Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DVBA151P

DVBA151P.m

Go to the documentation of this file.
  1. DVBA151P ;ALB/KCL - PATCH DVBA*2.7*151 INSTALL UTILITIES; 4/19/2010
  1. ;;2.7;AMIE;**151**;Apr 10, 1995;Build 14
  1. ;
  1. PRE ;Pre-install entry point.
  1. ;
  1. ;Used to disable older versions of a template for those templates being
  1. ;exported with the patch.
  1. ; - Make sure to call the DISABLE procedure for each template name
  1. ; being exported in the patch.
  1. ; - This must be called as a pre-init or else it will disable the
  1. ; templates that are being loaded by the patch.
  1. ;
  1. N DVBVERSS,DVBVERSN,DVBACTR
  1. ;
  1. ;what the template version will be in the incoming patch
  1. ;(version pulled from export account)
  1. S DVBVERSS="151F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="151"
  1. S DVBACTR=0
  1. ;
  1. D BMES^XPDUTL("**** PRE-INSTALL PROCESSING ****")
  1. D BMES^XPDUTL("Disabling templates...")
  1. D MES^XPDUTL(" ")
  1. ;
  1. D DISABLE("AID AND ATTENDANCE OR HOUSEBOUND EXAMINATION")
  1. D DISABLE("BLANK TEMPLATE")
  1. D DISABLE("BRAIN AND SPINAL CORD")
  1. D DISABLE("COLD INJURY PROTOCOL EXAMINATION")
  1. D DISABLE("CUSHINGS SYNDROME")
  1. D DISABLE("DIABETES MELLITUS")
  1. D DISABLE("EPILEPSY AND NARCOLEPSY")
  1. D DISABLE("EYE EXAMINATION")
  1. D DISABLE("GENERAL MEDICAL EXAMINATION")
  1. D DISABLE("GULF WAR GUIDELINES")
  1. D DISABLE("HYPERTENSION")
  1. D DISABLE("NEUROLOGICAL DISORDERS, MISCELLANEOUS")
  1. D DISABLE("PERIPHERAL NERVES")
  1. D DISABLE("PRISONER OF WAR PROTOCOL EXAMINATION")
  1. D DISABLE("SOCIAL AND INDUSTRIAL SURVEY")
  1. D DISABLE("SPINE")
  1. D DISABLE("TRAUMATIC BRAIN INJURY")
  1. ;
  1. D BMES^XPDUTL(" Number of templates disabled: "_DVBACTR)
  1. Q
  1. ;
  1. POST ;Post-install entry point.
  1. ;
  1. ;Used to rename templates that were loaded by the patch.
  1. ; - Make sure to call POSTP procedure for each template
  1. ; name being loaded by the patch.
  1. ; - Must be called as a post-init in order to rename those
  1. ; templates being loaded by the patch.
  1. ;
  1. N DVBVERSS,DVBVERSN,DVBACTR
  1. ;
  1. ;what the template version will be in the incoming patch
  1. ;(version pulled from export account)
  1. S DVBVERSS="151F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="151"
  1. S DVBACTR=0
  1. ;
  1. D BMES^XPDUTL("**** POST-INSTALL PROCESSING ****")
  1. D BMES^XPDUTL("Activating templates...")
  1. D MES^XPDUTL(" ")
  1. ;
  1. D POSTP("AID AND ATTENDANCE OR HOUSEBOUND EXAMINATION")
  1. D POSTP("BLANK TEMPLATE")
  1. D POSTP("BRAIN AND SPINAL CORD")
  1. D POSTP("COLD INJURY PROTOCOL EXAMINATION")
  1. D POSTP("CUSHINGS SYNDROME")
  1. D POSTP("DIABETES MELLITUS")
  1. D POSTP("EPILEPSY AND NARCOLEPSY")
  1. D POSTP("EYE EXAMINATION")
  1. D POSTP("GENERAL MEDICAL EXAMINATION")
  1. D POSTP("GULF WAR GUIDELINES")
  1. D POSTP("HYPERTENSION")
  1. D POSTP("NEUROLOGICAL DISORDERS, MISCELLANEOUS")
  1. D POSTP("PERIPHERAL NERVES")
  1. D POSTP("PRISONER OF WAR PROTOCOL EXAMINATION")
  1. D POSTP("SOCIAL AND INDUSTRIAL SURVEY")
  1. D POSTP("SPINE")
  1. D POSTP("TRAUMATIC BRAIN INJURY")
  1. ;
  1. D BMES^XPDUTL(" Number of templates activated: "_DVBACTR)
  1. Q
  1. ;
  1. POSTP(NM) ;Rename templates loaded by the patch.
  1. ;
  1. ;This procedure is used to lookup and rename a template in the
  1. ;CAPRI TEMPLATE DEFINITIONS (#396.18) file. This is done to rename
  1. ;the imported version of a template (i.e. ACROMEGALY~142F) to it's
  1. ;new name/version (i.e. ACROMEGALY~142T1).
  1. ;
  1. N DVBABIEN,DVBABIE2 ;ien of CAPRI TEMPLATE DEFINITIONS file
  1. N DVBABST ;template NAME field (i.e. ACROMEGALY~151F)
  1. N DVBABS2 ;template NAME field (i.e. ACROMEGALY~151T1)
  1. N DVBACH ;flag to indicate if template version is found or not
  1. N DVBAFDA ;FDA array for FILE^DIE
  1. N DVBAERR ;Error array for FILE^DIE
  1. N DVBAMSG,DVBAMSG1 ;Used to write message to installer/Install file entry
  1. N DVBAADT ;Template activation date
  1. ;
  1. S DVBABIEN=0
  1. ;
  1. ;main loop-walk through CAPRI TEMPLATE DEFINITIONS file entries
  1. F S DVBABIEN=$O(^DVB(396.18,DVBABIEN)) Q:'DVBABIEN D
  1. .S DVBABST=$P($G(^DVB(396.18,DVBABIEN,0)),"^",1) ;template name
  1. .;look for template versions just loaded by the patch (~151F)
  1. .I $P(DVBABST,"~",1)=NM I $P(DVBABST,"~",2)=DVBVERSS D
  1. ..S DVBABIE2=0,DVBACH=0
  1. ..;secondary loop-walk through CAPRI TEMPLATE DEFINITIONS file entries
  1. ..F S DVBABIE2=$O(^DVB(396.18,DVBABIE2)) Q:'DVBABIE2 D
  1. ...S DVBABS2=$P($G(^DVB(396.18,DVBABIE2,0)),"^",1) ;template name
  1. ...;if new version of template already exists in file, set flag
  1. ...I $P(DVBABS2,"~",1)=NM I $P(DVBABS2,"~",2)=DVBVERSN S DVBACH=1
  1. ..;if new version already exists, delete the imported version (abort rename)
  1. ..I DVBACH=1 D
  1. ...S DVBAMSG=" Found existing "_NM_". No modifications made."
  1. ...S DVBAFDA(396.18,DVBABIEN_",",.01)="@"
  1. ...D FILE^DIE("","DVBAFDA","DVBAERR")
  1. ..;otherwise, if new version isn't found, rename imported template
  1. ..;name to the new version name (i.e. ACROMEGALY~151F --> ACROMEGALY~151T1)
  1. ..I DVBACH=0 D
  1. ...S DVBAADT=$P($G(^DVB(396.18,DVBABIEN,2)),"^")
  1. ...S DVBACTR=DVBACTR+1
  1. ...S DVBAFDA(396.18,DVBABIEN_",",.01)=NM_"~"_DVBVERSN
  1. ...I DVBAADT=""!(DVBAADT<DT) S DVBAFDA(396.18,DVBABIEN_",",2)=DT
  1. ...D FILE^DIE("","DVBAFDA","DVBAERR")
  1. ...S DVBAMSG=" Activating: "_$P($G(^DVB(396.18,DVBABIEN,0)),"^",1)
  1. ..D MES^XPDUTL(DVBAMSG)
  1. ..I $D(DVBAERR) D
  1. ...D MSG^DIALOG("AE",.DVBAMSG1,"","","DVBAERR")
  1. ...D MES^XPDUTL(.DVBAMSG1)
  1. ;
  1. K DVBABIEN,DVBABST,DVBACH
  1. Q
  1. ;
  1. ;
  1. DISABLE(NM) ;Disable matching exam template entries.
  1. ;
  1. ;This procedure will find each entry in the CAPRI TEMPLATE DEFINITIONS
  1. ;(#396.18) file that matches the name (NM) of the template being exported.
  1. ;Once a matching entry is found, it will be disabled if the version
  1. ;suffix (i.e. ~139) does not match the version suffix that will be used
  1. ;for templates loaded by the patch on the target system (i.e. ~151T1).
  1. ;
  1. ;An entry will be disabled by doing the following:
  1. ; - Turning off the SELECTABLE BY USER? field. This will keep the entry
  1. ; from showing in the CAPRI GUI template list.
  1. ; - Looking at DE-ACTIVATION DATE field. If there's no date, set it to today.
  1. ;
  1. N DVBABIEN ;ien of CAPRI TEMPLATE DEFINITIONS file
  1. N DVBABST ;template NAME field (i.e. ACROMEGALY~151T1)
  1. N DVBACH ;flag used to indicate template was disabled
  1. N DVBAFDA ;FDA array for FILE^DIE
  1. N DVBAERR ;Error array for FILE^DIE
  1. N DVBAMSG1 ;Used to write message to installer/Install file entry
  1. ;
  1. S DVBABIEN=0
  1. ;
  1. ;walk through CAPRI TEMPLATE DEFINITIONS file entries
  1. F S DVBABIEN=$O(^DVB(396.18,DVBABIEN)) Q:'DVBABIEN D
  1. .S DVBABST=$P($G(^DVB(396.18,DVBABIEN,0)),"^",1) ;template name
  1. .;if name matches and version is different, then disable entry
  1. .I $P(DVBABST,"~",1)=NM I $P(DVBABST,"~",2)'=DVBVERSN D
  1. ..S DVBACH=0
  1. ..;turn SELECTABLE BY USER (#7) field off
  1. ..I $P($G(^DVB(396.18,DVBABIEN,6)),"^",1)'="0" S DVBAFDA(396.18,DVBABIEN_",",7)="0",DVBACH=1
  1. ..;set DE-ACTIVATION DATE (#3) field to TODAY
  1. ..I $P($G(^DVB(396.18,DVBABIEN,2)),"^",2)="" S DVBAFDA(396.18,DVBABIEN_",",3)=DT,DVBACH=1
  1. ..;output list of disabled templates
  1. ..I DVBACH=1 D
  1. ...S DVBACTR=DVBACTR+1
  1. ...D FILE^DIE("","DVBAFDA","DVBAERR")
  1. ...D MES^XPDUTL(" Disabling: "_DVBABST)
  1. ...I $D(DVBAERR) D
  1. ....D MSG^DIALOG("AE",.DVBAMSG1,"","","DVBAERR")
  1. ....D MES^XPDUTL(.DVBAMSG1)
  1. ;
  1. K DVBABIEN,DVBABST,DVBACH
  1. Q