Hello,
I was wondering if anyone who uses VFE knows of anyway to help speed up the forms load time. We noticed that the more changes we make to the forms the slower they load. We recently updated a Risk Factors form and had to pull it back because of how slow the entire encounter was loading. Any tips are greatly appreciated as I'm sure many of you have experienced similar issues.
Thank you,
Mike
Hi Mike,
One tip is to be careful with watcher expressions. If you have a lot of these running when a form is first loaded, your form load times can increase, especially if the functions called by the watcher expressions have a lot of loops.
If you have a slew of function I mean a lot, to the point where you get the warning. I have begun moving my functions into text components and call out to them. This makes the form much much faster.
That's what I've been doing. Some of the forms we have here were large enough that they needed function libraries. So I moved a lot of the code to the library and the forms move pretty fast.
Dave
Please send the dlg file(s) to VFE support (attention Lee). I am interested in see what has been done to cause slowness to the degree that you describe and, in return, I will offer suggestions on how to improve the speed/functionality of the form. Thanks!
Thank you all for the tips. Lee, I have emailed you the form.
Careful with some of the MEL symbols especially with {PATIENT.CONTACTS}.
This MEL symbol may take very long time to execute on the large database.
Also, if you notice that your encounter loads significantly slower in some charts compared to others, you may want to look in to archiving obs. We had charts that would freeze as soon as you tried to access them if your default flowsheet view was set to all.
Thank you all for your responses and help! I never knew forms could load so slowly.
I ended up fixing one of the functions in the form and it now loads 10x quicker!
Thanks so much,
Courtney
As it turns out, there are issues with visibility fields within this same form. There are 2 visibilities that overlap, depending on when the patent last ordered test "71250." If the patient ordered it within a year, ldctorderedbefore()"" and DOCUMENT.ANYTHING=="". If the patient did not order within a year (either never ordered or ordered > 1 yr ago), then ldctorderedbefore()"" and DOCUMENT.ANYTHING="True." However whether the patient never ordered 71250 or ordered it within a year the same visibility appears! So frustrated with this form, any help is greatly appreciated!! Thank you in advance! 🙂
This lies int he MEL worksheet:
{!IF ldctorderedbefore()=="" THEN DOCUMENT.ANYTHING="TRUE" ELSE "" ENDIF}
{
fn ldctorderedbefore(){
local h, arrOrd, resultldct=""
arrOrd=getfield(ORDERS_ALL("delimited","T"),"|","")
for h=1, h0 and val(DURATIONDAYS(str(arrOrd[h][4]),str(._TODAYSDATE)))<365 then resultldct="TRUE"
else ""
endif
endfor
return resultldct
}
Best,
Courtney
[email protected]
Hi Courtney,
It looks like the code you have above doesn't differentiate the CPT-71250 order from the rest of the list, so I revamped your function a little bit to include the 71250:
{fn ldctorderedbefore(){
local h, arrOrd, resultldct="FALSE"
arrOrd=getfield(ORDERS_ALL("delimited","T"),"|","")
local lSize = size(arrOrd)
for h=lSize, h>=1, h=h-1 do
arrOrd[h] = getfield(arrOrd[h],"^","")
if match(str(arrOrd[h][3]),"CPT-71250")>0 then
if val(DURATIONDAYS(str(arrOrd[h][4]),str(._TODAYSDATE)))<365 then resultldct="TRUE"
BREAK
else resultldct="FALSE"
endif
else resultldct="FALSE"
endif
endfor
return resultldct
}}
It takes the list of patient's orders starting with the most recent one, searches for the 71250. If it finds the 71250, it makes sure the date is within the last year. If it is, it sets resultldct to TRUE. If it's not within the year, or it doesn't find the 71250, it sets resultldct to FALSE.
Using this, you should be able to set your overlapping visibility regions as
1) {if ldctorderedbefore()=="TRUE" then TRUE else FALSE endif} and
2) {if ldctorderedbefore()=="FALSE" then TRUE else FALSE endif}
I hope this helps!
Sarah