SROPRE ;B'HAM ISC/MAM - PRE-INIT FOR VERSION 3 ; 16 JAN 1990 9:20 AM
;;3.0; Surgery ;**9**;24 Jun 93
W !!!,"SURGERY VERSION 3.0",!
S SRINST=$O(^SRO(133,0)) I 'SRINST D NEW Q
S Z=$P($G(^SRO(133,SRINST,0)),"^",3) Q:Z["3.0" K SRINST
W !!,"The pre-initialization routine will delete the display graphs stored in",!,"the ^SRS global for all dates up to two weeks prior to today. The option",!,"SRTASK-SCRAP has been modified to clean up this global on "
W "a regular basis.",!! D ^SROPRE0
S X="T-14" D ^%DT S EDATE=Y S SROR=0 F S SROR=$O(^SRS(SROR)) Q:'SROR S SRSDATE=0 F S SRSDATE=$O(^SRS(SROR,"SS",SRSDATE)) Q:SRSDATE>EDATE!('SRSDATE) D OR
W !!,"Updating existing schedule graphs to new 24 hour format..."
UP S SROR=0 F S SROR=$O(^SRS(SROR)) Q:'SROR S SRSDATE=0 F S SRSDATE=$O(^SRS(SROR,"SS",SRSDATE)) Q:'SRSDATE D GRAPH
D MORE W !!!
Q
NEW W !!,"Prior to using the Surgery package, an entry must be made in the Surgery",!,"Site Parameters file. Please enter the name of the institution that will",!,"appear on all of your Surgery Reports.",!!
K DIC S DIC=4,DIC(0)="QEAMZ",DIC("A")="Enter Institution for Surgery Site Parameters: " D ^DIC K DIC S:Y>0 SRINST=+Y
Q
OR ; kill "S" and "SS" nodes
K ^SRS(SROR,"S",SRSDATE),^SRS(SROR,"SS",SRSDATE)
Q
MORE W !!!,"The pre-initialization routine will delete the data dictionary for the",!,"SURGERY WAITING LIST file. The SRINITs will re-create the DDs later. The",!,"entries in this file will NOT be deleted. The pre-initialization "
W "routine",!,"will also delete the option 'Complications of Surgical Procedures' from",!,"your OPTION file. The functionality of this option has been moved into",!,"the 'Morbidity and Mortality Reports' option."
W !!,"Three other options that will be deleted from your OPTION file are",!,"'Calculate Average Operation Times', 'Lock Surgery Cases', and 'Delete"
W !,"Outstanding Requests'. The functionality of these three options has",!,"been moved into 'Surgery Nightly Cleanup and Updates' which will need",!,"to be tasked to run each night.",!!!
DD ; delete DDs for file 133.8
W !,"Deleting data dictionaries for the SURGERY WAITING LIST file..."
S DIU="^SRO(133.8,",DIU(0)="" D EN^DIU2
OPT ; delete the option 'Complication of Surgical Procedures'
I $O(^DIC(19,"B","SROCMP",0)) K DA W !!,"Deleting 'Complication of Surgical Procedures' option..." S (DA,SROPT)=$O(^DIC(19,"B","SROCMP",0)) I DA>0 D CLEAN K DIK,DA S DA=SROPT,DIK="^DIC(19," D ^DIK
TASK ; delete obsolete tasked options
I $O(^DIC(19,"B","SRTASK-OP TIMES",0)) K DA W !!,"Deleting 'Calculate Average Operation Times' option..." S DA=$O(^DIC(19,"B","SRTASK-OP TIMES",0)) I DA>0 K DIK S DIK="^DIC(19," D ^DIK
I $O(^DIC(19,"B","SRTASK-LOCK",0)) K DA W !!,"Deleting 'Lock Surgery Cases' option..." S DA=$O(^DIC(19,"B","SRTASK-LOCK",0)) I DA>0 K DIK S DIK="^DIC(19," D ^DIK
I $O(^DIC(19,"B","SRTASK-SCRAP",0)) K DA W !!,"Deleting 'Delete Outstanding Requests' option..." S DA=$O(^DIC(19,"B","SRTASK-SCRAP",0)) I DA>0 K DIK S DIK="^DIC(19," D ^DIK
K DIK,DA
Q
GRAPH ; update graph to 24 hour format
I $D(^SRS(SROR,"S",SRSDATE,1)),$L(^(1))<90 S MM=^(1),X=$E(MM,1,10)_"|____|____|____|____|____|____|____"_$E(MM,11,99)_"____|____|____|",^SRS(SROR,"S",SRSDATE,1)=X
I $D(^SRS(SROR,"SS",SRSDATE,1)),$L(^(1))<90 S MM=^(1),X=$E(MM,1,10)_"|____|____|____|____|____|____|____"_$E(MM,11,99)_"____|____|____|",^SRS(SROR,"SS",SRSDATE,1)=X
Q
CLEAN ; remove option from any menu
S SRM=0 F S SRM=$O(^DIC(19,"AD",SROPT,SRM)) Q:'SRM K DA,DIK S DA(1)=SRM,DA=$O(^DIC(19,"AD",SROPT,SRM,0)),DIK="^DIC(19,"_DA(1)_",10," D ^DIK
Q
OPT1 ; Entry point for SR*3*9 if Surgery v3 already installed
K DA,DIK S DA=$O(^DIC(19,"B","SROCMP",0)) I DA>0 W !,"Deleting 'Complication of Surgical Procedures' option..." S DIK="^DIC(19," D ^DIK K DA,DIK
XUHALT G:$D(^DIC(19,1,0)) FINE G:$O(^DIC(19,"B","XUHALT",0)) FINE
K DIC S X="XUHALT",DIC="^DIC(19,",DIC(0)="L",DLAYGO=19,DINUM=1 D FILE^DICN K DIC,DINUM,DLAYGO I Y<0 G FINE
W !,"Re-adding option XUHALT..."
S SROPT=+Y,SRHELP=$O(^DIC(9.2,"B","XUHALT",0))
S SRACT="S:'$D(XQCH) XQCH=""HALT"" G:$L(XQCH)>2 HALT^XQ12 S XQUR=""HALT"" G XPRMP^XQ12"
K DIE,DA,DR S DIE=19,DA=SROPT,DR="1////Halt;4////A;20////"_SRACT_";3.6////.5;3.7////"_SRHELP D ^DIE K DA,DIE,DR
S SRDES(1,0)="^^2^11^",SRDES(1,0,0,99999999)="^10^11^99999999",SRDES(1,0,"W")=75,SRDES(10,0)="^19.01IP^0^0",SRDES(99)="52902,63309",SRDES(99.1)="55438,42614"
S SRDES(1,10,0)="This is the command which is used to terminate processing in the Menu",SRDES(1,11,0)="Manager."
S %X="SRDES(",%Y="^DIC(19,SROPT," D %XY^%RCR
FINE K SRACT,SRDES,SRHELP,SROPT W !,"Finished."
Q
SROPRE ;B'HAM ISC/MAM - PRE-INIT FOR VERSION 3 ; 16 JAN 1990 9:20 AM
+1 ;;3.0; Surgery ;**9**;24 Jun 93
+2 WRITE !!!,"SURGERY VERSION 3.0",!
+3 SET SRINST=$ORDER(^SRO(133,0))
IF 'SRINST
DO NEW
QUIT
+4 SET Z=$PIECE($GET(^SRO(133,SRINST,0)),"^",3)
IF Z["3.0"
QUIT
KILL SRINST
+5 WRITE !!,"The pre-initialization routine will delete the display graphs stored in",!,"the ^SRS global for all dates up to two weeks prior to today. The option",!,"SRTASK-SCRAP has been modified to clean up this global on "
+6 WRITE "a regular basis.",!!
DO ^SROPRE0
+7 SET X="T-14"
DO ^%DT
SET EDATE=Y
SET SROR=0
FOR
SET SROR=$ORDER(^SRS(SROR))
IF 'SROR
QUIT
SET SRSDATE=0
FOR
SET SRSDATE=$ORDER(^SRS(SROR,"SS",SRSDATE))
IF SRSDATE>EDATE!('SRSDATE)
QUIT
DO OR
+8 WRITE !!,"Updating existing schedule graphs to new 24 hour format..."
UP SET SROR=0
FOR
SET SROR=$ORDER(^SRS(SROR))
IF 'SROR
QUIT
SET SRSDATE=0
FOR
SET SRSDATE=$ORDER(^SRS(SROR,"SS",SRSDATE))
IF 'SRSDATE
QUIT
DO GRAPH
+1 DO MORE
WRITE !!!
+2 QUIT
NEW WRITE !!,"Prior to using the Surgery package, an entry must be made in the Surgery",!,"Site Parameters file. Please enter the name of the institution that will",!,"appear on all of your Surgery Reports.",!!
+1 KILL DIC
SET DIC=4
SET DIC(0)="QEAMZ"
SET DIC("A")="Enter Institution for Surgery Site Parameters: "
DO ^DIC
KILL DIC
IF Y>0
SET SRINST=+Y
+2 QUIT
OR ; kill "S" and "SS" nodes
+1 KILL ^SRS(SROR,"S",SRSDATE),^SRS(SROR,"SS",SRSDATE)
+2 QUIT
MORE WRITE !!!,"The pre-initialization routine will delete the data dictionary for the",!,"SURGERY WAITING LIST file. The SRINITs will re-create the DDs later. The",!,"entries in this file will NOT be deleted. The pre-initialization "
+1 WRITE "routine",!,"will also delete the option 'Complications of Surgical Procedures' from",!,"your OPTION file. The functionality of this option has been moved into",!,"the 'Morbidity and Mortality Reports' option."
+2 WRITE !!,"Three other options that will be deleted from your OPTION file are",!,"'Calculate Average Operation Times', 'Lock Surgery Cases', and 'Delete"
+3 WRITE !,"Outstanding Requests'. The functionality of these three options has",!,"been moved into 'Surgery Nightly Cleanup and Updates' which will need",!,"to be tasked to run each night.",!!!
DD ; delete DDs for file 133.8
+1 WRITE !,"Deleting data dictionaries for the SURGERY WAITING LIST file..."
+2 SET DIU="^SRO(133.8,"
SET DIU(0)=""
DO EN^DIU2
OPT ; delete the option 'Complication of Surgical Procedures'
+1 IF $ORDER(^DIC(19,"B","SROCMP",0))
KILL DA
WRITE !!,"Deleting 'Complication of Surgical Procedures' option..."
SET (DA,SROPT)=$ORDER(^DIC(19,"B","SROCMP",0))
IF DA>0
DO CLEAN
KILL DIK,DA
SET DA=SROPT
SET DIK="^DIC(19,"
DO ^DIK
TASK ; delete obsolete tasked options
+1 IF $ORDER(^DIC(19,"B","SRTASK-OP TIMES",0))
KILL DA
WRITE !!,"Deleting 'Calculate Average Operation Times' option..."
SET DA=$ORDER(^DIC(19,"B","SRTASK-OP TIMES",0))
IF DA>0
KILL DIK
SET DIK="^DIC(19,"
DO ^DIK
+2 IF $ORDER(^DIC(19,"B","SRTASK-LOCK",0))
KILL DA
WRITE !!,"Deleting 'Lock Surgery Cases' option..."
SET DA=$ORDER(^DIC(19,"B","SRTASK-LOCK",0))
IF DA>0
KILL DIK
SET DIK="^DIC(19,"
DO ^DIK
+3 IF $ORDER(^DIC(19,"B","SRTASK-SCRAP",0))
KILL DA
WRITE !!,"Deleting 'Delete Outstanding Requests' option..."
SET DA=$ORDER(^DIC(19,"B","SRTASK-SCRAP",0))
IF DA>0
KILL DIK
SET DIK="^DIC(19,"
DO ^DIK
+4 KILL DIK,DA
+5 QUIT
GRAPH ; update graph to 24 hour format
+1 IF $DATA(^SRS(SROR,"S",SRSDATE,1))
IF $LENGTH(^(1))<90
SET MM=^(1)
SET X=$EXTRACT(MM,1,10)_"|____|____|____|____|____|____|____"_$EXTRACT(MM,11,99)_"____|____|____|"
SET ^SRS(SROR,"S",SRSDATE,1)=X
+2 IF $DATA(^SRS(SROR,"SS",SRSDATE,1))
IF $LENGTH(^(1))<90
SET MM=^(1)
SET X=$EXTRACT(MM,1,10)_"|____|____|____|____|____|____|____"_$EXTRACT(MM,11,99)_"____|____|____|"
SET ^SRS(SROR,"SS",SRSDATE,1)=X
+3 QUIT
CLEAN ; remove option from any menu
+1 SET SRM=0
FOR
SET SRM=$ORDER(^DIC(19,"AD",SROPT,SRM))
IF 'SRM
QUIT
KILL DA,DIK
SET DA(1)=SRM
SET DA=$ORDER(^DIC(19,"AD",SROPT,SRM,0))
SET DIK="^DIC(19,"_DA(1)_",10,"
DO ^DIK
+2 QUIT
OPT1 ; Entry point for SR*3*9 if Surgery v3 already installed
+1 KILL DA,DIK
SET DA=$ORDER(^DIC(19,"B","SROCMP",0))
IF DA>0
WRITE !,"Deleting 'Complication of Surgical Procedures' option..."
SET DIK="^DIC(19,"
DO ^DIK
KILL DA,DIK
XUHALT IF $DATA(^DIC(19,1,0))
GOTO FINE
IF $ORDER(^DIC(19,"B","XUHALT",0))
GOTO FINE
+1 KILL DIC
SET X="XUHALT"
SET DIC="^DIC(19,"
SET DIC(0)="L"
SET DLAYGO=19
SET DINUM=1
DO FILE^DICN
KILL DIC,DINUM,DLAYGO
IF Y<0
GOTO FINE
+2 WRITE !,"Re-adding option XUHALT..."
+3 SET SROPT=+Y
SET SRHELP=$ORDER(^DIC(9.2,"B","XUHALT",0))
+4 SET SRACT="S:'$D(XQCH) XQCH=""HALT"" G:$L(XQCH)>2 HALT^XQ12 S XQUR=""HALT"" G XPRMP^XQ12"
+5 KILL DIE,DA,DR
SET DIE=19
SET DA=SROPT
SET DR="1////Halt;4////A;20////"_SRACT_";3.6////.5;3.7////"_SRHELP
DO ^DIE
KILL DA,DIE,DR
+6 SET SRDES(1,0)="^^2^11^"
SET SRDES(1,0,0,99999999)="^10^11^99999999"
SET SRDES(1,0,"W")=75
SET SRDES(10,0)="^19.01IP^0^0"
SET SRDES(99)="52902,63309"
SET SRDES(99.1)="55438,42614"
+7 SET SRDES(1,10,0)="This is the command which is used to terminate processing in the Menu"
SET SRDES(1,11,0)="Manager."
+8 SET %X="SRDES("
SET %Y="^DIC(19,SROPT,"
DO %XY^%RCR
FINE KILL SRACT,SRDES,SRHELP,SROPT
WRITE !,"Finished."
+1 QUIT