Well, that's no ordinary rabbit!

Text Edit/View Word Wrap Attribute

The Challenge: A request for a multiple type query that only one person can edit - the person who first entered a response.

Initial Solution: Add a second query that stores the user id of the person who first enters the response. Add an IFE attribute on the multiple query that only allows the cursor to stop there if there is no response yet or if the current user matches the response to the second query.

The Problem: Since query one is a multiple type there could be more lines of text off screen that users could not see.

Final Solution: Use a modified version of the word wrap attribute written by Joe Cocuzzo of Iatric Systems. The IFE attribute would then display the text in a text editor for the initial user and in a text viewer for other users.

wordwrap image

Query

Attributes/Comments

TJT.M.TEXT

Uses an IFE attribute to load either a text editor or text viewer

IFE=IF{%MIS.QUERY.zcus.is.M.edit(ANS,R,S,"",
IFE=IF{[ANS,"TJT.M.TEXT","M",1]|0_.=.!
IFE=(/.USR=[ANS,"TJT.M.USER"]|0);""),"";""}

The call to the macro has 5 arguments.- ANS, R, S, MAX, EDIT/VIEW. The only change from Joe's original attribute is the addition of a 5th argument - EDIT/VIEW. If that argument has a value the text is displayed in a text viewer window. If it has no value the text is loaded into a text editor window. See below for the changes to the macro itself.

TJT.M.USER

Uses IFE and REQ attributes to store the ID of the user who first answers the TJT.M.TEXT query

IFE=IF{[ANS,"TJT.M.TEXT","M",1]|0_.'=.&([ANS,"TJT.M.USER"]|0_.=.)
IFE= /.USR^/[ANS%0,"TJT.M.USER"]|0,"";""}
REQ=IF{[ANS,"TJT.M.TEXT","M",1]|0_.'=.&([ANS,"TJT.M.USER"]|0_.=.)
REQ= /.USR^/[ANS%0,"TJT.M.USER"]|0,"";""}

TJT.M.OK

A simple Y/N prompt only there so I could stay on the CDS after exiting the text editor/viewer. It has no impact on how the rest of the CDS functions.

TJT.M.LABEL

A label type query that displays the "Press to exit the text editor" text

Changes to MIS.QUERY.zcus.is.M.edit

; -- EDIT macro
IF{/.GUI 2;0}^OS,
IF{'E "Z.text.ed.shell";"Z.view.shell"}^PGM,
%[PGM](^/IAT,ROW+OS,(ROW+OS+@multiple.line-1),@length,COL,"","","","",MAX)^CHG,
IF{/Z=147 13^/Z}

There are 2 changes here. The first is the addition of code to make the text window display properly using Workstation 4+. The second is the change in code to use either a text editor or text viewer depending on the E argument. This is not the full macro code but it does show the all the changes I made to Joe's original macro. You can view and download the full macro from Iatric Systems web site.


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
Attributes
NPR tips
NPR reports
Magic and C/S Products
ITNurse.net
Hosted by Daniel Davis
Resources for the IT Nurse
Articles and Discussion Forum
Debbie Kelly web site
Attributes
Meditech tips
Nursing Informatics
Debbie Bate-Travis web site
Attributes
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).