예제 #1
0
        public EhrStatus(ArchetypeId archetypeId, DvText name, ObjectVersionId uid, PartySelf subject, 
            bool isQueryable, bool isModifiable, ItemStructure otherDetails)
        {
            if (uid != null)
            this.Uid = uid;

            this.subject = subject;

            this.isQueryable = isQueryable;
            this.isQueryableSet = true;

            this.isModifiable = isModifiable;
            this.isModifiableSet = true;

            this.otherDetails = otherDetails;

            base.SetBaseData(archetypeId.Value, name);
        }
예제 #2
0
        /// <summary>
        /// Create new ObjectVersionId that is the next trunk version of the precedingVersionUid
        /// with the same CreatingSystemId
        /// </summary>
        /// <param name="precedingVersionUid">Preceding version UID</param>
        /// <returns>Next trunk object version of the preceding version UID</returns>
        public static ObjectVersionId CreateNew(ObjectVersionId precedingVersionUid)
        {
            long trunkVersion;

            if (!long.TryParse(precedingVersionUid.VersionTreeId.Value, out trunkVersion))
            {
                throw new NotSupportedException("Branched version tree IDs not supported");
            }
            trunkVersion++;

            ObjectVersionId result = new ObjectVersionId(precedingVersionUid.ObjectId,
                                                         precedingVersionUid.CreatingSystemId, new VersionTreeId(trunkVersion.ToString()));

            Check.Ensure(precedingVersionUid.ObjectId.Equals(result.ObjectId),
                         "result objectId must equal preceding objectId");
            Check.Ensure(precedingVersionUid.CreatingSystemId == result.CreatingSystemId,
                         "result creatingSystemId must equal preceding creatingSystemId");
            Check.Ensure(long.Parse(result.VersionTreeId.Value) > long.Parse(precedingVersionUid.VersionTreeId.Value),
                         "result VersionTreeId must be greater than preceding versionTreeId");
            return(result);
        }
예제 #3
0
파일: Party.cs 프로젝트: nickvane/OpenEHR
 public static void SetVersionUid(Party party, ObjectVersionId versionUid)
 {
     Check.Require(party != null, "party must not be null");
     party.VersionUid = versionUid;
 }
예제 #4
0
 protected void RemoveVersion(ObjectVersionId uid, HierObjectId ehrId, string rmTypeName)
 {
     ObjectRef version = new ObjectRef(uid, ehrId.Value, rmTypeName);
     versions.Remove(version);
 }
예제 #5
0
        /// <summary>
        /// Create new ObjectVersionId that is the next trunk version of the precedingVersionUid 
        /// with the same CreatingSystemId
        /// </summary>
        /// <param name="precedingVersionUid">Preceding version UID</param>
        /// <returns>Next trunk object version of the preceding version UID</returns>
        public static ObjectVersionId CreateNew(ObjectVersionId precedingVersionUid)
        {
            long trunkVersion;
            if (!long.TryParse(precedingVersionUid.VersionTreeId.Value, out trunkVersion))
                throw new NotSupportedException("Branched version tree IDs not supported");
            trunkVersion++;

            ObjectVersionId result = new ObjectVersionId(precedingVersionUid.ObjectId,
                precedingVersionUid.CreatingSystemId, new VersionTreeId(trunkVersion.ToString()));

            Check.Ensure(precedingVersionUid.ObjectId.Equals(result.ObjectId),
                "result objectId must equal preceding objectId");
            Check.Ensure(precedingVersionUid.CreatingSystemId == result.CreatingSystemId,
                "result creatingSystemId must equal preceding creatingSystemId");
            Check.Ensure(long.Parse(result.VersionTreeId.Value) > long.Parse(precedingVersionUid.VersionTreeId.Value),
                "result VersionTreeId must be greater than preceding versionTreeId");
            return result;
        }
예제 #6
0
 public EhrStatus(ObjectVersionId uid, PartySelf subject, bool isQueryable, bool isModifiable, ItemStructure otherDetails)
     : this(new ArchetypeId(defaultArchetypeId), new DvText(defaultName), uid, subject, isQueryable, isModifiable, otherDetails)
 {
 }