Yes and No on understanding..... In Here? :
!fn B_ATrans(field_count)
{ local b_a_trans = ""
local b_a_field = ""
b_a_field = EVAL("DOCUMENT.BR_A"+field_count)
if (b_a_field = "") then
b_a_trans = ""
else
if EVAL("DOCUMENT.BR_A"+field_count) <> "" AND (b_a_field <> "") then
b_a_trans = numtoascii(9) + b_a_field
else
b_a_trans = numtoascii(9) + numtoascii(9) + b_a_field
endif
endif
Yes so the function will evaluate anytime the variable that you are passing changes, which is field_count in your case. Since field_count is hard coded here, it will only evaluate when you open the form. Its going to take a lot of work to fix it, but what you need is to change this to something like this
!fn B_ATrans(b_a_field)
{ local b_a_trans = ""
if (b_a_field = "") then
b_a_trans = ""
else
if (b_a_field <> "") then
b_a_trans = numtoascii(9) + b_a_field
else
b_a_trans = numtoascii(9) + numtoascii(9) + b_a_field
endif
endif
and in the item translation pass the whole thing
{B_ATrans(document.BR_A1)}
That made my second column auto populate! I will try to replace everything in the form and see what happens!! Thank you so much!!
I have all the new coding in, and it works great. The problem is now my columns are not lining up. I tried to put all the tabs back in and that doesn't work. The date column does not go in a column but in a long run on row instead. If I get the date to work, the rest might line up, but I am once again stuck. I have tried everything I know (which is obviously not advanced enough for this form!!)
Here is the updated test version
Trying adding a '!' to the calls to get them to run on form open, that may fix the spacing, if not I would need to see a dlg file, that last one you attached is a ckt which I can't open without the other associated files
{!B_ATrans(document.BR_A1)}
I removed all the tabs I added in because as I was putting in all the new coding, everything was lining up. I quit testing once I got to the lunch dose column or the dinner pre column because it was working so good. Not sure when it all fell apart.... I also removed the visibility field and corrected the average functions thinking that might help, but no...
The first date field where you enter the date, there are a few extra lines outside the brackets that you need to remove. The rest of the dates, add a hret before the ADDDATES() function to start a new line. The only other thing messing it up is the comments. I would remove the heading for comments, and then if anything is entered for comments put it on a new line by itself, probably use a numtoascii(9) to make it easier to read. The document just is not wide enough for all the fields plus comments
This is what I get when I add the HRET function:
Home Blood Sugars
Breakfast Lunch Dinner
Date: Pre: Post: Dose: Pre: Post: Dose: Pre: Post: Dose: Bed: Comments:
06/04/201406/05/201406/06/201406/07/201406/08/201406/09/201406/10/2014
Thats what I saw the first time, I added it like this in the translation field
{hret + adddates(str(DOCUMENT.DATE_EDIT),"","","1")}
That worked and my columns are back lined up!! Thank you so much!!
So, back to this form again.....
We made a form on the patient portal that matches these obs terms. It pulls into the flowsheet, but it lists the date on top and subjects down the side. You can change the flowsheet view to the opposite, but they are printing the flowsheet for the provider and that view does not change. How can I get this to pull into a handout or letter, in the grid form with the dates listed down and the sugar times listed across? My magic wand ran out of gas....
Interesting as I am also experiencing this with EMR 9.8 as I call a function to list out the immunizations with the new formats. Thus, the screen display in the VFE form is not re-evaluating and neither is the chart note translation for the data display.
So, I am doing the following:
{
fnTextTransImmunHx()
}
And the function is stored as:
{!fn fnTextTransImmunHx() {
local hold = getfield(IMMUN_GETLIST("", "all"), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt + rtntype
endif
rslt = rslt + temp[3] + if temp[4] <> "" then " - " else "" endif + temp[4] + " on " + temp[30] + HRET
endfor
return rslt
}}
I wonder if I can pass a random variable, perhaps current date/time as a parameter to the function?