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

RCDPEX1.m

Go to the documentation of this file.
RCDPEX1 ;ALB/TMK - ELECTRONIC EOB MESSAGE EXCEPTIONS PROCESS ;2 Aug 2018 21:41:05
 ;;4.5;Accounts Receivable;**173,262,298,304,326,332**;Mar 20, 1995;Build 40
 ;Per VA Directive 6402, this routine should not be modified.
 ;
EN ; Main entry point
 D DT^DICRW
 N RCFASTXT,RCDA,RCEXCTYP,RCINCEX,DIR,Y,X,RCPAR,RCPAY,RCQUIT,RCTYPE,XX
 ; Ask for TRANSMISSION exceptions or DATA exceptions
 S DIR("A")="DO YOU WANT TO SEE (T)RANSMISSION OR (D)ATA EXCEPTIONS?: ",DIR("B")="T",DIR(0)="SAO^T:TRANSMISSION;D:DATA"
 S DIR("?",1)="TRANSMISSION EXCEPTIONS INCLUDE ANY PROBLEM ENCOUNTERED WHEN AN ERA/EEOB",DIR("?",2)="  IS RECEIVED AT THE SITE AND BEFORE IT IS STORED PERMANENTLY IN VISTA."
 S DIR("?",3)="  THIS INCLUDES PARTIAL MESSAGE RECEIPTS, EXTRACT PROBLEMS AND EEOBs THAT ",DIR("?",4)="  WERE TRANSFERRED IN FROM ANOTHER SITE."
 S DIR("?",5)="DATA EXCEPTIONS INCLUDE EEOB DETAIL RECORDS FOR SPECIFIC BILLS THAT CAN'T BE"
 S DIR("?",6)="  FULLY PROCESSED INTO THE VISTA SYSTEM.  THIS INCLUDES EEOB DETAIL FOR",DIR("?",7)="  CLAIMS THAT NEED TO BE TRANSFERRED TO ANOTHER SITE OR WHOSE DETAIL COULD",DIR("?")="  NOT BE STORED IN IB"
 D ^DIR K DIR
 I Y=""!(Y="^") Q
 S RCEXCTYP=Y,RCQUIT=0
 I RCEXCTYP="D" D  ; Include exceptions for MEDICAL, PHARMACY or BOTH - PRCA*4.5*298 Filter question for medical, pharmacy or both
 . S RCTYPE=$$RTYPE^RCDPEU1("A") ; PRCA*4.5*326 Pick MEDICAL/PHARMACY/TRICARE/ALL
 . I RCTYPE=-1 S RCQUIT=1 Q
 . ;
 . S RCPAY=$$PAYRNG^RCDPEU1()    ; PRCA*4.5*326 New payer selection
 . I RCTYPE=-1 S RCQUIT=1 Q
 . I RCPAY'="A" D  ;
 ..  S RCPAR("TYPE")=RCTYPE,RCPAR("SELC")=RCPAY
 ..  S RCPAR("DICA")="Select Insurance Company NAME: "
 ..  S XX=$$SELPAY^RCDPEU1(.RCPAR)
 ..  I XX=-1 S RCQUIT=1
 ;
 ; Exit if the user asks to exit. 
 I RCQUIT Q
 ;
 ; Transmission exceptions
 I RCEXCTYP="T" D EN^VALM("RCDPEX EOB EXCEPTION LIST")
 I RCEXCTYP="D" D EN^VALM("RCDPEX EOB_SUM EXCEPTION LIST")
 K RCFASTXT,RCDA
 Q
 ;
EN1 ; Duplicate ERA Worklist [RCDPE DUPLICATE ERA WORKLIST] option
 D EN^VALM("RCDPEX DUPLICATE ERA LIST")
 K RCFASTXT,RCDA
 Q
 ;
INITD ; set up initial variables (RCDPEX DUPLICATE ERA LIST)
 S U="^",VALMCNT=0,VALMBG=1
 D BLD("DUPLICATE ERA")
 Q
 ;
INIT ; set up initial variables
 S U="^",VALMCNT=0,VALMBG=1
 D BLD("TRANSMISSION")
 Q
 ;
BLD(MODE) ; EP - from RCDPEX -- build list of messages
 ; INPUT: MODE = "TRANSMISSION" or "DUPLICATE ERA"
 ; OUTPUT: ^TMP("RCDPEX-EOB",$J)
 N DA,DR,RCSEQ,RCMSG,RCS,RCER,RCDPDATA,RC0,RCDUP,X,Z
 K ^TMP("RCDPEX-EOB",$J),^TMP("RCDPEX-EOBDX",$J)
 S (RCMSG,RCSEQ,VALMCNT)=0
 ; Extract from 344.5
 F  S RCMSG=$O(^RCY(344.5,"AEXC",1,RCMSG)) Q:'RCMSG  S RC0=$G(^RCY(344.5,RCMSG,0)) D
 . ; Check if message is on duplicate ERA worklist
 . S RCDUP=+$$GET1^DIQ(344.5,RCMSG_",",.15,"I")
 . ; Only display messages relevant to worklist type
 . I MODE="TRANSMISSION",RCDUP Q
 . I MODE="DUPLICATE ERA",'RCDUP Q
 . ; add to list
 . S RCSEQ=RCSEQ+1
 . S DR=".01:.03;.1;.11",DA=RCMSG D DIQ3445(DA,DR)
 . S X=""
 . S X=$$SETSTR^VALM1($E(RCSEQ_"    ",1,4)_"  "_$G(RCDPDATA(344.5,RCMSG,.01,"E")),"",1,26)  ;(#.01) MESSAGE ID [1F]
 . S X=$$SETSTR^VALM1("  "_$E($G(RCDPDATA(344.5,RCMSG,.02,"I")),4,6),X,27,9)  ;(#.02) MESSAGE TYPE [2S]
 . S X=$$SETSTR^VALM1("  "_$G(RCDPDATA(344.5,RCMSG,.03,"E")),X,36,22)  ;(#.03) DATE RECORDED [3D]
 . S X=$$SETSTR^VALM1("  "_$G(RCDPDATA(344.5,RCMSG,.11,"E")),X,58,17)  ;(#.11) MAIL MESSAGE [11F] 
 . D SET(X,344.5,RCMSG,RCSEQ)
 . S X="    EXCEPTION: "_$G(RCDPDATA(344.5,RCMSG,.1,"E"))  ;(#.1) EXCEPTION CATEGORY [10S]
 . D SET(X,344.5,RCMSG,RCSEQ)
 . S DR=1,DA=RCMSG D DIQ3445(DA,DR) ;(#1) DISPLAY DATA
 . S Z=0 F  S Z=$O(RCDPDATA(344.5,RCMSG,1,Z)) Q:'Z  S X="      "_RCDPDATA(344.5,RCMSG,1,Z) D SET(X,344.5,RCMSG,RCSEQ)
 ;
 I '$D(^TMP("RCDPEX-EOB",$J)) S VALMCNT=2,^TMP("RCDPEX-EOB",$J,1,0)=" ",^TMP("RCDPEX-EOB",$J,2,0)="   There Are No EEOB Exception Records On File"
 Q
 ;
FNL ; -- Clean up list
 K ^TMP("RCDPEX-EOBDX",$J),^TMP("RCDPEU1",$J) ; PRCA*4.5*326
 D CLEAN^VALM10
 K RCFASTXT
 Q
 ;
SET(X,FILE,RCMSG,RCSEQ) ; -- set arrays for EOB exception records
 ; X = the data to set into the global
 S VALMCNT=VALMCNT+1,^TMP("RCDPEX-EOB",$J,VALMCNT,0)=X
 S ^TMP("RCDPEX-EOB",$J,"IDX",VALMCNT,RCSEQ)=""
 S ^TMP("RCDPEX-EOBDX",$J,RCSEQ)=VALMCNT_U_RCMSG_U_FILE
 Q
 ;
HDR ;
 S VALMHDR(1)=$J("",21)_"ERA/EEOB MESSAGES WITH EXCEPTION CONDITIONS"
 S VALMHDR(2)=" "
 Q
 ;
HDR1 ;
 S VALMHDR(1)=$J("",21)_"Duplicate 835ERA Messages",VALMHDR(2)=" "
 Q
 ;
DIQ3445(DA,DR) ; DIQ call to retrieve data for DR fields in file 344.5
 N %I,D0,DIC,DIQ,DIQ2,YY
 K RCDPDATA(344.5)
 S DIQ(0)="EI",DIC="^RCY(344.5,",DIQ="RCDPDATA" D EN^DIQ1
 Q
 ;
DIQ3444(DA,DR) ; DIQ call to retrieve data for DR fields in file 344.4
 N %I,D0,DIC,DIQ,DIQ2,YY
 K RCDPDATA(344.4)
 S DIQ(0)="EI",DIC="^RCY(344.4,",DIQ="RCDPDATA" D EN^DIQ1
 Q
 ;