It takes a longer time (unbelievably) to get Course.PlanSetups when a patient has multiple treatment plans

Developer
Oct 29, 2014 at 4:42 PM
Edited Oct 29, 2014 at 4:45 PM
We are trying to retrieve treatment plan data from Eclipse API (Version 11.0) based on a patient’s course ID and PlanSetupID. We tried to use three different ways in code (see below) for achieving the goal. When the number of PlanSetup is increased, the process time for executing the statements below is increased unbelievably. We tested a patient with 10 PlanSetups in a course, the executing time is around 52 seconds; and another patient with 13 PlanSetups in a course, the executing time is around 1 minute and 36 seconds. Is there a quick/best way to retrieve a PlanSetup data in this situation?

Method#1:

VMS.TPS.Common.Model.API.PlanSetup planSetup = null;
try { planSetup = (from s in course.PlanSetups where s.Id == strPlanSetupID select s).First(); }
catch { planSetup = null; }

Method#2:

VMS.TPS.Common.Model.API.PlanSetup planSetup = null;
planSetup = course.PlanSetups.First(x => x.Id == strPlanSetupID);

Method#3:

VMS.TPS.Common.Model.API.PlanSetup planSetup = null;
int iCount = course.PlanSetups.Count();
for (int i = 0; i < iCount; i++)
{
   planSetup =          course.PlanSetups.Take(iCount).AsEnumerable().ToList()[i];
if (planSetup.Id == strPlanSetupID)
                    break;
}


Thanks in advance for your help and guidance.
Angell
Coordinator
Nov 10, 2014 at 2:27 PM
In version 11 ESAPI, Eclipse completely loads each plan to check the Plan Integrity Checksum whenever plans are referenced (e.g. Course.PlanSetups). This causes a large delay in loading when there are many plans in a course.

The only workaround is to limit the number of Plans in each Course.

This has been changed in v13 and later versions so the full load of the PlanSetup object happens later.
Marked as answer by rexcardan on 11/25/2014 at 8:01 AM
Developer
Nov 10, 2014 at 4:35 PM
Wayne,
Thank you very much for letting us know.
Thanks,
Angell