DGBTR ;ALB/LM - BENEFICIARY TRAVEL RE-PRINT; 1/30/89@8:00 ;4/26/91 14:32
;;1.0;Beneficiary Travel;**20**;September 25, 2001;Build 185
;
Q
DISPLAY ;display the selected claim
N DGBTCMTY,NOLINE
D QUIT^DGBTEND
S DGBTR=1 D ASK I $G(DFN)="" D QUIT Q
I '$D(DGBTDT) D QUIT
S DGBTCMTY=$$GET1^DIQ(392,DGBTDT,56)
D CLMTYP(.DGBTCMTY)
I $G(DGBTCMTY)="S" S NOLINE=0 K DGBTSP D SCREEN^DGBTCDSP D QUIT,DISPLAY Q
I '$D(DGBTDT) D QUIT Q
I '$D(^DGBT(392,DGBTDT,0)) D QUIT Q
S VADAT("W")=DGBTDT
D ^VADATE
S DGBTDTE=VADATE("E"),IOP=""
D ^%ZIS
D SCREEN^DGBTCD
D QUIT
D DISPLAY Q
;
REPRINT ;
N DGBTDLTR
S DGBTR=0 D ASK
I '$D(DGBTDT) D QUIT Q
S DGBTDLTR=$$GET1^DIQ(392,DGBTDT,45.2,"I")
I DGBTDLTR=1 W !!,"CLAIM WAS DENIED. NO VOUCHER FOR THIS CLAIM",!! D QUIT D REPRINT Q
I '$D(^DGBT(392,DGBTDT,0)) D QUIT Q
I '$D(MONTOT) N MONTOT D
.N TOTRIPS,ONEWAY,RT,MONTHDED,WAIVER,WTYPE,TTRIPS,TDED,DGBTDTI,RDVMSG,DGBTRET,DGBTRDV,TFIEN
.S DGBTDTI=DGBTA
.D MONTOT^DGBT1(.TOTRIPS,.ONEWAY,.RT,.MONTHDED,.WAIVER,.WTYPE,.TTRIPS,.TDED)
D START^DGBTCR
D QUIT Q
;
ASK ;
S DIC="^DPT(",DIC(0)="AEQMZ" D ^DIC
I Y<1 D QUIT Q
S DFN=+Y
I '$D(^DGBT(392,"C",DFN)) W !!,"There are no computer entries on file for this patient.",! D ASK Q
D 6^VADPT
K ^UTILITY($J,"DGBT")
W:'DGBTR !!,"Only claims with ACCOUNT TYPE of ALL OTHER or C&P are listed as choices.",! D LIST Q
Q
;
LIST ;list the patients claim by newest claim first
;
N DGBTDCLM
S X="",(DGBTC,DGBTCH)=0
F I=0:0 S I=$O(^DGBT(392,"AI",DFN,I)) Q:'I S J=^(I) I $S(DGBTR:1,$D(^DGBT(392,"ACTP",4,J)):1,$D(^DGBT(392,"ACTP",5,J)):1,1:0) S DGBTC=DGBTC+1,^UTILITY($J,"DGBT",DGBTC,I)=9999999.99999-I
I '$D(^UTILITY($J,"DGBT"))!'$D(^DGBT(392,"C",DFN)) W !,"There are no computer entries on file for this patient with these account types.",! D ASK Q
I $D(^UTILITY($J,"DGBT")) W !,"Select Claim DATE/TIME: ",!
;F I=0:0 S I=$O(^UTILITY($J,"DGBT",I)) Q:'I!(DGBTCH)!(X["^") D I K#5=0 D CHOZ G QUIT:$D(DTOUT) Q:DGBTCH
F I=0:0 S I=$O(^UTILITY($J,"DGBT",I)) D CHOZLAST Q:'I!(DGBTCH)!(X["^") D G QUIT:$D(DTOUT)!($D(DUOUT)) Q:DGBTCH
.F J=0:0 S J=$O(^UTILITY($J,"DGBT",I,J)) Q:'J Q:DGBTCH D
..S K=I,VADAT("W")=^(J)
..D ^VADATE S DGBTDCLM=$$GET1^DIQ(392,VADAT("W"),45,"I")
..W !?5,I,".",?10,VADATE("E")_$S($G(DGBTDCLM)'="":" (D)",1:"") D:K#5=0 CHOZ Q:DGBTCH I $D(DTOUT)!($D(DUOUT)) Q ;D QUIT Q
I DGBTCH S DGBTA=$O(^UTILITY($J,"DGBT",X,0)),DGBTA=^UTILITY($J,"DGBT",X,DGBTA) S (DGBTDT,VADAT("W"))=DGBTA D ^VADATE S DGBTDCLM=$$GET1^DIQ(392,VADAT("W"),45,"I") W " ",VADATE("E")_$S($G(DGBTDCLM)'="":" (D)",1:"")
I 'DGBTCH D ASK
Q
;
CHOZ ;
Q:DGBTCH
I K'=DGBTC S DIR("A",1)="",DIR("A",2)="Type '^' to Stop, or" S DIR("?")="^D HELP^DGBTR"
S DIR("A")="Choose 1-"_$S(K=1:"",1:K)_": ",DIR(0)="NOA^1:"_K D ^DIR K DIR S:$D(DTOUT) DTOUT=1 I Y,$D(^UTILITY($J,"DGBT",Y)) S DGBTCH=1 Q
Q
CHOZLAST ;
Q:I
Q:DGBTCH
D CHOZ
Q
QUIT K DIC,DTOUT,X,VA,VADAT,VADATE,DGBTDT,DFN,VAEL,VADM,VAPA,DFN,DGBTA,DGBTC,DGBTCH,DGBTDTE,DGBTR,I,J,K,Y,DGBTFCTY,DGBTMR,DGBTTCTY,VAERR,DGBTCNU,DGBTVAR
K DEDUCT,DTOTAL,ONEWAY,RTRIP,MDATA,PDATA,DGVAR,DGPGM,DGBTACCT,CDAT,EMONTH,EDATE
Q
;
HELP W !!,"ANSWER WITH NUMERIC CHOICE. BECAUSE ENTRIES ARE STORED BY DATE.TIME.SECONDS,",!,"YOU MUST ENTER A NUMERIC CHOICE."
Q
;
CLMTYP(DGBTCMTY) ;this will return the claim type from ^DGBT(392,IEN,0) field #56. If equal null then mileage claim, if equal "S", special mode claim
S DGBTCMTY=$$GET1^DIQ(392,DGBTDT,56,"I")
S DGBTCMTY=$S($G(DGBTCMTY)="S":DGBTCMTY,1:"M")
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGBTR 3570 printed Dec 13, 2024@01:40:56 Page 2
DGBTR ;ALB/LM - BENEFICIARY TRAVEL RE-PRINT; 1/30/89@8:00 ;4/26/91 14:32
+1 ;;1.0;Beneficiary Travel;**20**;September 25, 2001;Build 185
+2 ;
+3 QUIT
DISPLAY ;display the selected claim
+1 NEW DGBTCMTY,NOLINE
+2 DO QUIT^DGBTEND
+3 SET DGBTR=1
DO ASK
IF $GET(DFN)=""
DO QUIT
QUIT
+4 IF '$DATA(DGBTDT)
DO QUIT
+5 SET DGBTCMTY=$$GET1^DIQ(392,DGBTDT,56)
+6 DO CLMTYP(.DGBTCMTY)
+7 IF $GET(DGBTCMTY)="S"
SET NOLINE=0
KILL DGBTSP
DO SCREEN^DGBTCDSP
DO QUIT
DO DISPLAY
QUIT
+8 IF '$DATA(DGBTDT)
DO QUIT
QUIT
+9 IF '$DATA(^DGBT(392,DGBTDT,0))
DO QUIT
QUIT
+10 SET VADAT("W")=DGBTDT
+11 DO ^VADATE
+12 SET DGBTDTE=VADATE("E")
SET IOP=""
+13 DO ^%ZIS
+14 DO SCREEN^DGBTCD
+15 DO QUIT
+16 DO DISPLAY
QUIT
+17 ;
REPRINT ;
+1 NEW DGBTDLTR
+2 SET DGBTR=0
DO ASK
+3 IF '$DATA(DGBTDT)
DO QUIT
QUIT
+4 SET DGBTDLTR=$$GET1^DIQ(392,DGBTDT,45.2,"I")
+5 IF DGBTDLTR=1
WRITE !!,"CLAIM WAS DENIED. NO VOUCHER FOR THIS CLAIM",!!
DO QUIT
DO REPRINT
QUIT
+6 IF '$DATA(^DGBT(392,DGBTDT,0))
DO QUIT
QUIT
+7 IF '$DATA(MONTOT)
NEW MONTOT
Begin DoDot:1
+8 NEW TOTRIPS,ONEWAY,RT,MONTHDED,WAIVER,WTYPE,TTRIPS,TDED,DGBTDTI,RDVMSG,DGBTRET,DGBTRDV,TFIEN
+9 SET DGBTDTI=DGBTA
+10 DO MONTOT^DGBT1(.TOTRIPS,.ONEWAY,.RT,.MONTHDED,.WAIVER,.WTYPE,.TTRIPS,.TDED)
End DoDot:1
+11 DO START^DGBTCR
+12 DO QUIT
QUIT
+13 ;
ASK ;
+1 SET DIC="^DPT("
SET DIC(0)="AEQMZ"
DO ^DIC
+2 IF Y<1
DO QUIT
QUIT
+3 SET DFN=+Y
+4 IF '$DATA(^DGBT(392,"C",DFN))
WRITE !!,"There are no computer entries on file for this patient.",!
DO ASK
QUIT
+5 DO 6^VADPT
+6 KILL ^UTILITY($JOB,"DGBT")
+7 if 'DGBTR
WRITE !!,"Only claims with ACCOUNT TYPE of ALL OTHER or C&P are listed as choices.",!
DO LIST
QUIT
+8 QUIT
+9 ;
LIST ;list the patients claim by newest claim first
+1 ;
+2 NEW DGBTDCLM
+3 SET X=""
SET (DGBTC,DGBTCH)=0
+4 FOR I=0:0
SET I=$ORDER(^DGBT(392,"AI",DFN,I))
if 'I
QUIT
SET J=^(I)
IF $SELECT(DGBTR:1,$DATA(^DGBT(392,"ACTP",4,J)):1,$DATA(^DGBT(392,"ACTP",5,J)):1,1:0)
SET DGBTC=DGBTC+1
SET ^UTILITY($JOB,"DGBT",DGBTC,I)=9999999.99999-I
+5 IF '$DATA(^UTILITY($JOB,"DGBT"))!'$DATA(^DGBT(392,"C",DFN))
WRITE !,"There are no computer entries on file for this patient with these account types.",!
DO ASK
QUIT
+6 IF $DATA(^UTILITY($JOB,"DGBT"))
WRITE !,"Select Claim DATE/TIME: ",!
+7 ;F I=0:0 S I=$O(^UTILITY($J,"DGBT",I)) Q:'I!(DGBTCH)!(X["^") D I K#5=0 D CHOZ G QUIT:$D(DTOUT) Q:DGBTCH
+8 FOR I=0:0
SET I=$ORDER(^UTILITY($JOB,"DGBT",I))
DO CHOZLAST
if 'I!(DGBTCH)!(X["^")
QUIT
Begin DoDot:1
+9 FOR J=0:0
SET J=$ORDER(^UTILITY($JOB,"DGBT",I,J))
if 'J
QUIT
if DGBTCH
QUIT
Begin DoDot:2
+10 SET K=I
SET VADAT("W")=^(J)
+11 DO ^VADATE
SET DGBTDCLM=$$GET1^DIQ(392,VADAT("W"),45,"I")
+12 ;D QUIT Q
WRITE !?5,I,".",?10,VADATE("E")_$SELECT($GET(DGBTDCLM)'="":" (D)",1:"")
if K#5=0
DO CHOZ
if DGBTCH
QUIT
IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
End DoDot:2
End DoDot:1
if $DATA(DTOUT)!($DATA(DUOUT))
GOTO QUIT
if DGBTCH
QUIT
+13 IF DGBTCH
SET DGBTA=$ORDER(^UTILITY($JOB,"DGBT",X,0))
SET DGBTA=^UTILITY($JOB,"DGBT",X,DGBTA)
SET (DGBTDT,VADAT("W"))=DGBTA
DO ^VADATE
SET DGBTDCLM=$$GET1^DIQ(392,VADAT("W"),45,"I")
WRITE " ",VADATE("E")_$SELECT($GET(DGBTDCLM)'="":" (D)",1:"")
+14 IF 'DGBTCH
DO ASK
+15 QUIT
+16 ;
CHOZ ;
+1 if DGBTCH
QUIT
+2 IF K'=DGBTC
SET DIR("A",1)=""
SET DIR("A",2)="Type '^' to Stop, or"
SET DIR("?")="^D HELP^DGBTR"
+3 SET DIR("A")="Choose 1-"_$SELECT(K=1:"",1:K)_": "
SET DIR(0)="NOA^1:"_K
DO ^DIR
KILL DIR
if $DATA(DTOUT)
SET DTOUT=1
IF Y
IF $DATA(^UTILITY($JOB,"DGBT",Y))
SET DGBTCH=1
QUIT
+4 QUIT
CHOZLAST ;
+1 if I
QUIT
+2 if DGBTCH
QUIT
+3 DO CHOZ
+4 QUIT
QUIT KILL DIC,DTOUT,X,VA,VADAT,VADATE,DGBTDT,DFN,VAEL,VADM,VAPA,DFN,DGBTA,DGBTC,DGBTCH,DGBTDTE,DGBTR,I,J,K,Y,DGBTFCTY,DGBTMR,DGBTTCTY,VAERR,DGBTCNU,DGBTVAR
+1 KILL DEDUCT,DTOTAL,ONEWAY,RTRIP,MDATA,PDATA,DGVAR,DGPGM,DGBTACCT,CDAT,EMONTH,EDATE
+2 QUIT
+3 ;
HELP WRITE !!,"ANSWER WITH NUMERIC CHOICE. BECAUSE ENTRIES ARE STORED BY DATE.TIME.SECONDS,",!,"YOU MUST ENTER A NUMERIC CHOICE."
+1 QUIT
+2 ;
CLMTYP(DGBTCMTY) ;this will return the claim type from ^DGBT(392,IEN,0) field #56. If equal null then mileage claim, if equal "S", special mode claim
+1 SET DGBTCMTY=$$GET1^DIQ(392,DGBTDT,56,"I")
+2 SET DGBTCMTY=$SELECT($GET(DGBTCMTY)="S":DGBTCMTY,1:"M")
+3 QUIT
+4 ;