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

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

            if (reader.LocalName == "transition")
            {
                this.transition = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.transition.ReadXml(reader);
            }

            if (reader.LocalName == "careflow_step")
            {
                this.careflowStep = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.careflowStep.ReadXml(reader);
            }

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

            this.SetAttributeDictionary();
            this.CheckInvariants();
        }
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
        public PartyRelated(string name, List<DvIdentifier> identifiers, DvCodedText relationship,
            PartyRef externalRef)
        {
            Check.Require(relationship != null, "relationship must not be null");

            this.relationship = relationship;

            SetBaseData(name, identifiers, externalRef);
        }
Exemple #4
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "relationship",
                                          "Expected localName is relationship not " + reader.LocalName);
            this.relationship = new DvCodedText();
            this.relationship.ReadXml(reader);
        }
Exemple #5
0
        public AuditDetails(string systemId, DataTypes.Text.DvCodedText changeType)
            : this()
        {
            DesignByContract.Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");

            this.systemId      = systemId;
            this.timeCommitted = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.changeType    = changeType;
        }
Exemple #6
0
        public AuditDetails(string systemId, DataTypes.Text.DvCodedText changeType)
            : this()
        {
            DesignByContract.Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");

            this.systemId = systemId;
            this.timeCommitted = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
            this.changeType = changeType;
        }
Exemple #7
0
        // System ID is not set here, expecting it top be set by the server
        public AuditDetails(DataTypes.Text.DvCodedText changeType, PartyProxy committer)
            : this()
        {
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");
            DesignByContract.Check.Require(committer != null, "committer must not be null");

            this.changeType = changeType;
            this.committer = committer;

            this.CheckDefaultInvariants();
        }
Exemple #8
0
        // System ID is not set here, expecting it top be set by the server
        public AuditDetails(DataTypes.Text.DvCodedText changeType, PartyProxy committer)
            : this()
        {
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");
            DesignByContract.Check.Require(committer != null, "committer must not be null");

            this.changeType = changeType;
            this.committer  = committer;

            this.CheckDefaultInvariants();
        }
Exemple #9
0
        public Element(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
            Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
            DataValue value, DvCodedText nullFlavour)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit)
        {
            this.value = value;
            this.nullFlavour = nullFlavour;

            SetAttributeDictionary();
            CheckInvariants();
        }
Exemple #10
0
        public IsmTransition(DataTypes.Text.DvCodedText currentState, DataTypes.Text.DvCodedText transition,
            DataTypes.Text.DvCodedText careflowStep)
            : this()
        {
            Check.Require(currentState != null, "current_state must not be null");

            this.currentState = currentState;
            this.transition = transition;
            this.careflowStep = careflowStep;

            SetAttributeDictionary();
            this.SetAttributeDictionary();
        }
Exemple #11
0
        public IsmTransition(DataTypes.Text.DvCodedText currentState, DataTypes.Text.DvCodedText transition,
                             DataTypes.Text.DvCodedText careflowStep)
            : this()
        {
            Check.Require(currentState != null, "current_state must not be null");

            this.currentState = currentState;
            this.transition   = transition;
            this.careflowStep = careflowStep;

            SetAttributeDictionary();
            this.SetAttributeDictionary();
        }
Exemple #12
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "value")
            {
                this.value = DataTypes.Basic.DataValue.ReadDataValue(reader);
            }

            if (reader.LocalName == "null_flavour")
            {
                this.nullFlavour = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.nullFlavour.ReadXml(reader);
            }
        }
        public OriginalVersion(Support.Identification.ObjectVersionId uid,
                               Support.Identification.ObjectVersionId precedingVersionUid,
                               DataTypes.Text.DvCodedText lifecycleState, Common.Generic.AuditDetails commitAudit,
                               Support.Identification.ObjectRef contribution, T data)
            : base(commitAudit, contribution)
        {
            Check.Require(uid != null, "uid must not be null");
            Check.Require(data != null, "data must not be null");

            // set local data
            this.data = data;
            this.uid  = uid;
            this.precedingVersionUid = precedingVersionUid;
            this.lifecycleState      = lifecycleState;
        }
Exemple #14
0
        public Participation(DataTypes.Text.DvText function,
            DataTypes.Quantity.DvInterval<DataTypes.Quantity.DateTime.DvDateTime> time,
            DataTypes.Text.DvCodedText mode, PartyProxy performer)
            : this()
        {
            Check.Require(function != null, "function must not be null.");
            Check.Require(mode != null, "mode must not be null");
            Check.Require(performer != null, "performer must not be null");

            this.function = function;
            this.time = time;
            this.mode = mode;
            this.performer = performer;

            this.CheckStrictInvariants();
        }
Exemple #15
0
        public Participation(DataTypes.Text.DvText function,
                             DataTypes.Quantity.DvInterval <DataTypes.Quantity.DateTime.DvDateTime> time,
                             DataTypes.Text.DvCodedText mode, PartyProxy performer)
            : this()
        {
            Check.Require(function != null, "function must not be null.");
            Check.Require(mode != null, "mode must not be null");
            Check.Require(performer != null, "performer must not be null");

            this.function  = function;
            this.time      = time;
            this.mode      = mode;
            this.performer = performer;

            this.CheckStrictInvariants();
        }
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
            object value)
        {
            if (value != null)
            {
                try
                {
                    if (value is string)
                    {
                        string s = (string)value;
                        string[] parts = s.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries);

                        if (parts.Length == 3)
                        {
                            DataTypes.Text.DvCodedText codedValue
                                = new DataTypes.Text.DvCodedText(parts[2], parts[1], parts[0]);

                            return codedValue;
                        }

                        if (parts.Length == 2 && parts[0] == "local")
                        {
                            DataTypes.Text.DvCodedText codedValue
                                = new DataTypes.Text.DvCodedText("", parts[1], parts[0]);

                            return codedValue;
                        }

                        DesignByContract.Check.Assert(parts.Length <= 1, "Invalid text string: " + s);

                        DataTypes.Text.DvText textValue = new DataTypes.Text.DvText(s);

                        return textValue;
                    }

                    if (value.GetType().IsAssignableFrom(typeof(DataTypes.Text.DvText)))
                    {
                        return value;
                    }
                }
                catch (Exception ex)
                {
                    throw new ArgumentException("Can not convert '" + (string)value + "' to type DvText", ex);
                }
            }
            return base.ConvertFrom(context, culture, value);
        }
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
                                           object value)
        {
            if (value != null)
            {
                try
                {
                    if (value is string)
                    {
                        string   s     = (string)value;
                        string[] parts = s.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries);

                        if (parts.Length == 3)
                        {
                            DataTypes.Text.DvCodedText codedValue
                                = new DataTypes.Text.DvCodedText(parts[2], parts[1], parts[0]);

                            return(codedValue);
                        }

                        if (parts.Length == 2 && parts[0] == "local")
                        {
                            DataTypes.Text.DvCodedText codedValue
                                = new DataTypes.Text.DvCodedText("", parts[1], parts[0]);

                            return(codedValue);
                        }

                        DesignByContract.Check.Assert(parts.Length <= 1, "Invalid text string: " + s);

                        DataTypes.Text.DvText textValue = new DataTypes.Text.DvText(s);

                        return(textValue);
                    }

                    if (value.GetType().IsAssignableFrom(typeof(DataTypes.Text.DvText)))
                    {
                        return(value);
                    }
                }
                catch (Exception ex)
                {
                    throw new ArgumentException("Can not convert '" + (string)value + "' to type DvText", ex);
                }
            }
            return(base.ConvertFrom(context, culture, value));
        }
Exemple #18
0
        public AuditDetails(string systemId, DataTypes.Quantity.DateTime.DvDateTime timeCommitted, 
            DataTypes.Text.DvCodedText changeType, PartyProxy committer, DataTypes.Text.DvText description)
            : this()
        {
            DesignByContract.Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            DesignByContract.Check.Require(timeCommitted != null, "timeCommitted must not be null");
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");
            DesignByContract.Check.Require(committer != null, "committer must not be null");

            this.systemId = systemId;
            this.timeCommitted = timeCommitted;
            this.changeType = changeType;
            this.committer = committer;
            this.description = description;

            this.CheckDefaultInvariants();
        }
Exemple #19
0
        public AuditDetails(string systemId, DataTypes.Quantity.DateTime.DvDateTime timeCommitted,
                            DataTypes.Text.DvCodedText changeType, PartyProxy committer, DataTypes.Text.DvText description)
            : this()
        {
            DesignByContract.Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            DesignByContract.Check.Require(timeCommitted != null, "timeCommitted must not be null");
            DesignByContract.Check.Require(changeType != null, "changeType must not be null");
            DesignByContract.Check.Require(committer != null, "committer must not be null");

            this.systemId      = systemId;
            this.timeCommitted = timeCommitted;
            this.changeType    = changeType;
            this.committer     = committer;
            this.description   = description;

            this.CheckDefaultInvariants();
        }
Exemple #20
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();
        }
Exemple #21
0
        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 #22
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);
            }
        }
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
                                         object value, Type destinationType)
        {
            DataTypes.Text.DvText textValue = value as DataTypes.Text.DvText;
            if (textValue != null)
            {
                if (destinationType == typeof(string))
                {
                    DataTypes.Text.DvCodedText codedValue = textValue as DataTypes.Text.DvCodedText;

                    if (codedValue == null)
                    {
                        return(textValue.Value);
                    }

                    else
                    {
                        string s = codedValue.DefiningCode.TerminologyId.Value + "::" + codedValue.DefiningCode.CodeString
                                   + "::" + codedValue.Value;

                        s = s.TrimEnd(':');

                        return(s);
                    }
                }

                if (destinationType == typeof(System.Object))
                {
                    return(textValue as object);
                }

                if (destinationType == textValue.GetType())
                {
                    return(textValue);
                }
            }

            return(base.ConvertTo(context, culture, value, destinationType));
        }
Exemple #24
0
        public EventContext(DvDateTime startTime, DvDateTime endTime,
            DvCodedText setting, string location, PartyIdentified healthCareFacility,
            ItemStructure otherContext, Participation[] participations)
            : this()
        {
            Check.Require(startTime != null, "start_time must not be null");
            Check.Require(setting != null, "setting must not be null");

            this.startTime = startTime;
            this.endTime = endTime;
            this.setting = setting;
            this.location = location;
            this.healthCareFacility = healthCareFacility;
            this.otherContext = otherContext;
            if (this.otherContext != null)
                this.otherContext.Parent = this;
            if (participations != null)
                this.participations = new OpenEhr.AssumedTypes.List<Participation>(participations);

            SetAttributeDictionary();
            this.CheckInvariants();
        }
Exemple #25
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            DesignByContract.Check.Assert(reader.LocalName == "relationship",
                "Expected localName is relationship not " + reader.LocalName);
            this.relationship = new DvCodedText();
            this.relationship.ReadXml(reader);
        }
Exemple #26
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);
            }
        }
Exemple #27
0
        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 #28
0
        internal void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

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

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

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

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

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

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

            }

            if (reader.LocalName == "participations")
            {
                this.participations = new OpenEhr.AssumedTypes.List<OpenEhr.RM.Common.Generic.Participation>();
                do
                {
                    OpenEhr.RM.Common.Generic.Participation p = new OpenEhr.RM.Common.Generic.Participation();
                    p.ReadXml(reader);
                    this.participations.Add(p);

                } while (reader.LocalName == "participations");
            }

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

            this.SetAttributeDictionary();
        }
Exemple #29
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

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

            if (reader.LocalName == "transition")
            {
                this.transition = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.transition.ReadXml(reader);
            }

            if (reader.LocalName == "careflow_step")
            {
                this.careflowStep = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.careflowStep.ReadXml(reader);
            }

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

            this.SetAttributeDictionary();
            this.CheckInvariants();
        }
Exemple #30
0
        internal void ReadXml(XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

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

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

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

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

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

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

            if (reader.LocalName == "participations")
            {
                this.participations = new OpenEhr.AssumedTypes.List <OpenEhr.RM.Common.Generic.Participation>();
                do
                {
                    OpenEhr.RM.Common.Generic.Participation p = new OpenEhr.RM.Common.Generic.Participation();
                    p.ReadXml(reader);
                    this.participations.Add(p);
                } while (reader.LocalName == "participations");
            }


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

            this.SetAttributeDictionary();
        }
Exemple #31
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            if (reader.LocalName == "value")
            {
                this.value = DataTypes.Basic.DataValue.ReadDataValue(reader);
            }

            if (reader.LocalName == "null_flavour")
            {
                this.nullFlavour = new OpenEhr.RM.DataTypes.Text.DvCodedText();
                this.nullFlavour.ReadXml(reader);
            }
        }