use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class FhirClientTimeoutTest method testFhirClientContext_handlesDelayWithConfiguration.
@Test
public void testFhirClientContext_handlesDelayWithConfiguration() {
FhirServerConfig fhirServerConfig = getFhirServerConfig();
fhirServerConfig.setSocketTimeout(CONFIG_NO_TIMEOUT_MILLIS);
FHIRClientContext fhirClientContext = new FHIRClientContext.Builder().withDefaultClient(fhirServerConfig).build();
Patient patient = fhirClientContext.getDataClient().read().resource(Patient.class).withId(PATIENT_ID).execute();
Enumerations.AdministrativeGender actual = patient.getGender();
Assert.assertEquals(Enumerations.AdministrativeGender.OTHER, actual);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class FhirClientTimeoutTest method testFhirClientContext_handlesDelayDefault.
@Test
public void testFhirClientContext_handlesDelayDefault() {
FhirServerConfig fhirServerConfig = getFhirServerConfig();
fhirServerConfig.setSocketTimeout(null);
FHIRClientContext fhirClientContext = new FHIRClientContext.Builder().withDefaultClient(fhirServerConfig).build();
Patient patient = fhirClientContext.getDataClient().read().resource(Patient.class).withId(PATIENT_ID).execute();
Enumerations.AdministrativeGender actual = patient.getGender();
Assert.assertEquals(Enumerations.AdministrativeGender.OTHER, actual);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class FhirClientTimeoutTest method testDefaultFhirClientBuilder_handlesDelayWithConfiguration.
@Test
public void testDefaultFhirClientBuilder_handlesDelayWithConfiguration() {
FhirServerConfig fhirServerConfig = getFhirServerConfig();
fhirServerConfig.setSocketTimeout(CONFIG_NO_TIMEOUT_MILLIS);
DefaultFhirClientBuilder builder = new DefaultFhirClientBuilder(fhirContext);
IGenericClient client = builder.createFhirClient(fhirServerConfig);
Patient patient = client.read().resource(Patient.class).withId(PATIENT_ID).execute();
Enumerations.AdministrativeGender actual = patient.getGender();
Assert.assertEquals(Enumerations.AdministrativeGender.OTHER, actual);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class FhirClientTimeoutTest method testDefaultFhirClientBuilder_handlesDelayDefault.
@Test
public void testDefaultFhirClientBuilder_handlesDelayDefault() {
FhirServerConfig fhirServerConfig = getFhirServerConfig();
fhirServerConfig.setSocketTimeout(null);
DefaultFhirClientBuilder builder = new DefaultFhirClientBuilder(fhirContext);
IGenericClient client = builder.createFhirClient(fhirServerConfig);
Patient patient = client.read().resource(Patient.class).withId(PATIENT_ID).execute();
Enumerations.AdministrativeGender actual = patient.getGender();
Assert.assertEquals(Enumerations.AdministrativeGender.OTHER, actual);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class MeasureTestBase method setUp.
@Before
public void setUp() {
FhirServerConfig config = getFhirServerConfig();
FhirClientBuilderFactory factory = FhirClientBuilderFactory.newInstance();
FhirClientBuilder builder = factory.newFhirClientBuilder(fhirContext);
client = builder.createFhirClient(config);
expressionsByPopulationType = new HashMap<>();
expressionsByPopulationType.put(MeasurePopulationType.INITIALPOPULATION, INITIAL_POPULATION);
expressionsByPopulationType.put(MeasurePopulationType.DENOMINATOR, DENOMINATOR);
expressionsByPopulationType.put(MeasurePopulationType.DENOMINATOREXCLUSION, DENOMINATOR_EXCLUSION);
expressionsByPopulationType.put(MeasurePopulationType.DENOMINATOREXCEPTION, DENOMINATOR_EXCEPTION);
expressionsByPopulationType.put(MeasurePopulationType.NUMERATOR, NUMERATOR);
expressionsByPopulationType.put(MeasurePopulationType.NUMERATOREXCLUSION, NUMERATOR_EXCLUSION);
expectationsByPopulationType = new HashMap<>();
expectationsByPopulationType.put(MeasurePopulationType.INITIALPOPULATION, 1);
expectationsByPopulationType.put(MeasurePopulationType.DENOMINATOR, 1);
expectationsByPopulationType.put(MeasurePopulationType.DENOMINATOREXCLUSION, 0);
expectationsByPopulationType.put(MeasurePopulationType.DENOMINATOREXCEPTION, 0);
expectationsByPopulationType.put(MeasurePopulationType.NUMERATOR, 0);
expectationsByPopulationType.put(MeasurePopulationType.NUMERATOREXCLUSION, 0);
}
Aggregations