Because of the limitations of the new Immunizations, I built a companion VFE form for us to handle some things. One if to be able to display and print the list of immunizations in the current encounter. I use a function call shown below with the function definition following it. If I close the note (saving) and then re-opening the function is re-evaulated. How else can I trick the form to analyze the function? Should I pass a dummy variable like current time to the function but not do anything with the variable inside the function? Or, in the alternative, does anyone have suggestions on how to display historical immunization data automatically as part of an encounter?
Thanks.
{
fnTextTransImmunHx()
}
{!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
}}
The documentation says IMMUN_GETLIST() evaluates continuously, I would start with this, I think that should work.
{
fnTextTransImmunHx(IMMUN_GETLIST("", "all"))
}
Now, I seem to be part way there. When that modified function call is in the Options tab of 'data display', it seems to update the form on the screen. Now I am stumped how to trick the system (or copy the function output) into placing it in the encounter text. No luck when I paste the same modified function call in the Translation tab for the Chart Note.
Then, the ultimate test will be to see if the form automatically updates based on the entries in the html form for the Immunizations.
The IMMUN_GETLIST is using a web service call to pull the immunization data. So, "evaluates continuously" is meaning less here. You have to recall it with a trigger base (a specific time for example) function or add a refresh button with recall to your function. And finally you may implement something like a SignalR or similar pull technology.