RAIENVCK ;HIRMFO/GJC-Environmental Check Routine ;5/16/97 08:50
VERSION ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
EN1 ; Version 5.0 environment check routine for Radiology/Nuclear Medicine.
I $S($D(DUZ)[0:1,$D(DUZ(0))[0:1,'DUZ:1,1:0) D S XPDABORT=2 Q
. W !?5,"DUZ and DUZ(0) must be defined as an active user to initialize"
. W !?5,"the RADIOLOGY/NUCLEAR MEDICINE v",$P($T(+2),";",3)
. W " software.",$C(7)
. Q
I DUZ(0)'="@" D S XPDABORT=2 Q
. W !?5,"You must have programmer access i.e, DUZ(0)=@, to run this "
. W "init!",$C(7)
. Q
Q:$G(^RADPT(0))']"" ; virgin install, quit!
; Check for the two imaging types which will use radiopharmaceuticals.
; Abort the install if they are not present.
S RAFLG=0
I +$G(^DD(70,0,"VR"))<5.0 D
. F RAI=1:1 S RATXT=$P($T(TEXT+RAI),";;",2) Q:RATXT']"" D
.. S RATXT(1)=$P(RATXT,";"),RATXT(2)=$P(RATXT,";",2)
.. I '$D(^RA(79.2,"C",RATXT(2))) D
... S (RAFLG,XPDABORT)=2 ; abort install, don't remove from ^XTMP
... W !!?3,"The Imaging type abbreviated as: "_RATXT(2)
... W !?3,"is missing. ("_RATXT(1)_")"
... Q
.. Q
. Q
I RAFLG D ERR792
S RA787=+$O(^RA(78.7,"B","VERIFIED DATE",0))
I $G(^RA(78.7,RA787,"E"))'["RAVERFDT" D
. W !!?3,"Patch 2 (RA*4.5*2) must be installed before"
. W " RADIOLOGY/NUCLEAR",!?3,"MEDICINE v",$P($T(+2),";",3)
. W " can be installed!",$C(7) S XPDABORT=2
. Q
I '$$PATCH^XPDUTL("RA*4.5*10") D
. W !!?3,"Patch 10 (RA*4.5*10) must be installed before"
. W " RADIOLOGY/NUCLEAR",!?3,"MEDICINE v",$P($T(+2),";",3)
. W " can be installed!",$C(7) S XPDABORT=2
. Q
I '$$CLEANUP() D
. W !!?3,"RADIOLOGY/NUCLEAR MEDICINE CLEANUP v",$P($T(+2),";",3)
. W " must be loaded and reside",!?3,"in the transport global before"
. W " RADIOLOGY/NUCLEAR MEDICINE v",$P($T(+2),";",3)
. W !?3,"can be installed!",!,$C(7) S XPDABORT=2
. Q
XIT ; Exit point, kill variables then quit application.
K RA787,RAFLG,RAI,RATXT
Q
CLEANUP() ; Check if the 'Radiology/Nuclear Medicine Cleanup 5.0'
; distribution has been loaded and is resident in the transport global.
; Output: 0 if not loaded -OR- not resident in transport global
; 1 if ok to proceed (loaded & transport global present)
N %,DIC,RASTAT,X,Y
S X="RADIOLOGY/NUCLEAR MEDICINE CLEANUP "_$P($T(+2),";",3)
S DIC="^XPD(9.7,",DIC(0)="O" D ^DIC Q:+Y'>0 0 ;cleanup missing
S RASTAT=$$GET1^DIQ(9.7,+Y,.02,"I") ; status of distribution
Q:RASTAT'=0 0 ; status must be 'loaded from distribution'
Q:'$D(^XTMP("XPDI",+Y,"BLD")) 0 ; missing from transport global
Q 1
ERR792 ; Error messages for an incomplete Imaging Type file. Needed are the
; imaging type abbreviations for those imaging types which will use
; radiopharmaceuticals.
W !!?3,"The Imaging Type file must have these imaging type"
W !?3,"abbreviations before the package can be updated from"
W !?3,"version 4.5 to 5.0:",!
W !?5,"CARD - Cardiology Studies (Nuc Med)"
W !?5,"NM - Nuclear Medicine"
W !!?3,"Package installation cannot proceed. Contact the Radiology/"
W !?3,"Nuclear Medicine ADPAC for assistance.",$C(7)
Q
TEXT ; Check I-Type & abbreviation of file 79.2 against those listed below.
;;CARDIOLOGY STUDIES (NUC MED);CARD
;;NUCLEAR MEDICINE;NM
;;
RAIENVCK ;HIRMFO/GJC-Environmental Check Routine ;5/16/97 08:50
VERSION ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
EN1 ; Version 5.0 environment check routine for Radiology/Nuclear Medicine.
+1 IF $SELECT($DATA(DUZ)[0:1,$DATA(DUZ(0))[0:1,'DUZ:1,1:0)
Begin DoDot:1
+2 WRITE !?5,"DUZ and DUZ(0) must be defined as an active user to initialize"
+3 WRITE !?5,"the RADIOLOGY/NUCLEAR MEDICINE v",$PIECE($TEXT(+2),";",3)
+4 WRITE " software.",$CHAR(7)
+5 QUIT
End DoDot:1
SET XPDABORT=2
QUIT
+6 IF DUZ(0)'="@"
Begin DoDot:1
+7 WRITE !?5,"You must have programmer access i.e, DUZ(0)=@, to run this "
+8 WRITE "init!",$CHAR(7)
+9 QUIT
End DoDot:1
SET XPDABORT=2
QUIT
+10 ; virgin install, quit!
IF $GET(^RADPT(0))']""
QUIT
+11 ; Check for the two imaging types which will use radiopharmaceuticals.
+12 ; Abort the install if they are not present.
+13 SET RAFLG=0
+14 IF +$GET(^DD(70,0,"VR"))<5.0
Begin DoDot:1
+15 FOR RAI=1:1
SET RATXT=$PIECE($TEXT(TEXT+RAI),";;",2)
IF RATXT']""
QUIT
Begin DoDot:2
+16 SET RATXT(1)=$PIECE(RATXT,";")
SET RATXT(2)=$PIECE(RATXT,";",2)
+17 IF '$DATA(^RA(79.2,"C",RATXT(2)))
Begin DoDot:3
+18 ; abort install, don't remove from ^XTMP
SET (RAFLG,XPDABORT)=2
+19 WRITE !!?3,"The Imaging type abbreviated as: "_RATXT(2)
+20 WRITE !?3,"is missing. ("_RATXT(1)_")"
+21 QUIT
End DoDot:3
+22 QUIT
End DoDot:2
+23 QUIT
End DoDot:1
+24 IF RAFLG
DO ERR792
+25 SET RA787=+$ORDER(^RA(78.7,"B","VERIFIED DATE",0))
+26 IF $GET(^RA(78.7,RA787,"E"))'["RAVERFDT"
Begin DoDot:1
+27 WRITE !!?3,"Patch 2 (RA*4.5*2) must be installed before"
+28 WRITE " RADIOLOGY/NUCLEAR",!?3,"MEDICINE v",$PIECE($TEXT(+2),";",3)
+29 WRITE " can be installed!",$CHAR(7)
SET XPDABORT=2
+30 QUIT
End DoDot:1
+31 IF '$$PATCH^XPDUTL("RA*4.5*10")
Begin DoDot:1
+32 WRITE !!?3,"Patch 10 (RA*4.5*10) must be installed before"
+33 WRITE " RADIOLOGY/NUCLEAR",!?3,"MEDICINE v",$PIECE($TEXT(+2),";",3)
+34 WRITE " can be installed!",$CHAR(7)
SET XPDABORT=2
+35 QUIT
End DoDot:1
+36 IF '$$CLEANUP()
Begin DoDot:1
+37 WRITE !!?3,"RADIOLOGY/NUCLEAR MEDICINE CLEANUP v",$PIECE($TEXT(+2),";",3)
+38 WRITE " must be loaded and reside",!?3,"in the transport global before"
+39 WRITE " RADIOLOGY/NUCLEAR MEDICINE v",$PIECE($TEXT(+2),";",3)
+40 WRITE !?3,"can be installed!",!,$CHAR(7)
SET XPDABORT=2
+41 QUIT
End DoDot:1
XIT ; Exit point, kill variables then quit application.
+1 KILL RA787,RAFLG,RAI,RATXT
+2 QUIT
CLEANUP() ; Check if the 'Radiology/Nuclear Medicine Cleanup 5.0'
+1 ; distribution has been loaded and is resident in the transport global.
+2 ; Output: 0 if not loaded -OR- not resident in transport global
+3 ; 1 if ok to proceed (loaded & transport global present)
+4 NEW %,DIC,RASTAT,X,Y
+5 SET X="RADIOLOGY/NUCLEAR MEDICINE CLEANUP "_$PIECE($TEXT(+2),";",3)
+6 ;cleanup missing
SET DIC="^XPD(9.7,"
SET DIC(0)="O"
DO ^DIC
IF +Y'>0
QUIT 0
+7 ; status of distribution
SET RASTAT=$$GET1^DIQ(9.7,+Y,.02,"I")
+8 ; status must be 'loaded from distribution'
IF RASTAT'=0
QUIT 0
+9 ; missing from transport global
IF '$DATA(^XTMP("XPDI",+Y,"BLD"))
QUIT 0
+10 QUIT 1
ERR792 ; Error messages for an incomplete Imaging Type file. Needed are the
+1 ; imaging type abbreviations for those imaging types which will use
+2 ; radiopharmaceuticals.
+3 WRITE !!?3,"The Imaging Type file must have these imaging type"
+4 WRITE !?3,"abbreviations before the package can be updated from"
+5 WRITE !?3,"version 4.5 to 5.0:",!
+6 WRITE !?5,"CARD - Cardiology Studies (Nuc Med)"
+7 WRITE !?5,"NM - Nuclear Medicine"
+8 WRITE !!?3,"Package installation cannot proceed. Contact the Radiology/"
+9 WRITE !?3,"Nuclear Medicine ADPAC for assistance.",$CHAR(7)
+10 QUIT
TEXT ; Check I-Type & abbreviation of file 79.2 against those listed below.
+1 ;;CARDIOLOGY STUDIES (NUC MED);CARD
+2 ;;NUCLEAR MEDICINE;NM
+3 ;;