OriginalVersion <Composition> CreateVersion(Composition composition) { var uid = ObjectVersionId.CreateNew(new HierObjectId("EHR")); var uid2 = ObjectVersionId.CreateNew(new HierObjectId("EHR")); var audition = CreateAudition(); return(new OriginalVersion <Composition>(uid, null, new DvCodedText("complete", "532", "openehr"), audition, new ObjectRef(new GenericId(Guid.NewGuid().ToString(), "EHR"), "EHR::COMMON", "CONTRIBUTION"), composition)); }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); // read for the attributes in this local class Check.Assert(reader.LocalName == "uid", "Expected LocalName as uid rather than " + reader.LocalName); this.uid = new OpenEhr.RM.Support.Identification.ObjectVersionId(); this.uid.ReadXml(reader); if (reader.LocalName == "data") { string dataType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace); OpenEhr.RM.Common.Archetyped.Impl.Locatable locatableData = OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(dataType); locatableData.ReadXml(reader); this.data = locatableData as T; } if (reader.LocalName == "preceding_version_uid") { this.precedingVersionUid = new OpenEhr.RM.Support.Identification.ObjectVersionId(); this.precedingVersionUid.ReadXml(reader); } if (reader.LocalName == "other_input_version_uids") { this.otherInputVersionUids = new AssumedTypes.Set <ObjectVersionId>(); do { ObjectVersionId objectVersionId = new ObjectVersionId(); objectVersionId.ReadXml(reader); this.otherInputVersionUids.Add(objectVersionId); } while (reader.LocalName == "other_input_version_uids"); } if (reader.LocalName == "attestations") { this.attestations = new OpenEhr.AssumedTypes.List <OpenEhr.RM.Common.Generic.Attestation>(); do { Generic.Attestation a = new OpenEhr.RM.Common.Generic.Attestation(); a.ReadXml(reader); this.attestations.Add(a); } while (reader.LocalName == "attestations"); } Check.Assert(reader.LocalName == "lifecycle_state", "Expected LocalName is lifecycle_state not " + reader.LocalName); this.lifecycleState = new OpenEhr.RM.DataTypes.Text.DvCodedText(); this.lifecycleState.ReadXml(reader); }
public Version <T> VersionWithId(ObjectVersionId uid) { Check.Require(uid != null && uid.Value != null && uid.Value.Length > 0, "Version Id cannot be null or empty."); foreach (Version <T> v in this.versions) { if (v.Uid.Value == uid.Value) { return(v); } } throw new InvalidOperationException("Version Id is not existing in this versionedObjectProxy instance: " + uid.Value); }
public bool HasVersionId(ObjectVersionId uid) { Check.Require(uid != null && uid.Value != null && uid.Value.Length > 0, "Version Id cannot be null or empty."); foreach (Version <T> v in this.versions) { if (v.Uid.Value == uid.Value) { return(true); } } return(false); }
public void ValuesShouldBeSetCorrectly() { const string objectId = "D8EE6A3F-7C70-4858-B37F-6F280EF0A04A"; const string creatingSystemId = "3BC0C3E8-3828-4E95-8AE9-7819286957F3"; const string versionTreeId = "1.2.1"; const string value = objectId + "::" + creatingSystemId + "::" + versionTreeId; var id1 = new ObjectVersionId(value); Assert.AreEqual(value, id1.Value); Assert.AreEqual(objectId, id1.ObjectId.Value); Assert.AreEqual(creatingSystemId, id1.CreatingSystemId.Value); Assert.AreEqual(versionTreeId, id1.VersionTreeId.Value); Assert.IsTrue(id1.IsBranch); Assert.AreEqual(value, id1.ToString()); }
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); }
public UidBasedId UidBasedId(string value) { UidBasedId uid; if (value.Contains("::")) uid = new ObjectVersionId(value); else uid = new HierObjectId(value); return uid; }
public EhrStatus(ObjectVersionId uid, PartySelf subject, bool isQueryable, bool isModifiable, ItemStructure otherDetails) : this(new ArchetypeId(defaultArchetypeId), new DvText(defaultName), uid, subject, isQueryable, isModifiable, otherDetails) { }
IVersion <T> IVersionedObject <T> .VersionWithId(ObjectVersionId uid) { return(VersionWithId(uid)); }
public static void SetVersionUid(Party party, ObjectVersionId versionUid) { Check.Require(party != null, "party must not be null"); party.VersionUid = versionUid; }
protected void RemoveVersion(ObjectVersionId uid, HierObjectId ehrId, string rmTypeName) { ObjectRef version = new ObjectRef(uid, ehrId.Value, rmTypeName); versions.Remove(version); }