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

The hapi-fhir-jpaserver-example project's JpaServerDemo supports DSTU1 and DSTU2, but not DSTU2.1 #278

karlmdavis opened this Issue Jan 7, 2016 · 1 comment


None yet
1 participant
Copy link

karlmdavis commented Jan 7, 2016

This class has a number of if ... else blocks that cope with the differences between DSTU1 and DSTU2, but does not yet include any logic for DSTU2.1.

Not a big deal, but would be nice.


This comment has been minimized.

Copy link
Contributor Author

karlmdavis commented Jan 7, 2016

I've created Pull Request #279 to address the JpaServerDemo changes needed. In addition, the following patch can be applied manually to address the other files that need to be updated to switch things to DSTU2.1:

diff --git a/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/ b/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/
index 9186ebd..4f6e6b1 100644
--- a/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/
+++ b/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/
@@ -15,16 +15,16 @@
 import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
 import org.springframework.transaction.annotation.EnableTransactionManagement;

-import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu2;
+import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu21;
 import ca.uhn.fhir.jpa.dao.DaoConfig;
-import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu2;
+import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu21;

-public class FhirServerConfig extends BaseJavaConfigDstu2 {
+public class FhirServerConfig extends BaseJavaConfigDstu21 {

     * Configure FHIR properties around the the JPA server via this bean
@@ -108,7 +108,7 @@

    @Bean(autowire = Autowire.BY_TYPE)
    public IServerInterceptor subscriptionSecurityInterceptor() {
-       SubscriptionsRequireManualActivationInterceptorDstu2 retVal = new SubscriptionsRequireManualActivationInterceptorDstu2();
+       SubscriptionsRequireManualActivationInterceptorDstu21 retVal = new SubscriptionsRequireManualActivationInterceptorDstu21();
        return retVal;

diff --git a/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF/web.xml b/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF/web.xml
index c81a6f6..ad7ebb5 100644
--- a/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF/web.xml
+++ b/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF/web.xml
@@ -42,7 +42,7 @@
-           <param-value>DSTU2</param-value>
+           <param-value>DSTU2_1</param-value>
diff --git a/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/ b/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/
index f4efde6..13463e4 100644
--- a/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/
+++ b/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/
@@ -7,13 +7,13 @@

 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.webapp.WebAppContext;
+import org.hl7.fhir.dstu21.model.Patient;
 import org.hl7.fhir.instance.model.api.IIdType;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;

 import ca.uhn.fhir.context.FhirContext;
-import ca.uhn.fhir.model.dstu2.resource.Patient;

@jamesagnew jamesagnew closed this in 95248c4 Jan 8, 2016

jamesagnew added a commit that referenced this issue Jan 8, 2016

Merge pull request #279 from karlmdavis/jpaserver-example-dstu-2.1
Resolves #278: Update JpaServerDemo to also support DSTU 2.1.

jamesagnew added a commit that referenced this issue Jan 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.