Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: EASEZF5

EASEZF5.m

Go to the documentation of this file.
EASEZF5 ;ALB/jap - Filing 1010EZ Data to Patient Database ;10/31/00  13:07
 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**51**;Mar 15, 2001
 ;
IBINS(EASAPP,EASDFN) ;setup for call to IB API
 ;
 N DATANM,X,IBDATA,OK,PARTA,PARTB,LSTNM,FRSTNM
 ;file Medicare data
 K IBDATA
 S DATANM="MEDICARE PART A EFFECTIVE DATE" S PARTA=$$GET(DATANM)
 S IBDATA("M","PART A")=PARTA
 S DATANM="MEDICARE PART B EFFECTIVE DATE" S PARTB=$$GET(DATANM)
 S IBDATA("M","PART B")=PARTB
 I (PARTA'="")!(PARTB'="") D
 .S IBDATA("M","DFN")=EASDFN
 .S IBDATA("M","SOURCE")=1
 .S DATANM="MEDICARE CLAIM NUMBER" S X=$$GET(DATANM)
 .S IBDATA("M","HICN")=X
 .S DATANM="SIGNEE ON MEDICARE CARD" S X=$$GET(DATANM)
 .S IBDATA("M","NAME")=X
 .S OK=$$BUFF^IBCNBES1(.IBDATA)
 ;
 ;applicant health insurance
 K IBDATA
 S DATANM="APPLICANT INSURANCE COMPANY" S X=$$GET(DATANM)
 I X'="" D
 .S IBDATA(1,20.01)=X
 .S DATANM="APPLICANT INSURANCE GROUP CODE" S X=$$GET(DATANM)
 .S IBDATA(1,40.03)=X
 .S DATANM="APPLICANT INSURANCE POLICY HOLDER" S X=$$GET(DATANM)
 .S IBDATA(1,60.07)=X
 .S IBDATA(1,60.05)=$$INSREL(IBDATA(1,60.07))
 .S X=IBDATA(1,60.05) S IBDATA(1,60.06)=$S(X="v":"01",X="s":"02",1:"09")
 .S DATANM="APPLICANT INSURANCE POLICY NUMBER" S X=$$GET(DATANM)
 .S IBDATA(1,60.04)=X
 .S DATANM="APPLICANT INSURANCE ADDRESS" S X=$$GET(DATANM)
 .S IBDATA(1,21.01)=X
 .S DATANM="APPLICANT INSURANCE CITY" S X=$$GET(DATANM)
 .S IBDATA(1,21.04)=X
 .S DATANM="APPLICANT INSURANCE STATE" S X=$$GET(DATANM)
 .S IBDATA(1,21.05)=X
 .S DATANM="APPLICANT INSURANCE ZIP" S X=$$GET(DATANM)
 .S IBDATA(1,21.06)=X
 .S X=$$INSPH^EASEZT2(EASAPP,"APPLICANT",1)
 .S IBDATA(1,20.02)=X
 .S IBDATA(1,.03)=1
 .S IBDATA(1,60.01)=EASDFN
 .S OK=$$BUFF^IBCNBES1(.IBDATA)
 ;applicant additional health insurance
 K IBDATA
 F MM=1:1 S DATANM="OTHER(N) INSURANCE COMPANY" S X=$$GET(DATANM,MM) Q:(X="")  D
 .S IBDATA(1,20.01)=X
 .S DATANM="OTHER(N) INSURANCE GROUP CODE" S X=$$GET(DATANM,MM)
 .S IBDATA(1,40.03)=X
 .S DATANM="OTHER(N) INSURANCE POLICY HOLDER" S X=$$GET(DATANM,MM)
 .S IBDATA(1,60.07)=X
 .S IBDATA(1,60.05)=$$INSREL(IBDATA(1,60.07))
 .S X=IBDATA(1,60.05) S IBDATA(1,60.06)=$S(X="v":"01",X="s":"02",1:"09")
 .S DATANM="OTHER(N) INSURANCE POLICY NUMBER" S X=$$GET(DATANM,MM)
 .S IBDATA(1,60.04)=X
 .S DATANM="OTHER(N) INSURANCE ADDRESS" S X=$$GET(DATANM,MM)
 .S IBDATA(1,21.01)=X
 .S DATANM="OTHER(N) INSURANCE CITY" S X=$$GET(DATANM,MM)
 .S IBDATA(1,21.04)=X
 .S DATANM="OTHER(N) INSURANCE STATE" S X=$$GET(DATANM,MM)
 .S IBDATA(1,21.05)=X
 .S DATANM="OTHER(N) INSURANCE ZIP" S X=$$GET(DATANM,MM)
 .S IBDATA(1,21.06)=X
 .S X=$$INSPH^EASEZT2(EASAPP,"OTHER(N)",MM)
 .S IBDATA(1,20.02)=X
 .S IBDATA(1,.03)=1
 .S IBDATA(1,60.01)=EASDFN
 .S OK=$$BUFF^IBCNBES1(.IBDATA)
 ;
 ;spouse health insurance
 ;retain for backward compatibility
 K IBDATA
 S DATANM="SPOUSE INSURANCE COMPANY" S X=$$GET(DATANM)
 I X'="" D
 .S IBDATA(2,20.01)=X
 .S DATANM="SPOUSE INSURANCE GROUP CODE" S X=$$GET(DATANM)
 .S IBDATA(2,40.03)=X
 .S DATANM="SPOUSE INSURANCE POLICY HOLDER" S X=$$GET(DATANM)
 .S IBDATA(2,60.07)=X
 .S DATANM="SPOUSE INSURANCE POLICY NUMBER" S X=$$GET(DATANM)
 .S IBDATA(2,60.04)=X
 .S IBDATA(2,60.05)="s"
 .S IBDATA(2,.03)=1
 .S IBDATA(2,60.06)="02"
 .S IBDATA(2,60.01)=EASDFN
 .S OK=$$BUFF^IBCNBES1(.IBDATA)
 ;
 ;update field #.3192 in file #2 for Reg. screen 5
 S X=$P($G(^DPT(EASDFN,.31)),U,11) I ((X="")!(X="U")) S $P(^DPT(EASDFN,.31),U,11)="N"
 Q
 ;
GET(DATANM,MM) ;get 1010EZ data as needed by IB
 ;
 N KEY,XDATA
 I '$G(MM) S MM=1
 S KEY=+$$KEY711^EASEZU1(DATANM)
 S XDATA=$P($$DATA712^EASEZU1(EASAPP,KEY,MM),U,1)
 I DATANM["DATE",XDATA'="" D
 .S X=XDATA D ^%DT S XDATA=$P(Y,".",1)
 S XDATA=$$UC^EASEZT1(XDATA)
 Q XDATA
 ;
INSREL(INSNM) ;
 N FRSTNM,LSTNM
 I INSNM="" Q ""
 S DATANM="APPLICANT LAST NAME" S LSTNM=$$GET(DATANM)
 S DATANM="APPLICANT FIRST NAME" S FRSTNM=$$GET(DATANM)
 I INSNM[LSTNM,INSNM[FRSTNM Q "v"
 S DATANM="SPOUSE LAST NAME" S LSTNM=$$GET(DATANM)
 S DATANM="SPOUSE FIRST NAME" S FRSTNM=$$GET(DATANM)
 I INSNM[LSTNM,INSNM[FRSTNM Q "s"
 Q "o"