From f39ca7eb2f96a79a2c59c83b23ce629ec726ad92 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 30 Sep 2016 08:34:25 -0400 Subject: [PATCH] Start del cleanup --- .../ca/uhn/fhir/jpa/config/BaseConfig.java | 42 ------------------ .../uhn/fhir/jpa/config/BaseDstu1Config.java | 11 +++++ .../uhn/fhir/jpa/config/BaseDstu2Config.java | 43 ++++++++++++++----- .../jpa/config/dstu3/BaseDstu3Config.java | 15 +++++-- hapi-fhir-narrativegenerator/.project | 31 +++++++++++++ 5 files changed, 85 insertions(+), 57 deletions(-) create mode 100644 hapi-fhir-narrativegenerator/.project diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java index dac314d390c..3fbf16857ea 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java @@ -50,10 +50,6 @@ import ca.uhn.fhir.jpa.term.IHapiTerminologySvc; @EnableJpaRepositories(basePackages = "ca.uhn.fhir.jpa.dao.data") public class BaseConfig implements SchedulingConfigurer { - private static FhirContext ourFhirContextDstu1; - private static FhirContext ourFhirContextDstu2; - private static FhirContext ourFhirContextDstu2Hl7Org; - private static FhirContext ourFhirContextDstu3; @Resource private ApplicationContext myAppCtx; @@ -71,45 +67,7 @@ public class BaseConfig implements SchedulingConfigurer { return new DatabaseBackedPagingProvider(10); } - @Bean(name = "myFhirContextDstu1") - @Lazy - public FhirContext fhirContextDstu1() { - if (ourFhirContextDstu1 == null) { - ourFhirContextDstu1 = FhirContext.forDstu1(); - } - return ourFhirContextDstu1; - } - @Bean(name = "myFhirContextDstu2") - @Lazy - public FhirContext fhirContextDstu2() { - if (ourFhirContextDstu2 == null) { - ourFhirContextDstu2 = FhirContext.forDstu2(); - } - return ourFhirContextDstu2; - } - - @Bean(name = "myFhirContextDstu2Hl7Org") - @Lazy - public FhirContext fhirContextDstu2Hl7Org() { - if (ourFhirContextDstu2Hl7Org == null) { - ourFhirContextDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); - } - return ourFhirContextDstu2Hl7Org; - } - - @Bean(name = "myFhirContextDstu3") - @Lazy - public FhirContext fhirContextDstu3() { - if (ourFhirContextDstu3 == null) { - ourFhirContextDstu3 = FhirContext.forDstu3(); - - // Don't strip versions in some places - ParserOptions parserOptions = ourFhirContextDstu3.getParserOptions(); - parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); - } - return ourFhirContextDstu3; - } @Bean(autowire=Autowire.BY_TYPE) public StaleSearchDeletingSvc staleSearchDeletingSvc() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu1Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu1Config.java index 2364782d1f7..d7a8d20110c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu1Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu1Config.java @@ -25,6 +25,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowire; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; import ca.uhn.fhir.context.FhirContext; @@ -36,12 +37,22 @@ import ca.uhn.fhir.model.dstu2.composite.MetaDt; @Configuration public class BaseDstu1Config extends BaseConfig { + private static FhirContext ourFhirContextDstu1; @Bean(autowire = Autowire.BY_TYPE) public IHapiTerminologySvc terminologyService() { return new HapiTerminologySvcDstu1(); } + @Bean(name = "myFhirContextDstu1") + @Lazy + public FhirContext fhirContextDstu1() { + if (ourFhirContextDstu1 == null) { + ourFhirContextDstu1 = FhirContext.forDstu1(); + } + return ourFhirContextDstu1; + } + @Bean @Primary diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java index efc19f62bcb..dca0fce4690 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseDstu2Config.java @@ -10,7 +10,7 @@ package ca.uhn.fhir.jpa.config; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,6 +23,7 @@ package ca.uhn.fhir.jpa.config; import org.springframework.beans.factory.annotation.Autowire; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; import org.springframework.transaction.annotation.EnableTransactionManagement; @@ -39,11 +40,8 @@ import ca.uhn.fhir.model.dstu2.composite.MetaDt; @EnableTransactionManagement public class BaseDstu2Config extends BaseConfig { - @Bean(autowire = Autowire.BY_TYPE) - public IHapiTerminologySvc terminologyService() { - return new HapiTerminologySvcDstu2(); - } - + private static FhirContext ourFhirContextDstu2; + private static FhirContext ourFhirContextDstu2Hl7Org; @Bean @Primary @@ -51,6 +49,24 @@ public class BaseDstu2Config extends BaseConfig { return fhirContextDstu2(); } + @Bean(name = "myFhirContextDstu2") + @Lazy + public FhirContext fhirContextDstu2() { + if (ourFhirContextDstu2 == null) { + ourFhirContextDstu2 = FhirContext.forDstu2(); + } + return ourFhirContextDstu2; + } + + @Bean(name = "myFhirContextDstu2Hl7Org") + @Lazy + public FhirContext fhirContextDstu2Hl7Org() { + if (ourFhirContextDstu2Hl7Org == null) { + ourFhirContextDstu2Hl7Org = FhirContext.forDstu2Hl7Org(); + } + return ourFhirContextDstu2Hl7Org; + } + @Bean(name = "myJpaValidationSupportDstu2", autowire = Autowire.BY_NAME) public ca.uhn.fhir.jpa.dao.IJpaValidationSupportDstu2 jpaValidationSupportDstu2() { ca.uhn.fhir.jpa.dao.JpaValidationSupportDstu2 retVal = new ca.uhn.fhir.jpa.dao.JpaValidationSupportDstu2(); @@ -63,6 +79,11 @@ public class BaseDstu2Config extends BaseConfig { return searchDao; } + @Bean(autowire = Autowire.BY_TYPE) + public SearchParamExtractorDstu2 searchParamExtractor() { + return new SearchParamExtractorDstu2(); + } + @Bean(name = "mySystemDaoDstu2", autowire = Autowire.BY_NAME) public IFhirSystemDao systemDaoDstu2() { ca.uhn.fhir.jpa.dao.FhirSystemDaoDstu2 retVal = new ca.uhn.fhir.jpa.dao.FhirSystemDaoDstu2(); @@ -75,10 +96,10 @@ public class BaseDstu2Config extends BaseConfig { retVal.setDao(systemDaoDstu2()); return retVal; } - - @Bean(autowire=Autowire.BY_TYPE) - public SearchParamExtractorDstu2 searchParamExtractor() { - return new SearchParamExtractorDstu2(); + + @Bean(autowire = Autowire.BY_TYPE) + public IHapiTerminologySvc terminologyService() { + return new HapiTerminologySvcDstu2(); } - + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java index bb7cc28196f..e5cd85fdaa8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/dstu3/BaseDstu3Config.java @@ -32,6 +32,7 @@ import org.springframework.context.annotation.Primary; import org.springframework.transaction.annotation.EnableTransactionManagement; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.ParserOptions; import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.IFhirSystemDao; @@ -61,8 +62,14 @@ public class BaseDstu3Config extends BaseConfig { @Bean @Primary - public FhirContext defaultFhirContext() { - return fhirContextDstu3(); + public FhirContext fhirContextDstu3() { + FhirContext retVal = FhirContext.forDstu3(); + + // Don't strip versions in some places + ParserOptions parserOptions = retVal.getParserOptions(); + parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); + + return retVal; } @Bean(name = "myInstanceValidatorDstu3") @@ -95,7 +102,7 @@ public class BaseDstu3Config extends BaseConfig { @Bean(name = "mySystemProviderDstu3") public ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3 systemProviderDstu3() { ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3 retVal = new ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3(); - retVal.setContext(defaultFhirContext()); + retVal.setContext(fhirContextDstu3()); retVal.setDao(systemDaoDstu3()); return retVal; } @@ -114,7 +121,7 @@ public class BaseDstu3Config extends BaseConfig { @Bean(autowire=Autowire.BY_TYPE) public TerminologyUploaderProviderDstu3 terminologyUploaderProvider() { TerminologyUploaderProviderDstu3 retVal = new TerminologyUploaderProviderDstu3(); - retVal.setContext(defaultFhirContext()); + retVal.setContext(fhirContextDstu3()); return retVal; } diff --git a/hapi-fhir-narrativegenerator/.project b/hapi-fhir-narrativegenerator/.project new file mode 100644 index 00000000000..579a2b6f9ac --- /dev/null +++ b/hapi-fhir-narrativegenerator/.project @@ -0,0 +1,31 @@ + + + hapi-fhir-narrativegenerator + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + +