| [613] | 1 | DVBA2829        ;ALB/KCL - PATCH DVBA*2.7*129 INSTALL UTILITIES ; 1/25/08
 | 
|---|
 | 2 |         ;;2.7;AMIE;**129**;Apr 10, 1995;Build 31
 | 
|---|
 | 3 |         ;
 | 
|---|
 | 4 |         ; Pre/Post install routine for patch DVBA*2.7*129.
 | 
|---|
 | 5 |         ;
 | 
|---|
 | 6 |         ; Make sure to call each exam name being exported in the patch.
 | 
|---|
 | 7 |         ; This routine will find existing matching entries and ensure
 | 
|---|
 | 8 |         ; they are disabled. Call as a pre-init or else it will disable
 | 
|---|
 | 9 |         ; the exams just loaded.
 | 
|---|
 | 10 |         ; 
 | 
|---|
 | 11 | PRE     ;Main entry point for Pre-init items.
 | 
|---|
 | 12 |         N DVBVERSS,DVBVERSN
 | 
|---|
 | 13 |         S DVBVERSS="129F"  ;what the version will be in the incoming file
 | 
|---|
 | 14 |         S DVBVERSN="129"   ;what the final version should be named
 | 
|---|
 | 15 |         W !!!,"**** PRE-INSTALL PROCESSING ****",!!
 | 
|---|
 | 16 |         D DISABLE("TRAUMATIC BRAIN INJURY")
 | 
|---|
 | 17 |         Q
 | 
|---|
 | 18 |         ;
 | 
|---|
 | 19 | POST    ;Main entry point for Post-init items.
 | 
|---|
 | 20 |         N DVBVERSS,DVBVERSN
 | 
|---|
 | 21 |         S DVBVERSS="129F"  ;what the version will be in the incoming file
 | 
|---|
 | 22 |         S DVBVERSN="129"   ;what the final version should be named
 | 
|---|
 | 23 |         W !!!,"**** POST-INSTALL PROCESSING ****",!!
 | 
|---|
 | 24 |         D POSTP("TRAUMATIC BRAIN INJURY")
 | 
|---|
 | 25 |         D RBXREF
 | 
|---|
 | 26 |         Q
 | 
|---|
 | 27 |         ;
 | 
|---|
 | 28 | POSTP(NM)       ;Rename XXXXXXX~imported version to XXXXXXX~new version.
 | 
|---|
 | 29 |         N DVBABCNT,DVBABIEN,DVBABST,DVBACH,DVBABCN2,DVBABIE2,DVBABS2
 | 
|---|
 | 30 |         S DVBABCNT=0,DVBABIEN=0
 | 
|---|
 | 31 |         F  S DVBABIEN=$O(^DVB(396.18,DVBABIEN)) Q:'DVBABIEN  D
 | 
|---|
 | 32 |         .S DVBABST=$P($G(^DVB(396.18,DVBABIEN,0)),"^",1)
 | 
|---|
 | 33 |         .I $P(DVBABST,"~",1)=NM  I $P(DVBABST,"~",2)=DVBVERSS  D
 | 
|---|
 | 34 |         ..;Check and be sure the new version isn't in the file yet
 | 
|---|
 | 35 |         ..S DVBABCN2=0,DVBABIE2=0,DVBACH=0
 | 
|---|
 | 36 |         ..F  S DVBABIE2=$O(^DVB(396.18,DVBABIE2)) Q:'DVBABIE2  D
 | 
|---|
 | 37 |         ...S DVBABS2=$P($G(^DVB(396.18,DVBABIE2,0)),"^",1)
 | 
|---|
 | 38 |         ...I $P(DVBABS2,"~",1)=NM  I $P(DVBABS2,"~",2)=DVBVERSN  S DVBACH=1
 | 
|---|
 | 39 |         ..;If new version is found, delete the import version and don't import
 | 
|---|
 | 40 |         ..I DVBACH=1  D
 | 
|---|
 | 41 |         ...W "FOUND EXISTING "_NM_".  NO MODIFICATIONS MADE.",!
 | 
|---|
 | 42 |         ...K ^DVB(396.18,DVBABIEN)
 | 
|---|
 | 43 |         ..;If existing version isn't found, go ahead and rename imported entry to new version name
 | 
|---|
 | 44 |         ..I DVBACH=0  D
 | 
|---|
 | 45 |         ...S $P(^DVB(396.18,DVBABIEN,0),"^",1)=NM_"~"_DVBVERSN
 | 
|---|
 | 46 |         ...W "ACTIVATED: "_$P($G(^DVB(396.18,DVBABIEN,0)),"^",1),!
 | 
|---|
 | 47 |         K DVBABCNT,DVBABIEN,DVBABST,DVBACH
 | 
|---|
 | 48 |         Q
 | 
|---|
 | 49 |         ;
 | 
|---|
 | 50 | RBXREF  ;Rebuild cross-references.
 | 
|---|
 | 51 |         ;
 | 
|---|
 | 52 |         ;XRef: B
 | 
|---|
 | 53 |         W !!,"CLEANING UP FILES AND REBUILDING 2 CROSS-REFERENCES.",!,"THIS MAY TAKE A FEW MINUTES.",!
 | 
|---|
 | 54 |         W !!,"REBUILDING 'B' XREF, CAPRI TEMPLATE DEFINITIONS FILE",!
 | 
|---|
 | 55 |         N DA,DIK,REGIEN,ROOT
 | 
|---|
 | 56 |         S ROOT=$$ROOT^DILFD(396.18,,1)  K @ROOT@("B")
 | 
|---|
 | 57 |         S REGIEN=0
 | 
|---|
 | 58 |         F  S REGIEN=$O(@ROOT@(REGIEN))  Q:'REGIEN  D
 | 
|---|
 | 59 |         . S DIK=$$ROOT^DILFD(396.18,","_REGIEN_","),DIK(1)=".01^B"
 | 
|---|
 | 60 |         . S DA(1)=REGIEN  D ENALL^DIK
 | 
|---|
 | 61 |         ; 
 | 
|---|
 | 62 |         ;XRef: AV
 | 
|---|
 | 63 |         W !!,"REBUILDING 'AV' XREF, CAPRI TEMPLATE DEFINITIONS FILE",!
 | 
|---|
 | 64 |         N DA,DIK,REGIEN,ROOT
 | 
|---|
 | 65 |         S ROOT=$$ROOT^DILFD(396.18,,1)  K @ROOT@("AV")
 | 
|---|
 | 66 |         S REGIEN=0
 | 
|---|
 | 67 |         F  S REGIEN=$O(@ROOT@(REGIEN))  Q:'REGIEN  D
 | 
|---|
 | 68 |         . S DIK=$$ROOT^DILFD(396.18,","_REGIEN_","),DIK(1)=".01^AV"
 | 
|---|
 | 69 |         . S DA(1)=REGIEN  D ENALL^DIK
 | 
|---|
 | 70 |         K DA,DIK,REGIEN,ROOT
 | 
|---|
 | 71 |         Q
 | 
|---|
 | 72 |         ; 
 | 
|---|
 | 73 | DISABLE(NM)     ;Disable matching templates in CAPRI TEMPLATE DEFINITIONS (#396.18) file.
 | 
|---|
 | 74 |         ;First look for matches and turn off SELECTABLE BY USER? field. This will
 | 
|---|
 | 75 |         ;keep the entry from showing in the list. Next, look at DE-ACTIVATION DATE field.
 | 
|---|
 | 76 |         ;If there's no date, set it to today.
 | 
|---|
 | 77 |         ;
 | 
|---|
 | 78 |         N DVBABCNT,DVBABIEN,DVBABST,DVBACH
 | 
|---|
 | 79 |         S DVBABCNT=0,DVBABIEN=0
 | 
|---|
 | 80 |         ;look for template matches
 | 
|---|
 | 81 |         F  S DVBABIEN=$O(^DVB(396.18,DVBABIEN)) Q:'DVBABIEN  D
 | 
|---|
 | 82 |         .S DVBABST=$P($G(^DVB(396.18,DVBABIEN,0)),"^",1)
 | 
|---|
 | 83 |         .I $P(DVBABST,"~",1)=NM  I $P(DVBABST,"~",2)'=DVBVERSN  D
 | 
|---|
 | 84 |         ..S DVBACH=0
 | 
|---|
 | 85 |         ..;Selectable by user field
 | 
|---|
 | 86 |         ..I $P(^DVB(396.18,DVBABIEN,6),"^",1)'="0"  S $P(^DVB(396.18,DVBABIEN,6),"^",1)="0",DVBACH=1
 | 
|---|
 | 87 |         ..;Deactivation date field
 | 
|---|
 | 88 |         ..I $P(^DVB(396.18,DVBABIEN,2),"^",2)=""  S $P(^DVB(396.18,DVBABIEN,2),"^",2)=DT,DVBACH=1
 | 
|---|
 | 89 |         ..;output modified templates
 | 
|---|
 | 90 |         ..I DVBACH=1  W "MODIFIED: "_DVBABST,!
 | 
|---|
 | 91 |         ;
 | 
|---|
 | 92 |         K DVBABCNT,DVBABIEN,DVBABST,DVBACH
 | 
|---|
 | 93 |         Q
 | 
|---|