source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCNBES1.m@ 1261

Last change on this file since 1261 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1IBCNBES1 ;ALB/ARH-Ins Buffer: stuff new entries/data into buffer ;27 OCT 2000
2 ;;2.0;INTEGRATED BILLING;**141**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;
6BUFF(IBDATA) ; add new entries to Insurance Buffer file (355.33) and stuff the data passed in, no user interaction
7 ;
8 ; IBDATA array contains insurance entries, pass by reference
9 ;
10 ; IBDATA("M") level should contain Medicare WNR data only
11 ; IBDATA("M","DFN") = Patient DFN, required
12 ; IBDATA("M","SOURCE")= Source of data (355.33,.03), required
13 ; IBDATA("M","PART A") = Medicare Part A Effective Date
14 ; IBDATA("M","PART B") = Medicare Part B Effective Date
15 ; IBDATA("M","HICN") = Medicare HICN
16 ; IBDATA("M","NAME") = Benficiary Name as Appears on Card
17 ;
18 ; IBDATA(X) level should contain any Insurance other than Medicare WNR
19 ; IBDATA(X,field #) = array of data to file in Buffer, may contain data on multiple insurance companies
20 ; where X = 1:1, subscript defines an insurance company
21 ; field # = field number of the data field in 355.33, DFN (60.01) and Source (.03) required
22 ;
23 ; returns 1 if all entries added ok or 0 if any errors found
24 ; also adds IBDATA(X,"MESSAGE") = ien of new entry or 0 followed by error message if entry could not be added
25 ;
26 ; example of call: $$BUFF^IBCNBES1(.IBDATA) where IBDATA(1,20.01)="Insurance Company Name", etc
27 ;
28 N X,Y,IBIX,IBFLD,IBY,IBARRAY,IBOUT,IBSOURCE,DFN S IBOUT=1
29 ;
30 ; insurance companies
31 S IBIX=0 F S IBIX=$O(IBDATA(IBIX)) Q:'IBIX D
32 . ;
33 . S DFN=$G(IBDATA(IBIX,60.01)) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
34 . S IBSOURCE=$G(IBDATA(IBIX,.03)) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
35 . ;
36 . S IBFLD=0 F S IBFLD=$O(IBDATA(IBIX,IBFLD)) Q:'IBFLD S IBARRAY(IBFLD)=IBDATA(IBIX,IBFLD)
37 . ;
38 . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
39 ;
40 ; medicare Part A and Part B
41 S IBIX="M" F IBFLD="PART A","PART B" I $D(IBDATA(IBIX,IBFLD)) D
42 . ;
43 . S DFN=$G(IBDATA(IBIX,"DFN")) I 'DFN S IBDATA(IBIX,"MESSAGE")="0^No DFN",IBOUT=0 Q
44 . S IBSOURCE=$G(IBDATA(IBIX,"SOURCE")) I 'IBSOURCE S IBDATA(IBIX,"MESSAGE")="0^No Source",IBOUT=0 Q
45 . ;
46 . S IBARRAY(20.01)="MEDICARE"
47 . S IBARRAY(40.02)=IBFLD
48 . S IBARRAY(40.03)=IBFLD
49 . S IBARRAY(60.02)=$G(IBDATA(IBIX,IBFLD))
50 . S IBARRAY(60.04)=$G(IBDATA(IBIX,"HICN"))
51 . S IBARRAY(60.05)="v"
52 . S IBARRAY(60.06)="01"
53 . S IBARRAY(60.07)=$G(IBDATA(IBIX,"NAME"))
54 . ;
55 . S IBY=$$ADDSTF^IBCNBES(IBSOURCE,DFN,.IBARRAY) K IBARRAY S IBDATA(IBIX,"MESSAGE")=IBY I 'IBY S IBOUT=0
56 ;
57BUFFQ Q IBOUT
Note: See TracBrowser for help on using the repository browser.