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

DVBA2824.m

Go to the documentation of this file.
  1. DVBA2824 ;ALB/KCL - PATCH DVBA*2.7*124 INSTALL UTILITIES ; 5/1/08
  1. ;;2.7;AMIE;**124**;Apr 10, 1995;Build 56
  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
  1. ;
  1. ;what the template version will be in the incoming patch
  1. ;(version pulled from export account)
  1. S DVBVERSS="124F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="124"
  1. ;
  1. W !!!,"**** PRE-INSTALL PROCESSING ****",!
  1. W !,"Disabling templates...",!!
  1. ;
  1. D DISABLE("ACROMEGALY")
  1. D DISABLE("AID AND ATTENDANCE OR HOUSEBOUND EXAMINATION")
  1. D DISABLE("AMPUTATION") ;this template is being de-activated
  1. D DISABLE("ARRHYTHMIAS")
  1. D DISABLE("ARTERIES, VEINS AND MISCELLANEOUS")
  1. D DISABLE("AUDIO")
  1. D DISABLE("BONES (FRACTURES AND BONE DISEASE)")
  1. D DISABLE("BRAIN AND SPINAL CORD")
  1. D DISABLE("CHRONIC FATIGUE SYNDROME")
  1. D DISABLE("COLD INJURY PROTOCOL EXAMINATION")
  1. D DISABLE("CRANIAL NERVES")
  1. D DISABLE("CUSHINGS SYNDROME")
  1. D DISABLE("DENTAL AND ORAL")
  1. D DISABLE("DIABETES MELLITUS")
  1. D DISABLE("DIGESTIVE CONDITIONS, MISCELLANEOUS")
  1. D DISABLE("EAR DISEASE")
  1. D DISABLE("EATING DISORDERS")
  1. D DISABLE("ENDOCRINE, MISCELLANEOUS")
  1. D DISABLE("EPILEPSY AND NARCOLEPSY")
  1. D DISABLE("ESOPHAGUS AND HIATAL HERNIA")
  1. D DISABLE("EYE EXAMINATION")
  1. D DISABLE("FEET")
  1. D DISABLE("FIBROMYALGIA")
  1. D DISABLE("GENERAL MEDICAL EXAMINATION")
  1. D DISABLE("GENITOURINARY EXAMINATION")
  1. D DISABLE("GULF WAR GUIDELINES")
  1. D DISABLE("GYNECOLOGICAL CONDITIONS AND DISORDERS OF THE BREAST")
  1. D DISABLE("HAND, THUMB, AND FINGERS")
  1. D DISABLE("HEART")
  1. D DISABLE("HEMIC DISORDERS")
  1. D DISABLE("HIV-RELATED ILLNESS")
  1. D DISABLE("HYPERTENSION")
  1. D DISABLE("INFECTIOUS, IMMUNE, AND NUTRITIONAL DISABILITIES")
  1. D DISABLE("INITIAL EVALUATION FOR POST-TRAUMATIC STRESS DISORDER (PTSD)")
  1. D DISABLE("INTESTINES (LARGE AND SMALL)")
  1. D DISABLE("JOINTS")
  1. D DISABLE("LIVER, GALL BLADDER, AND PANCREAS")
  1. D DISABLE("LYMPHATIC DISORDERS")
  1. D DISABLE("MEDICAL OPINION")
  1. D DISABLE("MENTAL DISORDERS (EXCEPT PTSD AND EATING DISORDERS)")
  1. D DISABLE("MOUTH, LIPS AND TONGUE")
  1. D DISABLE("MUSCLES")
  1. D DISABLE("NEUROLOGICAL DISORDERS, MISCELLANEOUS")
  1. D DISABLE("NOSE, SINUS, LARYNX, AND PHARYNX")
  1. D DISABLE("PERIPHERAL NERVES")
  1. D DISABLE("PRISONER OF WAR PROTOCOL EXAMINATION")
  1. D DISABLE("PULMONARY TUBERCULOSIS AND MYCOBACTERIAL DISEASES")
  1. D DISABLE("RECTUM AND ANUS")
  1. D DISABLE("RESIDUALS OF AMPUTATIONS")
  1. D DISABLE("RESPIRATORY (OBSTRUCTIVE, RESTRICTIVE, AND INTERSTITIAL)")
  1. D DISABLE("RESPIRATORY DISEASES, MISCELLANEOUS")
  1. D DISABLE("REVIEW EXAMINATION FOR POST-TRAUMATIC STRESS DISORDER (PTSD)")
  1. D DISABLE("SCARS")
  1. D DISABLE("SENSE OF SMELL AND TASTE")
  1. D DISABLE("SKIN DISEASES (OTHER THAN SCARS)")
  1. D DISABLE("SOCIAL AND INDUSTRIAL SURVEY")
  1. D DISABLE("SPINE")
  1. D DISABLE("STOMACH, DUODENUM AND PERITONEAL ADHESIONS")
  1. D DISABLE("THYROID AND PARATHYROID DISEASES")
  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
  1. ;
  1. ;what the template version will be in the incoming patch
  1. ;(version pulled from export account)
  1. S DVBVERSS="124F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="124"
  1. ;
  1. W !!!,"**** POST-INSTALL PROCESSING ****",!
  1. W !,"Activating templates...",!!
  1. ;
  1. D POSTP("ACROMEGALY")
  1. D POSTP("AID AND ATTENDANCE OR HOUSEBOUND EXAMINATION")
  1. D POSTP("ARRHYTHMIAS")
  1. D POSTP("ARTERIES, VEINS AND MISCELLANEOUS")
  1. D POSTP("AUDIO")
  1. D POSTP("BONES (FRACTURES AND BONE DISEASE)")
  1. D POSTP("BRAIN AND SPINAL CORD")
  1. D POSTP("CHRONIC FATIGUE SYNDROME")
  1. D POSTP("COLD INJURY PROTOCOL EXAMINATION")
  1. D POSTP("CRANIAL NERVES")
  1. D POSTP("CUSHINGS SYNDROME")
  1. D POSTP("DENTAL AND ORAL")
  1. D POSTP("DIABETES MELLITUS")
  1. D POSTP("DIGESTIVE CONDITIONS, MISCELLANEOUS")
  1. D POSTP("EAR DISEASE")
  1. D POSTP("EATING DISORDERS")
  1. D POSTP("ENDOCRINE, MISCELLANEOUS")
  1. D POSTP("EPILEPSY AND NARCOLEPSY")
  1. D POSTP("ESOPHAGUS AND HIATAL HERNIA")
  1. D POSTP("EYE EXAMINATION")
  1. D POSTP("FEET")
  1. D POSTP("FIBROMYALGIA")
  1. D POSTP("GENERAL MEDICAL EXAMINATION")
  1. D POSTP("GENITOURINARY EXAMINATION")
  1. D POSTP("GULF WAR GUIDELINES")
  1. D POSTP("GYNECOLOGICAL CONDITIONS AND DISORDERS OF THE BREAST")
  1. D POSTP("HAND, THUMB, AND FINGERS")
  1. D POSTP("HEART")
  1. D POSTP("HEMIC DISORDERS")
  1. D POSTP("HIV-RELATED ILLNESS")
  1. D POSTP("HYPERTENSION")
  1. D POSTP("INFECTIOUS, IMMUNE, AND NUTRITIONAL DISABILITIES")
  1. D POSTP("INITIAL EVALUATION FOR POST-TRAUMATIC STRESS DISORDER (PTSD)")
  1. D POSTP("INTESTINES (LARGE AND SMALL)")
  1. D POSTP("JOINTS")
  1. D POSTP("LIVER, GALL BLADDER, AND PANCREAS")
  1. D POSTP("LYMPHATIC DISORDERS")
  1. D POSTP("MEDICAL OPINION")
  1. D POSTP("MENTAL DISORDERS (EXCEPT PTSD AND EATING DISORDERS)")
  1. D POSTP("MOUTH, LIPS AND TONGUE")
  1. D POSTP("MUSCLES")
  1. D POSTP("NEUROLOGICAL DISORDERS, MISCELLANEOUS")
  1. D POSTP("NOSE, SINUS, LARYNX, AND PHARYNX")
  1. D POSTP("PERIPHERAL NERVES")
  1. D POSTP("PRISONER OF WAR PROTOCOL EXAMINATION")
  1. D POSTP("PULMONARY TUBERCULOSIS AND MYCOBACTERIAL DISEASES")
  1. D POSTP("RECTUM AND ANUS")
  1. D POSTP("RESIDUALS OF AMPUTATIONS")
  1. D POSTP("RESPIRATORY (OBSTRUCTIVE, RESTRICTIVE, AND INTERSTITIAL)")
  1. D POSTP("RESPIRATORY DISEASES, MISCELLANEOUS")
  1. D POSTP("REVIEW EXAMINATION FOR POST-TRAUMATIC STRESS DISORDER (PTSD)")
  1. D POSTP("SCARS")
  1. D POSTP("SENSE OF SMELL AND TASTE")
  1. D POSTP("SKIN DISEASES (OTHER THAN SCARS)")
  1. D POSTP("SOCIAL AND INDUSTRIAL SURVEY")
  1. D POSTP("SPINE")
  1. D POSTP("STOMACH, DUODENUM AND PERITONEAL ADHESIONS")
  1. D POSTP("THYROID AND PARATHYROID DISEASES")
  1. ;
  1. ;re-build cross references
  1. D RBXREF
  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~124F) to it's
  1. ;new name/version (i.e. ACROMEGALY~124T6).
  1. ;
  1. N DVBABIEN,DVBABIE2 ;ien of CAPRI TEMPLATE DEFINITIONS file
  1. N DVBABST ;template NAME field (i.e. ACROMEGALY~124F)
  1. N DVBABS2 ;template NAME field (i.e. ACROMEGALY~124T6)
  1. N DVBACH ;flag to indicate if template version is found or not
  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 (~124F)
  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. ...W "Found existing "_NM_". No modifications made.",!
  1. ...K ^DVB(396.18,DVBABIEN)
  1. ..;otherwise, if new version isn't found, rename imported template
  1. ..;name to the new version name (i.e. ACROMEGALY~124F --> ACROMEGALY~124t6)
  1. ..I DVBACH=0 D
  1. ...S $P(^DVB(396.18,DVBABIEN,0),"^",1)=NM_"~"_DVBVERSN
  1. ...W "Activated: "_$P($G(^DVB(396.18,DVBABIEN,0)),"^",1),!
  1. ;
  1. K DVBABIEN,DVBABST,DVBACH
  1. Q
  1. ;
  1. RBXREF ;Rebuild cross-references in (#396.18) file.
  1. ;
  1. W !!,"Cleaning up files and rebuilding 2 cross-references.",!,"This may take a few minutes.",!
  1. ;
  1. ;XRef: B
  1. W !!,"Rebuilding 'B' x-ref, CAPRI TEMPLATE DEFINITIONS file",!
  1. N DA,DIK,REGIEN,ROOT
  1. S ROOT=$$ROOT^DILFD(396.18,,1) K @ROOT@("B")
  1. S REGIEN=0
  1. F S REGIEN=$O(@ROOT@(REGIEN)) Q:'REGIEN D
  1. . S DIK=$$ROOT^DILFD(396.18,","_REGIEN_","),DIK(1)=".01^B"
  1. . S DA(1)=REGIEN D ENALL^DIK
  1. ;
  1. ;XRef: AV
  1. W !!,"Rebuilding 'AV' x-ref, CAPRI TEMPLATE DEFINITIONS file",!
  1. N DA,DIK,REGIEN,ROOT
  1. S ROOT=$$ROOT^DILFD(396.18,,1) K @ROOT@("AV")
  1. S REGIEN=0
  1. F S REGIEN=$O(@ROOT@(REGIEN)) Q:'REGIEN D
  1. . S DIK=$$ROOT^DILFD(396.18,","_REGIEN_","),DIK(1)=".01^AV"
  1. . S DA(1)=REGIEN D ENALL^DIK
  1. ;
  1. K DA,DIK,REGIEN,ROOT
  1. Q
  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. ~124T5) does not match the version suffix that will be used
  1. ;for templates loaded by the patch on the target system (i.e. ~124T6).
  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~124T5)
  1. N DVBACH ;flag used to indicate template was disabled
  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 field off
  1. ..I $P(^DVB(396.18,DVBABIEN,6),"^",1)'="0" S $P(^DVB(396.18,DVBABIEN,6),"^",1)="0",DVBACH=1
  1. ..;set DE-ACTIVATION DATE field to TODAY
  1. ..I $P(^DVB(396.18,DVBABIEN,2),"^",2)="" S $P(^DVB(396.18,DVBABIEN,2),"^",2)=DT,DVBACH=1
  1. ..;output list of disabled templates
  1. ..I DVBACH=1 W "Disabled: "_DVBABST,!
  1. ;
  1. K DVBABIEN,DVBABST,DVBACH
  1. Q