DGBTEE1 ;ALB/SCK - BENEFICIARY TRAVEL ENTER/EDIT CHECK; 12/7/92 3/19/93
;;5.3;Registration;**5,60,1015**;Aug 13, 1993;Build 21
Q
SCREEN ; called by dgbtee,dgbtce
Q:'$D(^DGBT(392,DGBTDT,0))
K DGBTVAR F I=0,"A","D","M","R","T" S DGBTVAR(I)=$S($D(^DGBT(392,DGBTDT,I)):^(I),1:"") ; ref file #392, claims
W @IOF S DGBTFLAG=0
I '$D(^DG(43,1,"BT"))!('$D(^DG(43.1,$O(^DG(43.1,(9999999.99999-DGBTDT))),"BT"))) W !!,"Module has not been properly initialized - to continue you should first complete",!,"the parameters" Q
W !?16,"Beneficiary Travel Claim Information <Enter/Edit>"
D PID^VADPT6
W !!?8,"Name: ",VADM(1),?40,"PT ID: ",VA("PID"),?64,"DOB: ",$P(VADM(3),"^",2),!
START ; ask date/time, and division
K DIC,^TMP("DGBT",$J),X
S DIE="^DGBT(392,",DIE("NO^")="OUTOK"
S DR=".01;S (DGBTDT,VADAT(""W""))=X D ^VADATE S DGBTDTI=VADATE(""I""),DGBTDTE=VADATE(""E"") K VADAT,VADATE I '$D(DGBTMD) S Y=""@1"";11;@1"
S DIDEL=392 ; allows users to delete BT claims
D ^DIE K DIE,DIDEL,DQ,DR I $D(DTOUT)!($D(Y)) S DGBTTOUT=-1 Q
K X
I '$D(^DGBT(392,DGBTDT,0)) Q
I $D(^DGBT(392,DGBTDT,0)) L ^DGBT(392,DGBTDT):2 I '$T W !?5,"Another user is editing this entry.",*7 S DGBTTOUT=1 G QUIT
; set rates and build eligibilities in DGBTEE2
D RATES^DGBTEE2
ELIG1 ; select eligibility from those available in TMP list
I '$O(VAEL(1,0)) S DGBTELIG=+VAEL(1) G ESET1
S DIR("A")="Select ELIGIBILITY",DIR("B")=$S($P(^DGBT(392,DGBTDT,0),"^",3):$P(^DIC(8,$P(^DGBT(392,DGBTDT,0),"^",3),0),"^"),VAEL(1):$P(VAEL(1),"^",2),1:"")
S DIR(0)="F",DIR("?")="^D ELIST^DGBTEE2"
D ^DIR K DIR I $D(DUOUT) W !?3,"SORRY, '^' NOT ALLOWED!!" G ELIG1
I $D(DTOUT) S DGBTTOUT=-1 Q
S:Y="" DGBTELIG=$S($P(^DGBT(392,DGBTDT,0),"^",3):$P(^(0),"^",3),1:+VAEL(1)) ; ref file #392, claims
I X["@" W !,"ELIGIBILITY REQUIRED." G ELIG1
I Y?1A.E F I=0:0 S I=$O(^TMP("DGBT",$J,I)) Q:'I I $E($P(^(I),"^",2),1,$L(X))=X S XX=Y,Y=I G ESET ; ref ^TMP file for eligibility
I +Y?1N.N S Y=+Y F I=0:0 S I=$O(^TMP("DGBT",$J,I)) Q:'I I +$P(^(I),"^")=Y S XX=Y,Y=I G ESET ; ref ^TMP file for eligibility
ECHOZ ;
W !!,"Choose by NUMBER the primary eligibility or other entitled eligibilities",!
I DGBTCT>1 F I=0:0 S I=$O(^TMP("DGBT",$J,I)) Q:'I W !?5,I,?10,$P(^TMP("DGBT",$J,I),"^",2)
K DIR,X S DIR("A")="Choose 1-"_DGBTCT,DIR(0)="NO^1:"_DGBTCT,DIR("?")="Enter choice from those displayed"
D ^DIR K DIR G:$D(DIRUT) ELIG1 S XX=Y
I '$D(^TMP("DGBT",$J,Y)) W " ?? ",!,"Select ELIGIBILITY: " G ECHOZ
ESET ;
S:$D(Y) DGBTELIG=$S($D(^TMP("DGBT",$J,Y)):+^TMP("DGBT",$J,Y),'$D(XX):Y,1:+VAEL(1))
W:Y]"" ?30,$E($P(^DIC(8,+DGBTELIG,0),"^"),$S($D(XX):($L(XX)+1),1:1),99)
ESET1 ;
S DGBTSCP=$S($P(^DIC(8,DGBTELIG,0),"^",9)=1&(+VAEL(3)):$P(VAEL(3),"^",2),$P(^DIC(8,DGBTELIG,0),"^",9)=3&(+VAEL(3)):$P(VAEL(3),"^",2),1:"")
CERT ; stuff of certification date if appropriate
; naked global ref file #392.2, certification file.
I $P(VAEL(3),"^") S DGBTCD="" I VAEL(3)&($P(VAEL(3),"^",2)'>29) S DGBTIDT=9999999.99999-DGBTDT F I=0:0 S I=$O(^DGBT(392.2,"C",DFN,I)) Q:'I I I'>DGBTIDT&($P(^DGBT(392.2,I,0),"^",3)) S DGBTCD=$P(^(0),"^")
ACCT ; allowed to select only valid active accounts
S DGBTOACT=$S('$D(^DGBT(392.3,+$P(DGBTVAR(0),"^",6),0)):0,1:+$P(^DGBT(392.3,$P(DGBTVAR(0),"^",6),0),"^",5))
K X S (DIC("B"),X)=$S(+$P(DGBTVAR(0),"^",6):$P(^DGBT(392.3,$P(DGBTVAR(0),"^",6),0),"^"),1:$$DEFLT1) S DIC("A")="Select ACCOUNT: "
S DIC="^DGBT(392.3,",DIC(0)="AEQMZ",DIC("S")="I $P(^(0),U,3)'>DGBTDT&('$P(^(0),U,4)!($P(^(0),U,4)'<DGBTDT))"
D ^DIC K DIC I $D(DTOUT) S DGBTTOUT=-1 K DTOUT Q
I Y'>0 W !,"ACCOUNT IS REQUIRED!!" G ACCT
S DGBTACTN=$P(Y,"^"),DGBTACCT=$P(Y(0),"^",5)
; if account is ALL OTHER - stuff in mileage info
I $D(DGBTVAR("M")) S DGBTML=$P(DGBTVAR("M"),"^",2),DGBTOWRT=$P(DGBTVAR("M"),"^"),DGBTMLT=DGBTML*DGBTOWRT*DGBTMR
QUIT ;
K A,C,I,IA,J,X,XX,^TMP("DGBT",$J),DGBTDIV,DGBTIDT,DGBTCT
Q
;
DEFLT1() ;
N REC,Y
S REC="0" F S REC=$O(^DGBT(392.3,REC)) Q:'REC D Q:$D(Y)
. S:$P(^DGBT(392.3,REC,0),U,5)=4&($P(^(0),U,3)'>DGBTDT&('$P(^(0),U,4)!($P(^(0),U,4)'<DGBTDT))) Y=$P(^(0),U,1)
Q $G(Y)
DGBTEE1 ;ALB/SCK - BENEFICIARY TRAVEL ENTER/EDIT CHECK; 12/7/92 3/19/93
+1 ;;5.3;Registration;**5,60,1015**;Aug 13, 1993;Build 21
+2 QUIT
SCREEN ; called by dgbtee,dgbtce
+1 IF '$DATA(^DGBT(392,DGBTDT,0))
QUIT
+2 ; ref file #392, claims
KILL DGBTVAR
FOR I=0,"A","D","M","R","T"
SET DGBTVAR(I)=$SELECT($DATA(^DGBT(392,DGBTDT,I)):^(I),1:"")
+3 WRITE @IOF
SET DGBTFLAG=0
+4 IF '$DATA(^DG(43,1,"BT"))!('$DATA(^DG(43.1,$ORDER(^DG(43.1,(9999999.99999-DGBTDT))),"BT")))
WRITE !!,"Module has not been properly initialized - to continue you should first complete",!,"the parameters"
QUIT
+5 WRITE !?16,"Beneficiary Travel Claim Information <Enter/Edit>"
+6 DO PID^VADPT6
+7 WRITE !!?8,"Name: ",VADM(1),?40,"PT ID: ",VA("PID"),?64,"DOB: ",$PIECE(VADM(3),"^",2),!
START ; ask date/time, and division
+1 KILL DIC,^TMP("DGBT",$JOB),X
+2 SET DIE="^DGBT(392,"
SET DIE("NO^")="OUTOK"
+3 SET DR=".01;S (DGBTDT,VADAT(""W""))=X D ^VADATE S DGBTDTI=VADATE(""I""),DGBTDTE=VADATE(""E"") K VADAT,VADATE I '$D(DGBTMD) S Y=""@1"";11;@1"
+4 ; allows users to delete BT claims
SET DIDEL=392
+5 DO ^DIE
KILL DIE,DIDEL,DQ,DR
IF $DATA(DTOUT)!($DATA(Y))
SET DGBTTOUT=-1
QUIT
+6 KILL X
+7 IF '$DATA(^DGBT(392,DGBTDT,0))
QUIT
+8 IF $DATA(^DGBT(392,DGBTDT,0))
LOCK ^DGBT(392,DGBTDT):2
IF '$TEST
WRITE !?5,"Another user is editing this entry.",*7
SET DGBTTOUT=1
GOTO QUIT
+9 ; set rates and build eligibilities in DGBTEE2
+10 DO RATES^DGBTEE2
ELIG1 ; select eligibility from those available in TMP list
+1 IF '$ORDER(VAEL(1,0))
SET DGBTELIG=+VAEL(1)
GOTO ESET1
+2 SET DIR("A")="Select ELIGIBILITY"
SET DIR("B")=$SELECT($PIECE(^DGBT(392,DGBTDT,0),"^",3):$PIECE(^DIC(8,$PIECE(^DGBT(392,DGBTDT,0),"^",3),0),"^"),VAEL(1):$PIECE(VAEL(1),"^",2),1:"")
+3 SET DIR(0)="F"
SET DIR("?")="^D ELIST^DGBTEE2"
+4 DO ^DIR
KILL DIR
IF $DATA(DUOUT)
WRITE !?3,"SORRY, '^' NOT ALLOWED!!"
GOTO ELIG1
+5 IF $DATA(DTOUT)
SET DGBTTOUT=-1
QUIT
+6 ; ref file #392, claims
IF Y=""
SET DGBTELIG=$SELECT($PIECE(^DGBT(392,DGBTDT,0),"^",3):$PIECE(^(0),"^",3),1:+VAEL(1))
+7 IF X["@"
WRITE !,"ELIGIBILITY REQUIRED."
GOTO ELIG1
+8 ; ref ^TMP file for eligibility
IF Y?1A.E
FOR I=0:0
SET I=$ORDER(^TMP("DGBT",$JOB,I))
IF 'I
QUIT
IF $EXTRACT($PIECE(^(I),"^",2),1,$LENGTH(X))=X
SET XX=Y
SET Y=I
GOTO ESET
+9 ; ref ^TMP file for eligibility
IF +Y?1N.N
SET Y=+Y
FOR I=0:0
SET I=$ORDER(^TMP("DGBT",$JOB,I))
IF 'I
QUIT
IF +$PIECE(^(I),"^")=Y
SET XX=Y
SET Y=I
GOTO ESET
ECHOZ ;
+1 WRITE !!,"Choose by NUMBER the primary eligibility or other entitled eligibilities",!
+2 IF DGBTCT>1
FOR I=0:0
SET I=$ORDER(^TMP("DGBT",$JOB,I))
IF 'I
QUIT
WRITE !?5,I,?10,$PIECE(^TMP("DGBT",$JOB,I),"^",2)
+3 KILL DIR,X
SET DIR("A")="Choose 1-"_DGBTCT
SET DIR(0)="NO^1:"_DGBTCT
SET DIR("?")="Enter choice from those displayed"
+4 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO ELIG1
SET XX=Y
+5 IF '$DATA(^TMP("DGBT",$JOB,Y))
WRITE " ?? ",!,"Select ELIGIBILITY: "
GOTO ECHOZ
ESET ;
+1 IF $DATA(Y)
SET DGBTELIG=$SELECT($DATA(^TMP("DGBT",$JOB,Y)):+^TMP("DGBT",$JOB,Y),'$DATA(XX):Y,1:+VAEL(1))
+2 IF Y]""
WRITE ?30,$EXTRACT($PIECE(^DIC(8,+DGBTELIG,0),"^"),$SELECT($DATA(XX):($LENGTH(XX)+1),1:1),99)
ESET1 ;
+1 SET DGBTSCP=$SELECT($PIECE(^DIC(8,DGBTELIG,0),"^",9)=1&(+VAEL(3)):$PIECE(VAEL(3),"^",2),$PIECE(^DIC(8,DGBTELIG,0),"^",9)=3&(+VAEL(3)):$PIECE(VAEL(3),"^",2),1:"")
CERT ; stuff of certification date if appropriate
+1 ; naked global ref file #392.2, certification file.
+2 IF $PIECE(VAEL(3),"^")
SET DGBTCD=""
IF VAEL(3)&($PIECE(VAEL(3),"^",2)'>29)
SET DGBTIDT=9999999.99999-DGBTDT
FOR I=0:0
SET I=$ORDER(^DGBT(392.2,"C",DFN,I))
IF 'I
QUIT
IF I'>DGBTIDT&($PIECE(^DGBT(392.2,I,0),"^",3))
SET DGBTCD=$PIECE(^(0),"^")
ACCT ; allowed to select only valid active accounts
+1 SET DGBTOACT=$SELECT('$DATA(^DGBT(392.3,+$PIECE(DGBTVAR(0),"^",6),0)):0,1:+$PIECE(^DGBT(392.3,$PIECE(DGBTVAR(0),"^",6),0),"^",5))
+2 KILL X
SET (DIC("B"),X)=$SELECT(+$PIECE(DGBTVAR(0),"^",6):$PIECE(^DGBT(392.3,$PIECE(DGBTVAR(0),"^",6),0),"^"),1:$$DEFLT1)
SET DIC("A")="Select ACCOUNT: "
+3 SET DIC="^DGBT(392.3,"
SET DIC(0)="AEQMZ"
SET DIC("S")="I $P(^(0),U,3)'>DGBTDT&('$P(^(0),U,4)!($P(^(0),U,4)'<DGBTDT))"
+4 DO ^DIC
KILL DIC
IF $DATA(DTOUT)
SET DGBTTOUT=-1
KILL DTOUT
QUIT
+5 IF Y'>0
WRITE !,"ACCOUNT IS REQUIRED!!"
GOTO ACCT
+6 SET DGBTACTN=$PIECE(Y,"^")
SET DGBTACCT=$PIECE(Y(0),"^",5)
+7 ; if account is ALL OTHER - stuff in mileage info
+8 IF $DATA(DGBTVAR("M"))
SET DGBTML=$PIECE(DGBTVAR("M"),"^",2)
SET DGBTOWRT=$PIECE(DGBTVAR("M"),"^")
SET DGBTMLT=DGBTML*DGBTOWRT*DGBTMR
QUIT ;
+1 KILL A,C,I,IA,J,X,XX,^TMP("DGBT",$JOB),DGBTDIV,DGBTIDT,DGBTCT
+2 QUIT
+3 ;
DEFLT1() ;
+1 NEW REC,Y
+2 SET REC="0"
FOR
SET REC=$ORDER(^DGBT(392.3,REC))
IF 'REC
QUIT
Begin DoDot:1
+3 IF $PIECE(^DGBT(392.3,REC,0),U,5)=4&($PIECE(^(0),U,3)'>DGBTDT&('$PIECE(^(0),U,4)!($PIECE(^(0),U,4)'<DGBTDT)))
SET Y=$PIECE(^(0),U,1)
End DoDot:1
IF $DATA(Y)
QUIT
+4 QUIT $GET(Y)