Reference search :identifier modifier

49 views
Skip to first unread message

Erik Brakke

unread,
Jul 11, 2024, 12:11:04 PM7/11/24
to GCP Healthcare Discuss
From the conformance statement:
  • The token search modifier :of-type and the reference search modifier :identifier aren't supported.
Is the :identifier modifier on the roadmap?

Thanks!
-Erik

Paul Church

unread,
Jul 12, 2024, 5:29:54 PM7/12/24
to Erik Brakke, GCP Healthcare Discuss
There hasn't been enough demand for this to get it onto the roadmap so far - I don't think identifier references have achieved widespread use.

There is a partial workaround through custom search parameters, as pointing a token search parameter's fhirpath expression to [reference field].identifier will index the system/value and act like an identifier search, e.g. ?my-identifier-reference-search=system|value - but because this is not a reference search, related functionality like chaining and include will not work.

--
You received this message because you are subscribed to the Google Groups "GCP Healthcare Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gcp-healthcare-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gcp-healthcare-discuss/cc41e39a-c287-475f-9921-8bee1358c709n%40googlegroups.com.

Erik Brakke

unread,
Jul 16, 2024, 10:41:19 AM7/16/24
to GCP Healthcare Discuss
Thank you Paul for the insights and the workaround!  Looking forward to custom search going GA.

Maico Bernal

unread,
Oct 22, 2024, 4:37:08 PM10/22/24
to GCP Healthcare Discuss
Hello there,

Is the :of-type modifier on the roadmap? 

Do you know any workaround solution using custom search parameters for that purpose?

What i need is a way to search for a identifier value of a specific type. 

I have tried with multiples expressions like Person.identifier.where(type.coding.code = value) or .identifier.where(type.coding.where(code = '1')) with this parameters i list below but i get a error 400 with INVALID_ARGUMENT and no more clues about whats wrong.

"code": "dni",
"base": ["Person"],
"type": "token",
"status": "active",
"expression": "Person.identifier.where(type.coding.where(code = '1'))",
"xpathUsage": "normal"

"error": { "code": 400, "message": "failed to parse search parameter PersonNationalIdentifierSearch", "status": "INVALID_ARGUMENT" }

Any help or suggestions will be appreciated.

Erik Brakke

unread,
Oct 22, 2024, 4:45:31 PM10/22/24
to GCP Healthcare Discuss
If your identifier system aligns with the type, searching on system might be an option.

Person?identifier={system}|{value}

The {value} after the pipe is optional

Person?identifier={system}|

Will return all resources of that identifier system.  And, behind the scenes it is an indexed search, so it performs well.

-Erik

Paul Church

unread,
Oct 22, 2024, 6:05:16 PM10/22/24
to mbe...@uma-health.com, GCP Healthcare Discuss
The issue with the expression you're trying is that custom search parameter expressions don't support "where()" clauses (except in the specific case of extension URLs, since that is a common pattern). The limitations should hopefully be clear from https://cloud.google.com/healthcare-api/docs/how-tos/fhir-custom-search#expression

Emulating the exact functionality of :of-type with custom searches is not quite possible. You can define an expression that walks into that sub-field, e.g. Person.identifier.type (a CodeableConcept so as a token parameter it will support system|value, or pointing the expression to Person.identifier.type.coding.code is an option if you only care about the code), and then search by Person?my-identifier-type-param=[system|value] but this doesn't combine with the value of the identifier the way of-type does.

If you did a search for Person?identifier=[value]&my-identifier-type-param=[system|value], this risks unintended matches if an individual resource has multiple identifiers, one of which matches identifier=[value] while another matches my-identifier-type-param=[system|value]. If you can constrain the assumptions of the use case so that doesn't happen, this may still be viable as a workaround.

Alternately, as Erik points out there are a fair number of use cases where the identifier system aligns with the type so searching by system is sufficient.

Support for :of-type is not currently on the roadmap. It is being tracked but has not come up often as a priority for customers.

Maico Bernal

unread,
Oct 23, 2024, 11:37:59 AM10/23/24
to GCP Healthcare Discuss
Thank you both for the responses.

Your explanation about the expression limitations is very clear. I understand now that there's no direct workaround since custom search parameters don't support where() clauses (totally missed that line on the docs)

Our specific case involves a client that sends identifiers with a unique system but three different types of identifier. While the probability of collisions (same identifier.value for different type.coding.codes) is low, we tested the suggested approach of Person?identifier=[value]&my-identifier-type-param=[system|value] and encountered the exact issue you described - the FHIR store returns matches when an identifier.value exists in one identifier entry but the type matches in a different identifier entry of the same resource.

As a workaround, we'll implement post-processing using FHIRPath in our application layer to validate that Person.identifier.where(type.coding.where(code = '1')) matches the specific identifier.value we're searching for.

Thanks for explaining the current status regarding :of-type support and your helpful suggestions.

Best regards,
Maico
Reply all
Reply to author
Forward
0 new messages