AGED7 ; IHS/ASDS/EFG - EDIT - PAGE 7 (PRIVATE INSURANCE) ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
VAR ;
I $D(DIRUT) G END
I AGOPT(5)'="Y" G END:$D(AGXTERN)!$D(DUOUT)!$D(DLOUT) G END
S AG("PG")=7,AG("LINE")="=" K AG("EDIT"),AG("ALPHORD")
L1 ;
I $D(AGSEENLY) S AGINSPTR=$P($P(AGINSREC,U,11),",",3) G L4DATA
I '$D(AGSEENLY)&($G(AGADDINS)="E") S AGINSPTR=$P($P(AGINSREC,U,11),",",3) G L3
L11 ;
L1A S AG("EDIT")="",AG("DFLT")="NO" D ADDCOV^AG7 Q ;agpatch set from PI Elig file fields
L3 W !
S:$G(AGINSPTR)="" AGINSPTR=$G(AGEL("IN"))
I $G(AGINSPTR)="" Q
S DIC=9000006.11,AG("TOTAL")=0,DA=DFN
ALPHORD ;
L4 ;
L4DATA ;
S AGELP("HRN")=$G(AGCHRT),AGELP("TYPE")="PI",AGELP("PDFN")=DFN
S AGELP("PH")=$S('$D(^AUPNPRVT(DFN,11,AGINSPTR,0)):"",1:$P(^(0),U,8)),AGELP("INS")=$S(AGELP("PH")]"":$P(^(0),U),1:"")
;Q:$G(AGELP("PH"))=""
I '$D(AGSEENLY),$D(AGELP("PH"))]"",$D(AGELP("INS"))]"" D DISP^AGEL Q:$G(Y)=AGOPT("ESCAPE") G VAR
I $D(AGSEENLY),(AGELP("PH")]""),(AGELP("INS")]"") D DISP^AGEL
Q:$G(Y)=AGOPT("ESCAPE")
G END:$D(AGSEENLY)
L4DATA1 ;
L4A ;
L5 ;
L6 ;
L7 ;
END I $D(DTOUT) S AGTOUT=""
K AG,AGI,AGY,DUOUT,DFOUT,DQOUT,DTOUT,DLOUT,DA,DIC,DIE,DR,DRENT
K AG("DRENT1"),AGL,AG("LKERR"),AG("LKPRINT"),Y
Q:$D(AGXTERN)
Q:$D(DIROUT)
K DIR
Q
UP Q:$D(AGXTERN)
Q
EDIT S DIE="^AUPNPRVT("_DFN_",11,"
S DA=AGINSPTR,DA(1)=DFN
W !
D ^DIE
Q
DATA W !,AG("N"),".",?22-$L(AG("L")),AG("L"),":"
D ^AGDICLK
Q:$D(AG("LKERR"))
W ?26,AG("LKPRINT")
Q
PRVTKILL ;
Q
AGED7 ; IHS/ASDS/EFG - EDIT - PAGE 7 (PRIVATE INSURANCE) ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
VAR ;
+1 IF $DATA(DIRUT)
GOTO END
+2 IF AGOPT(5)'="Y"
IF $DATA(AGXTERN)!$DATA(DUOUT)!$DATA(DLOUT)
GOTO END
GOTO END
+3 SET AG("PG")=7
SET AG("LINE")="="
KILL AG("EDIT"),AG("ALPHORD")
L1 ;
+1 IF $DATA(AGSEENLY)
SET AGINSPTR=$PIECE($PIECE(AGINSREC,U,11),",",3)
GOTO L4DATA
+2 IF '$DATA(AGSEENLY)&($GET(AGADDINS)="E")
SET AGINSPTR=$PIECE($PIECE(AGINSREC,U,11),",",3)
GOTO L3
L11 ;
L1A ;agpatch set from PI Elig file fields
SET AG("EDIT")=""
SET AG("DFLT")="NO"
DO ADDCOV^AG7
QUIT
L3 WRITE !
+1 IF $GET(AGINSPTR)=""
SET AGINSPTR=$GET(AGEL("IN"))
+2 IF $GET(AGINSPTR)=""
QUIT
+3 SET DIC=9000006.11
SET AG("TOTAL")=0
SET DA=DFN
ALPHORD ;
L4 ;
L4DATA ;
+1 SET AGELP("HRN")=$GET(AGCHRT)
SET AGELP("TYPE")="PI"
SET AGELP("PDFN")=DFN
+2 SET AGELP("PH")=$SELECT('$DATA(^AUPNPRVT(DFN,11,AGINSPTR,0)):"",1:$PIECE(^(0),U,8))
SET AGELP("INS")=$SELECT(AGELP("PH")]"":$PIECE(^(0),U),1:"")
+3 ;Q:$G(AGELP("PH"))=""
+4 IF '$DATA(AGSEENLY)
IF $DATA(AGELP("PH"))]""
IF $DATA(AGELP("INS"))]""
DO DISP^AGEL
IF $GET(Y)=AGOPT("ESCAPE")
QUIT
GOTO VAR
+5 IF $DATA(AGSEENLY)
IF (AGELP("PH")]"")
IF (AGELP("INS")]"")
DO DISP^AGEL
+6 IF $GET(Y)=AGOPT("ESCAPE")
QUIT
+7 IF $DATA(AGSEENLY)
GOTO END
L4DATA1 ;
L4A ;
L5 ;
L6 ;
L7 ;
END IF $DATA(DTOUT)
SET AGTOUT=""
+1 KILL AG,AGI,AGY,DUOUT,DFOUT,DQOUT,DTOUT,DLOUT,DA,DIC,DIE,DR,DRENT
+2 KILL AG("DRENT1"),AGL,AG("LKERR"),AG("LKPRINT"),Y
+3 IF $DATA(AGXTERN)
QUIT
+4 IF $DATA(DIROUT)
QUIT
+5 KILL DIR
+6 QUIT
UP IF $DATA(AGXTERN)
QUIT
+1 QUIT
EDIT SET DIE="^AUPNPRVT("_DFN_",11,"
+1 SET DA=AGINSPTR
SET DA(1)=DFN
+2 WRITE !
+3 DO ^DIE
+4 QUIT
DATA WRITE !,AG("N"),".",?22-$LENGTH(AG("L")),AG("L"),":"
+1 DO ^AGDICLK
+2 IF $DATA(AG("LKERR"))
QUIT
+3 WRITE ?26,AG("LKPRINT")
+4 QUIT
PRVTKILL ;
+1 QUIT