source: WorldVistAEHR/trunk/r/BENEFICIARY_TRAVEL-DGBT/DGBTOA4.m

Last change on this file was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1DGBTOA4 ;ALB/MAC - BENEFICIARY OUTPUTS HEADER ROUTINE ;2/21/91 15:57
2 ;;1.0;Beneficiary Travel;**7**;September 25, 2001
3 ;Adds up totals
4DTC K X,X2 I DGBTSL="PAT" S:DGBTZ="T" DGBTSSN=SSN I DGBTSL="PAT" S DGBTOD=$S(DGBTZ="F":^UTILITY($J,2,DGBTDD,DGBTX1,DGBTSSN,"T"),1:^UTILITY($J,2,DGBTDN,DGBTX,DGBTSSN,"T"))
5 I DGBTSL'="PAT" S DGBTOD=$S(DGBTZ="F":^UTILITY($J,2,DGBTDD,DGBTX1,"T"),1:^UTILITY($J,2,DGBTDN,DGBTX,"T"))
6 W ! I DGBTZ="T" W DGBTX,?32
7 I DGBTZ="F" W:DGBTSL'="PAT" !?35,"TOTAL",?45 W:DGBTSL="PAT" !?32,"TOTAL",?38
8 S:DGBTZ="F" X2="2$" S X=$P(DGBTOD,"^",2) S DGBTSDT=DGBTSDT+X D CM W X W:DGBTZ="T" ?46 I DGBTZ="F" W:DGBTSL="PAT" ?52 W:DGBTSL'="PAT" ?57
9 S:DGBTZ="F" X2="2$" S X=$P(DGBTOD,"^",1) S DGBTAT=DGBTAT+X D CM W X
10 I DGBTZ="T" S X=$P(DGBTOD,"^",1)+$P(DGBTOD,"^",2) S DGBTGT=DGBTGT+X D CM W ?60,X W:DGBTSL'="PAT" ?76,$J(DGBTOTX(DGBTDN,DGBTX1),4) S DGBTGT(DGBTDV)=DGBTAT_"^"_DGBTSDT Q
11 S DGBTGT(DGBTODV)=DGBTAT_"^"_DGBTSDT Q
12 ;Prints page headings
13HE S DGBTPG=DGBTPG+1
14 W @IOF W:'DGBT4 !?3,"DIVISION: ",$S(DGBTDV="ZNOT SPECIFIED":"NOT SPECIFIED",DGBTD1:DGBTODV,1:DGBTDV) W ?50,DGBTDT," PAGE ",DGBTPG
15 S X="BENEFICIARY TRAVEL OUTPUT "_"BY "_$S(DGBTSL="CAR":"CARRIER",DGBTSL="ACCT":"ACCOUNT",DGBTSL="TYP":"ACCOUNT TYPE",1:"PATIENT")
16 W !?(40-($L(X)/2)),X I DGBTZ="T" W !?32,"DIVISION TOTALS"
17 S DGBTBG=DGBTBEG+.0001,DGBTT=$S(DGBTBG=(DGBTEND\1):"FOR ",1:"FROM "),VADAT("W")=DGBTBG D ^VADATE S DGBTT=DGBTT_$P(VADATE("E"),"@",1) I DGBTEND\1'=DGBTBG S VADAT("W")=DGBTEND\1 D ^VADATE S DGBTT=DGBTT_" TO "_$P(VADATE("E"),"@",1)
18 S DGBTY=40-($L(DGBTT)/2) W !?DGBTY,DGBTT,!
19 W ! I DGBTSL="PAT" W:DGBTZ="F" ?7,"DATE",?25,"ACCOUNT",?43
20 I DGBTSL'="PAT" W:DGBTZ="F" ?7,"NAME",?22,"PT ID",?35,"DATE",?50
21 I DGBTZ="T" W:DGBT4 ?5 W:'DGBT4 ?10 W $S(DGBT4:"DIVISION NAME",DGBTSL="PAT":"NAME",DGBTSL="CAR":"CARRIER",1:"ACCOUNT")
22 I DGBTZ="F" W "$DEDUC" W:DGBTSL="PAT" ?55 W:DGBTSL'="PAT" ?60 W "$PAYABLE" W:DGBTZ="F" ?70,$S(DGBTSL="CAR":"ACCOUNT",1:"CARRIER") W !,DGBTCL,! Q
23 W ?37,"$DEDUC",?49,"$PAYABLE",?65,"$TOTAL" W:DGBTSL'="PAT" ?75,"# PAT" W !,DGBTCL Q
24RT Q:$Y=0 Q:IOST'?1"C-".E F X=$Y:1:(IOSL-2) W !
25 S DIR("A",1)="",DIR("A")="Enter <RET> to continue or ^ to QUIT ",DIR(0)="FO" D ^DIR K DIR S:$D(DUOUT)!($D(DTOUT)) DGBTU=1 Q:DGBTU W:DGBTZ="T" @IOF Q
26RP I $Y+6>IOSL D RT:(IOST?1"C-".E) Q:DGBTU D HE D:DGBTX=DGBTG HDR S DGBTF=1
27 Q
28HDR I DGBTZ="F" S DGBTXX=$S(DGBTSL="ACCT":DGBTX_":",DGBTSL="PAT":$P(DGBTNO,"^",1)_":"_SSN,1:$P(DGBTNO,"^",5)_":"_$P(DGBTNO,"^",3)),DGBTG=DGBTX W !,DGBTXX S DGBTF=1
29 Q
30 ;prints total for divisions
31SM I DGBTZ="T" Q:'DGBT3
32 I DGBTZ="F" Q:'DGBTF
33 S:DGBTX="" DGBTD1=1 D RP Q:DGBTU S DGBTD1=0 W !! W:DGBTZ="T" ?3 W:DGBTZ="F" ?10 W "DIVISION TOTAL" S X=DGBTSDT,X2="2$" D CM W:DGBTZ="T" ?32,X I DGBTZ="F" W:DGBTSL="PAT" ?38 W:DGBTSL'="PAT" ?45 W X
34 S X=DGBTAT,X2="2$" D CM W:DGBTZ="T" ?46,X I DGBTZ="F" W:DGBTSL="PAT" ?52 W:DGBTSL'="PAT" ?57 W X
35 I DGBTZ="T" S X=DGBTGT,X2="2$" D CM W ?60,X I DGBTSL'="PAT" W ?76,$J(DGBTPTC(DGBTODV),4)
36 S (DGBTAT,DGBTSDT,DGBTGT,DGBTPTC)=0 Q
37 ;Prints total page plus grand total.
38TOTAL S DGBTZ="T",DGBT4=1,DGBTPG=0 D HE S (DGBTDV,DGBTC)=0 F X=0:0 S DGBTDV=$O(DGBTGT(DGBTDV)) Q:DGBTDV="" D:DGBT3 RP Q:DGBTU D CON
39 D RP Q:DGBTU W !!?12,"GRAND TOTAL",?32 S X2="2$",X=DGBTSDT D CM W X S X2="2$",X=DGBTAT D CM W ?46,X S X2="2$",X=DGBTGT D CM W ?60,X I DGBTSL'="PAT" W ?74,$J(DGBTPTC,6)
40 Q
41CON S:DGBTSL'="PAT" DGBTPTC=DGBTPTC+DGBTPTC(DGBTDV) W !,$S(DGBTDV="ZNOT SPECIFIED":"NOT SPECIFIED",1:$E(DGBTDV,1,30)),?32 S X2="2$",X=$P(DGBTGT(DGBTDV),"^",2),DGBTSDT=DGBTSDT+X D CM W X
42 S X2="2$",X=$P(DGBTGT(DGBTDV),"^",1),DGBTAT=DGBTAT+X D CM W ?46,X S X2="2$",X=$P(DGBTGT(DGBTDV),"^",1)+$P(DGBTGT(DGBTDV),"^",2),DGBTGT=DGBTGT+X D CM W ?60,X I DGBTSL'="PAT" W ?74,$J(DGBTPTC(DGBTDV),6)
43 S DGBT3=1 D:$O(DGBTGT(DGBTDV))'="" RP
44 Q
45CM N X3 D COMMA^%DTC Q
Note: See TracBrowser for help on using the repository browser.