Exemplo n.º 1
0
        private void ParseArmsInterventionsModule(ref Study result)
        {
            XmlNode     armsInterventionModule = doc.SelectSingleNode("/FullStudiesResponse/FullStudyList/FullStudy/Struct/Struct[@Name='ProtocolSection']/Struct[@Name='ArmsInterventionsModule']");
            XmlNodeList armList = armsInterventionModule.SelectNodes("./List[@Name='ArmGroupList']/Struct");

            foreach (XmlNode arm in armList)
            {
                StudyArm newArm = new StudyArm();
                newArm.Title       = ParseSingleNode(arm, "./Field[@Name='ArmGroupLabel']");
                newArm.Description = ParseSingleNode(arm, "./Field[@Name='ArmGroupDescription']");
                newArm.Type        = StudyArmParser.Parse(ParseSingleNode(arm, "./Field[@Name='ArmGroupType']"));

                result.StudyArmList.Add(newArm);
            }

            XmlNodeList interventionList = armsInterventionModule.SelectNodes("./List[@Name='InterventionList']/Struct");

            foreach (XmlNode intervention in interventionList)
            {
                Intervention newIntervention = new Intervention();
                newIntervention.Name        = ParseSingleNode(intervention, "./Field[@Name='InterventionName']");
                newIntervention.Description = ParseSingleNode(intervention, "./Field[@Name='InterventionDescription']");
                newIntervention.Type        = InterventionParser.Parse(ParseSingleNode(intervention, "./Field[@Name='InterventionType']"));

                armList = intervention.SelectNodes("./List[@Name='InterventionArmGroupLabelList']/Field");
                foreach (XmlNode armNode in armList)
                {
                    if (result.StudyArmList.Any(item => item.Title == armNode.InnerText))
                    {
                        StudyArm thisArm = result.StudyArmList.First(item => item.Title == armNode.InnerText);
                        newIntervention.StudyArmNameList.Add(thisArm.Title);
                        thisArm.InterventionList.Add(newIntervention);
                    }
                }
            }

            result.StudyArmList = result.StudyArmList.OrderBy(item => item.Title).ToList();
        }
Exemplo n.º 2
0
        public static Study Translate(Study study)
        {
            Study result = new Study();

            result.Id = study.Id;
            result.ActualPrimaryCompletionDate = study.ActualPrimaryCompletionDate;
            result.ActualStudyStartDate        = study.ActualStudyStartDate;
            result.ConditionList = new List <Condition>();

            foreach (Condition condition in study.ConditionList)
            {
                Condition newCondition = new Condition(Translator.Translate(condition.Name));
                //newCondition.Icd10Item = condition.Icd10Item;
                newCondition.Id = condition.Id;
                result.ConditionList.Add(newCondition);
            }

            result.Design = new StudyDesign();
            result.Design.FollowUpDuration   = Translator.Translate(study.Design.FollowUpDuration);
            result.Design.MaskingDescription = Translator.Translate(study.Design.MaskingDescription);
            result.Design.ModelDescription   = Translator.Translate(study.Design.ModelDescription);
            result.Design.InterventionModel  = study.Design.InterventionModel;
            result.Design.ObservationalModel = study.Design.ObservationalModel;
            result.Design.TimePerspective    = study.Design.TimePerspective;

            result.Design.EligibilityText = Translator.Translate(study.Design.EligibilityText);
            result.EndpointList           = new List <OutcomeMeasure>();
            foreach (OutcomeMeasure measure in study.EndpointList)
            {
                OutcomeMeasure newMeasure = new OutcomeMeasure();
                newMeasure.Description        = Translator.Translate(measure.Description);
                newMeasure.EndpointPriority   = measure.EndpointPriority;
                newMeasure.EndpointDescriptor = measure.EndpointDescriptor;
                newMeasure.Id        = measure.Id;
                newMeasure.Name      = Translator.Translate(measure.Name);
                newMeasure.TimeFrame = Translator.Translate(measure.TimeFrame);
                result.EndpointList.Add(newMeasure);
            }

            result.FirstResultsSubmittedDate = study.FirstResultsSubmittedDate;
            result.FirstSubmittedDate        = study.FirstResultsSubmittedDate;
            result.FullTitle   = Translator.Translate(study.FullTitle);
            result.KeywordList = new List <string>();
            foreach (string keyWord in study.KeywordList)
            {
                result.KeywordList.Add(Translator.Translate(keyWord));
            }
            result.LastUpdatePostedDate = study.LastUpdatePostedDate;
            result.NctId                    = study.NctId;
            result.PublicationList          = study.PublicationList;
            result.SecondaryIndentifierList = study.SecondaryIndentifierList;
            result.ShortTitle               = Translator.Translate(study.ShortTitle);
            result.StudyArmList             = new List <StudyArm>();
            foreach (StudyArm arm in study.StudyArmList)
            {
                StudyArm newArm = new StudyArm();
                newArm.Id                      = arm.Id;
                newArm.Description             = Translator.Translate(arm.Description);
                newArm.InterventionDescription = Translator.Translate(arm.InterventionDescription);
                newArm.InterventionName        = Translator.Translate(arm.InterventionName);
                newArm.Title                   = Translator.Translate(arm.Title);
                newArm.InterventionType        = arm.InterventionType;
                newArm.Type                    = arm.Type;
                newArm.InterventionList        = new List <Intervention>();
                foreach (Intervention intervention in arm.InterventionList)
                {
                    Intervention newIntervention = new Intervention();
                    newIntervention.Id               = intervention.Id;
                    newIntervention.Description      = Translator.Translate(intervention.Description);
                    newIntervention.Name             = Translator.Translate(intervention.Name);
                    newIntervention.OtherNameList    = intervention.OtherNameList;
                    newIntervention.Type             = intervention.Type;
                    newIntervention.StudyArmNameList = intervention.StudyArmNameList;
                    newArm.InterventionList.Add(newIntervention);
                }
                result.StudyArmList.Add(newArm);
            }

            result.OriginalLanguageStudy = study;
            return(result);
        }