FHIR Chat · QI Core in HAPI FHIR JPAserver · hapi

Stream: hapi

Topic: QI Core in HAPI FHIR JPAserver


view this post on Zulip Greg A (Dec 16 2021 at 20:19):

I've got a HAPI FHIR JPA server started (fresh checkout from HAPI-FHIR-JpaServer-Starter

After asking on the google groups mailing list, I learned that I can specify an NPM package to include an implementation guide.

Now, I've already got QI-Core validation working in a Plain Server, but was looking for the most straight-forward way to set this up in a JpaServer.

The server starts, and the structure definitions are loaded. However, the validation isn't actually happening when I create a Patient resource.

I'm testing this by creating a Patient without name.family (which is required by QI-Core, but not required by base FHIR R4 )

Any suggestions for what I can look for to see if I have something setup incorrectly? Or.. should is the expected behavior different from what I'm expecting?

view this post on Zulip Jens Villadsen (Dec 16 2021 at 20:21):

There are multiple places where your validation can kick in. The JPA starter uses the RepositoryValidationInterceptors as default. See more here: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/java/ca/uhn/fhir/jpa/starter/RepositoryValidationInterceptorFactoryR4.java

view this post on Zulip Greg A (Dec 16 2021 at 23:10):

Thanks for the hint Jens.

So looking at the BaseJpaRestfulServer, it appears that the instance of factory that should be Autowired to a RepositoryValidationInterceptors is null

I'm guessing that it's simply because of this @ConditionalOnProperty(prefix = "hapi.fhir", name = "enable_repository_validating_interceptor", havingValue = "true")

and in application.yaml

#    enable_repository_validating_interceptor: false

I haven't used "ConditionalOnProperty" before, but if I explicitly set it to true, then the interceptor factory registers and the Resources are validates as I expected.


Last updated: Apr 12 2022 at 19:14 UTC