source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPESR8.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: 5.6 KB
RevLine 
[613]1RCDPESR8 ;ALB/TMK - EFT return file field captions ;09-SEP-2003
2 ;;4.5;Accounts Receivable;**173**;Mar 20, 1995
3 ;
4 ; Note: if the 835 EFT flat file changes, make the corresponding changes
5 ; in this routine.
6DISP(RCMIN,RCMOUT,RCFMT,RCFULL,RCW) ; Format display for 835 EFT return msg
7 ; RCMIN = the name of the array that contains the raw message data
8 ; The data is contained at the next level and the subscript is
9 ; numeric and greater than 0 OR the data can be at the
10 ; 0-node subsequent to the final subscript.
11 ; If the message array is a global ^TMP($J,"MSG",n), RCMIN
12 ; will equal "^TMP($J,""MSG"")" and the message text will be
13 ; in ^TMP($J,"MSG",1), ^TMP($J,"MSG",2), etc. OR
14 ; the message text can be defined at TMP($J,"MSG",1,0) ^...,2,0)
15 ; etc.
16 ; RCMOUT = the name of the array that should be returned. This array
17 ; will follow the same convention as the input array. The
18 ; array will be returned with a numeric final subscript. If
19 ; RCMOUT is passed as "^TMP($J,""MSG1"")", then the display
20 ; lines will be returned in ^TMP($J,"MSG1",1),
21 ; ^TMP($J,"MSG1",2), etc. Note the array RCMOUT is killed
22 ; on entry to this call
23 ; RCFMT = 0 or null if call should return raw data, 1 to execute the
24 ; transforms attached to the fields
25 ; RCFULL = the name of an array if the data should be returned in
26 ; this array, formatted into lines for display. If not sent,
27 ; only the display data by element is returned in RCMOUT. If
28 ; RCFULL is sent, the array is killed before populating it
29 ; RCW = max # of characters per line to return in array RCFULL
30 ;
31 N Z,Z0,Z1,R,RC,RCCT,RCREF,RCDATA,RCQ
32 S RCCT=0 K @RCMOUT
33 S Z=0 F S Z=$O(@RCMIN@(Z)) Q:'Z S Z0=$S($G(@RCMIN@(Z))'="":@RCMIN@(Z),1:$G(@RCMIN@(Z,0))) I Z0'="" S RCQ=0 D
34 . F Z1=1:1:$L(Z0,U) I $P(Z0,U,Z1)'="" D Q:RCQ
35 .. S RCDATA=$P(Z0,U,Z1)
36 .. I Z1=1 D Q:RCQ
37 ... S RCREF=$S(RCDATA'["EFT":RCDATA,1:"EFT"),R=RCREF_"^RCDPESR8",RC=$P($T(@R),";;",2)
38 ... I RC="" S RCCT=RCCT+1,@RCMOUT@(RCCT)="<<<INVALID LINE TYPE - RAW DATA IS:",RCCT=RCCT+1,@RCMOUT@(RCCT)=Z0
39 .. Q:RCDATA=""
40 .. S R=RCREF_"+"_Z1_"^RCDPESR8",RC=$P($T(@R),";;",2)
41 .. I RC=""!($P(RC,U)'=RCREF) S:$S(RCDATA'="":1,1:'$P(RC,U,2)) RCCT=RCCT+1,@RCMOUT@(RCCT)="NO DATA DEFINITION PC "_Z1_": "_RCDATA Q
42 .. I RC'="" D
43 ... N X,X1,Y
44 ... S X1=$P(RC,U,4,99)
45 ... I $G(RCFMT),X1'="" S X=RCDATA X X1 S RCDATA=Y ; Output transform
46 ... S RC=$P(RC,U,3)
47 ... Q:RC=""&(RCDATA="")
48 ... S RCCT=RCCT+1,@RCMOUT@(RCCT)=$S(Z1=1:"<<<",1:"")_RC_": "_RCDATA_$S(Z1=1:">>>",1:"")
49 I $G(RCFULL)'="" D FMTDSP(RCMOUT,RCFULL,$G(RCW))
50 Q
51 ;
52FMTDSP(RCMUN,RCMFO,RCW) ; Format the display data in array named in RCMUN into
53 ; lines up to RCW characters wide RCMUN must be set up the same as the
54 ; output of the DISP call above
55 ; Returns array named in RCMFO with the last subscript being the line #
56 ; Note @RCMFO is killed on entry to this call
57 ; Default is 80 if RCW=0 or null
58 N Z,RCLINE,RCCT,RCCT1,RCMID,RCD,RCSTART,RCDASH
59 K @RCMFO
60 S:'$G(RCW) RCW=80
61 S RCDASH=" "_$TR($J("",RCW-2)," ","-")
62 S (RCCT,RCCT1)=0,RCLINE="",RCMID=RCW\2-1
63 S Z=0 F S Z=$O(@RCMUN@(Z)) Q:'Z S RCD=$G(@RCMUN@(Z)) D
64 . I $E(RCD,1,3)="<<<" D Q ; New line needed ... record start
65 .. I $L(RCLINE)>0 S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
66 .. I $L(RCLINE)=0 D
67 ... I Z>1 S RCCT=RCCT+1,@RCMFO@(RCCT)=" "
68 ... I RCD["<<<Line Type: 01 " S RCCT1=RCCT1+1,RCCT=RCCT+1,@RCMFO@(RCCT)=RCDASH,RCCT=RCCT+1,@RCMFO@(RCCT)="*** EFT PAYMENT DETAIL START - PAYMENT SEQUENCE #"_RCCT1_"***",RCCT=RCCT+1,@RCMFO@(RCCT)=RCDASH
69 ... I $L(RCD)>RCW D Q
70 .... S RCSTART=1
71 .... F S RCCT=RCCT+1,@RCMFO@(RCCT)=$E(RCD,RCSTART,RCSTART+RCW-1),RCSTART=RCSTART+RCW Q:RCSTART>$L(RCD)
72 ... S RCCT=RCCT+1,@RCMFO@(RCCT)=RCD
73 . ;
74 . I $L(RCD)>RCW D Q ; Split line if greater than width given
75 .. I $L(RCLINE) S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE
76 .. S RCSTART=1
77 .. F S RCCT=RCCT+1,@RCMFO@(RCCT)=$E(RCD,RCSTART,RCSTART+RCW-1),RCSTART=RCSTART+RCW Q:RCSTART>$L(RCD)
78 .. S RCLINE=""
79 . I $L(RCLINE)=0 D Q ; Format left side of line
80 .. S RCLINE=RCD
81 .. ;
82 .. I $L(RCLINE)>RCMID S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
83 . ;
84 . I (RCMID+$L(RCD)+1)>RCW D Q ; data too long for right side of line
85 .. S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
86 . S RCLINE=$E(RCLINE_$J("",RCMID),1,RCMID)_" "_RCD,RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
87 I $L(RCLINE) S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE
88 Q
89 ;
90 ;
91DISPADJ(RC3444,RCARRAY) ; Returns formatted lines of ERA level takeback data
92 ; in array @RCARRAY@(n) where n=line #. Data is taken from entry
93 ; # RC3444 in file 344.4, subfile 344.42
94 N RCT,Z,Z0
95 S RCT=0
96 S Z=0 F S Z=$O(^RCY(344.4,RC3444,2,Z)) Q:'Z S Z0=$G(^(Z,0)) D
97 . S RCT=RCT+1,@RCARRAY@(RCT)="REFERENCE #/BILL #: "_$P(Z0,U)
98 . S RCT=RCT+1,@RCARRAY@(RCT)=" "_$E("ADJUSTMENT CODE: "_$P(Z0,U,2)_$J("",30),1,30)_"AMOUNT: "_$J($P(Z0,U,3),0,2)
99 Q
100 ;
101EFT ;;HEADER DATA
102 ;;EFT^^Return Message ID^S Y=X_" (EFT HEADER DATA)"
103 ;;EFT^^^S Y=""
104 ;;EFT^^File Date^S Y=$$FDT^RCDPESR9(X)
105 ;;EFT^^File Time^S Y=$E(X,1,2)-$S($E(X,1,2)>12:12,1:0)_":"_$E(X,3,4)_$S($E(X,1,2)=24:" AM",$E(X,1,2)>11:" PM",1:" AM")
106 ;;EFT^1^
107 ;;EFT^^Deposit #
108 ;;EFT^^Deposit Date^S Y=$$FDT^RCDPESR9(X)
109 ;;EFT^^Total Deposit Amount^S Y=$$ZERO^RCDPESR9(X,1)
110 ;
11101 ;;EFT DETAIL RECORD
112 ;;01^^Line Type^S Y=X_" (PAYMENT IDENTIFICATION)"
113 ;;01^^Trace #
114 ;;01^^Date Claims Paid^S Y=$$FDT^RCDPESR9(X)
115 ;;01^^TOTAL AMOUNT PAID^S Y=$$ZERO^RCDPESR9(X,1)
116 ;;01^^Payer Name
117 ;;01^^Payer ID
118 ;;01^^Provider Tax ID Sent
119 ;;01^^Tax ID correction Flag^S Y=$S(X="E":"CHANGED BY EPHRA",X="C":"DETERMINED FROM CLAIM DATA",X="":"NO CHANGE MADE",1:X)
120 ;;01^^ACH Trace #
121 ;
Note: See TracBrowser for help on using the repository browser.