PSSPOST ;BIR/WRT-Post-install routine ; 04/07/98 10:19
;;1.0;PHARMACY DATA MANAGEMENT;**10**;9/30/97
; POST-INSTALL ROUTINE
VERSION S:'$D(^PS(59.7,1,80)) ^PS(59.7,1,80)="1.0^0"
D ^PSSDENT,MR,LABM,CLEAN S $P(^PS(59.7,1,80),"^",1)="1.0" D BTEMP,P8 K ^TMP($J,"PSSEXP"),SCH,IEN,OEXP
S:'$D(^PS(59.7,1,31)) ^PS(59.7,1,31)="^IV" I $D(^PS(59.7,1,31)),$P(^PS(59.7,1,31),"^",2)="" S $P(^PS(59.7,1,31),"^",2)="IV"
S X="PSSJXR",Y="55",DMAX="5000" D EN^DIKZ
S X="PSSVX6",Y="52.6",DMAX="5000" D EN^DIKZ
Q
P8 S SCH="" F S SCH=$O(^TMP($J,"PSSEXP",SCH)) Q:SCH="" S OEXP=$O(^TMP($J,"PSSEXP",SCH,0)) I $D(^PS(51.1,"AC","PSJ",SCH)) S IEN=$O(^PS(51.1,"AC","PSJ",SCH,0)) S:$P(^PS(51.1,IEN,0),"^",8)="" $P(^PS(51.1,IEN,0),"^",8)=OEXP
Q
BTEMP F GG=0:1 S HH=$P($T(DATA+GG),";",3,20) Q:HH="" S RCD=$P(HH,"^",1),EXP=$P(HH,"^",2) D BTEMP1
K GG,HH,RCD,EXP Q
BTEMP1 S ^TMP($J,"PSSEXP",RCD,EXP)=""
Q
CLA K ^PSDRUG("VAC") S DIK="^PSDRUG(",DIK(1)="25" D ENALL^DIK
Q
MR N ROOT,I,J,X,LINE
S ROOT=$NA(@XPDGREF@("DATA"))
F J=1:1 Q:'$D(@ROOT@(J)) S LINE=^(J) D MR1
Q
MR1 I $D(^PS(51.2,"B",$P(LINE,"^",1))) S DA=$O(^PS(51.2,"B",$P(LINE,"^",1),0)) S $P(^PS(51.2,DA,0),"^",2)=$P(LINE,"^",2)
Q
CLEAN F IFN=0:0 S IFN=$O(^PSDRUG(IFN)) Q:'IFN K:$D(^PSDRUG(IFN,"CH")) ^PSDRUG(IFN,"CH") K:$D(^PSDRUG(IFN,"PS")) ^PSDRUG(IFN,"PS") K:$D(^PSDRUG(IFN,"IV")) ^PSDRUG(IFN,"IV")
Q
LABM K IEN F IEN=0:0 S IEN=$O(^PSDRUG(IEN)) Q:'IEN D LABM1,LABM2,LABM3
Q
LABM1 I $P($G(^PSDRUG(IEN,"CLOZ1")),"^")="LAB MONITOR" S ^PSDRUG(IEN,"CLOZ1")="^1"
Q
LABM2 I $D(^PSDRUG(IEN,"CLOZ1")),$P(^PSDRUG(IEN,"CLOZ1"),"^")="",$D(^PSDRUG(IEN,"CLOZ")) S $P(^PSDRUG(IEN,"CLOZ1"),"^",2)=1
Q
LABM3 I '$D(^PSDRUG(IEN,"CLOZ1")),$D(^PSDRUG(IEN,"CLOZ")) S $P(^PSDRUG(IEN,"CLOZ1"),"^",2)=1
Q
DATA ;;QD^EVERY DAY
;;BID^TWICE A DAY
;;Q4H^EVERY 4 HOURS
;;Q3H^EVERY 3 HOURS
;;Q8H^EVERY 8 HOURS
;;QAM^EVERY MORNING
;;Q6H^EVERY 6 HOURS
;;TID^THREE TIMES A DAY
;;QID^FOUR TIMES A DAY
;;Q12H^EVERY 12 HOURS
;;QOD^EVERY OTHER DAY
;;QHS^AT BEDTIME
;;Q24H^EVERY 24 HOURS
;;Q2H^EVERY 2 HOURS
PSSPOST ;BIR/WRT-Post-install routine ; 04/07/98 10:19
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**10**;9/30/97
+2 ; POST-INSTALL ROUTINE
VERSION IF '$DATA(^PS(59.7,1,80))
SET ^PS(59.7,1,80)="1.0^0"
+1 DO ^PSSDENT
DO MR
DO LABM
DO CLEAN
SET $PIECE(^PS(59.7,1,80),"^",1)="1.0"
DO BTEMP
DO P8
KILL ^TMP($JOB,"PSSEXP"),SCH,IEN,OEXP
+2 IF '$DATA(^PS(59.7,1,31))
SET ^PS(59.7,1,31)="^IV"
IF $DATA(^PS(59.7,1,31))
IF $PIECE(^PS(59.7,1,31),"^",2)=""
SET $PIECE(^PS(59.7,1,31),"^",2)="IV"
+3 SET X="PSSJXR"
SET Y="55"
SET DMAX="5000"
DO EN^DIKZ
+4 SET X="PSSVX6"
SET Y="52.6"
SET DMAX="5000"
DO EN^DIKZ
+5 QUIT
P8 SET SCH=""
FOR
SET SCH=$ORDER(^TMP($JOB,"PSSEXP",SCH))
IF SCH=""
QUIT
SET OEXP=$ORDER(^TMP($JOB,"PSSEXP",SCH,0))
IF $DATA(^PS(51.1,"AC","PSJ",SCH))
SET IEN=$ORDER(^PS(51.1,"AC","PSJ",SCH,0))
IF $PIECE(^PS(51.1,IEN,0),"^",8)=""
SET $PIECE(^PS(51.1,IEN,0),"^",8)=OEXP
+1 QUIT
BTEMP FOR GG=0:1
SET HH=$PIECE($TEXT(DATA+GG),";",3,20)
IF HH=""
QUIT
SET RCD=$PIECE(HH,"^",1)
SET EXP=$PIECE(HH,"^",2)
DO BTEMP1
+1 KILL GG,HH,RCD,EXP
QUIT
BTEMP1 SET ^TMP($JOB,"PSSEXP",RCD,EXP)=""
+1 QUIT
CLA KILL ^PSDRUG("VAC")
SET DIK="^PSDRUG("
SET DIK(1)="25"
DO ENALL^DIK
+1 QUIT
MR NEW ROOT,I,J,X,LINE
+1 SET ROOT=$NAME(@XPDGREF@("DATA"))
+2 FOR J=1:1
IF '$DATA(@ROOT@(J))
QUIT
SET LINE=^(J)
DO MR1
+3 QUIT
MR1 IF $DATA(^PS(51.2,"B",$PIECE(LINE,"^",1)))
SET DA=$ORDER(^PS(51.2,"B",$PIECE(LINE,"^",1),0))
SET $PIECE(^PS(51.2,DA,0),"^",2)=$PIECE(LINE,"^",2)
+1 QUIT
CLEAN FOR IFN=0:0
SET IFN=$ORDER(^PSDRUG(IFN))
IF 'IFN
QUIT
IF $DATA(^PSDRUG(IFN,"CH"))
KILL ^PSDRUG(IFN,"CH")
IF $DATA(^PSDRUG(IFN,"PS"))
KILL ^PSDRUG(IFN,"PS")
IF $DATA(^PSDRUG(IFN,"IV"))
KILL ^PSDRUG(IFN,"IV")
+1 QUIT
LABM KILL IEN
FOR IEN=0:0
SET IEN=$ORDER(^PSDRUG(IEN))
IF 'IEN
QUIT
DO LABM1
DO LABM2
DO LABM3
+1 QUIT
LABM1 IF $PIECE($GET(^PSDRUG(IEN,"CLOZ1")),"^")="LAB MONITOR"
SET ^PSDRUG(IEN,"CLOZ1")="^1"
+1 QUIT
LABM2 IF $DATA(^PSDRUG(IEN,"CLOZ1"))
IF $PIECE(^PSDRUG(IEN,"CLOZ1"),"^")=""
IF $DATA(^PSDRUG(IEN,"CLOZ"))
SET $PIECE(^PSDRUG(IEN,"CLOZ1"),"^",2)=1
+1 QUIT
LABM3 IF '$DATA(^PSDRUG(IEN,"CLOZ1"))
IF $DATA(^PSDRUG(IEN,"CLOZ"))
SET $PIECE(^PSDRUG(IEN,"CLOZ1"),"^",2)=1
+1 QUIT
DATA ;;QD^EVERY DAY
+1 ;;BID^TWICE A DAY
+2 ;;Q4H^EVERY 4 HOURS
+3 ;;Q3H^EVERY 3 HOURS
+4 ;;Q8H^EVERY 8 HOURS
+5 ;;QAM^EVERY MORNING
+6 ;;Q6H^EVERY 6 HOURS
+7 ;;TID^THREE TIMES A DAY
+8 ;;QID^FOUR TIMES A DAY
+9 ;;Q12H^EVERY 12 HOURS
+10 ;;QOD^EVERY OTHER DAY
+11 ;;QHS^AT BEDTIME
+12 ;;Q24H^EVERY 24 HOURS
+13 ;;Q2H^EVERY 2 HOURS