protected override void ReadXmlBase(XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "name")
            {
                this.name = reader.ReadElementString("name", RmXmlSerializer.OpenEhrNamespace);
            }

            reader.MoveToContent();

            if (reader.LocalName == "identifiers")
            {
                if (this.identifiers == null)
                {
                    this.identifiers = new List <OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                }
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);

                    this.identifiers.Add(id);
                } while (reader.LocalName == "identifiers");
            }
        }
Exemple #2
0
        protected override void ReadXmlBase(XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "name")
            {
                this.name = reader.ReadElementString("name", RmXmlSerializer.OpenEhrNamespace);
            }

            reader.MoveToContent();

            if (reader.LocalName == "identifiers")
            {
                if (this.identifiers == null)
                    this.identifiers = new List<OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);

                    this.identifiers.Add(id);

                } while (reader.LocalName == "identifiers");
            }
        }
Exemple #3
0
        internal void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            if (reader.LocalName == "originating_system_item_ids")
            {
                this.originatingSystemItemIds = new OpenEhr.AssumedTypes.List <OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);
                    this.originatingSystemItemIds.Add(id);
                } while (reader.LocalName == "originating_system_item_ids" && reader.NodeType == System.Xml.XmlNodeType.Element);
            }

            if (reader.LocalName == "feeder_system_item_ids")
            {
                this.feederSystemItemIds = new OpenEhr.AssumedTypes.List <OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);
                    this.feederSystemItemIds.Add(id);
                } while (reader.LocalName == "feeder_system_item_ids" && reader.NodeType == System.Xml.XmlNodeType.Element);
            }

            if (reader.LocalName == "original_content")
            {
                string originalContentType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                Check.Assert(!string.IsNullOrEmpty(originalContentType),
                             "the type of original_content must not be null or empty.");

                int i = originalContentType.IndexOf(":");
                if (i >= 0)
                {
                    originalContentType = originalContentType.Substring(i + 1);
                }

                if (originalContentType == "DV_MULTIMEDIA")
                {
                    this.originalContent = new DvMultimedia();
                }
                else if (originalContentType == "DV_PARSABLE")
                {
                    this.originalContent = new DvParsable();
                }
                else
                {
                    throw new InvalidOperationException("originalContent type must be either DV_MULTIMEDIA or " +
                                                        "DV_PARSABLE (type: " + originalContentType + ")");
                }

                this.originalContent.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "originating_system_audit",
                         "Expected LocalName is 'originating_system_audit', but it is " + reader.LocalName);
            this.originatingSystemAudit = new FeederAuditDetails();
            this.originatingSystemAudit.ReadXml(reader);

            if (reader.LocalName == "feeder_system_audit")
            {
                this.feederSystemAudit = new FeederAuditDetails();
                this.feederSystemAudit.ReadXml(reader);
            }

            if (!reader.IsStartElement())
            {
                reader.ReadEndElement();
            }

            reader.MoveToContent();
        }
Exemple #4
0
        internal void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            if (reader.LocalName == "originating_system_item_ids")
            {
                this.originatingSystemItemIds = new OpenEhr.AssumedTypes.List<OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);
                    this.originatingSystemItemIds.Add(id);
                } while (reader.LocalName == "originating_system_item_ids" && reader.NodeType == System.Xml.XmlNodeType.Element);

            }

            if (reader.LocalName == "feeder_system_item_ids")
            {
                this.feederSystemItemIds = new OpenEhr.AssumedTypes.List<OpenEhr.RM.DataTypes.Basic.DvIdentifier>();
                do
                {
                    OpenEhr.RM.DataTypes.Basic.DvIdentifier id = new OpenEhr.RM.DataTypes.Basic.DvIdentifier();
                    id.ReadXml(reader);
                    this.feederSystemItemIds.Add(id);
                } while (reader.LocalName == "feeder_system_item_ids" && reader.NodeType == System.Xml.XmlNodeType.Element);

            }

            if (reader.LocalName == "original_content")
            {
                string originalContentType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                Check.Assert(!string.IsNullOrEmpty(originalContentType),
                    "the type of original_content must not be null or empty.");

                int i = originalContentType.IndexOf(":");
                if (i >= 0)
                    originalContentType = originalContentType.Substring(i + 1);

                if (originalContentType == "DV_MULTIMEDIA")
                    this.originalContent = new DvMultimedia();
                else if (originalContentType == "DV_PARSABLE")
                    this.originalContent = new DvParsable();
                else
                    throw new InvalidOperationException("originalContent type must be either DV_MULTIMEDIA or " +
                        "DV_PARSABLE (type: " + originalContentType + ")");

                this.originalContent.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "originating_system_audit",
                "Expected LocalName is 'originating_system_audit', but it is " + reader.LocalName);
            this.originatingSystemAudit = new FeederAuditDetails();
            this.originatingSystemAudit.ReadXml(reader);

            if (reader.LocalName == "feeder_system_audit")
            {
                this.feederSystemAudit = new FeederAuditDetails();
                this.feederSystemAudit.ReadXml(reader);
            }

            if (!reader.IsStartElement())
            {
                reader.ReadEndElement();
            }

            reader.MoveToContent();
        }