HLOPOST ;IRMFO-ALB/CJM -Post-Install routine for HLO;03/24/2004 14:43 ;07/20/2007
;;1.6;HEALTH LEVEL SEVEN;**126,134,136,137**;Oct 13, 1995;Build 21
;Per VHA Directive 2004-038, this routine should not be modified.
;
N SYSTEM,DATA,VASITE,OLDSITE
D IDXLINKS
D SYSPARMS^HLOSITE(.SYSTEM)
S VASITE=$$SITE^VASITE
S OLDSITE=$G(^HLCS(869.3,1,0))
S DATA(.01)=SYSTEM("DOMAIN")
I DATA(.01)="" D
.I $P(OLDSITE,"^",2) S DATA(.01)="HL7."_$P($G(^DIC(4.2,$P(OLDSITE,"^",2),0)),"^")
I DATA(.01)="" D
.N INST,DOMAIN
.S INST=$P(VASITE,"^")
.Q:'INST
.S DOMAIN=$P($G(^DIC(4,INST,6)),"^")
.I DOMAIN S DOMAIN=$P($G(^DIC(4.2,DOMAIN,0)),"^") I DOMAIN'="" S DATA(.01)="HL7."_DOMAIN
I DATA(.01)="" D BMES^XPDUTL("Post-Install failed, system missing INSTITUTION or DOMAIN file entry") Q
S DATA(.02)=SYSTEM("STATION")
I DATA(.02)="",$P(OLDSITE,"^",4) S DATA(.02)=$P($G(^DIC(4,$P(OLDSITE,"^",4),99)),"^")
I DATA(.02)="" S DATA(.02)=$P(VASITE,"^",3)
S DATA(.03)=$P(OLDSITE,"^",3)
S DATA(.04)=SYSTEM("MAXSTRING")
S DATA(.05)=SYSTEM("HL7 BUFFER")
S DATA(.06)=SYSTEM("USER BUFFER")
S DATA(.07)=SYSTEM("NORMAL PURGE")
S DATA(.08)=SYSTEM("ERROR PURGE")
I $D(^HLD(779.1,1,0)) D
.N ERROR
.I '$$UPD^HLOASUB1(779.1,1,.DATA,.ERROR) D BMES^XPDUTL("Post-Install failed -"_$G(ERROR))
E D
.N ERROR
.I '$$ADD^HLOASUB1(779.1,,.DATA,.ERROR,1) D BMES^XPDUTL("Post-Install failed -"_$G(ERROR))
Q
IDXLINKS ;
;set the "AC" and "AD" indicies on the HL Logical Link file
N DIK
S DIK="^HLCS(870,"
S DIK(1)=".01^AC^AD^AD1^AD2"
D ENALL^DIK
Q
;
P134 ;
N DAILY,STARTUP,IEN,DATA
S DAILY=$O(^DIC(19,"B","HLO DAILY STARTUP",0))
I 'DAILY D BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
S STARTUP=$O(^DIC(19,"B","HLO SYSTEM STARTUP",0))
I 'STARTUP D BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
I STARTUP D
.S IEN=$O(^DIC(19.2,"B",STARTUP,0))
.S DATA(.01)=STARTUP
.S DATA(2)=""
.S DATA(6)=""
.S DATA(9)=$S($P($G(^HLD(779.1,1,0)),"^",3)="P":"S",1:"")
.I IEN D
..I '$$UPD^HLOASUB1(19.2,IEN,.DATA) D BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
.E D
..I '$$ADD^HLOASUB1(19.2,,.DATA) D BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
I DAILY D
.S IEN=$O(^DIC(19.2,"B",DAILY,0))
.S DATA(.01)=DAILY
.S DATA(2)=$$NOW^XLFDT
.S DATA(6)="1D"
.S DATA(9)=""
.I IEN D
..I '$$UPD^HLOASUB1(19.2,IEN,.DATA) D BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
.E D
..I '$$ADD^HLOASUB1(19.2,,.DATA) D BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
Q
;
P136 ;post-install routine for HL*1.6*136
N ERROR,DIFROM,IEN
I $P($G(^HLD(779.1,1,0)),"^",3)="P" D
.D RESCH^XUTMOPT("HLO DAILY STARTUP",$$FMADD^XLFDT($$NOW^XLFDT,,1),,"1D","L",.ERROR)
.I $G(ERROR)<0 D BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option! Please do so manually")
;
S IEN=$O(^HLD(779.3,"B","PURGE OLD MESSAGES",0))
Q:'IEN
S ^HLD(779.3,IEN,0)="PURGE OLD MESSAGES^1^0^2^20^^5^GETWORK^HLOPURGE^DOWORK^HLOPURGE^1^0"
Q
;
P137 ;
;move the existing errros to the new structure
N TYPE
K ^TMP($J,"HLO ERRORS")
F TYPE="TF","SE","AE" D
.M ^TMP($J,"HLO ERRORS",TYPE)=^HLB("ERRORS",TYPE)
.M ^HLB("ERRORS")=^TMP($J,"HLO ERRORS",TYPE)
.K ^TMP($J,"HLO ERRORS",TYPE)
.K ^HLB("ERRORS",TYPE)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLOPOST 3359 printed Nov 22, 2024@17:09:02 Page 2
HLOPOST ;IRMFO-ALB/CJM -Post-Install routine for HLO;03/24/2004 14:43 ;07/20/2007
+1 ;;1.6;HEALTH LEVEL SEVEN;**126,134,136,137**;Oct 13, 1995;Build 21
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 NEW SYSTEM,DATA,VASITE,OLDSITE
+5 DO IDXLINKS
+6 DO SYSPARMS^HLOSITE(.SYSTEM)
+7 SET VASITE=$$SITE^VASITE
+8 SET OLDSITE=$GET(^HLCS(869.3,1,0))
+9 SET DATA(.01)=SYSTEM("DOMAIN")
+10 IF DATA(.01)=""
Begin DoDot:1
+11 IF $PIECE(OLDSITE,"^",2)
SET DATA(.01)="HL7."_$PIECE($GET(^DIC(4.2,$PIECE(OLDSITE,"^",2),0)),"^")
End DoDot:1
+12 IF DATA(.01)=""
Begin DoDot:1
+13 NEW INST,DOMAIN
+14 SET INST=$PIECE(VASITE,"^")
+15 if 'INST
QUIT
+16 SET DOMAIN=$PIECE($GET(^DIC(4,INST,6)),"^")
+17 IF DOMAIN
SET DOMAIN=$PIECE($GET(^DIC(4.2,DOMAIN,0)),"^")
IF DOMAIN'=""
SET DATA(.01)="HL7."_DOMAIN
End DoDot:1
+18 IF DATA(.01)=""
DO BMES^XPDUTL("Post-Install failed, system missing INSTITUTION or DOMAIN file entry")
QUIT
+19 SET DATA(.02)=SYSTEM("STATION")
+20 IF DATA(.02)=""
IF $PIECE(OLDSITE,"^",4)
SET DATA(.02)=$PIECE($GET(^DIC(4,$PIECE(OLDSITE,"^",4),99)),"^")
+21 IF DATA(.02)=""
SET DATA(.02)=$PIECE(VASITE,"^",3)
+22 SET DATA(.03)=$PIECE(OLDSITE,"^",3)
+23 SET DATA(.04)=SYSTEM("MAXSTRING")
+24 SET DATA(.05)=SYSTEM("HL7 BUFFER")
+25 SET DATA(.06)=SYSTEM("USER BUFFER")
+26 SET DATA(.07)=SYSTEM("NORMAL PURGE")
+27 SET DATA(.08)=SYSTEM("ERROR PURGE")
+28 IF $DATA(^HLD(779.1,1,0))
Begin DoDot:1
+29 NEW ERROR
+30 IF '$$UPD^HLOASUB1(779.1,1,.DATA,.ERROR)
DO BMES^XPDUTL("Post-Install failed -"_$GET(ERROR))
End DoDot:1
+31 IF '$TEST
Begin DoDot:1
+32 NEW ERROR
+33 IF '$$ADD^HLOASUB1(779.1,,.DATA,.ERROR,1)
DO BMES^XPDUTL("Post-Install failed -"_$GET(ERROR))
End DoDot:1
+34 QUIT
IDXLINKS ;
+1 ;set the "AC" and "AD" indicies on the HL Logical Link file
+2 NEW DIK
+3 SET DIK="^HLCS(870,"
+4 SET DIK(1)=".01^AC^AD^AD1^AD2"
+5 DO ENALL^DIK
+6 QUIT
+7 ;
P134 ;
+1 NEW DAILY,STARTUP,IEN,DATA
+2 SET DAILY=$ORDER(^DIC(19,"B","HLO DAILY STARTUP",0))
+3 IF 'DAILY
DO BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
+4 SET STARTUP=$ORDER(^DIC(19,"B","HLO SYSTEM STARTUP",0))
+5 IF 'STARTUP
DO BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
+6 IF STARTUP
Begin DoDot:1
+7 SET IEN=$ORDER(^DIC(19.2,"B",STARTUP,0))
+8 SET DATA(.01)=STARTUP
+9 SET DATA(2)=""
+10 SET DATA(6)=""
+11 SET DATA(9)=$SELECT($PIECE($GET(^HLD(779.1,1,0)),"^",3)="P":"S",1:"")
+12 IF IEN
Begin DoDot:2
+13 IF '$$UPD^HLOASUB1(19.2,IEN,.DATA)
DO BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
End DoDot:2
+14 IF '$TEST
Begin DoDot:2
+15 IF '$$ADD^HLOASUB1(19.2,,.DATA)
DO BMES^XPDUTL("Failed to schedule the HLO SYSTEM STARTUP option!")
End DoDot:2
End DoDot:1
+16 IF DAILY
Begin DoDot:1
+17 SET IEN=$ORDER(^DIC(19.2,"B",DAILY,0))
+18 SET DATA(.01)=DAILY
+19 SET DATA(2)=$$NOW^XLFDT
+20 SET DATA(6)="1D"
+21 SET DATA(9)=""
+22 IF IEN
Begin DoDot:2
+23 IF '$$UPD^HLOASUB1(19.2,IEN,.DATA)
DO BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
End DoDot:2
+24 IF '$TEST
Begin DoDot:2
+25 IF '$$ADD^HLOASUB1(19.2,,.DATA)
DO BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option!")
End DoDot:2
End DoDot:1
+26 QUIT
+27 ;
P136 ;post-install routine for HL*1.6*136
+1 NEW ERROR,DIFROM,IEN
+2 IF $PIECE($GET(^HLD(779.1,1,0)),"^",3)="P"
Begin DoDot:1
+3 DO RESCH^XUTMOPT("HLO DAILY STARTUP",$$FMADD^XLFDT($$NOW^XLFDT,,1),,"1D","L",.ERROR)
+4 IF $GET(ERROR)<0
DO BMES^XPDUTL("Failed to schedule the HLO DAILY STARTUP option! Please do so manually")
End DoDot:1
+5 ;
+6 SET IEN=$ORDER(^HLD(779.3,"B","PURGE OLD MESSAGES",0))
+7 if 'IEN
QUIT
+8 SET ^HLD(779.3,IEN,0)="PURGE OLD MESSAGES^1^0^2^20^^5^GETWORK^HLOPURGE^DOWORK^HLOPURGE^1^0"
+9 QUIT
+10 ;
P137 ;
+1 ;move the existing errros to the new structure
+2 NEW TYPE
+3 KILL ^TMP($JOB,"HLO ERRORS")
+4 FOR TYPE="TF","SE","AE"
Begin DoDot:1
+5 MERGE ^TMP($JOB,"HLO ERRORS",TYPE)=^HLB("ERRORS",TYPE)
+6 MERGE ^HLB("ERRORS")=^TMP($JOB,"HLO ERRORS",TYPE)
+7 KILL ^TMP($JOB,"HLO ERRORS",TYPE)
+8 KILL ^HLB("ERRORS",TYPE)
End DoDot:1
+9 QUIT