Exemplo n.º 1
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "attested_view")
            {
                this.attestedView = new OpenEhr.RM.DataTypes.Encapsulated.DvMultimedia();
                this.attestedView.ReadXml(reader);
            }

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

            if (reader.LocalName == "items")
            {
                this.items = new OpenEhr.AssumedTypes.List <OpenEhr.RM.DataTypes.Uri.DvEhrUri>();
                do
                {
                    DataTypes.Uri.DvEhrUri uri = new OpenEhr.RM.DataTypes.Uri.DvEhrUri();
                    uri.ReadXml(reader);

                    this.items.Add(uri);
                } while (reader.LocalName == "items");
            }

            if (reader.LocalName != "reason")
            {
                throw new ValidationException("Excepted element name is reason, but it is: " + reader.LocalName);
            }
            string reasonType = RmXmlSerializer.ReadXsiType(reader);

            if (!string.IsNullOrEmpty(reasonType))
            {
                this.reason = RmFactory.DataValue(reasonType) as DataTypes.Text.DvText;
            }
            else
            {
                this.reason = new OpenEhr.RM.DataTypes.Text.DvText();
            }
            this.reason.ReadXml(reader);

            if (reader.LocalName != "is_pending")
            {
                throw new ValidationException("Excepted element name is is_pending, but it is: " + reader.LocalName);
            }
            this.isPending = reader.ReadElementContentAsBoolean("is_pending", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();
        }
Exemplo n.º 2
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "attested_view")
            {
                this.attestedView = new OpenEhr.RM.DataTypes.Encapsulated.DvMultimedia();
                this.attestedView.ReadXml(reader);
            }

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

            if (reader.LocalName == "items")
            {
                this.items = new OpenEhr.AssumedTypes.List<OpenEhr.RM.DataTypes.Uri.DvEhrUri>();
                do
                {
                    DataTypes.Uri.DvEhrUri uri = new OpenEhr.RM.DataTypes.Uri.DvEhrUri();
                    uri.ReadXml(reader);

                    this.items.Add(uri);
                } while (reader.LocalName == "items");
            }

            if (reader.LocalName != "reason")
                throw new ValidationException("Excepted element name is reason, but it is: " + reader.LocalName);
            string reasonType = RmXmlSerializer.ReadXsiType(reader);
            if (!string.IsNullOrEmpty(reasonType))
            {
                this.reason = RmFactory.DataValue(reasonType) as DataTypes.Text.DvText;
            }
            else
                this.reason = new OpenEhr.RM.DataTypes.Text.DvText();
            this.reason.ReadXml(reader);

            if (reader.LocalName != "is_pending")
                throw new ValidationException("Excepted element name is is_pending, but it is: " + reader.LocalName);
            this.isPending = reader.ReadElementContentAsBoolean("is_pending", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();
        }