Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RCDPESR8

RCDPESR8.m

Go to the documentation of this file.
  1. RCDPESR8 ;ALB/TMK - EFT return file field captions ;09-SEP-2003
  1. ;;4.5;Accounts Receivable;**173**;Mar 20, 1995
  1. ;
  1. ; Note: if the 835 EFT flat file changes, make the corresponding changes
  1. ; in this routine.
  1. DISP(RCMIN,RCMOUT,RCFMT,RCFULL,RCW) ; Format display for 835 EFT return msg
  1. ; RCMIN = the name of the array that contains the raw message data
  1. ; The data is contained at the next level and the subscript is
  1. ; numeric and greater than 0 OR the data can be at the
  1. ; 0-node subsequent to the final subscript.
  1. ; If the message array is a global ^TMP($J,"MSG",n), RCMIN
  1. ; will equal "^TMP($J,""MSG"")" and the message text will be
  1. ; in ^TMP($J,"MSG",1), ^TMP($J,"MSG",2), etc. OR
  1. ; the message text can be defined at TMP($J,"MSG",1,0) ^...,2,0)
  1. ; etc.
  1. ; RCMOUT = the name of the array that should be returned. This array
  1. ; will follow the same convention as the input array. The
  1. ; array will be returned with a numeric final subscript. If
  1. ; RCMOUT is passed as "^TMP($J,""MSG1"")", then the display
  1. ; lines will be returned in ^TMP($J,"MSG1",1),
  1. ; ^TMP($J,"MSG1",2), etc. Note the array RCMOUT is killed
  1. ; on entry to this call
  1. ; RCFMT = 0 or null if call should return raw data, 1 to execute the
  1. ; transforms attached to the fields
  1. ; RCFULL = the name of an array if the data should be returned in
  1. ; this array, formatted into lines for display. If not sent,
  1. ; only the display data by element is returned in RCMOUT. If
  1. ; RCFULL is sent, the array is killed before populating it
  1. ; RCW = max # of characters per line to return in array RCFULL
  1. ;
  1. N Z,Z0,Z1,R,RC,RCCT,RCREF,RCDATA,RCQ
  1. S RCCT=0 K @RCMOUT
  1. 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
  1. . F Z1=1:1:$L(Z0,U) I $P(Z0,U,Z1)'="" D Q:RCQ
  1. .. S RCDATA=$P(Z0,U,Z1)
  1. .. I Z1=1 D Q:RCQ
  1. ... S RCREF=$S(RCDATA'["EFT":RCDATA,1:"EFT"),R=RCREF_"^RCDPESR8",RC=$P($T(@R),";;",2)
  1. ... I RC="" S RCCT=RCCT+1,@RCMOUT@(RCCT)="<<<INVALID LINE TYPE - RAW DATA IS:",RCCT=RCCT+1,@RCMOUT@(RCCT)=Z0
  1. .. Q:RCDATA=""
  1. .. S R=RCREF_"+"_Z1_"^RCDPESR8",RC=$P($T(@R),";;",2)
  1. .. 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
  1. .. I RC'="" D
  1. ... N X,X1,Y
  1. ... S X1=$P(RC,U,4,99)
  1. ... I $G(RCFMT),X1'="" S X=RCDATA X X1 S RCDATA=Y ; Output transform
  1. ... S RC=$P(RC,U,3)
  1. ... Q:RC=""&(RCDATA="")
  1. ... S RCCT=RCCT+1,@RCMOUT@(RCCT)=$S(Z1=1:"<<<",1:"")_RC_": "_RCDATA_$S(Z1=1:">>>",1:"")
  1. I $G(RCFULL)'="" D FMTDSP(RCMOUT,RCFULL,$G(RCW))
  1. Q
  1. ;
  1. FMTDSP(RCMUN,RCMFO,RCW) ; Format the display data in array named in RCMUN into
  1. ; lines up to RCW characters wide RCMUN must be set up the same as the
  1. ; output of the DISP call above
  1. ; Returns array named in RCMFO with the last subscript being the line #
  1. ; Note @RCMFO is killed on entry to this call
  1. ; Default is 80 if RCW=0 or null
  1. N Z,RCLINE,RCCT,RCCT1,RCMID,RCD,RCSTART,RCDASH
  1. K @RCMFO
  1. S:'$G(RCW) RCW=80
  1. S RCDASH=" "_$TR($J("",RCW-2)," ","-")
  1. S (RCCT,RCCT1)=0,RCLINE="",RCMID=RCW\2-1
  1. S Z=0 F S Z=$O(@RCMUN@(Z)) Q:'Z S RCD=$G(@RCMUN@(Z)) D
  1. . I $E(RCD,1,3)="<<<" D Q ; New line needed ... record start
  1. .. I $L(RCLINE)>0 S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
  1. .. I $L(RCLINE)=0 D
  1. ... I Z>1 S RCCT=RCCT+1,@RCMFO@(RCCT)=" "
  1. ... 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
  1. ... I $L(RCD)>RCW D Q
  1. .... S RCSTART=1
  1. .... F S RCCT=RCCT+1,@RCMFO@(RCCT)=$E(RCD,RCSTART,RCSTART+RCW-1),RCSTART=RCSTART+RCW Q:RCSTART>$L(RCD)
  1. ... S RCCT=RCCT+1,@RCMFO@(RCCT)=RCD
  1. . ;
  1. . I $L(RCD)>RCW D Q ; Split line if greater than width given
  1. .. I $L(RCLINE) S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE
  1. .. S RCSTART=1
  1. .. F S RCCT=RCCT+1,@RCMFO@(RCCT)=$E(RCD,RCSTART,RCSTART+RCW-1),RCSTART=RCSTART+RCW Q:RCSTART>$L(RCD)
  1. .. S RCLINE=""
  1. . I $L(RCLINE)=0 D Q ; Format left side of line
  1. .. S RCLINE=RCD
  1. .. ;
  1. .. I $L(RCLINE)>RCMID S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
  1. . ;
  1. . I (RCMID+$L(RCD)+1)>RCW D Q ; data too long for right side of line
  1. .. S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
  1. . S RCLINE=$E(RCLINE_$J("",RCMID),1,RCMID)_" "_RCD,RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE,RCLINE=""
  1. I $L(RCLINE) S RCCT=RCCT+1,@RCMFO@(RCCT)=RCLINE
  1. Q
  1. ;
  1. ;
  1. DISPADJ(RC3444,RCARRAY) ; Returns formatted lines of ERA level takeback data
  1. ; in array @RCARRAY@(n) where n=line #. Data is taken from entry
  1. ; # RC3444 in file 344.4, subfile 344.42
  1. N RCT,Z,Z0
  1. S RCT=0
  1. S Z=0 F S Z=$O(^RCY(344.4,RC3444,2,Z)) Q:'Z S Z0=$G(^(Z,0)) D
  1. . S RCT=RCT+1,@RCARRAY@(RCT)="REFERENCE #/BILL #: "_$P(Z0,U)
  1. . 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)
  1. Q
  1. ;
  1. EFT ;;HEADER DATA
  1. ;;EFT^^Return Message ID^S Y=X_" (EFT HEADER DATA)"
  1. ;;EFT^^^S Y=""
  1. ;;EFT^^File Date^S Y=$$FDT^RCDPESR9(X)
  1. ;;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")
  1. ;;EFT^1^
  1. ;;EFT^^Deposit #
  1. ;;EFT^^Deposit Date^S Y=$$FDT^RCDPESR9(X)
  1. ;;EFT^^Total Deposit Amount^S Y=$$ZERO^RCDPESR9(X,1)
  1. ;
  1. 01 ;;EFT DETAIL RECORD
  1. ;;01^^Line Type^S Y=X_" (PAYMENT IDENTIFICATION)"
  1. ;;01^^Trace #
  1. ;;01^^Date Claims Paid^S Y=$$FDT^RCDPESR9(X)
  1. ;;01^^TOTAL AMOUNT PAID^S Y=$$ZERO^RCDPESR9(X,1)
  1. ;;01^^Payer Name
  1. ;;01^^Payer ID
  1. ;;01^^Provider Tax ID Sent
  1. ;;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)
  1. ;;01^^ACH Trace #
  1. ;