Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shared db, fix spring getting confused #345

Merged
merged 1 commit into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public TerminologyProvider terminologyProvider(Map<String, Iterable<Code>> termi
return new CacheAwareTerminologyProvider(terminologyCache, jpaTerminologyProvider);
}

@Bean
@Bean(name = "dstu3ModelResolver")
public ModelResolver modelResolver() {
return new CachingModelResolverDecorator(new Dstu3FhirModelResolver());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.opencds.cqf.dstu3.evaluation;

import javax.inject.Inject;
import javax.inject.Named;

import org.apache.lucene.search.BooleanQuery;
import org.opencds.cqf.common.evaluation.EvaluationProviderFactory;
import org.opencds.cqf.common.helpers.ClientHelper;
import org.opencds.cqf.common.providers.Dstu3ApelonFhirTerminologyProvider;
Expand Down Expand Up @@ -34,7 +36,8 @@ public class ProviderFactory implements EvaluationProviderFactory {

@Inject
public ProviderFactory(FhirContext fhirContext, DaoRegistry registry,
TerminologyProvider defaultTerminologyProvider, ModelResolver modelResolver) {
TerminologyProvider defaultTerminologyProvider, @Named("dstu3ModelResolver") ModelResolver modelResolver) {
BooleanQuery.setMaxClauseCount(10000000);
this.defaultTerminologyProvider = defaultTerminologyProvider;
this.registry = registry;
this.fhirContext = fhirContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.hl7.fhir.dstu3.model.ActivityDefinition;
import org.hl7.fhir.dstu3.model.Attachment;
Expand Down Expand Up @@ -47,7 +48,7 @@ public class ActivityDefinitionApplyProvider {

@Inject
public ActivityDefinitionApplyProvider(FhirContext fhirContext, CqlExecutionProvider executionProvider,
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, ModelResolver modelResolver) {
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, @Named("dstu3ModelResolver") ModelResolver modelResolver) {
this.modelResolver = modelResolver;
this.executionProvider = executionProvider;
this.activityDefinitionDao = activityDefinitionDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.UUID;

import javax.inject.Inject;
import javax.inject.Named;

import org.hl7.fhir.dstu3.model.ActivityDefinition;
import org.hl7.fhir.dstu3.model.CarePlan;
Expand Down Expand Up @@ -64,7 +65,7 @@ public class PlanDefinitionApplyProvider {
public PlanDefinitionApplyProvider(FhirContext fhirContext,
ActivityDefinitionApplyProvider activityDefinitionApplyProvider,
IFhirResourceDao<PlanDefinition> planDefinitionDao,
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, CqlExecutionProvider executionProvider, ModelResolver modelResolver) {
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, CqlExecutionProvider executionProvider, @Named("dstu3ModelResolver") ModelResolver modelResolver) {
this.executionProvider = executionProvider;
this.modelResolver = modelResolver;
this.activityDefinitionApplyProvider = activityDefinitionApplyProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void init() {
this.libraryResolutionProvider = (LibraryResolutionProvider<org.hl7.fhir.dstu3.model.Library>)appCtx.getBean(LibraryResolutionProvider.class);
this.fhirRetrieveProvider = appCtx.getBean(JpaFhirRetrieveProvider.class);
this.serverTerminologyProvider = appCtx.getBean(TerminologyProvider.class);
this.modelResolver = appCtx.getBean(ModelResolver.class);
this.modelResolver = appCtx.getBean("dstu3ModelResolver", ModelResolver.class);
this.libraryHelper = appCtx.getBean(LibraryHelper.class);
}

Expand Down
4 changes: 2 additions & 2 deletions dstu3/src/main/resources/hapi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fhirpath_interceptor.enabled=false


datasource.driver=org.apache.derby.jdbc.EmbeddedDriver
datasource.url=jdbc:derby:target/derby;create=true
datasource.url=jdbc:derby:target/derbyDstu3;create=true
hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
spring.jpa.hibernate.ddl-auto=update
datasource.username=
Expand All @@ -95,7 +95,7 @@ hibernate.search.enabled=true
hibernate.search.backend.type=lucene
hibernate.search.backend.analysis.configurer=ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer
hibernate.search.backend.directory.type=local-filesystem
hibernate.search.backend.directory.root=target/lucenefiles
hibernate.search.backend.directory.root=target/lucenefilesDstu3
hibernate.search.backend.lucene_version=lucene_current
# hibernate.search.model_mapping=ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory
# hibernate.search.default.directory_provider=filesystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public TerminologyProvider terminologyProvider(Map<String, Iterable<Code>> termi
return new CacheAwareTerminologyProvider(terminologyCache, jpaTerminologyProvider);
}

@Bean
@Bean(name = "r4ModelResolver")
public ModelResolver modelResolver() {
return new CachingModelResolverDecorator(new R4FhirModelResolver());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.opencds.cqf.r4.evaluation;

import javax.inject.Inject;
import javax.inject.Named;

import org.apache.lucene.search.BooleanQuery;
import org.opencds.cqf.common.evaluation.EvaluationProviderFactory;
import org.opencds.cqf.common.helpers.ClientHelper;
import org.opencds.cqf.common.providers.R4ApelonFhirTerminologyProvider;
Expand Down Expand Up @@ -31,7 +33,8 @@ public class ProviderFactory implements EvaluationProviderFactory {

@Inject
public ProviderFactory(FhirContext fhirContext, DaoRegistry registry,
TerminologyProvider defaultTerminologyProvider, ModelResolver modelResolver) {
TerminologyProvider defaultTerminologyProvider, @Named("r4ModelResolver") ModelResolver modelResolver) {
BooleanQuery.setMaxClauseCount(10000000);
this.defaultTerminologyProvider = defaultTerminologyProvider;
this.registry = registry;
this.fhirContext = fhirContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.ActivityDefinition;
Expand Down Expand Up @@ -56,7 +57,7 @@ public class ActivityDefinitionApplyProvider {

@Inject
public ActivityDefinitionApplyProvider(FhirContext fhirContext, CqlExecutionProvider executionProvider,
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, ModelResolver modelResolver) {
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, @Named("r4ModelResolver") ModelResolver modelResolver) {
this.modelResolver = modelResolver;
this.executionProvider = executionProvider;
this.activityDefinitionDao = activityDefinitionDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.UUID;

import javax.inject.Inject;
import javax.inject.Named;

import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.ActivityDefinition;
Expand Down Expand Up @@ -66,7 +67,7 @@ public class PlanDefinitionApplyProvider {
public PlanDefinitionApplyProvider(FhirContext fhirContext,
ActivityDefinitionApplyProvider activityDefinitionApplyProvider,
IFhirResourceDao<PlanDefinition> planDefinitionDao,
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, CqlExecutionProvider executionProvider, ModelResolver modelResolver) {
IFhirResourceDao<ActivityDefinition> activityDefinitionDao, CqlExecutionProvider executionProvider, @Named("r4ModelResolver") ModelResolver modelResolver) {
this.executionProvider = executionProvider;
this.modelResolver = modelResolver;
this.activityDefinitionApplyProvider = activityDefinitionApplyProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void init() {
this.libraryResolutionProvider = (LibraryResolutionProvider<org.hl7.fhir.r4.model.Library>)appCtx.getBean(LibraryResolutionProvider.class);
this.fhirRetrieveProvider = appCtx.getBean(JpaFhirRetrieveProvider.class);
this.serverTerminologyProvider = appCtx.getBean(TerminologyProvider.class);
this.modelResolver = appCtx.getBean(ModelResolver.class);
this.modelResolver = appCtx.getBean("r4ModelResolver", ModelResolver.class);
this.libraryHelper = appCtx.getBean(LibraryHelper.class);
}

Expand Down
4 changes: 2 additions & 2 deletions r4/src/main/resources/hapi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fhirpath_interceptor.enabled=false


datasource.driver=org.apache.derby.jdbc.EmbeddedDriver
datasource.url=jdbc:derby:target/derby;create=true
datasource.url=jdbc:derby:target/derbyR4;create=true
hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
spring.jpa.hibernate.ddl-auto=update
datasource.username=
Expand All @@ -96,7 +96,7 @@ hibernate.search.enabled=true
hibernate.search.backend.type=lucene
hibernate.search.backend.analysis.configurer=ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer
hibernate.search.backend.directory.type=local-filesystem
hibernate.search.backend.directory.root=target/lucenefiles
hibernate.search.backend.directory.root=target/lucenefilesR4
hibernate.search.backend.lucene_version=lucene_current
# hibernate.search.model_mapping=ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory
# hibernate.search.default.directory_provider=filesystem
Expand Down