PSXHENV ;BIR/BAB-CMOP Environment Check-HOST ;[ 04/08/97 2:06 PM ]
;;2.0;CMOP;;11 Apr 97
START I ^XMB("NETNAME")'["CMOP-" S XPDQUIT=1 Q
S XQABT1=$H
S ERROR=0
I ^XMB("NETNAME")?1"CMOP-".E W !!,"Consolidated Mail Outpatient Pharmacy Install for Host Facility.",!!
E S XPDABORT=2 Q
DUZ S PSXDZ=$S(('($D(DUZ)#2)):1,'$D(^VA(200,DUZ,0)):1,'$D(DUZ(0)):1,DUZ(0)'="@":1,1:0) I PSXDZ=1 W !!,"You must be a valid user and ",!,"DUZ(0) must be set to the ""@"" sign!!",!! S XPDABORT=2 Q
CKDT I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y
CKU S PSX=0 I $D(DUZ),DUZ(0)="@",$D(DT),$D(U),PSXDZ=0 G QUIT:$G(ERROR) D ENV G DONE
QUIT ;
S XPDABORT=2 I $G(ERROR)=1 K PSX,PSXDZ,ERROR Q
DONE I $G(PSXDZ)=0,HOST=1,OP=0,NDF=1,KNL=1 S PSX=1
I $G(PSXDZ)=0,HOST=0,OP=1,NDF=1,KNL=1 S PSX=1
S:ERROR=1 PSX=0 K ERROR
I PSX=0 S XPDABORT=2 W !,"INITIALIZATION ABORTED"
K PSX,PKG,KNL,NDF,OP,HOST,PSXDZ,ERROR
S (XQABT2,XQABT3)=$H
Q
ENV ;
S (HOST,OP,NDF,KNL)=0
S:^XMB("NETNAME")?1"CMOP-".E HOST=1
;I $D(^DIC(9.4,"B","OUTPATIENT PHARMACY")) S PKG=$O(^DIC(9.4,"B","OUTPATIENT PHARMACY",0)) I $G(^DIC(9.4,+PKG,"VERSION"))'<"6.0" S OP=1
;I OP'=1,(^XMB("NETNAME")'?1"CMOP-".E) W !,"Outpatient Pharmacy Version 6.0 (or greater) not found. This version is required to continue CMOP installation."
I $D(^DIC(9.4,"B","KERNEL")) S PKG=$O(^DIC(9.4,"B","KERNEL",0)) I $G(^DIC(9.4,+PKG,"VERSION"))'<"8.0" S KNL=1
I KNL'=1 W !,"Kernel Version 8.0 (or greater) not found. This version is required to continue CMOP installation."
I $D(^DIC(9.4,"B","NATIONAL DRUG FILE")) S PKG=$O(^DIC(9.4,"B","NATIONAL DRUG FILE",0)) I $G(^DIC(9.4,+PKG,"VERSION"))'<"3.16" S NDF=1
I NDF'=1 W !,"National Drug File Version 3.16 (or greater) not found. This version is required to continue CMOP installation."
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSXHENV 1789 printed Nov 22, 2024@16:54:27 Page 2
PSXHENV ;BIR/BAB-CMOP Environment Check-HOST ;[ 04/08/97 2:06 PM ]
+1 ;;2.0;CMOP;;11 Apr 97
START IF ^XMB("NETNAME")'["CMOP-"
SET XPDQUIT=1
QUIT
+1 SET XQABT1=$HOROLOG
+2 SET ERROR=0
+3 IF ^XMB("NETNAME")?1"CMOP-".E
WRITE !!,"Consolidated Mail Outpatient Pharmacy Install for Host Facility.",!!
+4 IF '$TEST
SET XPDABORT=2
QUIT
DUZ SET PSXDZ=$SELECT(('($DATA(DUZ)#2)):1,'$DATA(^VA(200,DUZ,0)):1,'$DATA(DUZ(0)):1,DUZ(0)'="@":1,1:0)
IF PSXDZ=1
WRITE !!,"You must be a valid user and ",!,"DUZ(0) must be set to the ""@"" sign!!",!!
SET XPDABORT=2
QUIT
CKDT IF '$DATA(DT)
SET %DT=""
SET X="T"
DO ^%DT
SET DT=Y
CKU SET PSX=0
IF $DATA(DUZ)
IF DUZ(0)="@"
IF $DATA(DT)
IF $DATA(U)
IF PSXDZ=0
if $GET(ERROR)
GOTO QUIT
DO ENV
GOTO DONE
QUIT ;
+1 SET XPDABORT=2
IF $GET(ERROR)=1
KILL PSX,PSXDZ,ERROR
QUIT
DONE IF $GET(PSXDZ)=0
IF HOST=1
IF OP=0
IF NDF=1
IF KNL=1
SET PSX=1
+1 IF $GET(PSXDZ)=0
IF HOST=0
IF OP=1
IF NDF=1
IF KNL=1
SET PSX=1
+2 if ERROR=1
SET PSX=0
KILL ERROR
+3 IF PSX=0
SET XPDABORT=2
WRITE !,"INITIALIZATION ABORTED"
+4 KILL PSX,PKG,KNL,NDF,OP,HOST,PSXDZ,ERROR
+5 SET (XQABT2,XQABT3)=$HOROLOG
+6 QUIT
ENV ;
+1 SET (HOST,OP,NDF,KNL)=0
+2 if ^XMB("NETNAME")?1"CMOP-".E
SET HOST=1
+3 ;I $D(^DIC(9.4,"B","OUTPATIENT PHARMACY")) S PKG=$O(^DIC(9.4,"B","OUTPATIENT PHARMACY",0)) I $G(^DIC(9.4,+PKG,"VERSION"))'<"6.0" S OP=1
+4 ;I OP'=1,(^XMB("NETNAME")'?1"CMOP-".E) W !,"Outpatient Pharmacy Version 6.0 (or greater) not found. This version is required to continue CMOP installation."
+5 IF $DATA(^DIC(9.4,"B","KERNEL"))
SET PKG=$ORDER(^DIC(9.4,"B","KERNEL",0))
IF $GET(^DIC(9.4,+PKG,"VERSION"))'<"8.0"
SET KNL=1
+6 IF KNL'=1
WRITE !,"Kernel Version 8.0 (or greater) not found. This version is required to continue CMOP installation."
+7 IF $DATA(^DIC(9.4,"B","NATIONAL DRUG FILE"))
SET PKG=$ORDER(^DIC(9.4,"B","NATIONAL DRUG FILE",0))
IF $GET(^DIC(9.4,+PKG,"VERSION"))'<"3.16"
SET NDF=1
+8 IF NDF'=1
WRITE !,"National Drug File Version 3.16 (or greater) not found. This version is required to continue CMOP installation."
+9 QUIT