Ejemplo 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();
        }
Ejemplo n.º 2
0
        public Attestation(string systemId, DataTypes.Quantity.DateTime.DvDateTime timeCommitted, 
            DataTypes.Text.DvCodedText changedType, PartyProxy committer, DataTypes.Text.DvText description,
            DataTypes.Encapsulated.DvMultimedia attestedView, string proof, 
            AssumedTypes.List<DataTypes.Uri.DvEhrUri> items, DataTypes.Text.DvText reason, bool isPending)
            : base(systemId, timeCommitted, changedType, committer, description)
        {
            Check.Require(items == null | items.Count >0, "if items is not null, it must not be empty.");
            Check.Require(reason != null, "reason must not be null.");

            this.attestedView = attestedView;
            this.proof = proof;
            this.items = items;
            this.reason = reason;
            this.isPending = isPending;
            this.isPendingSet = true;

            this.CheckDefaultInvariants();
        }
Ejemplo n.º 3
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();
        }