public void Test_Create() { var createdPatient = (Patient)FHIRbase.Create(SimplePatient); Assert.That(createdPatient, Is.Not.Null); Assert.That(createdPatient.Id, Is.Not.Null.Or.Empty); Assert.That(createdPatient.HasVersionId, Is.True); Assert.That(createdPatient.Name.First().Family.First(), Is.EqualTo("Hello")); Assert.That(createdPatient.Name.First().Given.First(), Is.EqualTo("World")); Assert.That(createdPatient.Telecom.First().Value, Is.EqualTo("123456789")); FHIRbase.Delete(createdPatient); var createdpatient1 = FHIRbase.Create(CommonPatient); Assert.That(createdpatient1, Is.Not.Null); Assert.That(createdpatient1.Id, Is.Not.Null.Or.Empty); Assert.That(createdpatient1.HasVersionId, Is.True); var readCreated = FHIRbase.Read(createdpatient1); Assert.That(readCreated, Is.Not.Null); Assert.That(readCreated.Id, Is.Not.Null.Or.Empty); Assert.That(readCreated.HasVersionId, Is.True); FHIRbase.Delete(createdpatient1); }
public void Test_TearDown() { foreach (var searchPatient in SearchPatients) { FHIRbase.Delete(searchPatient); } foreach (var entryComponent in RemovedPatient.Entry) { FHIRbase.Create(entryComponent.Resource); } }
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); }