Esempio n. 1
0
        private void button_Click(object sender, EventArgs e)
        {
            selectedChecklistType = (ChecklistType)((Button)sender).Tag;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Esempio n. 2
0
        //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);
            }
        }
        public async Task <ApiResponse <ChecklistType> > GetChecklistTypeByName(string typeName)
        {
            var           response      = new ApiResponse <ChecklistType>();
            ChecklistType checklistType = await _checklistTypeRepository.FindAsync(x => x.Name == typeName);

            if (checklistType == null)
            {
                response.Success = false;
                return(response);
            }
            response.Success = true;
            response.Data    = checklistType;
            return(response);
        }
        public async Task <ApiResponse <ChecklistType> > GetChecklistTypeById(Guid id)
        {
            var           response      = new ApiResponse <ChecklistType>();
            ChecklistType checklistType = await _checklistTypeRepository.GetByGuidAsync(id);

            if (checklistType == null)
            {
                response.Success = false;
                return(response);
            }
            response.Success = true;
            response.Data    = checklistType;
            return(response);
        }
Esempio n. 5
0
 public Checklist(string title, ChecklistType type, IEnumerable <ChecklistItem> items)
 {
     this.Title = title;
     this.Type  = type;
     this.items = items;
 }
Esempio n. 6
0
        private void GetFieldSizeGridSize(PlanSetup planSetup, double lim, ChecklistType checklistType, out string outText, out AutoCheckStatus checkstatusOut) // Section for controlling field size in all types of plans Lim in mm!
        {
            //Note Lim is in mm!
            //This part checks the size of the fields.
            outText        = string.Empty;
            checkstatusOut = AutoCheckStatus.MANUAL;
            string calcSize;
            int    tol       = 25;
            bool   isOverTol = false;

            foreach (Beam beam in planSetup.Beams)
            {
                if (!beam.IsSetupField)
                {
                    var    xSz   = beam.ControlPoints.Select(i => Math.Abs(i.JawPositions.X2 - i.JawPositions.X1));
                    var    ySz   = beam.ControlPoints.Select(i => Math.Abs(i.JawPositions.Y2 - i.JawPositions.Y1));
                    double percX = 0;
                    double percY = 0;

                    if (xSz.Min() < lim)
                    {
                        percX = (double)xSz.Where(v => v <= lim).Count() / (double)xSz.Count() * 100;
                    }
                    if (ySz.Min() < lim)
                    {
                        percY = (double)ySz.Where(v => v <= lim).Count() / (double)ySz.Count() * 100;
                    }
                    if (percX > 0 || percY > 0)
                    {
                        if (checklistType == ChecklistType.Eclipse || checklistType == ChecklistType.EclipseGating)
                        {
                            outText += (String.IsNullOrEmpty(outText) ? "" : ", ") + beam.Id + ": " + (percX > 0 ? "X-kollimator < " + lim + " mm" : "") + (percY > 0 ? " Y-kollimator < " + lim + " mm" : "");
                        }
                        else
                        {
                            outText += (String.IsNullOrEmpty(outText) ? "" : ", ") + beam.Id + ": " + (percX > 0 ? "X-kollimator < " + lim + " mm i " + percX.ToString("0.0") + "% av segmenten" : "") + (percY > 0 ? " Y-kollimator < " + lim + " mm i " + percY.ToString("0.0") + "% av segmenten" : "");
                        }
                        if (percX > tol || percY > tol)
                        {
                            isOverTol = true;
                        }
                    }
                }
            }
            if (!planSetup.PhotonCalculationOptions.TryGetValue("CalculationGridSizeInCM", out calcSize))
            {
                outText        = "Ingen beräkningsupplösning " + outText;
                checkstatusOut = AutoCheckStatus.FAIL;
            }
            else
            {
                //Ger följande utfall
                if (calcSize == "0.1" && !String.IsNullOrEmpty(outText)) // outText är ej tom, dvs någon del av något fält < lim mm. Då skall Algoritmen
                {
                    checkstatusOut = AutoCheckStatus.PASS;
                }
                else if (calcSize == "0.25" && String.IsNullOrEmpty(outText))
                {
                    checkstatusOut = AutoCheckStatus.PASS;
                }
                else if (calcSize == "0.25" && !String.IsNullOrEmpty(outText))
                {
                    if (isOverTol) // if more than 25 % of the segments are less than the set value lim this will give a fail, else Warning.
                    {
                        checkstatusOut = AutoCheckStatus.FAIL;
                    }
                    else
                    {
                        checkstatusOut = AutoCheckStatus.WARNING;
                    }
                }

                else if (calcSize == "0.1" && String.IsNullOrEmpty(outText))
                {
                    checkstatusOut = AutoCheckStatus.WARNING;
                    outText        = ", Rekommenderat med 0.25 cm för fält > " + lim / 10 + " cm.";
                }
                outText = calcSize + " cm. " + outText;
            }
            //return new Tuple<string, AutoCheckStatus>(outText, checkstatusOut);
        }