internal void ReadXml(System.Xml.XmlReader reader) { reader.ReadStartElement(); reader.MoveToContent(); Check.Assert(reader.LocalName == "archetype_id", "Expected local name is 'archetype_id', not " + reader.LocalName); this.archetypeId = new OpenEhr.RM.Support.Identification.ArchetypeId(); this.archetypeId.ReadXml(reader); if (reader.LocalName == "template_id") { this.templateId = new OpenEhr.RM.Support.Identification.TemplateId(); this.templateId.ReadXml(reader); } Check.Assert(reader.LocalName == "rm_version", "Expected local name is 'rm_version', not " + reader.LocalName); this.rmVersion = reader.ReadElementString("rm_version", RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); if (!reader.IsStartElement()) { reader.ReadEndElement(); reader.MoveToContent(); } }
public Archetyped(Support.Identification.ArchetypeId archetypeId, string rmVersion, Support.Identification.TemplateId templateId) { Check.Require(archetypeId != null, "archetype_id must not be null"); Check.Require(!string.IsNullOrEmpty(rmVersion), "rm_version must not be null or empty"); this.archetypeId = archetypeId; this.rmVersion = rmVersion; this.templateId = templateId; CheckInvariants(); }