public void ReadOperationalTemplate(XmlReader reader, OperationalTemplate template) { Check.Require(reader != null, string.Format(CommonStrings.XMustNotBeNull, "reader")); Check.Require(template != null, string.Format(CommonStrings.XMustNotBeNull, "template")); reader.ReadStartElement(); //template reader.MoveToContent(); CodePhrase language = new CodePhrase(); language.ReadXml(reader); template.Language = language; if (reader.LocalName == "is_controlled") { reader.ReadElementContentAsBoolean("is_controlled", RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); } if (reader.LocalName == "description") { ResourceDescription description = new ResourceDescription(); description.ReadXml(reader); template.Description = description; } if (reader.LocalName == "revision_history") { RevisionHistory revisionHistory = new RevisionHistory(); revisionHistory.ReadXml(reader); template.RevisionHistory = revisionHistory; } if (reader.LocalName == "uid") { HierObjectId uid = new HierObjectId(); uid.ReadXml(reader); template.Uid = uid; } TemplateId templateId = new TemplateId(); templateId.ReadXml(reader); template.TemplateId = templateId; template.Concept = reader.ReadElementContentAsString("concept", RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); CArchetypeRoot definition = new CArchetypeRoot(); ReadCArchetypeRoot(reader, definition); template.Definition = definition; // LMT added 12 May 2010 for TMP-1252 if (reader.LocalName == "annotations") { template.Annotations = new List <OpenEhr.RM.Common.Resource.Annotation>(); OpenEhr.RM.Common.Resource.Annotation currentAnnotation; while (reader.LocalName == "annotations") { currentAnnotation = ReadAnnotation(reader); template.Annotations.Add(currentAnnotation); reader.MoveToContent(); } } if (reader.LocalName == "constraints") { TConstraint constraints = new TConstraint(); ReadTConstraint(reader, constraints); template.Constraints = constraints; } if (reader.LocalName == "view") { TView view = new TView(); ReadTView(reader, view); template.View = view; } reader.ReadEndElement(); // template reader.MoveToContent(); }