Well, that's no ordinary rabbit!
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.
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;
IFE=%NUR.PAT.zcus.pgm.M.ct.gen(ANS,R,S,"","MYQUERY"),1}
When the cursor reaches the multiple query the response area changes to blue.
After pressing F4 (get) the user can enter the canned text mnemonic or press F9 for a lookup.
After selecting the canned text this window opens if there are any tab stops in the canned text.
After all the tab stops have been processed the user is returned to the CDS blue response box.
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.
Don't see what you
need? Visit one of these other sites
or email me your request (tomt at thomast357.com).