Download Printing from %MIS.SCREEN.print

Document related concepts
no text concepts found
Transcript
“Let MEDITECH do the Work”
Joe Cocuzzo
VP, NPR Report Writer Group
Central Region MUSE Workshop 2007
1
Let Meditech do the Work
1.
2.
3.
4.
5.
6.
7.
8.
Printing CDS prompts and responses
Printing Laboratory Results
Printing multiples with ECB-ECE loops
Printing PHA info “just like a MAR”
Checking Financial access
INIT Reports from Standard
Flexible Page Breaks
BAR Inquiry
2
1. Printing CDS prompts and responses
a. ADM
b. ADM - Insurance
c. OE
d. NUR
3
When you need to print all the query
prompts and responses from a CDS onto
an NPR report one method is to type all
the prompt into the picture and use a
computer field to print each response.
A better method is to use
%MIS.SCREEN.print
4
The arguments are:
A = user-defined screen mnemonic
B = name of structure where responses are
kept
C = nil strip any blank lines
non-nil print blank lines
D = left margin
5
OE Category Screen
%MIS.SCREEN.print(@cat.screen,^@Root(@responses),1,0)
OE Procedure Screen
%MIS.SCREEN.print(@proc.order.screen,^@Root(@responses),1,0)
“Regular” ADM CDS
%MIS.SCREEN.print(@cd.screen,^@Root(customer.defined.queries),1,0)
6
MIS.SCREEN.print examples (cont’d)
• ADM Insurance CDS
• Meditech has a field you can use for
insurance screens:
• Place the field: @ins.print.queries on the
picture (or)
• Call the program
%ADM.PAT.print.ins.screen(urn,insurance,
””,0,1) from an LC or macro
7
MIS.SCREEN.print examples (cont’d)
• NUR (Magic Only)
%MIS.SCREEN.print(@intervention's.screen,^@Root(@td.results),1,0)
• SCH (Magic or C/S)
Put field @sch.cds.print on an LC or ECB (you cannot put it in field list)
8
“Regular” Admission Queries
9
10
11
12
13
Admissions – Insurance Queries
14
15
16
Printing from @ins.print.queries
17
18
Printing from %MIS.SCREEN.print
19
20
Order Entry Queries
21
Additional Problem: There is no good service date index in Magic.
22
23
24
comp.order.number
25
Use computed comp.order.num in select
26
Category Screen
27
Procedure Screen
28
29
Nursing Queries
30
31
32
33
34
Let Meditech do the Work
2.
Laboratory results
a. Print Result programs
b. Lab widget
35
• LAB results printing programs
%LAB.L.SPEC.result.lines(“”)
Set up arguments in /ARG as follows
A = specimen urn
B = LIS Report Format
C = Confidential Ck (A,N,U)
D = Queued Range of tests to Print (default
= ALL)
36
•
•
•
•
Similar programs in other modules:
%LAB.B.SPEC.result.lines
%LAB.M.SPEC.result.lines
%LAB.P.SPEC.results
37
• Example –
Find/Display Lab results not printed on a
report prior to patient discharge to another
care facility.
38
39
No Index
40
41
Built in start macro
Computed field
42
Auguments A,B
43
Select all specimens or only
abnormals
44
45
46
Used in Selection
Used in select macro
47
Arguments A,B
Macro called as a program ends with a ;
48
49
Get last report date/time
Convert date/time to seconds
50
If VERIFY seconds >INHOUSE seconds
the result qualifies to print.
51
Used when c.xx.abn=“N”
52
53
Print Patient Header
54
Print Specimen Header
55
56
57
Specimen Header
58
59
60
61
62
63
LIS Report Format Dictionary
64
65
66
67
• Example –
A download report listing PTH specimens
followed by all reports.
68
69
Use signout index
70
71
Build list of specimens
72
73
Build file name for ftp
74
75
76
77
•
•
•
•
LAB Widget
Utility you can use anywhere to get lab
results (from CDS, from NPR report)
Does not use fragment (faster!)
Does not depend on user access to LAB
Written in Z dpm so it files in all segments
78
•
•
•
•
•
Z.zcus.is.lab.util.M.get(A,B,C,D)
A = patient admissions urn
B = test mnemonic
C = LAB db if not “LAB”_._(@.db#”1.”)
D = If true, also create array of all results
– Note utility returns verified results only
79
%Z.zcus.is.lab.util.M.get(A,B,C,D)^RESULT
RESULT = Q(res,date,tm,flag,range)
|0 test result
|1 collection date
|2 collection time
|3 abnormal flag
|4 normal range
80
Use of Widget in OE CDS
81
Next CDS page shows “display only” lab results
82
Get WBC result on all Inpatients
83
84
85
86
ADM database is ADM.BEV
Augument D is nil
LAB database is LAB.ADG
Get last result
“T” type test
87
88
89
90
Multiple result example uses
ECE/ECB
91
3 – ECB/ECE
a. Lab Results
b. Labels
92
Argument D is 1
Return all results in an array
93
Result Array
94
Reference to array
95
96
97
• ECB/ECE Labels
Over the years, we have presented a variety of methods
to print three across laser labels.
The most common approach is to load the patients into
an MV array in the detail sections, then print the array
out in a report trailer. The problem with this approach is
that you cannot apply different formatting to parts of the
label, such as bolding, different font sizes, or bar coding.
98
99
100
101
102
103
ECB/ECE equivalent to:
DO{+/DATA[SET]^SET 1.}
104
Prevent “No Records Found” message
105
Can call detail macro with no Detail region
106
107
108
• Printing PHA Info
%PHA.MAR.allergies
%PHA.RX.compile.med.lines
%PHA.RX.compile.med.array
109
• %PHA.MAR.allergies(A,B,C,D,E,F)
A = patient
B = max line length
C = structure for allergies dft ^/MV[“AL”]
D = field number in MV for allergies
E = structure for ADR’s dft ^/MV[“AD”]
F = field number for ADR’s
110
111
112
113
114
115
116
117
118
119
• %PHA.RX.compile.med.lines(A,B)
A = urn
B = T trade name G generic B both
@med.temp.line temporary child segment
created
120
Add this line
121
Add @med.temp.line as multiple
122
Field numbers change
123
Change numbers in program call
124
Added Text
125
• %PHA.RX.compile.med.array(A)
Builds a list of all medications in an order in
/D[PHA.DRUG.mnemonic]
126
PHA/LAB Report
• Get current patients on anti-coagulant
meds.
• Get relevant lab tests
• Present meds and labs in time sequence,
newest to oldest by date.
127
128
129
Need to use 2 indexes – 1st to get patients
and the 2nd to get Rxs for each patient.
Only room for 1 index so the other must be
done in a start macro.
130
Array built in start macro
131
Unbreakable MV array
Loop thru room bed index
Build /MED array for select
132
Computed field
133
What is %PHA.RX.compile.med.array?
134
135
136
137
• %PHA.RX.compile.med.array(urn)
/D[med] = 1
• %PHA.RX.compile.med.array(urn,””,1)
/D[1] = first med
/D[2] = second med
138
139
Final Value of xx.select
140
141
Print header if LAB results
142
143
144
Improved Page Break
145
Same as @Next.get
Unbreakable MV array
146
Lab Fragment
147
All specimens for patient
148
Always use status EQ “COMP” or
verify.user NE “”
149
Nothing in picture
150
Nil out variables used to store
specimen test results.
151
Eliminate “Site” prompt
“T” type tests
152
Arrays built for selection
/PREFIX array makes selection
faster
153
Detail macro called for each resulted test.
Store results for specimen.
154
Queue Results and store in
/R.FRAG.VAL
155
Same as @Next.get
Unbreakable MV array
156
157
• GL Checking
%MIS.DL.DEPT.user.ok
158
• GL Checking
Users will create a report for managers which presents
confidential data (such as Payroll) and then make a copy
for each manager with hard coded restrictions in each
copy for each manager.
This means that any change to the report will have to be
done in many clones and there will be changes to the
selection criteria of multiple reports as department
assignments and access change.
159
• A better practice is to use the Meditech
standard program %MIS.GL.DEPT.user.ok
to check the departments selected by a
user and limit access based on the
information listed in the financial access
section of the MIS.USER dictionary.
160
• %MIS.GL.DEPT.user.ok(A)
Avoid making a version of a financial or payroll
report for each manager.
MIS.GL.DEPT.user.ok includes code for the
new database specific access in release 4.9
Syntax is identical in Magic and C/S
161
Example report to list employee/dept.
162
163
164
165
166
• INIT reports from STD
167
• Problem:
– You copy a big macro from MT standard
– The macro filer complains of illegal syntax,
but you cannot find the offending line(s)
• Solution:
– NPR Report that prints each line that triggers
the syntax checker, followed by the message
168
• Open prefix to macro saf
• Loop and call syntax checker / grab errors
• List offending lines and corresponding
error message
169
Typical Syntax Violations
• @Next(@subscript.with.at.sign)
– Change to @Next(subscript)
• @Kill(/STUFF)
– Change to
• DO{>/STUFF[“”]^SUB “”^/STUFF[SUB]}
• O(*S,%some.file)
– Change to
• ZZ%OP(*S,%[“some.file”])
• $SEG(SEG,DIR)
– Change to
– $[“SEG”](SEG,DIR)
170
More typical syntax checker issues
• Writing to “slash dot” fields
“MAIN”^/.LAB.SITE or
0^@.lines.left
Change as follows
“.LAB.SITE”^XXX,
“MAIN”^/[XXX]
“.LL”^XXX,
0^/[XXX]
171
• Flexible Page Break
172
Flexible Page Break
• Problem: Avoid breaking within a record
that varies in size (number of lines)
• Solution: Before printing, check size and
call /R.NEW.PAGE.PGM if the record will
not fit within the lines left.
173
ABS Example, listing dx and procedures
174
175
176
177
178
Every record requires at least 3 lines
179
# of diagnoses
# of procedures
For C/S use /R.LL and [/R.NEW.PAGE.PGM](0)
180
181
Example –
• List top admitting doctors by service.
Problem – Need MV array to display data.
How to page break in MV
182
Smarter page break in MV array
183
184
185
Count physician for this record
186
Allow for bolding
187
After all records have been read /TOT is built with the
number of records for each physician.
Need to change this array :
Sorted by Service
Doc totals high to low
188
Total count for DOC
Get Service
Subtracting CNT from very high
number reverses the order
189
999999-36=999963
190
Loop thru /REV to build MV
array
First Speciality will not require
page break.
Otherwise attach “&PBK” into
MV subscript.
Build docs into MV
Add bolding
191
192
Page Break
193
194
• C/S Example
Page Break in MV Array
Physicians Rounds report
195
196
197
198
199
Build list of doctors
200
Count in detail macro
201
Add Lines after each doctor
202
IF last line for doctor append “.99”
to MV subscript
203
More of the tr macro
204
Bolding
Lines left
205
Page break needed here
206
Check /R.MV for page break
207
208
BAR Inquiry
• %BAR.PAT.inquiry.d1(account,””,1)
• Other inquiry formats:
• d2,d4,d5,d7,d8,d9
209
210
211
212
213
214
215
216
217
218
• xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
219
Backwards Do Loops
• Problem:
– In macros, DO loops thru multiple subscripts
of a file can be cumbersome to review/edit.
• Solution:
– Write the DO loop backwards and keep it all
on the page.
220
Backwards DO Loop
The LAB.C.ACT file can be used in a start macro to
find those lab specimens that had result activity
during a particular date range.
LAB.C.ACT SEGMENT
SUBSCRIPTS
PHYSICAL BASE
INTERNAL NAME
------------------------------------------------ ------------------------------------------lab.c.activity.by.patient
[date,patient,module,specimen]
SCA[sca,aa,scaM,scaS]
by.patient
221
Backwards DO Loop
222
Backwards DO Loop
223
Backwards DO Loop
224
Backwards DO Loop
225
Backwards DO Loop
226
Backwards DO Loop
227