- IBCNEHL6 ;EDE/DM - HL7 Process Incoming RPI Continued ; 19-OCT-2017
- ;;2.0;INTEGRATED BILLING;**601,621,737,743,752**;21-MAR-94;Build 20
- ;;Per VA Directive 6402, this routine should not be modified.
- ;
- Q
- FIL ; Finish processing the response message - file into insurance buffer
- ;
- ; Input Variables
- ; ERACT, ERFLG, ERROR, IIVSTAT, MAP, RIEN, TRACE, TRKIEN
- ;
- ; If no record IEN, quit
- I $G(RIEN)="" Q
- ;
- N BUFF,CALLEDBY,DFN,FILEIT,IBEICDV,IBFDA,IBIEN,IBINSDTA,IBISMBI,IBQFL
- N RDAT0,RSRVDT,RSTYPE,SYMBOL,TQDATA,TQN,TQSRVDT,TRKDTA
- ; Initialize variables from the Response File
- S RDAT0=$G(^IBCN(365,RIEN,0)),TQN=$P(RDAT0,U,5)
- S TQDATA=$G(^IBCN(365.1,TQN,0))
- S IBQFL=$P(TQDATA,U,11)
- S DFN=$P(RDAT0,U,2),BUFF=$P(RDAT0,U,4)
- S IBISMBI=+$$MBICHK^IBCNEUT7(BUFF) ; IB*2*601/DM
- S IBEICDV=((IBQFL="V")&($P(TQDATA,U,10)="4")) ; IB*2.0*621/DM
- S IBIEN=$P(TQDATA,U,5),RSTYPE=$P(RDAT0,U,10)
- S RSRVDT=$P($G(^IBCN(365,RIEN,1)),U,10)
- ;
- ; If an unknown error action or an error filing the response message,
- ; send a warning email message
- ; Note - A call to UEACT will always set ERFLAG=1
- ;
- ; IB*2.0*506 Removed the following line of code to Treat all AAA Action Codes
- ; as though the Payer/FSC Responded.
- ;I ",W,X,R,P,C,N,Y,S,"'[(","_$G(ERACT)_",")&($G(ERACT)'="")!$D(ERROR) D UEACT^IBCNEHL3
- ;
- ; If an error occurred, processing complete
- I $G(ERFLG)=1 Q
- ;
- ; For an original response, set the Transmission Queue Status to 'Response Received' &
- ; update remaining retries to comm failure (5)
- ;IB*743/CKB - called earlier when saving the MSA segment
- ;I $G(RSTYPE)="O" D SST^IBCNEUT2(TQN,3),RSTA^IBCNEUT7(TQN)
- ;
- ; Update the TQ service date to the date in the response file
- ; if they are different AND the Error Action <>
- ; 'P' for 'Please submit original transaction'
- ;
- ; *** Temporary change to suppress update of service & freshness dates.
- ; *** To reinstate, remove comment (;) from next line.
- ;I TQN'="",$G(RSTYPE)="O" D
- ;. S TQSRVDT=$P($G(^IBCN(365.1,TQN,0)),U,12)
- ;. I RSRVDT'="",TQSRVDT'=RSRVDT,$G(ERACT)'="P" D SAVETQ^IBCNEUT2(TQN,RSRVDT)
- ;. ; update freshness date by same delta
- ;. D SAVFRSH^IBCNEUT5(TQN,+$$FMDIFF^XLFDT(RSRVDT,TQSRVDT,1))
- ;
- ; Moved everything related to CALLEDBY variable higher up in the tag ;IB*752/DJW
- ; ** Very important: Variable 'CALLEDBY' must be set for this routine so
- ; that when a payer response is saved to the buffer either as an
- ; update to an existing buffer entry or as a new buffer entry a new
- ; eIV inquiry is not automatically triggered and resent to the payer again.
- ; When certain fields are changed in file #355.33 a trigger calls routine
- ; ^IBCNERTQ which can create and send a new inquiry in real time to the payer.
- ; We want this to occur in all cases _EXCEPT_ when it is a payer response.
- ; Which means _EXCEPT_ when it is triggered as a result of this routine.
- ;
- S CALLEDBY="IBCNEHL1"
- ;
- ; Check for error action
- ; IB*2*601/DM, IB*2.0*621/DM If the response is MBI or EICD verification, keep processing after error
- I $G(ERACT)'=""!($G(ERTXT)'="") D G:('IBISMBI)&('IBEICDV) FILX
- . S ERACT=$$ERRACT^IBCNEHLU(RIEN),ERCON=$P(ERACT,U,2),ERACT=$P(ERACT,U)
- . D ERROR^IBCNEHL3(TQN,ERACT,ERCON,TRACE)
- . I IBEICDV S BUFF=$P($G(^IBCN(365,RIEN,0)),U,4) ;IB*2.0*621/DM reset BUFF
- ;
- I EVENTYP=1 D PROCTRK^IBCNEHL7(TRKIEN) Q ;IB*621 Process EICD Tracking file #365.18
- ;
- ; Stop processing if identification response and not an active policy
- S FILEIT=1
- I $G(IIVSTAT)=6,TQN]"" D
- . I TQDATA="" Q
- . I IBQFL'="I" Q
- . S FILEIT=0
- I 'FILEIT G FILX
- ;
- ; If there is an associated buffer entry & one or both of the following
- ; is true, stop filing (don't update buffer entry)
- ; 1) buffer status is not 'Entered'
- ; 2) the buffer entry is verified (* symbol) ;IB*737/DTG stop use of '*' verified
- ;I BUFF'="",($P($G(^IBA(355.33,BUFF,0)),U,4)'="E")!($$SYMBOL^IBCNBLL(BUFF)="*") G FILX
- I BUFF'="",($P($G(^IBA(355.33,BUFF,0)),U,4)'="E") G FILX ;IB*737/DTG stop use of '*' verified
- ;
- ; Set buffer symbol based on value returned from EC
- ; IB*2*601/DM
- ;S SYMBOL=MAP(IIVSTAT)
- I 'IBISMBI S SYMBOL=MAP(IIVSTAT)
- ; if subscriber ID is populated set SYMBOL to '%' otherwise a '#'
- I IBISMBI S SYMBOL=$S($$GET1^DIQ(365,RIEN_",","SUBSCRIBER ID")'="":MAP("MBI%"),1:MAP("MBI#"))
- ;
- ; If there is an associated buffer entry, update the buffer entry w/
- ; response data
- ;IB*743/CKB - add the locking of the Buffer
- ;I BUFF'="" D RP^IBCNEBF(RIEN,"",BUFF)
- N BUFDONE,BUFLOCK,BUFSTAT
- S (BUFDONE,BUFLOCK)=0 ; BUFDONE indicates that a user processed the entry already
- I BUFF'="" D
- . ;If STATUS (#355.33,.04) is NOT ENTERED, ABORT - DON'T touch the buffer entry
- . ; (#355.33), and continue normal processing
- . I $$GET1^DIQ(355.33,BUFF_",",.04,"I")'="E" S BUFDONE=1 Q
- . ;BUFSTAT is ENTERED, attempt to Lock buffer entry
- . S BUFLOCK=$$BUFLOCK(BUFF,1)
- . ;Lock acquired
- . I BUFLOCK D Q
- . . ;Re-evaluate STATUS (#355.33,.04)
- . . S BUFSTAT=$$GET1^DIQ(355.33,BUFF_",",.04,"I")
- . . ;If BUFSTAT is NOT ENTERED, DO NOT modify or touch the buffer entry (#355.33),
- . . ; release lock , and continue normal processing
- . . I BUFSTAT'="E" S BUFDONE=1 Q
- . . ;If BUFSTAT is ENTERED, continue normal processing (modify buffer entry), release lock
- . . I BUFSTAT="E" D RP^IBCNEBF(RIEN,"",BUFF)
- . . ;Unlock buffer
- . . N XX S XX=$$BUFLOCK(BUFF,0)
- . ;
- . ;Lock NOT acquired
- . ;DON'T reevaluate BUFLOCK after calling $$BUFLOCK(BUFF,0)
- . I 'BUFLOCK D
- . . ;Re-evaluate STATUS (#355.33,.04)
- . . S BUFSTAT=$$GET1^DIQ(355.33,BUFF_",",.04,"I")
- . . ;If BUFSTAT is NOT ENTERED, DO NOT modify or touch the buffer entry (#355.33), and
- . . ; continue normal processing
- . . I BUFSTAT'="E" S BUFDONE=1 Q
- . . ;If BUFSTAT is ENTERED, do tag UPDBUF
- . . D UPDBUF(BUFF,SYMBOL)
- I BUFF'="",'BUFLOCK G FILX
- I $G(BUFDONE)=1 G FILX
- ;
- ; If no associated buffer entry, create one & populate w/ response
- ; data (routine call sets IBFDA)
- ;IB/743 CKB - the locking of the buffer is done in $$ADDSTF^IBCNEBF
- I BUFF="" D RP^IBCNEBF(RIEN,1) S BUFF=+IBFDA,UP(365,RIEN_",",.04)=BUFF
- ;
- ; IB*2*601/DM for an MBI query, set the patient relationship to insured to "Patient"
- I IBISMBI S UP(355.33,BUFF_",",60.06)="01"
- ;
- ; IB*2*621/DM for EICD verification response with errors, populate PATID, GRPNUM and SUBID in buffer
- I ($G(ERTXT)'=""),IBEICDV D
- . N TRKIEN
- . S TRKIEN=$O(^IBCN(365.18,"C",TQN,""))
- . S TRKDTA=$P(TQDATA,U,21)_","_TRKIEN_","
- . K IBINSDTA D GETS^DIQ(365.185,TRKDTA,".03;.04;.05",,"IBINSDTA") ; grab selected fields (external)
- . S UP(355.33,BUFF_",",62.01)=IBINSDTA(365.185,TRKDTA,.05) ; Member/Patient ID
- . S UP(355.33,BUFF_",",90.02)=IBINSDTA(365.185,TRKDTA,.03) ; Group Number
- . S UP(355.33,BUFF_",",90.03)=IBINSDTA(365.185,TRKDTA,.04) ; Subscriber ID
- ; Set eIV Processed Date to now
- S UP(355.33,BUFF_",",.15)=$$NOW^XLFDT()
- D FILE^DIE("I","UP","ERROR")
- FILX ;
- Q
- ;
- ;IB*743/TAZ&CKB - Buffer Lock/Unlock Function
- BUFLOCK(BUFF,ONOFF) ;Get a lock on the Buffer entry associated with this Response IEN
- ; Input:
- ; BUFF Buffer IEN file #355.33
- ; ONOFF 0=unlock / 1=lock
- ; Output:
- ; OK 0=Not successful / 1=Successful
- N CNT,OK
- S OK=0
- I BUFF="" G LOCKEND
- ;Unlock Buffer
- I 'ONOFF L -^IBA(355.33,BUFF) S OK=1 G LOCKEND
- ;Attempt to Lock for 30 minutes
- F CNT=1:1:30 D G:OK LOCKEND
- . L +^IBA(355.33,BUFF):DILOCKTM I $T S OK=1 Q
- . H 55
- LOCKEND ;
- Q OK
- ;
- ;IB*743/CKB & DJW UPDBUF tag
- UPDBUF(BUFF,SYMBOL) ; Update the IIV PROCESSED DATE (#355.33,.15) and update Buffer eIV Symbol based
- ; on the incoming Response.
- ;
- ; Per eBiz eInsurance 12/2022 - If there is a Buffer entry & the lock is NOT acquired, do the
- ; following if the buffer status is ENTERED: Set the eIV Processed Date so that the trace #
- ; will display, the 'magic sentence' saying the service date and STC the response is based on
- ; is displayed, the eligibility benefit info associated with the response is displayed and
- ; available when accepting the buffer entry. DO NOT set the other fields in the buffer such
- ; as effective date, group #/name, etc on the buffer entry as eBiz wants to the buffer fields
- ; set to the values that they were 1 second before the eIV response arrived back at the site.
- ;
- ; Therefore, only the eligiblity benefit data from the response will be available when and if
- ; a user accepts the buffer entry and no other data from the response. That is why we are
- ; *NOT* calling RP^IBCNEBF here. PATCH IB*743// DJW
- ;
- N BUFERR,BUFUPD
- ; Set eIV Processed Date to Now
- S BUFUPD(355.33,BUFF_",",.15)=$$NOW^XLFDT()
- D FILE^DIE("I","BUFUPD","BUFERR")
- ;
- ; Update insurance buffer with the eIV symbol as returned by EC
- I SYMBOL D BUFF^IBCNEUT2(BUFF,SYMBOL)
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCNEHL6 8913 printed Mar 13, 2025@21:19:28 Page 2
- IBCNEHL6 ;EDE/DM - HL7 Process Incoming RPI Continued ; 19-OCT-2017
- +1 ;;2.0;INTEGRATED BILLING;**601,621,737,743,752**;21-MAR-94;Build 20
- +2 ;;Per VA Directive 6402, this routine should not be modified.
- +3 ;
- +4 QUIT
- FIL ; Finish processing the response message - file into insurance buffer
- +1 ;
- +2 ; Input Variables
- +3 ; ERACT, ERFLG, ERROR, IIVSTAT, MAP, RIEN, TRACE, TRKIEN
- +4 ;
- +5 ; If no record IEN, quit
- +6 IF $GET(RIEN)=""
- QUIT
- +7 ;
- +8 NEW BUFF,CALLEDBY,DFN,FILEIT,IBEICDV,IBFDA,IBIEN,IBINSDTA,IBISMBI,IBQFL
- +9 NEW RDAT0,RSRVDT,RSTYPE,SYMBOL,TQDATA,TQN,TQSRVDT,TRKDTA
- +10 ; Initialize variables from the Response File
- +11 SET RDAT0=$GET(^IBCN(365,RIEN,0))
- SET TQN=$PIECE(RDAT0,U,5)
- +12 SET TQDATA=$GET(^IBCN(365.1,TQN,0))
- +13 SET IBQFL=$PIECE(TQDATA,U,11)
- +14 SET DFN=$PIECE(RDAT0,U,2)
- SET BUFF=$PIECE(RDAT0,U,4)
- +15 ; IB*2*601/DM
- SET IBISMBI=+$$MBICHK^IBCNEUT7(BUFF)
- +16 ; IB*2.0*621/DM
- SET IBEICDV=((IBQFL="V")&($PIECE(TQDATA,U,10)="4"))
- +17 SET IBIEN=$PIECE(TQDATA,U,5)
- SET RSTYPE=$PIECE(RDAT0,U,10)
- +18 SET RSRVDT=$PIECE($GET(^IBCN(365,RIEN,1)),U,10)
- +19 ;
- +20 ; If an unknown error action or an error filing the response message,
- +21 ; send a warning email message
- +22 ; Note - A call to UEACT will always set ERFLAG=1
- +23 ;
- +24 ; IB*2.0*506 Removed the following line of code to Treat all AAA Action Codes
- +25 ; as though the Payer/FSC Responded.
- +26 ;I ",W,X,R,P,C,N,Y,S,"'[(","_$G(ERACT)_",")&($G(ERACT)'="")!$D(ERROR) D UEACT^IBCNEHL3
- +27 ;
- +28 ; If an error occurred, processing complete
- +29 IF $GET(ERFLG)=1
- QUIT
- +30 ;
- +31 ; For an original response, set the Transmission Queue Status to 'Response Received' &
- +32 ; update remaining retries to comm failure (5)
- +33 ;IB*743/CKB - called earlier when saving the MSA segment
- +34 ;I $G(RSTYPE)="O" D SST^IBCNEUT2(TQN,3),RSTA^IBCNEUT7(TQN)
- +35 ;
- +36 ; Update the TQ service date to the date in the response file
- +37 ; if they are different AND the Error Action <>
- +38 ; 'P' for 'Please submit original transaction'
- +39 ;
- +40 ; *** Temporary change to suppress update of service & freshness dates.
- +41 ; *** To reinstate, remove comment (;) from next line.
- +42 ;I TQN'="",$G(RSTYPE)="O" D
- +43 ;. S TQSRVDT=$P($G(^IBCN(365.1,TQN,0)),U,12)
- +44 ;. I RSRVDT'="",TQSRVDT'=RSRVDT,$G(ERACT)'="P" D SAVETQ^IBCNEUT2(TQN,RSRVDT)
- +45 ;. ; update freshness date by same delta
- +46 ;. D SAVFRSH^IBCNEUT5(TQN,+$$FMDIFF^XLFDT(RSRVDT,TQSRVDT,1))
- +47 ;
- +48 ; Moved everything related to CALLEDBY variable higher up in the tag ;IB*752/DJW
- +49 ; ** Very important: Variable 'CALLEDBY' must be set for this routine so
- +50 ; that when a payer response is saved to the buffer either as an
- +51 ; update to an existing buffer entry or as a new buffer entry a new
- +52 ; eIV inquiry is not automatically triggered and resent to the payer again.
- +53 ; When certain fields are changed in file #355.33 a trigger calls routine
- +54 ; ^IBCNERTQ which can create and send a new inquiry in real time to the payer.
- +55 ; We want this to occur in all cases _EXCEPT_ when it is a payer response.
- +56 ; Which means _EXCEPT_ when it is triggered as a result of this routine.
- +57 ;
- +58 SET CALLEDBY="IBCNEHL1"
- +59 ;
- +60 ; Check for error action
- +61 ; IB*2*601/DM, IB*2.0*621/DM If the response is MBI or EICD verification, keep processing after error
- +62 IF $GET(ERACT)'=""!($GET(ERTXT)'="")
- Begin DoDot:1
- +63 SET ERACT=$$ERRACT^IBCNEHLU(RIEN)
- SET ERCON=$PIECE(ERACT,U,2)
- SET ERACT=$PIECE(ERACT,U)
- +64 DO ERROR^IBCNEHL3(TQN,ERACT,ERCON,TRACE)
- +65 ;IB*2.0*621/DM reset BUFF
- IF IBEICDV
- SET BUFF=$PIECE($GET(^IBCN(365,RIEN,0)),U,4)
- End DoDot:1
- if ('IBISMBI)&('IBEICDV)
- GOTO FILX
- +66 ;
- +67 ;IB*621 Process EICD Tracking file #365.18
- IF EVENTYP=1
- DO PROCTRK^IBCNEHL7(TRKIEN)
- QUIT
- +68 ;
- +69 ; Stop processing if identification response and not an active policy
- +70 SET FILEIT=1
- +71 IF $GET(IIVSTAT)=6
- IF TQN]""
- Begin DoDot:1
- +72 IF TQDATA=""
- QUIT
- +73 IF IBQFL'="I"
- QUIT
- +74 SET FILEIT=0
- End DoDot:1
- +75 IF 'FILEIT
- GOTO FILX
- +76 ;
- +77 ; If there is an associated buffer entry & one or both of the following
- +78 ; is true, stop filing (don't update buffer entry)
- +79 ; 1) buffer status is not 'Entered'
- +80 ; 2) the buffer entry is verified (* symbol) ;IB*737/DTG stop use of '*' verified
- +81 ;I BUFF'="",($P($G(^IBA(355.33,BUFF,0)),U,4)'="E")!($$SYMBOL^IBCNBLL(BUFF)="*") G FILX
- +82 ;IB*737/DTG stop use of '*' verified
- IF BUFF'=""
- IF ($PIECE($GET(^IBA(355.33,BUFF,0)),U,4)'="E")
- GOTO FILX
- +83 ;
- +84 ; Set buffer symbol based on value returned from EC
- +85 ; IB*2*601/DM
- +86 ;S SYMBOL=MAP(IIVSTAT)
- +87 IF 'IBISMBI
- SET SYMBOL=MAP(IIVSTAT)
- +88 ; if subscriber ID is populated set SYMBOL to '%' otherwise a '#'
- +89 IF IBISMBI
- SET SYMBOL=$SELECT($$GET1^DIQ(365,RIEN_",","SUBSCRIBER ID")'="":MAP("MBI%"),1:MAP("MBI#"))
- +90 ;
- +91 ; If there is an associated buffer entry, update the buffer entry w/
- +92 ; response data
- +93 ;IB*743/CKB - add the locking of the Buffer
- +94 ;I BUFF'="" D RP^IBCNEBF(RIEN,"",BUFF)
- +95 NEW BUFDONE,BUFLOCK,BUFSTAT
- +96 ; BUFDONE indicates that a user processed the entry already
- SET (BUFDONE,BUFLOCK)=0
- +97 IF BUFF'=""
- Begin DoDot:1
- +98 ;If STATUS (#355.33,.04) is NOT ENTERED, ABORT - DON'T touch the buffer entry
- +99 ; (#355.33), and continue normal processing
- +100 IF $$GET1^DIQ(355.33,BUFF_",",.04,"I")'="E"
- SET BUFDONE=1
- QUIT
- +101 ;BUFSTAT is ENTERED, attempt to Lock buffer entry
- +102 SET BUFLOCK=$$BUFLOCK(BUFF,1)
- +103 ;Lock acquired
- +104 IF BUFLOCK
- Begin DoDot:2
- +105 ;Re-evaluate STATUS (#355.33,.04)
- +106 SET BUFSTAT=$$GET1^DIQ(355.33,BUFF_",",.04,"I")
- +107 ;If BUFSTAT is NOT ENTERED, DO NOT modify or touch the buffer entry (#355.33),
- +108 ; release lock , and continue normal processing
- +109 IF BUFSTAT'="E"
- SET BUFDONE=1
- QUIT
- +110 ;If BUFSTAT is ENTERED, continue normal processing (modify buffer entry), release lock
- +111 IF BUFSTAT="E"
- DO RP^IBCNEBF(RIEN,"",BUFF)
- +112 ;Unlock buffer
- +113 NEW XX
- SET XX=$$BUFLOCK(BUFF,0)
- End DoDot:2
- QUIT
- +114 ;
- +115 ;Lock NOT acquired
- +116 ;DON'T reevaluate BUFLOCK after calling $$BUFLOCK(BUFF,0)
- +117 IF 'BUFLOCK
- Begin DoDot:2
- +118 ;Re-evaluate STATUS (#355.33,.04)
- +119 SET BUFSTAT=$$GET1^DIQ(355.33,BUFF_",",.04,"I")
- +120 ;If BUFSTAT is NOT ENTERED, DO NOT modify or touch the buffer entry (#355.33), and
- +121 ; continue normal processing
- +122 IF BUFSTAT'="E"
- SET BUFDONE=1
- QUIT
- +123 ;If BUFSTAT is ENTERED, do tag UPDBUF
- +124 DO UPDBUF(BUFF,SYMBOL)
- End DoDot:2
- End DoDot:1
- +125 IF BUFF'=""
- IF 'BUFLOCK
- GOTO FILX
- +126 IF $GET(BUFDONE)=1
- GOTO FILX
- +127 ;
- +128 ; If no associated buffer entry, create one & populate w/ response
- +129 ; data (routine call sets IBFDA)
- +130 ;IB/743 CKB - the locking of the buffer is done in $$ADDSTF^IBCNEBF
- +131 IF BUFF=""
- DO RP^IBCNEBF(RIEN,1)
- SET BUFF=+IBFDA
- SET UP(365,RIEN_",",.04)=BUFF
- +132 ;
- +133 ; IB*2*601/DM for an MBI query, set the patient relationship to insured to "Patient"
- +134 IF IBISMBI
- SET UP(355.33,BUFF_",",60.06)="01"
- +135 ;
- +136 ; IB*2*621/DM for EICD verification response with errors, populate PATID, GRPNUM and SUBID in buffer
- +137 IF ($GET(ERTXT)'="")
- IF IBEICDV
- Begin DoDot:1
- +138 NEW TRKIEN
- +139 SET TRKIEN=$ORDER(^IBCN(365.18,"C",TQN,""))
- +140 SET TRKDTA=$PIECE(TQDATA,U,21)_","_TRKIEN_","
- +141 ; grab selected fields (external)
- KILL IBINSDTA
- DO GETS^DIQ(365.185,TRKDTA,".03;.04;.05",,"IBINSDTA")
- +142 ; Member/Patient ID
- SET UP(355.33,BUFF_",",62.01)=IBINSDTA(365.185,TRKDTA,.05)
- +143 ; Group Number
- SET UP(355.33,BUFF_",",90.02)=IBINSDTA(365.185,TRKDTA,.03)
- +144 ; Subscriber ID
- SET UP(355.33,BUFF_",",90.03)=IBINSDTA(365.185,TRKDTA,.04)
- End DoDot:1
- +145 ; Set eIV Processed Date to now
- +146 SET UP(355.33,BUFF_",",.15)=$$NOW^XLFDT()
- +147 DO FILE^DIE("I","UP","ERROR")
- FILX ;
- +1 QUIT
- +2 ;
- +3 ;IB*743/TAZ&CKB - Buffer Lock/Unlock Function
- BUFLOCK(BUFF,ONOFF) ;Get a lock on the Buffer entry associated with this Response IEN
- +1 ; Input:
- +2 ; BUFF Buffer IEN file #355.33
- +3 ; ONOFF 0=unlock / 1=lock
- +4 ; Output:
- +5 ; OK 0=Not successful / 1=Successful
- +6 NEW CNT,OK
- +7 SET OK=0
- +8 IF BUFF=""
- GOTO LOCKEND
- +9 ;Unlock Buffer
- +10 IF 'ONOFF
- LOCK -^IBA(355.33,BUFF)
- SET OK=1
- GOTO LOCKEND
- +11 ;Attempt to Lock for 30 minutes
- +12 FOR CNT=1:1:30
- Begin DoDot:1
- +13 LOCK +^IBA(355.33,BUFF):DILOCKTM
- IF $TEST
- SET OK=1
- QUIT
- +14 HANG 55
- End DoDot:1
- if OK
- GOTO LOCKEND
- LOCKEND ;
- +1 QUIT OK
- +2 ;
- +3 ;IB*743/CKB & DJW UPDBUF tag
- UPDBUF(BUFF,SYMBOL) ; Update the IIV PROCESSED DATE (#355.33,.15) and update Buffer eIV Symbol based
- +1 ; on the incoming Response.
- +2 ;
- +3 ; Per eBiz eInsurance 12/2022 - If there is a Buffer entry & the lock is NOT acquired, do the
- +4 ; following if the buffer status is ENTERED: Set the eIV Processed Date so that the trace #
- +5 ; will display, the 'magic sentence' saying the service date and STC the response is based on
- +6 ; is displayed, the eligibility benefit info associated with the response is displayed and
- +7 ; available when accepting the buffer entry. DO NOT set the other fields in the buffer such
- +8 ; as effective date, group #/name, etc on the buffer entry as eBiz wants to the buffer fields
- +9 ; set to the values that they were 1 second before the eIV response arrived back at the site.
- +10 ;
- +11 ; Therefore, only the eligiblity benefit data from the response will be available when and if
- +12 ; a user accepts the buffer entry and no other data from the response. That is why we are
- +13 ; *NOT* calling RP^IBCNEBF here. PATCH IB*743// DJW
- +14 ;
- +15 NEW BUFERR,BUFUPD
- +16 ; Set eIV Processed Date to Now
- +17 SET BUFUPD(355.33,BUFF_",",.15)=$$NOW^XLFDT()
- +18 DO FILE^DIE("I","BUFUPD","BUFERR")
- +19 ;
- +20 ; Update insurance buffer with the eIV symbol as returned by EC
- +21 IF SYMBOL
- DO BUFF^IBCNEUT2(BUFF,SYMBOL)
- +22 QUIT