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

code for returning 'summary' search responses is automatically stripping extensions from the response #5871

Open
henryt678 opened this issue Apr 24, 2024 · 2 comments · May be fixed by #5944

Comments

@henryt678
Copy link

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):

  • HAPI FHIR Version 5.6.8
  • OS: Windows

Additional context
Add any other context about the problem here.

@jamesagnew jamesagnew linked a pull request May 18, 2024 that will close this issue
@henryt678
Copy link
Author

Glad to hear that there will be a fix! Any timelines on when it will be released?

@jamesagnew
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants