public Report(Patient patient, Course c, PlanSetup currentPlan) { monthName = thisDay.ToString("MMMM"); monthNumber = thisDay.Month; yearNumber = thisDay.Year; timeUpdated = String.Format("-{0}", DateTime.Now.ToString()); reportDestFile = ""; reportSourceFile = ""; physicsDestFile = ""; physicsSourceFile = ""; string[] specialChars = new string[] { ";", ":", "/", "\\", "'", "\"" }; courseId = c.Id.ToString(); planId = currentPlan.Id.ToString(); foreach (string specialChar in specialChars) { courseId = courseId.Replace(specialChar, "-"); planId = planId.Replace(specialChar, "-"); timeUpdated = timeUpdated.Replace(specialChar, "-"); } reportFileName = courseId + planId + "-Report.pdf"; physicsReportFileName = courseId + planId + "-Check.pdf"; sourcePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); if (currentPlan.Beams.FirstOrDefault().TreatmentUnit.Id.Contains("SB_LA_1") || currentPlan.Beams.FirstOrDefault().TreatmentUnit.Id.Contains("SB_LA_2")) { targetPath = String.Format(@"\\tigger-new.radonc.local\Public\SouthBayCTR\CCSB - Isodose Plans\{0}\{1} {2}\{3}, {4}", yearNumber, monthNumber, monthName, patient.LastName.ToString(), patient.FirstName.ToString()); } else { targetPath = String.Format(@"\\tigger-new.radonc.local\Public\CancerCTR\SHC - Isodose Plans\{0}\{1} {2}\{3}, {4}", yearNumber, monthNumber, monthName, patient.LastName.ToString(), patient.FirstName.ToString()); } }
void UpdateChartSeries() { foreach (KeyValuePair <VolumeViewModel, List <MPatient> > kvp in _dictpatients) { kvp.Value.Clear(); } VolumeChartSeries.Clear(); int patcnt = 0; foreach (MPatient pat in (_filterlevel > 0) ? _patientRepository.GetSelectedPatients(_filterlevel - 1) : _patientRepository.GetAllPatients()) { bool bDone = false; VMS.TPS.Common.Model.API.Patient vpat = _vapp.OpenPatientById(pat.MRN); foreach (VMS.TPS.Common.Model.API.Course course in vpat.Courses) { foreach (VMS.TPS.Common.Model.API.PlanSetup setup in course.PlanSetups) { if (setup.StructureSet != null) { foreach (VMS.TPS.Common.Model.API.Structure str in setup.StructureSet.Structures) { if (str.Name.ToUpper().Contains(_selectedStructure.Name.ToUpper())) { bDone = true; this.VolumeChartSeries.Add(new KeyValuePair <string, float>((++patcnt).ToString(), (float)str.Volume)); foreach (VolumeViewModel vol in AllVolumes) { if (str.Volume > vol.Range[0] && str.Volume < vol.Range[1]) { _dictpatients[vol].Add(pat); //break; } } } if (bDone) { break; } } } if (bDone) { break; } } if (bDone) { break; } } _vapp.ClosePatient(); } }
void ShowPlans() { if (_selectedpatient != null) { VMS.TPS.Common.Model.API.Patient pat = _vapp.OpenPatientById(_selectedpatient.MRN); List <VMS.TPS.Common.Model.API.PlanSetup> lstPlans = new List <VMS.TPS.Common.Model.API.PlanSetup>(); foreach (VMS.TPS.Common.Model.API.Course c in pat.Courses) { lstPlans.AddRange(c.PlanSetups); } List <VMS.TPS.Common.Model.API.Beam> lstBeams = new List <VMS.TPS.Common.Model.API.Beam>(); lstBeams.AddRange(lstPlans[0].Beams); ESAPISimpleUI.View.ListBoxWindow win = new ESAPISimpleUI.View.ListBoxWindow("Test selection box", "Select a plan", System.Windows.Controls.SelectionMode.Single, ESAPISimpleUI.View.ViewType.DataGrid, lstPlans); bool bOK = win.ShowDialog().Value; if (bOK) { List <VMS.TPS.Common.Model.API.PlanSetup> lstSelectedPlans = win.SelectedItems.Cast <VMS.TPS.Common.Model.API.PlanSetup>().ToList(); if (lstSelectedPlans != null && lstSelectedPlans.Count > 0) { ESAPISimpleUI.View.ListBoxWindow win2 = new ESAPISimpleUI.View.ListBoxWindow("Test selection box", "Select beams", System.Windows.Controls.SelectionMode.Multiple, ESAPISimpleUI.View.ViewType.DataGrid, lstSelectedPlans[0].Beams); bOK = win2.ShowDialog().Value; if (bOK) { List <VMS.TPS.Common.Model.API.Beam> lstSelectedBeams = win2.SelectedItems.Cast <VMS.TPS.Common.Model.API.Beam>().ToList(); } } } _vapp.ClosePatient(); } }
public MainViewModel(Patient patient) { _patient = patient; }
void UpdateChartSeries() { foreach (KeyValuePair <string, List <MPatient> > kvp in _dictpatients) { kvp.Value.Clear(); } foreach (MPatient pat in (_filterlevel > 0)?_patientRepository.GetSelectedPatients(_filterlevel - 1):_patientRepository.GetAllPatients()) { bool bDone = false; VMS.TPS.Common.Model.API.Patient vpat = _vapp.OpenPatientById(pat.MRN); foreach (VMS.TPS.Common.Model.API.Course course in vpat.Courses) { foreach (VMS.TPS.Common.Model.API.PlanSetup setup in course.PlanSetups) { if (setup.StructureSet != null) { foreach (VMS.TPS.Common.Model.API.Structure str in setup.StructureSet.Structures) { foreach (SiteViewModel site in AllSites) { foreach (string sz in site.Structures) { if (str.Id.ToUpper().Contains(sz.ToUpper())) //if (site.Structures.Contains(str.Id.ToUpper())) { bDone = true; _dictpatients[site.Name].Add(pat); break; } } if (bDone) { break; } } if (bDone) { break; } } } if (bDone) { break; } } if (bDone) { break; } } if (!bDone) { _dictpatients[AllSites[AllSites.Count - 1].Name].Add(pat); } _vapp.ClosePatient(); } this.SiteChartSeries = new ObservableCollection <KeyValuePair <string, int> >(); foreach (KeyValuePair <string, List <MPatient> > kvp in _dictpatients) { this.SiteChartSeries.Add(new KeyValuePair <string, int>(kvp.Key, kvp.Value.Count)); } }