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

IBCNBES1.m

Go to the documentation of this file.
  1. 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
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;
  1. BUFF(IBDATA) ; add new entries to Insurance Buffer file (355.33) and stuff the data passed in, no user interaction
  1. ;
  1. ; IBDATA array contains insurance entries, pass by reference
  1. ;
  1. ; IBDATA("M") level should contain Medicare WNR data only
  1. ; IBDATA("M","DFN") = Patient DFN, required
  1. ; IBDATA("M","SOURCE")= Source of data (355.33,.03), required
  1. ; IBDATA("M","PART A") = Medicare Part A Effective Date
  1. ; IBDATA("M","PART B") = Medicare Part B Effective Date
  1. ; IBDATA("M","HICN") = Medicare HICN
  1. ; IBDATA("M","NAME") = Beneficiary Name as Appears on Card
  1. ;
  1. ; IBDATA(X) level should contain any Insurance other than Medicare WNR
  1. ; IBDATA(X,field #) = array of data to file in Buffer, may contain data on multiple insurance companies
  1. ; where X = 1:1, subscript defines an insurance company
  1. ; field # = field number of the data field in 355.33, DFN (60.01) and Source (.03) required
  1. ;
  1. ; returns 1 if all entries added ok or 0 if any errors found
  1. ; also adds IBDATA(X,"MESSAGE") = ien of new entry or 0 followed by error message if entry could not be added
  1. ;
  1. ; example of call: $$BUFF^IBCNBES1(.IBDATA) where IBDATA(1,20.01)="Insurance Company Name", etc
  1. ;
  1. N X,Y,IBIX,IBFLD,IBY,IBARRAY,IBOUT,IBSOURCE,DFN S IBOUT=1
  1. ;
  1. ; insurance companies
  1. S IBIX=0 F S IBIX=$O(IBDATA(IBIX)) Q:'IBIX D
  1. . ;
  1. . S DFN=$G(IBDATA(IBIX,60.01)) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
  1. . S IBSOURCE=$G(IBDATA(IBIX,.03)) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
  1. . ;
  1. . S IBFLD=0 F S IBFLD=$O(IBDATA(IBIX,IBFLD)) Q:'IBFLD S IBARRAY(IBFLD)=IBDATA(IBIX,IBFLD)
  1. . ;
  1. . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
  1. ;
  1. ; medicare Part A and Part B
  1. S IBIX="M" F IBFLD="PART A","PART B" I $D(IBDATA(IBIX,IBFLD)) D
  1. . ;
  1. . S DFN=$G(IBDATA(IBIX,"DFN")) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
  1. . S IBSOURCE=$G(IBDATA(IBIX,"SOURCE")) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
  1. . ;
  1. . S IBARRAY(20.01)="MEDICARE"
  1. . S IBARRAY(90.01)=IBFLD
  1. . S IBARRAY(90.02)=IBFLD
  1. . S IBARRAY(60.02)=$G(IBDATA(IBIX,IBFLD))
  1. . S IBARRAY(90.03)=$G(IBDATA(IBIX,"HICN"))
  1. . S IBARRAY(60.05)="v"
  1. . S IBARRAY(60.06)="01"
  1. . S IBARRAY(91.01)=$G(IBDATA(IBIX,"NAME"))
  1. . ;
  1. . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
  1. ;
  1. BUFFQ Q IBOUT