Exemple #1
0
        public void Test_ReadLastVersion()
        {
            var createdPatient  = (Patient)FHIRbase.Create(SimplePatient);
            var updatedPatient1 = (Patient)FHIRbase.Update(createdPatient);
            var updatedPatient2 = (Patient)FHIRbase.Update(updatedPatient1);

            var history = FHIRbase.History(createdPatient.TypeName, createdPatient.Id);

            Assert.That(history, Is.Not.Null);
            Assert.That(history.Entry, Is.Not.Null);
            Assert.That(history.Entry.Count, Is.EqualTo(3));

            var lastPatientVersion = (Patient)FHIRbase.ReadLastVersion(createdPatient);

            Assert.That(lastPatientVersion, Is.Not.Null);
            Assert.That(lastPatientVersion.VersionId, Is.EqualTo(updatedPatient2.VersionId));

            FHIRbase.Delete(createdPatient);

            Assert.That(FHIRbase.IsDeleted(createdPatient), Is.True);
            Assert.That(FHIRbase.IsExists(createdPatient), Is.False);
        }