Quickly Find Selected PlanSetup

May 5, 2016 at 2:03 PM
I am looking for the fastest way to load a plansetup based on user selection. I present the available plansetup Ids based on a database query and then do a foreach through the courses looking for a plan sum that matches the user selection. Depending on the patient, this can take a while. Can optimize this in any way?
May 5, 2016 at 2:17 PM
Hi kevbro02,

What filter index do you use in your DB query? I'm just wondering if the entire process can be converted to the ESAPI environment by using something like OpenPatientById("ptn_id") and then create a dropdownlist selection or something similar. I find that once the ESAPI script has connected to the Eclipse application (this can take a few seconds), the data filter responds pretty quickly.
May 5, 2016 at 2:46 PM
The performance while iterating over plans using ESAPI in v11 is not great. We have optimized that in later versions so it is much faster.
May 5, 2016 at 4:00 PM
I include the UID from RTPlan for comparison with ESAPI uid. My time penalty is in the iterating over the ESAPI courses, as I cant go straight to PlanSetups. Is there an optimal loop structure or does it really matter? Foreach(ps in c.plansetup){ if(ps.uid == selecteduid) return ps; } is my matching loop
May 5, 2016 at 7:47 PM
mschmidt : It was originally all ESAPI and I noticed a significant difference in load times per patient that I tracked to building the plansetup name list. So I shifted building that list to the DB which takes no time at all. But I still have to find the match for any ESAPI work. I can use the courseid to get to the course, which reduces a lot of time not looking through each course, but still need to check each plan in that course, which is where it is slow.
wkeranen: Thanks for the update. Looking forward to later versions