public StringSearchTestFixture(DataStore dataStore, Format format, TestFhirServerFactory testFhirServerFactory) : base(dataStore, format, testFhirServerFactory) { // Prepare the resources used for string search tests. FhirClient.DeleteAllResources(ResourceType.Patient).Wait(); Patients = FhirClient.CreateResourcesAsync <Patient>( p => SetPatientInfo(p, "Seattle", "Smith", given: "Bea"), p => SetPatientInfo(p, "Portland", "Williams"), p => SetPatientInfo(p, "Vancouver", "Anderson"), p => SetPatientInfo(p, LongString, "Murphy"), p => SetPatientInfo(p, "Montreal", "Richard", given: "Bea")) .Result; void SetPatientInfo(Patient patient, string city, string family, string given = null) { patient.Address = new List <Address>() { new Address() { City = city }, }; patient.Name = new List <HumanName>() { new HumanName() { Family = family, Given = new[] { given } }, }; } }
public StringSearchTestFixture(DataStore dataStore, Format format) : base(dataStore, format) { // Prepare the resources used for string search tests. FhirClient.DeleteAllResources(ResourceType.Patient).Wait(); Patients = FhirClient.CreateResourcesAsync <Patient>( p => SetPatientInfo(p, "Seattle", "Smith"), p => SetPatientInfo(p, "Portland", "Williams"), p => SetPatientInfo(p, "Vancouver", "Anderson")) .Result; void SetPatientInfo(Patient patient, string city, string family) { patient.Address = new List <Address>() { new Address() { City = city }, }; patient.Name = new List <HumanName>() { new HumanName() { Family = family }, }; } }
public NumberSearchTestFixture(DataStore dataStore, Format format) : base(dataStore, format) { // Prepare the resources used for number search tests. FhirClient.DeleteAllResources(ResourceType.Immunization).Wait(); Immunizations = FhirClient.CreateResourcesAsync <Immunization>( i => SetImmunization(i, 1), i => SetImmunization(i, 4), i => SetImmunization(i, 5), i => SetImmunization(i, 6), i => SetImmunization(i, 100)).Result; void SetImmunization(Immunization immunization, int doseSequence) { immunization.Patient = new ResourceReference("Patient/123"); immunization.VaccineCode = new CodeableConcept("vaccine", "code"); immunization.Status = Immunization.ImmunizationStatusCodes.Completed; immunization.NotGiven = false; immunization.PrimarySource = true; immunization.VaccinationProtocol = new List <Immunization.VaccinationProtocolComponent>() { new Immunization.VaccinationProtocolComponent() { DoseSequence = doseSequence, }, }; } }
public NumberSearchTestFixture(DataStore dataStore, Format format) : base(dataStore, format) { // Prepare the resources used for number search tests. FhirClient.DeleteAllResources(ResourceType.RiskAssessment).Wait(); RiskAssessments = FhirClient.CreateResourcesAsync <RiskAssessment>( i => SetRiskAssessment(i, 1), i => SetRiskAssessment(i, 4), i => SetRiskAssessment(i, 5), i => SetRiskAssessment(i, 6), i => SetRiskAssessment(i, 100)).Result; void SetRiskAssessment(RiskAssessment riskAssessment, int probability) { riskAssessment.Status = ObservationStatus.Final; riskAssessment.Subject = new ResourceReference("Patient/123"); riskAssessment.Prediction = new List <RiskAssessment.PredictionComponent> { new RiskAssessment.PredictionComponent { Probability = new FhirDecimal(probability) }, }; } }
public ReferenceSearchTestFixture(DataStore dataStore, Format format, TestFhirServerFactory testFhirServerFactory) : base(dataStore, format, testFhirServerFactory) { // Prepare the resources used for string search tests. FhirClient.DeleteAllResources(ResourceType.Patient).Wait(); Patients = FhirClient.CreateResourcesAsync <Patient>( p => p.ManagingOrganization = new ResourceReference("Organization/123"), p => p.ManagingOrganization = new ResourceReference("Organization/abc")) .Result; }
public ReferenceSearchTestFixture() : base() { // Prepare the resources used for string search tests. FhirClient.DeleteAllResources(ResourceType.Patient).Wait(); Patients = FhirClient.CreateResourcesAsync <Patient>( p => p.ManagingOrganization = new ResourceReference("Organization/123"), p => p.ManagingOrganization = new ResourceReference("Organization/abc")) .Result; }
public DateSearchTestFixture() : base() { FhirClient.DeleteAllResources(ResourceType.Patient).Wait(); Patients = FhirClient.CreateResourcesAsync <Patient>( p => p.BirthDate = "1979-12-31", // 1979-12-31T00:00:00.0000000 <-> 1979-12-31T23:59:59.9999999 p => p.BirthDate = "1980", // 1980-01-01T00:00:00.0000000 <-> 1980-12-31T23:59:59.9999999 p => p.BirthDate = "1980-05", // 1980-05-01T00:00:00.0000000 <-> 1980-05-31T23:59:59.9999999 p => p.BirthDate = "1980-05-11", // 1980-05-11T00:00:00.0000000 <-> 1980-05-11T23:59:59.9999999 p => p.BirthDate = "1980-05-11T16:32", // 1980-05-11T16:32:00.0000000 <-> 1980-05-11T16:32:59.9999999 p => p.BirthDate = "1980-05-11T16:32:15", // 1980-05-11T16:32:15.0000000 <-> 1980-05-11T16:32:15.9999999 p => p.BirthDate = "1980-05-11T16:32:15.500", // 1980-05-11T16:32:15.5000000 <-> 1980-05-11T16:32:15.5000000 p => p.BirthDate = "1981-01-01").Result; // 1981-01-01T00:00:00.0000000 <-> 1981-12-31T23:59:59.9999999 }
public UriSearchTestFixture(DataStore dataStore, Format format) : base(dataStore, format) { // Prepare the resources used for URI search tests. FhirClient.DeleteAllResources(ResourceType.ValueSet).Wait(); ValueSets = FhirClient.CreateResourcesAsync <ValueSet>( vs => AddValueSet(vs, "http://somewhere.com/test/system"), vs => AddValueSet(vs, "urn://localhost/test")).Result; void AddValueSet(ValueSet vs, string url) { vs.Status = PublicationStatus.Active; vs.Url = url; } }
public TokenSearchTestFixture() : base() { // Prepare the resources used for number search tests. FhirClient.DeleteAllResources(ResourceType.Observation).Wait(); Observations = FhirClient.CreateResourcesAsync <Observation>( o => SetObservation(o, cc => cc.Coding.Add(new Coding("system1", "code1"))), o => SetObservation(o, cc => cc.Coding.Add(new Coding("system2", "code2"))), o => SetObservation(o, cc => cc.Text = "text"), o => SetObservation(o, cc => cc.Coding.Add(new Coding("system1", "code2", "text2"))), o => SetObservation(o, cc => cc.Coding.Add(new Coding("system3", "code3", "text"))), o => SetObservation(o, cc => { cc.Text = "text"; cc.Coding.Add(new Coding("system1", "code1")); cc.Coding.Add(new Coding("system3", "code2")); }), o => SetObservation(o, cc => { cc.Coding.Add(new Coding("system2", "code1")); cc.Coding.Add(new Coding("system3", "code3", "text2")); }), o => SetObservation(o, cc => cc.Coding.Add(new Coding(null, "code3")))).Result; void SetObservation(Observation observation, Action <CodeableConcept> codeableConceptCustomizer) { observation.Code = new CodeableConcept("system", "code"); observation.Status = ObservationStatus.Registered; var codeableConcept = new CodeableConcept(); codeableConceptCustomizer(codeableConcept); observation.Value = codeableConcept; } }
public QuantitySearchTestFixture(DataStore dataStore, Format format) : base(dataStore, format) { // Prepare the resources used for number search tests. FhirClient.DeleteAllResources(ResourceType.Observation).Wait(); Observations = FhirClient.CreateResourcesAsync <Observation>( o => SetObservation(o, 1.0m, "unit1", "system1"), o => SetObservation(o, 3.12m, "unit1", "system2"), o => SetObservation(o, 4.0m, "unit1", "system1"), o => SetObservation(o, 5.0m, "unit1", "system1"), o => SetObservation(o, 5.0m, "unit2", "system2"), o => SetObservation(o, 6.0m, "unit2", "system2"), o => SetObservation(o, 8.95m, "unit2", "system1"), o => SetObservation(o, 10.0m, "unit1", "system1")).Result; void SetObservation(Observation observation, decimal quantity, string unit, string system) { observation.Code = new CodeableConcept("system", "code"); observation.Status = ObservationStatus.Registered; observation.Value = new Quantity(quantity, unit, system); } }