Written by Joe Cocuzzo, Senior VP of Report Writing Services - iatricSystems
You may have noticed that MEDITECH standard NPR report screens can have "display only" fields, but in customer reports, there is no attribute or standard method to provide the same feature. In a CDS, you could just set the "Echo Name" flag to Y when building the screen.
This month we will show you how to add a "name echo" feature to a MAGIC NPR report. Our example will be a simple doctor dictionary report where we will show the name on the selection screen after a doctor is selected:
Instead of this:
We want to have the selected doctor’s name display like this:
Here is how to add a "display only" field to your MAGIC report:
Step 1
Add a computed field where the name will display, make it the appropriate length (for doctor name this is 30 characters) and use the "IG" (Ignore) selection operator.
In Process Reports you have two options that allow you to modify the screen generated by the screen built automatically by the report translator. The "Edit Picture" option allows you to move or edit prompts, to add additional text, or to increase the number of entries that show for an LI or RL field. The "Edit Elements" option allows you to add or modify FCL, REQ, DFT, and IFE attributes for the screen fields.
First we want to move the 2nd "xx.name" field to the right of the doctor mnemonic field, we can remove the ":" prompt entirely.
In the Edit Picture routine do this:
Then we use the Edit Elements routine to add an IFE="" expression that shows the doctor name in 30 characters at the correct row and column and has the cursor skip the field.
The attributes that default for the "xx.name" field with the IG selection operator look like this:
We need to make two changes. We need to change the REQ=1 to REQ="" so the field is not required, and we need to add code to the IFE so that the field is skipped but the doctor name is displayed in the spot where me moved the field (to the right on the mnemonic).
It would be nice if the Report Screen program kept the row and column in some nice "R" and "C" variables for us to use in the IFE, but then we do not have that luxury. We could hardcode values and experiment, but we’d need to adjust for the 3.x vs the 4.x workstation and code like this:
This code uses the P() command to print the name in 30 characters truncated, left justified to row 0 (if 4.x Workstation) or 2 (if 3.x Workstation) and column 29.
Since you have a ruler line in the "Edit Screen" routine, it isn’t too difficult to figure out the row and column to use, you just need to check the @.gui flag to figure out if the screen starts on row 0 or row 2. 3.x screens use up two lines for the title and the horizontal line, and in the 4.0 workstation the title moves up to the Windows menu bar so your screen starts at line 0.
With this code, we have a report that works for both versions of the Workstation:
For extra credit, you could invert the name and display the doctor group mnemonic and name as well, like this: Try your own variation as appropriate to add relevant information to your NPR Report selection screens.
But what about C/S sites?
Unfortunately this trick won’t work in C/S because starting in version 5.6 all screen output is handled by a set of NPR.UI programs and calling them is blocked by the syntax checker. If MEDITECH added a DIS=N attribute feature to the C/S screen builder, you could do this the same way they do in Programmers NPR. Don’t hold your breath.
The MAGIC version of this report MIS.DOC.DICT.zcus.is.echo.name has been uploaded to our report library:
http://new.iatric.com/report-library-search
You can find additional Report Writing Tips on our website at http://new.iatric.com/report-writing-tips, as well as information about our on-site Report Writer Training and Report Writing Services.
To subscribe for email notifications for new Report Writing classes, please follow this link:
http://new.iatric.com/schedule-of-classes.
For more information, please contact our NPR report writing team at reportwriting@iatric.com.