BTIUP9 ; IHS/CIA/MGH - POST INSTALL FOR PATCH 1009;05-Jan-2012 14:45;DU
;;1.0;TEXT INTEGRATION UTILITIES;**1009**;SEPT 04, 2005;Build 22
;
ENV ;EP environment check
N PATCH,STAT,INSTDA
S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
;
S PATCH="TIU*1.0*1007"
I '$$PATCH(PATCH) D Q
. W !,"You must first install "_PATCH_"." S XPDABORT=1
S PATCH="TIU*1.0*1008"
I '$$PATCH(PATCH) D Q
. W !,"You must first install "_PATCH_"." S XPDABORT=1
S PATCH="BJPC*2.0*6"
I '$$PATCH(PATCH) D Q
. W !,"You must first install "_PATCH_"." S XPDABORT=1
;Check for the installation of the ICARE
S IN="ICARE MANAGEMENT SYSTEM 2.1",INSTDA=""
I '$D(^XPD(9.7,"B",IN)) D Q
.W !,"You must first install the ICARE 2.1 before this patch" S XPDABORT=1
S INSTDA=$O(^XPD(9.7,"B",IN,INSTDA),-1)
S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
I STAT'=3 D
.W !,"ICARE 2.1 must be completely installed before installing this patch." S XPDABORT=1
S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
;Check for EHR installation
S IN="EHR*1.1*8",INSTDA=""
I '$D(^XPD(9.7,"B",IN)) D Q
.W !,"You must first install the EHR patch 8 before installing patch TIU patch 1009" S XPDABORT=1
S INSTDA=$O(^XPD(9.7,"B",IN,INSTDA),-1)
S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
I STAT'=3 D Q
.W !,"EHR patch 8 must be completely installed before installing TIU patch 1009" S XPDABORT=1
S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
;Redo the environment checker for patch 113
N CHKOK,TIULOC S CHKOK=1,TIULOC=0
W !!,"Checking DIVISION for all Hospital Location file (#44)"
W !,"entries <AND> INSTITUTION FILE POINTER for all Medical"
W !,"Center Division file (#40.8) entries..."
W !!
;
F S TIULOC=$O(^SC(TIULOC)) Q:'TIULOC!('CHKOK) D
. N TIUDVHL
. S TIUDVHL=+$P($G(^SC(TIULOC,0)),U,15) I 'TIUDVHL S CHKOK=0 Q
I CHKOK=1 D
. N TIUDIV,TIUIFP S TIUDIV=0
. F S TIUDIV=$O(^DG(40.8,TIUDIV)) Q:'TIUDIV!('CHKOK) D
. . S TIUIFP=+$G(^DG(40.8,"ADV",TIUDIV)) I 'TIUIFP S CHKOK=0 Q
;
I 'CHKOK D
. S XPDABORT=1 ; kill transport global from ^XTMP
. W !,"Sorry...DIVISION cannot be determined for all Hospital"
. W !,"Location file (#44) entries <AND/OR> INSTITUTION FILE"
. W !,"POINTER cannot be determined for all Medical Center"
. W !,"Division file (#40.8) entries. Please review and correct"
. W !,"both files as necessary."
. W !!,"** ABORTING INSTALLATION **"
E D
. W !,"** Files are OK **"
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)
;
PRE ;EP; beginning of pre install code
Q
;
POST ;EP; beginning of post install code
N SECURITY
S SECURITY("RD")="#"
S SECURITY("DD")="@"
S SECURITY("DEL")="#"
S SECURITY("WR")="#"
S SECURITY("LAYGO")="#"
S SECURITY("AUDIT")="@"
D FILESEC^DDMOD(8927,.SECURITY)
;Add the items to the menu
D REGMENU^BEHUTIL("BTIU SPECIAL REPORTS",,"HIMS","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU BROWSE PAT BY MR",,"IPD","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU DOC LIST",,"LAD","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU BTIU REVIEW SCREEN MR",,"MPD","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU MENU PRINT DOCS",,"PDM","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU IC LISTING",,"SIG","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU SEARCH FOR MR",,"SSD","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU MENU STATS REPORTS",,"STR","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU MENU MGR",,"TMM","BTIU MENU2")
D REGMENU^BEHUTIL("TIU UNSIGNED/UNCOSIGNED REPORT",,"UNS","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU MENU UPLOAD",,"UPL","BTIU MENU2")
D REGMENU^BEHUTIL("BTIU VIEW USER ALERTS",,"VUA","BTIU MENU2")
Q
BTIUP9 ; IHS/CIA/MGH - POST INSTALL FOR PATCH 1009;05-Jan-2012 14:45;DU
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**1009**;SEPT 04, 2005;Build 22
+2 ;
ENV ;EP environment check
+1 NEW PATCH,STAT,INSTDA
+2 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+3 ;
+4 SET PATCH="TIU*1.0*1007"
+5 IF '$$PATCH(PATCH)
Begin DoDot:1
+6 WRITE !,"You must first install "_PATCH_"."
SET XPDABORT=1
End DoDot:1
QUIT
+7 SET PATCH="TIU*1.0*1008"
+8 IF '$$PATCH(PATCH)
Begin DoDot:1
+9 WRITE !,"You must first install "_PATCH_"."
SET XPDABORT=1
End DoDot:1
QUIT
+10 SET PATCH="BJPC*2.0*6"
+11 IF '$$PATCH(PATCH)
Begin DoDot:1
+12 WRITE !,"You must first install "_PATCH_"."
SET XPDABORT=1
End DoDot:1
QUIT
+13 ;Check for the installation of the ICARE
+14 SET IN="ICARE MANAGEMENT SYSTEM 2.1"
SET INSTDA=""
+15 IF '$DATA(^XPD(9.7,"B",IN))
Begin DoDot:1
+16 WRITE !,"You must first install the ICARE 2.1 before this patch"
SET XPDABORT=1
End DoDot:1
QUIT
+17 SET INSTDA=$ORDER(^XPD(9.7,"B",IN,INSTDA),-1)
+18 SET STAT=+$PIECE($GET(^XPD(9.7,INSTDA,0)),U,9)
+19 IF STAT'=3
Begin DoDot:1
+20 WRITE !,"ICARE 2.1 must be completely installed before installing this patch."
SET XPDABORT=1
End DoDot:1
+21 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+22 ;Check for EHR installation
+23 SET IN="EHR*1.1*8"
SET INSTDA=""
+24 IF '$DATA(^XPD(9.7,"B",IN))
Begin DoDot:1
+25 WRITE !,"You must first install the EHR patch 8 before installing patch TIU patch 1009"
SET XPDABORT=1
End DoDot:1
QUIT
+26 SET INSTDA=$ORDER(^XPD(9.7,"B",IN,INSTDA),-1)
+27 SET STAT=+$PIECE($GET(^XPD(9.7,INSTDA,0)),U,9)
+28 IF STAT'=3
Begin DoDot:1
+29 WRITE !,"EHR patch 8 must be completely installed before installing TIU patch 1009"
SET XPDABORT=1
End DoDot:1
QUIT
+30 SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+31 ;Redo the environment checker for patch 113
+32 NEW CHKOK,TIULOC
SET CHKOK=1
SET TIULOC=0
+33 WRITE !!,"Checking DIVISION for all Hospital Location file (#44)"
+34 WRITE !,"entries <AND> INSTITUTION FILE POINTER for all Medical"
+35 WRITE !,"Center Division file (#40.8) entries..."
+36 WRITE !!
+37 ;
+38 FOR
SET TIULOC=$ORDER(^SC(TIULOC))
IF 'TIULOC!('CHKOK)
QUIT
Begin DoDot:1
+39 NEW TIUDVHL
+40 SET TIUDVHL=+$PIECE($GET(^SC(TIULOC,0)),U,15)
IF 'TIUDVHL
SET CHKOK=0
QUIT
End DoDot:1
+41 IF CHKOK=1
Begin DoDot:1
+42 NEW TIUDIV,TIUIFP
SET TIUDIV=0
+43 FOR
SET TIUDIV=$ORDER(^DG(40.8,TIUDIV))
IF 'TIUDIV!('CHKOK)
QUIT
Begin DoDot:2
+44 SET TIUIFP=+$GET(^DG(40.8,"ADV",TIUDIV))
IF 'TIUIFP
SET CHKOK=0
QUIT
End DoDot:2
End DoDot:1
+45 ;
+46 IF 'CHKOK
Begin DoDot:1
+47 ; kill transport global from ^XTMP
SET XPDABORT=1
+48 WRITE !,"Sorry...DIVISION cannot be determined for all Hospital"
+49 WRITE !,"Location file (#44) entries <AND/OR> INSTITUTION FILE"
+50 WRITE !,"POINTER cannot be determined for all Medical Center"
+51 WRITE !,"Division file (#40.8) entries. Please review and correct"
+52 WRITE !,"both files as necessary."
+53 WRITE !!,"** ABORTING INSTALLATION **"
End DoDot:1
+54 IF '$TEST
Begin DoDot:1
+55 WRITE !,"** Files are OK **"
End DoDot:1
+56 QUIT
+57 ;
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 ;
PRE ;EP; beginning of pre install code
+1 QUIT
+2 ;
POST ;EP; beginning of post install code
+1 NEW SECURITY
+2 SET SECURITY("RD")="#"
+3 SET SECURITY("DD")="@"
+4 SET SECURITY("DEL")="#"
+5 SET SECURITY("WR")="#"
+6 SET SECURITY("LAYGO")="#"
+7 SET SECURITY("AUDIT")="@"
+8 DO FILESEC^DDMOD(8927,.SECURITY)
+9 ;Add the items to the menu
+10 DO REGMENU^BEHUTIL("BTIU SPECIAL REPORTS",,"HIMS","BTIU MENU2")
+11 DO REGMENU^BEHUTIL("BTIU BROWSE PAT BY MR",,"IPD","BTIU MENU2")
+12 DO REGMENU^BEHUTIL("BTIU DOC LIST",,"LAD","BTIU MENU2")
+13 DO REGMENU^BEHUTIL("BTIU BTIU REVIEW SCREEN MR",,"MPD","BTIU MENU2")
+14 DO REGMENU^BEHUTIL("BTIU MENU PRINT DOCS",,"PDM","BTIU MENU2")
+15 DO REGMENU^BEHUTIL("BTIU IC LISTING",,"SIG","BTIU MENU2")
+16 DO REGMENU^BEHUTIL("BTIU SEARCH FOR MR",,"SSD","BTIU MENU2")
+17 DO REGMENU^BEHUTIL("BTIU MENU STATS REPORTS",,"STR","BTIU MENU2")
+18 DO REGMENU^BEHUTIL("BTIU MENU MGR",,"TMM","BTIU MENU2")
+19 DO REGMENU^BEHUTIL("TIU UNSIGNED/UNCOSIGNED REPORT",,"UNS","BTIU MENU2")
+20 DO REGMENU^BEHUTIL("BTIU MENU UPLOAD",,"UPL","BTIU MENU2")
+21 DO REGMENU^BEHUTIL("BTIU VIEW USER ALERTS",,"VUA","BTIU MENU2")
+22 QUIT