Exemple #1
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            Check.Assert(reader.LocalName == "language", "Expected LocalName is 'language' rather than " +
                         reader.LocalName);
            this.language = new OpenEhr.RM.DataTypes.Text.CodePhrase();
            this.language.ReadXml(reader);

            Check.Assert(reader.LocalName == "encoding", "Expected LocalName is 'encoding' rather than " +
                         reader.LocalName);
            this.encoding = new OpenEhr.RM.DataTypes.Text.CodePhrase();
            this.encoding.ReadXml(reader);

            Check.Assert(reader.LocalName == "subject", "Expected LocalName is 'subject' rather than " +
                         reader.LocalName);
            string subjectType = RmXmlSerializer.ReadXsiType(reader);

            this.subject = RmFactory.PartyProxy(subjectType);

            this.subject.ReadXml(reader);


            if (reader.LocalName == "provider")
            {
                string providerType = RmXmlSerializer.ReadXsiType(reader);
                this.provider = RmFactory.PartyProxy(providerType);

                this.provider.ReadXml(reader);
            }

            if (reader.LocalName == "other_participations")
            {
                this.otherParticipations = new OpenEhr.AssumedTypes.List <Participation>();
                do
                {
                    Participation p = new Participation();
                    p.ReadXml(reader);

                    this.otherParticipations.Add(p);
                } while (reader.LocalName == "other_participations");
            }

            if (reader.LocalName == "work_flow_id")
            {
                string workFlowIdType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

                // CM: 06/09/10 when workFlowIdType is null or empty, it's type of OBJECT_REF
                if (string.IsNullOrEmpty(workFlowIdType))
                {
                    this.workflowId = new ObjectRef();
                }
                else
                {
                    this.workflowId = ObjectRef.GetObjectRefByType(workFlowIdType);
                }

                this.workflowId.ReadXml(reader);
            }
        }
Exemple #2
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "language",
                                          "Expected LocalName is 'language', but it is " + reader.LocalName);
            this.language = new OpenEhr.RM.DataTypes.Text.CodePhrase();
            this.language.ReadXml(reader);

            DesignByContract.Check.Assert(reader.LocalName == "territory",
                                          "Expected LocalName is 'territory', but it is " + reader.LocalName);
            this.territory = new OpenEhr.RM.DataTypes.Text.CodePhrase();
            this.territory.ReadXml(reader);

            DesignByContract.Check.Assert(reader.LocalName == "category",
                                          "Expected LocalName is 'category', but it is " + reader.LocalName);
            this.category = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            this.category.ReadXml(reader);

            DesignByContract.Check.Assert(reader.LocalName == "composer",
                                          "Expected LocalName is 'composer', but it is " + reader.LocalName);
            string composerType = RmXmlSerializer.ReadXsiType(reader);

            this.composer = RmFactory.PartyProxy(composerType);

            this.composer.ReadXml(reader);

            if (reader.LocalName == "context")
            {
                this.context = new EventContext();
                this.context.ReadXml(reader);
                this.context.Parent = this;
            }

            if (reader.LocalName == "content")
            {
                OpenEhr.AssumedTypes.Impl.LocatableList <ContentItem> contents =
                    new OpenEhr.AssumedTypes.Impl.LocatableList <ContentItem>();
                do
                {
                    string contentType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                    Check.Assert(!string.IsNullOrEmpty(contentType), "content type must not be null or empty.");

                    ContentItem aContentItem = ContentItem.GetLocatableObjectByType(contentType)
                                               as ContentItem;
                    if (aContentItem == null)
                    {
                        throw new InvalidOperationException("Composition contentType must be type of ContentItem: " + contentType);
                    }
                    aContentItem.ReadXml(reader);

                    aContentItem.Parent = this;
                    contents.Add(aContentItem);
                } while (reader.LocalName == "content" && reader.NodeType == System.Xml.XmlNodeType.Element);

                this.content = contents;
            }
        }
Exemple #3
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Require(reader.LocalName == "system_id", "Expected LocalName is 'system_id' rather than "
                          + reader.LocalName);
            this.systemId = reader.ReadElementString("system_id", RmXmlSerializer.OpenEhrNamespace);

            if (reader.LocalName == "location")
            {
                this.location = new OpenEhr.RM.Common.Generic.PartyIdentified();
                this.location.ReadXml(reader);
            }

            if (reader.LocalName == "provider")
            {
                this.provider = new OpenEhr.RM.Common.Generic.PartyIdentified();
                this.provider.ReadXml(reader);
            }

            if (reader.LocalName == "subject")
            {
                string subjectType = RmXmlSerializer.ReadXsiType(reader);
                Check.Assert(!string.IsNullOrEmpty(subjectType), "the type of subject must not be null or empty.");
                this.subject = RmFactory.PartyProxy(subjectType);
                this.subject.ReadXml(reader);
            }

            if (reader.LocalName == "time")
            {
                this.time = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
                this.time.ReadXml(reader);
            }

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

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

            reader.MoveToContent();
        }
        internal void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "function",
                         "Expected LocalName is 'function' not " + reader.LocalName);
            string functionType = RmXmlSerializer.ReadXsiType(reader);

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

            Check.Assert(reader.LocalName == "performer",
                         "Expected LocalName is 'performer' not " + reader.LocalName);
            string performerType = RmXmlSerializer.ReadXsiType(reader);

            this.performer = RmFactory.PartyProxy(performerType);

            this.performer.ReadXml(reader);

            if (reader.LocalName == "time")
            {
                this.time = new OpenEhr.RM.DataTypes.Quantity.DvInterval <OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime>();
                this.time.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "mode", "Expected LocalName is 'mode' not " + reader.LocalName);
            this.mode = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            this.mode.ReadXml(reader);

            DesignByContract.Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement,
                                          "Expected endElement of PartyIdentified.");
            reader.ReadEndElement();
            reader.MoveToContent();
        }
Exemple #5
0
        protected virtual void ReadXmlBase(System.Xml.XmlReader reader)
        {
            Check.Assert(reader.LocalName == "system_id",
                         "Expected LocalName is 'system_id' not " + reader.LocalName);
            this.systemId = reader.ReadElementString("system_id", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "committer",
                         "Expected LocalName is 'committer' not " + reader.LocalName);
            string committerType = RmXmlSerializer.ReadXsiType(reader);

            this.committer = RmFactory.PartyProxy(committerType);

            this.committer.ReadXml(reader);

            Check.Assert(reader.LocalName == "time_committed",
                         "Expected LocalName is 'time_committed' not " + reader.LocalName);
            this.timeCommitted = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.timeCommitted.ReadXml(reader);

            Check.Assert(reader.LocalName == "change_type",
                         "Expected LocalName is 'change_type' not " + reader.LocalName);
            this.changeType = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            this.changeType.ReadXml(reader);

            if (reader.LocalName == "description")
            {
                string descriptionType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                if (descriptionType == null)
                {
                    this.description = new OpenEhr.RM.DataTypes.Text.DvText();
                }
                else
                {
                    this.description = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                }

                this.description.ReadXml(reader);
            }
        }