-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
code for returning 'summary' search responses is automatically stripping extensions from the response #5871
Comments
jamesagnew
added a commit
that referenced
this issue
May 18, 2024
Glad to hear that there will be a fix! Any timelines on when it will be released? |
@henryt678 This should appear in snapshot builds in the next day or so, and will be released in our 7.4.0 (August 2024) release. |
jamesagnew
added a commit
that referenced
this issue
May 30, 2024
* Fix #5871 - Configurable summary mode * Add docs * Spotless * Add javadoc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The code for returning 'summary' search responses is automatically stripping extensions from the response. In our case, there are certain extensions that need to be included in the summary search response.
Here is the code in BaseParser of HAPI FHIR,
if (retVal && isSummaryMode() && (getDef() == null || !getDef().isSummary())) {
String resourceName = myEncodeContext.getLeafResourceName();
// Technically the spec says we shouldn't include extensions in CapabilityStatement
// but we will do so because there are people who depend on this behaviour, at least
// as of 2019-07. See
// smart-on-fhir/Swift-FHIR#26
// for example.
if (("Conformance".equals(resourceName) || "CapabilityStatement".equals(resourceName))
&& ("extension".equals(myDef.getElementName())
|| "extension".equals(myEncodeContext.getLeafElementName()))) {
// skip
} else {
retVal = false;
}
}
In the summary mode, the extensions are dropped.
To Reproduce
Steps to reproduce the behavior:
...for a claim resource, when we add an extension, the HAPI plain server returns the response without the extension.
Expected behavior
The wording from the specification is "This subset SHOULD consist solely of all supported elements that are marked as "summary" in the base definition of the resource(s)". Note the use of SHOULD rather than SHALL. While it's reasonable for HAPI's default behavior to be stripping all extensions, there should be a configuration option to allow selected extensions to be included. The only alternative to this is moving to custom operations, which is much less interoperable.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: