예제 #1
0
 public PointEvent(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
                   Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
                   DvDateTime time, T data,
                   ItemStructure.ItemStructure state)
     : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, time, data, state)
 {
     SetAttributeDictionary();
     CheckInvariants();
 }
예제 #2
0
        public History(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
                       Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
                       DvDateTime origin, DvDuration period, DvDuration duration,
                       Event <T>[] events, ItemStructure.ItemStructure summary)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit)
        {
            this.period   = period;
            this.duration = duration;
            this.summary  = summary;
            if (this.summary != null)
            {
                this.summary.Parent = this;
            }
            if (events != null)
            {
                this.events = RmFactory.LocatableList <Event <T> >(this, events);
            }
            this.origin = origin;

            SetAttributeDictionary();
            CheckInvariants();
        }
예제 #3
0
        protected Event(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
                        Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
                        DvDateTime time, T data,
                        ItemStructure.ItemStructure state)
            : base(name, archetypeNodeId,
                   uid, links, archetypeDetails, feederAudit)
        {
            Check.Require(time != null, "time must not be null");

            this.time = time;

            this.data = data;
            if (this.data != null)
            {
                this.data.Parent = this;
            }
            this.state = state;
            if (this.state != null)
            {
                this.state.Parent = this;
            }
        }
예제 #4
0
        public IntervalEvent(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
                             Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
                             DvDateTime time, T data,
                             ItemStructure.ItemStructure state, DvDuration width,
                             int?sampleCount, DvCodedText mathFunction)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, time, data, state)
        {
            Check.Require(width != null, "width must not be null");
            Check.Require(mathFunction != null, "math_function must not be null");

            this.width = width;

            if (sampleCount != null)
            {
                this.sampleCount    = (int)sampleCount;
                this.sampleCountSet = true;
            }

            this.mathFunction = mathFunction;

            SetAttributeDictionary();
            CheckInvariants();
        }
예제 #5
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            // TODO: CM: 09/07/09 need to disable this assertion check when EhrTypes is not used
            // in deserialization since TDS origin is optional. When the origin is not existing in
            // openEHR instance, need to get the origin by CalculatOrigin function. At the moment,
            // TddTransformer still uses EhrTypes for the deserialization.
            DesignByContract.Check.Assert(reader.LocalName == "origin",
                                          "Expected LocalName is 'origin', but it is " + reader.LocalName);

            // HKF: 7 Aug 2009 - need to allow origin to be nil for TDD and EhrGateDataObjects transformation prior to OperationalTemplate augmentation
            if (reader.HasAttributes && reader.GetAttribute("nil", RmXmlSerializer.XsiNamespace) == "true")
            {
                // leave origin as null and skip
                reader.Skip();
            }
            else
            {
                this.origin = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime();
                this.origin.ReadXml(reader);
            }

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

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

            if (reader.LocalName == "events")
            {
                LocatableList <Event <ItemStructure.ItemStructure> > events =
                    new LocatableList <Event <OpenEhr.RM.DataStructures.ItemStructure.ItemStructure> >();
                do
                {
                    string eventType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

                    Event <ItemStructure.ItemStructure> anEvent =
                        OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(eventType)
                        as Event <ItemStructure.ItemStructure>;
                    if (anEvent == null)
                    {
                        throw new InvalidOperationException("anEvent must not be null.");
                    }
                    anEvent.ReadXml(reader);

                    anEvent.Parent = this;
                    events.Add(anEvent);
                } while (reader.LocalName == "events");

                this.events = events as AssumedTypes.List <Event <T> >;
            }

            if (reader.LocalName == "summary")
            {
                string summaryType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                this.summary = Locatable.GetLocatableObjectByType(summaryType) as ItemStructure.ItemStructure;
                if (this.summary == null)
                {
                    throw new InvalidOperationException("History summary type must be type of ItemStructure: " + summaryType);
                }
                this.summary.ReadXml(reader);
                this.summary.Parent = this;
            }
        }