private static void LoadItemIntoSection(XmlElement e, ref QuestionnaireSection section) { QuestionnaireItem item = new QuestionnaireItem(); item.ActionId = GetNodeValue(e, "ActionId"); item.DisplayId = GetNodeValue(e, "DisplayId"); item.Attributes = QuestionnaireItemAttributes.CanSkip; //TODO item.ScoringNote = GetNodeValue(e, "ScoringNote"); if (GetNodeValue(e, "BestScore") == "Highest") { item.HigherIsBetter = true; } else { item.HigherIsBetter = false; } try { item.SummaryText = GetNodeValue(e, "Summary"); } catch (Exception exp) { Error = "The summary: \n doesn't exist"; Form1.Print("The summary: doesn't exist" + exp.ToString()); logReport.returnError("The summary: doesn't exist" + exp.ToString()); } QuestionnaireElement x = item; LoadTextVersionsIntoElement(e, ref x); LoadOptionGroupsIntoItem(e, ref item); section.Elements.Add(item); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as QuestionnaireResponse; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); } if (BasedOn != null) { dest.BasedOn = new List <Hl7.Fhir.Model.ResourceReference>(BasedOn.DeepCopy()); } if (PartOf != null) { dest.PartOf = new List <Hl7.Fhir.Model.ResourceReference>(PartOf.DeepCopy()); } if (QuestionnaireElement != null) { dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.QuestionnaireResponse.QuestionnaireResponseStatus>)StatusElement.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (AuthoredElement != null) { dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopy(); } if (Author != null) { dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); } if (Source != null) { dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); } if (Item != null) { dest.Item = new List <Hl7.Fhir.Model.QuestionnaireResponse.ItemComponent>(Item.DeepCopy()); } return(dest); }
private static void LoadTextVersionsIntoElement(XmlElement e, ref QuestionnaireElement elem) { foreach (XmlElement t in e.GetElementsByTagName("TextVersion")) { QuestionnaireElementTextVersion txt = new QuestionnaireElementTextVersion(); txt.SetSupportedInstances(Instance.Baseline, Instance.Followup); //TODO txt.SetSupportedPlatforms(Platform.Chat, Platform.Classic, Platform.Mobile); //TODO txt.Text = GetNodeValue(t, "Text"); elem.TextVersions.Add(txt); } }
private static void LoadTextIntoSection(XmlElement e, ref QuestionnaireSection section) { QuestionnaireText text = new QuestionnaireText(); text.ActionId = GetNodeValue(e, "ActionId"); QuestionnaireElement x = text; LoadTextVersionsIntoElement(e, ref x); section.Elements.Add(text); }
private static void LoadItemIntoSection(XmlElement e, ref QuestionnaireSection section) { QuestionnaireItem item = new QuestionnaireItem(); item.ActionId = GetNodeValue(e, "ActionId"); item.DisplayId = GetNodeValue(e, "DisplayId"); item.Attributes = QuestionnaireItemAttributes.CanSkip; //TODO item.SummaryText = GetNodeValue(e, "Summary"); QuestionnaireElement x = item; LoadTextVersionsIntoElement(e, ref x); LoadOptionGroupsIntoItem(e, ref item); section.Elements.Add(item); }