BIEXPRT8 ;IHS/CMI/MWR - EXPORT IMMUNIZATION RECORDS; MAY 10, 2010
;;8.5;IMMUNIZATION;;SEP 01,2011
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; EXPORT IMMUNIZATION RECORDS: HFS ACCESS, OTHER PROMPTS.
;
;
;----------
HFS(BIFLNM,BIPATH,BIOPEN,BIPOP) ;EP
;---> Return path, open Host File and test access.
;---> Parameters:
; 1 - BIFLNM (req) File name given by the user.
; 2 - BIPATH (ret) Path name set in Site Parameters.
; 3 - BIOPEN (opt) If BIOPEN=1, leave Device (Host File) open;
; otherwise, close Host File with %ZISC.
; 4 - BIPOP (ret) BIPOP=1 if failed to open Host File.
;
S BIPOP=0
;---> No file name.
I $G(BIFLNM)']"" D ERRCD^BIUTL2(102,,1) S BIPOP=1 Q
;
;---> No site parameter entry.
I $G(^BISITE(DUZ(2),0))']"" D ERRCD^BIUTL2(103,,1) S BIPOP=1 Q
;
;---> Path not set.
S BIPATH=$P(^BISITE(DUZ(2),0),U,14) N X S X="I"_"O(1)" K @X
I BIPATH']"" D ERRCD^BIUTL2(104,,1) S BIPOP=1 Q
;
;---> Attempt to open Host File Server.
S BIPOP=$$OPEN^%ZISH(BIPATH,BIFLNM,"W")
;
;---> If not valid PATH, will bomb with a <MODER>.
;---> Purpose here is to test Host File access before beginning search.
I BIPOP D ^%ZISC,ERRCD^BIUTL2(101,,1) Q
U IO W ""
D:'$G(BIOPEN) ^%ZISC
Q
;
;----------
OKAY(BIPOP) ;EP
;---> Get final okay to continue.
;---> Parameters:
; 1 - BIPOP (ret) BIPOP=1 if DIRUT *or* if Not OK to proceed.
;
D IO^BIO("Do you REALLY wish to export records now?")
N A S BIPOP=0
S A=" Enter YES to export records, enter NO to abort this process."
D DIR^BIFMAN("Y",.Y,.BIPOP," Enter Yes or No","YES",A)
I BIPOP!(Y=0) D Q
.D IO^BIO("* NO RECORDS EXPORTED. *","!!?25")
.D DIRZ^BIUTL3(.BIPOP) S BIPOP=1 ;---> If Y=0 flag "not okay".
;
S A="Please hold while records are scanned. This may take awhile..."
D IO^BIO(A,"!!?3")
Q
BIEXPRT8 ;IHS/CMI/MWR - EXPORT IMMUNIZATION RECORDS; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;;SEP 01,2011
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; EXPORT IMMUNIZATION RECORDS: HFS ACCESS, OTHER PROMPTS.
+4 ;
+5 ;
+6 ;----------
HFS(BIFLNM,BIPATH,BIOPEN,BIPOP) ;EP
+1 ;---> Return path, open Host File and test access.
+2 ;---> Parameters:
+3 ; 1 - BIFLNM (req) File name given by the user.
+4 ; 2 - BIPATH (ret) Path name set in Site Parameters.
+5 ; 3 - BIOPEN (opt) If BIOPEN=1, leave Device (Host File) open;
+6 ; otherwise, close Host File with %ZISC.
+7 ; 4 - BIPOP (ret) BIPOP=1 if failed to open Host File.
+8 ;
+9 SET BIPOP=0
+10 ;---> No file name.
+11 IF $GET(BIFLNM)']""
DO ERRCD^BIUTL2(102,,1)
SET BIPOP=1
QUIT
+12 ;
+13 ;---> No site parameter entry.
+14 IF $GET(^BISITE(DUZ(2),0))']""
DO ERRCD^BIUTL2(103,,1)
SET BIPOP=1
QUIT
+15 ;
+16 ;---> Path not set.
+17 SET BIPATH=$PIECE(^BISITE(DUZ(2),0),U,14)
NEW X
SET X="I"_"O(1)"
KILL @X
+18 IF BIPATH']""
DO ERRCD^BIUTL2(104,,1)
SET BIPOP=1
QUIT
+19 ;
+20 ;---> Attempt to open Host File Server.
+21 SET BIPOP=$$OPEN^%ZISH(BIPATH,BIFLNM,"W")
+22 ;
+23 ;---> If not valid PATH, will bomb with a <MODER>.
+24 ;---> Purpose here is to test Host File access before beginning search.
+25 IF BIPOP
DO ^%ZISC
DO ERRCD^BIUTL2(101,,1)
QUIT
+26 USE IO
WRITE ""
+27 IF '$GET(BIOPEN)
DO ^%ZISC
+28 QUIT
+29 ;
+30 ;----------
OKAY(BIPOP) ;EP
+1 ;---> Get final okay to continue.
+2 ;---> Parameters:
+3 ; 1 - BIPOP (ret) BIPOP=1 if DIRUT *or* if Not OK to proceed.
+4 ;
+5 DO IO^BIO("Do you REALLY wish to export records now?")
+6 NEW A
SET BIPOP=0
+7 SET A=" Enter YES to export records, enter NO to abort this process."
+8 DO DIR^BIFMAN("Y",.Y,.BIPOP," Enter Yes or No","YES",A)
+9 IF BIPOP!(Y=0)
Begin DoDot:1
+10 DO IO^BIO("* NO RECORDS EXPORTED. *","!!?25")
+11 ;---> If Y=0 flag "not okay".
DO DIRZ^BIUTL3(.BIPOP)
SET BIPOP=1
End DoDot:1
QUIT
+12 ;
+13 SET A="Please hold while records are scanned. This may take awhile..."
+14 DO IO^BIO(A,"!!?3")
+15 QUIT