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

DVBA2833.m

Go to the documentation of this file.
  1. DVBA2833 ;ALB/KCL - PATCH DVBA*2.7*133 INSTALL UTILITIES ; 7/22/08
  1. ;;2.7;AMIE;**133**;Apr 10, 1995;Build 35
  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="133F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="133"
  1. ;
  1. W !!!,"**** PRE-INSTALL PROCESSING ****",!
  1. W !,"Disabling templates...",!!
  1. ;
  1. D DISABLE("GENERAL MEDICAL EXAMINATION")
  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="133F"
  1. ;what the final template version should be once the template is
  1. ;loaded by the patch on the target system
  1. S DVBVERSN="133"
  1. ;
  1. W !!!,"**** POST-INSTALL PROCESSING ****",!
  1. W !,"Activating templates...",!!
  1. ;
  1. D POSTP("GENERAL MEDICAL EXAMINATION")
  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