You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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: