DGBTOA1 ;ALB/TT,ALB/MAC - BENEFICIARY TRAVEL OUTPUTS ;4/22/91 12:50
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
D QUIT D DT^DICRW,ASK2^SDDIV G QUIT:Y<0 S VAUTNI=1,(DGBTBEG,DGBTEND)=0
BEG W ! S %DT="AEX",%DT("A")="Enter beginning date: " D ^%DT S DGBTBG=Y,DGBTBEG=Y-.0001 G:X="^"!(X="") QUIT
END W ! S %DT("A")="Enter ending date: " D ^%DT G:X="^" QUIT I Y<1 D HELP^%DTC G END
S DGBTEND=Y_.9999
I DGBTEND\1<DGBTBG W !!?5,"The ending date cannot be before the beginning date" G END
D NOW^%DTC I DGBTEND-.9999>X!(DGBTBG>X) W !!?5,"Future dates are not allowed" G BEG
SORT W !! S DIR("A")="Sort output by: ",DIR("B")="PATIENT",DIR(0)="SA^P:PATIENT;C:CARRIER;A:ACCOUNT;T:ACCOUNT TYPE"
S DIR("?")="Select one from the above list",DIR("?",1)="Sort Bene Travel claims by one of the following:",DIR("?",2)=" A for Account",DIR("?",3)=" C for Carrier",DIR("?",4)=" P for Patient",DIR("?",5)=" T for Account Type"
D ^DIR K DIR I $D(DTOUT)!($D(DUOUT))!(Y="^")!(Y<0) G QUIT
S DGBTSL=$S(Y="A":"ACCT",Y="T":"TYP",Y="C":"CAR",1:"PAT") K Y D ACCT:DGBTSL="ACCT",TYP:DGBTSL="TYP",CAR:DGBTSL="CAR",PAT:DGBTSL="PAT" G:Y<0!(Y="^")!($D(DTOUT))!($D(DUOUT)) QUIT
DISP ;
S DIR("A",1)="",DIR("A")="Display Report (F)ULL or (T)OTALS ONLY: ",DIR("B")="FULL",DIR("?")="^D HELP^DGBTOA1",DIR(0)="SA^F:FULL;T:TOTALS"
D ^DIR K DIR G QUIT:$D(DIRUT)
S DGBTZ=$E(Y)
S DGVAR="VAUTN#^DGBTBEG^DGBTBG^DGBTEND^DGBTSL^DGBTZ^VAUTD#",DGPGM="START^DGBTOA2" W ! D ZIS^DGUTQ I 'POP U IO D START^DGBTOA2
QUIT K %,%DT,DFN,DGBT2,DGBT3,DGBT4,DGBTA,DGBTAT,DGBTB,DGBTBEG,DGBTBG,DGBTBY,DGBTC,DGBTCH,DGBTCL,DGBTCW,DGBTD,DGBTD1,DGBTDD,DGBTDN,DGBTDT,DGBTDV,DGBTEND,DGBTF,DGBTG,DGBTGT
K DGBTI,DGBTIX,DGBTK,DGBTK9,DGBTK10,DGBTNO,DGBTO,DGBTOD,DGBTODV,DGBTOTX,DGBTP,DGBTPG,DGBTPTC,DGBTS,DGBTSD
K DGBTSDT,DGBTSL,DGBTSSN,DGBTT,DGBTU,DGBTV,DGBTX,DGBTX1,DGBTXX,DGBTY,DGBTZ,DGPGM,DGSCR,DGVAR,DIC,DIR,DTOUT,DUOUT,K,K1,L1,M,POP,PRCABN,SSN,VA,VADAT,VADATE,VAERR,VAUTD
K VAUTN,VAUTNI,VAUTSTR,VAUTVB,X,X2,Y,Z,^UTILITY($J)
Q
;Selects the patient,account,carrier,account type (one,many,all).
PAT S VAUTNI=2 D PATIENT^VAUTOMA
Q
ACCT S VAUTVB="VAUTN",DIC="^DGBT(392.3,",VAUTSTR="account",VAUTNI=2,DIC("S")="I $P(^(0),U,3)'>DGBTEND&('$P(^(0),U,4)!($P(^(0),U,4)>DGBTBG))" D FIRST^VAUTOMA
Q
CAR S VAUTVB="VAUTN",PRCABN=0,DIC="^PRC(440,",VAUTSTR="carrier",VAUTNI=2 D FIRST^VAUTOMA
Q
TYP S DIR("A")="Would you like ALL Account Types",DIR(0)="Y",DIR("B")="NO",DIR("?")="Enter 'Yes' if you wish to include ALL Account Types or press Return to select individual Account Types."
D ^DIR K DIR Q:$D(DTOUT)!($D(DUOUT))
I Y=1 S VAUTN=1 Q
S DIR("A")="Select ACCOUNT TYPE",DIR(0)="392.3,5"
S DIR("?")="Enter the account type by which you would like to sort bene travel claims."
D ^DIR Q:$D(DTOUT)!($D(DUOUT))
S VAUTN=0,VAUTN(Y)="",DIR("A")="Select another ACCOUNT TYPE",$P(DIR(0),"^",1)=$P(DIR(0),"^",1)_"O"
TYPMNY D ^DIR Q:$D(DUOUT)!($D(DTOUT))
I X]"" S VAUTN(Y)="" D TYPMNY
K DIR Q
HELP W !!?10,"Choose either:",!?20,"F - To get FULL DISPLAY as well as TOTALS",!?20,"(Report contains Patient name, Date of claim, Patient ID, ",!?20,"Account, Carrier, Deductible, Amount payable)",!!?20,"T - To display TOTALS ONLY",!!
Q
DGBTOA1 ;ALB/TT,ALB/MAC - BENEFICIARY TRAVEL OUTPUTS ;4/22/91 12:50
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 DO QUIT
DO DT^DICRW
DO ASK2^SDDIV
IF Y<0
GOTO QUIT
SET VAUTNI=1
SET (DGBTBEG,DGBTEND)=0
BEG WRITE !
SET %DT="AEX"
SET %DT("A")="Enter beginning date: "
DO ^%DT
SET DGBTBG=Y
SET DGBTBEG=Y-.0001
IF X="^"!(X="")
GOTO QUIT
END WRITE !
SET %DT("A")="Enter ending date: "
DO ^%DT
IF X="^"
GOTO QUIT
IF Y<1
DO HELP^%DTC
GOTO END
+1 SET DGBTEND=Y_.9999
+2 IF DGBTEND\1<DGBTBG
WRITE !!?5,"The ending date cannot be before the beginning date"
GOTO END
+3 DO NOW^%DTC
IF DGBTEND-.9999>X!(DGBTBG>X)
WRITE !!?5,"Future dates are not allowed"
GOTO BEG
SORT WRITE !!
SET DIR("A")="Sort output by: "
SET DIR("B")="PATIENT"
SET DIR(0)="SA^P:PATIENT;C:CARRIER;A:ACCOUNT;T:ACCOUNT TYPE"
+1 SET DIR("?")="Select one from the above list"
SET DIR("?",1)="Sort Bene Travel claims by one of the following:"
SET DIR("?",2)=" A for Account"
SET DIR("?",3)=" C for Carrier"
SET DIR("?",4)=" P for Patient"
SET DIR("?",5)=" T for Account Type"
+2 DO ^DIR
KILL DIR
IF $DATA(DTOUT)!($DATA(DUOUT))!(Y="^")!(Y<0)
GOTO QUIT
+3 SET DGBTSL=$SELECT(Y="A":"ACCT",Y="T":"TYP",Y="C":"CAR",1:"PAT")
KILL Y
IF DGBTSL="ACCT"
DO ACCT
IF DGBTSL="TYP"
DO TYP
IF DGBTSL="CAR"
DO CAR
IF DGBTSL="PAT"
DO PAT
IF Y<0!(Y="^")!($DATA(DTOUT))!($DATA(DUOUT))
GOTO QUIT
DISP ;
+1 SET DIR("A",1)=""
SET DIR("A")="Display Report (F)ULL or (T)OTALS ONLY: "
SET DIR("B")="FULL"
SET DIR("?")="^D HELP^DGBTOA1"
SET DIR(0)="SA^F:FULL;T:TOTALS"
+2 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO QUIT
+3 SET DGBTZ=$EXTRACT(Y)
+4 SET DGVAR="VAUTN#^DGBTBEG^DGBTBG^DGBTEND^DGBTSL^DGBTZ^VAUTD#"
SET DGPGM="START^DGBTOA2"
WRITE !
DO ZIS^DGUTQ
IF 'POP
USE IO
DO START^DGBTOA2
QUIT KILL %,%DT,DFN,DGBT2,DGBT3,DGBT4,DGBTA,DGBTAT,DGBTB,DGBTBEG,DGBTBG,DGBTBY,DGBTC,DGBTCH,DGBTCL,DGBTCW,DGBTD,DGBTD1,DGBTDD,DGBTDN,DGBTDT,DGBTDV,DGBTEND,DGBTF,DGBTG,DGBTGT
+1 KILL DGBTI,DGBTIX,DGBTK,DGBTK9,DGBTK10,DGBTNO,DGBTO,DGBTOD,DGBTODV,DGBTOTX,DGBTP,DGBTPG,DGBTPTC,DGBTS,DGBTSD
+2 KILL DGBTSDT,DGBTSL,DGBTSSN,DGBTT,DGBTU,DGBTV,DGBTX,DGBTX1,DGBTXX,DGBTY,DGBTZ,DGPGM,DGSCR,DGVAR,DIC,DIR,DTOUT,DUOUT,K,K1,L1,M,POP,PRCABN,SSN,VA,VADAT,VADATE,VAERR,VAUTD
+3 KILL VAUTN,VAUTNI,VAUTSTR,VAUTVB,X,X2,Y,Z,^UTILITY($JOB)
+4 QUIT
+5 ;Selects the patient,account,carrier,account type (one,many,all).
PAT SET VAUTNI=2
DO PATIENT^VAUTOMA
+1 QUIT
ACCT SET VAUTVB="VAUTN"
SET DIC="^DGBT(392.3,"
SET VAUTSTR="account"
SET VAUTNI=2
SET DIC("S")="I $P(^(0),U,3)'>DGBTEND&('$P(^(0),U,4)!($P(^(0),U,4)>DGBTBG))"
DO FIRST^VAUTOMA
+1 QUIT
CAR SET VAUTVB="VAUTN"
SET PRCABN=0
SET DIC="^PRC(440,"
SET VAUTSTR="carrier"
SET VAUTNI=2
DO FIRST^VAUTOMA
+1 QUIT
TYP SET DIR("A")="Would you like ALL Account Types"
SET DIR(0)="Y"
SET DIR("B")="NO"
SET DIR("?")="Enter 'Yes' if you wish to include ALL Account Types or press Return to select individual Account Types."
+1 DO ^DIR
KILL DIR
IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+2 IF Y=1
SET VAUTN=1
QUIT
+3 SET DIR("A")="Select ACCOUNT TYPE"
SET DIR(0)="392.3,5"
+4 SET DIR("?")="Enter the account type by which you would like to sort bene travel claims."
+5 DO ^DIR
IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+6 SET VAUTN=0
SET VAUTN(Y)=""
SET DIR("A")="Select another ACCOUNT TYPE"
SET $PIECE(DIR(0),"^",1)=$PIECE(DIR(0),"^",1)_"O"
TYPMNY DO ^DIR
IF $DATA(DUOUT)!($DATA(DTOUT))
QUIT
+1 IF X]""
SET VAUTN(Y)=""
DO TYPMNY
+2 KILL DIR
QUIT
HELP WRITE !!?10,"Choose either:",!?20,"F - To get FULL DISPLAY as well as TOTALS",!?20,"(Report contains Patient name, Date of claim, Patient ID, ",!?20,"Account, Carrier, Deductible, Amount payable)",!!?20,"T - To display TOTALS ONLY",!!
+1 QUIT