示例#1
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();
        }
示例#2
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();
        }
示例#3
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();
        }
示例#4
0
        protected XVersionedObject(HierObjectId uid, ObjectRef ownerId, DvDateTime timeCreated,
                                   int totalVersionCount, List <OriginalVersion <T> > versions)
            : this(uid, ownerId, timeCreated, totalVersionCount)
        {
            Check.Require(totalVersionCount >= 1, "totalVersionCount must not be less than 1");

            this.versions = versions;
        }
示例#5
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();
 }
示例#6
0
        public VersionedObject(HierObjectId uid, ObjectRef ownerId, DvDateTime timeCreated,
                               System.Collections.Generic.IEnumerable <Version <T> > versions)
        {
            this.uid         = uid;
            this.ownerId     = ownerId;
            this.timeCreated = timeCreated;

            versions = new List <Version <T> >(versions);
        }
 private void assertDateTimeValue(AttributeValue attr, string value)
 {
     Assert.IsInstanceOfType(attr.getValue(), typeof(PrimitiveObjectBlock));
     PrimitiveObjectBlock pob = (PrimitiveObjectBlock)attr.getValue();
     Assert.IsInstanceOfType(pob.getSimpleValue(), typeof(DateTimeValue));
     DateTimeValue actual = (DateTimeValue)pob.getSimpleValue();
     DvDateTime expected = new DvDateTime(value.ToString());
     Assert.AreEqual(actual.getValue(), expected);
 }
示例#8
0
        private void assertDateTimeValue(AttributeValue attr, string value)
        {
            Assert.IsInstanceOfType(attr.getValue(), typeof(PrimitiveObjectBlock));
            PrimitiveObjectBlock pob = (PrimitiveObjectBlock)attr.getValue();

            Assert.IsInstanceOfType(pob.getSimpleValue(), typeof(DateTimeValue));
            DateTimeValue actual   = (DateTimeValue)pob.getSimpleValue();
            DvDateTime    expected = new DvDateTime(value.ToString());

            Assert.AreEqual(actual.getValue(), expected);
        }
示例#9
0
        public VersionedObject(Extract.Common.XVersionedObject <T> xVersionedObject)
        {
            this.versions = new List <Version <T> >();
            foreach (OriginalVersion <T> version in xVersionedObject.Versions)
            {
                this.versions.Add(version);
            }

            this.ownerId     = xVersionedObject.OwnerId;
            this.timeCreated = xVersionedObject.TimeCreated;
            this.uid         = xVersionedObject.Uid;
        }
示例#10
0
        protected XVersionedObject(HierObjectId uid, ObjectRef ownerId, DvDateTime timeCreated,
                                   int totalVersionCount)
        {
            Check.Require(uid != null, "uid must not be null");
            Check.Require(ownerId != null, "ownerId must not be null");
            Check.Require(timeCreated != null, "uid must not be null");
            Check.Require(totalVersionCount >= 1, "totalVersionCount must not be less than 1");

            this.uid               = uid;
            this.ownerId           = ownerId;
            this.timeCreated       = timeCreated;
            this.totalVersionCount = totalVersionCount;
        }
示例#11
0
 internal static void MapDateTime(ref DvDateTime src, ref StringBuilder sb)
 {
     if (sb == null)
     {
         sb = new StringBuilder();
     }
     else
     {
         sb.Clear();
     }
     if (!src.IsNA)
     {
         sb.AppendFormat("\"{0:o}\"", (DateTime)src);
     }
 }
示例#12
0
文件: EHR.cs 项目: nickvane/OpenEHR
        public EHR(string systemId, HierObjectId ehrId, DvDateTime timeCreated, ObjectRef ehrAccess, ObjectRef ehrStatus, 
            ObjectRef directory, List<ObjectRef> compositions, List<ObjectRef> contributions)
        {
            Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            Check.Require(ehrId != null, "ehrId must not be null");
            Check.Require(timeCreated != null, "timeCreated must not be null");
            Check.Require(ehrAccess != null, "ehrAccess must not be null");
            Check.Require(ehrStatus != null, "ehrStatus must not be null");

            this.systemId = systemId;
            this.ehrId = ehrId;
            this.timeCreated = timeCreated;
            this.ehrAccess = ehrAccess;
            this.ehrStatus = ehrStatus;
            this.directory = directory;
            this.compositions = compositions;
            this.contributions = contributions;
        }
示例#13
0
        public EHR(string systemId, HierObjectId ehrId, DvDateTime timeCreated, ObjectRef ehrAccess, ObjectRef ehrStatus,
                   ObjectRef directory, List <ObjectRef> compositions, List <ObjectRef> contributions)
        {
            Check.Require(!string.IsNullOrEmpty(systemId), "systemId must not be null or empty");
            Check.Require(ehrId != null, "ehrId must not be null");
            Check.Require(timeCreated != null, "timeCreated must not be null");
            Check.Require(ehrAccess != null, "ehrAccess must not be null");
            Check.Require(ehrStatus != null, "ehrStatus must not be null");

            this.systemId      = systemId;
            this.ehrId         = ehrId;
            this.timeCreated   = timeCreated;
            this.ehrAccess     = ehrAccess;
            this.ehrStatus     = ehrStatus;
            this.directory     = directory;
            this.compositions  = compositions;
            this.contributions = contributions;
        }
示例#14
0
        public XVersionedObject(ObjectRef ownerId, DvDateTime timeCreated, int totalVersionCount,
                                OriginalVersion <T>[] versions)
        {
            Check.Require(versions != null, "versions must not be null");
            Check.Require(versions.Length > 0, "versions must not be empty");
            Check.Require(ownerId != null, "ownerId must not be null");
            Check.Require(timeCreated != null, "uid must not be null");
            Check.Require(totalVersionCount >= 1, "totalVersionCount must not be less than 1");


            this.uid               = new HierObjectId(versions[0].OwnerId.Value);
            this.ownerId           = ownerId;
            this.timeCreated       = timeCreated;
            this.totalVersionCount = totalVersionCount;

            foreach (OriginalVersion <T> version in versions)
            {
                this.Add(version);
            }
        }
示例#15
0
        /// <summary>
        /// Get the origin value based on the history.Events time or IntervalStartTime
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="history"></param>
        /// <returns></returns>
        static public DvDateTime CalculateOrigin(History <T> history)
        {
            Check.Require(history != null, "history must not be null");

            DvDateTime originValue = null;

            if (history.Events != null && history.Events.Count > 0)
            {
                foreach (Event <T> anEvent in history.Events)
                {
                    DvDateTime        eventTime;
                    IntervalEvent <T> intervalEvent = anEvent as IntervalEvent <T>;
                    if (intervalEvent != null)
                    {
                        eventTime = intervalEvent.IntervalStartTime();
                    }
                    else
                    {
                        eventTime = anEvent.Time;
                    }

                    CComplexObject constraint = ((IRmType)anEvent).Constraint as CComplexObject;
                    if (constraint != null)
                    {
                        CAttribute offsetConstraint = constraint.GetAttribute("offset");
                        if (offsetConstraint != null && offsetConstraint.Children != null && offsetConstraint.Children.Count == 1)
                        {
                            CComplexObject offsetDuration = offsetConstraint.Children[0] as CComplexObject;
                            eventTime = eventTime.Subtract((DvDuration)offsetDuration.DefaultValue);
                        }
                    }

                    if (originValue == null || originValue > eventTime)
                    {
                        originValue = new DvDateTime(eventTime.Value);
                    }
                }
            }
            Check.Ensure(originValue != null, "originValue must not be null");
            return(originValue);
        }
示例#16
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();
        }
示例#17
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;
            }
        }
示例#18
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();
        }
示例#19
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();
        }
示例#20
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();
        }
示例#21
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();
        }
示例#22
0
        public override DvDuration Offset()
        {
            History <T> parent = this.Parent as History <T>;

            if (parent == null)
            {
                throw new ApplicationException("parent must not be null.");
            }

            DataTypes.Quantity.DateTime.DvDuration offset;
            if (parent.Origin != null)
            {
                DvDateTime intervalStartTime = this.IntervalStartTime();
                Check.Assert(intervalStartTime != null, "intervalStartTime must not be null.");
                offset = intervalStartTime.Diff(parent.Origin);
                Check.Ensure(offset != null, "offset must not be null");

                return(offset);
            }
            else
            {
                return(base.Offset());
            }
        }
示例#23
0
 protected void MapDateTime(ref DvDateTime src, ref StringBuilder sb)
 {
     TextSaverUtils.MapDateTime(ref src, ref sb);
 }
示例#24
0
 public Version <T> VersionAtTime(DvDateTime time)
 {
     throw new Exception("The method or operation is not implemented.");
 }
示例#25
0
 public VersionedObject()
 {
     this.timeCreated = new DvDateTime();
     this.versions    = new List <Version <T> >();
 }
示例#26
0
 IVersion <T> IVersionedObject <T> .VersionAtTime(DvDateTime time)
 {
     return(VersionAtTime(time));
 }