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

FHIR Search _count=0 should be same as _summary=count #3230

Closed
mikaelweave opened this issue Apr 13, 2023 · 3 comments
Closed

FHIR Search _count=0 should be same as _summary=count #3230

mikaelweave opened this issue Apr 13, 2023 · 3 comments
Assignees
Labels
Bug Bug bug bug. Good First Issue Specification An issue referring or related to the FHIR Specification Up for grabs The issue require minimal context and is well-suited for new contributors.

Comments

@mikaelweave
Copy link
Contributor

mikaelweave commented Apr 13, 2023

Describe the bug
When running a FHIR query with _count=0, I get a HTTP 400 response. This is not expected according to the FHIR spec.

http://<redacted>.azurewebsites.net/Encounter?_count=0

FHIR Version?
Found on R4, possibly applicable to all.

Data provider?
Found on SQL, possibly applicable to all.

To Reproduce
Steps to reproduce the behavior:

  1. Load a FHIR Server with encounter data.
  2. Run a _count=0 on encounters (http://<redacted>.azurewebsites.net/Encounter?_count=0)

Expected behavior
According to the FHIR Spec, _count=0 should be the same as _summary=count.

CleanShot 2023-04-13 at 10 10 19

Actual behavior
HTTP 400 response.

CleanShot 2023-04-13 at 10 11 27

AB#102605

@mikaelweave mikaelweave added the Bug Bug bug bug. label Apr 13, 2023
@brendankowitz brendankowitz added Up for grabs The issue require minimal context and is well-suited for new contributors. Specification An issue referring or related to the FHIR Specification labels Apr 13, 2023
@LTA-Thinking
Copy link
Collaborator

This is a bug on the Firely library. Their SearchParam validator requires _count to be >0.
https://github.com/FirelyTeam/firely-net-sdk/blob/develop/src/Hl7.Fhir.Base/Rest/SearchParams.cs#L117

We need to add a filter to remove the _count param and replace it with the _summary param before this line: https://github.com/microsoft/fhir-server/blob/main/src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs#L193

@LTA-Thinking
Copy link
Collaborator

I think this is a good first issue. The fix should be limited to one file, is easy to test manually, and easy to add a unit test for.

mahajan-xor added a commit that referenced this issue Nov 9, 2023
* Fix FHIR Serach query with params _count=0  (#3230)

* fixes code review comments

* Fix for CustomQueryTests  #105699

* letter summary fixes

* Adds Testcase for Invalid _count and updates existing testcase to check for totalcount

* worked on review comments
@brendankowitz
Copy link
Member

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug bug bug. Good First Issue Specification An issue referring or related to the FHIR Specification Up for grabs The issue require minimal context and is well-suited for new contributors.
Projects
None yet
Development

No branches or pull requests

4 participants