RCDPEU ;ALB/TMK - ELECTRONIC ERA UTILITIES ;05-NOV-02
;;4.5;Accounts Receivable;**173,367,409**;Mar 20, 1995;Build 17
;Per VA Directive 6402, this routine should not be modified.
Q
;
EFTMTCH ; Match an electronic EFT's deposit to a paper EOB's receipt record
; Select the receipt record. Match the totals.
N DIR,X,Y,RCDEP,DUOUT,DTOUT
S DIR(0)="PAO^RCY(344.31,:AEMQ",DIR("S")="I $P($G(^(0),U,8)=0" ; must be unmatched
S DIR("A")="Select EFT RECORD (Unmatched to an ERA): " D ^DIR K DIR
I $D(DTOUT)!$D(DUOUT) G MATCHQ2
S RCDEP=+Y
MATCHQ2 Q
;
MATCH ; Manual start of ERA/EFT automatic matching
D EN^RCDPEM(1,1)
Q
;
ADJ(RC3444,RCADJ) ; Function-determines if ERA record contains adjustments
; RC3444 = ien of ERA entry in file 344.4
; Return value = 1 for ERA level adjustments found, 2 if claim level
; adjustments found, 3 if both found
; Also returns RCADJ(ERA ien,seq#)=bill # for claim level adjustments
;
N Z,DA
S RCADJ=0
;
I $O(^RCY(344.4,RC3444,2,0)) S RCADJ=1 ;ERA level adjustment
;
I 'RCADJ D ; Claim level adjustment
. S DA(1)=RC3444
. S Z=0 F S Z=$O(^RCY(344.4,RC3444,1,Z)) Q:'Z I $P($G(^(Z,0)),U,14) S RCADJ=RCADJ+2,DA=Z,RCADJ(RC3444,Z)=$$GETBILL^RCDPESR0(.DA)
;
Q RCADJ
;
DEPREC(RC3443) ; Returns the ien of the receipt for the EFT deposit RC3443
; RC3443 = ien of entry in file 344.3
N Z
S Z=+$P($G(^RCY(344.3,+RC3443,0)),U,3)
S Z=+$O(^RCY(344,"AD",Z,0))
Q Z
;
EDILB(RCRCPT) ; Given receipt ien RCRCPT, return 1 if the receipt is for
; an EDI Lockbox deposit (EFT), 2 if for EDI Lockbox detail (EOB/ERA)
; or 0 if not EDI Lockbox related (paper check)
N X,Z
S Z=0
S X=$$EDILBEV($P($G(^RCY(344,RCRCPT,0)),U,4))
I X D
. I $P($G(^RCY(344,RCRCPT,0)),U,6),$$EDILBDEP(+$P(^(0),U,6)) S Z=1 Q ; EFT deposit associated with receipt
. I '$P($G(^RCY(344,RCRCPT,0)),U,6) S Z=2 Q ; EFT detail
Q Z
;
EDILBDEP(RCDEP) ; Given deposit ien RCDEP (file 344.1), return 1 if there is
; an EFT referrencing it in file 344.3
N X,Y
S X=$O(^RCY(344.3,"ARDEP",RCDEP,0))
Q (X>0)
;
EDILBEV(PAYTYP) ; Given ien of file 341.1 PAYTYP, return 1 if the pay type's
; event number is EDI LOCKBOX
; Input: PAYTYP - IEN for AR EVENT TYPE (341.1)
; Returns: 0 if PAYTP is not 14 or 18, Otherwise returns PAYTYP IEN
;PRCA*4.5*409 This method used to return a 1 if the Payment Type was 14 (EDI LOCKBOX) and 0 otherwise
; Now it returns 14 (if EDI LOCKBOX), 18 (if OGC-EFT) and 0 otherwise
N X
S X=$P($G(^RC(341.1,+$G(PAYTYP),0)),U,2)
I X'=14,X'=18 Q 0
Q PAYTYP
;
LBEVENT() ; Returns the IEN of EDI Lockbox event 14 in file 341.1
Q +$O(^RC(341.1,"AC",14,0))
;
HACERA(RCERA) ; Functions to determine if ERA entry in file 344.4 is an
; ERA received from HAC (CHAMPVA)
; RCERA = ien of entry file 344.4
; Returns 1 if it is, 0 if not
; PRCA*4.5*367 - Add logic to determine if ERA is CHAMPVA
N RCPMTHD,RCTRACE
S RCTRACE=$$GET1^DIQ(344.4,RCERA_",",.02)
S RCPMTHD=$$GET1^DIQ(344.4,RCERA_",",.15)
Q $E(RCTRACE,1,3)="TDA"&(RCPMTHD="CHK")
;
HACEFT(RCEFT) ; Functions to determine if EFT entry in file 344.3 is an
; EFT received from HAC (CHAMPVA)
; RCEFT = ien of entry file 344.3
; Returns 1 if it is, 0 if not
Q ($E($P($G(^RCY(344.3,+RCEFT,0)),U,6),1,3)="HAC")
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCDPEU 3339 printed Oct 16, 2024@17:46:23 Page 2
RCDPEU ;ALB/TMK - ELECTRONIC ERA UTILITIES ;05-NOV-02
+1 ;;4.5;Accounts Receivable;**173,367,409**;Mar 20, 1995;Build 17
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
+4 ;
EFTMTCH ; Match an electronic EFT's deposit to a paper EOB's receipt record
+1 ; Select the receipt record. Match the totals.
+2 NEW DIR,X,Y,RCDEP,DUOUT,DTOUT
+3 ; must be unmatched
SET DIR(0)="PAO^RCY(344.31,:AEMQ"
SET DIR("S")="I $P($G(^(0),U,8)=0"
+4 SET DIR("A")="Select EFT RECORD (Unmatched to an ERA): "
DO ^DIR
KILL DIR
+5 IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO MATCHQ2
+6 SET RCDEP=+Y
MATCHQ2 QUIT
+1 ;
MATCH ; Manual start of ERA/EFT automatic matching
+1 DO EN^RCDPEM(1,1)
+2 QUIT
+3 ;
ADJ(RC3444,RCADJ) ; Function-determines if ERA record contains adjustments
+1 ; RC3444 = ien of ERA entry in file 344.4
+2 ; Return value = 1 for ERA level adjustments found, 2 if claim level
+3 ; adjustments found, 3 if both found
+4 ; Also returns RCADJ(ERA ien,seq#)=bill # for claim level adjustments
+5 ;
+6 NEW Z,DA
+7 SET RCADJ=0
+8 ;
+9 ;ERA level adjustment
IF $ORDER(^RCY(344.4,RC3444,2,0))
SET RCADJ=1
+10 ;
+11 ; Claim level adjustment
IF 'RCADJ
Begin DoDot:1
+12 SET DA(1)=RC3444
+13 SET Z=0
FOR
SET Z=$ORDER(^RCY(344.4,RC3444,1,Z))
if 'Z
QUIT
IF $PIECE($GET(^(Z,0)),U,14)
SET RCADJ=RCADJ+2
SET DA=Z
SET RCADJ(RC3444,Z)=$$GETBILL^RCDPESR0(.DA)
End DoDot:1
+14 ;
+15 QUIT RCADJ
+16 ;
DEPREC(RC3443) ; Returns the ien of the receipt for the EFT deposit RC3443
+1 ; RC3443 = ien of entry in file 344.3
+2 NEW Z
+3 SET Z=+$PIECE($GET(^RCY(344.3,+RC3443,0)),U,3)
+4 SET Z=+$ORDER(^RCY(344,"AD",Z,0))
+5 QUIT Z
+6 ;
EDILB(RCRCPT) ; Given receipt ien RCRCPT, return 1 if the receipt is for
+1 ; an EDI Lockbox deposit (EFT), 2 if for EDI Lockbox detail (EOB/ERA)
+2 ; or 0 if not EDI Lockbox related (paper check)
+3 NEW X,Z
+4 SET Z=0
+5 SET X=$$EDILBEV($PIECE($GET(^RCY(344,RCRCPT,0)),U,4))
+6 IF X
Begin DoDot:1
+7 ; EFT deposit associated with receipt
IF $PIECE($GET(^RCY(344,RCRCPT,0)),U,6)
IF $$EDILBDEP(+$PIECE(^(0),U,6))
SET Z=1
QUIT
+8 ; EFT detail
IF '$PIECE($GET(^RCY(344,RCRCPT,0)),U,6)
SET Z=2
QUIT
End DoDot:1
+9 QUIT Z
+10 ;
EDILBDEP(RCDEP) ; Given deposit ien RCDEP (file 344.1), return 1 if there is
+1 ; an EFT referrencing it in file 344.3
+2 NEW X,Y
+3 SET X=$ORDER(^RCY(344.3,"ARDEP",RCDEP,0))
+4 QUIT (X>0)
+5 ;
EDILBEV(PAYTYP) ; Given ien of file 341.1 PAYTYP, return 1 if the pay type's
+1 ; event number is EDI LOCKBOX
+2 ; Input: PAYTYP - IEN for AR EVENT TYPE (341.1)
+3 ; Returns: 0 if PAYTP is not 14 or 18, Otherwise returns PAYTYP IEN
+4 ;PRCA*4.5*409 This method used to return a 1 if the Payment Type was 14 (EDI LOCKBOX) and 0 otherwise
+5 ; Now it returns 14 (if EDI LOCKBOX), 18 (if OGC-EFT) and 0 otherwise
+6 NEW X
+7 SET X=$PIECE($GET(^RC(341.1,+$GET(PAYTYP),0)),U,2)
+8 IF X'=14
IF X'=18
QUIT 0
+9 QUIT PAYTYP
+10 ;
LBEVENT() ; Returns the IEN of EDI Lockbox event 14 in file 341.1
+1 QUIT +$ORDER(^RC(341.1,"AC",14,0))
+2 ;
HACERA(RCERA) ; Functions to determine if ERA entry in file 344.4 is an
+1 ; ERA received from HAC (CHAMPVA)
+2 ; RCERA = ien of entry file 344.4
+3 ; Returns 1 if it is, 0 if not
+4 ; PRCA*4.5*367 - Add logic to determine if ERA is CHAMPVA
+5 NEW RCPMTHD,RCTRACE
+6 SET RCTRACE=$$GET1^DIQ(344.4,RCERA_",",.02)
+7 SET RCPMTHD=$$GET1^DIQ(344.4,RCERA_",",.15)
+8 QUIT $EXTRACT(RCTRACE,1,3)="TDA"&(RCPMTHD="CHK")
+9 ;
HACEFT(RCEFT) ; Functions to determine if EFT entry in file 344.3 is an
+1 ; EFT received from HAC (CHAMPVA)
+2 ; RCEFT = ien of entry file 344.3
+3 ; Returns 1 if it is, 0 if not
+4 QUIT ($EXTRACT($PIECE($GET(^RCY(344.3,+RCEFT,0)),U,6),1,3)="HAC")
+5 ;