Header image

CDS Info - Word Wrap

Disclaimer: Use of the following attribute and NPR macro is done at the sole discretion of the user. Iatric Systems is not responsible for any problems arising from the use of this code. All code should be implemented and tested thoroughly in a TEST environment before moving LIVE.

CDS Info - Word Wrap

Overview

Creating a text editing box on a CDS via a multiple query and one IFE attribute

Download File - A copy of this report can be downloaded from our NPR MAGIC Library

If you place a comment query setup as a multiple (Release 4.7 and higher) on a CDS, the user gets a scrolling array of queries, but the text does not word wrap.

A simple IFE attribute attached to the query, calling a short macro attached to an MIS.QUERY report will "change" the text box into a word wrapping text edit window.

Setup the attribute as follows:

IFE=%MIS.QUERY.zcus.is.M.edit(ANS,R,S)

ANS contains a pointer to the query array. R is the current cursor row and S is the column. The macro calls Z.text.ed.shell with an editing window location which matches the field area for the multiple on the CDS.

The macro "edit" is attached to the NPR report MIS.QUERY.zcus.is
The report is available for downloading from the Iatrics NPR Report Library. Look at MIS reports.

The code in the macro is as follows:

A%0^ANS,
B^ROW,
C^COL,
D^MAX,
IF{ANS 1,
@CLEAN,
/S.LAST.QUERY^mnemonic,
IF{@multiple'="Y" @W.err("Query "_mnemonic_" is not a multiple");
@LOAD.TEXT,
@EDIT,
IF{CHG @PUT.BACK}}},
""^CHG^ROW^COL^MAX^ANS^mnemonic^T;

CLEAN
""^L,
DO{+/IAT[L]^L ""^/IAT[L]}

LOAD.TEXT
""^L,
DO{+(/[ANS,mnemonic,"M",L],DATA)^L DATA|0^/IAT[L]}

EDIT
%Z.text.ed.shell(^/IAT,ROW,(ROW+@multiple.line-1),@length,COL,"","","","",MAX)^CHG,
IF{/Z=147 13^/Z}

PUT.BACK
""^L,
DO{+/[ANS,mnemonic,"M",L]^L ""^/[ANS,mnemonic,"M",L]},
DO{+(/IAT[L],T)^L T^/[ANS,mnemonic,"M",L]|0},
@CLEAN