DGBT2 ;ALB/LM - BENEFICIARY TRAVEL SCREEN 2 ;5/24/91 09:19
;;5.3;Registration;**151,1015**;Aug 13, 1993;Build 21
Q
SCREEN ;
W @IOF
W !?18,"Beneficiary Travel Claim Information <Screen 2>"
D PID^VADPT6 W !!?8,"Name: ",VADM(1),?42,"PT ID: ",VA("PID"),?64,"DOB: ",$P(VADM(3),"^",2)
D PAST,ADM
W !!?2,"Visits For: " W $P(DGBTDTE,"@")
S DGBTAS="" S:DGBTAD DGBTAS=$S($P(DGBTDD,".")=$P(DGBTDTI,"."):"D",$P(DGBTAD,".")=$P(DGBTDTI,"."):"A",$P(DGBTAD,".")&'$P(DGBTDD,"."):"I",$P(DGBTAD,".")&($P(DGBTDTI,".")'>$P(DGBTDD,".")):"II",1:"")
I DGBTAS]"" W $S(DGBTAS="A":" * * * * ADMITTED ON THIS DATE * * * *",DGBTAS="D":" * * * * DISCHARGED ON THIS DATE * * * *",DGBTAS="I":" * * * * CURRENTLY AN INPATIENT * * * *",DGBTAS="II":" * * * INPATIENT STATUS * * *",1:"")
I DGBTAS]"" W !!," Admitted On: " S Y=+DGBTAD X ^DD("DD") W Y K Y W:$D(^DPT(DFN,.1)) ?40,"Ward Location: ",^DPT(DFN,.1) I DGBTDD W ?40,"Discharge Date: " S Y=+DGBTDD X ^DD("DD") W Y K Y
W !!,"Appointments: " W:'$D(DGBTCL) "NONE RECORDED FOR THIS DATE" I $D(DGBTCL) F I=0:0 S I=$O(DGBTCL(I)) Q:'I D APPT
N DGVAL,DGCBK,DGDT1
;
S DGVAL("DFN")=DFN,DGVAL("BDT")=DGBTDTI\1,DGVAL("EDT")=DGVAL("BDT")_".9999"
S DGCBK="I $P(SDOE0,U,8)=2 D WRTVIS^DGBT2(SDOE0) S DGDT1=+SDOE0",DGDT1=""
D SCAN^DGSDU("PATIENT/DATE",.DGVAL,"",DGCBK,1,.DGQUERY)
EXIT ;
K VAIP
Q
;
WRTVIS(DGBTCSN) ;
S:$S('DGDT1:0,1:+SDOE0'=DGDT1) SDSTOP=1
I '$G(DGDT1) W !!?45,"Elig for Visit:",?65,"Appt Type:",!?45,"______________",?65,"_________",!!,"Clinic Stop: "
I 'SDSTOP D
.N DGBTCS
.S:$P(DGBTCSN,U,3) DGBTCS=$P(DGBTCSN,U,3)
.W ?14,$E($S($D(^DIC(40.7,+$P($G(DGBTCSN),U,3),0)):$P(^(0),U),1:"Unknown"),1,20),?45,$S($D(^DIC(8,+$P(DGBTCSN,U,13),0)):$E($P(^(0),U),1,18),1:"")
.D STOP
Q
;
ADM S DGBTAN=$S($D(^DPT(DFN,.105)):^(.105),1:"")
I 'DGBTAN D NOW^%DTC S DGBTDI=+$O(^DGPM("ATID3",DFN,9999999.9999999-%)),DGBTDN=+$O(^(DGBTDI,0)),DGBTAN=$S($D(^DGPM(DGBTDN,0)):$P(^(0),"^",14),1:"")
S DGBTAD=$S($D(^DGPM(+DGBTAN,0)):^(0),1:""),DGBTDD=$S($D(^DGPM(+$P(DGBTAD,"^",17),0)):^(0),1:"")
K %,DGBTDI,DGBTDN Q
STOP I $D(DGBTCS) W ?65,$E($S($D(^SD(409.1,+$P(DGBTCSN,"^",10),0)):$P(^(0),"^"),1:"REGULAR"),1,15),!
Q
APPT I $D(DGBTCL) S DGBTCN=+$P(DGBTCL(I),"^") W ?14,$S($D(^SC(DGBTCN,0)):$P(^(0),"^"),1:"Unknown") S Y=I X ^DD("DD") W " (",Y,") "
I $D(DGBTCL) D
.S X=$P(DGBTCL(I),"^",2)
.W ?50,$S(X["NT":"NO ACTION TAKEN",X["N":"NO-SHOW",X["C":"CANCELLED",1:""),?66,$P("C&P^10-10^SCHED.^UNSCHED.","^",+$P(DGBTCL(I),"^",7)),?73,$S($D(^SD(409.1,+$P(DGBTCL(I),"^",16),0)):$E($P(^(0),"^"),1,7),1:"REGULAR"),!
Q
PAST W:'$O(^DGBT(392,"AI",DFN,9999999.99999-DGBTDTI)) !!,"Past Claims: NONE RECORDED" I $O(^DGBT(392,"AI",DFN,9999999.99999-DGBTDTI)) W !!?14,"Date/Time",?35,"Account",?55,"Deductible",?69,"Amt. Paid",!!,"Past Claims: "
S J=0 F DGBTP=9999999.99999-DGBTDTI:0 S DGBTP=$O(^DGBT(392,"AI",DFN,DGBTP)) Q:'DGBTP S DGBTPDT=^DGBT(392,"AI",DFN,DGBTP),VADAT("W")=DGBTPDT D ^VADATE W ?14,VADATE("E") D ACCT S J=J+1 Q:J=5
Q
ACCT W ?35,$S($P(^DGBT(392,DGBTPDT,0),"^",6):$E($P(^DGBT(392.3,$P(^(0),"^",6),0),"^"),1,15),1:"") D AMT
Q
AMT S X=$P(^DGBT(392,DGBTPDT,0),"^",9),X2="2$" D COMMA^%DTC W ?54,X S X=$P(^(0),"^",10) D COMMA^%DTC W ?67,X,! K VADAT,VADATE,X,X2
Q
DGBT2 ;ALB/LM - BENEFICIARY TRAVEL SCREEN 2 ;5/24/91 09:19
+1 ;;5.3;Registration;**151,1015**;Aug 13, 1993;Build 21
+2 QUIT
SCREEN ;
+1 WRITE @IOF
+2 WRITE !?18,"Beneficiary Travel Claim Information <Screen 2>"
+3 DO PID^VADPT6
WRITE !!?8,"Name: ",VADM(1),?42,"PT ID: ",VA("PID"),?64,"DOB: ",$PIECE(VADM(3),"^",2)
+4 DO PAST
DO ADM
+5 WRITE !!?2,"Visits For: "
WRITE $PIECE(DGBTDTE,"@")
+6 SET DGBTAS=""
IF DGBTAD
SET DGBTAS=$SELECT($PIECE(DGBTDD,".")=$PIECE(DGBTDTI,"."):"D",$PIECE(DGBTAD,".")=$PIECE(DGBTDTI,"."):"A",$PIECE(DGBTAD,".")&'$PIECE(DGBTDD,"."):"I",$PIECE(DGBTAD,".")&($PIECE(DGBTDTI,".")'>$PIECE(DGBTDD,".")):"II",1:"")
+7 IF DGBTAS]""
WRITE $SELECT(DGBTAS="A":" * * * * ADMITTED ON THIS DATE * * * *",DGBTAS="D":" * * * * DISCHARGED ON THIS DATE * * * *",DGBTAS="I":" * * * * CURRENTLY AN INPATIENT * * * *",DGBTAS="II":" * * * INPATIENT STATUS * * *",1:"")
+8 IF DGBTAS]""
WRITE !!," Admitted On: "
SET Y=+DGBTAD
XECUTE ^DD("DD")
WRITE Y
KILL Y
IF $DATA(^DPT(DFN,.1))
WRITE ?40,"Ward Location: ",^DPT(DFN,.1)
IF DGBTDD
WRITE ?40,"Discharge Date: "
SET Y=+DGBTDD
XECUTE ^DD("DD")
WRITE Y
KILL Y
+9 WRITE !!,"Appointments: "
IF '$DATA(DGBTCL)
WRITE "NONE RECORDED FOR THIS DATE"
IF $DATA(DGBTCL)
FOR I=0:0
SET I=$ORDER(DGBTCL(I))
IF 'I
QUIT
DO APPT
+10 NEW DGVAL,DGCBK,DGDT1
+11 ;
+12 SET DGVAL("DFN")=DFN
SET DGVAL("BDT")=DGBTDTI\1
SET DGVAL("EDT")=DGVAL("BDT")_".9999"
+13 SET DGCBK="I $P(SDOE0,U,8)=2 D WRTVIS^DGBT2(SDOE0) S DGDT1=+SDOE0"
SET DGDT1=""
+14 DO SCAN^DGSDU("PATIENT/DATE",.DGVAL,"",DGCBK,1,.DGQUERY)
EXIT ;
+1 KILL VAIP
+2 QUIT
+3 ;
WRTVIS(DGBTCSN) ;
+1 IF $SELECT('DGDT1
SET SDSTOP=1
+2 IF '$GET(DGDT1)
WRITE !!?45,"Elig for Visit:",?65,"Appt Type:",!?45,"______________",?65,"_________",!!,"Clinic Stop: "
+3 IF 'SDSTOP
Begin DoDot:1
+4 NEW DGBTCS
+5 IF $PIECE(DGBTCSN,U,3)
SET DGBTCS=$PIECE(DGBTCSN,U,3)
+6 WRITE ?14,$EXTRACT($SELECT($DATA(^DIC(40.7,+$PIECE($GET(DGBTCSN),U,3),0)):$PIECE(^(0),U),1:"Unknown"),1,20),?45,$SELECT($DATA(^DIC(8,+$PIECE(DGBTCSN,U,13),0)):$EXTRACT($PIECE(^(0),U),1,18),1:"")
+7 DO STOP
End DoDot:1
+8 QUIT
+9 ;
ADM SET DGBTAN=$SELECT($DATA(^DPT(DFN,.105)):^(.105),1:"")
+1 IF 'DGBTAN
DO NOW^%DTC
SET DGBTDI=+$ORDER(^DGPM("ATID3",DFN,9999999.9999999-%))
SET DGBTDN=+$ORDER(^(DGBTDI,0))
SET DGBTAN=$SELECT($DATA(^DGPM(DGBTDN,0)):$PIECE(^(0),"^",14),1:"")
+2 SET DGBTAD=$SELECT($DATA(^DGPM(+DGBTAN,0)):^(0),1:"")
SET DGBTDD=$SELECT($DATA(^DGPM(+$PIECE(DGBTAD,"^",17),0)):^(0),1:"")
+3 KILL %,DGBTDI,DGBTDN
QUIT
STOP IF $DATA(DGBTCS)
WRITE ?65,$EXTRACT($SELECT($DATA(^SD(409.1,+$PIECE(DGBTCSN,"^",10),0)):$PIECE(^(0),"^"),1:"REGULAR"),1,15),!
+1 QUIT
APPT IF $DATA(DGBTCL)
SET DGBTCN=+$PIECE(DGBTCL(I),"^")
WRITE ?14,$SELECT($DATA(^SC(DGBTCN,0)):$PIECE(^(0),"^"),1:"Unknown")
SET Y=I
XECUTE ^DD("DD")
WRITE " (",Y,") "
+1 IF $DATA(DGBTCL)
Begin DoDot:1
+2 SET X=$PIECE(DGBTCL(I),"^",2)
+3 WRITE ?50,$SELECT(X["NT":"NO ACTION TAKEN",X["N":"NO-SHOW",X["C":"CANCELLED",1:""),?66,$PIECE("C&P^10-10^SCHED.^UNSCHED.","^",+$PIECE(DGBTCL(I),"^",7)),?73,$SELECT($DATA(^SD(409.1,+$PIECE(DGBTCL(I),"^",16),0)):$EXTRACT($PIECE(^(0),"^"),
1,7),1:"REGULAR"),!
End DoDot:1
+4 QUIT
PAST IF '$ORDER(^DGBT(392,"AI",DFN,9999999.99999-DGBTDTI))
WRITE !!,"Past Claims: NONE RECORDED"
IF $ORDER(^DGBT(392,"AI",DFN,9999999.99999-DGBTDTI))
WRITE !!?14,"Date/Time",?35,"Account",?55,"Deductible",?69,"Amt. Paid",!!,"Past Claims: "
+1 SET J=0
FOR DGBTP=9999999.99999-DGBTDTI:0
SET DGBTP=$ORDER(^DGBT(392,"AI",DFN,DGBTP))
IF 'DGBTP
QUIT
SET DGBTPDT=^DGBT(392,"AI",DFN,DGBTP)
SET VADAT("W")=DGBTPDT
DO ^VADATE
WRITE ?14,VADATE("E")
DO ACCT
SET J=J+1
IF J=5
QUIT
+2 QUIT
ACCT WRITE ?35,$SELECT($PIECE(^DGBT(392,DGBTPDT,0),"^",6):$EXTRACT($PIECE(^DGBT(392.3,$PIECE(^(0),"^",6),0),"^"),1,15),1:"")
DO AMT
+1 QUIT
AMT SET X=$PIECE(^DGBT(392,DGBTPDT,0),"^",9)
SET X2="2$"
DO COMMA^%DTC
WRITE ?54,X
SET X=$PIECE(^(0),"^",10)
DO COMMA^%DTC
WRITE ?67,X,!
KILL VADAT,VADATE,X,X2
+1 QUIT