I have the following code, which populates 4 document variables to the chart. I added the comments filed as an extra field, but for some reason, when I populate it in the form, it does not show in the chart until I populate some other field. It seems to be dependent on another value being entered. Does anyone know why it does not show when I enter the data originally, then close the form ?
if hpi1<>"" and (hpi2<>"" or hpi4<>"") then prhpi=prhpi+"The problem of "+hpi1+" was discovered" else "" endif
if hpi4<>"" then prhpi=prhpi+" on "+hpi4 else "" endif
if hpi1<>"" and hpi2<>"" then prhpi=prhpi+" by "+praorand(hpi2)+hpi2 else "" endif
if hpi1<>"" and (hpi2<>"" or hpi4<>"") then prhpi=prhpi+". " else "" endif
if hpi3<>"" then prhpi=prhpi+hpi3+". " else "" endif
if hpi1<>"" and (hpi2<>"" or hpi4<>"") and document.hpi_comments_1<>"" then prhpi=prhpi+document.hpi_comments_1+". " else "" endif
Thank you.
John Mazurowski
Faxton-St. Lukes
Where is this code? If it is in a function, like this -
{fn formatcode(hpi1,hpi2,hpi3,hpi4){
Code here
}}
and called like this -
{formatcode(document.hpi1,document.hpi2,document.hpi3,document.hpi4)}
Then your problem is that the comments field isn't part of call, the function will fire only when one of those four variables change, you would need to add it somewhere like
{fn formatcode(hpi1,hpi2,hpi3,hpi4,comment){
Code here
}}
{formatcode(document.hpi1,document.hpi2,document.hpi3,document.hpi4,document.hpi_comments_1)}
Thank you for the reply !! I will add it to the function, and give it a try.
Is document.hpi_comments_1 actually bolded in your code? If it is, that's your problem…you can make document variables and obs terms bolded in a handout and the text in those fields will display bolded, but you'd have to do
CFMT(DOCUMENT.hpi_comments_1, "B", "", "", " ") to make it work.
No, I just bolded it in this post to indicate that is the field I was having issues with. I have found the problem. Had to add the field as part of the function. Thanks.