Skip to content

The _elements filter is not properly applied when using a batch search #6169

@brian-mcdonell-invitae

Description

@brian-mcdonell-invitae

Describe the bug
When doing a POST search with a batch bundle as the payload, the "_elements" parameter in the included GET requests are not honored.

To Reproduce
For example - if you make this simple GET request to the FHIR server, the FHIR resource will exclude most elements in the resources, including only: resourceType, id, meta and medicationCodeableConcept:

/MedicationStatement?_elements=medicationCodeableConcept

However - if you execute a batch search with the same thing nested in the bundle, then all the elements in the returned resources are returned, instead of just those listed above, such as "dateAsserted", "dosage", etc:

{
  "resourceType": "Bundle",
  "type": "batch",
  "entry": [
    {
      "request": {
        "method": "GET",
        "url": "/MedicationStatement?_elements=medicationCodeableConcept"
      }
    }
  ]
}

Expected behavior
The _elements filter value should be honored in batch searches, just as it is in non-batch searches.

Environment (please complete the following information):
This happens on the HAPI FHIR JPS server. I verified it happens in the latest version running on the public hapi fhir server:


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions