BPSOSCB ;BHAM ISC/FCS/DRS/DLF - Prep for building BPS array ;06/01/2004
;;1.0;E CLAIMS MGMT ENGINE;**1,5,10**;JUN 2004;Build 27
;;Per VHA Directive 2004-038, this routine should not be modified.
;----------------------------------------------------------------------
; Called from BPSOSCA from BPSOSQG from BPSOSQ2
; Setup BPS() array which contains all pertinent data to create
; claim Submission Records for the current Billing Item Record:
;
; Input:
; TRANLIST needs to be defined - List of Transactions
; Returns
; BPS Formatted array containing data required to create claim
; submission records. This array is shared by all BPSOSC*
; routines and some of the BPSOSH routines as well.
;----------------------------------------------------------------------
;
Q
BPS() ;
N IEN59,IEN5902,INDEX,ENTRY,VAINFO
;
; Set up some basic variables from first transaction
S IEN59=$O(TRANLIST(""))
I IEN59="" Q "320^BPS Transaction not found in TRANLIST"
;
S IEN5902=$P(^BPST(IEN59,9),U,1)
I IEN5902="" Q "321^VA Insurer not determined"
;
; Set transaction multiple into VAINFO array and get top node of multiple
D GETS^DIQ(9002313.59,IEN59_",","902*","I","VAINFO")
;
; Set up BPS array for Patient, Insurer, Site and NCPDP record format data
D GETINFO^BPSOSCC(IEN59,IEN5902)
;
; Get transaction-level data for each transaction
S IEN59=""
F INDEX=1:1 S IEN59=$O(TRANLIST(IEN59)) Q:'IEN59 D
. S IEN5902=$P(^BPST(IEN59,9),U,1)
. D MEDINFO^BPSOSCD(IEN59,IEN5902,INDEX)
;
; Set up BPS("RX",0)
S BPS("RX",0)=INDEX-1
I BPS("RX",0)=0 Q "322^No claims in TRANLIST"
;
; If certification, get certification overrides
S IEN59=$O(TRANLIST("")),IEN5902=$P(^BPST(IEN59,9),U,1)
S ENTRY=$$GET1^DIQ(9002313.59902,IEN5902_","_IEN59_",",902.23,"I")
I ENTRY,$D(^BPS(9002313.31,ENTRY)) D SETBPS^BPSOSC2(ENTRY)
;
; Quit with no error
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSOSCB 1941 printed Oct 16, 2024@17:52:24 Page 2
BPSOSCB ;BHAM ISC/FCS/DRS/DLF - Prep for building BPS array ;06/01/2004
+1 ;;1.0;E CLAIMS MGMT ENGINE;**1,5,10**;JUN 2004;Build 27
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;----------------------------------------------------------------------
+4 ; Called from BPSOSCA from BPSOSQG from BPSOSQ2
+5 ; Setup BPS() array which contains all pertinent data to create
+6 ; claim Submission Records for the current Billing Item Record:
+7 ;
+8 ; Input:
+9 ; TRANLIST needs to be defined - List of Transactions
+10 ; Returns
+11 ; BPS Formatted array containing data required to create claim
+12 ; submission records. This array is shared by all BPSOSC*
+13 ; routines and some of the BPSOSH routines as well.
+14 ;----------------------------------------------------------------------
+15 ;
+16 QUIT
BPS() ;
+1 NEW IEN59,IEN5902,INDEX,ENTRY,VAINFO
+2 ;
+3 ; Set up some basic variables from first transaction
+4 SET IEN59=$ORDER(TRANLIST(""))
+5 IF IEN59=""
QUIT "320^BPS Transaction not found in TRANLIST"
+6 ;
+7 SET IEN5902=$PIECE(^BPST(IEN59,9),U,1)
+8 IF IEN5902=""
QUIT "321^VA Insurer not determined"
+9 ;
+10 ; Set transaction multiple into VAINFO array and get top node of multiple
+11 DO GETS^DIQ(9002313.59,IEN59_",","902*","I","VAINFO")
+12 ;
+13 ; Set up BPS array for Patient, Insurer, Site and NCPDP record format data
+14 DO GETINFO^BPSOSCC(IEN59,IEN5902)
+15 ;
+16 ; Get transaction-level data for each transaction
+17 SET IEN59=""
+18 FOR INDEX=1:1
SET IEN59=$ORDER(TRANLIST(IEN59))
if 'IEN59
QUIT
Begin DoDot:1
+19 SET IEN5902=$PIECE(^BPST(IEN59,9),U,1)
+20 DO MEDINFO^BPSOSCD(IEN59,IEN5902,INDEX)
End DoDot:1
+21 ;
+22 ; Set up BPS("RX",0)
+23 SET BPS("RX",0)=INDEX-1
+24 IF BPS("RX",0)=0
QUIT "322^No claims in TRANLIST"
+25 ;
+26 ; If certification, get certification overrides
+27 SET IEN59=$ORDER(TRANLIST(""))
SET IEN5902=$PIECE(^BPST(IEN59,9),U,1)
+28 SET ENTRY=$$GET1^DIQ(9002313.59902,IEN5902_","_IEN59_",",902.23,"I")
+29 IF ENTRY
IF $DATA(^BPS(9002313.31,ENTRY))
DO SETBPS^BPSOSC2(ENTRY)
+30 ;
+31 ; Quit with no error
+32 QUIT 0