GMTSP88 ;BP CHY20/RJT - GMTS*2.7*88 POST INIT: ; 2/13/08 1:56pm
;;2.7;HEALTH SUMMARY;**88**;Oct 20, 1995;Build 23
Q
EN ;
N GMTSIEN,GMTSHS,GMTSALRT,INDEX S INDEX=1 D BMES^XPDUTL("Updating the Health Summary Component file")
I +$$VERSION^XPDUTL("GMTS")'="2.7" D BMES^XPDUTL("Health Summary version 2.7 not found! Aborting file update...") Q
;S GMTSHS=$$FIND1^DIC(9.4,"","X","HEALTH SUMMARY","B","") I +GMTSHS=0 D BMES^XPDUTL("Health Summary package not found! Aborting file update...") G END
;S GMTSIEN=$$FIND1^DIC(9.49,","_GMTSHS_",","X","2.7","B","") I +GMTSIEN=0 D BMES^XPDUTL("Health Summary version 2.7 not found! Aborting file update...") G END
D EN1,EN2
D
. I '$D(^TMP("GMTS",$J,"ALERT")) D BMES^XPDUTL("File #142.1 was updated successfully.") Q
. D ALERT
G END
Q
EN1 ;
N MHAS S MHAS=$$FIND1^DIC(142.1,"","X","MHA Score","B","")
I $G(MHAS)]"" D
. I $$GET1^DIQ(142.1,MHAS,2,"I")="1" D
. . S DIE="142.1",DA=MHAS,DR="2///yes"
. . L +^GMT(142.1,MHAS):$G(DILOCKTM,3) I $T D ^DIE L -^GMT(142.1,MHAS) Q
. . D BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.") D ADD("MHAS","TIME LIMITS APPLICABLE") Q
. I $$GET1^DIQ(142.1,MHAS,4,"I")="1" D
. . S DIE="142.1",DA=MHAS,DR="4///yes"
. . L +^GMT(142.1,MHAS):$G(DILOCKTM,3) I $T D ^DIE L -^GMT(142.1,MHAS) Q
. . D BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.") D ADD("MHAS","MAXIMUM OCCURRENCES APPLICABLE") Q
Q
EN2 ;
N MHAL S MHAL=$$FIND1^DIC(142.1,"","X","MHA Administration List","B","")
I $G(MHAL)]"" D
. I $$GET1^DIQ(142.1,MHAL,2,"I")="1" D
. . S DIE="142.1",DA=MHAL,DR="2///yes"
. . L +^GMT(142.1,MHAL):$G(DILOCKTM,3) I $T D ^DIE L -^GMT(142.1,MHAL) Q
. . D BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.") D ADD("MHAL","TIME LIMITS APPLICABLE") Q
. I $$GET1^DIQ(142.1,MHAL,4,"I")="1" D
. . S DIE="142.1",DA=MHAL,DR="4///yes"
. . L +^GMT(142.1,MHAL):$G(DILOCKTM,3) I $T D ^DIE L -^GMT(142.1,MHAL) Q
. . D BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.") D ADD("MHAL","MAXIMUM OCCURRENCES APPLICABLE") Q
Q
ADD(COMP,FIELD) ; Add alert info to array
S ^TMP("GMTS",$J,"ALERT")=""
S GMTSALRT(INDEX)=COMP_"^"_FIELD,INDEX=INDEX+1
Q
ALERT ; Send alert to user notifying them that file #142.1 was not updated
N XQA,XQAARCH,XQADATA,XQAFLG,XQAGUID,XQAID,XQAMSG,XQAOPT,XQAROU,XQASUPV,XQASURO,XQATEXT,XTEXT,XQALERR,RESULT,XQATEXT2,I
S I=0 D
. S XQA(DUZ)=""
. S XQAMSG="GMTS*2.7*88 Installation - update to file #142.1 failed."
. S XQATEXT=$C(13)_$C(10)_" The following update(s) failed during the installation of GMTS*2.7*88: "_$C(13)_$C(10)
. F S I=$O(GMTSALRT(I)) Q:'I D
. . S XQATEXT=XQATEXT_$C(13)_$C(10)_$C(9)_"- field "_$P($G(GMTSALRT(I)),"^",2)_" of the "_$P($G(GMTSALRT(I)),"^",1)_" component. "
. S XQATEXT=XQATEXT_$C(13)_$C(10)_$C(13)_$C(10)_" See the post-install section of the patch description for instructions"
. S XQATEXT=XQATEXT_$C(13)_$C(10)_" on how to manually update the file."
. S XQATEXT2=XQATEXT,RESULT=0,RESULT=$$SETUP1^XQALERT I RESULT=0 D BUL
Q
BUL ; MAILMAN MESSAGE
N XMSUB,XMTEXT,XMY,FSMG,GMTSI,DIFROM,COUNTER
S XMY(DUZ,0)="IN",GMTSI=0,COUNTER=0
S XMSUB="!!! GMTS*2.7*88 Installation - update failed !!!"
S FMSG(1)="The following update(s) failed during the installation of GMTS*2.7*88: ",FMSG(2)=""
F S GMTSI=$O(GMTSALRT(GMTSI)) Q:'GMTSI D
. S FMSG(GMTSI+2)=" - field "_$P($G(GMTSALRT(GMTSI)),"^",2)_" of the "_$P($G(GMTSALRT(GMTSI)),"^",1)_" component ",COUNTER=COUNTER+1
S FMSG(COUNTER+3)=""
S FMSG(COUNTER+4)=" See the post-install section of the patch description for instructions on "
S FMSG(COUNTER+5)=" how to manually update the file."
S XMTEXT="FMSG("
D ^XMD K FMSG
Q
END ;
K ^TMP("GMTS",$J,"ALERT"),DA,DIE,DR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMTSP88 3903 printed Dec 13, 2024@01:59:04 Page 2
GMTSP88 ;BP CHY20/RJT - GMTS*2.7*88 POST INIT: ; 2/13/08 1:56pm
+1 ;;2.7;HEALTH SUMMARY;**88**;Oct 20, 1995;Build 23
+2 QUIT
EN ;
+1 NEW GMTSIEN,GMTSHS,GMTSALRT,INDEX
SET INDEX=1
DO BMES^XPDUTL("Updating the Health Summary Component file")
+2 IF +$$VERSION^XPDUTL("GMTS")'="2.7"
DO BMES^XPDUTL("Health Summary version 2.7 not found! Aborting file update...")
QUIT
+3 ;S GMTSHS=$$FIND1^DIC(9.4,"","X","HEALTH SUMMARY","B","") I +GMTSHS=0 D BMES^XPDUTL("Health Summary package not found! Aborting file update...") G END
+4 ;S GMTSIEN=$$FIND1^DIC(9.49,","_GMTSHS_",","X","2.7","B","") I +GMTSIEN=0 D BMES^XPDUTL("Health Summary version 2.7 not found! Aborting file update...") G END
+5 DO EN1
DO EN2
+6 Begin DoDot:1
+7 IF '$DATA(^TMP("GMTS",$JOB,"ALERT"))
DO BMES^XPDUTL("File #142.1 was updated successfully.")
QUIT
+8 DO ALERT
End DoDot:1
+9 GOTO END
+10 QUIT
EN1 ;
+1 NEW MHAS
SET MHAS=$$FIND1^DIC(142.1,"","X","MHA Score","B","")
+2 IF $GET(MHAS)]""
Begin DoDot:1
+3 IF $$GET1^DIQ(142.1,MHAS,2,"I")="1"
Begin DoDot:2
+4 SET DIE="142.1"
SET DA=MHAS
SET DR="2///yes"
+5 LOCK +^GMT(142.1,MHAS):$GET(DILOCKTM,3)
IF $TEST
DO ^DIE
LOCK -^GMT(142.1,MHAS)
QUIT
+6 DO BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.")
DO ADD("MHAS","TIME LIMITS APPLICABLE")
QUIT
End DoDot:2
+7 IF $$GET1^DIQ(142.1,MHAS,4,"I")="1"
Begin DoDot:2
+8 SET DIE="142.1"
SET DA=MHAS
SET DR="4///yes"
+9 LOCK +^GMT(142.1,MHAS):$GET(DILOCKTM,3)
IF $TEST
DO ^DIE
LOCK -^GMT(142.1,MHAS)
QUIT
+10 DO BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.")
DO ADD("MHAS","MAXIMUM OCCURRENCES APPLICABLE")
QUIT
End DoDot:2
End DoDot:1
+11 QUIT
EN2 ;
+1 NEW MHAL
SET MHAL=$$FIND1^DIC(142.1,"","X","MHA Administration List","B","")
+2 IF $GET(MHAL)]""
Begin DoDot:1
+3 IF $$GET1^DIQ(142.1,MHAL,2,"I")="1"
Begin DoDot:2
+4 SET DIE="142.1"
SET DA=MHAL
SET DR="2///yes"
+5 LOCK +^GMT(142.1,MHAL):$GET(DILOCKTM,3)
IF $TEST
DO ^DIE
LOCK -^GMT(142.1,MHAL)
QUIT
+6 DO BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.")
DO ADD("MHAL","TIME LIMITS APPLICABLE")
QUIT
End DoDot:2
+7 IF $$GET1^DIQ(142.1,MHAL,4,"I")="1"
Begin DoDot:2
+8 SET DIE="142.1"
SET DA=MHAL
SET DR="4///yes"
+9 LOCK +^GMT(142.1,MHAL):$GET(DILOCKTM,3)
IF $TEST
DO ^DIE
LOCK -^GMT(142.1,MHAL)
QUIT
+10 DO BMES^XPDUTL("The Health Summary Component file (#142.1) is being edited by another user.")
DO ADD("MHAL","MAXIMUM OCCURRENCES APPLICABLE")
QUIT
End DoDot:2
End DoDot:1
+11 QUIT
ADD(COMP,FIELD) ; Add alert info to array
+1 SET ^TMP("GMTS",$JOB,"ALERT")=""
+2 SET GMTSALRT(INDEX)=COMP_"^"_FIELD
SET INDEX=INDEX+1
+3 QUIT
ALERT ; Send alert to user notifying them that file #142.1 was not updated
+1 NEW XQA,XQAARCH,XQADATA,XQAFLG,XQAGUID,XQAID,XQAMSG,XQAOPT,XQAROU,XQASUPV,XQASURO,XQATEXT,XTEXT,XQALERR,RESULT,XQATEXT2,I
+2 SET I=0
Begin DoDot:1
+3 SET XQA(DUZ)=""
+4 SET XQAMSG="GMTS*2.7*88 Installation - update to file #142.1 failed."
+5 SET XQATEXT=$CHAR(13)_$CHAR(10)_" The following update(s) failed during the installation of GMTS*2.7*88: "_$CHAR(13)_$CHAR(10)
+6 FOR
SET I=$ORDER(GMTSALRT(I))
if 'I
QUIT
Begin DoDot:2
+7 SET XQATEXT=XQATEXT_$CHAR(13)_$CHAR(10)_$CHAR(9)_"- field "_$PIECE($GET(GMTSALRT(I)),"^",2)_" of the "_$PIECE($GET(GMTSALRT(I)),"^",1)_" component. "
End DoDot:2
+8 SET XQATEXT=XQATEXT_$CHAR(13)_$CHAR(10)_$CHAR(13)_$CHAR(10)_" See the post-install section of the patch description for instructions"
+9 SET XQATEXT=XQATEXT_$CHAR(13)_$CHAR(10)_" on how to manually update the file."
+10 SET XQATEXT2=XQATEXT
SET RESULT=0
SET RESULT=$$SETUP1^XQALERT
IF RESULT=0
DO BUL
End DoDot:1
+11 QUIT
BUL ; MAILMAN MESSAGE
+1 NEW XMSUB,XMTEXT,XMY,FSMG,GMTSI,DIFROM,COUNTER
+2 SET XMY(DUZ,0)="IN"
SET GMTSI=0
SET COUNTER=0
+3 SET XMSUB="!!! GMTS*2.7*88 Installation - update failed !!!"
+4 SET FMSG(1)="The following update(s) failed during the installation of GMTS*2.7*88: "
SET FMSG(2)=""
+5 FOR
SET GMTSI=$ORDER(GMTSALRT(GMTSI))
if 'GMTSI
QUIT
Begin DoDot:1
+6 SET FMSG(GMTSI+2)=" - field "_$PIECE($GET(GMTSALRT(GMTSI)),"^",2)_" of the "_$PIECE($GET(GMTSALRT(GMTSI)),"^",1)_" component "
SET COUNTER=COUNTER+1
End DoDot:1
+7 SET FMSG(COUNTER+3)=""
+8 SET FMSG(COUNTER+4)=" See the post-install section of the patch description for instructions on "
+9 SET FMSG(COUNTER+5)=" how to manually update the file."
+10 SET XMTEXT="FMSG("
+11 DO ^XMD
KILL FMSG
+12 QUIT
END ;
+1 KILL ^TMP("GMTS",$JOB,"ALERT"),DA,DIE,DR
+2 QUIT