BDGP1006 ;IHS/OIT/LJF - PRE & POST INSTALL, ENVIRON CHECK FOR PATCH 1006
;;5.3;PIMS;**1006**;MAY 28, 2004
;
CKENV ; environment check code
;Prevents "Disable Options..." and "Move Routines..." questions
S XPDDIQ("XPZ1")=0,XPPDIQ("XPZ2")=0
;
; now check for patch 1004
NEW PATCH S PATCH="PIMS*5.3*1005"
I '$$PATCH(PATCH) D Q
. W !,"You must first install "_PATCH_"." S XPDQUIT=2
;
; check for test version of patch 1004
I $$TEST(PATCH) D Q
. W !,"You have a TEST version of "_PATCH_" installed. Please install the released patch. . ."
. S XPDQUIT=2
;
Q
PATCH(X) ;return 1 if patch X was installed, X=aaaa*nn.nn*nnnn
;copy of code from XPDUTL but modified to handle 4 digit IHS patch numbers
Q:X'?1.4UN1"*"1.2N1"."1.2N.1(1"V",1"T").2N1"*"1.4N 0
NEW NUM,I,J
S I=$O(^DIC(9.4,"C",$P(X,"*"),0)) Q:'I 0
S J=$O(^DIC(9.4,I,22,"B",$P(X,"*",2),0)),X=$P(X,"*",3) Q:'J 0
;check if patch is just a number
Q:$O(^DIC(9.4,I,22,J,"PAH","B",X,0)) 1
S NUM=$O(^DIC(9.4,I,22,J,"PAH","B",X_" SEQ"))
Q (X=+NUM)
;
TEST(X) ; return 1 if site is running an iteration version of patch
NEW IEN
S IEN=$O(^XPD(9.6,"B",X,0)) I 'IEN Q 1 ;not test version but bad xref
I $G(^XPD(9.6,IEN,1,1,0))["ITERATION" Q 1
Q 0
;
PRE ;EP;
Q
;
POST ;EP; post install code
Q
BDGP1006 ;IHS/OIT/LJF - PRE & POST INSTALL, ENVIRON CHECK FOR PATCH 1006
+1 ;;5.3;PIMS;**1006**;MAY 28, 2004
+2 ;
CKENV ; environment check code
+1 ;Prevents "Disable Options..." and "Move Routines..." questions
+2 SET XPDDIQ("XPZ1")=0
SET XPPDIQ("XPZ2")=0
+3 ;
+4 ; now check for patch 1004
+5 NEW PATCH
SET PATCH="PIMS*5.3*1005"
+6 IF '$$PATCH(PATCH)
Begin DoDot:1
+7 WRITE !,"You must first install "_PATCH_"."
SET XPDQUIT=2
End DoDot:1
QUIT
+8 ;
+9 ; check for test version of patch 1004
+10 IF $$TEST(PATCH)
Begin DoDot:1
+11 WRITE !,"You have a TEST version of "_PATCH_" installed. Please install the released patch. . ."
+12 SET XPDQUIT=2
End DoDot:1
QUIT
+13 ;
+14 QUIT
PATCH(X) ;return 1 if patch X was installed, X=aaaa*nn.nn*nnnn
+1 ;copy of code from XPDUTL but modified to handle 4 digit IHS patch numbers
+2 IF X'?1.4UN1"*"1.2N1"."1.2N.1(1"V",1"T").2N1"*"1.4N
QUIT 0
+3 NEW NUM,I,J
+4 SET I=$ORDER(^DIC(9.4,"C",$PIECE(X,"*"),0))
IF 'I
QUIT 0
+5 SET J=$ORDER(^DIC(9.4,I,22,"B",$PIECE(X,"*",2),0))
SET X=$PIECE(X,"*",3)
IF 'J
QUIT 0
+6 ;check if patch is just a number
+7 IF $ORDER(^DIC(9.4,I,22,J,"PAH","B",X,0))
QUIT 1
+8 SET NUM=$ORDER(^DIC(9.4,I,22,J,"PAH","B",X_" SEQ"))
+9 QUIT (X=+NUM)
+10 ;
TEST(X) ; return 1 if site is running an iteration version of patch
+1 NEW IEN
+2 ;not test version but bad xref
SET IEN=$ORDER(^XPD(9.6,"B",X,0))
IF 'IEN
QUIT 1
+3 IF $GET(^XPD(9.6,IEN,1,1,0))["ITERATION"
QUIT 1
+4 QUIT 0
+5 ;
PRE ;EP;
+1 QUIT
+2 ;
POST ;EP; post install code
+1 QUIT