RCDPEV ;ALB/TMK - EDI LOCKBOX WORKLIST VERIFY PAYMENTS ;28-JAN-04 ;;4.5;Accounts Receivable;**208,138**;Mar 20, 1995 ;;Per VHA Directive 10-93-142, this routine should not be modified. Q ; AUTOVER(RCSCR) ; Entrypoint to auto-verify an ERA worklist ; RCSCR = ien of the ERA worklist entry in file 344.49 N Z,Z0,Z00,RC399,RC430,RC3444,RC36112,X,X1,X2,X12,DA,DR,DIE S Z=0 F S Z=$O(^RCY(344.49,Z)) Q:'Z S Z0=0 F S Z0=$O(^RCY(344.49,Z,1,Z0)) Q:'Z0 I $P($G(^(Z0,0)),U,7) S Z00=$G(^(0)) D . I $$VER(RCSCR,+$P(Z00,U,7),+$P(Z00,U,9)) S DA(1)=RCSCR,DA=Z0,DIE="^RCY(344.49,"_DA(1)_",1,",DR=".13////1" D ^DIE ; Q ; VER(RCSCR,RCBILL,RCREF,F1) ; Run verif for WL entry RCSCR in file 344.49 ; RCBILL = ien of claim in file 430 ; RCREF = the entry referenced in subfile file 344.41 ; F1 = flag if set = 1 will return all data, regardless of if it ; matches or not. If flag is set to 1 and data doesn't match, ; an asterisk (*) will preceed the actual data value in the ; corresponding piece ; Function returns the following data: ; '^' piece 1: 1 if verfied OK 0 if not ; '^' piece 2: patient name from VistA if mismatch ; '^' piece 3: patient name from EEOB if mismatch ; '^' piece 4: amt billed from VistA if mismatch ; '^' piece 5: amt billed from EEOB if mismatch ; '^' piece 6: date of service 'from' from VistA if mismatch ; '^' piece 7: date of service 'from' from EEOB if mismatch ; '^' piece 8: date of service 'to' from VistA if mismatch ; '^' piece 9: date of service 'to' from EEOB if mismatch ; '^' piece 10: patient SSN from VistA ; N RESULT,SETF1,RC430,RC399,RC3444,RC36112,X,X1,X2,X12,NM,NM1,DTOK,SSN,RC43013 S RESULT=1,SETF1=$S($G(F1):"*",1:"") S RC430=$G(^PRCA(430,RCBILL,0)),RC43013=$G(^(13)) S RC399=$G(^DGCR(399,RCBILL,0)) S RC3444=$G(^RCY(344.4,RCSCR,1,RCREF,0)) S RC36112=$G(^IBM(361.1,+$P(RC3444,U,2),2)) ; S NM=$P($G(^DPT(+$P(RC399,U,2),0)),U),X=$E($P(NM,","),1,5) ; Name from VistA S SSN=$P($G(^DPT(+$P(RC399,U,2),0)),U,9) S NM1=$P(RC3444,U,15),X1=$E($P(NM1,","),1,5) ; from EEOB I $G(F1),X1=X S $P(RESULT,U,2)=NM,$P(RESULT,U,3)=NM1 I X1'=X S $P(RESULT,U)=0,$P(RESULT,U,2)=SETF1_NM,$P(RESULT,U,3)=SETF1_NM1 ; S X=$P(RC430,U,3)+$P(RC43013,U)+$P(RC43013,U,2) ; Amount billed from VistA (including MRA totals) S X1=$P(RC36112,U,4) ; from EEOB I $G(F1),+X=+X1 S $P(RESULT,U,4)=X,$P(RESULT,U,5)=X1 I +X'=+X1 S $P(RESULT,U)=0,$P(RESULT,U,4)=SETF1_X,$P(RESULT,U,5)=SETF1_X1 ; S X=$P($G(^DGCR(399,+RCBILL,"U")),U) ; Date of service from VistA S X2=$P($G(^DGCR(399,+RCBILL,"U")),U,2) S X1=$P($G(^IBM(361.1,+$P(RC3444,U,2),1)),U,10) ; from EEOB S X12=$P($G(^IBM(361.1,+$P(RC3444,U,2),1)),U,11) ; if no date of service on EEOB, skip the check ; Date of svc on EEOB must fall into date range for svc dates in VistA S DTOK=0 I X1 D . I X1=X S DTOK=1 . I 'DTOK,X1>X S:X1'>X2 DTOK=1 . I 'DTOK,X1