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

HLPOST.m

Go to the documentation of this file.
HLPOST ;ALB/JRP - POST INIT DRIVER;23-MAR-95
 ;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
 ;DECLARE VARIABLES
 N DIC,X,Y,ALRDYRUN,PROTINST,LISTINST,FILECNV,DATERUN
 N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,%ZIS,POP,%DT,%H
 ;CREATE ENTRY IN HL COMMUNICATION SERVER PARAMETER FILE (#869.3)
 D PARAM
 ;DETERMINE IF POST INIT HAS ALREADY BY RUN
 S DIC="^DIC(9.4,"
 S DIC(0)="X"
 S X="HEALTH LEVEL SEVEN"
 D ^DIC
 S ALRDYRUN=+$P($G(^DIC(9.4,+Y,"INIT")),"^",2)
 S (PROTINST,LISTINST,FILECNV)=1
 ;ALREADY RUN ASK USER WHAT TO DO
 I (ALRDYRUN) D  Q:(('PROTINST)&('LISTINST)&('FILECNV))
 .;RUN POST-INIT AGAIN
 .I ($$RUNAGAIN^HLPOSTQ(ALRDYRUN)<1) S (PROTINST,LISTINST,FILECNV)=0 Q
 .;RE-INSTALL PROTOCOLS
 .S PROTINST=$$PROTINST^HLPOSTQ
 .I (PROTINST<0) S (PROTINST,LISTINST,FILECNV)=0 Q
 .;RE-INSTALL LIST TEMPLATES
 .S LISTINST=$$LISTINST^HLPOSTQ
 .I (LISTINST<0) S (PROTINST,LISTINST,FILECNV)=0 Q
 .;RE-RUN FILE CONVERSION
 .S FILECNV=$$FILECNV^HLPOSTQ
 .S:(FILECNV<0) (PROTINST,LISTINST,FILECNV)=0
 ;INSTALL PROTOCOLS
 I (PROTINST) W !! D ^HLONIT
 W:('PROTINST) !!,"Installation of PROTOCOLS not performed"
 ;INSTALL LIST TEMPLATES
 I (LISTINST) W !! D ^HLLM
 W:('LISTINST) !!,"Installation of LIST TEMPLATES not performed"
 ;NOT DOING FILE CONVERSION - DONE
 I ('FILECNV) W !!,"Running of file conversions not performed" Q
CONVERT ;FILE CONVERSION
 S %ZIS="QN0"
 S %ZIS("A")="Select output device for file conversion: "
 W !! D ^%ZIS
 I (POP) W !!,"Running of the file conversions not performed" Q
 ;QUEUE TO DEVICE
 I (IO'=IO(0)) D  Q:($G(ZTSK))
 .;USER SELECTED HOST FILE
 .S:(IOT="HFS") IO("HFSIO")=IO
 .;QUEUE
 .S ZTRTN="^HLPOST16"
 .S ZTDESC="FILE CONVERSIONS REQUIRED BY INSTALLATION OF HL7 V1.6"
 .S ZTIO=ION
 .S:('$D(IO("Q"))) ZTDTH=$H
 .D ^%ZTLOAD
 .;ERROR QUEUEING
 .I ('$G(ZTSK)) D  Q
 ..D HOME^%ZIS
 ..W !!,"** Running of file conversions could not be queued **"
 ..W !,"**  File conversions will be run interactively  **"
 .;TELL USER TASK NUMBER & QUEUEING TIME
 .D HOME^%ZIS
 .S %H=ZTSK("D")
 .D YX^%DTC
 .S DATERUN=$P(Y,"@",1)_" @ "_$P(Y,"@",2)
 .W !!,"Running of file conversions queued as task number ",ZTSK
 .W !,"Task will begin execution on ",DATERUN
 ;INTERACTIVE
 ;OPEN SLAVE
 I ($P(IOST,"-",1)["P") D
 .S %ZIS=""
 .S IOP=ION
 .D ^%ZIS
 ;DO CONVERSIONS
 D ^HLPOST16
 ;CLOSE SLAVE DEVICE
 D ^%ZISC
 ;[RE]SET HOME DEVICE ATTRIBUTES
 D HOME^%ZIS
 Q
 ;
REQUEUE ;ENTRY POINT FOR REQUEUEING/RUNNING OF FILE CONVERSIONS
 ;DECLARE VARIABLES
 N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,%ZIS,POP,%DT,DATERUN,%H
 ;QUEUE/RUN FILE CONVERSIONS
 D CONVERT
 ;DONE
 Q
PARAM ;CREATE INITIAL ENTRY IN HL COMMUNICATION SERVER PARAMETER file (#869.3)
 ;DECLARE VARIABLES
 N DIC,X,Y,DTOUT,DUOUT,DLAYGO
 ;CREATE/FIND ENTRY
 S DLAYGO=869.3
 S DIC="^HLCS(869.3,"
 S DIC(0)="L"
 S DIC("DR")="11///1;12///1"
 S X=1
 D ^DIC
 ;Error
 I (Y="-1") D  Q
 .W !!,"Unable to create/find entry in HL COMMUNICATION SERVER"
 .W !,"PARAMETER file (#869.3).  Entry must exist in order for"
 .W !,"the incoming & outgoing filers to run.  Use FileMan to"
 .W !,"create an initial entry for editing.",!!
 ;Entry created
 I ($P(Y,"^",3)) D
 .;Tell user entry was created
 .W !!,"Initial entry in HL COMMUNICATION SERVER PARAMETER file"
 .W !,"(#869.3) has been created.",!
 Q