Unable to query the data for a specific patient
Describe the bug It looks like we are unable to get the resources (Observation, Condition etc) for a specific patient using the patient id. It is returning all the data in the database, regardless of the patient id requested
To Reproduce Steps to reproduce the behavior: These 3 calls will give the same result, all the condition records in the database: https://my.spark.fhir.server/fhir/Condition https://my.spark.fhir.server/fhir/Condition?Patient=19 https://my.spark.fhir.server/fhir/Condition?Patient=2000
Expected behavior It should return only the condition records for the requested patient id (19 or 2000), not all.
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome, Edge
Additional context This FHIR server is deployed in Google Cloud Run and running with a MongoDB database.
Hi @cbodnara!
Could you try to change the casing of the search parameter from 'Patient' to 'patient'
For example:
https://my.spark.fhir.server/fhir/Condition?patient=19
https://my.spark.fhir.server/fhir/Condition?patient=2000
Hi Kenneth,
Thanks for replying. With lower case I am getting the below response. That is the reason I changed the case.
Cristian

It seems I'm currently having the same problem on my test server, but not yet able to reproduce it locally.
These two searches will work: https://spark.incendi.no/fhir/Condition?subject=Patient/34&_format=json https://spark.incendi.no/fhir/Condition?subject=34&_format=json While this, will not: https://spark.incendi.no/fhir/Condition?patient=34&_format=json
I will investigate this further and come back to you.
In the meantime for a workaround this:
https://spark.incendi.no/fhir/Condition?subject=Patient/34
will be the same as this:
https://spark.incendi.no/fhir/Condition?patient=34
Thanks for looking into this Kenneth.
It looks like using the parameter subject is doing the same in my server. It always brings the data, regardless of the patient id supplied. There is only one patient in the database with the id 19 but I guess if there were more, it would bring them all.
@cbodnara I can see there is a problem with the patient search parameter, but not with subject so that should work.
Can you look into the collection searchindex and find the Condition entry in your database. There you will find which search parameteres Spark has indexed.