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

IBCECSA6.m

Go to the documentation of this file.
IBCECSA6 ;ALB/CXW/PJH - VIEW EOB SCREEN ;01-OCT-1999
 ;;2.0;INTEGRATED BILLING;**137,135,155,417,431,451,488,547**;21-MAR-1994;Build 119
 ;;Per VA Directive 6402, this routine should not be modified.
 ;
 ; reference to $$VFILE^DILFD allowed with IA#2055  (IB*2.0*547)
 ;
BLD ;build EOB data display
 D GETEOB(IBCNT,0)
 Q
 ;
GETEOB(IBCNT,IBSRC,IBFULL,IBJTIBLN) ; Get EOB data in display format
 ; IBCNT = the ien of the entry in file 361.1
 ; IBSRC = 1 if called from AR, 0 if List Manager format needed
 ;       = 2 if called from AR and header data is desired
 ;   If IBSRC > 0  ^TMP("PRCA_EOB",$J,IBCNT,n)=line n's text is ret'd
 ; IBFULL = 1 if no check should be made to eliminate a fld whose value=0
 ; IBJTIBLN = line number to start VALMCNT with (optional)
 ;            used by IBJTBA1
 ;
 N IBREC,IBTYP,CNT,IBREM
 S IBFULL=$G(IBFULL),IBSRC=$G(IBSRC)
 I IBSRC N VALMBG,VALMCNT
 S VALMCNT=0,VALMBG=1,CNT=0
 I $G(IBJTIBLN)>0 S VALMCNT=IBJTIBLN
 S IBREC=$G(^IBM(361.1,IBCNT,0)),IBTYP=$P(IBREC,U,4)
 I IBSRC K ^TMP("PRCA_EOB",$J,IBCNT)
 ; Once we're displaying a single EOB, remove the multiple EOB header of 
 ; the View EOB screen that was set in HDR^IBCEOB2 - VALMHDR(4).
 I 'IBSRC,$G(VALMHDR(4))'="" S VALMHDR(4)=""
 D GEN,PAY,ARCP^IBCECSA7,CLVL,CLVLA,MIN^IBCECSA5,MOUT,LLVLA^IBCECSA7,RDATA^IBCECSA7
 Q
 ;
SEL(IB,ONE) ;
 N IBDA
 D EN^VALM2($G(XQORNOD(0)),$S('$G(ONE):"",1:"S"))
 S IBDA=0 S IBDA=$O(VALMY(IBDA)) Q:'IBDA  D
 . S IB=$P($G(^TMP("IBCECSD",$J,IBDA)),U,2)
 . S IBONE=1
 Q
 ;
ACT ; Reposition display using actions
 I '$G(IBONE) D SEL(.IBCNT,1) D BLD:$G(IBCNT)
 S VALMBG=$G(^TMP("IBCECSD",$J,"X",+$G(IBACT))) S:'VALMBG VALMBG=1
 S VALMBCK="R"
 Q
 ;
SET(IBSRC,X,CNT,IBCNT) ;set list manager arrays
 S VALMCNT=VALMCNT+1,IBSRC=$G(IBSRC)
 ;
 I IBSRC D  Q
 . S ^TMP("PRCA_EOB",$J,IBCNT,VALMCNT)=X
 ;
 S ^TMP("IBCECSD",$J,VALMCNT,0)=X
 S ^TMP("IBCECSD",$J,"IDX",VALMCNT,CNT)=""
 S ^TMP("IBCECSD",$J,CNT)=VALMCNT_U_IBCNT
 Q
 ;
GEN ;
 S IBSRC=$G(IBSRC) Q:IBSRC=1
 N IBREC1,IBTMP,IBSPL
 S IBSPL=+$O(^IBM(361.1,IBCNT,8,0)),IBSPL=(+$O(^(IBSPL))'=IBSPL)
 S IB=$$SETSTR^VALM1("EOB GENERAL INFORMATION:","",1,50)
 D SET(IBSRC,IB,CNT,IBCNT)
 I 'IBSRC D
 . D CNTRL^VALM10(VALMCNT,1,24,IORVON,IORVOFF)
 . S ^TMP("IBCECSD",$J,"X",1)=VALMCNT
 S IB=$$SETSTR^VALM1("Type        : "_$S(IBTYP:"MEDICARE MRA",1:"NORMAL EOB")_$S(IBSPL:" (SPLIT IN A/R)",1:""),"",2,39)
 S IB=$$SETSTR^VALM1("EOB Paid DT  : "_$$DAT1^IBOUTL($P(IBREC,U,6),1),IB,41,38)
 D SET(IBSRC,IB,CNT,IBCNT)
 I IBSRC D
 . S IB=$$SETSTR^VALM1($S(IBSRC:"Entry Dt/Tm :"_$$DAT1^IBOUTL($P(IBREC,U,5),1),1:""),"",2,39)
 . S IBTMP=$P(IBREC,U,13)
 . S IB=$$SETSTR^VALM1("Claim Status : "_$$EXTERNAL^DILFD(361.1,.13,"",IBTMP),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 . S IBTMP=$P(IBREC,U,16)
 . S IB=$$SETSTR^VALM1("Review Status: "_$$EXTERNAL^DILFD(361.1,.16,"",IBTMP),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 . S IB=$$SETSTR^VALM1("Entered By  : "_$P($G(^VA(200,+$P(IBREC,U,18),0)),U),"",2,39)
 . S IBTMP=$P(IBREC,U,15)
 . S IB=$$SETSTR^VALM1("Insurance Seq: "_$$EXTERNAL^DILFD(361.1,.15,"",IBTMP),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 I 'IBSRC D
 . S IB=$$SETSTR^VALM1($S($P(IBREC,U,17):"Manual Entry: YES",1:""),"",2,39)
 . S IBTMP=$P(IBREC,U,13)
 . S IB=$$SETSTR^VALM1("Claim Status : "_$$EXTERNAL^DILFD(361.1,.13,"",IBTMP),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 . S IBTMP=$P(IBREC,U,15)
 . S IB=$$SETSTR^VALM1("Insurance Seq: "_$$EXTERNAL^DILFD(361.1,.15,"",IBTMP),"",41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 S IBREC1=$G(^IBM(361.1,IBCNT,100))
 I $S($G(IBFULL):1,1:$P(IBREC1,U,4)'=""!($P(IBREC1,U,3)'="")) D
 . S IB=$$SETSTR^VALM1("Last Edited : "_$$DAT1^IBOUTL($P(IBREC1,U,4),1),"",2,39)
 . S IB=$$SETSTR^VALM1("Last Edit By : "_$P($G(^VA(200,+$P(IBREC1,U,3),0)),U),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 ;
 D INSINF^IBCECSA7(+IBREC,CNT,IBCNT)
 ;
 ;Additional fields for HIPAA 5010
 I IBSRC D
 .N IBOSN,IBOSN1,IBREC50,IBREC51
 .S IBREC50=$G(^IBM(361.1,IBCNT,50)),IBREC51=$G(^IBM(361.1,IBCNT,51))
 .S IB=$$SETSTR^VALM1("Claim Rec'd Date     : "_$$DAT1^IBOUTL($P(IBREC50,U),1),"",2,39)
 .D SET(IBSRC,IB,CNT,IBCNT)
 .S IBOSN=$E($P(IBREC51,U),1,56),IBOSN1=$E($P(IBREC51,U),57,112)
 .S IB=$$SETSTR^VALM1("Other Subscriber Name: "_IBOSN,"",2,79)
 .D SET(IBSRC,IB,CNT,IBCNT) Q:IBOSN1=""
 .S IB=$$SETSTR^VALM1("                       "_IBOSN1,"",2,79)
 .D SET(IBSRC,IB,CNT,IBCNT)
 ;
 I $S($G(IBFULL):1,1:$P($G(^IBM(361.1,IBCNT,6)),U)'=""!($P($G(^IBM(361.1,IBCNT,6)),U,2)'="")) D
 . S IB=$$SETSTR^VALM1("New Pat. Nm.: "_$P($G(^IBM(361.1,IBCNT,6)),U),"",2,39)
 . S IB=$$SETSTR^VALM1("New Pat. Id  : "_$P($G(^IBM(361.1,IBCNT,6)),U,2),IB,41,38)
 . D SET(IBSRC,IB,CNT,IBCNT)
 D:IBSRC SET(IBSRC,"",CNT,IBCNT)
 Q
 ;
PAY ;
 S IBSRC=$G(IBSRC) Q:IBSRC=1
 N IBREC1,IBTMP
 S IB=$$SETSTR^VALM1("PAYER INFORMATION:","",1,50)
 D SET(IBSRC,IB,CNT,IBCNT)
 I 'IBSRC D
 . D CNTRL^VALM10(VALMCNT,1,18,IORVON,IORVOFF)
 . S ^TMP("IBCECSD",$J,"X",2)=VALMCNT
 ; KL - HIPAA 5010 - moved the write of the Payer ID on the next line down from the payer name to accommodate
 ; the increased length of the PAYER NAME from 35 to 60 characters.  modified length parameter to $$SETSTR function for
 ; Payer ID and ICN to accommodate increased length of additional 20 characters. 
 S IB=$$SETSTR^VALM1("Payer Name   : "_$P($G(^DIC(36,+$P(IBREC,U,2),0)),U),"",2,60)
 D SET(IBSRC,IB,CNT,IBCNT)
 S IB=$$SETSTR^VALM1("Payer Id     : "_$P(IBREC,U,3),IB,2,38)
 D SET(IBSRC,IB,CNT,IBCNT)
 S IB=$$SETSTR^VALM1("ICN          : "_$P(IBREC,U,14),"",2,60)
 D SET(IBSRC,IB,CNT,IBCNT)
 ;Additional fields for HIPA 5010
 N I,IBREC25,IBCON,IBCONTXT,IBCTYP,IBPAYNAM,IBWEB3,IBWEB
 ; Display PAYER CONTACT NAME, file #361.1, or CONTACT NAME, file #344; .4, (whichever is available)
 S IBREC25=$G(^IBM(361.1,IBCNT,25))
 S IBPAYNAM=$P(IBREC25,U)
 I IBPAYNAM="",+$G(RCSCR)>0 S IBPAYNAM=$P($G(^RCY(344.4,RCSCR,3)),U)
 I IBPAYNAM'="" D
 .S IB=$$SETSTR^VALM1("Payer Contact: "_IBPAYNAM,IB,2,60)
 .D SET(IBSRC,IB,CNT,IBCNT)
 I $TR($P(IBREC25,U,2,7),U,"")'="" D
 .F I=2,4,6 D
 ..S IBCON=$P(IBREC25,U,I),IBCTYP=$P(IBREC25,U,I+1) Q:IBCON=""
 ..S IBCONTXT=$S(IBCTYP="TE":"Contact Phone  : ",IBCTYP="FX":"Contact Fax    : ",IBCTYP="EM":"Contact e-Mail : ",1:"Invalid type :")
 ..S IB=$$SETSTR^VALM1(IBCONTXT_IBCON,"",2,50)
 ..D SET(IBSRC,IB,CNT,IBCNT)
 I $G(RCSCR)'="" D
 .S IBWEB=$P($G(^RCY(344.4,RCSCR,5)),U) Q:IBWEB=""
 .S IB=$$SETSTR^VALM1("Payer Web Site : "_$E(IBWEB,1,60),"",2,78)
 .D SET(IBSRC,IB,CNT,IBCNT) Q:$L(IBWEB)<61
 .S IB=$$SETSTR^VALM1($E(IBWEB,61,115),"",19,78)
 .D SET(IBSRC,IB,CNT,IBCNT)
 ;Payer Policy References
 D PPR
 N IBREC51
 S IBREC51=$G(^IBM(361.1,IBCNT,51))
 I $P(IBREC,U,9)'=""!($P(IBREC51,U,2)'="") D
 . S IB=$$SETSTR^VALM1("Cross Ovr ID : "_$P(IBREC,U,9),"",2,39)
 . D SET(IBSRC,IB,CNT,IBCNT)
 . S IB=$$SETSTR^VALM1("Cross Ovr Nm: "_$P(IBREC51,U,2),"",2,76)
 . D SET(IBSRC,IB,CNT,IBCNT)
 D:IBSRC SET(IBSRC,"",CNT,IBCNT)
 ;Audit Details
 D AUDIT
 Q
 ;
CLVL ;
 N IBREC1,IBTMP,IBRL
 S IB=$$SETSTR^VALM1("CLAIM LEVEL PAY STATUS:","",1,50),IBSRC=$G(IBSRC)
 D SET(IBSRC,IB,CNT,IBCNT)
 I 'IBSRC D
 . D CNTRL^VALM10(VALMCNT,1,23,IORVON,IORVOFF)
 . S ^TMP("IBCECSD",$J,"X",3)=VALMCNT
 I '$D(^IBM(361.1,IBCNT,2)),'$D(^IBM(361.1,IBCNT,1)) D SET(IBSRC," NONE",CNT,IBCNT) Q
 S IB=$$SETSTR^VALM1("Tot Submitted Chrg: "_$$A10($P($G(^IBM(361.1,IBCNT,2)),U,4)),"",2,39)
 S IBREC1=$G(^IBM(361.1,IBCNT,1))
 S IB=$$SETSTR^VALM1("Covered Amt       : "_$$A10($P(IBREC1,U,3)),IB,41,38)
 D SET(IBSRC,IB,CNT,IBCNT)
 S IB=$$SETSTR^VALM1("Payer Paid Amt    : "_$$A10($P(IBREC1,U)),"",2,39)
 S IB=$$SETSTR^VALM1("Patient Resp. Amt : "_$$A10($S($D(^IBM(361.1,IBCNT,"ERR")):0,IBSRC:$P(IBREC1,U,2),$$FT^IBCEF(+IBREC)=3:$$PTRESPI^IBCECOB1(IBCNT),1:$P($G(^IBM(361.1,IBCNT,1)),"^",2))),IB,41,38)
 D SET(IBSRC,IB,CNT,IBCNT)
 S (IB,IBRL)=""
 I $S(IBFULL:1,1:$P(IBREC1,U,4)) S IB=$$SETSTR^VALM1("Discount Amt      : "_$$A10($P(IBREC1,U,4)),"",2,39),IBRL=1
 I $S(IBFULL:1,1:$P(IBREC1,U,5)) S IB=$$SETSTR^VALM1("Per Day Limit Amt : "_$$A10($P(IBREC1,U,5)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P(IBREC1,U,8)) S IB=$$SETSTR^VALM1("Tax Amt           : "_$$A10($P(IBREC1,U,8)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P(IBREC1,U,9)) S IB=$$SETSTR^VALM1("Tot Before Tax Amt: "_$$A10($P(IBREC1,U,9)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P($G(^IBM(361.1,IBCNT,2)),U,3)) S IB=$$SETSTR^VALM1("Total Allowed Amt : "_$$A10($P($G(^IBM(361.1,IBCNT,2)),U,3)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P($G(^IBM(361.1,IBCNT,2)),U,5)) S IB=$$SETSTR^VALM1("Negative Reimb Amt: "_$$A10($P($G(^IBM(361.1,IBCNT,2)),U,5)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $G(IBSRC) I $S(IBFULL:1,1:$P(IBREC,U,12)) S IB=$$SETSTR^VALM1("Discharge Fraction: "_$$A10($P(IBREC,U,12)),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P(IBREC,U,10)) S IB=$$SETSTR^VALM1("DRG Code Used     :"_$$RJ^XLFSTR($P(IBREC,U,10),11," "),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1) I IBRL=0 D SET(IBSRC,IB,CNT,IBCNT) S IB=""
 I $S(IBFULL:1,1:$P(IBREC,U,11)) S IB=$$SETSTR^VALM1("DRG Weight Used   :"_$$RJ^XLFSTR($P(IBREC,U,11),11," "),IB,$S('IBRL:2,1:41),$S('IBRL:39,1:38)),IBRL=$S(IBRL:0,1:1)
 D:IBRL'="" SET(IBSRC,IB,CNT,IBCNT)
 D:IBSRC SET(IBSRC,"",CNT,IBCNT)
 Q
 ;
MOUT ;
 N IBREC1,IBRL
 S IBREC1=$G(^IBM(361.1,IBCNT,3)),IBSRC=$G(IBSRC)
 I 'IBSRC,$$INPAT^IBCEF(+IBREC),$TR(IBREC1,"0^")="" Q
 I IBREC1="" D:'$D(^IBM(361.1,IBCNT,4)) SET(IBSRC," NONE",CNT,IBCNT) D:'IBSRC SET(IBSRC,"",CNT,IBCNT),REMARK^IBCECSA5 Q
 D SET(IBSRC," OUTPATIENT:",CNT,IBCNT)
 S IBRL=""
 I $S(IBFULL:1,1:$P(IBREC1,U)) S IB=$$SETSTR^VALM1("Reimburse Rate    : "_$$P10($P(IBREC1,U)),"",$S('IBRL:4,1:40),$S('IBRL:41,1:38)),IBRL=$S(IBRL:0,1:1)
 I $S(IBFULL:1,1:$P(IBREC1,U,2)) S IB=$$SETSTR^VALM1("HCPCS Pay Amt     : "_$$A10($P(IBREC1,U,2)),IB,$S('IBRL:4,1:40),$S('IBRL:41,1:38)),IBRL=$S(IBRL:0,1:1)
 D:IBRL=0 SET(IBSRC,IB,CNT,IBCNT)
 I $S(IBFULL:1,1:$P(IBREC1,U,8)) S IB=$$SETSTR^VALM1("Esrd Paid Amt     : "_$$A10($P(IBREC1,U,8)),"",$S('IBRL:4,1:40),$S('IBRL:41,1:38)),IBRL=$S(IBRL:0,1:1)
 D:IBRL=0 SET(IBSRC,IB,CNT,IBCNT)
 I $S(IBFULL:1,1:$P(IBREC1,U,9)) S IB=$$SETSTR^VALM1("Non-Pay Prof Comp : "_$$A10($P(IBREC1,U,9)),IB,$S('IBRL:4,1:40),$S('IBRL:41,1:38)),IBRL=$S(IBRL:0,1:1)
 D:IBRL'="" SET(IBSRC,IB,CNT,IBCNT)
 D REMARK^IBCECSA5
 D SET(IBSRC,"",CNT,IBCNT)
 Q
 ;
CLVLA ;
 N IBREC,IBFLG,GR,RSN,Z,I,IBCARC,IBN
 S IB=$$SETSTR^VALM1("CLAIM LEVEL ADJUSTMENTS:","",1,50),IBSRC=$G(IBSRC)
 D SET(IBSRC,IB,CNT,IBCNT)
 I 'IBSRC D
 . D CNTRL^VALM10(VALMCNT,1,24,IORVON,IORVOFF)
 . S ^TMP("IBCECSD",$J,"X",4)=VALMCNT
 S (Y,IBFLG)=0 F  S Y=$O(^IBM(361.1,IBCNT,10,Y)) Q:'Y  D
 . S IBREC=$G(^IBM(361.1,IBCNT,10,Y,0)),GR=$P(IBREC,U,1)
 . I GR="OA",$P($G(^IBM(361.1,IBCNT,10,Y,1,0)),U,4)=1,$D(^IBM(361.1,IBCNT,10,Y,1,"B","AB3")) Q   ; kludge
 . S IBREC=$$EXTERNAL^DILFD(361.11,.01,"",GR),IBFLG=1
 . D SET(IBSRC," GROUP CODE: "_IBREC,CNT,IBCNT)
 . S Z=0 F  S Z=$O(^IBM(361.1,IBCNT,10,Y,1,Z)) Q:'Z  D
 .. S IBREC=$G(^IBM(361.1,IBCNT,10,Y,1,Z,0)),RSN=$P(IBREC,U,1)
 .. I GR="OA",RSN="AB3" Q   ; kludge
 .. ; ib*2.0*547 - get CARC/RARC descriptions from new AR files 345/346 when available
 .. S:'$$VFILE^DILFD(345) IB=$$SETSTR^VALM1("REASON CODE: "_RSN_"  "_$P(IBREC,U,4),"",3,77)
 .. S:$$VFILE^DILFD(345) IB=$$SETSTR^VALM1("REASON CODE: "_RSN,"",3,77)
 .. D SET(IBSRC,IB,CNT,IBCNT)
 .. I $$VFILE^DILFD(345) D
 ... S IBN=$$CARC^IBCECSA5(RSN,345,74,"IBCARC")
 ... F I=1:1:IBN S IB=$$SETSTR^VALM1(IBCARC(I),"",3,77) D SET(IBSRC,IB,CNT,IBCNT)
 .. ; end IB*2.0*547 changes
 .. S IB=$$SETSTR^VALM1("Amount: "_$$A10($P(IBREC,U,2)),"",3,40)
 .. S IB=$$SETSTR^VALM1("Quantity: "_$P(IBREC,U,3),IB,41,38)
 .. D SET(IBSRC,IB,CNT,IBCNT)
 .. ;D:IBSRC SET(IBSRC,"",CNT,IBCNT)   ;IB*2.0*488 (vd) REMOVED EXTRA BLANK LINE.
 I 'IBFLG D SET(IBSRC," NONE",CNT,IBCNT)
 Q
 ;
A10(X) ; returns a dollar amount right justified to 10 characters
 Q $$RJ^XLFSTR($FN(X,"",2),10," ")
 ;
P10(X) ; returns a % right just 10
 ; X is a decimal between 0-1
 Q $$RJ^XLFSTR((X*100)_"%",10," ")
 ;
PPR ;Display Payer Policy References
 ;
 N I,IBARR,IBX,IBX2,IBX3,IBPY,IBPCNT,IBDISP,IBTXT
 S IBX=0
 ;Get next Adjustment
 F  S IBX=$O(^IBM(361.1,IBCNT,15,IBX)) Q:'IBX  D
 .;Get next Line Level
 .S IBX2=0
 .F  S IBX2=$O(^IBM(361.1,IBCNT,15,IBX,1,IBX2)) Q:'IBX2  D
 ..;Get Adjustment line references (up to 5)
 ..S IBX3=0
 ..F  S IBX3=$O(^IBM(361.1,IBCNT,15,IBX,1,IBX2,2,IBX3)) Q:'IBX3  D
 ...S IBPY=$P($G(^IBM(361.1,IBCNT,15,IBX,1,IBX2,2,IBX3,0)),U) Q:IBPY=""
 ...S IBARR(IBPY)=""
 ;Concatenate Adjustment references
 S IBPY="",IBPCNT=0
 F  S IBPY=$O(IBARR(IBPY)) Q:IBPY=""  D  Q:IBPCNT=5
 .S IBPCNT=IBPCNT+1,$P(IBDISP,";",IBPCNT)=IBPY
 ;Format display
 Q:'IBPCNT
 S IB=$$SETSTR^VALM1("Policy Reference: Check Payer policies referenced on Payer website","",2,78)
 D SET(IBSRC,IB,CNT,IBCNT)
 S IB=$$SETSTR^VALM1("for the following: "_$E(IBDISP,1,50),"",2,78)
 D SET(IBSRC,IB,CNT,IBCNT)
 F I=50:50:250 S IBTXT=$E(IBDISP,I+1,I+50) Q:IBTXT=""  D
 .S IB=$$SETSTR^VALM1($J("",19)_IBTXT,"",2,78)
 .D SET(IBSRC,IB,CNT,IBCNT)
 Q
 ;
AUDIT ;Display details of any EEOB MOVE/COPY
 ;
 N IEN101,FIRST101
 S IEN101=0,FIRST101=1
 F  S IEN101=$O(^IBM(361.1,IBCNT,101,IEN101)) Q:'IEN101  D
 .N IB101,IBDATE,IBUSER,IBJUST,IBJUST1,IBORIG,IBDIR
 .S IB101=$G(^IBM(361.1,IBCNT,101,IEN101,0)) Q:IB101=""
 .S IBDATE=$$EXTERNAL^DILFD(361.1101,.01,,$P(IB101,U,1))
 .S IBUSER=$$EXTERNAL^DILFD(361.1101,.02,,$P(IB101,U,2))
 .S IBJUST=$E($P(IB101,U,3),1,78),IBJUST1=$E($P(IB101,U,3),79,100)
 .S IBORIG=$$EXTERNAL^DILFD(361.1101,.04,,$P(IB101,U,4))
 .S IBDIR=$$EXTERNAL^DILFD(361.1101,.05,,$P(IB101,U,5)) ; kl - added MOVE/COPY field
 .S:IBDIR']"" IBDIR="Move"
 .I FIRST101 D
 ..S IB=$$SETSTR^VALM1("MOVE/COPY HISTORY","",1,78),FIRST101=0
 ..D SET(IBSRC,IB,CNT,IBCNT)
 .D SET(IBSRC,"",CNT,IBCNT)
 .S IB=$$SETSTR^VALM1("Date/Time of EEOB "_IBDIR_": "_IBDATE,"",1,78)  ;kl  8/23/11
 .D SET(IBSRC,IB,CNT,IBCNT)
 .S IB=$$SETSTR^VALM1(IBDIR_" of EEOB performed by: "_IBUSER,"",1,78)  ;kl 8/23/11
 .D SET(IBSRC,IB,CNT,IBCNT)
 .S IB=$$SETSTR^VALM1(IBDIR_" Justification Comments: ","",1,78)
 .D SET(IBSRC,IB,CNT,IBCNT)
 .S IB=$$SETSTR^VALM1(IBJUST,"",1,78)
 .D SET(IBSRC,IB,CNT,IBCNT)
 .I IBJUST1]"" D
 ..S IB=$$SETSTR^VALM1(IBJUST1,"",1,78)
 ..D SET(IBSRC,IB,CNT,IBCNT)
 .I IBORIG]"" D
 ..S IB=$$SETSTR^VALM1("Original Claim Number: "_IBORIG,"",1,78)
 ..D SET(IBSRC,IB,CNT,IBCNT)
 .;Other claim numbers
 .N SUB,IBOTH,OTEXT
 .S SUB=0,OTEXT=""
 .F  S SUB=$O(^IBM(361.1,IBCNT,101,IEN101,1,SUB)) Q:'SUB  D
 ..S IBOTH=$P($G(^IBM(361.1,IBCNT,101,IEN101,1,SUB,0)),U) Q:'IBOTH
 ..S IBOTH=$$EXTERNAL^DILFD(361.11016,.01,,IBOTH) Q:IBOTH=""
 ..S OTEXT=OTEXT_","_IBOTH
 .S OTEXT=$P(OTEXT,",",2,99)
 .I OTEXT]"" D
 ..S IB=$$SETSTR^VALM1("Other Claims: "_OTEXT,"",1,78)
 ..D SET(IBSRC,IB,CNT,IBCNT)
 .D SET(IBSRC,"",CNT,IBCNT)
 Q