Example #1
0
 public FeederAudit(FeederAuditDetails originatingSystemAudit,
                    AssumedTypes.List <DataTypes.Basic.DvIdentifier> originatingSystemItemIds,
                    DataTypes.Encapsulated.DvEncapsulated originalContent)
     : this()
 {
     Check.Require(originatingSystemAudit != null);
     this.originatingSystemAudit   = originatingSystemAudit;
     this.originatingSystemItemIds = originatingSystemItemIds;
     this.originalContent          = originalContent;
 }
Example #2
0
 public FeederAudit(FeederAuditDetails originatingSystemAudit,
     AssumedTypes.List<DataTypes.Basic.DvIdentifier> originatingSystemItemIds,            
     DataTypes.Encapsulated.DvEncapsulated originalContent)
     : this()
 {
     Check.Require(originatingSystemAudit != null);
     this.originatingSystemAudit = originatingSystemAudit;
     this.originatingSystemItemIds = originatingSystemItemIds;
     this.originalContent = originalContent;
 }
Example #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();
        }
Example #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();
        }