source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPEM1.m@ 1608

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

initial load of WorldVistAEHR

File size: 7.2 KB
RevLine 
[613]1RCDPEM1 ;ALB/TMK - ERA MATCH TO EFT (cont) ;05-NOV-02
2 ;;4.5;Accounts Receivable;**173**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6BULL(RCFILE,RC0,RCER) ; Add the error to the bulletin text array
7 ; RCFILE = null, 344.3 or 344.31, depending on the file being worked
8 ; RC0 = the 0-node of the RCFILE entry
9 ; RCER = the error text to be placed in the bulletin (passed by ref)
10 ;
11 N RCHCT,CT,Z
12 I '$O(^TMP($J,"RCXM",0)) S ^TMP($J,"RCXM",1)="The following exceptions were encountered attempting",^TMP($J,"RCXM",2)="to post EFT deposits OR to match EFT's with ERA's:",^TMP($J,"RCXM",3)=" "
13 S (RCHCT,CT)=+$O(^TMP($J,"RCXM",""),-1)
14 S ^TMP($J,"RCXM",0)=$G(^TMP($J,"RCXM",0))+1
15 I RC0'="" D
16 . D BLD("^TMP($J,""RCXM"")",.CT,RCFILE,RC0)
17 . S RCER=$G(RCER)+1,RCHCT=RCHCT+1
18 . S ^TMP($J,"RCXM",RCHCT)=$E(^TMP($J,"RCXM",0)_$J("",4),1,4)_$G(^TMP($J,"RCXM",RCHCT))
19 S Z=1 F S Z=$O(RCER(Z)) Q:'Z S CT=CT+1,^TMP($J,"RCXM",CT)=" "_RCER(Z)
20 S CT=CT+1,^TMP($J,"RCXM",CT)=" "
21 Q
22 ;
23SENDBULL ; Sends the bulletin when all processing is complete
24 N XMBODY,XMB,XMINSTR,XMTYPE,XMFULL,XMTO,XMZ,XMERR,XMSUBJ
25 S XMTO("I:G.RCDPE PAYMENTS")=""
26 S XMBODY="^TMP($J,""RCXM"")"
27 S XMSUBJ="EDI LBOX "_$$FMTE^XLFDT(DT,2)_" EXCEPTIONS EFT DEP/MATCH EFTs TO ERAs"
28 D ;
29 . N DUZ
30 . S DUZ=.5,DUZ(0)="@"
31 . D SENDMSG^XMXAPI(.5,XMSUBJ,XMBODY,.XMTO,,.XMZ)
32 K ^TMP($J,"RCXM")
33 Q
34 ;
35BLD(RCARRAY,RCT,RCFILE,RC0) ; Build the array for entry 344.31 detail
36 ; RCARRAY = the name of the array to be set
37 ; RCT = the # of lines already output into this array
38 ; RCFILE = 344.3 or 344.31
39 ; RC0 = the 0-node of the entry in RCFILE
40 ;
41 N Z,RC00
42 I RCFILE=344.31 D
43 . S RC00=$G(^RCY(344.3,+RC0,0))
44 . S Z=$$SETSTR^VALM1(" TRACE #: "_$P(RC0,U,4),"",1,31)
45 . S Z=$$SETSTR^VALM1(" INS CO: "_$E($P(RC0,U,2),1,22)_"/"_$P(RC0,U,3),Z,32,43)
46 . S RCT=RCT+1,@RCARRAY@(RCT)=Z
47 . S Z=$$SETSTR^VALM1(" DEPOSIT DATE: "_$$FMTE^XLFDT($P(RC00,U,7),2),"",1,24)
48 . S Z=$$SETSTR^VALM1(" DATE REC'D: "_$S($P(RC00,U,13):$$FMTE^XLFDT($P(RC00,U,13)\1,2),1:""),Z,25,22)
49 . S Z=$$SETSTR^VALM1(" PAYMENT AMT: "_$TR($J($P(RC0,U,7),15,2)," "),Z,47,30)
50 . S RCT=RCT+1,@RCARRAY@(RCT)=Z
51 ;
52 I RCFILE=344.3 D
53 . S Z=$$SETSTR^VALM1(" DEPOSIT #: "_$P(RC0,U,6),"",1,13)
54 . S Z=$$SETSTR^VALM1(" DEPOSIT DATE: "_$$FMTE^XLFDT($P(RC0,U,7),2),Z,16,24)
55 . S RCT=RCT+1,@RCARRAY@(RCT)=Z
56 . S Z=$$SETSTR^VALM1(" DATE REC'D: "_$S($P(RC0,U,13):$$FMTE^XLFDT($P(RC0,U,13)\1,2),1:""),"",25,22)
57 . S Z=$$SETSTR^VALM1(" DEPOSIT AMT: "_$TR($J($P(RC0,U,8),15,2)," "),Z,47,30)
58 . S RCT=RCT+1,@RCARRAY@(RCT)=Z
59 ;
60 Q
61 ;
62EN1 ; Queue match job for run on demand
63 N DIR,X,Y,ZTIO,ZTRTN,ZTSK,ZTDESC,ZTDTH
64 S DIR(0)="YA",DIR("A",1)="THIS OPTION QUEUES THE JOB TO MATCH EFTs TO ELECTRONIC ERAs"
65 S DIR("A")="ARE YOU SURE YOU WANT TO RUN THIS JOB?: ",DIR("B")="NO"
66 W ! D ^DIR K DIR
67 I Y'=1 G EN1Q
68 L +^RCY(344.3,"ALOCK"):5 I '$T D G EN1Q
69 . S DIR(0)="EA",DIR("A",1)="This job is currently running ... try again later",DIR("A")="Press ENTER to continue: " D ^DIR K DIR
70 S ZTIO="",ZTDTH=$$NOW^XLFDT()
71 S ZTRTN="MATCH^RCDPEM(1,1)",ZTDESC="AR - MANUAL EFT-ERA MATCH EDI LOCKBOX"
72 D ^%ZTLOAD
73 W !!,$S($D(ZTSK):"Your job has been queued - task number "_ZTSK,1:"Unable to queue this job.")
74 U IO
75EN1Q L -^RCY(344.3,"ALOCK")
76 Q
77 ;
78EN2 ; Entrypoint from nightly job to put Nightly and Daily Activity Report
79 ; data into the nightly job's status bulletin
80 N CT,DATA,Z,Z0,RCHD,T,T0
81 S CT=+$O(^TMP($J,"RCXM",""),-1)
82 S CT=CT+1,^TMP($J,"RCXM",CT)=""
83 I $D(^TMP($J,"RCTOT","EFT_DEP")) D
84 . S CT=CT+1,^TMP($J,"RCXM",CT)=$J("",12)_"********** TOTALS **********"
85 . S CT=CT+1,^TMP($J,"RCXM",CT)="DEPOSITS"
86 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # UNPOSTED EFT DEPOSITS FOUND: "_+$G(^TMP($J,"RCTOT","EFT_DEP"))
87 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # NEW EFT DEPOSITS CREATED: "_+$G(^TMP($J,"RCTOT","DEPOSIT"))
88 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # NEW EFT DEPOSIT RECEIPTS CREATED: "_+$G(^TMP($J,"RCTOT","EFT_RECPT"))
89 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # EFT DEPOSITS WITH CHECK SUM ERRORS: "_+$G(^TMP($J,"RCTOT","CSUM"))
90 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # EFT DEPOSITS WITH OTHER ERRORS: "_+$G(^TMP($J,"RCTOT","ERR"))
91 . S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL EFT DEPOSIT AMOUNT POSTED TO REV SRC CD 8NZZ: "_$J(+$G(^TMP($J,"RCTOT","SUSPAMT")),"",2)
92 . S CT=CT+1,^TMP($J,"RCXM",CT)=""
93 S CT=CT+1,^TMP($J,"RCXM",CT)="EFT-ERA MATCHES"
94 S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # UNMATCHED ERAs CHECKED: "_+$G(^TMP($J,"RCTOT","EFT"))
95 S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # ERAs MATCHED TO EFTs: "_+$G(^TMP($J,"RCTOT","MATCH"))_$S($G(^TMP($J,"RCTOT","MATCH"))&$G(^TMP($J,"RCTOT","TOTMIS")):" INCLUDING "_+$G(^TMP($J,"RCTOT","TOTMIS"))_" WITH MISMATCHED TOTALS",1:"")
96 S CT=CT+1,^TMP($J,"RCXM",CT)=" TOTAL # ERAs STILL UNMATCHED: "_+$G(^TMP($J,"RCTOT","NO_MATCH"))
97 S CT=CT+1,^TMP($J,"RCXM",CT)=""
98 K ^TMP("RCDAILYACT",$J),^TMP($J,"RC1")
99 ;
100 S Z=0 F S Z=$O(^TMP($J,"RCDPETOT",344.31,Z)) Q:'Z S Z0=$G(^RCY(344.31,Z,0)) I Z0 S ^TMP($J,"RC1",+Z0,Z)=Z0
101 ;
102 S (RCHD,Z)=0 F S Z=$O(^TMP($J,"RCDPETOT",344.3,Z)) Q:'Z S DATA=$G(^(Z)) D
103 . I 'RCHD D HDR(.CT,.RCHD) ; Add headers
104 . S Z0=$G(^RCY(344.3,Z,0))
105 . S CT=CT+1
106 . S ^TMP($J,"RCXM",CT)=""
107 . I '$G(DATA) D
108 .. S CT=CT+1
109 .. S ^TMP($J,"RCXM",CT)=^TMP($J,"RCXM",CT)_" "_$E($P($G(^RCY(344.1,+$P(Z0,U,3),0)),U)_$J("",15),1,15)_" "_$E($P($G(^RCY(344,+$O(^RCY(344,"AD",+$P(Z0,U,3),0)),0)),U)_$J("",15),1,15)_" "
110 .. S ^TMP($J,"RCXM",CT)=^TMP($J,"RCXM",CT)_$J(+$P(Z0,U,12),"",2)
111 . I $G(DATA) D
112 .. S ^TMP($J,"RCXM",CT)=^TMP($J,"RCXM",CT)_" "_$E($P($G(^RCY(344.1,+$P(DATA,U,5),0)),U)_$J("",15),1,15)_" "_$E($S($P(DATA,U,5):$P($G(^RCY(344,+DATA,0)),U),1:"")_$J("",15),1,15)_" "
113 .. S ^TMP($J,"RCXM",CT)=^TMP($J,"RCXM",CT)_$J($S($P(DATA,U,3):+$P(DATA,U,2),1:0),"",2)
114 . I $P(DATA,U,4) S CT=CT+1,^TMP($J,"RCXM",CT)=" ERROR # REFERENCED ABOVE : "_$P(DATA,U,4)
115 . S T=0 F S T=$O(^TMP($J,"RC1",Z,T)) Q:'T S T0=$G(^(T)) D
116 .. S CT=CT+1
117 .. S ^TMP($J,"RCXM",CT)=$J("",5)_$E($P(T0,U,4)_$J("",20),1,20)_" "_$P(T0,U,2)_"/"_$P(T0,U,3)
118 .. S CT=CT+1,^TMP($J,"RCXM",CT)=$J("",10)_"PAYMENT AMOUNT: "_$J(+$P(T0,U,7),"",2)_" MATCH STATUS: "_$$EXTERNAL^DILFD(344.31,.08,,$P(T0,U,8))
119 .. S:$O(^TMP($J,"RCDPETOT",344.3,Z)) CT=CT+1,^TMP($J,"RCXM",CT)=" "
120 . I $P(DATA,U,3) S ^TMP("RCDAILYACT",$J,DT,Z)=Z0
121 ;
122 K ^TMP($J,"RC1")
123 I $O(^TMP("RCDAILYACT",$J,0)) D ; Daily activity rep automatic bulletin
124 . N XMBODY,XMB,XMINSTR,XMTYPE,XMFULL,XMTO,XMZ,XMERR,XMSUBJ
125 . K ^TMP($J,"RCDPE_DAR")
126 . D RPT1^RCDPEDAR(1,0,DT,DT)
127 . K ^TMP("RCDAILYACT",$J)
128 . Q:'$O(^TMP($J,"RCDPE_DAR",0))
129 . S XMTO("I:G.RCDPE PAYMENTS")=""
130 . S XMBODY="^TMP($J,""RCDPE_DAR"")"
131 . S XMSUBJ="EDI LBOX - AUTO DAILY ACTIVITY SUMMARY - "_$$FMTE^XLFDT(DT,2)
132 . D ;
133 .. N DUZ
134 .. S DUZ=.5,DUZ(0)="@"
135 .. D SENDMSG^XMXAPI(.5,XMSUBJ,XMBODY,.XMTO,,.XMZ)
136 . K ^TMP($J,"RCDPE_DAR")
137 Q
138 ;
139HDR(CT,HD) ; Header array set
140 ; CT = line count, passed by reference
141 ; HD = flag returned as 1 so the header is only output once
142 N Q
143 S CT=CT+1,^TMP($J,"RCXM",CT)=" "
144 S CT=CT+1,^TMP($J,"RCXM",CT)=$J("",20)_"********** EFT DEPOSIT RECORDS **********"
145 S CT=CT+1,^TMP($J,"RCXM",CT)=" EFT DEPOSIT EFT RECEIPT POSTED AMOUNT"
146 S CT=CT+1,^TMP($J,"RCXM",CT)=" "
147 S CT=CT+1,^TMP($J,"RCXM",CT)=" TRACE # PAYER NAME/ID"
148 S CT=CT+1,Q="",$P(Q,"=",79)="",^TMP($J,"RCXM",CT)=Q
149 S HD=1
150 Q
151 ;
Note: See TracBrowser for help on using the repository browser.