- DVBA215P ;ALB/JDG - DVBA C PURGE OFF;6/20/2019
- ;;2.7;AMIE;**215**;Oct 20, 2000;Build 4
- ;
- ; Call to RTN^%ZTLOAD supported by ICR #10063
- ; Call to DQ^%ZTLOAD supported by ICR #10063
- ; Call to KILL^%ZTLOAD supported by ICR #10063
- ; Call to OWNSKEY^XUSRB supported by ICR #3277
- ; Call to BMES^XPDUTL supported by ICR #10141
- ;
- Q
- ;
- EN ; entry point for post install routine
- D TASKOFF
- D BADXRFDL
- Q
- ;
- TASKOFF ;unschedules and deletes DVBA C PURGE 2507 tasks
- N DVBOPTN,DVBLIST,DVBKEY,DVBRET,ZTSK
- S DVBKEY="ZTMQ" D OWNSKEY^XUSRB(.DVBRET,DVBKEY) I '$G(DVBRET(0)) D BMES^XPDUTL("The Installer MUST be assigned Security Key 'ZTMQ'.") D Q
- .D BMES^XPDUTL("Please add the key to yourself using Allocation of Security Keys [ORLEASE] menu option.")
- .D BMES^XPDUTL("Then, either re-install this patch, or re-run this post install routine from the command prompt.")
- S DVBOPTN="DVBA C PURGE 2507",DVBLIST="^TMP(""DVBLIST"",$J)"
- D OPTION^%ZTLOAD(DVBOPTN,DVBLIST)
- I '$O(^TMP("DVBLIST",$J,0)) D BMES^XPDUTL("No DVBA C PURGE 2507 tasks found.") Q
- S ZTSK=0 F S ZTSK=$O(^TMP("DVBLIST",$J,ZTSK)) Q:'ZTSK D
- .D DQ^%ZTLOAD I $G(ZTSK(0)) D BMES^XPDUTL("Task number "_ZTSK_" has been successfully un-scheduled.")
- .I '$G(ZTSK(0)) D BMES^XPDUTL("Task number "_ZTSK_" could not be un-scheduled. Please use Taskman Management [XUTM MGR] to un-schedule the task.")
- .D KILL^%ZTLOAD I $G(ZTSK(0)) D BMES^XPDUTL("Task number "_ZTSK_" has been successfully deleted.")
- .I '$G(ZTSK(0)) D BMES^XPDUTL("Task number "_ZTSK_" could not be deleted. Please use Taskman Management [XUTM MGR] to delete the task.")
- Q
- ;
- BADXRFDL ;removal of bad AH x-ref
- N DVBCNT,DVBDTE,DVBIEN
- D BMES^XPDUTL("Searching for corrupt entries within the DATE STATUS LAST CHANGED (AH)")
- D BMES^XPDUTL("cross-reference of the 2507 REQUEST (#396.3) file...")
- S DVBCNT=0
- S DVBDTE=0 F S DVBDTE=$O(^DVB(396.3,"AH",DVBDTE)) Q:'DVBDTE D
- .S DVBIEN=0 F S DVBIEN=$O(^DVB(396.3,"AH",DVBDTE,DVBIEN)) Q:'DVBIEN D
- ..I '$D(^DVB(396.3,DVBIEN,0)) S DVBCNT=DVBCNT+1 K ^DVB(396.3,"AH",DVBDTE,DVBIEN)
- I DVBCNT=0 D BMES^XPDUTL("There were no corrupt entries found in the 2507 REQUEST (#396.3) file.") Q
- D BMES^XPDUTL(DVBCNT_" corrupt entries have been removed from the 2507 REQUEST (#396.3) file.")
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBA215P 2293 printed Jan 18, 2025@02:40:45 Page 2
- DVBA215P ;ALB/JDG - DVBA C PURGE OFF;6/20/2019
- +1 ;;2.7;AMIE;**215**;Oct 20, 2000;Build 4
- +2 ;
- +3 ; Call to RTN^%ZTLOAD supported by ICR #10063
- +4 ; Call to DQ^%ZTLOAD supported by ICR #10063
- +5 ; Call to KILL^%ZTLOAD supported by ICR #10063
- +6 ; Call to OWNSKEY^XUSRB supported by ICR #3277
- +7 ; Call to BMES^XPDUTL supported by ICR #10141
- +8 ;
- +9 QUIT
- +10 ;
- EN ; entry point for post install routine
- +1 DO TASKOFF
- +2 DO BADXRFDL
- +3 QUIT
- +4 ;
- TASKOFF ;unschedules and deletes DVBA C PURGE 2507 tasks
- +1 NEW DVBOPTN,DVBLIST,DVBKEY,DVBRET,ZTSK
- +2 SET DVBKEY="ZTMQ"
- DO OWNSKEY^XUSRB(.DVBRET,DVBKEY)
- IF '$GET(DVBRET(0))
- DO BMES^XPDUTL("The Installer MUST be assigned Security Key 'ZTMQ'.")
- Begin DoDot:1
- +3 DO BMES^XPDUTL("Please add the key to yourself using Allocation of Security Keys [ORLEASE] menu option.")
- +4 DO BMES^XPDUTL("Then, either re-install this patch, or re-run this post install routine from the command prompt.")
- End DoDot:1
- QUIT
- +5 SET DVBOPTN="DVBA C PURGE 2507"
- SET DVBLIST="^TMP(""DVBLIST"",$J)"
- +6 DO OPTION^%ZTLOAD(DVBOPTN,DVBLIST)
- +7 IF '$ORDER(^TMP("DVBLIST",$JOB,0))
- DO BMES^XPDUTL("No DVBA C PURGE 2507 tasks found.")
- QUIT
- +8 SET ZTSK=0
- FOR
- SET ZTSK=$ORDER(^TMP("DVBLIST",$JOB,ZTSK))
- if 'ZTSK
- QUIT
- Begin DoDot:1
- +9 DO DQ^%ZTLOAD
- IF $GET(ZTSK(0))
- DO BMES^XPDUTL("Task number "_ZTSK_" has been successfully un-scheduled.")
- +10 IF '$GET(ZTSK(0))
- DO BMES^XPDUTL("Task number "_ZTSK_" could not be un-scheduled. Please use Taskman Management [XUTM MGR] to un-schedule the task.")
- +11 DO KILL^%ZTLOAD
- IF $GET(ZTSK(0))
- DO BMES^XPDUTL("Task number "_ZTSK_" has been successfully deleted.")
- +12 IF '$GET(ZTSK(0))
- DO BMES^XPDUTL("Task number "_ZTSK_" could not be deleted. Please use Taskman Management [XUTM MGR] to delete the task.")
- End DoDot:1
- +13 QUIT
- +14 ;
- BADXRFDL ;removal of bad AH x-ref
- +1 NEW DVBCNT,DVBDTE,DVBIEN
- +2 DO BMES^XPDUTL("Searching for corrupt entries within the DATE STATUS LAST CHANGED (AH)")
- +3 DO BMES^XPDUTL("cross-reference of the 2507 REQUEST (#396.3) file...")
- +4 SET DVBCNT=0
- +5 SET DVBDTE=0
- FOR
- SET DVBDTE=$ORDER(^DVB(396.3,"AH",DVBDTE))
- if 'DVBDTE
- QUIT
- Begin DoDot:1
- +6 SET DVBIEN=0
- FOR
- SET DVBIEN=$ORDER(^DVB(396.3,"AH",DVBDTE,DVBIEN))
- if 'DVBIEN
- QUIT
- Begin DoDot:2
- +7 IF '$DATA(^DVB(396.3,DVBIEN,0))
- SET DVBCNT=DVBCNT+1
- KILL ^DVB(396.3,"AH",DVBDTE,DVBIEN)
- End DoDot:2
- End DoDot:1
- +8 IF DVBCNT=0
- DO BMES^XPDUTL("There were no corrupt entries found in the 2507 REQUEST (#396.3) file.")
- QUIT
- +9 DO BMES^XPDUTL(DVBCNT_" corrupt entries have been removed from the 2507 REQUEST (#396.3) file.")
- +10 QUIT