public void CreatePatientWithExtension() { Patient selena = Utils.NewPatient("Gomez", "Selena"); selena.AddAddress("Cornett", "Amanda", "United States", "Texas", "Grand Prairie"); Uri qualifier = new Uri("http://hl7.org/fhir/Profile/iso-21090#qualifier"); selena.Contact[0].Name.AddExtension(qualifier, new Code("AC")); ResourceEntry <Patient> entry = client.Create(selena, null, false); string id = entry.GetBasicId(); //entry = null; entry = client.Read <Patient>(entry.GetBasicId()); var extensions = entry.Resource.Contact[0].Name.GetExtensions(qualifier); if (extensions == null || extensions.Count() == 0) { TestResult.Fail("Extensions have disappeared on resource " + Location); } if (!extensions.Any(ext => ext.Value is Code && ((Code)ext.Value).Value == "AC")) { TestResult.Fail("Resource extension was not persisted on created resource " + entry.GetBasicId()); } }
public void AddPatient() { Patient patient = Utils.NewPatient("Bach", "Johan", "Sebastian"); entry = client.Create <Patient>(patient, null, true); id = entry.GetBasicId(); }
public void GetTestDataPerson() { Patient p = NewPatient("Emerald", "Caro"); ResourceEntry <Patient> entry = client.Create(p, null, false); string id = entry.GetBasicId(); var pat = client.Read <Patient>(id); HttpTests.AssertHttpOk(client); HttpTests.AssertValidResourceContentTypePresent(client); HttpTests.AssertLastModifiedPresent(client); HttpTests.AssertContentLocationPresentAndValid(client); }
private string createObservation(decimal value) { Observation observation = new Observation(); observation.Status = Observation.ObservationStatus.Preliminary; observation.Reliability = Observation.ObservationReliability.Questionable; observation.Name = new CodeableConcept("http://loinc.org", "2164-2"); observation.Value = new Quantity() { System = new Uri("http://unitofmeasure.org"), Value = value, Units = "mmol" }; observation.BodySite = new CodeableConcept("http://snomed.info/sct", "182756003"); ResourceEntry <Observation> entry = client.Create <Observation>(observation, null, true); return(entry.GetBasicId()); }
public void AddPatient() { Patient patient = Utils.NewPatient("Bach", "Johan", "Sebastian"); entry = client.Create<Patient>(patient, null, true); id = entry.GetBasicId(); }