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

IBCNEDE7.m

Go to the documentation of this file.
  1. IBCNEDE7 ;DAOU/DAC - eIV DATA EXTRACTS ; 04-JUN-2002
  1. ;;2.0;INTEGRATED BILLING;**271,416,438,497,601,621,668,702,737,771**;21-MAR-94;Build 26
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q ; no direct calls allowed
  1. ;
  1. SETTINGS(EXTNUM) ; Check site parameter settings for the extracts
  1. ; IB*737/TAZ - Removed reference to Non-Verified which is being pulled from VistA.
  1. ; Input Parameter:
  1. ;
  1. ; IB*2.0*621/DM reimplement extract (#4), now EICD, formerly No Insurance
  1. ; EXTNUM is either 1, 2, 4 to represent the different extracts
  1. ; 1 - Insurance Buffer extract
  1. ; 2 - Pre-Reg (appointments)
  1. ; 4 - EICD
  1. ;
  1. ; Output parameters:
  1. ; Returns a "^" delimited string passing back:
  1. ; EACTIVE - A flag of whether to consider the extract active
  1. ; XDAYS - Number of days to look back in the past when extracting data
  1. ; MAXCNT - Max Number of entries you are allowed to set into the eIV
  1. ; Transmission Queue file. If null, # of entries allowed is unlimited.
  1. ; SUPPBUFF - Suppress Buffer Flag - Either '0' (No) or '1' (Yes)
  1. ; 1 will suppress the creation of buffer entries
  1. ; 0 will not
  1. ; Applies to #2 (Appointment), and #4 (EICD)
  1. ;
  1. ; For now, the next three parameters are only used by the EICD (#4) extract
  1. ; STARTDYS - number of days from today to form the extract's start date
  1. ; DYSAFTER - number of days added to the start date to form the extract's end date
  1. ; FREQ - how long the extract must wait before an attempt to re-verify for the patient
  1. ;
  1. N DIC,DISYS,DA,X,Y,EACTIVE,XDAYS,MAXCNT,OK,SUPPBUFF
  1. N STARTDYS,DYSAFTER,FREQ
  1. S EACTIVE=0,(XDAYS,MAXCNT,SUPPBUFF,STARTDYS,DYSAFTER,FREQ)=""
  1. S OK=$S(EXTNUM=1:1,EXTNUM=2:1,EXTNUM=4:1,1:0)
  1. I 'OK G EXIT
  1. S DA=1,DIC="^IBE(350.9,"_DA_",51.17,",DIC(0)="X",X=EXTNUM D ^DIC
  1. ;
  1. I Y<1 G EXIT ; extract not defined in the IB Site Parameter
  1. ;
  1. S EACTIVE=$G(^IBE(350.9,1,51.17,+Y,0))
  1. S XDAYS=$P(EACTIVE,U,3)
  1. S MAXCNT=$P(EACTIVE,U,5)
  1. S SUPPBUFF=$P(EACTIVE,U,6)
  1. S STARTDYS=$P(EACTIVE,U,7)
  1. S DYSAFTER=$P(EACTIVE,U,8)
  1. S FREQ=$P(EACTIVE,U,9)
  1. I SUPPBUFF="" S SUPPBUFF=0
  1. S EACTIVE=$P(EACTIVE,U,2)
  1. EXIT ;
  1. I EXTNUM=2,(XDAYS="") S EACTIVE=0 ; missing required data
  1. I EXTNUM=4,((STARTDYS="")!(DYSAFTER="")!(FREQ="")) S EACTIVE=0 ; missing required data
  1. ; IB*737/TAZ 3RD Piece below is left blank on purpose.
  1. Q EACTIVE_U_XDAYS_U_U_MAXCNT_U_SUPPBUFF_U_STARTDYS_U_DYSAFTER_U_FREQ
  1. ;
  1. SETTQ(DATA1,DATA2,ORIG,OVERRIDE,DATA5) ;Set extract data in TQ file 365.1
  1. ;
  1. ; DATA1, DATA2, ORIG & DATA5 are "^" delimited variables containing the data
  1. ; listed below
  1. ;
  1. ; OVERRIDE - flag indicates that this entry is a result of the
  1. ; 'Request Re-Verification' menu option.
  1. ;
  1. ; IB*737/TAZ - Removed references to "~NO PAYER"
  1. ;
  1. N BUFFIEN,FDA,IENARRAY,ERROR,TRANSNO,DFN,SRVCODE
  1. S BUFFIEN=$P(DATA1,U,4),SRVCODE=0
  1. ;IB*2.0*621/DM make sure SRVCODE is populated
  1. S:BUFFIEN SRVCODE=+$$GET1^DIQ(355.33,BUFFIEN_",",80.01,"I") ; "INQ SERVICE TYPE CODE 1"
  1. S:'SRVCODE SRVCODE=+$$GET1^DIQ(350.9,"1,",60.01,"I") ; "DEFAULT SERVICE TYPE CODE 1"
  1. S TRANSNO=$P($G(^IBCN(365.1,0)),U,3)+1
  1. S FDA(365.1,"+1,",.01)=TRANSNO ; Transaction #
  1. ;
  1. S DFN=$P(DATA1,U)
  1. S FDA(365.1,"+1,",.02)=DFN ; patient DFN
  1. S FDA(365.1,"+1,",.03)=$P(DATA1,U,2) ; ien of payer
  1. S FDA(365.1,"+1,",.04)=$P(DATA1,U,3) ; ien of transmission status
  1. S FDA(365.1,"+1,",.15)=DT ; trans status date
  1. S FDA(365.1,"+1,",.05)=BUFFIEN ; ien of buffer
  1. ;
  1. S FDA(365.1,"+1,",.06)=$$NOW^XLFDT ; creation date/time
  1. S FDA(365.1,"+1,",.07)=0 ; transmission retries
  1. S FDA(365.1,"+1,",.08)=0 ; number of retries
  1. I $D(OVERRIDE) S FDA(365.1,"+1,",.14)=OVERRIDE ; override flag
  1. S FDA(365.1,"+1,",.16)=$P(DATA1,U,5) ; Sub. ID
  1. S FDA(365.1,"+1,",.17)=$P(DATA1,U,6) ; Freshness Date
  1. S FDA(365.1,"+1,",.18)=$P(DATA1,U,7) ; Pass Buffer ien?
  1. S FDA(365.1,"+1,",.19)=$P(DATA1,U,8) ; Patient ID
  1. S FDA(365.1,"+1,",.2)=SRVCODE ; Service code
  1. ;
  1. I $D(DATA2) D
  1. . S FDA(365.1,"+1,",.1)=$P(DATA2,U) ; which extract (ien)
  1. . S FDA(365.1,"+1,",.11)=$P(DATA2,U,2) ; query flag
  1. . S FDA(365.1,"+1,",.12)=$P(DATA2,U,3) ; service date
  1. . S FDA(365.1,"+1,",.13)=$P(DATA2,U,4) ; patient insur. ien
  1. ;
  1. I $D(ORIG) D
  1. . S FDA(365.1,"+1,",1.02)=$P(ORIG,U) ; original ins co (in buffer)
  1. . S FDA(365.1,"+1,",1.03)=$P(ORIG,U,2) ; grp number (in buffer or patient record) ;IB*771/CKB
  1. . S FDA(365.1,"+1,",1.04)=$P(ORIG,U,3) ; grp name (in buffer or patient record) ;IB*771/CKB
  1. . S FDA(365.1,"+1,",1.05)=$P(ORIG,U,4) ; original subscriber ID
  1. ;
  1. I $D(DATA5) D
  1. . S FDA(365.1,"+1,",3.02)=$P(DATA5,U) ; source of information ien, IB*2*601/DM
  1. . S FDA(365.1,"+1,",.21)=$P(DATA5,U,2) ; EICD INS-FND IEN, IB*2*621/DM
  1. ;
  1. D UPDATE^DIE("","FDA","IENARRAY","ERROR")
  1. ;
  1. I $G(ERROR("DIERR",1,"TEXT",1))'="" D ; MailMan msg
  1. . N MGRP,XMSUB,MSG
  1. . ;
  1. . ; Set to IB site parameter MAILGROUP
  1. . S MGRP=$$MGRP^IBCNEUT5()
  1. . ;
  1. . S XMSUB="eIV Problem: Trouble setting entry in File 365.1"
  1. . S MSG(1)="Tried to create an entry in the eIV Transmission Queue File #365.1 without"
  1. . S MSG(2)="success."
  1. . S MSG(3)=""
  1. . S MSG(4)="Error encountered: "_$G(ERROR("DIERR",1,"TEXT",1))
  1. . S MSG(5)=""
  1. . S MSG(6)="The data that was to be stored is as follows:"
  1. . S MSG(7)=""
  1. . S MSG(8)="Transaction #: "_TRANSNO
  1. . S MSG(9)="Patient: "_$P($G(^DPT(DFN,0)),U)_$$SSN^IBCNEDEQ(DFN)
  1. . S MSG(10)="Extract: "_$P($G(DATA2),U,1)
  1. . S MSG(11)="Payer: "
  1. . S:$P(DATA1,U,2)'="" MSG(11)=MSG(11)_$P($G(^IBE(365.12,$P(DATA1,U,2),0)),U,1)
  1. . S MSG(12)="Please call the Help Desk about this problem."
  1. . D MSG^IBCNEUT5(MGRP,XMSUB,"MSG(")
  1. ;
  1. Q $G(IENARRAY(1))
  1. ;
  1. PYRACTV(PIEN) ; check if given payer is nationally enabled for eIV
  1. ; returns 1 if payer is nationally enabled, 0 otherwise
  1. ;IB*668/TAZ - Changed field names to enabled and Payer Application from IIV to EIV
  1. N APPIEN,RES
  1. S RES=0
  1. I +$G(PIEN)'>0 G PYRACTVX
  1. S APPIEN=$$PYRAPP^IBCNEUT5("EIV",PIEN)
  1. I +$G(APPIEN)'>0 G PYRACTVX
  1. I $P($G(^IBE(365.12,PIEN,1,APPIEN,0)),U,2)=1 S RES=1
  1. PYRACTVX ;
  1. Q RES