Task resource search URL with output filed that is an identifier ?

22 views
Skip to first unread message

christophe spielmann

unread,
Feb 24, 2025, 8:52:53 AM2/24/25
to HAPI FHIR
Hello,

Let's say that I have a Task resource as below into HAPI FHIR. I wonder how to search for it within HAPI FHIR using its output value when it is an identifier.

Strangely enough the following works with another FHIR server implementation but not with HAPI (7.4.0)
GET {{baseurl}}/Task?output:identifier=http%3A//www.lns.lu/glims/dossierid|23113483

Any hint welcome. it puzzled me.

Here is the Task (pretty basic)

{ "resourceType": "Task", "basedOn": [ { "type": "CarePlan", "identifier": { "system": "urn:ietf:rfc:3986", "value": "urn:uuid:3aae92e6-9c51-46ab-83bb-bc3a5a66d429" } } ], "status": "completed", "intent": "filler-order", "code": { "coding": [ { "system": "http://lns.lu/task", "code": "CREATE_ORDER_IN_GLIMS" } ] }, "authoredOn": "2023-12-11T17:44:00+01:00", "output": [ { "type": { "text": "order identifier" }, "valueReference": { "identifier": { "system": "http://www.lns.lu/glims/dossierid", "value": "5487" } } } ], "id": "44" }


G G (Tadgh)

unread,
Feb 24, 2025, 11:31:53 AM2/24/25
to HAPI FHIR
Based on the spec for Task, there is no built-in search parameter for the output. see https://hl7.org/fhir/R4/task.html#search . HAPI-FHIR implements search parameterss as defined on this spec. You could, however, define a custom search parameter, re-index the data ( or add a new Task that matches), and then search by the new SP.

I don't know what the fhirpath for the custom SP would be offhand, but probably something like Task.output.where(type="order identifier").valueReference.identifier and the SP type would be `token` given its on an identifier.

christophe spielmann

unread,
Feb 24, 2025, 11:39:09 AM2/24/25
to HAPI FHIR
Hello Gary, thanks for the reply.

Actually, I forgot to mention that I am using R5. sorry about that.
and as far as I can see into the specs R5,  there is something supposedly that would meet your expectation above.

output

reference

Search by task output

Task.output.value.ofType(Reference)



G G (Tadgh)

unread,
Feb 24, 2025, 1:40:08 PM2/24/25
to HAPI FHIR
Ah, you're right, this apparently is currently unsupported in HAPI-FHIR, per this zulip thread: https://chat.fhir.org/#narrow/stream/179167-hapi/topic/searching.20for.20subject.3Aidentifier

christophe spielmann

unread,
Feb 25, 2025, 2:39:23 AM2/25/25
to HAPI FHIR
Ah, I missed that. thanks for pin pointing this as it seem a pretty standard expected behavior . 
Yet it is very annoying .
I will browser and add my comment on their github.

Reply all
Reply to author
Forward
0 new messages