2

Is there a way I can do a wildcard search for MRN numbers in FHIR? ex. I want to search for all MRN numbers starting with 12345.

thanks, Suresh

Suresh
  • 31
  • 4

1 Answers1

0

I think this is actually a bit trickier than it may seem within the fhir standard.

For general text/string searching, your best bet would be the :contains modifier in your query parameters. For example:

[base]/Patient?given:contains=ada

should return a Bundle containing all Patient resources with the string 'ada' (case and accent insensitive) in the given name. However, MRN's are typically stored as Patient.identifier, which is a token parameter. The specification states:

"A token type is a parameter that provides an exact match search, either on a string of characters, potentially scoped by a URI. It is mostly used against a code or identifier data type where the value may have a URI that scopes its meaning, where the search is performed against the pair from a Coding or an Identifier. Tokens are also used against other fields where exact matches are required"

https://www.hl7.org/fhir/search.html#token

However, the specification also provides the :text modifier for token parameters, of which it states:

"For token: :text (the match does a partial searches on the text portion of a CodeableConcept or the display portion of a Coding), instead of the default search which uses codes."

This seems to suggest that you could perform your search with something like:

[base]/Patient?identifier:text=12345

...however the standard ALSO states that "only a few servers are expected to offer this facility." So you may be out of luck unless the server you are querying against has implemented this functionality.

roboscott
  • 19
  • 5