source: FOIAVistA/trunk/r/BENEFICIARY_TRAVEL-DGBT/DGBTEE.m@ 1535

Last change on this file since 1535 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1DGBTEE ;ALB/SCK - BENEFICIARY TRAVEL ENTER/EDIT; 12/3/92@1600
2 ;;1.0;Beneficiary Travel;**2,14**;September 25, 2001;Build 7
3 Q
4SCREEN ;
5 D SCREEN^DGBTEE1 Q:DGBTTOUT=-1!(DGBTTOUT=1) Q:'$D(^DGBT(392,DGBTDT,0))
6 ; The following section of code moved to DGBTEE2 for space problems
7 D STUFF^DGBTEE2
8MILES ; get miles between dep. and dest. using function call to DGBTUTL
9 K X,DGBTREC S (DGBTOWRT,DGBTML,DGBTMLT)=""
10 I DGBTFR4]""&((DGBTACCT=4)!(DGBTACCT=5)) I $D(^DGBT(392.1,"ACS",DGBTFR4,+VAPA(5))) D
11 . S X=$O(^(+VAPA(5),0)) ; naked ref. refers to file #392.1, "ACS", city. Full reference on line MILES+2^DGBTEE, ^DGBTE(392.1,"ACS",DGBTFR4,+VAPA(5)
12 . ; function $$miles passes city's record# and div name to function, mileage value is returned
13 . I X'="" S DGBTREC=X,DGBTML=$$MILES^DGBTUTL(DGBTREC,DGBTDV1),DGBTOWRT="ROUND TRIP" K X
14 S (DGBTMAL,DGBTFAB,DGBTME,DGBTCP,DGBTFLAG,DGBTDCV,DGBTDE,DGBTDCM,DGBTDPV,DGBTDPM)=0
15DIE1 ; stuff from,to address, meals, ferry's/bridges
16 Q:'$D(^DGBT(392,DGBTDT,0))
17 S DIE="^DGBT(392,",DA=DGBTDT,DR=$S(DGBTACCT=4:"42//"_DGBTAP,DGBTACCT=5:"43;S DGBTCP=X;42//"_DGBTAP,1:"44")
18 D ^DIE I X=""!(X="^") S DGBTTOUT=-1 Q
19 S DR="21////^S X=DGBTFR1;22////^S X=DGBTFR2;23////^S X=DGBTFR3;24////^S X=DGBTFR4;25////^S X=DGBTTO1;26////^S X=DGBTTO2;27////^S X=DGBTTO3;28////^S X=DGBTTO4;34////^S X=DGBTMAL;35////^S X=DGBTFAB"
20 D ^DIE I X=""!(X="^") S DGBTTOUT=-1 Q
21 ; function $$diclkup passes the city's record #, div name, and a flag for remarks (4), remarks or a null are returned
22 I DGBTACCT=4!(DGBTACCT=5) D
23 . W !!,"Please wait, Checking Mileage ..."
24 . S DGBTRMK=$S($D(DGBTREC):$$DICLKUP^DGBTUTL(DGBTREC,DGBTDV1,4),1:"") I $D(DGBTDEF),DGBTDEF S DGBTRMK="DEFAULT MILEAGE USED"
25 . I DGBTRMK]"" W !,*7,"MILEAGE REMARKS: ",DGBTRMK,!
26EDIT ; display trip type, mileage
27 I DGBTACCT=4!(DGBTACCT=5) S DR="32//"_DGBTML_";S DGBTML=X;31//"_DGBTOWRT_";S DGBTOWRT=X;" D ^DIE I X=""!(X="^") S DGBTTOUT=-1 Q
28 S:DGBTACCT=5&(DGBTCP=1) DGBTMR=DGBTMR1 S DGBTMLT=DGBTOWRT*DGBTML*DGBTMR,DGBTMLT=$J(DGBTMLT,0,2),DR="33///"_DGBTMLT
29 D ^DIE I X=""!(X="^") S DGBTTOUT=-1 Q
30DIE2 ; stuff eligibility data, SC%, acct. type
31 S DIE("NO^")="12345" S:'$D(DGBTCD) DGBTCD=""
32 I 'DGBTCORE D
33 . S DR="3////"_DGBTELIG_";4////"_DGBTSCP_";5///"_DGBTCD_";6////"_DGBTACTN_";I DGBTACCT=4!(DGBTACCT=5) S Y=""@1"";41;7;@1;I DGBTMLFB=0 S Y=""@2"";34;S DGBTMAL=X;35;S DGBTFAB=X;@2"
34 I DGBTCORE D
35 . S DR(1,392,1)="3////"_DGBTELIG_";4////"_DGBTSCP_";5///"_DGBTCD_";6////"_DGBTACTN_";I DGBTACCT=4!(DGBTACCT=5) S Y=""@1"";41;"
36 . S DR(1,392,2)="@3;14;S DGBTCSL=$$AFTER^DGBTCSL(392,D0,X,$G(DGBTPRV)) S:DGBTCSL<1 Y=""@3"" W:DGBTCSL<1 "" Required"" K DGBTPRV,DGBTCSL;@1;I DGBTMLFB=0 S Y=""@2"";34;S DGBTMAL=X;35;S DGBTFAB=X;@2"
37DIE3 ; get most econ. cost
38 D ^DIE K DR I X=""!(X="^") S DGBTTOUT=-1 Q
39 ; function $$diclkup passes the city's record #, division name, and flag for MEC (3), the MEC is returned
40 S:$D(DGBTREC) DGBTME=$$DICLKUP^DGBTUTL(DGBTREC,DGBTDV1,3) S:DGBTME="" DGBTME=0 S DR="8//"_DGBTME_";S DGBTME=X"
41 D ^DIE I X=""!(X="^") S DGBTTOUT=-1 G EXIT
42TCOST ; calculate total cost and monthly cum. deductable
43MLFB ;
44 S DGBTMAF=$S(DGBTMLFB:DGBTMAL+DGBTFAB,1:0),DGBTMETC=DGBTME+$S($D(DGBTMAL):DGBTMAL,1:0)
45 I DGBTACCT'=4&(DGBTACCT'=5) S DGBTPA=DGBTMAF+DGBTME G CONT
46 I $D(DGBTMLT) S DGBTTC=$S(DGBTMLT+DGBTMAF'>DGBTMETC:DGBTMLT+DGBTMAF,DGBTMLT+DGBTMAF>DGBTMETC&(DGBTME>0):DGBTMETC,DGBTME'>0:DGBTMLT+DGBTMAF,1:DGBTMETC)
47 I DGBTACCT=5 S DGBTDE=0 S DGBTPA=$S((DGBTMLT+DGBTMAF)'=0:DGBTTC,1:DGBTMETC) G CONT
48 ; the following section of code moved to DGBTEE2 for space reasons
49 D DED^DGBTEE2
50DIE4 ; display deductable amount
51 D ^DIE I X=""!(X="^") S DGBTTOUT=-1 Q
52CONT ;
53 D CONT^DGBTCE1 Q
54EXIT ;
55 K DGBTDV1,DGBTRMK Q
Note: See TracBrowser for help on using the repository browser.