Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public static void SetVersionUid(Party party, ObjectVersionId versionUid)
 {
     Check.Require(party != null, "party must not be null");
     party.VersionUid = versionUid;
 }
Esempio n. 4
0
 protected void RemoveVersion(ObjectVersionId uid, HierObjectId ehrId, string rmTypeName)
 {
     ObjectRef version = new ObjectRef(uid, ehrId.Value, rmTypeName);
     versions.Remove(version);
 }
Esempio n. 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;
        }
Esempio n. 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)
 {
 }