source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLCSRPT2.m@ 1476

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

initial load of WorldVistAEHR

File size: 9.5 KB
Line 
1HLCSRPT2 ;ISC-SF/RAH-TRANS LOG ERROR LIST ;05/12/03 05:47 PM
2 ;;1.6;HEALTH LEVEL SEVEN;**50,85,107**;Oct 13, 1995
3 ;Calls to SAVEDDB^DDBR2, USAVEDDB^DDBR2, PSR^DDBR0, and WP^DDBR2 supported by IA#2540 & IA#3594
4 ;
5 Q
6 ;
7EN ; Entry point for reporting error messages.
8 ;
9 ; All NEWs below added by HL*1.6*85
10 N BLDOFF,BLDON,DY,ERRDTB,ERRDTE,HLCSCLNT,HLCSDTE,HLCSDTP
11 N HLCSEVN,HLCSEVN1,HLCSEVN2,HLCSHDR,HLCSK,HLCSLINK
12 N HLCSLNK,HLCSMID,HLCSMX,HLCSNREC,HLCSPTR,HLCSRNO,HLCSSRVR
13 N HLCSTITL,HLCSTYP,HLERR,IEN773,LAST773,LASTPDT
14 N LPIENS,NOREC,NUMERR,OLD773,OLDPDT,RVOFF,RVON,SPACE
15 N SPACE20,SPACE25,SPACE30,SPACE80,STOP,TYPEINFO,VERS22
16 ;
17 D CLEANGBL ;HL*1.6*85
18 ;
19 S (STOP,NOREC)=""
20 D SCREEN^HLCSRPT
21 S HLCSNREC=BLDON_" ===>>> NO MATCHING RECORDS <<<=== "_BLDOFF
22 S HLCSTITL="#773-IEN Message-ID Procd Log-Link Msg:Evn IO Sndg-Apl Rcvr-Apl" ;HL*1.6*85
23 S HLCSPTR=1,HLCSRNO=1
24 S VERS22=""
25 I 22'>+$$VERSION^XPDUTL("DI")!($$PATCH^XPDUTL("DI*21.0*32")) S VERS22="YES" ;HL*1.6*85
26 I VERS22'="YES" D
27 . S ^TMP("DDBPF1Z",$J)="D SHOWMSG^HLCSRPT2 Q"
28 . S HLCSTITL=HLCSTITL_" ERR"
29 E S HLCSTITL=HLCSTITL_" "
30 S ^TMP($J,"LIST","MESSAGE")="^TMP($J,""MESSAGE"",HLCSRNO)"
31 S ^TMP($J,"LIST",HLCSTITL_" ERR")="^TMP(""TLOG"",$J)" ;HL*1.6*85
32 ;
33REEN ; Internal Re-entry Point
34 S STOP=""
35 D WHATERR Q:(+$G(STOP))
36 QUIT:'$$SETUP^HLCSRPT4 ;-> HL*1.6*85
37 I TYPEINFO=2 S HLCSTITL="#773-IEN Message-ID Procd Log-Link Error-type " ;HL*1.6*85
38 D ERRSRCH
39 I ERRDTE[9999999 S ERRDTE=$$NOW^XLFDT
40 I +$G(STOP) D EXIT Q
41 I +$G(NOREC) W !!,HLCSNREC,!! S DIR(0)="E" D ^DIR K DIR,X,Y D EXIT Q
42 D DISPLAY^HLCSRPT ;HL*1.6*85
43 D CLEANGBL ;HL*1.6*85
44 D EXIT
45 S STOP=1
46 Q
47 ;
48CLEANGBL ; New subroutine added by HL*1.6*85 to clean up globals
49 N GBL
50 F GBL="LIST","MESSAGE" KILL ^TMP($J,GBL)
51 F GBL="DDBPF1Z","DDBLST","TLOG","TMPLOG" KILL ^TMP(GBL,$J)
52 QUIT
53 ;
54WHATERR ; Ask for one error code; with default of all
55 W @IOF,! S HLCSHDR="Error Type Selection" D HLCSBAR
56 S X="",HLCSER="ALL"
57 S DIR(0)="PAO^771.7:AEO",DIR("A")="Select Error Type: ALL//"
58 D ^DIR S:($D(DTOUT)!($D(DUOUT))) STOP=1
59 I +$G(STOP) K DIR,X,Y Q
60 I X="" K DIR,X,Y Q
61 I Y=-1 W !,X_" NOT VALID " K DIR,X,Y G WHATERR
62 S HLCSTER1=$P(Y,U,1),HLCSTER2=$P(Y,U,2) K DIR,X,Y
63 S HLCSER=1
64 Q
65 ;
66ERRSRCH ; Find and report the 'errored' messages (Multiple HL*1.6*85 changes start here)
67 ; ERRDTB,ERRDTE,NUMERR -- req
68 N NEXT,CT
69 W !!,"PLEASE WAIT, THIS CAN TAKE AWHILE..."
70 ;
71 ;HL*1.6*85 - LOADERR loads all errors, using the user-supplied
72 ; parameters, and places them in ^TMP. Below, the code
73 ; now loops thru ^TMP instead of ^HLMA (which happened
74 ; in LOADERR.)
75 D LOADERR^HLCSRPT4
76 ;
77 ; Looping starts here...
78 S HLCSI=0,HLCSST=0,HLCSLN=0
79 F S HLCSI=$O(^TMP("ERRLST",$J,HLCSI)) Q:HLCSI'>0 D
80 . S HLCSN=HLCSI,HLCSJ=0
81 . F S HLCSJ=$O(^TMP("ERRLST",$J,HLCSI,HLCSJ)) Q:HLCSJ'>0 D
82 .. ;HL*1.6*85 changes end here, until noted otherwise below.
83 ..
84 .. I '$D(^HLMA(HLCSJ,0)) Q
85 .. S HLCSX=^HLMA(HLCSJ,0),HLCSDTE=$P(HLCSX,U,1)
86 .. I $D(^HLMA(HLCSJ,"S")) S HLCSDTP=$P(^HLMA(HLCSJ,"S"),U,1)
87 .. E S HLCSDTP=""
88 .. I $D(^HLMA(HLCSJ,"P")) S HLCSY=^HLMA(HLCSJ,"P")
89 .. E S HLCSY=""
90 .. I HLCSER=1,(HLCSTER1'=$P(HLCSY,U,4)) Q
91 .. S HLCSER1=$P(HLCSY,U,4),HLCSER2=HLCSER1
92 .. I HLCSER1'="",($D(^HL(771.7,HLCSER1,0))) S HLCSER1=$P(^HL(771.7,HLCSER1,0),U,1)
93 .. S HLCSERMS=$P(HLCSY,U,3)
94 .. S HLCSLINK=$P(HLCSX,U,7) S HLCSLNK=" "
95 .. I HLCSLINK'="",($D(^HLCS(870,HLCSLINK,0))) S HLCSLNK=$P(^HLCS(870,HLCSLINK,0),U,1)
96 .. S HLCSEVN1=$P(HLCSX,U,13) I HLCSEVN1'="",($D(^HL(771.2,HLCSEVN1,0))) S HLCSEVN1=$P(^HL(771.2,HLCSEVN1,0),U,1)
97 .. S HLCSEVN2=$P(HLCSX,U,14) I HLCSEVN2'="",($D(^HL(779.001,HLCSEVN2,0))) S HLCSEVN2=$P(^HL(779.001,HLCSEVN2,0),U,1)
98 .. I HLCSEVN1="" S HLCSEVN1=$$MSGEVN^HLCSRPT5(HLCSJ,2) ;HL*1.6*85
99 .. I HLCSEVN2="" S HLCSEVN2=$$MSGEVN^HLCSRPT5(HLCSJ,2) ;HL*1.6*85
100 .. I $L(HLCSEVN1)<3 S HLCSEVN1=HLCSEVN1_" ",HLCSEVN1=$E(HLCSEVN1,1,3)
101 .. I $L(HLCSEVN2)<3 S HLCSEVN2=HLCSEVN2_" ",HLCSEVN2=$E(HLCSEVN2,1,3)
102 .. S HLCSEVN=HLCSEVN1_":"_HLCSEVN2
103 .. D ERRRPT^HLCSRPT5 ;HL*1.6*85 - Code overrun moved
104 .. Q
105 .Q
106 KILL ^TMP("ERRLST",$J) ;HL*1.6*85
107 D TMPLOG^HLCSRPT4 ;HL*1.6*85 Reset ^TMP("TMPLOG",$J) to ^TMP("TLOG",$J)
108 I '$D(^TMP("TLOG",$J,1)) S NOREC=1 Q
109 ;HL*1.6*85 - HLCSTITL already set above ;S HLCSTITL="IEN Record # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl"
110 I '$D(VERS22) S HLCSTITL=HLCSTITL_" ERR"
111 E S HLCSTITL=HLCSTITL_" "
112 D TEST
113 Q
114 ;
115SHOWMSG ; Enable switching to specific message (used by PF1Z).
116 ; If FM version 22 installed, uses VERS22 code, instead.
117 W @IOF
118 S DIR(0)="F:AE",DIR("A")="Enter Record Number: "
119 D ^DIR Q:$D(DIRUT)
120 I Y=-1!(X="") Q
121 S HLCSRNO=X I '$D(^HLMA(HLCSRNO,0)) D Q
122 . W !!,BLDON," ==> NO SUCH RECORD NUMBER <== ",BLDOFF H 3
123 S HLCSPTR=$P(^HLMA(HLCSRNO,0),"^",1)
124 S XXY=HLCSRNO,XXZ=HLCSPTR D VERS22(XXY,XXZ)
125 D SWITCH
126 Q
127SWITCH ; Non-standard Fileman Browser calls covered by IA# 2540.
128 N DDBLN,DDBZ,DIC,DIR,X,Y,DIRUT,DIROUT,DUOUT,DILN
129 S DILN=DDBRSA(DDBRSA,"DDBSRL")-2
130 S:$G(DDBLST)="" DDBLST="^TMP(""DDBLST"",$J)" S DDBLN=$S($D(@DDBLST@("A",DDBSA)):^(DDBSA),1:$O(@DDBLST@(" "),-1)+1)
131 I $D(@DDBLST) D
132 .I $O(@DDBLST@(" "),-1)=1,$G(@DDBLST@(1,"DDBSA"))=DDBSA Q
133 .S DDBZ=$G(@DDBLST@("A",DDBSA),0)
134 .S Y=2
135 .D SAVEDDB^DDBR2(DDBLST,DDBLN),USAVEDDB^DDBR2(DDBLST,+Y)
136 .S DIROUT=1
137 N DDBLNA
138 I $G(DDBLNA,-1)=-1 G PS
139 I $G(DDBLNA(6))=DDBSA G PS ;if current doc re-selected
140 I $G(DDBLNA(6))]"",$D(@DDBLST@("APSA",DDBSA)) G PS ;on list
141 D:DDBLNA>0 SAVEDDB^DDBR2(DDBLST,DDBLN),WP^DDBR2(.DDBLNA)
142PS D PSR^DDBR0(1)
143 Q
144 ;
145VERS22(XXY,XXZ) ; this is modified code from SHOWMSG^HLCSRPT1.
146 ; Each node, ^tmp($j,"message",record_ien), invokes this code
147 ; to compile a 'virtual w-p document' when a message is browsed.
148 I $D(^HLMA(XXY,"MSH",0)) D
149 .S ^TMP($J,"MESSAGE",XXY,0)=^HLMA(XXY,"MSH",0)
150 .S YY1=$P(^HLMA(XXY,"MSH",0),U,3),YY2=$P(^HLMA(XXY,"MSH",0),U,4)
151 E S ^TMP($J,"MESSAGE",XXY,0)="^^1^1" S (YY1,YY2)=1
152 S XLINE=^HLMA(XXY,0)
153 S LINE="Record #: "_XXY_" ",LINE=$E(LINE,1,30)
154 S LINE=LINE_"Message #: "_$P(XLINE,U,2)
155 S ^TMP($J,"MESSAGE",XXY,1,0)=LINE
156 S DTE=$P(XLINE,U,1) I $P($G(^HL(772,DTE,0)),U,1)'="" S DTE=$P(^HL(772,DTE,0),U,1),DTE=$E(DTE,4,7)_$E(DTE,2,3)_"."_$P(DTE,".",2)_" "
157 I $D(^HLMA(XXY,"S")),$P(^HLMA(XXY,"S"),U,1)'="" S DTP=$P(^HLMA(XXY,"S"),U,1) S DTP=$E(DTP,4,7)_$E(DTP,2,3)_"."_$P(DTP,".",2)
158 E S DTP=" "
159 S LINE="D/T Entered: "_DTE,LINE=$E(LINE,1,30)_"D/T Processed: "_DTP
160 S ^TMP($J,"MESSAGE",XXY,2,0)=LINE K DTE,DTP
161 S LINE="Logical Link: " I $P(XLINE,U,7)'="",($G(^HLCS(870,$P(XLINE,U,7),0))) S LINE=LINE_$P(^HLCS(870,$P(XLINE,U,7),0),U,1)
162 S LINE=LINE_" ",LINE=$E(LINE,1,30)
163 S LINE=LINE_"Ack To MSG#: " I $P(XLINE,U,6)'="",$G(^HLMA($P(XLINE,U,6),0)) S LINE=LINE_$P(^HLMA($P(XLINE,U,6),0),U,2)
164 S ^TMP($J,"MESSAGE",XXY,3,0)=LINE
165 S DTS="" I $P($G(^HLMA(XXY,"P")),U,2)'="" S DTS=$P(^HLMA(XXY,"P"),U,2),DTS=$E(DTS,4,7)_$E(DTS,2,3)_"."_$P(DTS,".",2)
166 S LINE="D/T STATUS: "_DTS_" ",LINE=$E(LINE,1,30),LINE=LINE_"STATUS: "
167 I $P(^HLMA(XXY,"P"),U,2)'="",($G(^HL(771.6,+$P(^HLMA(XXY,"P"),U,1),0))) S LINE=LINE_$P(^HL(771.6,+$P(^HLMA(XXY,"P"),U,1),0),U,1)
168 S ^TMP($J,"MESSAGE",XXY,4,0)=LINE K DTS
169 S LINE="ERR MSG: " I $P(^HLMA(XXY,"P"),U,3)'="" S LINE=LINE_$E($P(^HLMA(XXY,"P"),U,3),1,20)
170 S LINE=LINE_" ",LINE=$E(LINE,1,30)_"ERR TYPE: "
171 I $P(^HLMA(XXY,"P"),U,4)'="",($D(^HL(771.7,+$P(^HLMA(XXY,"P"),U,4),0))) S LINE=LINE_$P(^HL(771.7,+$P(^HLMA(XXY,"P"),U,4),0),U,1)
172 S ^TMP($J,"MESSAGE",XXY,5,0)=LINE
173 S LINE="Sending Appl: " I $P(XLINE,U,11)'="",($D(^HL(771,$P(XLINE,U,11),0))) S LINE=LINE_$P(^HL(771,$P(XLINE,U,11),0),U,1)
174 S ^TMP($J,"MESSAGE",XXY,6,0)=LINE
175 S LINE="Receiving Appl: " I $P(XLINE,U,12)'="",($D(^HL(771,$P(XLINE,U,12),0))) S LINE=LINE_$P(^HL(771,$P(XLINE,U,12),0),U,1)
176 S ^TMP($J,"MESSAGE",XXY,7,0)=LINE
177 S LINE="Message Type: " I $P(XLINE,U,13)'="",($D(^HL(771.2,$P(XLINE,U,13),0))) S LINE=LINE_$P(^HL(771.2,$P(XLINE,U,13),0),U,1)
178 S LINE=LINE_" ",LINE=$E(LINE,1,30)_"Event Type: "
179 I $P(XLINE,U,14)'="",($D(^HL(779.001,$P(XLINE,U,14),0))) S LINE=LINE_$P(^HL(779.001,$P(XLINE,U,14),0),U,1)
180 S ^TMP($J,"MESSAGE",XXY,8,0)=LINE K LINE,XLINE
181 S ^TMP($J,"MESSAGE",XXY,9,0)="MESSAGE HEADER: "
182 S LN2=10
183 I $D(^HLMA(XXY,"MSH",0)) D
184 .S LN1=.5
185 .F S LN1=$O(^HLMA(XXY,"MSH",LN1)) Q:LN1="" D
186 .. S ^TMP($J,"MESSAGE",XXY,LN2,0)=^HLMA(XXY,"MSH",LN1,0)
187 .. ;HL*1.6*107 start: to fix the multiple lines per segment
188 .. ;S LN2=LN2+1,LN1=LN1+1
189 .. S LN2=LN2+1
190 .. ;HL*1.6*107 end
191 E S ^TMP($J,"MESSAGE",XXY,LN2,0)=" No Header in MSG Admin File (#773)" S LN2=LN2+1
192 S LN1=.5
193 S ^TMP($J,"MESSAGE",XXY,LN2,0)="MESSAGE TEXT: ",LN2=LN2+1
194 I $D(^HL(772,XXZ,"IN",0)) D
195 .F S LN1=$O(^HL(772,XXZ,"IN",LN1)) Q:(LN1="") D
196 .. S ^TMP($J,"MESSAGE",XXY,LN2,0)=^HL(772,XXZ,"IN",LN1,0)
197 .. ;HL*1.6*107 start: to fix the multiple lines per segment
198 .. ;S LN2=LN2+1,LN1=LN1+1
199 .. S LN2=LN2+1
200 .. ;HL*1.6*107 end
201 ..Q
202 E S ^TMP($J,"MESSAGE",XXY,LN2,0)=" No Message in MSG Text File (#772)" S LN2=LN2+1
203 S (YY1,YY2)=LN2-1
204 S Y1Y2=YY1_"^"_YY2
205 S $P(^TMP($J,"MESSAGE",XXY,0),U,3,4)=Y1Y2
206 K LN1,LN2,Y1Y2,YY1,YY2
207 Q
208 ;
209EXIT ;
210 K I,J
211 K HLCSER,HLCSER1,HLCSER2,HLCSI,HLCSJ,HLCSLN,HLCSN
212 K HLCSST,HLCSTER1,HLCSTER2,HLCSERMS,HLCSX,HLCSY
213 K ^TMP($J,"LIST",HLCSTITL_" ERR") ;HL*1.6*85
214 I VERS22'="YES" S ^TMP("DDBPF1Z",$J)="D SHOWMSG^HLCSRPT Q"
215 Q
216 ;
217HLCSBAR ; Center Title on Top Line of Screen
218 W RVON,?(80-$L(HLCSHDR)\2),HLCSHDR,$E(SPACE,$X,77),RVOFF,!
219 Q
220 ;
221TEST ;
222 S HLCSJ=$O(^TMP("TLOG",$J,0))
223 S HLCSJ=+$P(HLCSJ," ",1)
224 S ^TMP($J,"MESSAGE",HLCSJ,0)="^^1^1"
225 S ^TMP($J,"MESSAGE",HLCSJ,1,0)=" HEADER: "
226 S HLCSRNO=HLCSJ
227 Q
228 ;
Note: See TracBrowser for help on using the repository browser.