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

IBCNERP8.m

Go to the documentation of this file.
  1. IBCNERP8 ;DAOU/BHS - IBCNE eIV STATISTICAL REPORT COMPILE ;11-JUN-2002
  1. ;;2.0;INTEGRATED BILLING;**184,271,345,416,506,621,631,668,687,737,752**;21-MAR-94;Build 20
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; eIV - Insurance Verification Interface
  1. ;
  1. ;Input vars from IBCNERP7:
  1. ; IBCNERTN = "IBCNERP7"
  1. ; **IBCNESPC array ONLY passed by reference **
  1. ; IBCNESPC("BEGDTM") = Start Dt/Tm for rpt range
  1. ; IBCNESPC("ENDDTM") = End Dt/Tm for rpt range
  1. ; IBCNESPC("SECTS") = 1 - All sections OR ',' sep'd list of 1 or more
  1. ; of the following (not all)
  1. ; 2 - Outgoing data, inq trans stats
  1. ; 3 - Incoming data, resps rec'd stats
  1. ; 4 - Current status, pending resps, queued inqs, payer stats, ins buf stats ;IB*752/DTG removed Deferred
  1. ;
  1. ; IBCNESPC("MM") = "" - do not generate MailMan message OR MAILGROUP to
  1. ; send report to Mail Group as defined in the IB site parameters
  1. ;Output vars:
  1. ; Based on IBCNESPC("SECTS") parameter the following scratch globals
  1. ; may be built
  1. ; 1 OR contains 2 -->
  1. ; ^TMP($J,RTN,"OUT")=TotInq^InsBufExtSubtotal^PreRegExtSubtotal^...
  1. ; NonVerifInsExtSubtotal^NoActInsExtSubtotal
  1. ; 1 OR contains 3 -->
  1. ; ^TMP($J,RTN,"IN")=TotResp^InsBufExtSubtotal^PreRegExtSubtotal^...
  1. ; NonVerifInsExtSubtotal^NoActInsExtSubtotal
  1. ;IB*752/DTG remove deferred inquiries, while maintaining piece integrity
  1. ; 1 OR contains 4 -->
  1. ; ^TMP($J,RTN,"CUR")=TotPendingResponses^TotQueuedInquiries^...
  1. ; NULL (was Deferred)^TotInsCosw/oNationalID^...
  1. ; ToteIVPyrsDisabldLocally^TotUserActReq^TotInsBufVerified^TotalManVerified...
  1. ; TotaleIVVerified^TotInsBufUnverified^! InsBufSubtotal^...
  1. ; ? InsBufSubtotal^- InsBufSubtotal^Other InsBufSubtotal^...
  1. ; $ EscolatedBufSubtotal
  1. ; 1 OR contains 4 -->
  1. ; ^TMP($J,RTN,"PYR",APP,PAYER,IEN)="" (list of new payers) ;IB*2.0*687
  1. ;
  1. ; Must call at EN
  1. ;
  1. ; /ckb-IB*2*687 Added APP to incorporate IIU into this rpt; corrected
  1. ; references from Nationally active & locally active to
  1. ; Nationally and Locally enabled
  1. Q
  1. ;
  1. EN(IBCNERTN,IBCNESPC) ; Entry pt
  1. ; Init vars
  1. N IBBDT,IBEDT,IBSCT,IBTOT,PIECES,VALUE,CT
  1. ;
  1. I '$D(ZTQUEUED),$G(IOST)["C-" W !!,"Compiling report data ..."
  1. ;
  1. S IBTOT=0
  1. ;
  1. ; Kill scratch global
  1. K ^TMP($J,IBCNERTN)
  1. ;
  1. ; Init looping vars
  1. S IBBDT=$G(IBCNESPC("BEGDTM")),IBEDT=$G(IBCNESPC("ENDDTM"))
  1. S IBSCT=$G(IBCNESPC("SECTS"))
  1. ;
  1. I IBSCT=1!$F(IBSCT,",2,") D OUT(IBCNERTN,IBBDT,IBEDT,.IBTOT)
  1. I $G(ZTSTOP) G EXIT
  1. I IBSCT=1!$F(IBSCT,",3,") D IN(IBCNERTN,IBBDT,IBEDT,.IBTOT)
  1. I $G(ZTSTOP) G EXIT
  1. I IBSCT=1!$F(IBSCT,",4,") D CUR(IBCNERTN,IBBDT,IBEDT,.IBTOT),PYR(IBCNERTN,IBBDT,IBEDT,.IBTOT)
  1. ;
  1. EXIT ; EN Exit pt
  1. Q
  1. ;
  1. IN(RTN,BDT,EDT,TOT) ; Determine Incoming Data
  1. ; Input params: RTN-routine name for ^TMP($J), BDT-start dt/time,
  1. ; EDT-end dt/time, **TOT-total records searched - used only for status
  1. ; checks when the process is queued (passed by reference)
  1. ; Output vars: Set pcs of ^TMP($J,RTN,"IN") as follows:
  1. ; 1=total Resps rec'd for date/time range
  1. ; 2=Ins Buf extract subtotal
  1. ; 3=Pre-Reg extract subtotal
  1. ; 4=Non-ver extract subtotal
  1. ; 5=No Act Ins subtotal
  1. ;
  1. ; Init vars
  1. N IBDT,PYRIEN,PATIEN,IBPTR,IBTYP,RPTDATA,TRANSIEN
  1. ;
  1. ; Loop thru the eIV Resp File (#365) x-ref on Date/Time Resp Rec'd
  1. S IBDT=$O(^IBCN(365,"AD",BDT),-1)
  1. F S IBDT=$O(^IBCN(365,"AD",IBDT)) Q:IBDT=""!(IBDT>EDT) D Q:$G(ZTSTOP)
  1. . S PYRIEN=0
  1. . F S PYRIEN=$O(^IBCN(365,"AD",IBDT,PYRIEN)) Q:'PYRIEN D Q:$G(ZTSTOP)
  1. . . S PATIEN=0
  1. . . F S PATIEN=$O(^IBCN(365,"AD",IBDT,PYRIEN,PATIEN)) Q:'PATIEN D Q:$G(ZTSTOP)
  1. . . . S IBPTR=0
  1. . . . F S IBPTR=$O(^IBCN(365,"AD",IBDT,PYRIEN,PATIEN,IBPTR)) Q:'IBPTR D Q:$G(ZTSTOP)
  1. . . . . S TOT=TOT+1
  1. . . . . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . . . . ; Update total
  1. . . . . S $P(RPTDATA,U,1)=$P($G(RPTDATA),U,1)+1
  1. . . . . ; Update extract type total
  1. . . . . ; Get the data for the report - build RPTDATA
  1. . . . . ;IB*2.0*631/TAZ
  1. . . . . ;S IBTYP=5,TRANSIEN=$P($G(^IBCN(365,IBPTR,0)),U,5)
  1. . . . . S TRANSIEN=$P($G(^IBCN(365,IBPTR,0)),U,5)
  1. . . . . ; IB*2.0*621
  1. . . . . S TQIEN=$P($G(^IBCN(365,IBPTR,0)),U,5)
  1. . . . . I TQIEN="" Q
  1. . . . . S IBTYP=$$GET1^DIQ(365.1,TQIEN_",",.1,"I")
  1. . . . . S IBQUERY=$$GET1^DIQ(365.1,TQIEN_",",.11,"I")
  1. . . . . S IBMBI=$$GET1^DIQ(365.1,TQIEN_",",.16,"I")
  1. . . . . I IBTYP'="" D
  1. . . . . . I IBTYP=3 Q
  1. . . . . . ;IB*2.0*631
  1. . . . . . I IBTYP=7 S $P(RPTDATA,U,6)=$P($G(RPTDATA),U,6)+1 Q ; MBI Request``
  1. . . . . . I ("~1~5~6~"[("~"_IBTYP_"~")) S $P(RPTDATA,U,2)=$P($G(RPTDATA),U,2)+1 Q
  1. . . . . . I IBTYP=4 D Q
  1. . . . . . . I IBQUERY="I" S $P(RPTDATA,U,4)=$P($G(RPTDATA),U,4)+1 ; EICD Queries
  1. . . . . . . I IBQUERY="V" S $P(RPTDATA,U,5)=$P($G(RPTDATA),U,5)+1 ; EICD Verification
  1. . . . . . S:IBTYP=2 $P(RPTDATA,U,3)=$P($G(RPTDATA),U,3)+1
  1. . . . . ; IB*2.0*621 - End IN Group
  1. ;
  1. I $G(ZTSTOP) G INX
  1. ;
  1. ; Save data to global
  1. S ^TMP($J,RTN,"IN")=$G(RPTDATA)
  1. ;
  1. INX ; IN exit pt
  1. Q
  1. ;
  1. OUT(RTN,BDT,EDT,TOT) ; Outgoing Data
  1. ;Input params: RTN-routine name used as subscript in ^TMP($J),
  1. ; BDT-start date/time, EDT-end date/time, **TOT-total recs searched-used
  1. ; only for status checks when process is queued (passed by reference)
  1. ;Output vars: Set pcs of ^TMP($J,RTN,"OUT") as follows:
  1. ; 1=total Inqs transmitted for timeframe
  1. ; 2=Ins Buffer extract subtotal
  1. ; 3=Pre-Reg extract subtotal
  1. ; 4=Non-Ver extract subtotal
  1. ; 5=No Act Ins subtotal
  1. ; 6=MBI subtotal
  1. ;
  1. ; Init vars
  1. N IBDT,IBPTR,IBTYP,RPTDATA,TQIEN
  1. ;
  1. ; Loop thru the eIV Resp File (#365) by x-ref on Date/Time Resp Created
  1. ; Only count responses for unique HL7 message IDs - filter out
  1. ; unsolicited responses as they artificially inflate the Outgoing Count
  1. S IBDT=$O(^IBCN(365,"AE",BDT),-1)
  1. F S IBDT=$O(^IBCN(365,"AE",IBDT)) Q:IBDT=""!(IBDT>EDT) D Q:$G(ZTSTOP)
  1. . S IBPTR=0
  1. . F S IBPTR=$O(^IBCN(365,"AE",IBDT,IBPTR)) Q:'IBPTR D Q:$G(ZTSTOP)
  1. . . S TOT=TOT+1
  1. . . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . . ; Quit, if response was not O - original
  1. . . I $P($G(^IBCN(365,IBPTR,0)),U,10)'="O" Q
  1. . . ; Update total
  1. . . S $P(RPTDATA,U,1)=$P($G(RPTDATA),U,1)+1
  1. . . ; Update extract type total (1,2,3,4)
  1. . . S TQIEN=$P($G(^IBCN(365,IBPTR,0)),U,5)
  1. . . I TQIEN="" Q
  1. . . ; IB*2.0*621
  1. . . ;S IBTYP=$P($G(^IBCN(365.1,TQIEN,0)),U,10)
  1. . . S IBTYP=$$GET1^DIQ(365.1,TQIEN_",",.1,"I")
  1. . . S IBQUERY=$$GET1^DIQ(365.1,TQIEN_",",.11,"I")
  1. . . S IBMBI=$$GET1^DIQ(365.1,TQIEN_",",.16,"I")
  1. . . I IBTYP'="" D
  1. . . . I IBTYP=3 Q
  1. . . . ;I IBTYP=1 D Q ;IB*2.0*631/TAZ
  1. . . . I IBTYP=7 S $P(RPTDATA,U,6)=$P($G(RPTDATA),U,6)+1 Q ; MBI Request``
  1. . . . I ("~1~5~6~"[("~"_IBTYP_"~")) S $P(RPTDATA,U,2)=$P($G(RPTDATA),U,2)+1 Q
  1. . . . I IBTYP=4 D Q
  1. . . . . I IBQUERY="I" S $P(RPTDATA,U,4)=$P($G(RPTDATA),U,4)+1 ; EICD Queries
  1. . . . . I IBQUERY="V" S $P(RPTDATA,U,5)=$P($G(RPTDATA),U,5)+1 ; EICD Verification
  1. . . . S:IBTYP=2 $P(RPTDATA,U,3)=$P($G(RPTDATA),U,3)+1
  1. ;
  1. I $G(ZTSTOP) G OUTX
  1. ;
  1. ; Save data to global array
  1. S ^TMP($J,RTN,"OUT")=$G(RPTDATA)
  1. ;
  1. OUTX ; OUT exit pt
  1. Q
  1. ;
  1. CUR(RTN,BDT,EDT,TOT) ; Current Status - stats - timeframe independent
  1. ; Input params: RTN-routine name as subs in ^TMP($J), **TOT-total recs
  1. ; searched - used only for status checks when the process is queued
  1. ; passed by reference
  1. ; Output vars: Set pcs of ^TMP($J,RTN,"CUR") as follows:
  1. ; 1=total Pending Resps (Transmitted-2)
  1. ; 2=total Queued Inqs (Ready to Transmit-1/Retry-6)
  1. ; 3=total Deferred Inqs (Hold-4)
  1. ; 4=Ins Cos w/o National ID
  1. ; 5=Payers w/eIV locally enabled is NO ;/vd-IB*2*687 - Reworded the description.
  1. ; ; 6=total user action required (symbol'='*' or '#' or '!' or '?' or '-')
  1. ; 6=total user action required (symbol'='#' or '!' or '?' or '-') ;IB*737/DTG stop use of '*' verified
  1. ; 7=total Man. Ver'd Ins Buf entries (symbol='*') ;IB*737/DTG stop use of '*' verified
  1. ; 8=total eIV Processed Ver. (symbol='+')
  1. ; 9=total awaiting processing (symbol='?' or BLANK)
  1. ; 10=total Ins Buf entries w/symbol='#'
  1. ; 11=total Ins Buf entries w/symbol='!'
  1. ; 12=total Ins Buf entries w/symbol='?'
  1. ; 13=total Ins Buf entries w/symbol='-'
  1. ; ; 14=total Ins Buffer entries w/symbol not in ('*','#','!','?','-')
  1. ; 14=total Ins Buffer entries w/symbol not in ('#','!','?','-') ;IB*737/DTG stop use of '*' verified
  1. ; 15=total Ins Buffer entries w/symbol='$'
  1. ; 16=total Ins Buffet entries w/symbol= % ; IB*2.0*621 - Added 16-21
  1. ; 17=total Insurance Buffer
  1. ; 18=Total Appointment
  1. ; 19=total Ele Ins Cov Discovery (EICD)
  1. ; 20=total EICD Triggered Einsurance Verification
  1. ; 21=total MBI Inquiry
  1. ; 22=total IIU Payer 'Received IIU Data' set to NO ;IB*2.0*687
  1. ;
  1. ; ^TMP($J,RTN,"CUR","FLAGS","NE",APP,Payer name,N) = nationally enabled flag timestamp ^ nationally enabled flag setting
  1. ; ^TMP($J,RTN,"CUR","FLAGS","AU",APP,Payer name,N) = auto updated flag timestamp ^ auto update flag setting
  1. ;
  1. ;/ckb-IB*2.0*687 Added APP to incorporate IIU into this report;
  1. ; added IIU Payer 'Received IIU Data' set to NO to the report;
  1. ; corrected references from Active (A) & Trusted (T) to
  1. ; Nationally Enabled (NE) and Auto Update (AU)
  1. ;
  1. ; Init vars
  1. N RIEN,TQIEN,ICIEN,IBIEN,RPTDATA,IEN,IBSYMBOL,PIECE,IBSTS,APPIEN
  1. N PIEN,TMP,APPDATA,XDT,PDATA
  1. ;
  1. S RPTDATA=""
  1. ;
  1. ; Responses pending (Transmitted - 2)
  1. S RIEN=0
  1. F S RIEN=$O(^IBCN(365,"AC",2,RIEN)) Q:'RIEN D Q:$G(ZTSTOP)
  1. . S TOT=TOT+1
  1. . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . S $P(RPTDATA,U,1)=$P(RPTDATA,U,1)+1
  1. . ; IB*2.0*621
  1. . S TQIEN=$P($G(^IBCN(365,RIEN,0)),U,5)
  1. . I TQIEN="" Q
  1. . S IBTYP=$$GET1^DIQ(365.1,TQIEN_",",.1,"I")
  1. . S IBQUERY=$$GET1^DIQ(365.1,TQIEN_",",.11,"I")
  1. . S IBMBI=$$GET1^DIQ(365.1,TQIEN_",",.16,"I")
  1. . I IBTYP'="" D
  1. . . I IBTYP=3 Q
  1. . . ;I IBTYP=1 D Q ;IB*2.0*631
  1. . . I IBTYP=7 S $P(RPTDATA,U,21)=$P($G(RPTDATA),U,21)+1 Q ; MBI Request``
  1. . . I ("~1~5~6~"[("~"_IBTYP_"~")) S $P(RPTDATA,U,17)=$P($G(RPTDATA),U,17)+1 Q
  1. . S:IBTYP=2 $P(RPTDATA,U,18)=$P($G(RPTDATA),U,18)+1 ; Appointment
  1. . I IBTYP=4 D Q
  1. . . I IBQUERY="I" S $P(RPTDATA,U,19)=$P($G(RPTDATA),U,19)+1 ; EICD Queries
  1. . . I IBQUERY="V" S $P(RPTDATA,U,20)=$P($G(RPTDATA),U,20)+1 ; EICD Verification
  1. . ; IB*2.0*621 - End IN Group
  1. ;
  1. I $G(ZTSTOP) G CURX
  1. ;
  1. ; Queued inquiries (Ready to Transmit - 1/Retry - 6) and
  1. ; IB*752/DTG REMOVED ; Deferred inquiries (Hold - 4)
  1. ;F IBSTS=1,6,4 D Q:$G(ZTSTOP)
  1. F IBSTS=1,6 D Q:$G(ZTSTOP) ; IB*752/DTG remove (4) Deferred
  1. . S TQIEN=0
  1. . F S TQIEN=$O(^IBCN(365.1,"AC",IBSTS,TQIEN)) Q:'TQIEN D Q:$G(ZTSTOP)
  1. . . S TOT=TOT+1
  1. . . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 QUIT
  1. . . ; IB*752/DTG remove Deferred
  1. . . ;I IBSTS'=4 S $P(RPTDATA,U,2)=$P(RPTDATA,U,2)+1 Q
  1. . . ;S $P(RPTDATA,U,3)=$P(RPTDATA,U,3)+1
  1. . . S $P(RPTDATA,U,2)=$P(RPTDATA,U,2)+1
  1. ;
  1. I $G(ZTSTOP) G CURX
  1. ;
  1. ; Payer stats
  1. ; Ins cos w/o National ID
  1. S ICIEN=0,$P(RPTDATA,U,4)=0
  1. F S ICIEN=$O(^DIC(36,ICIEN)) Q:'ICIEN D Q:$G(ZTSTOP)
  1. . S TOT=TOT+1
  1. . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 QUIT
  1. . ; Exclude inactive
  1. . S TMP=$$ACTIVE^IBCNEUT4(ICIEN) I 'TMP Q
  1. . ; Exclude Medicaid, etc.
  1. . I $$EXCLUDE^IBCNEUT4($P(TMP,U,2)) Q
  1. . ; Does a NATIONAL ID exist?
  1. . ; VA CBO defines 'No National ID' as lack of EDI IDs - fields (#36,3.02) & (#36,3.04) 3/4/14
  1. . ; This is *NOT* a check for the 'VA NATIONAL ID' associated with the linked payer
  1. . I ($$GET1^DIQ(36,ICIEN_",",3.02)="")&($$GET1^DIQ(36,ICIEN_",",3.04)="") S $P(RPTDATA,U,4)=$P(RPTDATA,U,4)+1 Q
  1. . Q
  1. . ; Determine assoc Payer
  1. . ;S PIEN=$P($G(^DIC(36,ICIEN,3)),U,10)
  1. . ; Missing payer link
  1. . ;I 'PIEN S $P(RPTDATA,U,4)=$P(RPTDATA,U,4)+1 Q
  1. . ; Does a VA NATIONAL ID exist?
  1. . ;I $P($G(^IBE(365.12,PIEN,0)),U,2)'="" Q
  1. . ;S $P(RPTDATA,U,4)=$P(RPTDATA,U,4)+1
  1. ;
  1. I $G(ZTSTOP) G CURX
  1. ;
  1. ; eIV Payers locally enabled is NO ;/ckb-IB*2.0*687 - Reworded the comment
  1. S PIEN=0
  1. F S PIEN=$O(^IBE(365.12,PIEN)) Q:'PIEN D Q:$G(ZTSTOP)
  1. . S TOT=TOT+1
  1. . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . S PDATA=$G(^IBE(365.12,PIEN,0))
  1. . ; Must have National ID
  1. . I $P(PDATA,U,2)="" Q
  1. . ; Get Payer app multiple IEN
  1. . ; /ckb-IB*2.0*687 - Replaced the following code.
  1. . ;IB*668/TAZ - Changed Payer Application from IIV to EIV
  1. . ;S APPIEN=$$PYRAPP^IBCNEUT5("EIV",PIEN)
  1. . ; Must have eIV application
  1. . ;I 'APPIEN Q
  1. . ; Get Active/Trusted flag logs
  1. . ;D GETFLAGS(PIEN,APPIEN,PDATA,BDT,EDT,.RPTDATA)
  1. . ;
  1. . ;S APPDATA=$G(^IBE(365.12,PIEN,1,APPIEN,0))
  1. . ; Must be Nationally Active
  1. . ;I '$P(APPDATA,U,2) Q
  1. . ; Must not be Locally Active
  1. . ;I $P(APPDATA,U,3) Q
  1. . ;S $P(RPTDATA,U,5)=$P(RPTDATA,U,5)+1
  1. . ;
  1. . N IENEIV,IENIIU
  1. . K APPDATA
  1. . S IENEIV=$$PYRAPP^IBCNEUT5("EIV",PIEN)
  1. . S IENIIU=$$PYRAPP^IBCNEUT5("IIU",PIEN)
  1. . I 'IENEIV,'IENIIU Q ; Payer doesn't have any applications.
  1. . ;'Receive IIU Data' field is set to NO (0), null values are also considered NO.
  1. . I IENIIU D
  1. . . ; Get the Nationally Enabled/Auto Update flag logs
  1. . . D GETFLAGS(PIEN,IENIIU,PDATA,BDT,EDT,"IIU",.RPTDATA)
  1. . . S APPDATA=$G(^IBE(365.12,PIEN,1,IENIIU,0))
  1. . . ; Must be Nationally Enabled
  1. . . I '$P(APPDATA,U,2) Q
  1. . . I $P($G(^IBE(365.12,PIEN,1,IENIIU,5)),U)'=1 S $P(RPTDATA,U,22)=$P(RPTDATA,U,22)+1
  1. . I IENEIV D
  1. . . ; Get the Nationally Enabled/Auto Update flag logs
  1. . . D GETFLAGS(PIEN,IENEIV,PDATA,BDT,EDT,"EIV",.RPTDATA)
  1. . . S APPDATA=$G(^IBE(365.12,PIEN,1,IENEIV,0))
  1. . . ; Must be Nationally Enabled
  1. . . I '$P(APPDATA,U,2) Q
  1. . . ; Must not be Locally Enabled
  1. . . I $P(APPDATA,U,3) Q
  1. . . S $P(RPTDATA,U,5)=$P(RPTDATA,U,5)+1
  1. ;/ckb-IB*2.0*687 End of new code
  1. ;
  1. I $G(ZTSTOP) G CURX
  1. ;
  1. ; Buffer stats
  1. ; Loop thru the Ins Buffer File (#355.33)
  1. S IBIEN=0,XDT=0
  1. F S XDT=$O(^IBA(355.33,"AEST","E",XDT)) Q:XDT="" D Q:$G(ZTSTOP)
  1. . F S IBIEN=$O(^IBA(355.33,"AEST","E",XDT,IBIEN)) Q:IBIEN="" D Q:$G(ZTSTOP)
  1. . . S TOT=TOT+1
  1. . . I $D(ZTQUEUED),TOT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
  1. . . S IBSYMBOL=$$SYMBOL^IBCNBLL(IBIEN)
  1. . . ; Determine piece to update based on symbol
  1. . . ; ;('*') = Man. Verified, ('#','!','-','?',blank/null) = eIV Processing
  1. . . ; ('#','!','-','?',blank/null) = eIV Processing ;IB*737/DTG stop use of '*' verified
  1. . . ; ('+') = eIV Processed, ('$') = Escalated, Active policy
  1. . . ; IB*2.0*506/taz Node 15 added.
  1. . . ; IB*2.0*621/ Node 16 Added.
  1. . . ;S PIECE=$S(IBSYMBOL="*":7,IBSYMBOL="+":8,IBSYMBOL="#":10,IBSYMBOL="!":11,IBSYMBOL="-":13,IBSYMBOL="?":12,IBSYMBOL="$":15,IBSYMBOL="%":16,1:14)
  1. . . S PIECE=$S(IBSYMBOL="+":8,IBSYMBOL="#":10,IBSYMBOL="!":11,IBSYMBOL="-":13,IBSYMBOL="?":12,IBSYMBOL="$":15,IBSYMBOL="%":16,1:14) ;IB*737/DTG stop use of '*' verified
  1. . . I PIECE=12!(PIECE=14) S $P(RPTDATA,U,9)=$P($G(RPTDATA),U,9)+1
  1. . . E S $P(RPTDATA,U,6)=$P($G(RPTDATA),U,6)+1
  1. . . S $P(RPTDATA,U,PIECE)=$P($G(RPTDATA),U,PIECE)+1
  1. ;
  1. I $G(ZTSTOP) G CURX
  1. CURM ;
  1. ; Save data to global
  1. M ^TMP($J,RTN,"CUR")=RPTDATA
  1. ;
  1. CURX ; CUR exit point
  1. Q
  1. ;
  1. ;/ckb-IB*2.0*687 - GETFLAGS is rewritten to incorporate IIU and improve readability.
  1. ; This function is only called by CUR^IBCNERP8; it is called by IBCNERPC but not used.
  1. GETFLAGS(PIEN,APPIEN,PDATA,BDT,EDT,APP,RPTDATA) ;
  1. ; PIEN - Payer ien in file 365.12
  1. ; APPIEN - Application ien in subfile 365.121
  1. ; PDATA - 0 node of Payer file entry
  1. ; BDT - Start date/time
  1. ; EDT - End date/time
  1. ; APP - Payer Application EIV or IIU
  1. ; RPTDATA - output array, passed by reference
  1. ;
  1. N FLAGS,IEN,PNAME,TYP,TM,VAL,Z
  1. S PNAME=$P(PDATA,U)
  1. I '$D(APP) S APP=0 ;to prevent error when called from IBCNERPC
  1. ; TYP=2 Nationally Enabled Log / TYP=3 Auto-Update Log
  1. F TYP=2,3 D
  1. . S TM=EDT,Z=0 F S TM=$O(^IBE(365.12,PIEN,1,APPIEN,TYP,"B",TM),-1) Q:TM=""!($$FMDIFF^XLFDT(TM,BDT,2)'>0) D
  1. . . S IEN=$O(^IBE(365.12,PIEN,1,APPIEN,TYP,"B",TM,""))
  1. . . S VAL=$$EXTERNAL^DILFD("365.121"_TYP,.02,,$P(^IBE(365.12,PIEN,1,APPIEN,TYP,IEN,0),U,2))
  1. . . S Z=Z+1
  1. . . S RPTDATA("FLAGS",APP,$S(TYP=2:"NE",1:"AU"),PNAME,Z)=$$FMTE^XLFDT(TM,"5ZS")_"^"_VAL
  1. . . Q
  1. Q
  1. ;
  1. PYR(RTN,BDT,EDT,TOT) ; Determine Incoming Data
  1. ; Input params: RTN-routine name for ^TMP($J), BDT-start dt/time,
  1. ; EDT-end dt/time, **TOT-total records searched - used only for status
  1. ; checks when the process is queued (passed by reference)
  1. ; Output vars: Set ^TMP($J,RTN,"PYR",APP,PAYER NAME,IEN of file 365.12)="" ;IB*2.0*687
  1. ;
  1. ; /ckb-IB*2*687 Added APP to incorporate IIU into this report. Moved from IBCNERP0.
  1. ;IB*737/TAZ - Removed reference to Most Popular Payer and "~NO PAYER"
  1. ;
  1. ;N PIEN,PYR,CREATEDT,APPIEN,APPDATA
  1. N PIEN,PYR,CREATEDT,APP,APPIEN,APPDATA
  1. S PIEN=0 F S PIEN=$O(^IBE(365.12,PIEN)) Q:'PIEN D
  1. . S PYR=$P($G(^IBE(365.12,PIEN,0)),U)
  1. . S TOT=TOT+1
  1. . F APP="EIV","IIU" D
  1. . . S APPIEN=+$$PYRAPP^IBCNEUT5(APP,+PIEN) ; Get the ien of the application
  1. . . I 'APPIEN Q ; No application for this Payer.
  1. . . ; Get the Date/Time Created from the Application
  1. . . S CREATEDT=$P($G(^IBE(365.12,PIEN,1,APPIEN,0)),U,13)
  1. . . I CREATEDT=""!(CREATEDT<BDT)!(CREATEDT>EDT) Q
  1. . . ;
  1. . . ; Get Payer app multiple IEN
  1. . . ;IB*668/TAZ - Changed Payer Application from IIV to EIV
  1. . . ;S APPIEN=$$PYRAPP^IBCNEUT5("EIV",PIEN)
  1. . . ; Must have eIV application
  1. . . ;I 'APPIEN Q
  1. . . ;IB*687 -remove Nationally Active check
  1. . . ;S APPDATA=$G(^IBE(365.12,PIEN,1,APPIEN,0))
  1. . . ; Must be Nationally Active
  1. . . ;I '$P(APPDATA,U,2) Q
  1. . . ;
  1. . . S ^TMP($J,RTN,"PYR",APP,PYR,PIEN)=""
  1. . . Q
  1. Q