source: FOIAVistA/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLEVX003.m@ 1671

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1HLEVX003 ;O-OIFO/LJA - VistA HL7 Event Monitor Code ;02/04/2004 15:25
2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
3 ;
4REPDINUM ; Create event log entry(s) for DINUM problems. (Use the
5 ; condensed report text instead of making one event for every DINUM
6 ; problem.)
7 ;
8 ; {01/16/04 - Added so wouldn't create thousands of events.}
9 ;
10 N LINK,LN,NO,PROB,QUIT,TAG,TXT,WAY
11 ;
12 KILL ^TMP($J,"HLEVDINUM")
13 ;
14 S LN=0,PROB="",QUIT=0,WAY="",LINK=""
15 F S LN=$O(^TMP($J,"HLEVREP",LN)) Q:'LN!(QUIT) D
16 . S TXT=^TMP($J,"HLEVREP",LN)
17 . I $P(TXT," ")="DINUM" S PROB="DINUM",WAY="",LINK=""
18 . QUIT:PROB'="DINUM" ;-> No DINUMs, or not to them yet...
19 . ; $$RDT returns LINK and WAY...
20 . S TXT=$$RDT(TXT) QUIT:TXT']""!(LINK']"")!(WAY']"") ;->
21 . F NO=1:1:$L(TXT,",") D
22 . . S TXT(1)=$P(TXT,",",NO) QUIT:TXT(1)']"" ;->
23 . . S ^TMP($J,"HLEVDINUM",LINK,WAY,TXT(1))=""
24 ;
25 ; No DINUM problems exist...
26 S LINK=""
27 F S LINK=$O(^TMP($J,"HLEVDINUM",LINK)) Q:LINK']"" D
28 . S WAY=""
29 . F S WAY=$O(^TMP($J,"HLEVDINUM",LINK,WAY)) Q:WAY']"" D
30 . . S MIENS=""
31 . . F S MIENS=$O(^TMP($J,"HLEVDINUM",LINK,WAY,MIENS)) Q:MIENS']"" D
32 . . . S X=$$LOG^HLEVAPI2("870-DINUM","LINK^WAY^MIENS")
33 ;
34 KILL ^TMP($J,"HLEVDINUM")
35 ;
36 Q
37 ;
38RDT(TXT) ; Strip down TXT to include only DINUM report details...
39 ; Returns LINK & WAY...
40 ;
41 ; {01/16/04 - See REPDINUM}
42 ;
43 ; First line of DINUM INCOMING or OUTGOING...
44 I TXT[" INCOMING " D QUIT $P(TXT,"COMING ",2,99) ;->
45 . S LINK=$P($E(TXT,16,99),"]")_"]"
46 . S WAY="INCOMING"
47 .
48 I TXT[" OUTGOING " D QUIT $P(TXT,"GOING ",2,99) ;->
49 . S LINK=$P($E(TXT,16,99),"]")_"]"
50 . S WAY="OUTGOING"
51 ;
52 ; Strip spaces and check pattern match...
53 S TXT=$TR(TXT," ","") QUIT:TXT']"" "" ;->
54 QUIT:TXT'?1.N1":"1.N1"(#"1.N1")".E "" ;->
55 ;
56 Q TXT
57 ;
58EOR ;HLEVX003 - VistA HL7 Event Monitor Code ;5/30/03 15:25
Note: See TracBrowser for help on using the repository browser.