Search in sources :

Example 1 with Builder

use of com.ibm.cohort.engine.measure.FHIRClientContext.Builder in project quality-measure-and-cohort-service by Alvearie.

the class R4DataProviderFactoryTest method createDataProviderMap_noCacheContext.

@Test
public void createDataProviderMap_noCacheContext() {
    IGenericClient client = new Builder().withDefaultClient(getFhirServerConfig()).build().getDataClient();
    CqlTerminologyProvider terminologyProvider = new R4RestFhirTerminologyProvider(client);
    Map<String, CqlDataProvider> map = R4DataProviderFactory.createDataProviderMap(client, terminologyProvider, null);
    verifyDataProviderMap(map);
}
Also used : IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) Builder(com.ibm.cohort.engine.measure.FHIRClientContext.Builder) R4RestFhirTerminologyProvider(com.ibm.cohort.engine.terminology.R4RestFhirTerminologyProvider) CqlTerminologyProvider(com.ibm.cohort.cql.terminology.CqlTerminologyProvider) CqlDataProvider(com.ibm.cohort.cql.data.CqlDataProvider) Test(org.junit.Test)

Example 2 with Builder

use of com.ibm.cohort.engine.measure.FHIRClientContext.Builder in project quality-measure-and-cohort-service by Alvearie.

the class R4DataProviderFactoryTest method createDataProviderMap_withCacheContext.

@Test
public void createDataProviderMap_withCacheContext() throws Exception {
    IGenericClient client = new Builder().withDefaultClient(getFhirServerConfig()).build().getDataClient();
    CqlTerminologyProvider terminologyProvider = new R4RestFhirTerminologyProvider(client);
    try (RetrieveCacheContext cacheContext = new DefaultRetrieveCacheContext(new CaffeineConfiguration<>())) {
        Map<String, CqlDataProvider> map = R4DataProviderFactory.createDataProviderMap(client, terminologyProvider, cacheContext);
        verifyDataProviderMap(map);
    }
}
Also used : IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) Builder(com.ibm.cohort.engine.measure.FHIRClientContext.Builder) R4RestFhirTerminologyProvider(com.ibm.cohort.engine.terminology.R4RestFhirTerminologyProvider) DefaultRetrieveCacheContext(com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext) RetrieveCacheContext(com.ibm.cohort.engine.measure.cache.RetrieveCacheContext) DefaultRetrieveCacheContext(com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext) CqlTerminologyProvider(com.ibm.cohort.cql.terminology.CqlTerminologyProvider) CqlDataProvider(com.ibm.cohort.cql.data.CqlDataProvider) Test(org.junit.Test)

Aggregations

IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)2 CqlDataProvider (com.ibm.cohort.cql.data.CqlDataProvider)2 CqlTerminologyProvider (com.ibm.cohort.cql.terminology.CqlTerminologyProvider)2 Builder (com.ibm.cohort.engine.measure.FHIRClientContext.Builder)2 R4RestFhirTerminologyProvider (com.ibm.cohort.engine.terminology.R4RestFhirTerminologyProvider)2 Test (org.junit.Test)2 DefaultRetrieveCacheContext (com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext)1 RetrieveCacheContext (com.ibm.cohort.engine.measure.cache.RetrieveCacheContext)1