Exemplo n.º 1
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            DesignByContract.Check.Assert(reader.LocalName == "instruction_id",
                                          "Expected LocalName is 'instruction_id', but it is " + reader.LocalName);
            this.instructionId = new OpenEhr.RM.Support.Identification.LocatableRef();
            this.instructionId.ReadXml(reader);

            DesignByContract.Check.Assert(reader.LocalName == "activity_id",
                                          "Expected LocalName is 'activity_id', but it is " + reader.LocalName);
            this.activityId = reader.ReadElementString("activity_id", RmXmlSerializer.OpenEhrNamespace);

            if (reader.LocalName == "wf_details")
            {
                string wfDetailsType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                this.wfDetails = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(wfDetailsType)
                                 as OpenEhr.RM.DataStructures.ItemStructure.ItemStructure;
                if (this.wfDetails == null)
                {
                    throw new InvalidOperationException("wfDetailsType must by type of ItemStructure: " + wfDetails);
                }
                this.wfDetails.ReadXml(reader);
                this.wfDetails.Parent = this;
            }

            DesignByContract.Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement, "Expected endElement of InstructionDetails.");
            reader.ReadEndElement();
            reader.MoveToContent();

            // CM: 26/11/09 need to set attributDictionary since InstructionDetails is not type of locatable
            this.SetAttributeDictionary();
            this.CheckInvariants();
        }
Exemplo n.º 2
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "time",
                                          "Expected LocalName is 'time', but it is " + reader.LocalName);
            this.time = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.time.ReadXml(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 = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(descriptionType)
                               as ItemStructure;
            if (this.description == null)
            {
                throw new InvalidOperationException("descriptionType in Action must be type of ItemStructure: " + descriptionType);
            }
            this.description.ReadXml(reader);
            this.description.Parent = this;


            if (reader.LocalName == "ism_transition")
            {
                this.ismTransition = new IsmTransition();
                this.ismTransition.ReadXml(reader);
            }

            if (reader.LocalName == "instruction_details")
            {
                this.instructionDetails = new InstructionDetails();
                this.instructionDetails.ReadXml(reader);
            }
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "protocol")
            {
                string protocolType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                this.protocol = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(protocolType)
                                as ItemStructure;
                if (this.protocol == null)
                {
                    throw new InvalidOperationException("otherContextType must be subtype of ItemStructure " + protocolType);
                }
                this.protocol.ReadXml(reader);
                this.protocol.Parent = this;
            }

            if (reader.LocalName == "guideline_id")
            {
                string guidelineIdType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                this.guidelineId = OpenEhr.RM.Support.Identification.ObjectRef.GetObjectRefByType(guidelineIdType);

                this.guidelineId.ReadXml(reader);
            }
        }
Exemplo n.º 5
0
        public Action(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, DvDateTime time, ItemStructure description,
            IsmTransition ismTransition, InstructionDetails instructionDetails)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language,
          encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId)
        {
            Check.Require(time != null, "time must not be null");
            Check.Require(description != null, "description must not be null");
            Check.Require(ismTransition != null, "ismTransition must not be null");

            this.time = time;
            this.description = description;
            if (this.description != null)
                this.description.Parent = this;
            this.ismTransition = ismTransition;
            if (this.ismTransition != null)
                this.ismTransition.Parent = this;
            this.instructionDetails = instructionDetails;
            if (this.instructionDetails != null)
                this.instructionDetails.Parent = this;

            SetAttributeDictionary();
            CheckInvariants();
        }
Exemplo n.º 6
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            Check.Assert(reader.LocalName == "time", "Expected LocalName is 'time', but it's " + reader.LocalName);
            this.time = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.time.ReadXml(reader);

            Check.Assert(reader.LocalName == "data", "Expected LocalName is 'data', but it's " + reader.LocalName);
            string dataType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

            this.data = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(dataType)
                        as T;
            this.data.ReadXml(reader);
            this.data.Parent = this;

            if (reader.LocalName == "state")
            {
                string stateType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                // CM: 01/04/08 fixed a bug
                this.state = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(stateType)
                             as ItemStructure.ItemStructure;
                if (this.state == null)
                {
                    throw new InvalidOperationException("stateType must be type of ItemStructure: " + stateType);
                }
                this.state.ReadXml(reader);

                this.state.Parent = this;
            }
        }
Exemplo n.º 7
0
        public InstructionDetails(LocatableRef instructionId,
            string activityId, ItemStructure wfDetails)
            : this()
        {
            Check.Require(instructionId != null, "instruction_id must not be null");
            Check.Require(!string.IsNullOrEmpty(activityId), "activity_id must not be null or empty");

            this.instructionId = instructionId;
            this.activityId = activityId;
            this.wfDetails = wfDetails;
            if (this.wfDetails != null)
                this.wfDetails.Parent = this;

            SetAttributeDictionary();
        }
Exemplo n.º 8
0
        public AdminEntry(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
           Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
            CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider,
            Participation[] otherParticipations, ObjectRef workflowId,
            ItemStructure data)
            : base(name, archetypeNodeId, uid, links, archetypeDetails,
            feederAudit, language, encoding, subject, proider, otherParticipations, workflowId)
        {
            Check.Require(data != null, "data must not be null");

            this.data = data;
            this.data.Parent = this;

            SetAttributeDictionary();
            this.CheckInvariants();
        }
Exemplo n.º 9
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

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

            this.data = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(dataType)
                        as ItemStructure;
            if (this.data == null)
            {
                throw new InvalidOperationException("data type must be type of ItemStructure: " + dataType);
            }
            this.data.ReadXml(reader);
            this.data.Parent = this;
        }
Exemplo n.º 10
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();
        }
Exemplo n.º 11
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "data",
                "Expected LocalName is 'data', but it is " + reader.LocalName);
            string dataType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
            this.data = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(dataType)
                as ItemStructure;
            if (this.data == null)
                throw new InvalidOperationException("data type must be type of ItemStructure: " + dataType);
            this.data.ReadXml(reader);
            this.data.Parent = this;
        }
Exemplo n.º 12
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "time",
                "Expected LocalName is 'time', but it is " + reader.LocalName);
            this.time = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.time.ReadXml(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 = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(descriptionType)
                as ItemStructure;
            if (this.description == null)
                throw new InvalidOperationException("descriptionType in Action must be type of ItemStructure: " + descriptionType);
            this.description.ReadXml(reader);
            this.description.Parent = this;

            if (reader.LocalName == "ism_transition")
            {
                this.ismTransition = new IsmTransition();
                this.ismTransition.ReadXml(reader);
            }

            if (reader.LocalName == "instruction_details")
            {
                this.instructionDetails = new InstructionDetails();
                this.instructionDetails.ReadXml(reader);
            }
        }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            DesignByContract.Check.Assert(reader.LocalName == "instruction_id",
                "Expected LocalName is 'instruction_id', but it is " + reader.LocalName);
            this.instructionId = new OpenEhr.RM.Support.Identification.LocatableRef();
            this.instructionId.ReadXml(reader);

            DesignByContract.Check.Assert(reader.LocalName == "activity_id",
                "Expected LocalName is 'activity_id', but it is " + reader.LocalName);
            this.activityId = reader.ReadElementString("activity_id", RmXmlSerializer.OpenEhrNamespace);

            if (reader.LocalName == "wf_details")
            {
                string wfDetailsType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                this.wfDetails = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(wfDetailsType)
                    as OpenEhr.RM.DataStructures.ItemStructure.ItemStructure;
                if (this.wfDetails == null)
                    throw new InvalidOperationException("wfDetailsType must by type of ItemStructure: " + wfDetails);
                this.wfDetails.ReadXml(reader);
                this.wfDetails.Parent = this;
            }

            DesignByContract.Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement, "Expected endElement of InstructionDetails.");
            reader.ReadEndElement();
            reader.MoveToContent();

            // CM: 26/11/09 need to set attributDictionary since InstructionDetails is not type of locatable
            this.SetAttributeDictionary();
            this.CheckInvariants();
        }