source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPEWL8.m@ 1710

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

initial load of WorldVistAEHR

File size: 9.4 KB
RevLine 
[613]1RCDPEWL8 ;ALB/TMK - EDI LOCKBOX WORKLIST ERA LEVEL ;12-FEB-04
2 ;;4.5;Accounts Receivable;**208**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6FILESP ; Action that files the split lines
7 ; Assumes RCDIR,RCLINE,RCSCR,RCSPLIT array defined
8 N RCTOT,Z,RCZ0,RCZ1,DTOUT,DUOUT,DIR,X,Y,DIE,DA,DR,DIC,DD,DO,DLAYGO,RCZ,RCZZ,RCZT
9 D FULL^VALM1
10 I '$G(^TMP("RCDPE_EOB_SPLIT_OK",$J)) D Q
11 . S VALMBCK="R"
12 . F Z=2,3 S RCTOT(Z)=$$TOT^RCDPEWL3(Z,.RCSPLIT)
13 . S DIR(0)="EA"
14 . S DIR("A",1)="TOTAL "_$S(+RCTOT(2)'=+$P(RCDIR,U,2):"PAYMENTS",1:"ADJUSTMENTS")_$S(+RCTOT(3)=+$P(RCDIR,U,3):"",+RCTOT(2)'=+$P(RCDIR,U,2):" AND ADJUSTMENTS",1:"")_" DO NOT MATCH THE ORIGINAL AMOUNT(s):"
15 . S DIR("A",2)=$E(" ORIG PAY AMT: "_$J(+$P(RCDIR,U,2),"",2)_$J("",35),1,35)_" ORIG ADJ AMT: "_$J(+$P(RCDIR,U,3),"",2)
16 . S DIR("A",3)=$E(" AMT ENTERED: "_$J(+RCTOT(2),"",2)_$J("",35),1,35)_" AMT ENTERED: "_$J(+RCTOT(3),"",2)
17 . S DIR("A")="PRESS RETURN TO CONTINUE " W ! D ^DIR K DIR
18 ;
19 S DA(1)=RCSCR
20 S RCZ0=+$P(RCLINE,U,2),RCZZ=+$G(^RCY(344.49,DA(1),1,RCZ0,0)),RCZZ(1)=""
21 S RCZ=+$O(RCSPLIT(0))
22 I RCZ D
23 . S DIE="^RCY(344.49,"_DA(1)_",1,",DA=RCZ0,RCZT=$P(RCSPLIT(RCZ),U,2)+$P(RCSPLIT(RCZ),U,3)
24 . S DR=".02////"_$P(RCSPLIT(RCZ),U)_";.05////"_$J(+$P(RCSPLIT(RCZ),U,2),"",2)_";.06////"_$J(+RCZT,"",2)_";.08////"_$J($P(RCSPLIT(RCZ),U,3),"",2)
25 . S DR=DR_";.07///"_$S($P(RCSPLIT(RCZ),U,5):"/"_$P(RCSPLIT(RCZ),U,5),1:"@")_";.03////"_$S(RCZT'<0:$J(+RCZT,"",2),1:"0.00")_$S($P(RCSPLIT(RCZ),U,6)'="":";.1///"_$S($P(RCSPLIT(RCZ),U,6)'="@":"/^S X=$P(RCSPLIT(RCZ),U,6)",1:"@"),1:"")
26 . D ^DIE,UPD^RCDPEWL3(DA(1),DA)
27 . I $P(RCDIR,U,3) D
28 .. N DA
29 .. S DA(2)=RCSCR,DA(1)=RCZ0,DA=1,DIE="^RCY(344.49,"_DA(2)_",1,"_DA(1)_",1,"
30 .. S RCZZ(1)=$G(^RCY(344.49,DA(2),1,DA(1),1,1,0))
31 .. S DR=".03////"_$J(+$P(RCSPLIT(RCZ),U,3),"",2)_$S($P(RCSPLIT(RCZ),U,4)'="":".09////"_$P(RCSPLIT(RCZ),U,4),1:"")
32 .. D ^DIE
33 F S RCZ=$O(RCSPLIT(RCZ)) Q:'RCZ D
34 . S DIC(0)="L",DLAYGO=344.491,DIC="^RCY(344.49,"_DA(1)_",1,",X=+$O(^RCY(344.49,RCSCR,1,"B",RCZZ\1+.999),-1)+.001
35 . S DIC("DR")=".02////"_$P(RCSPLIT(RCZ),U)_";.05////"_$J(+$P(RCSPLIT(RCZ),U,2),"",2)_";.08////"_$J(+$P(RCSPLIT(RCZ),U,3),"",2)_";.06////"_$J($P(RCSPLIT(RCZ),U,2)+$P(RCSPLIT(RCZ),U,3),"",2)
36 . I $P(RCSPLIT(RCZ),U,6)'="" S DIC("DR")=DIC("DR")_";.1///"_$S($P(RCSPLIT(RCZ),U,6)'="@":"/^S X=$P(RCSPLIT(RCZ),U,6)",1:"@")
37 . I $P(RCSPLIT(RCZ),U,5) S DIC("DR")=DIC("DR")_";.07////"_$P(RCSPLIT(RCZ),U,5)
38 . K DD,DO D FILE^DICN K DIC,DLAYGO,DD,DO
39 . S RCZ1=+Y
40 . I Y D UPD^RCDPEWL3(RCSCR,RCZ1)
41 . I Y,$P(RCDIR,U,3) D
42 .. N DA
43 .. S DA(2)=RCSCR,DA(1)=RCZ1,X=1,DIC(0)="L",DIC="^RCY(344.49,"_DA(2)_",1,"_DA(1)_",1,"
44 .. S DIC("DR")=".02////"_$P(RCZZ(1),U,2)_";.03////"_$J(+$P(RCSPLIT(RCZ),U,3),"",2)_$S($P(RCSPLIT(RCZ),U,4)'="":";.09////"_$P(RCSPLIT(RCZ),U,4),$P(RCZZ(1),U,9)'="":";.09////"_$P(RCZZ(1),U,9),1:"")
45 .. F Z=4:1:8 I $P(RCZZ(1),U,Z)'="" S DIC("DR")=DIC("DR")_";"_(Z/100)_"////"_$P(RCZZ(1),U,Z)
46 .. D FILE^DICN K DIC,DLAYGO,DD,DO
47 K ^TMP($J,"RCDPE_SPLIT_FILE")
48 S VALMBCK="Q"
49 Q
50 ;
51SELBAT(RCERA,RCQUIT) ; Select a batch
52 ; If batch is selected, global ^TMP("RCBATCH_SELECTED",$J) is set =
53 ; batch ien selected
54 ; RCQUIT = 1 if selection not made
55 N RCBAT,DA,DIE,X,Y,DIC,DUOUT,DTOUT,DIR,DR
56 S RCQUIT=0
57 S DA(1)=RCERA,DIC(0)="AEMQ",DIC="^RCY(344.49,"_DA(1)_",3,",DIC("S")="I '$P(^(0),U,5)" D ^DIC
58 I Y'>0 S RCQUIT=1 Q
59 S RCBAT=+Y
60 L +^RCY(344.4,RCERA,0):5 I '$T S DIR("A",1)="ANOTHER USER HAS JUST ACCESSED THE ENTIRE ERA - TRY AGAIN LATER",DIR("A")="PRESS RETURN TO CONTINUE ",DIR(0)="EA" W ! D ^DIR K DIR S RCQUIT=1 Q
61 L +^RCY(344.49,RCERA,3,RCBAT,0):5 I '$T!$P($G(^(0)),U,5) S DIR("A",1)="ANOTHER USER HAS JUST OPENED THIS BATCH - TRY AGAIN LATER",DIR("A")="PRESS RETURN TO CONTINUE ",DIR(0)=-"EA" W ! D ^DIR K DIR S RCQUIT=1 Q
62 S DA=RCBAT,DA(1)=RCERA,DIE="^RCY(344.49,"_DA(1)_",3,",DR=".05////1" D ^DIE L -^RCY(344.49,RCERA,3,RCBAT,0)
63 I $P($G(^RCY(344.49,RCERA,3,RCBAT,0)),U,3) D
64 . S DIR(0)="EA",DIR("A",1)="** WARNING - THIS BATCH HAS BEEN FLAGGED AS READY TO POST",DIR("A")="PRESS RETURN TO CONTINUE " W ! D ^DIR K DIR
65 S ^TMP("RCBATCH_SELECTED",$J)=RCBAT
66 L -^RCY(344.4,RCERA,0)
67 Q
68 ;
69SORT ; Select a new sort for the list of ERAs
70 D FULL^VALM1
71 N RCSORT,DUOUT,DTOUT,DIR,X,Y,RCS1,RCS2,RCORD
72 S VALMBCK="R"
73 S DIR("L",1)=" SELECT A FIRST LEVEL SORT",DIR("L",2)=" "
74 S DIR("L",3)=" A AMOUNT PAID E ERA PAID DATE"
75 S DIR("L")=" P PAYER NAME D DATE ERA RECEIVED"
76 S DIR(0)="S^A:AMOUNT PAID;E:ERA PAID DATE;P:PAYER NAME;D:DATE ERA RECEIVED",DIR("B")=$P($P(DIR(0),"D:",2),";")
77 W ! D ^DIR K DIR
78 I $D(DTOUT)!$D(DUOUT) Q
79 S RCS1=$S(Y="A":"AP",Y="E":"DP",Y="P":"PN",1:"DR")
80 S RCORD=$$ORD(.RCS1)
81 Q:'$D(RCS1)
82 S $P(RCSORT,U)=(RCS1_";"_RCORD)
83 K X
84 S X(1)=$S(RCS1'="AP":"A:AMOUNT PAID",1:"E:ERA PAID DATE")
85 S X(2)=$S(RCS1'="AP"&(RCS1'="DP"):"E:ERA PAID DATE",1:"P:PAYER NAME")
86 S X(3)=$S(RCS1="DR":"P:PAYER NAME",1:"D:DATE ERA RECEIVED")
87 S DIR(0)="S^N:NONE;"_X(1)_";"_X(2)_";"_X(3)
88 S DIR("B")="NONE"
89 S DIR("L",1)=" SELECT A SECOND LEVEL SORT",DIR("L",2)=" "
90 S DIR("L",3)=" N NONE"_$J("",13)_$P(X(1),":")_" "_$P(X(1),":",2)
91 S DIR("L")=" "_$E($P(X(2),":")_" "_$P(X(2),":",2)_$J("",20),1,20)_$P(X(3),":")_" "_$P(X(3),":",2)
92 K X W ! D ^DIR K DIR
93 I $D(DTOUT)!$D(DUOUT) Q
94 S RCS2=$S(Y="N":"N",Y="A":"AP",Y="E":"DP",Y="P":"PN",1:"DR")
95 S RCORD=$$ORD(.RCS2)
96 Q:'$D(RCS2)
97 S $P(RCSORT,U,2)=(RCS2_";"_RCORD)
98 K ^TMP($J,"RCERA_LIST") D BLD^RCDPEWL7(RCSORT)
99 Q
100 ;
101ORD(RCS) ; Select an order for the sorted field code in RCS
102 ; Kill RCS if nothing selected, passed by reference
103 ; Returns '-' if reverse order selected
104 N DIR,X,Y,ORD,RCQUIT
105 S RCQUIT=0,ORD=""
106 I RCS="N" G ORDQ
107 I RCS="PN" D G ORDQ
108 . S DIR(0)="SA^F:FIRST TO LAST;L:LAST TO FIRST"
109 . S DIR("B")=$P($P(DIR(0),"F:",2),";")
110 . S DIR("A")=" SORT (F)IRST TO LAST OR (L)AST TO FIRST?: "
111 . D ^DIR K DIR
112 . I $D(DUOUT)!$D(DTOUT) S RCQUIT=1 Q
113 . S ORD=$S(Y="F":"",1:"-")
114 ;
115 I RCS="AP" D G ORDQ
116 . S DIR("A")=" SORT (L)OWEST TO HIGHEST OR (H)IGHEST TO LOWEST?: "
117 . S DIR(0)="SA^L:LOWEST TO HIGHEST;H:HIGHEST TO LOWEST"
118 . S DIR("B")=$P($P(DIR(0),"L:",2),";")
119 . D ^DIR K DIR
120 . I $D(DUOUT)!$D(DTOUT) S RCQUIT=1 Q
121 . S ORD=$S(Y="L":"",1:"-")
122 ;
123 I RCS="DP"!(RCS="DR") D G ORDQ
124 . S DIR("A")=" SORT (E)ARLIEST TO LATEST OR (L)ATEST TO EARLIEST?: "
125 . S DIR(0)="SA^E:EARLIEST TO LATEST;L:LATEST TO EARLIEST"
126 . S DIR("B")=$P($P(DIR(0),"E:",2),";")
127 . D ^DIR K DIR
128 . I $D(DUOUT)!$D(DTOUT) S RCQUIT=1 Q
129 . S ORD=$S(Y="E":"",1:"-")
130 ;
131 ; Invalid sort code
132 S RCQUIT=1
133 ;
134ORDQ I RCQUIT K RCS
135 Q ORD
136 ;
137BATDSP ; Ask Display/Hide batch info on ERA list screen
138 N DIR,X,Y,RCZ,DUOUT,DTOUT
139 D FULL^VALM1
140 S RCZ=+$G(^TMP("RCERA_PARAMS",$J,"BATCHON"))
141 S DIR("A",1)="BATCH INFO DISPLAY IS CURRENTLY TURNED "_$S('RCZ:"OFF",1:"ON"),DIR("A")="DO YOU WANT TO TURN IT "_$S('RCZ:"ON",1:"OFF")_" NOW?: "
142 S DIR(0)="YA",DIR("B")="YES" W ! D ^DIR K DIR
143 S VALMBCK="R"
144 Q:$D(DUOUT)!$D(DTOUT)!'Y
145 S ^TMP("RCERA_PARAMS",$J,"BATCHON")=$S(RCZ:0,1:1)
146 D BLD^RCDPEWL7($G(^TMP("RCERA_PARAMS",$J,"SORT")))
147 Q
148 ;
149HASADJ(RCSCR,RCOK) ; Function=1 if WL entry has any adj not yet distributed
150 ; RCSCR = ien of entry in file 344.49
151 ; RCOK = if passed by reference, returns 1 if ANY postable lines exist
152 N Z,Z0,RCSTOP
153 S RCSTOP=0,RCOK=0
154 S Z=0 F S Z=$O(^RCY(344.49,RCSCR,1,Z)) Q:'Z S Z0=$G(^(Z,0)) D Q:RCSTOP
155 . I $P(Z0,U,6)>0!$O(^RCY(344.49,RCSCR,1,Z,1,0)) S RCOK=1 Q
156 . I $P(Z0,U,6)<0 S RCSTOP=1
157 Q RCSTOP
158 ;
159VERIF ; Entrypoint to verification options
160 N DIR,X,Y,RCQUIT,DTOUT,DUOUT
161 D FULL^VALM1
162 ;
163 W !!!!
164 S RCQUIT=0
165 F D Q:RCQUIT
166 . W !,"VERIFY EEOBs:",!,?10,"1",$J("",5),"MANUAL MARK AS VERIFIED",!,?10,"2",$J("",5),"REPORT OF UNVERIFIED WITH DISCREPANCIES",!,?10,"3",$J("",5),"QUIT AND RETURN TO WORKLIST"
167 . S DIR(0)="SAO^1:MANUAL VERIFICATION;2:REPORT UNVERIFIED DISCREPANCIES;3:QUIT"
168 . S DIR("A")="Select Action: ",DIR("B")="QUIT" W ! D ^DIR K DIR
169 . I Y=3!(Y="")!$D(DUOUT)!$D(DTOUT) S RCQUIT=1 Q
170 . ;
171 . I Y=1 D MVER^RCDPEV(RCERA) W !! Q
172 . ;
173 . I Y=2 D RPT^RCDPEV0(RCERA) W !! Q
174 ;
175VERIFQ S VALMBCK="R"
176 Q
177 ;
178BATED ; Entrypoint to batch edit options
179 N DIC,DA,DUOUT,DTOUT,DIR,X,Y,RCQUIT
180 D FULL^VALM1
181 ;
182 W !!!!
183 S RCQUIT=0
184 I '$O(^RCY(344.49,RCERA,3,0)) W !,"***** THERE ARE CURRENTLY NO BATCHES DEFINED FOR THIS ERA *****",!
185 ; No menu if entering from a batch level
186 I $G(^TMP("RCBATCH_SELECTED",$J)) W !,"EDITING BATCH #"_+^TMP("RCBATCH_SELECTED",$J) D EDIT^RCDPEWLB(RCERA,+^TMP("RCBATCH_SELECTED",$J)) G BATEDQ
187 F D Q:RCQUIT
188 . I '$D(^XUSEC("PRCA ERA BATCH MAINT",DUZ)) D Q
189 .. S RCQUIT=1
190 .. S DIR(0)="EA",DIR("A")="YOU DO NOT HAVE SECURITY ACCESS TO THIS ACTION - PRESS RETURN TO CONTINUE " W ! D ^DIR K DIR
191 . W !,"BATCH MAINTENANCE:",!,?10,"1",$J("",5),"EDIT BATCH",!,?10,"2",$J("",5),"NEW BATCH ASSIGNMENT",!,?10,"3",$J("",5),"MARK ALL READY TO POST",!,?10,"4",$J("",5),"BATCH SUMMARY REPORT",!,?10,"5",$J("",5),"QUIT AND RETURN TO WORKLIST"
192 . S DIR(0)="SAO^1:EDIT BATCH;2:NEW BATCHES;3:MARK ALL;4:BATCH SUMMARY;5:QUIT"
193 . S DIR("A")="Select Action: ",DIR("B")="Quit" W ! D ^DIR K DIR
194 . I Y="5"!(Y="")!$D(DUOUT)!$D(DTOUT) S RCQUIT=1 Q
195 . ;
196 . I Y=1 D W !! Q
197 .. I '$O(^RCY(344.49,RCERA,3,0)) D NOTSET^RCDPEWLC Q
198 .. S DIR("B")="ONE",DIR(0)="SA^A:ALL;O:ONE",DIR("A")="EDIT(A)LL or (O)NE BATCH?: " W ! D ^DIR K DIR
199 .. I $D(DTOUT)!$D(DUOUT) Q
200 .. I Y="A" D EDITALL^RCDPEWLB(RCERA) Q
201 .. S DA(1)=RCERA,DIC="^RCY(344.49,"_DA(1)_",3,",DIC(0)="AEMQ" D ^DIC
202 .. Q:Y'>0
203 .. D EDIT^RCDPEWLB(RCERA,+Y)
204 . ;
205 . I Y=2 D REBATCH^RCDPEWLB(RCERA) W !! Q
206 . ;
207 . I Y=3 D MARKALL^RCDPEWLB(RCERA) W !! Q
208 . ;
209 . I Y=4 D SUMRPT^RCDPEWLC(RCERA) W !! Q
210 ;
211BATEDQ S VALMBCK="R"
212 Q
213 ;
Note: See TracBrowser for help on using the repository browser.