BJMDECK ;VNGT/HS/AM-Pre Install ENVIRONMENT CHECK; 18 Nov 2009 12:51 PM
;;1.0;CDA/C32;**1**;May 27, 2011
;
; Run pre-install checks
;W !,"Build Name XPDNM = ",XPDNM
N EXEC,ROLES,FAC,STAT,NS,OBJ,C32DEST,DEFDEST,EDEST,DIR,METMS,METCS
N METFS,METDFS,LIST,MET,TSC,DEFEDEST,OK,FS,ES,VERSION,CMSG,CMSGLN
;
; Verify that the BFMC job finished and did not error out.
S CMSG=$O(^BJMDS(90607,"B","C32",""))
I CMSG="" S CMSG=1
; Check if the BFMC job errored out. If it errored out and we're trying to install BJMD, quit.
I $O(^BJMDS(90607,CMSG,2,0))'="" D S XPDQUIT=2 Q:XPDENV
. W !,"Cannot load the C Messaging (BJMD) software because the BFMC post-installation",!,"job terminated with the following error:"
. S CMSGLN=0 F S CMSGLN=$O(^BJMDS(90607,CMSG,2,CMSGLN)) Q:'CMSGLN W !,$G(^BJMDS(90607,CMSG,2,CMSGLN,0))
. W !!,"Please contact support before proceeding."
; Check if the BFMC job is still running. If it is still running and we're trying to install BJMD, quit.
; To avoid confusing the user, don't display this message if the BFMC job got an error.
E I '$P($G(^BJMDS(90607,CMSG,0)),U,10) W !,"Cannot load the C Messaging (BJMD) software until the BFMC post-installation",!,"job has finished running. Please try later." S XPDQUIT=2 I XPDENV Q
;
; Verify Version
;
S VERSION=$$VERSION^%ZOSV
I VERSION<2009!($E(VERSION,1,4)>2010)!(VERSION?1"2010.1.".E) D
. W !,"Ensemble 2009.1 or 2010.2 is required!"
. S XPDQUIT=2
;
; Verify that installer has proper roles
;
S EXEC="S ROLES=$roles" X EXEC
S ROLES=","_ROLES_",",U="^"
I ROLES'[",%All," D
. W !,"Your Ensemble account MUST have ""%All"" role to proceed!" S XPDQUIT=2
;
; Verify that station numbers are assigned
;
S FAC=0
F D Q:'FAC
. S FAC=$O(^AGFAC(FAC)) Q:'FAC
. I $P($G(^AGFAC(FAC,0)),U,21)'="Y" Q
. S STAT=$P($G(^DIC(4,FAC,99)),U)
. I STAT="" W !,"Station Number is not assigned for Facility ",FAC," ",$P($G(^DIC(4,FAC,0)),U) S XPDQUIT=2 Q
. I STAT<8000!(STAT>9000) W !,"Station Number ",STAT," is not in the 8000-9000 range for Facility ",FAC," ",$P($G(^DIC(4,FAC,0)),U) S XPDQUIT=2
;
; Verify the presence of two packages
;
I '$D(^DD(52.0113)) W !,"The package that added Medication Instructions to Prescriptions" W !,"file is not installed" S XPDQUIT=2
I '$D(^DD(50,9999999.145)) W !,"The package that added DISPENSE UNIT NCPDP CODE field to Drug" W !,"file is not installed" S XPDQUIT=2
;
; Check LIST of all namespaces for C32 partner for current namespace.
;
K LIST
S EXEC="S NS=$SYSTEM.SYS.NameSpace()" X EXEC
S EXEC="SET OBJ=##class(%ResultSet).%New(""%SYS.Namespace:List"") d OBJ.Execute()" X EXEC
S EXEC="while (OBJ.Next()) { s LIST(OBJ.Data(""Nsp""))=1 }" X EXEC
;
; %Installer Change
;
I '$D(LIST("C32"_NS)),XPDENV=1 D I $G(XPDQUIT) S EXEC="S:$G(MET)'="""" TSC=MET.Shutdown()" X EXEC G Q
. K ARG
. S ARG("NAMESPACE")=NS
. S EXEC="S DIR=##class(%SYS.Namespace).GetGlobalDest(NS),DIR=$P(DIR,""^"",2,99)" X EXEC
. S EXEC="Set MET=##class(%Monitor.System.Freespace).%New()" X EXEC
. S EXEC="S TSC=MET.Initialize()" X EXEC
. I $G(TSC)'=1 W !,"Space check monitor failed to initialize" S XPDQUIT=2 Q
. S DBNAME=""
. S EXEC="F S TSC=MET.GetSample() Q:'TSC I MET.Directory=DIR S DBNAME=MET.DBName" X EXEC
. S EXEC="S TSC=MET.Shutdown()" X EXEC
. K MET
. I DBNAME="" W !,"Space check monitor failed to find Database" S XPDQUIT=2 Q
. S ARG("DATABASE")=DBNAME
. K DIR S DIR("A")="Specify Full Directory path for the database for new namespace C32"_NS,DIR(0)="F^1:200"
. D ^DIR
. I Y="^"!(Y="^^") S XPDQUIT=2 Q
. S DIR=Y
. S EXEC="S DIREX=##class(%File).DirectoryExists(DIR)" X EXEC
. I 'DIREX S EXEC="S TSC=##class(%File).CreateDirectoryChain(DIR)" X EXEC I TSC'=1 W !,"Directory Creation Failed" S XPDQUIT=2 Q
. I DIREX D Q:$G(XPDQUIT)
. . N DIR1,DELIM,FN,FILE
. . S DIR1=DIR,DELIM=$S($$VERSION^%ZOSV(1)["Windows":"\",1:"/") I $E(DIR1,$L(DIR1))'=DELIM S DIR1=DIR1_DELIM
. . S EXEC="S FILE=##class(%File).%New("""_DIR1_$J_""")" X EXEC
. . S EXEC="S TSC=FILE.Open(""RWN"")" X EXEC
. . I TSC'=1 W !,"Unable to write to directory" S XPDQUIT=2 Q
. . S EXEC="S TSC=FILE.Write($ZH)" X EXEC
. . S EXEC="S FN=FILE.Name D FILE.Close()" X EXEC
. . I TSC'=1 W !,"Unable to write to file in directory" S XPDQUIT=2 Q
. . S EXEC="S TSC=##class(%File).Delete(FN)" X EXEC
. S EXEC="S TSC=##class(%File).GetDirectorySpace(DIR,.DIRFS)" X EXEC
. I TSC'=1 W !,"Invalid Directory" S XPDQUIT=2 Q
. I DIRFS<500 W !,"Not Enough Disk Space" S XPDQUIT=2 Q
. S EXEC="S CONFILE=$P($ZU(86),""*"")" X EXEC
. S EXEC="S FOK=0 O CONFILE:(""W""):1 I S FOK=1" X EXEC
. S EXEC="C CONFILE" X EXEC
. I '$G(FOK) W !,"Unable to obtain permission to modify the Ensemble configuration file:",!,CONFILE S XPDQUIT=2 Q
. S ARG("DB_LOCATION")=DIR
. W !,"Creating C32",NS," namespace",!,!
. S EXEC="S TSC=##class(BFMC.BJMD.Installer).setup(.ARG,1)" X EXEC
. I 'TSC W !,"Error in Installer process" S XPDQUIT=2 Q
. ; re-read the list of namespaces
. K LIST
. S EXEC="SET OBJ=##class(%ResultSet).%New(""%SYS.Namespace:List"") d OBJ.Execute()" X EXEC
. S EXEC="while (OBJ.Next()) { s LIST(OBJ.Data(""Nsp""))=1 }" X EXEC
;
; Verify that installation has Long Strings enabled
;
S EXEC="S OK=($SYSTEM.SYS.MaxLocalLength()>3600000)"
X EXEC
I 'OK D S XPDQUIT=2
. W !,"Long Strings are not enabled, Ensemble is not configured correctly."
I XPDENV=1 D
. I '$D(LIST("C32"_NS)) W !,"C32 Namespace does not exist" S XPDQUIT=2
. ;
. ; Check that C32 namespace has globals mapped properly
. ;
. S EXEC="S DEFDEST=##class(%SYS.Namespace).GetGlobalDest()" X EXEC
. S EXEC="S C32DEST=##class(%SYS.Namespace).GetGlobalDest(""C32""_NS,""^BJMDS"")" X EXEC
. I DEFDEST'=C32DEST W !,"Global mapping for ^BJMDS is not correct" S XPDQUIT=2
. ;
. ; Check that Ensemble globals are mapped to the default namespace of ENSLIB
. ;
. S EXEC="S DEFEDEST=##class(%SYS.Namespace).GetGlobalDest(""ENSLIB"")" X EXEC
. S EXEC="S EDEST=##class(%SYS.Namespace).GetGlobalDest(NS,""^EnsDICOM.Dictionary"")" X EXEC
. I EDEST'=DEFEDEST W !,"Ensemble is not properly mapped in ",NS S XPDQUIT=2
Q ;
I $G(MET)'="" S EXEC="S TSC=MET.Shutdown()" X EXEC
Q
DTCK(DT) ;
S %DT="FT",X=DT
D ^%DT
I Y=-1 Q 0
S ZTDTH=Y
Q 1
SPACE(NS) ;
; check if enough space
;
N FS,PATFS,PATCT,NS,EXEC,DIR,TSC,METMS,METSC,METFS,METDS,FS,ES,PATCT,PATFS
S FS=0,PATFS=0,PATCT=0
I $G(NS)="" S EXEC="S NS=$SYSTEM.SYS.NameSpace()" X EXEC
I NS'?1"C32".E S NS="C32"_NS
S EXEC="S DIR=##class(%SYS.Namespace).GetGlobalDest(NS),DIR=$P(DIR,""^"",2,99)" X EXEC
; set up monitor
S EXEC="Set MET=##class(%Monitor.System.Freespace).%New()" X EXEC
S EXEC="S TSC=MET.Initialize()" X EXEC
I $G(TSC)'=1 W !,"Space check monitor failed to initialize" G QS
SET METMS=0,METCS=0,METFS=0,METDFS=0,METDS=0
S EXEC="F S TSC=MET.GetSample() Q:'TSC I MET.Directory=DIR S METMS=MET.MaxSize,METCS=MET.CurSize,METFS=MET.FreeSpace,METDS=MET.DiskFreeSpace" X EXEC
I METCS=0 W !,"Space check monitor failed to find Cache Namespace with directory ",DIR G QS
; if unlimited cache.dat, then expansion space is FreeDiskSpace
I METMS=-1 S ES=METDS
; if limited cache.dat, then ExpansionSpace is smaller of FreeDiskSpace and (MaxSpace-CurrentSpace)
I METMS'=-1 S ES=METMS-METCS S:METDS<ES ES=METDS
; then limit is Expansion Space+FreeSpaceInCurrentFile
S FS=ES+METFS
S PATCT=$P(^AUPNPAT(0),U,3) I PATCT=0 G QS
S PATFS=FS/PATCT
QS ;
S EXEC="S TSC=MET.Shutdown()" X EXEC
K MET
; return space per person (in K), total space (in K), patient count,
; current used space, current free space in database, maximum space, and disk space
Q (PATFS*1024)_U_(FS*1024)_U_PATCT_U_(METCS*1024)_U_(METFS*1024)_U_(METMS*1024)_U_(METDS*1024)
BJMDECK ;VNGT/HS/AM-Pre Install ENVIRONMENT CHECK; 18 Nov 2009 12:51 PM
+1 ;;1.0;CDA/C32;**1**;May 27, 2011
+2 ;
+3 ; Run pre-install checks
+4 ;W !,"Build Name XPDNM = ",XPDNM
+5 NEW EXEC,ROLES,FAC,STAT,NS,OBJ,C32DEST,DEFDEST,EDEST,DIR,METMS,METCS
+6 NEW METFS,METDFS,LIST,MET,TSC,DEFEDEST,OK,FS,ES,VERSION,CMSG,CMSGLN
+7 ;
+8 ; Verify that the BFMC job finished and did not error out.
+9 SET CMSG=$ORDER(^BJMDS(90607,"B","C32",""))
+10 IF CMSG=""
SET CMSG=1
+11 ; Check if the BFMC job errored out. If it errored out and we're trying to install BJMD, quit.
+12 IF $ORDER(^BJMDS(90607,CMSG,2,0))'=""
Begin DoDot:1
+13 WRITE !,"Cannot load the C Messaging (BJMD) software because the BFMC post-installation",!,"job terminated with the following error:"
+14 SET CMSGLN=0
FOR
SET CMSGLN=$ORDER(^BJMDS(90607,CMSG,2,CMSGLN))
IF 'CMSGLN
QUIT
WRITE !,$GET(^BJMDS(90607,CMSG,2,CMSGLN,0))
+15 WRITE !!,"Please contact support before proceeding."
End DoDot:1
SET XPDQUIT=2
IF XPDENV
QUIT
+16 ; Check if the BFMC job is still running. If it is still running and we're trying to install BJMD, quit.
+17 ; To avoid confusing the user, don't display this message if the BFMC job got an error.
+18 IF '$TEST
IF '$PIECE($GET(^BJMDS(90607,CMSG,0)),U,10)
WRITE !,"Cannot load the C Messaging (BJMD) software until the BFMC post-installation",!,"job has finished running. Please try later."
SET XPDQUIT=2
IF XPDENV
QUIT
+19 ;
+20 ; Verify Version
+21 ;
+22 SET VERSION=$$VERSION^%ZOSV
+23 IF VERSION<2009!($EXTRACT(VERSION,1,4)>2010)!(VERSION?1"2010.1.".E)
Begin DoDot:1
+24 WRITE !,"Ensemble 2009.1 or 2010.2 is required!"
+25 SET XPDQUIT=2
End DoDot:1
+26 ;
+27 ; Verify that installer has proper roles
+28 ;
+29 SET EXEC="S ROLES=$roles"
XECUTE EXEC
+30 SET ROLES=","_ROLES_","
SET U="^"
+31 IF ROLES'[",%All,"
Begin DoDot:1
+32 WRITE !,"Your Ensemble account MUST have ""%All"" role to proceed!"
SET XPDQUIT=2
End DoDot:1
+33 ;
+34 ; Verify that station numbers are assigned
+35 ;
+36 SET FAC=0
+37 FOR
Begin DoDot:1
+38 SET FAC=$ORDER(^AGFAC(FAC))
IF 'FAC
QUIT
+39 IF $PIECE($GET(^AGFAC(FAC,0)),U,21)'="Y"
QUIT
+40 SET STAT=$PIECE($GET(^DIC(4,FAC,99)),U)
+41 IF STAT=""
WRITE !,"Station Number is not assigned for Facility ",FAC," ",$PIECE($GET(^DIC(4,FAC,0)),U)
SET XPDQUIT=2
QUIT
+42 IF STAT<8000!(STAT>9000)
WRITE !,"Station Number ",STAT," is not in the 8000-9000 range for Facility ",FAC," ",$PIECE($GET(^DIC(4,FAC,0)),U)
SET XPDQUIT=2
End DoDot:1
IF 'FAC
QUIT
+43 ;
+44 ; Verify the presence of two packages
+45 ;
+46 IF '$DATA(^DD(52.0113))
WRITE !,"The package that added Medication Instructions to Prescriptions"
WRITE !,"file is not installed"
SET XPDQUIT=2
+47 IF '$DATA(^DD(50,9999999.145))
WRITE !,"The package that added DISPENSE UNIT NCPDP CODE field to Drug"
WRITE !,"file is not installed"
SET XPDQUIT=2
+48 ;
+49 ; Check LIST of all namespaces for C32 partner for current namespace.
+50 ;
+51 KILL LIST
+52 SET EXEC="S NS=$SYSTEM.SYS.NameSpace()"
XECUTE EXEC
+53 SET EXEC="SET OBJ=##class(%ResultSet).%New(""%SYS.Namespace:List"") d OBJ.Execute()"
XECUTE EXEC
+54 SET EXEC="while (OBJ.Next()) { s LIST(OBJ.Data(""Nsp""))=1 }"
XECUTE EXEC
+55 ;
+56 ; %Installer Change
+57 ;
+58 IF '$DATA(LIST("C32"_NS))
IF XPDENV=1
Begin DoDot:1
+59 KILL ARG
+60 SET ARG("NAMESPACE")=NS
+61 SET EXEC="S DIR=##class(%SYS.Namespace).GetGlobalDest(NS),DIR=$P(DIR,""^"",2,99)"
XECUTE EXEC
+62 SET EXEC="Set MET=##class(%Monitor.System.Freespace).%New()"
XECUTE EXEC
+63 SET EXEC="S TSC=MET.Initialize()"
XECUTE EXEC
+64 IF $GET(TSC)'=1
WRITE !,"Space check monitor failed to initialize"
SET XPDQUIT=2
QUIT
+65 SET DBNAME=""
+66 SET EXEC="F S TSC=MET.GetSample() Q:'TSC I MET.Directory=DIR S DBNAME=MET.DBName"
XECUTE EXEC
+67 SET EXEC="S TSC=MET.Shutdown()"
XECUTE EXEC
+68 KILL MET
+69 IF DBNAME=""
WRITE !,"Space check monitor failed to find Database"
SET XPDQUIT=2
QUIT
+70 SET ARG("DATABASE")=DBNAME
+71 KILL DIR
SET DIR("A")="Specify Full Directory path for the database for new namespace C32"_NS
SET DIR(0)="F^1:200"
+72 DO ^DIR
+73 IF Y="^"!(Y="^^")
SET XPDQUIT=2
QUIT
+74 SET DIR=Y
+75 SET EXEC="S DIREX=##class(%File).DirectoryExists(DIR)"
XECUTE EXEC
+76 IF 'DIREX
SET EXEC="S TSC=##class(%File).CreateDirectoryChain(DIR)"
XECUTE EXEC
IF TSC'=1
WRITE !,"Directory Creation Failed"
SET XPDQUIT=2
QUIT
+77 IF DIREX
Begin DoDot:2
+78 NEW DIR1,DELIM,FN,FILE
+79 SET DIR1=DIR
SET DELIM=$SELECT($$VERSION^%ZOSV(1)["Windows":"\",1:"/")
IF $EXTRACT(DIR1,$LENGTH(DIR1))'=DELIM
SET DIR1=DIR1_DELIM
+80 SET EXEC="S FILE=##class(%File).%New("""_DIR1_$JOB_""")"
XECUTE EXEC
+81 SET EXEC="S TSC=FILE.Open(""RWN"")"
XECUTE EXEC
+82 IF TSC'=1
WRITE !,"Unable to write to directory"
SET XPDQUIT=2
QUIT
+83 SET EXEC="S TSC=FILE.Write($ZH)"
XECUTE EXEC
+84 SET EXEC="S FN=FILE.Name D FILE.Close()"
XECUTE EXEC
+85 IF TSC'=1
WRITE !,"Unable to write to file in directory"
SET XPDQUIT=2
QUIT
+86 SET EXEC="S TSC=##class(%File).Delete(FN)"
XECUTE EXEC
End DoDot:2
IF $GET(XPDQUIT)
QUIT
+87 SET EXEC="S TSC=##class(%File).GetDirectorySpace(DIR,.DIRFS)"
XECUTE EXEC
+88 IF TSC'=1
WRITE !,"Invalid Directory"
SET XPDQUIT=2
QUIT
+89 IF DIRFS<500
WRITE !,"Not Enough Disk Space"
SET XPDQUIT=2
QUIT
+90 SET EXEC="S CONFILE=$P($ZU(86),""*"")"
XECUTE EXEC
+91 SET EXEC="S FOK=0 O CONFILE:(""W""):1 I S FOK=1"
XECUTE EXEC
+92 SET EXEC="C CONFILE"
XECUTE EXEC
+93 IF '$GET(FOK)
WRITE !,"Unable to obtain permission to modify the Ensemble configuration file:",!,CONFILE
SET XPDQUIT=2
QUIT
+94 SET ARG("DB_LOCATION")=DIR
+95 WRITE !,"Creating C32",NS," namespace",!,!
+96 SET EXEC="S TSC=##class(BFMC.BJMD.Installer).setup(.ARG,1)"
XECUTE EXEC
+97 IF 'TSC
WRITE !,"Error in Installer process"
SET XPDQUIT=2
QUIT
+98 ; re-read the list of namespaces
+99 KILL LIST
+100 SET EXEC="SET OBJ=##class(%ResultSet).%New(""%SYS.Namespace:List"") d OBJ.Execute()"
XECUTE EXEC
+101 SET EXEC="while (OBJ.Next()) { s LIST(OBJ.Data(""Nsp""))=1 }"
XECUTE EXEC
End DoDot:1
IF $GET(XPDQUIT)
SET EXEC="S:$G(MET)'="""" TSC=MET.Shutdown()"
XECUTE EXEC
GOTO Q
+102 ;
+103 ; Verify that installation has Long Strings enabled
+104 ;
+105 SET EXEC="S OK=($SYSTEM.SYS.MaxLocalLength()>3600000)"
+106 XECUTE EXEC
+107 IF 'OK
Begin DoDot:1
+108 WRITE !,"Long Strings are not enabled, Ensemble is not configured correctly."
End DoDot:1
SET XPDQUIT=2
+109 IF XPDENV=1
Begin DoDot:1
+110 IF '$DATA(LIST("C32"_NS))
WRITE !,"C32 Namespace does not exist"
SET XPDQUIT=2
+111 ;
+112 ; Check that C32 namespace has globals mapped properly
+113 ;
+114 SET EXEC="S DEFDEST=##class(%SYS.Namespace).GetGlobalDest()"
XECUTE EXEC
+115 SET EXEC="S C32DEST=##class(%SYS.Namespace).GetGlobalDest(""C32""_NS,""^BJMDS"")"
XECUTE EXEC
+116 IF DEFDEST'=C32DEST
WRITE !,"Global mapping for ^BJMDS is not correct"
SET XPDQUIT=2
+117 ;
+118 ; Check that Ensemble globals are mapped to the default namespace of ENSLIB
+119 ;
+120 SET EXEC="S DEFEDEST=##class(%SYS.Namespace).GetGlobalDest(""ENSLIB"")"
XECUTE EXEC
+121 SET EXEC="S EDEST=##class(%SYS.Namespace).GetGlobalDest(NS,""^EnsDICOM.Dictionary"")"
XECUTE EXEC
+122 IF EDEST'=DEFEDEST
WRITE !,"Ensemble is not properly mapped in ",NS
SET XPDQUIT=2
End DoDot:1
Q ;
+1 IF $GET(MET)'=""
SET EXEC="S TSC=MET.Shutdown()"
XECUTE EXEC
+2 QUIT
DTCK(DT) ;
+1 SET %DT="FT"
SET X=DT
+2 DO ^%DT
+3 IF Y=-1
QUIT 0
+4 SET ZTDTH=Y
+5 QUIT 1
SPACE(NS) ;
+1 ; check if enough space
+2 ;
+3 NEW FS,PATFS,PATCT,NS,EXEC,DIR,TSC,METMS,METSC,METFS,METDS,FS,ES,PATCT,PATFS
+4 SET FS=0
SET PATFS=0
SET PATCT=0
+5 IF $GET(NS)=""
SET EXEC="S NS=$SYSTEM.SYS.NameSpace()"
XECUTE EXEC
+6 IF NS'?1"C32".E
SET NS="C32"_NS
+7 SET EXEC="S DIR=##class(%SYS.Namespace).GetGlobalDest(NS),DIR=$P(DIR,""^"",2,99)"
XECUTE EXEC
+8 ; set up monitor
+9 SET EXEC="Set MET=##class(%Monitor.System.Freespace).%New()"
XECUTE EXEC
+10 SET EXEC="S TSC=MET.Initialize()"
XECUTE EXEC
+11 IF $GET(TSC)'=1
WRITE !,"Space check monitor failed to initialize"
GOTO QS
+12 SET METMS=0
SET METCS=0
SET METFS=0
SET METDFS=0
SET METDS=0
+13 SET EXEC="F S TSC=MET.GetSample() Q:'TSC I MET.Directory=DIR S METMS=MET.MaxSize,METCS=MET.CurSize,METFS=MET.FreeSpace,METDS=MET.DiskFreeSpace"
XECUTE EXEC
+14 IF METCS=0
WRITE !,"Space check monitor failed to find Cache Namespace with directory ",DIR
GOTO QS
+15 ; if unlimited cache.dat, then expansion space is FreeDiskSpace
+16 IF METMS=-1
SET ES=METDS
+17 ; if limited cache.dat, then ExpansionSpace is smaller of FreeDiskSpace and (MaxSpace-CurrentSpace)
+18 IF METMS'=-1
SET ES=METMS-METCS
IF METDS<ES
SET ES=METDS
+19 ; then limit is Expansion Space+FreeSpaceInCurrentFile
+20 SET FS=ES+METFS
+21 SET PATCT=$PIECE(^AUPNPAT(0),U,3)
IF PATCT=0
GOTO QS
+22 SET PATFS=FS/PATCT
QS ;
+1 SET EXEC="S TSC=MET.Shutdown()"
XECUTE EXEC
+2 KILL MET
+3 ; return space per person (in K), total space (in K), patient count,
+4 ; current used space, current free space in database, maximum space, and disk space
+5 QUIT (PATFS*1024)_U_(FS*1024)_U_PATCT_U_(METCS*1024)_U_(METFS*1024)_U_(METMS*1024)_U_(METDS*1024)