示例#1
0
        protected override void ReadXmlBase(XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "items")
            {
                OpenEhr.AssumedTypes.Impl.LocatableList <Item> items =
                    new OpenEhr.AssumedTypes.Impl.LocatableList <Item>();
                while (reader.LocalName == "items" && reader.NodeType == System.Xml.XmlNodeType.Element)
                {
                    string itemType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

                    Item anItem = Item.GetLocatableObjectByType(itemType) as Item;
                    if (anItem == null)
                    {
                        throw new InvalidOperationException("itemType must be type of Item: " + itemType);
                    }
                    anItem.ReadXml(reader);
                    anItem.Parent = this;
                    items.Add(anItem);
                }

                this.items = items;
            }
        }
示例#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;
            }
        }
示例#3
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "narrative",
                                          "Expected LocalName is 'narrative', but it is " + reader.LocalName);
            string narrativeType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

            if (narrativeType != null)
            {
                this.narrative = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            }
            else
            {
                this.narrative = new OpenEhr.RM.DataTypes.Text.DvText();
            }
            this.narrative.ReadXml(reader);

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

            if (reader.LocalName == "wf_definition")
            {
                this.wfDefinition = new OpenEhr.RM.DataTypes.Encapsulated.DvParsable();
                this.wfDefinition.ReadXml(reader);
            }

            if (reader.LocalName == "activities")
            {
                AssumedTypes.Impl.LocatableList <Activity> activities = new OpenEhr.AssumedTypes.Impl.LocatableList <Activity>();
                do
                {
                    Activity activity = new Activity();
                    activity.ReadXml(reader);

                    activity.Parent = this;
                    activities.Add(activity);
                } while (reader.LocalName == "activities" && reader.NodeType == System.Xml.XmlNodeType.Element);

                this.activities = activities;
            }
        }
示例#4
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "narrative",
                "Expected LocalName is 'narrative', but it is " + reader.LocalName);
            string narrativeType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
            if (narrativeType != null)
                this.narrative = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            else
                this.narrative = new OpenEhr.RM.DataTypes.Text.DvText();
            this.narrative.ReadXml(reader);

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

            if (reader.LocalName == "wf_definition")
            {
                this.wfDefinition = new OpenEhr.RM.DataTypes.Encapsulated.DvParsable();
                this.wfDefinition.ReadXml(reader);
            }

            if (reader.LocalName == "activities")
            {
                AssumedTypes.Impl.LocatableList<Activity> activities = new OpenEhr.AssumedTypes.Impl.LocatableList<Activity>();
                do
                {
                    Activity activity = new Activity();
                    activity.ReadXml(reader);

                    activity.Parent = this;
                    activities.Add(activity);

                } while (reader.LocalName == "activities" && reader.NodeType == System.Xml.XmlNodeType.Element);

                this.activities = activities;
            }
        }
示例#5
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "items",
                "Expected LocalName is 'items' rather than " + reader.LocalName);

            OpenEhr.AssumedTypes.Impl.LocatableList < Item >  items = new OpenEhr.AssumedTypes.Impl.LocatableList<Item>();
            while (reader.LocalName == "items" && reader.NodeType== System.Xml.XmlNodeType.Element)
            {
                string itemType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                Item anItem = Item.GetLocatableObjectByType(itemType) as Item;
                if (anItem == null)
                    throw new InvalidOperationException("itemType must be type of Item: " + itemType);
                anItem.ReadXml(reader);

                anItem.Parent = this;
                items.Add(anItem);
            }
            this.items = items;
        }