- IBCNBES1 ;ALB/ARH-Ins Buffer: stuff new entries/data into buffer ;27 OCT 2000
- ;;2.0;INTEGRATED BILLING;**141,497**;21-MAR-94;Build 120
- ;;Per VHA Directive 10-93-142, this routine should not be modified.
- ;
- ;
- BUFF(IBDATA) ; add new entries to Insurance Buffer file (355.33) and stuff the data passed in, no user interaction
- ;
- ; IBDATA array contains insurance entries, pass by reference
- ;
- ; IBDATA("M") level should contain Medicare WNR data only
- ; IBDATA("M","DFN") = Patient DFN, required
- ; IBDATA("M","SOURCE")= Source of data (355.33,.03), required
- ; IBDATA("M","PART A") = Medicare Part A Effective Date
- ; IBDATA("M","PART B") = Medicare Part B Effective Date
- ; IBDATA("M","HICN") = Medicare HICN
- ; IBDATA("M","NAME") = Beneficiary Name as Appears on Card
- ;
- ; IBDATA(X) level should contain any Insurance other than Medicare WNR
- ; IBDATA(X,field #) = array of data to file in Buffer, may contain data on multiple insurance companies
- ; where X = 1:1, subscript defines an insurance company
- ; field # = field number of the data field in 355.33, DFN (60.01) and Source (.03) required
- ;
- ; returns 1 if all entries added ok or 0 if any errors found
- ; also adds IBDATA(X,"MESSAGE") = ien of new entry or 0 followed by error message if entry could not be added
- ;
- ; example of call: $$BUFF^IBCNBES1(.IBDATA) where IBDATA(1,20.01)="Insurance Company Name", etc
- ;
- N X,Y,IBIX,IBFLD,IBY,IBARRAY,IBOUT,IBSOURCE,DFN S IBOUT=1
- ;
- ; insurance companies
- S IBIX=0 F S IBIX=$O(IBDATA(IBIX)) Q:'IBIX D
- . ;
- . S DFN=$G(IBDATA(IBIX,60.01)) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
- . S IBSOURCE=$G(IBDATA(IBIX,.03)) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
- . ;
- . S IBFLD=0 F S IBFLD=$O(IBDATA(IBIX,IBFLD)) Q:'IBFLD S IBARRAY(IBFLD)=IBDATA(IBIX,IBFLD)
- . ;
- . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
- ;
- ; medicare Part A and Part B
- S IBIX="M" F IBFLD="PART A","PART B" I $D(IBDATA(IBIX,IBFLD)) D
- . ;
- . S DFN=$G(IBDATA(IBIX,"DFN")) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
- . S IBSOURCE=$G(IBDATA(IBIX,"SOURCE")) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
- . ;
- . S IBARRAY(20.01)="MEDICARE"
- . S IBARRAY(90.01)=IBFLD
- . S IBARRAY(90.02)=IBFLD
- . S IBARRAY(60.02)=$G(IBDATA(IBIX,IBFLD))
- . S IBARRAY(90.03)=$G(IBDATA(IBIX,"HICN"))
- . S IBARRAY(60.05)="v"
- . S IBARRAY(60.06)="01"
- . S IBARRAY(91.01)=$G(IBDATA(IBIX,"NAME"))
- . ;
- . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
- ;
- BUFFQ Q IBOUT
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCNBES1 2702 printed Jan 18, 2025@03:15:11 Page 2
- IBCNBES1 ;ALB/ARH-Ins Buffer: stuff new entries/data into buffer ;27 OCT 2000
- +1 ;;2.0;INTEGRATED BILLING;**141,497**;21-MAR-94;Build 120
- +2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
- +3 ;
- +4 ;
- BUFF(IBDATA) ; add new entries to Insurance Buffer file (355.33) and stuff the data passed in, no user interaction
- +1 ;
- +2 ; IBDATA array contains insurance entries, pass by reference
- +3 ;
- +4 ; IBDATA("M") level should contain Medicare WNR data only
- +5 ; IBDATA("M","DFN") = Patient DFN, required
- +6 ; IBDATA("M","SOURCE")= Source of data (355.33,.03), required
- +7 ; IBDATA("M","PART A") = Medicare Part A Effective Date
- +8 ; IBDATA("M","PART B") = Medicare Part B Effective Date
- +9 ; IBDATA("M","HICN") = Medicare HICN
- +10 ; IBDATA("M","NAME") = Beneficiary Name as Appears on Card
- +11 ;
- +12 ; IBDATA(X) level should contain any Insurance other than Medicare WNR
- +13 ; IBDATA(X,field #) = array of data to file in Buffer, may contain data on multiple insurance companies
- +14 ; where X = 1:1, subscript defines an insurance company
- +15 ; field # = field number of the data field in 355.33, DFN (60.01) and Source (.03) required
- +16 ;
- +17 ; returns 1 if all entries added ok or 0 if any errors found
- +18 ; also adds IBDATA(X,"MESSAGE") = ien of new entry or 0 followed by error message if entry could not be added
- +19 ;
- +20 ; example of call: $$BUFF^IBCNBES1(.IBDATA) where IBDATA(1,20.01)="Insurance Company Name", etc
- +21 ;
- +22 NEW X,Y,IBIX,IBFLD,IBY,IBARRAY,IBOUT,IBSOURCE,DFN
- SET IBOUT=1
- +23 ;
- +24 ; insurance companies
- +25 SET IBIX=0
- FOR
- SET IBIX=$ORDER(IBDATA(IBIX))
- if 'IBIX
- QUIT
- Begin DoDot:1
- +26 ;
- +27 SET DFN=$GET(IBDATA(IBIX,60.01))
- IF 'DFN
- SET IBDATA(IBIX,"MESSAGE")="0^No DFN"
- SET IBOUT=0
- QUIT
- +28 SET IBSOURCE=$GET(IBDATA(IBIX,.03))
- IF 'IBSOURCE
- SET IBDATA(IBIX,"MESSAGE")="0^No Source"
- SET IBOUT=0
- QUIT
- +29 ;
- +30 SET IBFLD=0
- FOR
- SET IBFLD=$ORDER(IBDATA(IBIX,IBFLD))
- if 'IBFLD
- QUIT
- SET IBARRAY(IBFLD)=IBDATA(IBIX,IBFLD)
- +31 ;
- +32 SET IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY)
- KILL IBARRAY
- SET IBDATA(IBIX,"MESSAGE")=IBY
- IF 'IBY
- SET IBOUT=0
- End DoDot:1
- +33 ;
- +34 ; medicare Part A and Part B
- +35 SET IBIX="M"
- FOR IBFLD="PART A","PART B"
- IF $DATA(IBDATA(IBIX,IBFLD))
- Begin DoDot:1
- +36 ;
- +37 SET DFN=$GET(IBDATA(IBIX,"DFN"))
- IF 'DFN
- SET IBDATA(IBIX,"MESSAGE")="0^No DFN"
- SET IBOUT=0
- QUIT
- +38 SET IBSOURCE=$GET(IBDATA(IBIX,"SOURCE"))
- IF 'IBSOURCE
- SET IBDATA(IBIX,"MESSAGE")="0^No Source"
- SET IBOUT=0
- QUIT
- +39 ;
- +40 SET IBARRAY(20.01)="MEDICARE"
- +41 SET IBARRAY(90.01)=IBFLD
- +42 SET IBARRAY(90.02)=IBFLD
- +43 SET IBARRAY(60.02)=$GET(IBDATA(IBIX,IBFLD))
- +44 SET IBARRAY(90.03)=$GET(IBDATA(IBIX,"HICN"))
- +45 SET IBARRAY(60.05)="v"
- +46 SET IBARRAY(60.06)="01"
- +47 SET IBARRAY(91.01)=$GET(IBDATA(IBIX,"NAME"))
- +48 ;
- +49 SET IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY)
- KILL IBARRAY
- SET IBDATA(IBIX,"MESSAGE")=IBY
- IF 'IBY
- SET IBOUT=0
- End DoDot:1
- +50 ;
- BUFFQ QUIT IBOUT