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

Invalid response when using _summary=count #1763

Closed
ghost opened this issue Mar 16, 2020 · 1 comment
Closed

Invalid response when using _summary=count #1763

ghost opened this issue Mar 16, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 16, 2020

Hi :)
I've been trying to have the server give me the total number of results for a given search. I noticed that the Bundle I get as a response does not include the type key which is required based on the FHIR standard:
https://www.hl7.org/fhir/bundle-definitions.html#Bundle.type

Describe the bug
Sending a request with _summary=count returns a Bundle without a type key.
The most appropriate type appears to be "searchset". When I use _summary with all the other valid options, that's the type I get in the response.

To Reproduce
Send a request with any resource type (Observation, Media ...) using _summary=count.
For example: http://hapi.fhir.org/baseR4/Media?_summary=count

Expected behavior
I expect to get a Bundle including the type key with the value "searchset".

Environment (please complete the following information):

  • Happened with both HAPI FHIR 4.1.0 and 4.3.0
  • I get this response I posted above both in the browser (link) and when using an actual FHIR client implementation. In this case: https://github.com/smart-on-fhir/Swift-SMART

Additional context
As an example of a response I get without the type key:
http://hapi.fhir.org/baseR4/Media?_summary=count gives me:

{
  "resourceType": "Bundle",
  "id": "9aaf1d79-4c1a-4c9c-a3db-ea5b119653b6",
  "meta": {
    "lastUpdated": "2020-03-16T12:02:17.484+00:00",
    "tag": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
        "code": "SUBSETTED",
        "display": "Resource encoded in summary mode"
      }
    ]
  },
  "total": 1705
}

I have opened another issue here (wasn't sure where it applied): hapifhir/hapi-fhir-jpaserver-starter#88

@jamesagnew
Copy link
Collaborator

Thanks for reporting! A fix has been submitted.

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

No branches or pull requests

1 participant