source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLP109.m@ 701

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

initial load of WorldVistAEHR

File size: 5.6 KB
Line 
1HLP109 ;ALB/CJM - Post-Install for patch 109 ;06/03/99
2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
3 ;
4SETAC ;Used to undo the changes to the "AC" xref, used only if the patch
5 ;HL*1.6*109 needs to be backed out.
6 S ^DD(773,7,1,1,1)="S %=$P(^HLMA(DA,0),U,3) S:%]"""" ^HLMA(""AC"",%,X,DA)="""" I %=""O"",'$D(HLTCPO) D LLCNT^HLCSTCP(X,3)"
7 S ^DD(773,7,1,1,2)="S %=$P(^HLMA(DA,0),U,3) K:%]"""" ^HLMA(""AC"",%,X,DA)"
8 ;S ^DD(773,100,1,1,1)="S ^HLMA(""AD"",X,DA)="""" N %,%1 S %=$G(^HLMA(DA,0)),%1=$P(%,U,3),%=$P(%,U,7) K:%1]""""&% ^HLMA(""AC"",%1,%,DA)"
9 Q
10 ;
11PRE ; Called by KIDS pre-init...
12 S ^HLCS(869.3,1,772)=($O(^HL(772,":"),-1)\1)
13 S ^HLCS(869.3,1,773)=($O(^HLMA(":"),-1)\1)
14 D UNQUEUE^HLEVUTIL
15 D LOADMON
16 D ETHL7 ; Make sure every official HL7 entry has PACKAGE NAME...
17 Q
18 ;
19LOADMON ; Create a list of monitors in ^XTMP(XTMP,"O")...
20 N NOW,XTMP
21 S NOW=$$NOW^XLFDT
22 S XTMP="HLEV INSTALL "_NOW
23 S ^XTMP(XTMP,0)=$$FMADD^XLFDT(NOW,2)_U_NOW_U_"HLEV INSTALLATION MONITOR LIST"
24 S IEN=0
25 F S IEN=$O(^HLEV(776.1,IEN)) Q:'IEN D
26 . S ^XTMP(XTMP,"O",IEN)=$P($G(^HLEV(776.1,IEN,0)),U)_U_$$IENSUM(IEN)
27 Q
28 ;
29 ;
30 ;
31 ;
32POST ; Called by KIDS post-init...
33 N NO,TEXT,XMDUZ,XMSUB,XMTEXT,XMZ
34 N %KMPRJT,%XX,%ZH0,%ZHFN,C,D0,DA,DG,DICR,DIFRFRV1,DIFROM,DIU,I,IEN
35 N J,X,XG255,XGATRSET,XGCURATR,XGEMPATR,XGPAD,XGRT,XGSCRN
36 N XQCH,ZQJMP,XQSV,XWT,XQUSER,XQZ,Y
37 N XPD,XPD0,XPDA,XPDBLD,XPDCHECK,XPDCP,XPDD,XPDGREF,XPDIDCNT
38 N XPDIDMOD,XPDIDTOT,XPDIDVT,XPDIT,XPDNM,XPDPKG,XPDRTN,XPDSET
39 N XPDSET1,XPDST,XPDT
40 ;
41 ; Load 776.999 file entry if needed...
42 D LOADPAR
43 ;
44 ; Update list of monitors...
45 D COMPMON
46 ;
47 ; Send email message to DUZ...
48 KILL ^TMP($J,"HLMAIL")
49 D ADD("The installation of the Event Monitoring software held in patch")
50 D ADD("HL*1.6*109 is complete. ")
51 S XTMP=$O(^XTMP("HLEV INSTALL 9999999.99999"),-1)
52 I XTMP]"",$D(^XTMP(XTMP)) D MAILMON
53 ;
54 ; Send Mailman message.
55 S XMDUZ=.5,XMSUB="HL*1.6*109 Installation - Site# "_$P($$SITE^VASITE,U,3)
56 S XMTEXT="^TMP("_$J_",""HLMAIL"","
57 S XMY("HL7SystemMonitoring@med.va.gov")=""
58 ;
59 D ^XMD
60 ;
61 I '$D(ZTQUEUED) W !!,"Setup instructions message #",$G(XMZ)," sent..."
62 KILL ^TMP($J,"HLMAIL")
63 ;
64 D DELMON ; Delete monitor(2)...
65 D DELMGRP ; Delete mail group(s) from monitor(s)...
66 ;
67 ; Start a new master job...
68 D STARTJOB^HLEVMST
69 ;
70 Q
71 ;
72DELMON ; Delete renamed, or now unwanted official monitors...
73 N DA,DIE,DR
74 D DELONE("STUB 870 SEARCH")
75 D DELONE("XREF CHECK - FILE 772 & 773")
76 Q
77 ;
78DELONE(NAME) ; Delete a monitor...
79 N DA
80 QUIT:$G(NAME)']"" ;->
81 F S DA=+$O(^HLEV(776.1,"B",NAME,0)) Q:'DA D
82 . N DIK,DR
83 . S DIK="^HLEV(776.1,"
84 . D ^DIK
85 Q
86 ;
87LOADPAR ; Load 776.999 file...
88 QUIT:$G(^HLEV(776.999,1,0))]"" ;->
89 S $P(^HLEV(776.999,0),U,3)=1,$P(^HLEV(776.999,0),U,4)=1
90 S ^HLEV(776.999,1,0)="SYSTEM^A^120^96^^A"
91 S ^HLEV(776.999,"B","SYSTEM",1)=""
92 Q
93 ;
94COMPMON ; Create list of monitors that have been changed...
95 N DATA,IEN,NM,XTMP
96 ;
97 S XTMP=$O(^XTMP("HLEV INSTALL 9999999.999999999"),-1)
98 QUIT:XTMP'["HLEV INSTALL" ;->
99 ;
100 S IEN=0
101 F S IEN=$O(^HLEV(776.1,IEN)) Q:IEN'>0 D
102 . S $P(^XTMP(XTMP,"O",IEN),U,3)=$P($G(^HLEV(776.1,+IEN,0)),U)
103 . S $P(^XTMP(XTMP,"O",IEN),U,4)=$$IENSUM(IEN)
104 . S DATA=^XTMP(XTMP,"O",IEN)
105 . QUIT:$P(DATA,U)'=$P(DATA,U,3) ;-> Names don't match
106 . QUIT:$P(DATA,U,2)'=$P(DATA,U,4) ;-> Checksums don't match
107 . KILL ^XTMP(XTMP,"O",IEN)
108 ;
109 ; Rearrange into new and "used" (pre-existing) monitors...
110 KILL ^XTMP(XTMP,"NEW"),^XTMP(XTMP,"OLD")
111 S IEN=0
112 F S IEN=$O(^XTMP(XTMP,"O",IEN)) Q:'IEN D
113 . S DATA=^XTMP(XTMP,"O",IEN) QUIT:DATA']"" ;->
114 . S NM=$P(DATA,U,3)
115 . S:$P(DATA,U)']"" ^XTMP(XTMP,"NEW",NM,IEN)=DATA
116 . S:$P(DATA,U)]"" ^XTMP(XTMP,"OLD",NM,IEN)=DATA
117 ;
118 KILL ^XTMP(XTMP,"O")
119 ;
120 Q
121 ;
122ETHL7 ; Check/reset PACKAGE NAME in HL7 Monitor Event Type file (#776.3)...
123 N DA,DIE,DR,IEN,IENS,PCE
124 ;
125 S IENS="1^2^3^4^5^6^7^8^9^10^11^12^13^14^15^16^17^18^100^101^102^103^104^105^106^107^108^109^200^201^202^203^204^205^206^207^208^209^210^211^213^214^215^216"
126 ;
127 F PCE=1:1:$L(IENS,U) D
128 . S IEN=$P(IENS,U,+PCE) QUIT:$G(^HLEV(776.3,IEN,0))']"" ;->
129 . S DA=IEN,DIE=776.3,DR=".08///HEALTH LEVEL SEVEN"
130 . D ^DIE
131 ;
132 Q
133 ;
134MAILMON ; Add to new or changed monitors to mail text...
135 N HDR,NM,TXT,TYP
136 ;
137 D ADD(" - New and changed monitors.")
138 ;
139 S TYPE=""
140 F S TYPE=$O(^XTMP(XTMP,TYPE)) Q:TYPE']"" D
141 . D ADD("")
142 . S HDR=$S(TYPE="OLD":"Monitors changed during installation",TYPE="NEW":"New monitors",1:"") QUIT:HDR']"" ;->
143 . D ADD(HDR),ADD($$REPEAT^XLFSTR("-",$L(HDR)))
144 . S NM="",TXT=""
145 . F S NM=$O(^XTMP(XTMP,TYPE,NM)) Q:NM']"" D
146 . . S TXT(1)=$E(NM_$$REPEAT^XLFSTR(" ",40),1,35)
147 . . S TXT=TXT_TXT(1)
148 . . I $L(TXT)>35 D ADD(TXT) S TXT=""
149 . I $L(TXT)>0 D ADD(TXT)
150 ;
151 Q
152 ;
153ADD(TXT) ; Add text to ^TMP($J,"HLMAIL")
154 N NO
155 S NO=$O(^TMP($J,"HLMAIL",":"),-1)+1
156 S ^TMP($J,"HLMAIL",+NO)=TXT
157 Q
158 ;
159IENSUM(IEN) ; Checksum of entry...
160 N ASC,CHAR,LP,POS,ST,SUM,TXT,VAL
161 S SUM=0
162 S LP="^HLEV(776.1,"_IEN,ST=LP_",",LP=LP_")"
163 F S LP=$Q(@LP) Q:LP'[ST D
164 . S TXT=LP_"="_@LP
165 . F POS=1:1:$L(TXT) D
166 . . S CHAR=$E(TXT,POS),ASC=$A(CHAR)
167 . . S SUM=SUM+(ASC*POS)
168 Q SUM
169 ;
170DELMGRP ; Delete mailgroup in monitor...
171 N IEN,MIEN
172 ;
173 ; CHECK 773 AC XREF --- @ --- HL7DevelopmentTeam@med.va.gov
174 S IEN=$O(^HLEV(776.1,"B","CHECK 773 AC XREF",0))
175 S MIEN=$O(^HLEV(776.1,+IEN,62,"B","HL7DevelopmentTeam@med.va.gov",0))
176 D DELGRP1(IEN,MIEN)
177 ;
178 ; LINK (870) CHECKS
179 S IEN=$O(^HLEV(776.1,"B","LINK (870) CHECKS",0))
180 S MIEN=$O(^HLEV(776.1,+IEN,62,"B","HL7DevelopmentTeam@med.va.gov",0))
181 D DELGRP1(IEN,MIEN)
182 ;
183 Q
184 ;
185 ;
186DELGRP1(IEN,MIEN) ; Delete one remote mail group...
187 N DIE,DIE,DR
188 QUIT:'$D(^HLEV(776.1,+IEN,62,+MIEN,0)) ;->
189 S DIE="^HLEV(776.1,"_IEN_",62,",DA(1)=IEN,DA=MIEN
190 S DR=".01///@"
191 D ^DIE
192 Q
193 ;
194EOR ;HLEVINIT - Event Monitor PRE&POST-INITS ;5/16/03 14:42
Note: See TracBrowser for help on using the repository browser.