HAPI-1942: Invalid _has parameter syntax

35 views
Skip to first unread message

Brian Walsh

unread,
Jan 15, 2025, 4:19:44 PM1/15/25
to HAPI FHIR
This query works on Google's FHIR service:

Patient?gender=female&_has:Condition:body-site.text=Kidney

But fails on HAPI 7.4.0 
HAPI-1942: Invalid _has parameter syntax: :Condition:body-site.text

Might be similar to:

James Agnew

unread,
Jan 15, 2025, 4:25:22 PM1/15/25
to Brian Walsh, HAPI FHIR
Hi Brian,

This is not a valid _has query, I don't actually understand what the Google server would be doing with it. Per the specs, the _has syntax has 3 colons. E.g. the following example from the spec:
GET [base]/Patient?_has:Observation:patient:code=1234-5

Presumably you meant to do:

Patient?gender=female&_has:Condition:subject:body-site.text=Kidney

Cheers,
James


--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/adfd752e-8c1d-45c1-bd51-9da126e1664dn%40googlegroups.com.

Brian Walsh

unread,
Jan 15, 2025, 5:18:13 PM1/15/25
to HAPI FHIR
Wow.  Thanks so much for the quick response.   Much appreciated!

I've corrected the query and gotten further.

Patient?gender=female&_has:Condition:subject:body-site=64033007
Returns the expected data

However,
Patient?gender=female&_has:Condition:subject:body-site:text=Kidney
Returns HAPI-1209: Unknown parameter name: Condition:body-site:text

While ,
Condition?body-site:text=Kidney
Returns the expected data



James Agnew

unread,
Jan 15, 2025, 5:22:57 PM1/15/25
to Brian Walsh, HAPI FHIR
Ah interesting. I don't actually think the :text modifier is currently supported as a part of a _has query in HAPI FHIR.

To work around this, you could create a custom search parameter of type "string" which indexes the path "Condition.bodySite.text" and reference it from your _has expression. That's a bit clunky but it would work.

Certainly a bug report would be appreciated, although no guarantees on how quickly it would be addressed, this would be tricky to implement.

Cheers,
James

Brian Walsh

unread,
Jan 15, 2025, 7:28:41 PM1/15/25
to HAPI FHIR
Bug created. Thanks again.
Reply all
Reply to author
Forward
0 new messages