use of org.opencds.cqf.cql.engine.model.ModelResolver in project cqf-ruler by DBCG.
the class EvaluationContext method getDataProvider.
private DataProvider getDataProvider() {
if (remoteProvider == null) {
ModelResolver resolver = modelResolver;
TerminologyProvider terminologyProvider;
switch(fhirVersion) {
case DSTU2:
terminologyProvider = new Dstu3FhirTerminologyProvider(this.getSystemFhirClient());
break;
case DSTU3:
terminologyProvider = new Dstu3FhirTerminologyProvider(this.getSystemFhirClient());
break;
case R4:
terminologyProvider = new R4FhirTerminologyProvider(this.getSystemFhirClient());
break;
default:
throw new NotImplementedException("This CDS Hooks implementation is not configured for FHIR version: " + fhirVersion.getFhirVersionString());
}
RestFhirRetrieveProvider provider = new RestFhirRetrieveProvider(new SearchParameterResolver(this.fhirContext), this.getHookFhirClient());
provider.setTerminologyProvider(terminologyProvider);
provider.setExpandValueSets(this.providerConfiguration.getExpandValueSets());
provider.setMaxCodesPerQuery(this.providerConfiguration.getMaxCodesPerQuery());
provider.setSearchStyle(this.providerConfiguration.getSearchStyle());
this.remoteProvider = new CompositeDataProvider(resolver, provider);
}
return remoteProvider;
}
use of org.opencds.cqf.cql.engine.model.ModelResolver in project quality-measure-and-cohort-service by Alvearie.
the class DefaultCqlDataProviderTest method resolveType_objectInput.
@Test
@SuppressWarnings({ "unchecked", "rawtypes" })
public void resolveType_objectInput() {
Object input = new Object();
Class expected = this.getClass();
ModelResolver resolver = Mockito.mock(ModelResolver.class);
Mockito.when(resolver.resolveType(input)).thenReturn(expected);
CqlDataProvider provider = new DefaultCqlDataProvider(resolver, null);
Assert.assertEquals(expected, provider.resolveType(input));
}
use of org.opencds.cqf.cql.engine.model.ModelResolver in project quality-measure-and-cohort-service by Alvearie.
the class DefaultCqlDataProviderTest method objectEqual.
@Test
public void objectEqual() {
boolean expected = true;
Object left = new Object();
Object right = new Object();
ModelResolver resolver = Mockito.mock(ModelResolver.class);
Mockito.when(resolver.objectEqual(left, right)).thenReturn(expected);
CqlDataProvider provider = new DefaultCqlDataProvider(resolver, null);
Assert.assertEquals(expected, provider.objectEqual(left, right));
}
use of org.opencds.cqf.cql.engine.model.ModelResolver in project quality-measure-and-cohort-service by Alvearie.
the class DefaultCqlDataProviderTest method resolveType_stringInput.
@Test
@SuppressWarnings({ "unchecked", "rawtypes" })
public void resolveType_stringInput() {
String typeName = "typeName";
Class expected = this.getClass();
ModelResolver resolver = Mockito.mock(ModelResolver.class);
Mockito.when(resolver.resolveType(typeName)).thenReturn(expected);
CqlDataProvider provider = new DefaultCqlDataProvider(resolver, null);
Assert.assertEquals(expected, provider.resolveType(typeName));
}
use of org.opencds.cqf.cql.engine.model.ModelResolver in project quality-measure-and-cohort-service by Alvearie.
the class DefaultCqlDataProviderTest method setPackageName.
@Test
public void setPackageName() {
String value = "value";
ModelResolver resolver = Mockito.mock(ModelResolver.class);
CqlDataProvider provider = new DefaultCqlDataProvider(resolver, null);
provider.setPackageName(value);
Mockito.verify(resolver, Mockito.times(1)).setPackageName(value);
}
Aggregations