コード例 #1
0
ファイル: Checklist.cs プロジェクト: lynch829/Checklista
        //private DatabaseManager databaseManager;

        public Checklist(Patient patient, Course course, PlanSetup planSetup, ChecklistType checklistType, string userId, string profession)
        {
            //planSetup.Beams = planSetup.Beams.OrderByDescending(x => x.Id);
            this.patient       = patient;
            this.course        = course;
            this.planSetup     = planSetup;
            this.checklistType = checklistType;
            this.userId        = userId;
            this.profession    = profession;
            databaseManager    = new DatabaseManager(Settings.RESULT_SERVER, Settings.RESULT_USERNAME, Settings.RESULT_PASSWORD);

            try
            {
                // Uncommented since it leads to timeout
                //databaseManager.CreateDatabase();
            }
            catch
            {
            }

            try
            {
                structureSet = planSetup.StructureSet;
                if (structureSet != null)
                {
                    image = planSetup.StructureSet.Image;
                }
                try { fractionation = planSetup.UniqueFractionation; }
                catch { }

                treatmentUnitManufacturer = GetTreatmentUnitManufacturer();
                treatmentSide             = GetTreatmentSide(planSetup);
                numberOfTreatmentBeams    = GetNumberOfTreatmentBeams();
                numberOfBeams             = GetNumberOfBeams();
            }
            catch (Exception exception)
            {
                System.Windows.Forms.MessageBox.Show(exception.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }

            try
            {
                AriaInterface.Connect();
                AriaInterface.GetPlanSetupSer(patient.Id, course.Id, planSetup.Id, out patientSer, out courseSer, out planSetupSer);
                AriaInterface.Disconnect();
            }
            catch (Exception exception)
            {
                System.Windows.Forms.MessageBox.Show(exception.Message, "ARIA Interface Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private TreatmentUnitManufacturer GetTreatmentUnitManufacturer()
        {
            // Loopa genom samtliga fält och ta reda på vilken typ av accelerator (tillverkare) som är associerad med planen
            TreatmentUnitManufacturer treatmentUnitManufacturer = TreatmentUnitManufacturer.None;

            foreach (Beam beam in planSetup.Beams)
            {
                TreatmentUnitManufacturer treatmentUnitManufacturerBeam = GetTreatmentUnitManufacturer(beam);

                if (treatmentUnitManufacturerBeam != treatmentUnitManufacturer && treatmentUnitManufacturer != TreatmentUnitManufacturer.None)
                {
                    treatmentUnitManufacturer = TreatmentUnitManufacturer.Multiple;
                }
                else
                {
                    treatmentUnitManufacturer = treatmentUnitManufacturerBeam;
                }
            }

            return(treatmentUnitManufacturer);
        }