I am working on a custom form that is similar to the Physical Exam forms: one multi-line edit field writing to an ObsTerm that has buttons (Normal, Prior) and ListBoxes (for abnormals or other canned phrases) also pushing text to the box.
I currently have a simple function that combines the listbox items and pushes it to the ObsTerm (and thus the multi-line edit field):
{fn PEListBoxResult(l1str,l2str)
{ local fullStr = "" if (size(l1str) > 0) and (size(l2str) > 0) then fullstr = fullstr + l1str + ", " + l2str + ". " endif if (size(l1str) > 0) and (size(l2str) < 1) then fullstr = fullstr + l1str + ". " endif if (size(l1str) < 1) and (size(l2str) > 0) then fullstr = fullstr + l2str + ". " endif
return fullstr} }
With the following "call" in place for each multi-line edit field:
{!OBSNOW("HD/FACE INSP", PEListBoxResult(DOCUMENT.HEAD_AB_1, DOCUMENT.HEAD_AB_2))}
I need to program this in such a way that a user can free-text in the box, use the button, and checkboxes all without overwriting or duplicating the data.
Using something like this causes duplication issues:
{!OBSNOW("HD/FACE INSP", OBSNOW("HD/FACE INSP") + PEListBoxResult(DOCUMENT.HEAD_AB_1, DOCUMENT.HEAD_AB_2))}
Ideas?
As I work with this further, it appears the duplication only comes from the two list boxes being called by the function (DOCUMENT.HEAD_AB_1 and DOCUMENT.HEAD_AB_2 from above).
if you are using an action button, can you just put in a line at the beginning of your mel code to clear the values within obsnow?