source: FOIAVistA/trunk/r/INTEGRATED_PATIENT_FUNDS-PRPF-PFXIP/PRPFCD.m@ 635

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1PRPFCD ;ALTOONA/CTB PATIENT FUNDS ACCOUNT CARD GENERATOR ;11/22/96 4:33 PM
2V ;;3.0;PATIENT FUNDS;**3,6**;JUNE 1, 1989
3 ;HARD CODED OUTPUT - DOES NOT USE THE FILE MANAGER
4LHDR1 W !,"REFERENCE",?12,"MASTER # SOURCE",?32,"WITHDRAWALS",?47,"DEPOSITS",?57,"DATE/TIME",?67,"DEFERRED",?86,"BALANCE",?95,"REMARKS" Q
5BODY ;PRINTS THE BODY OF THE PATIENT CARD
6 S BAL=0,PAGE=0,END=45,GBAL=0,PBAL=0,D1=0 W !,LINE
7 I $D(BDATE) F D1=0:0 S D1=$O(^PRPF(470,DFN,3,D1)) Q:'D1 Q:'$D(^(D1,0)) S PTR=^(0) Q:$P(PTR,"^",2)>BDATE S BAL=BAL+$P(PTR,"^",3),GBAL=GBAL+$P(PTR,"^",5),PBAL=PBAL+$P(PTR,"^",4)
8 I BAL,GBAL W !,"BALCARFWD",?24,"GRAT",?45,$J(GBAL,10,2),?57,BDATE1,?83,$J(GBAL,10,2),?95,"Gratuitous Balance Carried Forward"
9 I BAL,PBAL W !,"BALCARFWD",?24,"PRIV",?45,$J(PBAL,10,2),?57,BDATE1,?83,$J(BAL,10,2),?95,"Private Source Balance Carried Fwd"
10 K GBAL,PBAL
11 I D1,$D(^PRPF(470,DFN,3,D1,0)) S PTR=^(0) D LINE
12 F S D1=$O(^PRPF(470,DFN,3,D1)) Q:'D1 Q:'$D(^(D1,0)) S PTR=^(0) D LINE
13 Q
14LINE ;PRINTS THE TRANSACTION LINE FOR THE CARD
15 I PAGE>0,$Y>55 S PTRX=PTR D LINE3,PAGE,SHDR S PTR=PTRX K PTRX G LINE2
16 I PAGE=0,$Y>45 S PTRX=PTR D LINE3,TRAIL,PAGE,SHDR S END=58,PTR=PTRX K PTRX
17LINE2 S MTR=$S($D(^PRPF(470.1,+PTR,0)):^(0),1:"")
18 S SOURCE=$P(MTR,U,10) S SOURCE=$S(SOURCE="P":"PRIV",SOURCE="G":"GRAT",SOURCE="B":"BOTH",1:"UNK")
19 S NU=$P(MTR,U),REF=$P(MTR,U,7),WI="",DE="" S:$P(MTR,U,8)="W" WI=-$P(PTR,U,3) S:$P(MTR,U,8)="D" DE=$P(PTR,U,3) S REM=$S($L($P(MTR,"^",16))>35:$E($P(MTR,U,16),1,34)_"*",1:$P(MTR,"^",16))
20 S X=$P(MTR,U,5) D DATE S DATE=X
21 S BAL=BAL+DE-WI S:DE'="" DE=$J(DE,10,2) S:WI'="" WI=$J(WI,10,2) S:BAL'="" JBAL=$J(BAL,10,2)
22 S X=$P(MTR,U,21) D DATE S DEF=X
23 W !,REF,?13,NU,?24,SOURCE,?33,WI,?45,DE,?57,DATE,?68,DEF,?83,JBAL,?95,REM K DEF,HR,MIN,NU,REF,SOURCE,WI,DE,DATE,JBAL Q
24LINE3 W !,LINE
25 Q
26EN2 S U="^" K LINE S $P(LINE,"-",131)="-" D LHDR^PRPFCD1,BODY,END,OUT Q
27END W !!,"END OF CARD FOR: ",$P(DFN(0),U),?60,"ENDING BALANCE: $",$J(BAL,0,2)
28 F II=$Y:1:END W !
29 D:PAGE=0 LINE3,TRAIL
30 I '$D(TRAIL) F I=1:1:131 W "_"
31 D PAGE Q
32END1 Q
33OUT ;EXIT LINE
34 K ^PRPF(470,"AD","Y",DFN) S $P(^PRPF(470,DFN,1),"^",13)="" ;ABSV*3*8
35 K IOP,BAL,C1,D1,DATE,DE,DEF,DFN,DOA,DG1,DGA1,II,IND,JBAL,LINE,MONTH,MTR,PAGE,PTR,POP,NU,PDFN,SOURCE,WI,X,XREF,Y,TRAIL,END,REM Q
36TRAIL ; PRINTS THE TRAILER INFO FOR PAGE ONE OF THE CARD
37T1 ;
38 W !,"REGIONAL OFFICE: ",$S($P(PDFN(0),U,9)]"":$P(^DIC(4,$P(PDFN(0),U,9),0),U),1:""),?40,"OTHER ASSET: ",$P(PDFN(0),U,10),?65,"PRIVATE SOURCE FUNDS IN BALANCE: "
39 W $J($P(PDFN(1),U,5),9,2) W !!,"INCOME SOURCE",?27,"PAYEE",?52,"AMOUNT",?62,"FREQUENCY",?102,"MIN BALANCE",?120,"MAX BALANCE"
40 S N=0 F IX=1,3 S N=$O(^PRPF(470,DFN,6,N)) D S1
41 K XX,IX F IX=1:1 S N=$O(^PRPF(470,DFN,6,N)) G:'N T2 S XX=^(N,0) W !,$P(XX,U),?27,$P(XX,U,2),?49,"$",$J($P(XX,U,3),9,2) S Y="",X=$P(XX,U,4),DD=470.05,F=3 D:X]"" ^PRPFU1 W ?62,Y
42T2 K IX W ! S N=0,DIWF="W",DIWL=5,DIWR=IOM-10 F I=1:1 S N=$O(^PRPF(470,DFN,7,N)) Q:N="" S X=^(N,0) S:I=1 X="GENERAL REMARKS/INFORMATION: "_X D ^DIWP
43 D ^DIWW K DIWF,DIWL,DIWR,X Q
44 Q
45S1 S XX="" W ! S:N XX=^PRPF(470,DFN,6,N,0) W:N $P(XX,U),?27,$P(XX,U,2),?49,"$",$J($P(XX,U,3),9,2) S Y="",X=$P(XX,U,4) S DD=470.05,F=3 D:X]"" ^PRPFU1 W:N ?62,Y W ?102,"$",$J($P(PDFN(2),U,IX),9,2),?120,"$",$J($P(PDFN(2),U,IX+1),9,2) Q
46SHDR ;PRINTS THE SHORT HEADER USED ON CONTINUATION PAGES
47 W @IOF,!,"BENEFICIARY:",?32,"CLAIM #:",?48,"I.D. #",?64,"WARD",?75,"MIN BALANCE",?90,"MAX BALANCE"
48 W !,$P(DFN(0),U),?32,"C-",$P(DFN(.31),U,3),?48,$P(DFN(0),U,9),?64,DFN(.1),?75,$J($P(PDFN(2),U),8,2),?90,$J($P(PDFN(2),U,2),8,2),!,?75,$J($P(PDFN(2),U,3),8,2),?90,$J($P(PDFN(2),U,4),8,2),!,LINE
49 D LHDR1 W !! Q
50PAGE S PAGE=PAGE+1 F I=$Y:1:61 W !
51 W ?60,"PAGE ",PAGE Q
52DATE ;CONVERT DATE TO SLASH FORMAT
53 I +X<2000000 S X="" Q
54 S X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) Q
Note: See TracBrowser for help on using the repository browser.