I want to use a runprocess button to add a text component at a specific place in a chart note. The text component uses conditional processing. I've tried many variations of ADD_TEXT_COMP("location","title","position") with no success. No matter what I've tried, the contents of the text component will only write at the very end of the chart note. It will not write within the chart at the position of the cursor, after the current form, before the current form, etc.
Here are some examples of the runprocess code I've tried via a button:
{if OBSNOW("R_VISION_1")<>"" or OBSNOW("L_VISION_1")<>"" then ADD_TEXT_COMP("Enterprise\VFE Class", "Visual Acuity 1","AFTER_CURRENT") else "" endif}
{if OBSNOW("R_VISION_1")<>"" or OBSNOW("L_VISION_1")<>"" then ADD_TEXT_COMP("Enterprise\VFE Class", "Visual Acuity 1","BEFORE_CURRENT") else "" endif}
I've tried it without curly brackets and many other ways.
I've also tried a button that does not include the conditional processing, but just with the ADD_TEXT_COMP command, and this also writes to the end of the chart note.
This is driving me crazy. Any suggestions? Thank you!
Bentley Barbour
Cascade Eye Center
Oregon
Try removing the ADD_TEXT_COMP() from the button. Just call the ADD_TEXT_COMP() from the top of your form. In the text component declare a global variable with the text you want to add to your form. Then in the button you can add your conditional statement using the global variable. For example let's say we declared the global variable as gText in the text component. You could then take what you put in your button text output and do something like this:
{if OBSNOW(“R_VISION_1″)<>”” or OBSNOW(“L_VISION_1″)<>”” then FMT(gText,"") else “” endif}
This is assuming you just want to call some text. If you want to add a form you could put ADD_FORM_COMP where the FMT is above and leave the text component out the equation.