FHIR Chat · How to validate a Fhir query · implementers

Stream: implementers

Topic: How to validate a Fhir query


view this post on Zulip Janith Amarasingha (Nov 09 2021 at 05:31):

Hi all,
I’m bit new to Fhir queries, So I want to validate Fhir queries whether they are correct or not.
1. Is there a validator service available for Fhir queries?
2. I want to validate following query because I have doublet
"Observation?subject=patientId&code=http://loinc.org|8302-2,29463-7,urn:oid:1.2.752.108.1|NPU02902,NPU03568,NPU02593,NPU04998,SWE05054&sort:desc=date"

Thanks and regards,
Janith

view this post on Zulip René Spronk (Nov 09 2021 at 08:30):

AFAIK there is no query syntax validator (I've seen prior discussions of this idea). If you'd building a search string, one can always test against one of the public FHIR servers, or (as you just did) ask the wider FHIR community.
Observation?patient.identifier=patientId&code=http://loinc.org|8302-2,http://loinc.org|29463-7,urn:oid:1.2.752.108.1|NPU02902,urn:oid:1.2.752.108.1|NPU03568,urn:oid:1.2.752.108.1|NPU02593,urn:oid:1.2.752.108.1|NPU04998,urn:oid:1.2.752.108.1|SWE05054&_sort=date would be my (untested) corrected version of your search URL. Please study build.fhir.org/search.html as well..

view this post on Zulip Janith Amarasingha (Nov 10 2021 at 02:49):

René Spronk said:

AFAIK there is no query syntax validator (I've seen prior discussions of this idea). If you'd building a search string, one can always test against one of the public FHIR servers, or (as you just did) ask the wider FHIR community.
Observation?patient.identifier=patientId&code=http://loinc.org|8302-2,http://loinc.org|29463-7,urn:oid:1.2.752.108.1|NPU02902,urn:oid:1.2.752.108.1|NPU03568,urn:oid:1.2.752.108.1|NPU02593,urn:oid:1.2.752.108.1|NPU04998,urn:oid:1.2.752.108.1|SWE05054&_sort=date would be my (untested) corrected version of your search URL. Please study build.fhir.org/search.html as well..

Hi @René Spronk
Thanks for your quick response.

view this post on Zulip Grahame Grieve (Nov 10 2021 at 09:12):

there kind of is a query validator by default - perform the search on test.fhir.org, and see what it echoes in the search self link. As far as I'm aware, it's fully conformant with the specification


Last updated: Apr 12 2022 at 19:14 UTC