Search in sources :

Example 1 with NotImplementedException

use of org.opencds.cqf.ruler.cdshooks.exceptions.NotImplementedException 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;
}
Also used : SearchParameterResolver(org.opencds.cqf.cql.engine.fhir.searchparam.SearchParameterResolver) TerminologyProvider(org.opencds.cqf.cql.engine.terminology.TerminologyProvider) R4FhirTerminologyProvider(org.opencds.cqf.cql.engine.fhir.terminology.R4FhirTerminologyProvider) Dstu3FhirTerminologyProvider(org.opencds.cqf.cql.engine.fhir.terminology.Dstu3FhirTerminologyProvider) RestFhirRetrieveProvider(org.opencds.cqf.cql.engine.fhir.retrieve.RestFhirRetrieveProvider) NotImplementedException(org.opencds.cqf.ruler.cdshooks.exceptions.NotImplementedException) Dstu3FhirTerminologyProvider(org.opencds.cqf.cql.engine.fhir.terminology.Dstu3FhirTerminologyProvider) CompositeDataProvider(org.opencds.cqf.cql.engine.data.CompositeDataProvider) R4FhirTerminologyProvider(org.opencds.cqf.cql.engine.fhir.terminology.R4FhirTerminologyProvider) ModelResolver(org.opencds.cqf.cql.engine.model.ModelResolver)

Aggregations

CompositeDataProvider (org.opencds.cqf.cql.engine.data.CompositeDataProvider)1 RestFhirRetrieveProvider (org.opencds.cqf.cql.engine.fhir.retrieve.RestFhirRetrieveProvider)1 SearchParameterResolver (org.opencds.cqf.cql.engine.fhir.searchparam.SearchParameterResolver)1 Dstu3FhirTerminologyProvider (org.opencds.cqf.cql.engine.fhir.terminology.Dstu3FhirTerminologyProvider)1 R4FhirTerminologyProvider (org.opencds.cqf.cql.engine.fhir.terminology.R4FhirTerminologyProvider)1 ModelResolver (org.opencds.cqf.cql.engine.model.ModelResolver)1 TerminologyProvider (org.opencds.cqf.cql.engine.terminology.TerminologyProvider)1 NotImplementedException (org.opencds.cqf.ruler.cdshooks.exceptions.NotImplementedException)1