source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLCSRPT3.m@ 1396

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

initial load of WorldVistAEHR

File size: 6.5 KB
RevLine 
[613]1HLCSRPT3 ;ISC-SF/RAH-TRANS LOG MESSAGE SEARCH ;08/24/99 08:09
2 ;;1.6;HEALTH LEVEL SEVEN;**50,57**;Oct 13, 1995
3 ;
4 Q
5ADVSRCH ; Entry point for message search. (from HLCSRPT)
6 S (HLCSLS,HLSCES,HLCSSC)=0
7 D GETTIME Q:$D(STOP)
8 D DT2IEN Q:$D(STOP)
9 D STATCHK Q:$D(STOP)
10 D LNKSRCH Q:$D(STOP)
11 D EVNSRCH Q:$D(STOP)
12 D SEARCH
13 D EXIT
14 S STOP=1
15 Q
16GETTIME ;
17 W @IOF,! S HLCSHDR="Start/Stop Time Selection" D HLCSBAR
18GETSTART ;
19 W !!," Enter START Date and Time. Date is required.",!
20 S DIR(0)="D^::AEPSTX",DIR("?")="^D HELP^%DTC",DIR("B")="T"
21 D ^DIR S:$D(DIRUT)!(X="") STOP=1 I $D(STOP) K DIR,X,Y Q
22 I Y'["." S Y=Y_".000001"
23 S HLCSST=Y K DIR,X,Y
24GETEND ;
25 W !!," Enter END Date and Time. Date is required.",!
26 S DIR(0)="D^::AESTX",DIR("?")="^D HELP^%DTC",DIR("B")="NOW"
27 D ^DIR S:$D(DIRUT)!(X="") STOP=1 I $D(STOP) K DIR,X,Y Q
28 I Y'["." S Y=Y_".235959"
29 S HLCSET=Y K DIR,X,Y
30 Q
31 ;
32DT2IEN ;
33 ;set variable to HLCSST-.0000001
34 ;$O thru ^HL(772,"B",dt)
35 ;get ien from "B" xref.
36 ; that's starting value for $O(^HLMA("B",772ien,ien))
37 S HLCSI=HLCSST-.0000001
38 S HLCSI=$O(^HL(772,"B",HLCSI))
39 I HLCSI="" S STOP=1 W !!,HLCSNREC,!! S DIR(0)="E" D ^DIR K DIR Q
40 S HLCSJ=0 S HLCSJ=$O(^HL(772,"B",HLCSI,HLCSJ))
41 S HLCSST=HLCSJ
42 ;set variable to HLCSET+.0000001
43 ;reverse $O thru ^HL(772,"B",dt)
44 ;get ien fron "B" xref.
45 ;that's ending value for the $O thru ^HLMA("B"
46 S HLCSI=HLCSET+.0000001
47 S HLCSI=$O(^HL(772,"B",HLCSI),-1)
48 S HLCSJ="Z" S HLCSJ=$O(^HL(772,"B",HLCSI,HLCSJ),-1)
49 S HLCSET=HLCSJ
50 Q
51 ;
52DISPLAY ; common display method
53 ; clean-up here
54 S HLCSPTR=$P(^TMP("TLOG",$J,1)," "),HLCSK=$O(^HLMA("C",HLCSPTR,0))
55 S HLCSPTR=+$P($G(^HLMA(+HLCSK,0)),U)
56 I VERS22'="YES" D DOCLIST^DDBR("^TMP($J,""LIST"")","NR")
57 E D BROWSE^DDBR("^TMP(""TLOG"",$J)","NA",HLCSTITL)
58 Q
59 ;
60SEARCH ;
61 W !!," . . . PLEASE WAIT, THIS CAN TAKE AWHILE . . .",!
62 S HLCSI=HLCSST-.1 S HLCSLN=0
63 F I=HLCSST:1:HLCSET S HLCSI=$O(^HLMA("B",HLCSI)) Q:HLCSI>HLCSET!(HLCSI="") D
64 . S HLCSN=HLCSI,HLCSJ=0 F S HLCSJ=$O(^HLMA("B",HLCSI,HLCSJ)) Q:(HLCSJ="") D
65 .. Q:'$D(^HLMA(HLCSJ,0)) S HLCSX=^(0),HLCSDTP=$P($G(^("S")),U)
66 .. ;must have a status
67 .. Q:'$G(^HLMA(HLCSJ,"P")) S HLCSSTC=$P(^("P"),U)
68 .. ;check for only one status, if not the status we want, quit
69 .. I HLCSSC=1,(HLCSTSTC'=HLCSSTC) Q
70 .. S HLCSLINK=$P(HLCSX,U,7) S HLCSLNK=" "
71 .. I HLCSLINK'="",($D(^HLCS(870,HLCSLINK,0))) S HLCSLNK=$P(^HLCS(870,HLCSLINK,0),U,1)
72 .. S HLCSEVN1=$P(HLCSX,U,13) I HLCSEVN1'="",($D(^HL(771.2,HLCSEVN1,0))) S HLCSEVN1=$P(^HL(771.2,HLCSEVN1,0),U,1)
73 .. S HLCSEVN2=$P(HLCSX,U,14) I HLCSEVN2'="",($D(^HL(779.001,HLCSEVN2,0))) S HLCSEVN2=$P(^HL(779.001,HLCSEVN2,0),U,1)
74 .. I HLCSEVN1="" S HLCSEVN1=" "
75 .. I HLCSEVN2="" S HLCSEVN2=" "
76 .. I $L(HLCSEVN1)<3 S HLCSEVN1=HLCSEVN1_" ",HLCSEVN1=$E(HLCSEVN1,1,3)
77 .. I $L(HLCSEVN2)<3 S HLCSEVN2=HLCSEVN2_" ",HLCSEVN2=$E(HLCSEVN2,1,3)
78 .. S HLCSEVN=HLCSEVN1_":"_HLCSEVN2
79 .. I HLCSLS>0,(HLCSTLNK'=HLCSLNK) Q
80 .. I HLCSES>0,(HLCSES1=1)&(HLCSTEV1'=HLCSEVN1) Q
81 .. I HLCSES>0,(HLCSES2=2)&(HLCSTEV2'=HLCSEVN2) Q
82 .. I HLCSSC=1,(HLCSTSTC'=HLCSSTC) Q
83 .. D FORMAT
84 .. Q
85 . Q
86 I '$D(^TMP("TLOG",$J,1)) W !!,HLCSNREC,!! S DIR(0)="E" D ^DIR K DIR Q
87 I VERS22'="YES" S HLCSTITL="IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR"
88 E S HLCSTITL="MESSAGE ID # D/T Entered Log Link Msg:Evn IO Sndg Apl Rcvr Apl "
89 I VERS22'="YES" D FAKR^HLCSRPT1
90 D DISPLAY K ^TMP("TLOG",$J)
91 Q
92 ;
93LNKSRCH ; Report all messages on A logical link between start and end date/time
94 W ! ;S HLCSHDR="Logical Link Selection" D HLCSBAR
95 S DIR(0)="PAO^870:AERO",DIR("A")="Select Logical Link for Report: ALL//"
96 D ^DIR S:($D(DUOUT)!$D(DTOUT)) STOP=1 Q:$D(STOP)
97 I X'="",(Y=-1) W !,X_" NOT VALID " K X,Y G LNKSRCH
98 I X="" S HLCSLS=0 K DIR,X,Y Q
99 S HLCSLNK=$P(Y,U,2),HLCSTLNK=HLCSLNK K DIR,X,Y
100 S HLCSLS=1
101 Q
102 ;
103EVNSRCH ; Reports matching Message and Event Types for a logical link.
104 W ! ;S HLCSHDR="Message/Event Type Search" D HLCSBAR
105 S HLCSES1=1,HLCSES2=2
106 S DIR(0)="PAO^771.2:AEO",DIR("A")="Select Message Type for Report: ALL//"
107 D ^DIR S:$D(DUOUT)!($D(DTOUT)) STOP=1 Q:$D(STOP)
108 I X'="",(Y=-1) W !,X_" NOT VALID " K X,Y G EVNSRCH
109 I X="" S Y="^",HLCSES1=0
110 S HLCSTEV1=$P(Y,U,2) K DIR,X,Y
111 W !
112 S DIR(0)="PAO^779.001:AEO",DIR("A")="Select Event Type for Report: ALL//"
113 D ^DIR S:$D(DUOUT)!($D(DTOUT)) STOP=1 Q:$D(STOP)
114 I X'="",(Y=-1) W !,X_" NOT VALID " K X,Y G EVNSRCH
115 I X="" S Y="^",HLCSES2=0
116 S HLCSTEV2=$P(Y,U,2) K DIR,X,Y
117 I HLCSTEV1="" S HLCSTEV1=" "
118 I HLCSTEV2="" S HLCSTEV2=" "
119 S HLCSTEVN=HLCSTEV1_":"_HLCSTEV2,HLCSES=+HLCSES1+(+HLCSES2)
120 Q
121 ;
122STATCHK ; Determine whether a specific stauts is desired.
123 W @IOF,! S HLCSHDR="Message Criteria for Search" D HLCSBAR
124 S HLCSSC=1
125 S DIR(0)="PAO^771.6:AEO",DIR("A")="Select Status Code for Report: ALL//"
126 D ^DIR S:$D(DUOUT)!($D(DTOUT)) STOP=1 Q:$D(STOP)
127 I X'="",(Y=-1) W !,X_" NOT VALID " K DIR,X,Y G STATCHK
128 I X="" S Y="^",HLCSSC=0 K DIR,X,Y Q
129 S HLCSTAT=$P(Y,U,2),HLCSTSTC=$P(Y,U,1)
130 K DIR,X,Y
131 Q
132FORMAT ; Format a report line
133 S HLCSY=""
134 S HLCSRNO=HLCSJ,SPACE20=" "
135 I VERS22'="YES" D
136 . S HLCSRNO=HLCSRNO_SPACE20 S HLCSRNO=$E(HLCSRNO,1,14) S HLCSY=HLCSRNO_" "
137 . S HLCSMID=$P(HLCSX,U,2),HLCSMX=HLCSMID,HLCSPTR=$P(HLCSX,U,1)
138 . S HLCSMID=HLCSMID_SPACE20 S HLCSMID=$E(HLCSMID,1,20)
139 . S HLCSY=HLCSY_HLCSMID_" "
140 I VERS22="YES" D
141 . S HLCSMID=$P(HLCSX,U,2),HLCSMX=HLCSMID,HLCSPTR=$P(HLCSX,U,1)
142 . S HLCSMID="$.%$CREF$^TMP($J,""MESSAGE"","_HLCSRNO_")$CREF$^"_HLCSMX_"$.%"
143 . S Y=$L(HLCSMX),X=$E(SPACE20,1,20-Y) S HLCSMID=HLCSMID_X K X,Y
144 . S HLCSY=HLCSMID_" "
145 . S HLCSDTE=$P(HLCSX,U,1)
146 . S HLCSDTE=$P(^HL(772,HLCSDTE,0),U,1)
147 . S YR=$E(HLCSDTE,2,3),MO=$E(HLCSDTE,4,5),DAY=$E(HLCSDTE,6,7)
148 . S HLCSDTE=MO_DAY_YR_"."_$P(HLCSDTE,".",2)
149 . S HLCSDTE=HLCSDTE_SPACE20,HLCSDTE=$E(HLCSDTE,1,14)
150 . S HLCSY=HLCSY_HLCSDTE_" "
151 S HLCSY=HLCSY_$E(HLCSLNK_SPACE20,1,10)_" "
152 S HLCSY=HLCSY_HLCSEVN_" "
153 S HLCSTYP=$P(HLCSX,U,3) S:HLCSTYP="O" HLCSTYP="OT" S:HLCSTYP="I" HLCSTYP="IN"
154 S HLCSY=HLCSY_$E(HLCSTYP_SPACE20,1,2)_" "
155 S HLCSSRVR=$P(HLCSX,U,11) I HLCSSRVR'="" S HLCSSRVR=$P(^HL(771,HLCSSRVR,0),U,1)
156 S HLCSY=HLCSY_$E(HLCSSRVR_SPACE20,1,8)_" "
157 S HLCSCLNT=$P(HLCSX,U,12) I HLCSCLNT'="" S HLCSCLNT=$P(^HL(771,HLCSCLNT,0),U,1)
158 S HLCSY=HLCSY_$E(HLCSCLNT_SPACE20,1,8)
159 S HLCSLN=HLCSLN+1
160 I VERS22'="YES" S HLCSY=HLCSY_" " I $D(^HLMA(HLCSJ,"MSH",1,0)) S HLCSY=HLCSY_^HLMA(HLCSJ,"MSH",1,0)
161 S ^TMP("TLOG",$J,HLCSLN)=HLCSY
162 I VERS22="YES" S ^TMP($J,"MESSAGE",HLCSJ)="$XC$^D SHOWMSG^HLCSRPT1("_HLCSJ_","_HLCSPTR_")$XC$^MESSAGE"
163 Q
164 ;
165HLCSBAR ; Center Title on Top Line of Screen
166 W RVON,?(80-$L(HLCSHDR)\2),HLCSHDR,$E(SPACE,$X,77),RVOFF,!
167 Q
168 ;
169EXIT ;
170 Q
171 ;
Note: See TracBrowser for help on using the repository browser.