FHIR Chat · AuditEvent and setStripVersionsFromReferences · hapi

Stream: hapi

Topic: AuditEvent and setStripVersionsFromReferences


view this post on Zulip Michael Lawley (Oct 26 2021 at 20:56):

In an AuditEvent, it is important that References to resources are versioned. However, the default behaviour of HAPI's serialisation is to strip version references and thus the values of AuditEvent.entity.what are serialised without the version component of the reference.
From inspection of streamResponseAsResource, it appears that even with the use of interceptors (@James Agnew ;-), there is no simple way to tell HAPI to retain the version references?

view this post on Zulip James Agnew (Oct 27 2021 at 01:43):

You should be able to call setDontStripVersionsFromReferencesAtPaths on either the parser (if you're serializing manually) or on the FhirContext#getParserOptions() object (if you want it to apply globally)

view this post on Zulip Michael Lawley (Oct 27 2021 at 19:45):

The challenge I have is that I only want it set when returning the AuditEvent, and I can't get to the parser that's created by streamResponseAsResource to call it there and I really don't want to have to replicate all the other logic going on in there.


Last updated: Apr 12 2022 at 19:14 UTC