public AsyncPlan(AsyncESAPI ACurrent, PlanSum psIn, Patient ptIn, AsyncCourse cIn) { A = ACurrent; pt = ptIn; Course = cIn; ps = psIn; Id = ps.Id; var dates = ps.PlanSetups.Select(x => x.HistoryDateTime).OrderByDescending(x => x); HistoryDateTime = ps.PlanSetups.Select(x => x.HistoryDateTime).OrderByDescending(x => x).FirstOrDefault(); PlanType = ComponentTypes.Sum; NumFractions = 0; Dose = 0; if (ps.StructureSet == null) { Valid = false; } else { StructureSetId = ps.StructureSet.Id; StructureSetUID = ps.StructureSet.UID; foreach (Structure s in ps.StructureSet.Structures) { StructureIds.Add(s.Id); _Structures.Add(s.Id, s); Structures.Add(s.Id, new AsyncStructure(ACurrent, s, ps.StructureSet.Id, ps.StructureSet.UID)); } } foreach (PlanSetup p in ps.PlanSetups) { ConstituentPlans.Add(new AsyncPlan(A, p, ptIn, cIn)); } HashId = Convert.ToInt32(ps.Id.GetHashCode() + ps.Course.Id.GetHashCode() + string.Concat(ConstituentPlans.Select(x => x.UID)).GetHashCode()); UID = String.Join("+", ConstituentPlans.Select(x => x.UID)); }
public AsyncPlan(AsyncESAPI ACurrent, PlanSetup pIn, Patient ptIn, AsyncCourse cIn) { A = ACurrent; pt = ptIn; p = pIn; Course = cIn; UID = p.UID; HistoryDateTime = p.HistoryDateTime; Id = p.Id; NumFractions = p.UniqueFractionation.NumberOfFractions; HashId = Convert.ToInt32(p.Id.GetHashCode() + p.Course.Id.GetHashCode() + UID.GetHashCode()); Dose = p.TotalPrescribedDose.Dose; IsDoseValid = p.IsDoseValid; if (p.StructureSet == null) { Valid = false; } else { StructureSetId = p.StructureSet.Id; StructureSetUID = p.StructureSet.UID; foreach (Structure s in p.StructureSet.Structures) { StructureIds.Add(s.Id); _Structures.Add(s.Id, s); var AS = new AsyncStructure(ACurrent, s, p.StructureSet.Id, p.StructureSet.UID); Structures.Add(s.Id, AS); } } PlanType = ComponentTypes.Plan; }
public AsyncCourse(AsyncESAPI ACurrent, Course cIn, Patient ptIn, IProgress <int> progress = null) { A = ACurrent; pt = ptIn; c = cIn; Id = c.Id; double totalplans = 1; double count = 1; if (progress != null) { totalplans = c.PlanSetups.Count() + c.PlanSums.Count(); } foreach (PlanSetup p in c.PlanSetups) { if (progress != null) { progress.Report(Convert.ToInt32(count++ / totalplans * 100)); } Plans.Add(new AsyncPlan(A, p, pt, this)); } foreach (PlanSum p in c.PlanSums) { if (progress != null) { progress.Report(Convert.ToInt32(count++ / totalplans * 100)); } Plans.Add(new AsyncPlan(A, p, pt, this)); } }
public AsyncStructureSet(AsyncESAPI _A, StructureSet structureSet) { _StructureSet = structureSet; A = _A; Id = structureSet.Id; UID = structureSet.UID; foreach (Structure S in structureSet.Structures) { _Structures.Add(S.Id, new AsyncStructure(A, S, structureSet.Id, structureSet.UID)); } }
//private Dictionary<string, AsyncCourse> Courses = new Dictionary<string, AsyncCourse>(); public AsyncPatient(AsyncESAPI ACurrent, Patient p) { A = ACurrent; Id = p.Id; FirstName = p.FirstName; LastName = p.LastName; foreach (Course c in p.Courses) { CourseIds.Add(c.Id); } foreach (StructureSet SS in p.StructureSets) { StructureSetIds.Add(SS.Id); } }
public AsyncStructure(AsyncESAPI ACurrent, Structure Sin, string SSID, string SSUID) { A = ACurrent; S = Sin; isEmpty = Sin.IsEmpty; isHighResolution = S.IsHighResolution; Color = S.Color; StructureSetUID = SSUID; StructureSetID = SSID; Code = S.StructureCodeInfos.FirstOrDefault().Code; S.GetAssignedHU(out double HU_out); HU = HU_out; DicomType = S.DicomType; Volume = S.Volume; Id = S.Id; }