Пример #1
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

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

            this.description = Locatable.GetLocatableObjectByType(descriptionType) as ItemStructure;
            if (this.description == null)
            {
                throw new InvalidOperationException("descriptionType must be type of ItemStructure: " + descriptionType);
            }
            this.description.ReadXml(reader);
            this.description.Parent = this;

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

            DesignByContract.Check.Assert(reader.LocalName == "action_archetype_id",
                                          "Expected LocalName is 'action_archetype_id', but it is " + reader.LocalName);
            this.actionArchetypeId = reader.ReadElementString("action_archetype_id", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();
        }
Пример #2
0
        public Activity(DvText name, string archetypeNodeId, UidBasedId uid,
          Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
            ItemStructure description, DvParsable timing, string actionArchetypeId)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit)
        {
            Check.Require(description != null, "description must not be null");
            Check.Require(timing != null, "timing must not be null");
            Check.Require(!string.IsNullOrEmpty(actionArchetypeId), "action_archetype_id must not be null or empty");

            this.description = description;
            this.description.Parent = this;
            this.timing = timing;
            this.actionArchetypeId = actionArchetypeId;

            SetAttributeDictionary();
            CheckInvariants();
        }
Пример #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
        public Instruction(DvText name, string archetypeNodeId, UidBasedId uid,
         Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
         CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider,
         Participation[] otherParticipations, ObjectRef workflowId, ItemStructure protocol,
         ObjectRef guidelineId, DvText narrative, DvDateTime expiryTime,
         Activity[] activities, DvParsable wfDefinition)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language,
          encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId)
        {
            Check.Require(narrative != null, "narrative must not be null");

            this.narrative = narrative;
            this.expiryTime = expiryTime;
            if (activities != null)
            {
                this.activities = RmFactory.LocatableList<Activity>(this, activities);
            }
            this.wfDefinition = wfDefinition;

            SetAttributeDictionary();
            CheckInvariants();
        }
Пример #5
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;
            }
        }
Пример #6
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "description",
              "Expected LocalName is 'description', but it is " + reader.LocalName);
            string descriptionType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
            this.description = Locatable.GetLocatableObjectByType(descriptionType) as ItemStructure;
            if (this.description == null)
                throw new InvalidOperationException("descriptionType must be type of ItemStructure: " + descriptionType);
            this.description.ReadXml(reader);
            this.description.Parent = this;

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

            DesignByContract.Check.Assert(reader.LocalName == "action_archetype_id",
               "Expected LocalName is 'action_archetype_id', but it is " + reader.LocalName);
            this.actionArchetypeId = reader.ReadElementString("action_archetype_id", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();
        }