source: FOIAVistA/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPAPLI.m@ 863

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

initial load of FOIAVistA 6/30/08 version

File size: 6.8 KB
Line 
1RCDPAPLI ;WISC/RFJ-account profile top list manager init ;1 Jun 99
2 ;;4.5;Accounts Receivable;**114,141,241**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7INIT ; init for list manager screen
8 N DMCDATA,RCBILLDA,RCCOMM,RCDATA,RCDATE,RCLINE,RCSTATDA,RCTOTAL
9 N TOP4,TOP6
10 K ^TMP("RCDPAPLM",$J),^TMP("RCDPAPLMX",$J),^TMP("VALM VIDEO",$J)
11 ;
12 ; fast exit
13 I $G(RCDPFXIT) S VALMQUIT=1 Q
14 ;
15 I '$G(RCDEBTDA) D Q
16 . D SET("",1,1,80)
17 . D SET("***** Select an ACCOUNT *****",2,1,80)
18 . S VALMCNT=2
19 . D HDR^RCDPAPLM
20 ;
21 ; get bills for a debtor
22 D GETBILLS^RCDPAPST(RCDEBTDA)
23 ;
24 I '$O(^TMP("RCDPAPST",$J,0)) D Q
25 . D SET("",1,1,80,IORVOFF,IORVOFF)
26 . D SET(" ***** Account does not have any bills *****",2,1,80)
27 . S VALMCNT=2
28 . S RCTOTAL(1)=0
29 . D HDR^RCDPAPLM
30 ;
31 ; set the listmanager line number
32 S RCLINE=0
33 ;
34 S RCDATE=9999999 F S RCDATE=$O(^TMP("RCDPAPST",$J,RCDATE),-1) Q:'RCDATE D
35 . S RCSTATDA=0 F S RCSTATDA=$O(^TMP("RCDPAPST",$J,RCDATE,RCSTATDA)) Q:'RCSTATDA D
36 . . S RCBILLDA=0 F S RCBILLDA=$O(^TMP("RCDPAPST",$J,RCDATE,RCSTATDA,RCBILLDA)) Q:'RCBILLDA D
37 . . . S RCDATA=^TMP("RCDPAPST",$J,RCDATE,RCSTATDA,RCBILLDA)
38 . . . ; add up dollars owed by account (all bills)
39 . . . S RCTOTAL(1)=$G(RCTOTAL(1))+$P(RCDATA,"^")
40 . . . S RCTOTAL(2)=$G(RCTOTAL(2))+$P(RCDATA,"^",2)
41 . . . S RCTOTAL(3)=$G(RCTOTAL(3))+$P(RCDATA,"^",3)
42 . . . ;
43 . . . ; if not a selected status, do not display
44 . . . I ("^"_$G(^DISV(DUZ,"RCDPAPLM","STATUS"))_"^")'[("^"_RCSTATDA_"^") Q
45 . . . ;
46 . . . ; display the bill in listmanager if the status selected
47 . . . D SETBILL
48 . . . ;
49 . . . ; add up dollars owed by account (bills displayed)
50 . . . S RCTOTAL(4)=$G(RCTOTAL(4))+$P(RCDATA,"^")
51 . . . S RCTOTAL(5)=$G(RCTOTAL(5))+$P(RCDATA,"^",2)
52 . . . S RCTOTAL(6)=$G(RCTOTAL(6))+$P(RCDATA,"^",3)
53 ;
54 ; show totals of all bills displayed in listmanager
55 S RCLINE=RCLINE+1
56 D SET(" --------- -------- --------",RCLINE,1,80)
57 S RCLINE=RCLINE+1
58 D SET(" TOTAL BALANCE OWED FOR ALL BILLS DISPLAYED",RCLINE,1,80)
59 D SET($J($G(RCTOTAL(4)),9,2),RCLINE,53,62)
60 D SET($J($G(RCTOTAL(5)),9,2),RCLINE,62,71)
61 D SET($J($G(RCTOTAL(6)),9,2),RCLINE,71,80)
62 ;
63 ; get the pending payments for the debtor
64 S RCTOTAL("PP")=$$PENDPAY^RCDPURET($P(^RCD(340,RCDEBTDA,0),"^"))
65 I $O(^TMP($J,"RCDPUREC","PP",0)) D
66 . S RCLINE=RCLINE+1 D SET(" ",RCLINE,1,80)
67 . S RCLINE=RCLINE+1 D SET("Pending Payments",RCLINE,1,80,0,IORVON,IORVOFF)
68 . N %,DATA,DATE,RECEIPT,RECTDA,TRANDA,TYPE
69 . S RECTDA=0 F S RECTDA=$O(^TMP($J,"RCDPUREC","PP",RECTDA)) Q:'RECTDA D
70 . . S RECEIPT=$P($G(^RCY(344,RECTDA,0)),"^")
71 . . S TYPE=$E($P($G(^RC(341.1,+$P(^RCY(344,RECTDA,0),"^",4),0)),"^"),1,14)
72 . . S TRANDA=0 F S TRANDA=$O(^TMP($J,"RCDPUREC","PP",RECTDA,TRANDA)) Q:'TRANDA D
73 . . . S DATA=^TMP($J,"RCDPUREC","PP",RECTDA,TRANDA)
74 . . . S RCLINE=RCLINE+1
75 . . . D SET(RECEIPT_"/"_TRANDA,RCLINE,1,80)
76 . . . S DATE=$P(DATA,"^",6)
77 . . . S DATE=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
78 . . . D SET(DATE,RCLINE,13,21)
79 . . . ; build type of payment display
80 . . . S %=$E(TYPE_" ",1,14)
81 . . . I $P(DATA,"^",7)'="" S %=%_"/"_$P(DATA,"^",7) ; check #
82 . . . I $P(DATA,"^",8)'="" S %=%_"/"_$P(DATA,"^",8) ; bank #
83 . . . I $P(DATA,"^",2)'="" S %=%_"/"_$P(DATA,"^",2) ; confirmation
84 . . . D SET(%,RCLINE,29,53)
85 . . . ; show amount paid
86 . . . D SET($J($P(DATA,"^",4),9,2),RCLINE,53,62)
87 . S RCLINE=RCLINE+1
88 . D SET(" ---------",RCLINE,1,80)
89 . S RCLINE=RCLINE+1
90 . D SET(" TOTAL PENDING PAYMENTS",RCLINE,1,80)
91 . D SET($J($G(RCTOTAL("PP")),9,2),RCLINE,53,62)
92 . K ^TMP($J,"RCDPUREC","PP")
93 ;
94 ; dmc info
95 I $D(^RCD(340,"DMC",1,+RCDEBTDA)) D
96 . S DMCDATA=$G(^RCD(340,+RCDEBTDA,3))
97 . S RCLINE=RCLINE+1 D SET(" ",RCLINE,1,80)
98 . S RCLINE=RCLINE+1
99 . D SET("** Account forwarded to DMC: "_$S('$P(DMCDATA,"^",2):"",1:$$SLH^RCFN01($P(DMCDATA,"^",2))),RCLINE,1,80)
100 . D SET("Total DMC Amount: "_$J($P(DMCDATA,"^",5),9,2),RCLINE,50,80)
101 . I $P(DMCDATA,"^",9)'="" D
102 . . S RCLINE=RCLINE+1
103 . . D SET(" ",RCLINE,1,80)
104 . . D SET("Lesser Amt to DMC: "_$J($P(DMCDATA,"^",9),9,2),RCLINE,49,80)
105 ; top info
106 I $D(^RCD(340,"TOP",+RCDEBTDA)) D
107 . S TOP6=$G(^RCD(340,+RCDEBTDA,6)),TOP4=$G(^(4))
108 . S RCLINE=RCLINE+1 D SET(" ",RCLINE,1,80)
109 . S RCLINE=RCLINE+1
110 . D SET("** Account forwarded to TOP: "_$S('$P(TOP6,"^"):"",1:$$SLH^RCFN01($P(TOP6,"^"))),RCLINE,1,80)
111 . D SET("Total TOP Amount: "_$J($P(TOP4,"^",3),13,2),RCLINE,45,80)
112 . I $P(TOP6,"^",6)'="" D
113 . . S RCLINE=RCLINE+1
114 . . D SET(" ",RCLINE,1,80)
115 . . D SET("TOP Hold Date: "_$$SLH^RCFN01($P(TOP6,"^",6)),RCLINE,45,80)
116 ;
117 ; show if hurricane katrina vet
118 I $P(^RCD(340,+RCDEBTDA,0),U)["DPT(" S DFN=+^(0) D
119 . Q:$$EMGRES^DGUTL(DFN)'["K"
120 . S RCLINE=RCLINE+1
121 . D SET("EMERGENCY RESPONSE INDICATOR: HURRICANE KATRINA",RCLINE,1,80)
122 ;
123 ; show comments if they exist
124 I $O(^RCD(340,RCDEBTDA,2,0)) D
125 . S RCLINE=RCLINE+1 D SET(" ",RCLINE,1,80)
126 . S RCLINE=RCLINE+1 D SET("Comments",RCLINE,1,80,0,IOUON,IOUOFF)
127 . S RCCOMM=0 F S RCCOMM=$O(^RCD(340,RCDEBTDA,2,RCCOMM)) Q:'RCCOMM D
128 . . S RCLINE=RCLINE+1 D SET(^RCD(340,RCDEBTDA,2,RCCOMM,0),RCLINE,1,80)
129 ;
130 K ^TMP("RCDPAPST",$J)
131 ;
132 ; set valmcnt to number of lines in the list
133 S VALMCNT=RCLINE
134 D HDR^RCDPAPLM
135 Q
136 ;
137 ;
138SETBILL ; set a bill on the listmanager line
139 N DATE,IBCNDATA,RCDPDATA,VALUE
140 D DIQ430^RCDPBPLM(RCBILLDA,".01;2;3;8;60;")
141 ;
142 S RCLINE=RCLINE+1
143 ;
144 ; create an index array for bill lookup in list
145 S ^TMP("RCDPAPLM",$J,"IDX",RCLINE,RCLINE)=RCBILLDA
146 ;
147 ; bill number
148 D SET(RCLINE,RCLINE,1,80,0,IORVON,IORVOFF)
149 D SET($E($P(RCDPDATA(430,RCBILLDA,.01,"E"),"-",2)_" ",1,7),RCLINE,4,10,0)
150 ;
151 ; get date of care
152 D DIQ399^RCXFMSUR(RCBILLDA)
153 S DATE=$G(IBCNDATA(399,RCBILLDA,151,"I"))
154 I 'DATE S DATE=$G(RCDPDATA(430,RCBILLDA,60,"I"))
155 S DATE=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
156 D SET(DATE,RCLINE,13,21,0)
157 ;
158 ; status (field 8)
159 D SET("",RCLINE,23,26,8)
160 ;
161 ; type of care
162 D SET("",RCLINE,29,71,2)
163 ;
164 ; principle, interest, admin
165 D SET($J($P(RCDATA,"^"),9,2),RCLINE,53,62,0)
166 D SET($J($P(RCDATA,"^",2),9,2),RCLINE,62,71,0)
167 D SET($J($P(RCDATA,"^",3),9,2),RCLINE,71,80,0)
168 Q
169 ;
170 ;
171SET(STRING,LINE,COLBEG,COLEND,FIELD,ON,OFF) ; set array
172 I $G(FIELD) S STRING=STRING_$S(STRING="":"",1:": ")_$G(RCDPDATA(430,RCBILLDA,FIELD,"E"))
173 I STRING="",'$G(FIELD) D SET^VALM10(LINE,$J("",80)) Q
174 I '$D(@VALMAR@(LINE,0)) D SET^VALM10(LINE,$J("",80))
175 D SET^VALM10(LINE,$$SETSTR^VALM1(STRING,@VALMAR@(LINE,0),COLBEG,COLEND-COLBEG+1))
176 I $G(ON)]""!($G(OFF)]"") D CNTRL^VALM10(LINE,COLBEG,$L(STRING),ON,OFF)
177 Q
Note: See TracBrowser for help on using the repository browser.