public void SetFieldName(List <PlanFile> planFiles)
        {
            PlanFile match = planFiles.Find(X => X.SopInstanceId == SopInstanceId);

            if (match != null)
            {
                Tuple <string, string, string> beam = match.FieldNumberToNameList.Find(x => x.Item1 == BeamNumber);
                if (beam != null)
                {
                    PlanID    = match.PlanID;
                    FieldName = beam.Item2;
                    FieldMUs  = beam.Item3;
                }
                else
                {
                    var random = new Random();
                    PlanID    = "FieldNotFound" + random.Next();
                    FieldName = "FieldNotFound" + random.Next();
                    FieldMUs  = "-1";
                }
            }
            else
            {
                var random = new Random();
                PlanID    = "FieldNotFound" + random.Next();
                FieldName = "FieldNotFound" + random.Next();
                FieldMUs  = "-1";
            }
        }
        public static List <PlanFile> PlanFiles(string[] listOfFiles)
        {
            ConcurrentBag <PlanFile> planFiles = new ConcurrentBag <PlanFile>();

            _ = Parallel.ForEach(listOfFiles, new ParallelOptions {
                MaxDegreeOfParallelism = Environment.ProcessorCount
            }, file =>
            {
                DicomFile temp = new DicomFile(file);
                if (temp.IsPlanFile)
                {
                    PlanFile tempPlan = new PlanFile(file);
                    Debug.WriteLine("Found Plan File " + tempPlan.FileName);
                    planFiles.Add(tempPlan);
                }
            });
            return(new List <PlanFile>(planFiles));
        }