source: WorldVistAEHR/trunk/r/MY_HEALTHEVET-MHV/MHV1P2.m@ 808

Last change on this file since 808 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1MHV1P2 ;WAS/GPM - My HealtheVet Install Utility Routine ; 2/2/08 12:35pm
2 ;;1.0;My HealtheVet;**2**;Aug 23, 2005;Build 22
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ; Integration Agreements:
6 ; 10141 : BMES^XPDUTL
7 ; : MES^XPDUTL
8 ; 3552 : PARAM^HLCS2
9 ;
10ENV ;
11 Q
12 ;
13PRE ; Pre-init routine
14 ; Turn on MHV Application Logging, add a log entry for the start
15 ; of the patch install.
16 D LOGON
17 D LOG^MHVUL2(XPDNM,"PRE-INIT","S","TRACE")
18 Q
19 ;
20POST ; Post-init routine
21 ; Add a log entry for the post init, and turn off logging.
22 D LOG^MHVUL2(XPDNM,"POST-INIT BEGIN","S","TRACE")
23 ;
24 D BMES^XPDUTL(" Updating MHVVA logical link")
25 I '$$UPDLINK D
26 . D BMES^XPDUTL(" *** Update to MHVVA logical link failed.")
27 . D MES^XPDUTL(" Please update the MHVVA logical link manually.")
28 . D MES^XPDUTL(" The DNS DOMAIN field shoud be 'MHV.MED.VA.GOV'")
29 . D MES^XPDUTL(" The AUTOSTART field should be 'Enabled'")
30 . D MES^XPDUTL(" No other fields should be changed.")
31 . D MES^XPDUTL(" If you need help with this please consult the HL7 System Manager")
32 . D MES^XPDUTL(" Guide, or log a Remedy Ticket.")
33 . Q
34 ;
35 I '$$LOGCHK D
36 . D LOG^MHVUL2("LOG CHECK","FAILED","S","TRACE")
37 . D BMES^XPDUTL(" *** An HL7 message was processed by MHV during installation.")
38 . D MES^XPDUTL(" Please check your error trap. If you find an error in an MHV")
39 . D MES^XPDUTL(" routine, please log a remedy ticket.")
40 . Q
41 D LOG^MHVUL2(XPDNM,"POST-INIT END","S","TRACE")
42 D LOGOFF
43 D RESET^MHVUL2
44 Q
45 ;
46LOGON ; Turn on MHV application logging
47 N UPDATE,SUCCESS
48 D BMES^XPDUTL(" Turning on MHV Application Logging")
49 S UPDATE("STATE")=1
50 S UPDATE("DELETE")=$$HTFM^XLFDT($H+60)
51 S UPDATE("LEVEL")="DEBUG"
52 D LOGSET^MHVUL1(.SUCCESS,.UPDATE)
53 Q
54 ;
55LOGOFF ; Turn off MHV application logging
56 N SUCCESS
57 D BMES^XPDUTL(" Turning off MHV Application Logging")
58 D LOGOFF^MHVUL1(.SUCCESS)
59 Q
60 ;
61LOGCHK() ; Check for log entries during patch installation
62 N DTM,PREDTM,J,FLAG
63 S PREDTM=$G(^TMP("MHV7LOG",$J))
64 Q:PREDTM="" 1
65 S DTM=$O(^XTMP("MHV7LOG",2,""))
66 I DTM'="",DTM<PREDTM Q 0
67 S J="",FLAG=0
68 F S J=$O(^XTMP("MHV7LOG",2,PREDTM,J)) Q:J="" I J'=$J S FLAG=1 Q
69 I FLAG Q 0
70 Q 1
71 ;
72UPDLINK() ; Update Logical Link
73 N FDA,ERR,IEN
74 ;
75 D LOG^MHVUL2("UPDATE LOGICAL LINK","BEGIN","S","TRACE")
76 S ERR=""
77 S IEN=$$FIND1^DIC(870,"","X","MHVVA","B","","ERR")
78 I 'IEN D Q 0
79 . I '$G(ERR("DIERR")) S ERR("DIERR",1,"TEXT",1)="NOT FOUND"
80 . S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1))
81 . D LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
82 . Q
83 ;
84 S ERR=""
85 S IEN=IEN_","
86 I $P($$PARAM^HLCS2,U,3)="P" D
87 . S FDA(870,IEN,.08)="MHV.MED.VA.GOV"
88 . S FDA(870,IEN,4.5)=1
89 . S FDA(870,IEN,400.01)="10.224.43.21"
90 . S FDA(870,IEN,400.02)=5410
91 . Q
92 E D
93 . S FDA(870,IEN,.08)=""
94 . S FDA(870,IEN,4.5)=0
95 . S FDA(870,IEN,400.01)=""
96 . S FDA(870,IEN,400.02)=""
97 . Q
98 D UPDATE^DIE("","FDA","","ERR")
99 I $G(ERR("DIERR")) D Q 0
100 . S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1))
101 . D LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
102 . Q
103 ;
104 I '$$CHKLINK(.ERR) D Q 0
105 . D LOG^MHVUL2("CHECK FAILED",ERR,"S","ERROR")
106 . Q
107 ;
108 D LOG^MHVUL2("UPDATE LOGICAL LINK","SUCCESS","S","TRACE")
109 Q 1
110 ;
111CHKLINK(ERR) ; Check Logical Link
112 N ARY,IEN
113 ;
114 K ERR
115 S ERR=""
116 I $P($$PARAM^HLCS2,U,3)'="P" Q 1
117 S IEN=$$FIND1^DIC(870,"","X","MHVVA","B","","ERR")
118 I 'IEN S ERR="DOES NOT EXIST" Q 0
119 S IEN=IEN_","
120 D GETS^DIQ(870,IEN,".08;4.5;400.01;400.02","","ARY","ERR")
121 I $G(ERR("DIERR")) S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1)) Q 0
122 I $G(ARY(870,IEN,.08))'="MHV.MED.VA.GOV" S ERR="DNS DOMAIN NOT UPDATED" Q 0
123 I $G(ARY(870,IEN,4.5))'="Enabled" S ERR="AUTOSTART NOT ENABLED" Q 0
124 I $G(ARY(870,IEN,400.01))'="10.224.43.21" S ERR="INCORRECT IP ADDRESS" Q 0
125 I $G(ARY(870,IEN,400.02))'=5410 S ERR="INCORRECT TCP PORT" Q 0
126 Q 1
127 ;
Note: See TracBrowser for help on using the repository browser.