BRNPTCH2 ; IHS/OIT/AR - BRN Patch 2 Environment/Post Install ; [ 04/XX/2009 XX:YY XM ]
;;2.0;RELEASE OF INFO SYSTEM;**2**;APR 10, 2003
;
PRE ; EP
NEW CP,RPMS,RPMSVER
NEW STR
NEW LASTPTCH ; Last Patch
NEW LSTPISTS ; Last Patch Install Status
NEW ERRARRAY ; Array of errors
;
D BMES^XPDUTL("Beginning of Pre Check.")
I $G(XPDNM)="" D SORRY("XPDNM not defined or 0.") Q
;
S CP=$P(XPDNM,"*",3) ; This Patch Number
S RPMS=$P(XPDNM,"*",1) ; RPMS Module
S RPMSVER=$P(XPDNM,"*",2) ; Version of RPMS module being patched
;
PTCHLAST ; EP - Check for previous patch
D MES^XPDUTL(" Need BRN*2.0*1 Patch Installed.")
I $$PATCH^XPDUTL("BRN*2.0*1")'=1 D SORRY("BRN*2.0*1 Patch Not Installed.") Q
;
D OKAY("BRN*2.0*1 Patch Installed.",10)
;
S XPDNOQUE="NO QUE" ; No Queuing Allowed
;
; The following lines prevent the "Disable Options..." and "Move
; Routines..." questions from being asked during the install.
I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
;
S XPDABORT=0 ; KIDS install Flag
;
USERID ; EP - CHECK FOR USER ID
I '$G(DUZ) D SORRY("DUZ UNDEFINED OR 0.") Q
;
I '$L($G(DUZ(0))) D SORRY("DUZ(0) UNDEFINED OR NULL.") Q
;
D HOME^%ZIS
D DTNOLF^DICRW ; Set DT variable without Doing a Line Feed
;
S X=$P($G(^VA(200,DUZ,0)),U)
I $G(X) D SORRY("Installer cannot be identified!",,,CP) Q
;
D MES^XPDUTL("Pre Check complete.")
;
LETSGO ; EP - USER IDENTIFIED -- LET'S GO
D BMES^XPDUTL("Hello, "_$P(X,",",2)_" "_$P(X,","))
;
D BMES^XPDUTL("Checking Environment for Patch "_CP_" of Version "_RPMSVER_" of "_RPMS_".")
;
D NEEDIT("DI","22.0",,.ERRARRAY) ; FILEMAN 22.0
D NEEDIT("XM","8.0",,.ERRARRAY) ; MAILMAN 8.0
D NEEDIT("XU","8.0",,.ERRARRAY) ; KERNEL 8.0
D NEEDIT("XB","3.0",,.ERRARRAY) ; IHS/VA Utilities
;
I XPDABORT<1 D BMES^XPDUTL("Environment for Patch "_CP_" of Version "_RPMSVER_" of "_RPMS_" OK.")
I XPDABORT>0 D SORRYEND(.ERRARRAY) ; ENVIRONMENT HAS ERROR(S)
D BMES^XPDUTL(" ")
Q
;
; Generic "Find RPMS Module's Version and (perhaps) Patch number"
; The MODULE variable MUST be the PREFIX name from the PACKAGE file (9.4).
NEEDIT(MODULE,VERSION,PATCH,ERRARRAY) ; EP
NEW NAME ; Name of PACKAGE
NEW HEREYAGO,STR1,STR2 ; Scratch variables/arrays
NEW SYSVER,SYSPATCH ; System Version & System Patch variables
;
D FIND^DIC(9.4,"","","",MODULE,"","C","","","HEREYAGO")
S NAME=$G(HEREYAGO("DILIST",1,1))
;
D BMES^XPDUTL("Need at least "_NAME_" "_VERSION)
;
S SYSVER=$$VERSION^XPDUTL(MODULE) ; Get the System's Version
; If System Version < Needed Version, write message and quit
I SYSVER<VERSION D Q
. S ERRARRAY(MODULE,NAME,VERSION)=""
. D NEEDMSG("Need "_NAME_" "_VERSION_" & "_NAME_" "_SYSVER_" found!")
;
D OKAY(NAME_" "_SYSVER_" found.")
I VERSION<SYSVER Q ; If Version needed is lower, skip Patch check
;
I $G(PATCH)="" Q ; If no Patch check, just exit
;
D BMES^XPDUTL(" Need "_NAME_" "_VERSION_" Patch "_PATCH_".")
S SYSPATCH=$$PATCH^XPDUTL(MODULE_"*"_VERSION_"*"_PATCH)
I SYSPATCH'=1 D Q
. S ERRARRAY(MODULE,NAME,VERSION)=$G(PATCH)
. D NEEDMSG(NAME_" "_VERSION_" & Patch "_PATCH_" WAS NOT installed!")
;
D OKAY(NAME_" "_VERSION_" Patch "_PATCH_" found.",10)
;
Q
;
NEEDMSG(MESSAGE) ; EP
NEW STR1,STR2
;
S STR1=MESSAGE
I $L(STR1)<58 D SORRY(STR1,,,CP) Q
;
S STR1=$P(MESSAGE,"&")_" &"
S STR2=$$TRIM^XLFSTR($P(MESSAGE,"&",2),"L"," ")
D SORRY(STR1,,STR2,CP)
Q
;
POST ; EP
D BMES^XPDUTL("POST INSTALL Begins.")
;
D BMES^XPDUTL(" Deleting FOIA Option from BRN MENU RPT")
S OK=$$DELETE^XPDMENU("BRN MENU RPT","BRN FOIA REPORTING")
S STR=$J("",10)_"FOIA Option "_$S(OK=1:"WAS",1:"WAS NOT")
S STR=STR_" Deleted from ROI Reports Menu"
S STR=STR_$S(OK=1:". OK",1:".")
D MES^XPDUTL(STR)
D BMES^XPDUTL("POST INSTALL Complete.")
Q
;
DEBUG ; EP - Debugging
NEW CP,DEBUG,XPDNM
S DEBUG="YES"
S XPDNM="BRN*2.0*2"
S CP=$P($T(+2),"*",3) ; This Patch
D PRE
Q
;
SORRY(MSG,MODE,MSG2) ; EP -- Error Message routine.
NEW LINECNT,STR,MESSAGE,WHATMSG
; The STR array is built so that the error/warning message will
; also appear on the INSTALL LOG via the D BMES^XPDUTL(.STR) call.
;
I $G(MODE)="FATAL" D
. S MESSAGE="Install Aborting due to the following Systems Environment issue:"
. S XPDABORT=1 ; Fatal Error Flag Set
;
I $G(MODE)="NONFATAL" S MESSAGE="*** WARNING *** WARNING *** WARNING ***"
;
K DIFQ
;
S LINECNT=1
D ADDLINE($TR($J("",65)," ","*"),.LINECNT) ; Row of asterisks
D ADDLINE(" ",.LINECNT)
;
D ADDLINE($$CJ^XLFSTR("Site: "_$$LOC^XBFUNC,65),.LINECNT)
D ADDLINE(" ",.LINECNT)
;
D ADDLINE($$CJ^XLFSTR(MESSAGE,65),.LINECNT)
D ADDLINE(" ",.LINECNT)
;
D ADDLINE($$CJ^XLFSTR(">>> "_MSG_" <<<",65),.LINECNT)
I $D(MSG2) D ADDLINE($$CJ^XLFSTR(">>> "_MSG2_" <<<",65),.LINECNT)
D ADDLINE(" ",.LINECNT)
;
I $G(MODE)["NONFATAL" D ADDLINE($$CJ^XLFSTR(MESSAGE,65),.LINECNT)
;
I $G(MODE)='"FATAL" D
. D ADDLINE($$CJ^XLFSTR("Please print/capture this screen and",65),.LINECNT)
. D ADDLINE($$CJ^XLFSTR("notify the Support Center at",65),.LINECNT)
. D ADDLINE(" ",.LINECNT)
. D ADDLINE($$CJ^XLFSTR("1-999-999-9999.",65),.LINECNT)
. D ADDLINE(" ",.LINECNT)
;
D ADDLINE($TR($J("",65)," ","*"),.LINECNT) ; Row of asterisks
D ADDLINE(" ",.LINECNT)
;
D BMES^XPDUTL(.STR) ; Display the message
;
; If Debugging, just exit -- Don't send e-mail nor alert
I $G(DEBUG)="YES" Q
;
S WHATMSG=RPMS_" Patch "_CP_" Install "
S WHATMSG=WHATMSG_$S(MODE="NONFATAL":MODE,MODE="FATAL":">>FATAL<<",1:"<UNK>")
S WHATMSG=WHATMSG_" Error."
;
D SNDALERT(WHATMSG)
D SENDMAIL(WHATMSG)
Q
;
ADDLINE(ASTR,LC) ; EP -- Add a line to the STR array
I $G(ASTR)="" S ASTR=" "
S STR(LC)=ASTR
S LC=LC+1
Q
;
SNDALERT(ALERTMSG) ; EP -- Send alert to installer
NEW XQA,XQAARCH,XQACNDEL,XQADATA,XQAFLG,XQAGUID
NEW XQAID,XQAMSG,XQAOPT,XQAREVUE,XQAROU,XQASUPV
NEW XQASURO,XQATEXT,OK,NAME
;
S XQAMSG=ALERTMSG
S XQA(DUZ)=""
D SETUP^XQALERT
Q
;
SENDMAIL(MAILMSG) ; EP -- E-mail to Installer; message in STR array
NEW CP,RPMS,XMDUZ,XMSUB,XMTEXT,XMY
;
S CP=$P($T(+2),"*",3)
S RPMS=$P($T(+2),"*",4)
;
S XMY(DUZ)=""
S XMSUB=MAILMSG
S XMTEXT="STR("
S XMDUZ=RPMS_" Patch "_CP
;
D ^XMD ; Send the MailMan e-mail
Q
;
OKAY(MSG,TAB) ; EP -- Write out "OKAY" message
I $G(TAB)="" S TAB=5
D MES^XPDUTL($J("",TAB)_MSG_" OK.")
Q
;
SORRYEND(WOTERR) ; EP -- Final Error Message
NEW STR,MODULE,NAME,VERSION,PATCH,LINECNT,TMP
;
; Output a listing of ALL the errors detected during
; the environment check. The STR array will be
; displayed by the BMES^XPDUTL call.
;
D SORRYHED
;
; Add ALL the errors detected to the STR array
S (MODULE,NAME,VERSION)=""
F S MODULE=$O(WOTERR(MODULE)) Q:MODULE="" D
. F S NAME=$O(WOTERR(MODULE,NAME)) Q:NAME="" D
.. F S VERSION=$O(WOTERR(MODULE,NAME,VERSION)) Q:VERSION="" D
... D ADDMESG
;
D SORRYFIN
;
D BMES^XPDUTL(.STR) ; Display the message in the STR array
;
Q
;
SORRYHED ; EP -- "Header" of Final Fatal Message
S LINECNT=1
D ADDLINE(" ",.LINECNT)
D ADDLINE($TR($J("",65)," ","*"),.LINECNT)
D ADDLINE(" ",.LINECNT)
D ADDLINE($$CJ^XLFSTR("Systems Environment Error Detected",65),.LINECNT)
D ADDLINE($$CJ^XLFSTR("KIDS build will be deleted",65),.LINECNT)
D ADDLINE(" ",.LINECNT)
D ADDLINE($$CJ^XLFSTR("Modules with Version or Patch errors",65),.LINECNT)
D ADDLINE(" ",.LINECNT)
Q
;
ADDMESG ; EP -- Add to the STR array
S PATCH=$G(WOTERR(MODULE,NAME,VERSION))
D ADDLINE($$CJ^XLFSTR(NAME_" ("_MODULE_")",65),.LINECNT)
;
S TMP="Version:"_VERSION
I $G(PATCH)'="" S TMP=TMP_" Patch:"_$G(PATCH)
;
D ADDLINE($$CJ^XLFSTR(TMP,65),.LINECNT)
D ADDLINE(" ",.LINECNT)
Q
;
SORRYFIN ; EP -- "Fin" of Final Fatal Message
D ADDLINE($$CJ^XLFSTR("Re-Installation will be necessary.",65),.LINECNT)
D ADDLINE(" ",.LINECNT)
D ADDLINE($$CJ^XLFSTR("If assistance is needed, please call 1-999-999-9999.",65),.LINECNT)
D ADDLINE(" ",.LINECNT)
D ADDLINE($TR($J("",65)," ","*"),.LINECNT)
D ADDLINE(" ",.LINECNT)
Q
;
RESET ; EP -- For debugging only
NEW OK
;
D BMES^XPDUTL("Adding FOIA Option Back to BRN MENU RPT.")
S OK=$$ADD^XPDMENU("BRN MENU RPT","BRN FOIA REPORTING","FOIA",)
S STR=$J("",5)_"FOIA Option "_$S(OK=1:"WAS",1:"WAS NOT")
S STR=STR_" Added Back to ROI Reports Menu"
S STR=STR_$S(OK=1:". OK",1:".")
D MES^XPDUTL(STR)
D MES^XPDUTL("Adding FOIA Option Back to BRN MENU RPT Complete.")
D BMES^XPDUTL(" ")
Q
BRNPTCH2 ; IHS/OIT/AR - BRN Patch 2 Environment/Post Install ; [ 04/XX/2009 XX:YY XM ]
+1 ;;2.0;RELEASE OF INFO SYSTEM;**2**;APR 10, 2003
+2 ;
PRE ; EP
+1 NEW CP,RPMS,RPMSVER
+2 NEW STR
+3 ; Last Patch
NEW LASTPTCH
+4 ; Last Patch Install Status
NEW LSTPISTS
+5 ; Array of errors
NEW ERRARRAY
+6 ;
+7 DO BMES^XPDUTL("Beginning of Pre Check.")
+8 IF $GET(XPDNM)=""
DO SORRY("XPDNM not defined or 0.")
QUIT
+9 ;
+10 ; This Patch Number
SET CP=$PIECE(XPDNM,"*",3)
+11 ; RPMS Module
SET RPMS=$PIECE(XPDNM,"*",1)
+12 ; Version of RPMS module being patched
SET RPMSVER=$PIECE(XPDNM,"*",2)
+13 ;
PTCHLAST ; EP - Check for previous patch
+1 DO MES^XPDUTL(" Need BRN*2.0*1 Patch Installed.")
+2 IF $$PATCH^XPDUTL("BRN*2.0*1")'=1
DO SORRY("BRN*2.0*1 Patch Not Installed.")
QUIT
+3 ;
+4 DO OKAY("BRN*2.0*1 Patch Installed.",10)
+5 ;
+6 ; No Queuing Allowed
SET XPDNOQUE="NO QUE"
+7 ;
+8 ; The following lines prevent the "Disable Options..." and "Move
+9 ; Routines..." questions from being asked during the install.
+10 IF $GET(XPDENV)=1
SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+11 IF $GET(XPDENV)=1
SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+12 FOR X="XPO1","XPZ1","XPZ2","XPI1"
SET XPDDIQ(X)=0
+13 ;
+14 ; KIDS install Flag
SET XPDABORT=0
+15 ;
USERID ; EP - CHECK FOR USER ID
+1 IF '$GET(DUZ)
DO SORRY("DUZ UNDEFINED OR 0.")
QUIT
+2 ;
+3 IF '$LENGTH($GET(DUZ(0)))
DO SORRY("DUZ(0) UNDEFINED OR NULL.")
QUIT
+4 ;
+5 DO HOME^%ZIS
+6 ; Set DT variable without Doing a Line Feed
DO DTNOLF^DICRW
+7 ;
+8 SET X=$PIECE($GET(^VA(200,DUZ,0)),U)
+9 IF $GET(X)
DO SORRY("Installer cannot be identified!",,,CP)
QUIT
+10 ;
+11 DO MES^XPDUTL("Pre Check complete.")
+12 ;
LETSGO ; EP - USER IDENTIFIED -- LET'S GO
+1 DO BMES^XPDUTL("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","))
+2 ;
+3 DO BMES^XPDUTL("Checking Environment for Patch "_CP_" of Version "_RPMSVER_" of "_RPMS_".")
+4 ;
+5 ; FILEMAN 22.0
DO NEEDIT("DI","22.0",,.ERRARRAY)
+6 ; MAILMAN 8.0
DO NEEDIT("XM","8.0",,.ERRARRAY)
+7 ; KERNEL 8.0
DO NEEDIT("XU","8.0",,.ERRARRAY)
+8 ; IHS/VA Utilities
DO NEEDIT("XB","3.0",,.ERRARRAY)
+9 ;
+10 IF XPDABORT<1
DO BMES^XPDUTL("Environment for Patch "_CP_" of Version "_RPMSVER_" of "_RPMS_" OK.")
+11 ; ENVIRONMENT HAS ERROR(S)
IF XPDABORT>0
DO SORRYEND(.ERRARRAY)
+12 DO BMES^XPDUTL(" ")
+13 QUIT
+14 ;
+15 ; Generic "Find RPMS Module's Version and (perhaps) Patch number"
+16 ; The MODULE variable MUST be the PREFIX name from the PACKAGE file (9.4).
NEEDIT(MODULE,VERSION,PATCH,ERRARRAY) ; EP
+1 ; Name of PACKAGE
NEW NAME
+2 ; Scratch variables/arrays
NEW HEREYAGO,STR1,STR2
+3 ; System Version & System Patch variables
NEW SYSVER,SYSPATCH
+4 ;
+5 DO FIND^DIC(9.4,"","","",MODULE,"","C","","","HEREYAGO")
+6 SET NAME=$GET(HEREYAGO("DILIST",1,1))
+7 ;
+8 DO BMES^XPDUTL("Need at least "_NAME_" "_VERSION)
+9 ;
+10 ; Get the System's Version
SET SYSVER=$$VERSION^XPDUTL(MODULE)
+11 ; If System Version < Needed Version, write message and quit
+12 IF SYSVER<VERSION
Begin DoDot:1
+13 SET ERRARRAY(MODULE,NAME,VERSION)=""
+14 DO NEEDMSG("Need "_NAME_" "_VERSION_" & "_NAME_" "_SYSVER_" found!")
End DoDot:1
QUIT
+15 ;
+16 DO OKAY(NAME_" "_SYSVER_" found.")
+17 ; If Version needed is lower, skip Patch check
IF VERSION<SYSVER
QUIT
+18 ;
+19 ; If no Patch check, just exit
IF $GET(PATCH)=""
QUIT
+20 ;
+21 DO BMES^XPDUTL(" Need "_NAME_" "_VERSION_" Patch "_PATCH_".")
+22 SET SYSPATCH=$$PATCH^XPDUTL(MODULE_"*"_VERSION_"*"_PATCH)
+23 IF SYSPATCH'=1
Begin DoDot:1
+24 SET ERRARRAY(MODULE,NAME,VERSION)=$GET(PATCH)
+25 DO NEEDMSG(NAME_" "_VERSION_" & Patch "_PATCH_" WAS NOT installed!")
End DoDot:1
QUIT
+26 ;
+27 DO OKAY(NAME_" "_VERSION_" Patch "_PATCH_" found.",10)
+28 ;
+29 QUIT
+30 ;
NEEDMSG(MESSAGE) ; EP
+1 NEW STR1,STR2
+2 ;
+3 SET STR1=MESSAGE
+4 IF $LENGTH(STR1)<58
DO SORRY(STR1,,,CP)
QUIT
+5 ;
+6 SET STR1=$PIECE(MESSAGE,"&")_" &"
+7 SET STR2=$$TRIM^XLFSTR($PIECE(MESSAGE,"&",2),"L"," ")
+8 DO SORRY(STR1,,STR2,CP)
+9 QUIT
+10 ;
POST ; EP
+1 DO BMES^XPDUTL("POST INSTALL Begins.")
+2 ;
+3 DO BMES^XPDUTL(" Deleting FOIA Option from BRN MENU RPT")
+4 SET OK=$$DELETE^XPDMENU("BRN MENU RPT","BRN FOIA REPORTING")
+5 SET STR=$JUSTIFY("",10)_"FOIA Option "_$SELECT(OK=1:"WAS",1:"WAS NOT")
+6 SET STR=STR_" Deleted from ROI Reports Menu"
+7 SET STR=STR_$SELECT(OK=1:". OK",1:".")
+8 DO MES^XPDUTL(STR)
+9 DO BMES^XPDUTL("POST INSTALL Complete.")
+10 QUIT
+11 ;
DEBUG ; EP - Debugging
+1 NEW CP,DEBUG,XPDNM
+2 SET DEBUG="YES"
+3 SET XPDNM="BRN*2.0*2"
+4 ; This Patch
SET CP=$PIECE($TEXT(+2),"*",3)
+5 DO PRE
+6 QUIT
+7 ;
SORRY(MSG,MODE,MSG2) ; EP -- Error Message routine.
+1 NEW LINECNT,STR,MESSAGE,WHATMSG
+2 ; The STR array is built so that the error/warning message will
+3 ; also appear on the INSTALL LOG via the D BMES^XPDUTL(.STR) call.
+4 ;
+5 IF $GET(MODE)="FATAL"
Begin DoDot:1
+6 SET MESSAGE="Install Aborting due to the following Systems Environment issue:"
+7 ; Fatal Error Flag Set
SET XPDABORT=1
End DoDot:1
+8 ;
+9 IF $GET(MODE)="NONFATAL"
SET MESSAGE="*** WARNING *** WARNING *** WARNING ***"
+10 ;
+11 KILL DIFQ
+12 ;
+13 SET LINECNT=1
+14 ; Row of asterisks
DO ADDLINE($TRANSLATE($JUSTIFY("",65)," ","*"),.LINECNT)
+15 DO ADDLINE(" ",.LINECNT)
+16 ;
+17 DO ADDLINE($$CJ^XLFSTR("Site: "_$$LOC^XBFUNC,65),.LINECNT)
+18 DO ADDLINE(" ",.LINECNT)
+19 ;
+20 DO ADDLINE($$CJ^XLFSTR(MESSAGE,65),.LINECNT)
+21 DO ADDLINE(" ",.LINECNT)
+22 ;
+23 DO ADDLINE($$CJ^XLFSTR(">>> "_MSG_" <<<",65),.LINECNT)
+24 IF $DATA(MSG2)
DO ADDLINE($$CJ^XLFSTR(">>> "_MSG2_" <<<",65),.LINECNT)
+25 DO ADDLINE(" ",.LINECNT)
+26 ;
+27 IF $GET(MODE)["NONFATAL"
DO ADDLINE($$CJ^XLFSTR(MESSAGE,65),.LINECNT)
+28 ;
+29 IF $GET(MODE)='"FATAL"
Begin DoDot:1
+30 DO ADDLINE($$CJ^XLFSTR("Please print/capture this screen and",65),.LINECNT)
+31 DO ADDLINE($$CJ^XLFSTR("notify the Support Center at",65),.LINECNT)
+32 DO ADDLINE(" ",.LINECNT)
+33 DO ADDLINE($$CJ^XLFSTR("1-999-999-9999.",65),.LINECNT)
+34 DO ADDLINE(" ",.LINECNT)
End DoDot:1
+35 ;
+36 ; Row of asterisks
DO ADDLINE($TRANSLATE($JUSTIFY("",65)," ","*"),.LINECNT)
+37 DO ADDLINE(" ",.LINECNT)
+38 ;
+39 ; Display the message
DO BMES^XPDUTL(.STR)
+40 ;
+41 ; If Debugging, just exit -- Don't send e-mail nor alert
+42 IF $GET(DEBUG)="YES"
QUIT
+43 ;
+44 SET WHATMSG=RPMS_" Patch "_CP_" Install "
+45 SET WHATMSG=WHATMSG_$SELECT(MODE="NONFATAL":MODE,MODE="FATAL":">>FATAL<<",1:"<UNK>")
+46 SET WHATMSG=WHATMSG_" Error."
+47 ;
+48 DO SNDALERT(WHATMSG)
+49 DO SENDMAIL(WHATMSG)
+50 QUIT
+51 ;
ADDLINE(ASTR,LC) ; EP -- Add a line to the STR array
+1 IF $GET(ASTR)=""
SET ASTR=" "
+2 SET STR(LC)=ASTR
+3 SET LC=LC+1
+4 QUIT
+5 ;
SNDALERT(ALERTMSG) ; EP -- Send alert to installer
+1 NEW XQA,XQAARCH,XQACNDEL,XQADATA,XQAFLG,XQAGUID
+2 NEW XQAID,XQAMSG,XQAOPT,XQAREVUE,XQAROU,XQASUPV
+3 NEW XQASURO,XQATEXT,OK,NAME
+4 ;
+5 SET XQAMSG=ALERTMSG
+6 SET XQA(DUZ)=""
+7 DO SETUP^XQALERT
+8 QUIT
+9 ;
SENDMAIL(MAILMSG) ; EP -- E-mail to Installer; message in STR array
+1 NEW CP,RPMS,XMDUZ,XMSUB,XMTEXT,XMY
+2 ;
+3 SET CP=$PIECE($TEXT(+2),"*",3)
+4 SET RPMS=$PIECE($TEXT(+2),"*",4)
+5 ;
+6 SET XMY(DUZ)=""
+7 SET XMSUB=MAILMSG
+8 SET XMTEXT="STR("
+9 SET XMDUZ=RPMS_" Patch "_CP
+10 ;
+11 ; Send the MailMan e-mail
DO ^XMD
+12 QUIT
+13 ;
OKAY(MSG,TAB) ; EP -- Write out "OKAY" message
+1 IF $GET(TAB)=""
SET TAB=5
+2 DO MES^XPDUTL($JUSTIFY("",TAB)_MSG_" OK.")
+3 QUIT
+4 ;
SORRYEND(WOTERR) ; EP -- Final Error Message
+1 NEW STR,MODULE,NAME,VERSION,PATCH,LINECNT,TMP
+2 ;
+3 ; Output a listing of ALL the errors detected during
+4 ; the environment check. The STR array will be
+5 ; displayed by the BMES^XPDUTL call.
+6 ;
+7 DO SORRYHED
+8 ;
+9 ; Add ALL the errors detected to the STR array
+10 SET (MODULE,NAME,VERSION)=""
+11 FOR
SET MODULE=$ORDER(WOTERR(MODULE))
IF MODULE=""
QUIT
Begin DoDot:1
+12 FOR
SET NAME=$ORDER(WOTERR(MODULE,NAME))
IF NAME=""
QUIT
Begin DoDot:2
+13 FOR
SET VERSION=$ORDER(WOTERR(MODULE,NAME,VERSION))
IF VERSION=""
QUIT
Begin DoDot:3
+14 DO ADDMESG
End DoDot:3
End DoDot:2
End DoDot:1
+15 ;
+16 DO SORRYFIN
+17 ;
+18 ; Display the message in the STR array
DO BMES^XPDUTL(.STR)
+19 ;
+20 QUIT
+21 ;
SORRYHED ; EP -- "Header" of Final Fatal Message
+1 SET LINECNT=1
+2 DO ADDLINE(" ",.LINECNT)
+3 DO ADDLINE($TRANSLATE($JUSTIFY("",65)," ","*"),.LINECNT)
+4 DO ADDLINE(" ",.LINECNT)
+5 DO ADDLINE($$CJ^XLFSTR("Systems Environment Error Detected",65),.LINECNT)
+6 DO ADDLINE($$CJ^XLFSTR("KIDS build will be deleted",65),.LINECNT)
+7 DO ADDLINE(" ",.LINECNT)
+8 DO ADDLINE($$CJ^XLFSTR("Modules with Version or Patch errors",65),.LINECNT)
+9 DO ADDLINE(" ",.LINECNT)
+10 QUIT
+11 ;
ADDMESG ; EP -- Add to the STR array
+1 SET PATCH=$GET(WOTERR(MODULE,NAME,VERSION))
+2 DO ADDLINE($$CJ^XLFSTR(NAME_" ("_MODULE_")",65),.LINECNT)
+3 ;
+4 SET TMP="Version:"_VERSION
+5 IF $GET(PATCH)'=""
SET TMP=TMP_" Patch:"_$GET(PATCH)
+6 ;
+7 DO ADDLINE($$CJ^XLFSTR(TMP,65),.LINECNT)
+8 DO ADDLINE(" ",.LINECNT)
+9 QUIT
+10 ;
SORRYFIN ; EP -- "Fin" of Final Fatal Message
+1 DO ADDLINE($$CJ^XLFSTR("Re-Installation will be necessary.",65),.LINECNT)
+2 DO ADDLINE(" ",.LINECNT)
+3 DO ADDLINE($$CJ^XLFSTR("If assistance is needed, please call 1-999-999-9999.",65),.LINECNT)
+4 DO ADDLINE(" ",.LINECNT)
+5 DO ADDLINE($TRANSLATE($JUSTIFY("",65)," ","*"),.LINECNT)
+6 DO ADDLINE(" ",.LINECNT)
+7 QUIT
+8 ;
RESET ; EP -- For debugging only
+1 NEW OK
+2 ;
+3 DO BMES^XPDUTL("Adding FOIA Option Back to BRN MENU RPT.")
+4 SET OK=$$ADD^XPDMENU("BRN MENU RPT","BRN FOIA REPORTING","FOIA",)
+5 SET STR=$JUSTIFY("",5)_"FOIA Option "_$SELECT(OK=1:"WAS",1:"WAS NOT")
+6 SET STR=STR_" Added Back to ROI Reports Menu"
+7 SET STR=STR_$SELECT(OK=1:". OK",1:".")
+8 DO MES^XPDUTL(STR)
+9 DO MES^XPDUTL("Adding FOIA Option Back to BRN MENU RPT Complete.")
+10 DO BMES^XPDUTL(" ")
+11 QUIT