source: FOIAVistA/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLPOST.m@ 1470

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

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1HLPOST ;ALB/JRP - POST INIT DRIVER;23-MAR-95
2 ;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
3 ;DECLARE VARIABLES
4 N DIC,X,Y,ALRDYRUN,PROTINST,LISTINST,FILECNV,DATERUN
5 N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,%ZIS,POP,%DT,%H
6 ;CREATE ENTRY IN HL COMMUNICATION SERVER PARAMETER FILE (#869.3)
7 D PARAM
8 ;DETERMINE IF POST INIT HAS ALREADY BY RUN
9 S DIC="^DIC(9.4,"
10 S DIC(0)="X"
11 S X="HEALTH LEVEL SEVEN"
12 D ^DIC
13 S ALRDYRUN=+$P($G(^DIC(9.4,+Y,"INIT")),"^",2)
14 S (PROTINST,LISTINST,FILECNV)=1
15 ;ALREADY RUN ASK USER WHAT TO DO
16 I (ALRDYRUN) D Q:(('PROTINST)&('LISTINST)&('FILECNV))
17 .;RUN POST-INIT AGAIN
18 .I ($$RUNAGAIN^HLPOSTQ(ALRDYRUN)<1) S (PROTINST,LISTINST,FILECNV)=0 Q
19 .;RE-INSTALL PROTOCOLS
20 .S PROTINST=$$PROTINST^HLPOSTQ
21 .I (PROTINST<0) S (PROTINST,LISTINST,FILECNV)=0 Q
22 .;RE-INSTALL LIST TEMPLATES
23 .S LISTINST=$$LISTINST^HLPOSTQ
24 .I (LISTINST<0) S (PROTINST,LISTINST,FILECNV)=0 Q
25 .;RE-RUN FILE CONVERSION
26 .S FILECNV=$$FILECNV^HLPOSTQ
27 .S:(FILECNV<0) (PROTINST,LISTINST,FILECNV)=0
28 ;INSTALL PROTOCOLS
29 I (PROTINST) W !! D ^HLONIT
30 W:('PROTINST) !!,"Installation of PROTOCOLS not performed"
31 ;INSTALL LIST TEMPLATES
32 I (LISTINST) W !! D ^HLLM
33 W:('LISTINST) !!,"Installation of LIST TEMPLATES not performed"
34 ;NOT DOING FILE CONVERSION - DONE
35 I ('FILECNV) W !!,"Running of file conversions not performed" Q
36CONVERT ;FILE CONVERSION
37 S %ZIS="QN0"
38 S %ZIS("A")="Select output device for file conversion: "
39 W !! D ^%ZIS
40 I (POP) W !!,"Running of the file conversions not performed" Q
41 ;QUEUE TO DEVICE
42 I (IO'=IO(0)) D Q:($G(ZTSK))
43 .;USER SELECTED HOST FILE
44 .S:(IOT="HFS") IO("HFSIO")=IO
45 .;QUEUE
46 .S ZTRTN="^HLPOST16"
47 .S ZTDESC="FILE CONVERSIONS REQUIRED BY INSTALLATION OF HL7 V1.6"
48 .S ZTIO=ION
49 .S:('$D(IO("Q"))) ZTDTH=$H
50 .D ^%ZTLOAD
51 .;ERROR QUEUEING
52 .I ('$G(ZTSK)) D Q
53 ..D HOME^%ZIS
54 ..W !!,"** Running of file conversions could not be queued **"
55 ..W !,"** File conversions will be run interactively **"
56 .;TELL USER TASK NUMBER & QUEUEING TIME
57 .D HOME^%ZIS
58 .S %H=ZTSK("D")
59 .D YX^%DTC
60 .S DATERUN=$P(Y,"@",1)_" @ "_$P(Y,"@",2)
61 .W !!,"Running of file conversions queued as task number ",ZTSK
62 .W !,"Task will begin execution on ",DATERUN
63 ;INTERACTIVE
64 ;OPEN SLAVE
65 I ($P(IOST,"-",1)["P") D
66 .S %ZIS=""
67 .S IOP=ION
68 .D ^%ZIS
69 ;DO CONVERSIONS
70 D ^HLPOST16
71 ;CLOSE SLAVE DEVICE
72 D ^%ZISC
73 ;[RE]SET HOME DEVICE ATTRIBUTES
74 D HOME^%ZIS
75 Q
76 ;
77REQUEUE ;ENTRY POINT FOR REQUEUEING/RUNNING OF FILE CONVERSIONS
78 ;DECLARE VARIABLES
79 N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,%ZIS,POP,%DT,DATERUN,%H
80 ;QUEUE/RUN FILE CONVERSIONS
81 D CONVERT
82 ;DONE
83 Q
84PARAM ;CREATE INITIAL ENTRY IN HL COMMUNICATION SERVER PARAMETER file (#869.3)
85 ;DECLARE VARIABLES
86 N DIC,X,Y,DTOUT,DUOUT,DLAYGO
87 ;CREATE/FIND ENTRY
88 S DLAYGO=869.3
89 S DIC="^HLCS(869.3,"
90 S DIC(0)="L"
91 S DIC("DR")="11///1;12///1"
92 S X=1
93 D ^DIC
94 ;Error
95 I (Y="-1") D Q
96 .W !!,"Unable to create/find entry in HL COMMUNICATION SERVER"
97 .W !,"PARAMETER file (#869.3). Entry must exist in order for"
98 .W !,"the incoming & outgoing filers to run. Use FileMan to"
99 .W !,"create an initial entry for editing.",!!
100 ;Entry created
101 I ($P(Y,"^",3)) D
102 .;Tell user entry was created
103 .W !!,"Initial entry in HL COMMUNICATION SERVER PARAMETER file"
104 .W !,"(#869.3) has been created.",!
105 Q
Note: See TracBrowser for help on using the repository browser.