Well, that's no ordinary rabbit!

Pulling NUR Canned Text into a Multiple Query

Note: the attribute and macro were changed 7/19/06 to remove usage of /S.LAST.QUERY. Changes are in red.

This page describes how to pull nursing canned text into a multiple type query on an NUR cds. The code uses the MIS.EDIT.sh program. When the cursor reaches the query an IFE attribute calls the program. The query response area then becomes a box within the MIS.EDIT.sh program. The way the program is called allows for the F4 (get) key to be funtional. After pressing F4 the cursor changes from a block to an underline. At this point you can type the canned text mnemonic or press F9 for a lookup of available canned texts. After the canned text selection is made another window opens. While this window is open the <ENTER> key takes the user thru the tab stops. After the user has gone thru all the tab stops the window closes and the text is brought back into the query. At this point the user is still in the MIS.EDIT.sh program and must press <esc> to return to the CDS. After using it a couple times the users should be familiar with how it works, but it might be confusing for a while. Adding a label query on the screen reminding them to press <esc> might be helpful.

There are a couple of quirks involved. The program changes the query response area to blue. After <esc> is pressed to return to the CDS the color will change back to light green as you scroll up or down thru the text.

The code is very similar to the code for word-wrapping in a multiple type query devised by guru Joe C - you pass in R and S as a couple of arguments and everything else is automatic.

Important Note: canned text can be up to 80 characters wide in NUR but the maximum length for a query response is 75 characters. I did not put anything into the code to check for lines greater than the query response length. Pulling in canned text which excedes the response length will corrupt the screen and may crash the routine.

Query Attribute

The IFE attribute calls the program if there are not any previous responses. Once a response is entered the user can edit the response but will no longer have the ability to pull in canned text.

Note: attribute changed to remove usage of /S.LAST.QUERY. Replace MYQUERY on both lines with the actual name of your query. Changes are in red.

IFE=IF{/[ANS%0,"MYQUERY","M",1] 1;

The Macro

The macro should be written in NUR.PAT since it uses some NUR.PAT fields. I was not sure if they were necessary so I left them in just in case the canned text needs them in some way. The report I used is NUR.PAT.zcus.pgm and the macro is ct.gen. If you use a different report name and/or macro name you will need to adjust the IFE attribute accordingly. Copying from a web page does not always preserve all the spacing and line breaks so I have the report containing the macro available for download here. Be sure to file the macro after uploading the report.

Note: macro changed to remove usage of /S.LAST.QUERY. Change (line 6 of macro) is in red.

IF{@MIS.QUERY.multiple'="Y" @W.err("Query "_MIS.QUERY.mnemonic_" is not a multiple");

; Canned text will be put in [ ] format

; A - file structure
; B - top row offset
; C - bottom row
; D - width
; E - left margin
IF{@.gui 2;0}^OFF,
; the next 2 lines of code need to be combined into 1 line
; but were split here to fit in the browser window
; combine previous 2 lines into one line using the F6 key

; 132 = Get Key (F4)
; 164 = Help Key (Shift F8)


DO{+/[ANS,MIS.QUERY.mnemonic,"M",XX]^XX /[ANS,MIS.QUERY.mnemonic,"M",XX]|0^/CANT[XX]}

DO{+/[ANS,MIS.QUERY.mnemonic,"M",XX]^XX ""^/[ANS,MIS.QUERY.mnemonic,"M",XX]},
DO{+/CANT[XX]^XX /CANT[XX]^/[ANS,MIS.QUERY.mnemonic,"M",XX]|0,
IF{XX'>@MIS.QUERY.multiple.line P(ROW+XX-1,COL,/CANT[XX]:(LEN_"L"))^#},


Screen Shots

When the cursor reaches the multiple query the response area changes to blue.

canned text image 1

After pressing F4 (get) the user can enter the canned text mnemonic or press F9 for a lookup.

canned text image 2

After selecting the canned text this window opens if there are any tab stops in the canned text. 

canned text image 3

After all the tab stops have been processed the user is returned to the CDS blue response box. 

canned text image 5

Press <esc> at that point to actually return to the CDS and maybe even get the response box to change back to green. A second <esc> should clean up any corruption and restore the correct colors.

canned text image 4

Other Magic Pages

CDS Attributes Emailing Messages Emailing Scheduled Reports
@W. prompts String Manipulation NPR Viewer
Text Edit/View Attribute Meds in an NUR CDS NUI Desktop Icons
Field Attributes Lab results in a CDS Ultimate Message Box
Display Message Attributes Run NPR Report Attribute Multiple Query Checklist
NUR Canned Text in Query Mousetributes LAB TEST VIEW GROUP
OA Msg from PHA Rule FTP Standard Report HTML Pt Master Logs
PCI NPR Report

Don't see what you need?  Visit one of these other sites

Iatric Systems web site
NPR tips
NPR reports
Magic and C/S Products
Hosted by Daniel Davis
Resources for the IT Nurse
Articles and Discussion Forum
Debbie Kelly web site
Meditech tips
Nursing Informatics
Debbie Bate-Travis web site
Links to other attribute sites
Links to Nursing Informatics sites
Magic NPR Report Writing
Blogged by John Sharpe
NPR Report Writing Tips

or email me your request (tomt at thomast357.com).