source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCRHBR2.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1IBCRHBR2 ;ALB/ARH - RATES: UPLOAD HOST FILES (RC) READ ; 10-OCT-1998
2 ;;2.0;INTEGRATED BILLING;**106,138**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;LOAD -> A -> SET...
6 ;
7 ;for each file -> open/close and read a line -> parse the line -> save the data to XTMP
8 ;
9 ;
10LOAD(IBPATH,IBFILE,IBNAME,PARSE,VERS) ; open and read a host file, returns true if file loaded ok
11 N IBOK,IBI,IBFLINE,IBSYS,X,Y S IBOK=1,IBSYS=0,VERS=$G(VERS)
12 ;
13 S X=$G(^%ZOSF("OS")) I X["OpenM" S IBSYS=1,X="ERROR^IBCRHBR2",@^%ZOSF("TRAP") ; reset error trap for OpenM
14 ;
15 ;W !,IBNAME,?45,IBFILE ;I PARSE="OC" Q 0 ; ***** AND IBI ;Q 1
16 ;
17 D OPEN^%ZISH(IBFILE,IBPATH,IBFILE,"R") I POP W !!,?20,"**** Unable to open ",IBPATH,IBFILE,! S IBOK=0 G LOADQ
18 ;
19 U IO(0) W !,IBNAME,?45,IBFILE
20 ;
21 S IBI=0 F S IBI=IBI+1 U IO R IBFLINE:5 Q:$$ENDF D @(PARSE_"^IBCRHBR3") I '(IBI#100) U IO(0) W "." ;Q:IBI>100
22 ;
23CLOSE D CLOSE^%ZISH(IBFILE) ;W " Done, ",(IBI-1)," lines processed."
24 ;
25LOADQ I IBSYS=1 S X="",@^%ZOSF("TRAP") ; reset error trap for OpenM
26 Q $G(IBOK)
27 ;
28ENDF() N IBX S IBX=1 I $T S IBX=0
29 I $$STATUS^%ZISH S IBX=1
30 Q IBX
31 ;
32ERROR ; process EOF and errors for OpenM
33 N IBERROR S IBERROR=$$EC^%ZOSV
34 I IBERROR["ENDOFFILE" S IBOK=1 G CLOSE
35 U IO(0) W !!,"Error reading file: ",IBERROR,!!
36 D ^%ZTER
37 S IBOK=0
38 G CLOSE
39 Q
Note: See TracBrowser for help on using the repository browser.