Example #1
0
        int ReadObjectives(List <string[]> CSVsheet, out PQMSummaryViewModel[] objectives)
        {
            int numFoundObjectives = CSVsheet.Count();

            objectives = new PQMSummaryViewModel[numFoundObjectives];
            int i = 0;

            foreach (string[] line in CSVsheet)
            {
                if (line[0] == "")  //A blank line is present
                {
                    break;
                }
                objectives[i] = new PQMSummaryViewModel();
                // Structure ID
                objectives[i].TemplateId = line[0];
                // Structure Code
                string codes = line[1];
                objectives[i].TemplateCodes = (codes.Length > 0) ? ReplaceWhitespace(codes, @"\s+").Split('|') : new string[] { objectives[i].TemplateId };
                // Aliases : extract individual aliases using "|" as separator.  Ignore whitespaces.  If blank, use the ID.
                string aliases = line[2];
                objectives[i].TemplateAliases = (aliases.Length > 0) ? aliases.Split('|') : new string[] { objectives[i].TemplateId };
                // DVH Objective
                objectives[i].DVHObjective = line[4];
                // Evaluator
                objectives[i].Goal = line[5];
                //Variation
                objectives[i].Variation = line[6];
                // Priority
                objectives[i].Priority = line[7];
                // Met (calculate this later, check if meeting - Goal, Variation, Not met)
                objectives[i].Met = "";
                // Achieved (calculate this later)
                objectives[i].Achieved = "";
                i++;
            }
            return(numFoundObjectives);
        }
Example #2
0
        public PQMSummaryViewModel CalculatePQM(PQMSummaryViewModel objective, PlanningItemViewModel planningItemVM, StructureSet structureSet, StructureViewModel evalStructure)
        {
            objective.ActivePlanningItem = planningItemVM;
            PlanningItem planningItem = planningItemVM.PlanningItemObject;

            if (evalStructure == null)
            {
                objective.Achieved      = "Structure not found or empty.";
                objective.isCalculated  = false;
                objective.StructureList = StructureSetListViewModel.GetStructureList(structureSet);
                return(objective);
            }
            else
            {
                objective.isCalculated          = true;
                objective.Structure             = evalStructure;
                objective.StructureName         = evalStructure.StructureName;
                objective.StructVolume          = evalStructure.VolumeValue;
                objective.StructureNameWithCode = evalStructure.StructureNameWithCode;
                objective.StructureList         = StructureSetListViewModel.GetStructureList(structureSet);
                return(objective);
            }
        }