AGEL0 ; IHS/ASDS/EFG - Add/Edit Eligibility Information ;
;;7.1;PATIENT REGISTRATION;**1,2,12**;AUG 25, 2005;Build 1
;IHS/OIT/NKD AG*7.1*12 INSURER TYPE
;
DISP ;EP - DISP FLDS
;Q:'$D(AGELP("PH"))!(DFN="")
Q:'$D(AGELP("PH"))!($G(DFN)="") ;IHS/SD/TPF AG*7.1*1 9/6/2005
D ^AGELA ;DISP FLDS
I $D(AGSEENLY) D ^DIR,READ^AGED1 G XIT
ACTION ;
D OPT^AGEL0A
G XIT:$G(AGELP("PH"))=""
;AFTER EDITING THE SELECTION MUST BE UPDATED SO ANY ERRORS
;CORRECTED WILL BE REFLECTED ON THE REDRAWN SCREEN
S:$G(AGSELECT)'="" AGSELECT=$$FINDPVT^AGINSUPD(AGSELECT)
I ($D(MYERRS("C","E"))&(Y'?1N.N))&(Y'=AGOPT("ESCAPE")),(Y'["V"),(Y'["E"),(Y'["A"),(Y'["D") W !,"ERRORS ON THIS PAGE. PLEASE FIX BEFORE EXITING!!" H 3 G DISP
Q:$G(Y)=AGOPT("ESCAPE")
G XIT:$D(DIROUT)!(Y="N")!$D(DUOUT)!$D(DTOUT) G DISP:Y["V"
I Y="A",$P(^AUPN3PPH(AGELP("PH"),0),U,5)]"",$D(^AUTTPIC($P(^(0),U,5),0)),$P(^(0),U,4)="S" W !!?5,*7,"The COVERAGE TYPE for this Policy is for SELF ONLY, thus no members"
I W !?5,"may be added! Change the Coverage Type if it is incorrect!" H 5 G DISP
;I Y="A" S TEMPDFN=DFN S AGEL("LBL")=$S($P(^AUTNINS(AGELP("INS"),2),U)="D":"D14^AGEL2",1:"V14^AGEL3") D @AGEL("LBL") S (AUPNPAT,DFN)=TEMPDFN G DISP
I Y="A" S TEMPDFN=DFN S AGEL("LBL")=$S($$INSTYP^AGUTL(AGELP("INS"))="D":"D14^AGEL2",1:"V14^AGEL3") D @AGEL("LBL") S (AUPNPAT,DFN)=TEMPDFN G DISP ;IHS/OIT/NKD AG*7.1*12
I Y="D" D DEL^AGEL0A G XIT:'$D(AGELP("PH")),DISP
EDIT ;Entry of Claim Identifiers
S AGELP("MODE")="E" ;IF THIS TAG ENTERED THEN WE ARE IN EDIT MODE
D FLDS^AGEL0A
G XIT:$D(DTOUT)!$D(DIROUT)!$D(DUOUT)!$D(DTOUT)
W !!
EDLOOP ;EP - LOOP ASKING FOR FIELD INPUT
;THIS LOOP ENTERS WITH DA SET TO THE POLICY HOLDER PTR
S DR="" F AGEL("I")=1:1 S AGEL=$P(AGELP("FLDS"),",",AGEL("I")) Q:AGEL=""!$D(DUOUT)!$D(DTOUT) D
.S AGEL("TYP")="H"
.I AGEL=1 D ^AGELPHCK Q
.I AGEL=5 D PHSEX^AGEL4 Q
.I AGEL=6 D PHDOB^AGEL4 Q
.I AGEL=7 D PCP^AGEL4 Q
.I AGEL=8 D ESTAT^AGEL4 Q
.I AGEL=9 D EMP^AGEL4 Q
.I AGEL=10 D GRP^AGEL4 Q
.I AGEL=11 D COV^AGEL4 Q
.I AGEL=12 D CARDCOPY^AGEL4 Q
.I AGEL>7&(AGEL<10) D
..S AGEL("TYP")=$S($P(^AUPN3PPH(AGELP("PH"),0),U,2)]"":"P",1:"H")
.I '$D(AGELP("PHPAT")),$P(^AUPN3PPH(AGELP("PH"),0),U,2)]"" S AGELP("PHPAT")=$P(^(0),U,2)
.I AGEL>9,AGEL<11,AGELP("TYPE")="MCD" Q
.E K DIE("NO^")
.I AGEL=8 D
..S AGEL("TYP")=$S($P(^AUPN3PPH(AGELP("PH"),0),U,2)]"":"S",1:"H")
.I AGEL=9 S AGEL("D")=AGEL("TYP")_14_"^AGEL4" D @AGEL("D") Q
.I AGEL>12 D
..;S AGEL("TYP")=$S($P(^AUTNINS(AGELP("INS"),2),U)="D":"D",1:"V")
..S AGEL("TYP")=$S($$INSTYP^AGUTL(AGELP("INS"))="D":"D",1:"V") ;IHS/OIT/NKD AG*7.1*12
..S AGEL("D")=AGEL("TYP")_14_"^AGEL5" D @AGEL("D") Q
.S AGEL("T")=AGEL
.S DR=$P($T(@(AGEL("TYP")_AGEL("T"))),";;",2)
.S DIE=$S(AGEL("TYP")="H":"^AUPN3PPH(",AGEL("TYP")="P":"^DPT(",AGEL("TYP")="D":"^AUPNMCD(",AGEL("TYP")="S":"^AUPNPAT(",1:"^AUPNPRVT(")
.S DA=$S(AGEL("TYP")="H":$G(AGELP("PH")),AGEL("TYP")="D":$G(AGELP("MCD")),AGEL("TYP")="V":$G(AGELP("PI")),1:$G(AGELP("PHPAT")))
.;IF THE USER CHOOSES 2 OR 3 THIS SHOULD BE THE PRIVATE INSURANCE FILE NOT POLICY HOLDER FILE
.I AGEL=2!(AGEL=3) S DIE("NO^")=""
.;I AGEL=3!(AGEL=4) D Q
.;.M TEMPDR=DR,TEMPDIE=DIE,TEMPDIC=DIC
.;.K DIR,DR,DIE,DIC
.;.I AGEL=3 S DIE("NO^")=""
.;.S DR=$S(AGEL=3:".06R",1:".07")
.;.S PRVTIEN=$P(AGINSREC,U,11)
.;.S DA(1)=$P(PRVTIEN,",")
.;.S DA=$P(PRVTIEN,",",3)
.;.S DIE="^AUPNPRVT("_DA(1)_",11,"
.;.D ^DIE
.;.K DIR,DR,DIE,DIC
.;.M DR=TEMPDR K TEMPDR
.;.M DIC=TEMPDIC K TEMPDIC
.;.M DIE=TEMPDIE K TEMPDIE
.Q:$G(DA)=""
.D ^DIE
K %DT
Q:AGELP("MODE")="A"
;AFTER EDITING THE SELECTION MUST BE UPDATED SO ANY ERRORS
;CORRECTED WILL BE REFLECTED ON THE REDRAWN SCREEN
S:$G(AGSELECT)'="" AGSELECT=$$FINDPVT^AGINSUPD(AGSELECT)
D UPDT^AGEL5
G DISP
H1 ;;.01R~[1] Name on Policy..:
H2 ;;.04R~[2] Policy or SSN...:
H3 ;;.17R~[3] Effective Date..:
H4 ;;.18[4] Expiration Date.:
H11 ;;.08R~[11] Sex of Insured..:
P11 ;;W !,"** Patient Registraion Data (SEX) is Uneditable **"
H12 ;;.19[12] DOB of Insured..:
P12 ;;W !,"** Patient Registraion Data (DOB) is Uneditable **"
H9 ;;W !;W "<--------------INSURED'S ADDRESS-------------->";.09[9a] Street...: ;I X="" S Y="@9";.11[9b] City.....: ;.12[9c] State....: ;.13[9d] Zip......: ;W !;@9
P9 ;;W !;W "<--------------INSURED'S ADDRESS-------------->";.111[9a] Street...: ;I X="" S Y="@9";.114[9b] City.....: ;.115[9c] State....: ;.116[9d] Zip......: ;W !;@9
H10 ;;.14[10] Phone.....:
P10 ;;.131[10] Phone.....:
H13 ;;.15[13] Empl Stat.:
S13 ;;.21[13] Empl Stat.:
;
XIT Q
AGEL0 ; IHS/ASDS/EFG - Add/Edit Eligibility Information ;
+1 ;;7.1;PATIENT REGISTRATION;**1,2,12**;AUG 25, 2005;Build 1
+2 ;IHS/OIT/NKD AG*7.1*12 INSURER TYPE
+3 ;
DISP ;EP - DISP FLDS
+1 ;Q:'$D(AGELP("PH"))!(DFN="")
+2 ;IHS/SD/TPF AG*7.1*1 9/6/2005
IF '$DATA(AGELP("PH"))!($GET(DFN)="")
QUIT
+3 ;DISP FLDS
DO ^AGELA
+4 IF $DATA(AGSEENLY)
DO ^DIR
DO READ^AGED1
GOTO XIT
ACTION ;
+1 DO OPT^AGEL0A
+2 IF $GET(AGELP("PH"))=""
GOTO XIT
+3 ;AFTER EDITING THE SELECTION MUST BE UPDATED SO ANY ERRORS
+4 ;CORRECTED WILL BE REFLECTED ON THE REDRAWN SCREEN
+5 IF $GET(AGSELECT)'=""
SET AGSELECT=$$FINDPVT^AGINSUPD(AGSELECT)
+6 IF ($DATA(MYERRS("C","E"))&(Y'?1N.N))&(Y'=AGOPT("ESCAPE"))
IF (Y'["V")
IF (Y'["E")
IF (Y'["A")
IF (Y'["D")
WRITE !,"ERRORS ON THIS PAGE. PLEASE FIX BEFORE EXITING!!"
HANG 3
GOTO DISP
+7 IF $GET(Y)=AGOPT("ESCAPE")
QUIT
+8 IF $DATA(DIROUT)!(Y="N")!$DATA(DUOUT)!$DATA(DTOUT)
GOTO XIT
IF Y["V"
GOTO DISP
+9 IF Y="A"
IF $PIECE(^AUPN3PPH(AGELP("PH"),0),U,5)]""
IF $DATA(^AUTTPIC($PIECE(^(0),U,5),0))
IF $PIECE(^(0),U,4)="S"
WRITE !!?5,*7,"The COVERAGE TYPE for this Policy is for SELF ONLY, thus no members"
+10 IF $TEST
WRITE !?5,"may be added! Change the Coverage Type if it is incorrect!"
HANG 5
GOTO DISP
+11 ;I Y="A" S TEMPDFN=DFN S AGEL("LBL")=$S($P(^AUTNINS(AGELP("INS"),2),U)="D":"D14^AGEL2",1:"V14^AGEL3") D @AGEL("LBL") S (AUPNPAT,DFN)=TEMPDFN G DISP
+12 ;IHS/OIT/NKD AG*7.1*12
IF Y="A"
SET TEMPDFN=DFN
SET AGEL("LBL")=$SELECT($$INSTYP^AGUTL(AGELP("INS"))="D":"D14^AGEL2",1:"V14^AGEL3")
DO @AGEL("LBL")
SET (AUPNPAT,DFN)=TEMPDFN
GOTO DISP
+13 IF Y="D"
DO DEL^AGEL0A
IF '$DATA(AGELP("PH"))
GOTO XIT
GOTO DISP
EDIT ;Entry of Claim Identifiers
+1 ;IF THIS TAG ENTERED THEN WE ARE IN EDIT MODE
SET AGELP("MODE")="E"
+2 DO FLDS^AGEL0A
+3 IF $DATA(DTOUT)!$DATA(DIROUT)!$DATA(DUOUT)!$DATA(DTOUT)
GOTO XIT
+4 WRITE !!
EDLOOP ;EP - LOOP ASKING FOR FIELD INPUT
+1 ;THIS LOOP ENTERS WITH DA SET TO THE POLICY HOLDER PTR
+2 SET DR=""
FOR AGEL("I")=1:1
SET AGEL=$PIECE(AGELP("FLDS"),",",AGEL("I"))
IF AGEL=""!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
Begin DoDot:1
+3 SET AGEL("TYP")="H"
+4 IF AGEL=1
DO ^AGELPHCK
QUIT
+5 IF AGEL=5
DO PHSEX^AGEL4
QUIT
+6 IF AGEL=6
DO PHDOB^AGEL4
QUIT
+7 IF AGEL=7
DO PCP^AGEL4
QUIT
+8 IF AGEL=8
DO ESTAT^AGEL4
QUIT
+9 IF AGEL=9
DO EMP^AGEL4
QUIT
+10 IF AGEL=10
DO GRP^AGEL4
QUIT
+11 IF AGEL=11
DO COV^AGEL4
QUIT
+12 IF AGEL=12
DO CARDCOPY^AGEL4
QUIT
+13 IF AGEL>7&(AGEL<10)
Begin DoDot:2
+14 SET AGEL("TYP")=$SELECT($PIECE(^AUPN3PPH(AGELP("PH"),0),U,2)]"":"P",1:"H")
End DoDot:2
+15 IF '$DATA(AGELP("PHPAT"))
IF $PIECE(^AUPN3PPH(AGELP("PH"),0),U,2)]""
SET AGELP("PHPAT")=$PIECE(^(0),U,2)
+16 IF AGEL>9
IF AGEL<11
IF AGELP("TYPE")="MCD"
QUIT
+17 IF '$TEST
KILL DIE("NO^")
+18 IF AGEL=8
Begin DoDot:2
+19 SET AGEL("TYP")=$SELECT($PIECE(^AUPN3PPH(AGELP("PH"),0),U,2)]"":"S",1:"H")
End DoDot:2
+20 IF AGEL=9
SET AGEL("D")=AGEL("TYP")_14_"^AGEL4"
DO @AGEL("D")
QUIT
+21 IF AGEL>12
Begin DoDot:2
+22 ;S AGEL("TYP")=$S($P(^AUTNINS(AGELP("INS"),2),U)="D":"D",1:"V")
+23 ;IHS/OIT/NKD AG*7.1*12
SET AGEL("TYP")=$SELECT($$INSTYP^AGUTL(AGELP("INS"))="D":"D",1:"V")
+24 SET AGEL("D")=AGEL("TYP")_14_"^AGEL5"
DO @AGEL("D")
QUIT
End DoDot:2
+25 SET AGEL("T")=AGEL
+26 SET DR=$PIECE($TEXT(@(AGEL("TYP")_AGEL("T"))),";;",2)
+27 SET DIE=$SELECT(AGEL("TYP")="H":"^AUPN3PPH(",AGEL("TYP")="P":"^DPT(",AGEL("TYP")="D":"^AUPNMCD(",AGEL("TYP")="S":"^AUPNPAT(",1:"^AUPNPRVT(")
+28 SET DA=$SELECT(AGEL("TYP")="H":$GET(AGELP("PH")),AGEL("TYP")="D":$GET(AGELP("MCD")),AGEL("TYP")="V":$GET(AGELP("PI")),1:$GET(AGELP("PHPAT")))
+29 ;IF THE USER CHOOSES 2 OR 3 THIS SHOULD BE THE PRIVATE INSURANCE FILE NOT POLICY HOLDER FILE
+30 IF AGEL=2!(AGEL=3)
SET DIE("NO^")=""
+31 ;I AGEL=3!(AGEL=4) D Q
+32 ;.M TEMPDR=DR,TEMPDIE=DIE,TEMPDIC=DIC
+33 ;.K DIR,DR,DIE,DIC
+34 ;.I AGEL=3 S DIE("NO^")=""
+35 ;.S DR=$S(AGEL=3:".06R",1:".07")
+36 ;.S PRVTIEN=$P(AGINSREC,U,11)
+37 ;.S DA(1)=$P(PRVTIEN,",")
+38 ;.S DA=$P(PRVTIEN,",",3)
+39 ;.S DIE="^AUPNPRVT("_DA(1)_",11,"
+40 ;.D ^DIE
+41 ;.K DIR,DR,DIE,DIC
+42 ;.M DR=TEMPDR K TEMPDR
+43 ;.M DIC=TEMPDIC K TEMPDIC
+44 ;.M DIE=TEMPDIE K TEMPDIE
+45 IF $GET(DA)=""
QUIT
+46 DO ^DIE
End DoDot:1
+47 KILL %DT
+48 IF AGELP("MODE")="A"
QUIT
+49 ;AFTER EDITING THE SELECTION MUST BE UPDATED SO ANY ERRORS
+50 ;CORRECTED WILL BE REFLECTED ON THE REDRAWN SCREEN
+51 IF $GET(AGSELECT)'=""
SET AGSELECT=$$FINDPVT^AGINSUPD(AGSELECT)
+52 DO UPDT^AGEL5
+53 GOTO DISP
H1 ;;.01R~[1] Name on Policy..:
H2 ;;.04R~[2] Policy or SSN...:
H3 ;;.17R~[3] Effective Date..:
H4 ;;.18[4] Expiration Date.:
H11 ;;.08R~[11] Sex of Insured..:
P11 ;;W !,"** Patient Registraion Data (SEX) is Uneditable **"
H12 ;;.19[12] DOB of Insured..:
P12 ;;W !,"** Patient Registraion Data (DOB) is Uneditable **"
H9 ;;W !;W "<--------------INSURED'S ADDRESS-------------->";.09[9a] Street...: ;I X="" S Y="@9";.11[9b] City.....: ;.12[9c] State....: ;.13[9d] Zip......: ;W !;@9
P9 ;;W !;W "<--------------INSURED'S ADDRESS-------------->";.111[9a] Street...: ;I X="" S Y="@9";.114[9b] City.....: ;.115[9c] State....: ;.116[9d] Zip......: ;W !;@9
H10 ;;.14[10] Phone.....:
P10 ;;.131[10] Phone.....:
H13 ;;.15[13] Empl Stat.:
S13 ;;.21[13] Empl Stat.:
+1 ;
XIT QUIT