add factory loader
This commit is contained in:
@@ -5,6 +5,8 @@ import ca.uhn.fhir.cr.config.CrR4Config;
|
|||||||
import ca.uhn.fhir.jpa.batch2.JpaBatch2Config;
|
import ca.uhn.fhir.jpa.batch2.JpaBatch2Config;
|
||||||
import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion;
|
import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion;
|
||||||
import ca.uhn.fhir.jpa.starter.common.FhirTesterConfig;
|
import ca.uhn.fhir.jpa.starter.common.FhirTesterConfig;
|
||||||
|
import ca.uhn.fhir.jpa.starter.cr.CrProviderConfig;
|
||||||
|
import ca.uhn.fhir.jpa.starter.cr.StarterCrDstu3Config;
|
||||||
import ca.uhn.fhir.jpa.starter.cr.StarterCrR4Config;
|
import ca.uhn.fhir.jpa.starter.cr.StarterCrR4Config;
|
||||||
import ca.uhn.fhir.jpa.starter.mdm.MdmConfig;
|
import ca.uhn.fhir.jpa.starter.mdm.MdmConfig;
|
||||||
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
|
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
|
||||||
@@ -37,7 +39,10 @@ import org.springframework.web.servlet.DispatcherServlet;
|
|||||||
WebsocketDispatcherConfig.class,
|
WebsocketDispatcherConfig.class,
|
||||||
MdmConfig.class,
|
MdmConfig.class,
|
||||||
JpaBatch2Config.class,
|
JpaBatch2Config.class,
|
||||||
Batch2JobsConfig.class
|
Batch2JobsConfig.class,
|
||||||
|
StarterCrR4Config.class,
|
||||||
|
StarterCrDstu3Config.class,
|
||||||
|
CrProviderConfig.class
|
||||||
})
|
})
|
||||||
public class Application extends SpringBootServletInitializer {
|
public class Application extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMod
|
|||||||
import ca.uhn.fhir.jpa.model.entity.StorageSettings;
|
import ca.uhn.fhir.jpa.model.entity.StorageSettings;
|
||||||
import ca.uhn.fhir.jpa.starter.AppProperties;
|
import ca.uhn.fhir.jpa.starter.AppProperties;
|
||||||
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
||||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||||
import ca.uhn.fhir.rest.server.mail.IMailSvc;
|
import ca.uhn.fhir.rest.server.mail.IMailSvc;
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ import ca.uhn.fhir.context.ConfigurationException;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.context.support.IValidationSupport;
|
import ca.uhn.fhir.context.support.IValidationSupport;
|
||||||
import ca.uhn.fhir.cr.config.CrProperties;
|
|
||||||
import ca.uhn.fhir.cr.r4.measure.CareGapsOperationProvider;
|
|
||||||
import ca.uhn.fhir.cr.r4.measure.SubmitDataProvider;
|
|
||||||
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
||||||
import ca.uhn.fhir.jpa.api.IDaoRegistry;
|
import ca.uhn.fhir.jpa.api.IDaoRegistry;
|
||||||
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
||||||
@@ -45,6 +42,7 @@ import ca.uhn.fhir.jpa.starter.AppProperties;
|
|||||||
import ca.uhn.fhir.jpa.starter.annotations.OnCorsPresent;
|
import ca.uhn.fhir.jpa.starter.annotations.OnCorsPresent;
|
||||||
import ca.uhn.fhir.jpa.starter.annotations.OnImplementationGuidesPresent;
|
import ca.uhn.fhir.jpa.starter.annotations.OnImplementationGuidesPresent;
|
||||||
import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory;
|
import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory;
|
||||||
|
import ca.uhn.fhir.jpa.starter.cr.CrOperationLoader;
|
||||||
import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper;
|
import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper;
|
||||||
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
|
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
|
||||||
import ca.uhn.fhir.jpa.util.ResourceCountCache;
|
import ca.uhn.fhir.jpa.util.ResourceCountCache;
|
||||||
@@ -64,10 +62,7 @@ import ca.uhn.fhir.validation.IValidatorModule;
|
|||||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import org.cqframework.cql.cql2elm.model.Model;
|
|
||||||
import org.hl7.cql.model.ModelIdentifier;
|
|
||||||
import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport;
|
import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport;
|
||||||
import org.opencds.cqf.cql.evaluator.CqlOptions;
|
|
||||||
import org.opencds.cqf.cql.evaluator.library.EvaluationSettings;
|
import org.opencds.cqf.cql.evaluator.library.EvaluationSettings;
|
||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -80,8 +75,6 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.orm.jpa.JpaTransactionManager;
|
import org.springframework.orm.jpa.JpaTransactionManager;
|
||||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
|
||||||
import ca.uhn.fhir.cr.repo.HapiFhirRepository;
|
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
@@ -175,6 +168,12 @@ public class StarterJpaConfig {
|
|||||||
return new HSearchSortHelperImpl(mySearchParamRegistry);
|
return new HSearchSortHelperImpl(mySearchParamRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnProperty(prefix = "hapi.fhir", name = ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR, havingValue = "true")
|
||||||
|
public RepositoryValidatingInterceptor repositoryValidatingInterceptor(
|
||||||
|
IRepositoryValidationInterceptorFactory factory) {
|
||||||
|
return factory.buildUsingStoredStructureDefinitions();
|
||||||
|
}
|
||||||
@Bean
|
@Bean
|
||||||
public ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider myR4QuestionnaireOperationsProvider() {
|
public ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider myR4QuestionnaireOperationsProvider() {
|
||||||
return new ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider();
|
return new ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider();
|
||||||
@@ -261,40 +260,6 @@ public class StarterJpaConfig {
|
|||||||
return r -> new org.opencds.cqf.cql.evaluator.plandefinition.dstu3.PlanDefinitionProcessor(r,
|
return r -> new org.opencds.cqf.cql.evaluator.plandefinition.dstu3.PlanDefinitionProcessor(r,
|
||||||
theEvaluationSettings);
|
theEvaluationSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnProperty(prefix = "hapi.fhir", name = ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR, havingValue = "true")
|
|
||||||
public RepositoryValidatingInterceptor repositoryValidatingInterceptor(
|
|
||||||
IRepositoryValidationInterceptorFactory factory) {
|
|
||||||
return factory.buildUsingStoredStructureDefinitions();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
IRepositoryFactory repositoryFactory(DaoRegistry theDaoRegistry) {
|
|
||||||
return rd -> new HapiFhirRepository(theDaoRegistry, rd, (RestfulServer) rd.getServer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
EvaluationSettings evaluationSettings(CqlOptions theCqlOptions, Map<ModelIdentifier, Model> theGlobalModelCache,
|
|
||||||
Map<org.cqframework.cql.elm.execution.VersionedIdentifier, org.cqframework.cql.elm.execution.Library> theGlobalLibraryCache) {
|
|
||||||
var evaluationSettings = new EvaluationSettings();
|
|
||||||
evaluationSettings.setCqlOptions(theCqlOptions);
|
|
||||||
evaluationSettings.setModelCache(theGlobalModelCache);
|
|
||||||
evaluationSettings.setLibraryCache(theGlobalLibraryCache);
|
|
||||||
|
|
||||||
return evaluationSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public CqlOptions cqlOptions(CrProperties theCrProperties) {
|
|
||||||
return theCrProperties.getCqlProperties().getCqlOptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public CrProperties crProperties() {
|
|
||||||
return new CrProperties();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public LoggingInterceptor loggingInterceptor(AppProperties appProperties) {
|
public LoggingInterceptor loggingInterceptor(AppProperties appProperties) {
|
||||||
|
|
||||||
@@ -387,18 +352,7 @@ public class StarterJpaConfig {
|
|||||||
IPackageInstallerSvc packageInstallerSvc, ThreadSafeResourceDeleterSvc theThreadSafeResourceDeleterSvc,
|
IPackageInstallerSvc packageInstallerSvc, ThreadSafeResourceDeleterSvc theThreadSafeResourceDeleterSvc,
|
||||||
ApplicationContext appContext,
|
ApplicationContext appContext,
|
||||||
Optional<IpsOperationProvider> theIpsOperationProvider,
|
Optional<IpsOperationProvider> theIpsOperationProvider,
|
||||||
Optional<ca.uhn.fhir.cr.r4.measure.MeasureOperationsProvider> theR4MeasureOperationProvider,
|
Optional<CrOperationLoader> theCrProviderLoader){
|
||||||
Optional<ca.uhn.fhir.cr.dstu3.measure.MeasureOperationsProvider> theDstu3MeasureOperationProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.dstu3.activitydefinition.ActivityDefinitionOperationsProvider> theDstu3ActivityDefinitionProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.r4.activitydefinition.ActivityDefinitionOperationsProvider> theR4ActivityDefinitionProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionOperationsProvider> theR4PlanDefinitionOperationProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionOperationsProvider> theDstu3PlanDefinitionOperationProvider,
|
|
||||||
Optional<CareGapsOperationProvider> theR4CareGapsOperationProvider,
|
|
||||||
Optional<SubmitDataProvider> theR4SubmitDataProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.r4.questionnaireresponse.QuestionnaireResponseOperationsProvider> theR4QuestionnaireResponseOperationProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.dstu3.questionnaireresponse.QuestionnaireResponseOperationsProvider> theDstu3QuestionnaireResponseOperationProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider> theR4QuestionnaireOperationsProvider,
|
|
||||||
Optional<ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnaireOperationsProvider> theDstu3QuestionnaireOperationsProvider) {
|
|
||||||
RestfulServer fhirServer = new RestfulServer(fhirSystemDao.getContext());
|
RestfulServer fhirServer = new RestfulServer(fhirSystemDao.getContext());
|
||||||
|
|
||||||
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
||||||
@@ -418,8 +372,9 @@ public class StarterJpaConfig {
|
|||||||
|
|
||||||
if (appProperties.getMdm_enabled()) {
|
if (appProperties.getMdm_enabled()) {
|
||||||
mdmProviderProvider.get().loadProvider();
|
mdmProviderProvider.get().loadProvider();
|
||||||
// theCrProviderLoader.get().loadProvider();
|
}
|
||||||
|
if (appProperties.getCr_enabled()){
|
||||||
|
theCrProviderLoader.get().loadProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
fhirServer.registerProviders(resourceProviderFactory.createProviders());
|
fhirServer.registerProviders(resourceProviderFactory.createProviders());
|
||||||
@@ -584,6 +539,7 @@ public class StarterJpaConfig {
|
|||||||
fhirServer.registerProvider(theIpsOperationProvider.get());
|
fhirServer.registerProvider(theIpsOperationProvider.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return fhirServer;
|
return fhirServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
103
src/main/java/ca/uhn/fhir/jpa/starter/cr/CrOperationFactory.java
Normal file
103
src/main/java/ca/uhn/fhir/jpa/starter/cr/CrOperationFactory.java
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
package ca.uhn.fhir.jpa.starter.cr;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.cr.r4.measure.CareGapsOperationProvider;
|
||||||
|
import ca.uhn.fhir.cr.r4.measure.SubmitDataProvider;
|
||||||
|
import ca.uhn.fhir.cr.dstu3.activitydefinition.ActivityDefinitionOperationsProvider;
|
||||||
|
import ca.uhn.fhir.cr.dstu3.measure.MeasureOperationsProvider;
|
||||||
|
import ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionOperationsProvider;
|
||||||
|
import ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnaireOperationsProvider;
|
||||||
|
import ca.uhn.fhir.cr.dstu3.questionnaireresponse.QuestionnaireResponseOperationsProvider;
|
||||||
|
|
||||||
|
public class CrOperationFactory {
|
||||||
|
@Autowired
|
||||||
|
private FhirContext myFhirContext;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationContext myApplicationContext;
|
||||||
|
|
||||||
|
public Object getMeasureOperationsProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
return myApplicationContext.getBean(MeasureOperationsProvider.class);
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext.getBean(ca.uhn.fhir.cr.r4.measure.MeasureOperationsProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("Measure operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getActivityDefinitionProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
return myApplicationContext.getBean(ActivityDefinitionOperationsProvider.class);
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext
|
||||||
|
.getBean(ca.uhn.fhir.cr.r4.activitydefinition.ActivityDefinitionOperationsProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("ActivityDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getPlanDefinitionProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
return myApplicationContext.getBean(PlanDefinitionOperationsProvider.class);
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext
|
||||||
|
.getBean(ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionOperationsProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("PlanDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getCareGapsProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext.getBean(CareGapsOperationProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("PlanDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Object getSubmitDataProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext.getBean(SubmitDataProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("PlanDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Object getQuestionnaireResponseOperationProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
return myApplicationContext.getBean(QuestionnaireResponseOperationsProvider.class);
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext
|
||||||
|
.getBean(ca.uhn.fhir.cr.r4.questionnaireresponse.QuestionnaireResponseOperationsProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("PlanDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Object getQuestionnaireOperationProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
return myApplicationContext.getBean(QuestionnaireOperationsProvider.class);
|
||||||
|
case R4:
|
||||||
|
return myApplicationContext
|
||||||
|
.getBean(ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireOperationsProvider.class);
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("PlanDefinition operations are not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package ca.uhn.fhir.jpa.starter.cr;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.event.ContextRefreshedEvent;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
|
|
||||||
|
public class CrOperationLoader {
|
||||||
|
private static final Logger myLogger = LoggerFactory.getLogger(CrOperationLoader.class);
|
||||||
|
private final FhirContext myFhirContext;
|
||||||
|
private final ResourceProviderFactory myResourceProviderFactory;
|
||||||
|
private final CrOperationFactory myCrProviderFactory;
|
||||||
|
|
||||||
|
public CrOperationLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory,
|
||||||
|
CrOperationFactory theCrProviderFactory) {
|
||||||
|
myFhirContext = theFhirContext;
|
||||||
|
myResourceProviderFactory = theResourceProviderFactory;
|
||||||
|
myCrProviderFactory = theCrProviderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventListener(ContextRefreshedEvent.class)
|
||||||
|
public void loadProvider() {
|
||||||
|
switch (myFhirContext.getVersion().getVersion()) {
|
||||||
|
case DSTU3:
|
||||||
|
myLogger.info("Registering DSTU3 Clinical Reasoning Providers");
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getMeasureOperationsProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getActivityDefinitionProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getPlanDefinitionProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getQuestionnaireResponseOperationProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getQuestionnaireOperationProvider);
|
||||||
|
break;
|
||||||
|
case R4:
|
||||||
|
myLogger.info("Registering R4 Clinical Reasoning Providers");
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getMeasureOperationsProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getActivityDefinitionProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getPlanDefinitionProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getCareGapsProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getSubmitDataProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getQuestionnaireResponseOperationProvider);
|
||||||
|
myResourceProviderFactory.addSupplier(myCrProviderFactory::getQuestionnaireOperationProvider);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ConfigurationException("Clinical Reasoning not supported for FHIR version "
|
||||||
|
+ myFhirContext.getVersion().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package ca.uhn.fhir.jpa.starter.cr;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Conditional;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Conditional(CrConfigCondition.class)
|
||||||
|
public class CrProviderConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
CrOperationFactory crOperationFactory() {
|
||||||
|
return new CrOperationFactory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
CrOperationLoader crOperationLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory,
|
||||||
|
CrOperationFactory theCrlProviderFactory) {
|
||||||
|
return new CrOperationLoader(theFhirContext, theResourceProviderFactory, theCrlProviderFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package ca.uhn.fhir.jpa.starter.cr;
|
package ca.uhn.fhir.jpa.starter.cr;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.cr.config.CrDstu3Config;
|
import ca.uhn.fhir.cr.config.CrDstu3Config;
|
||||||
import ca.uhn.fhir.jpa.starter.annotations.OnDSTU3Condition;
|
import ca.uhn.fhir.jpa.starter.annotations.OnDSTU3Condition;
|
||||||
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Conditional;
|
import org.springframework.context.annotation.Conditional;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
@@ -10,4 +13,14 @@ import org.springframework.context.annotation.Import;
|
|||||||
@Conditional({OnDSTU3Condition.class, CrConfigCondition.class})
|
@Conditional({OnDSTU3Condition.class, CrConfigCondition.class})
|
||||||
@Import({CrDstu3Config.class})
|
@Import({CrDstu3Config.class})
|
||||||
public class StarterCrDstu3Config {
|
public class StarterCrDstu3Config {
|
||||||
|
@Bean
|
||||||
|
CrOperationFactory crOperationFactory() {
|
||||||
|
return new CrOperationFactory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
CrOperationLoader crOperationLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory,
|
||||||
|
CrOperationFactory theCrlProviderFactory) {
|
||||||
|
return new CrOperationLoader(theFhirContext, theResourceProviderFactory, theCrlProviderFactory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.LocalServerPort;
|
||||||
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.LocalServerPort;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|||||||
Reference in New Issue
Block a user