Stream: implementers
Topic: How to do prefix search for token parameter?
shoho (Apr 26 2021 at 08:00):
There are two examples I want to search.
1.Patient resource having the following property.
"telecom": [{"system": "phone", "value": "0311112222"}]
I want to search the patient even with partial phone number (0311).
2.Patient resource having the following property.
"identifier": [{"type": {"text": “CIVIL ID”},"value": "1111111111"}]
I want to search the patient even with type and partial value (11111).
Thank you.
Paul Church (Apr 26 2021 at 14:44):
Token search is defined as "close to exact match". It is not expected to search partial values.
ContactPoint (for telecom) has a special case "At the discretion of the server, token searches on ContactPoint may use special handling, such as ignoring punctuation, performing partial searches etc." but this is implementation dependent.
http://hl7.org/fhir/search.html#token
Lloyd McKenzie (Apr 26 2021 at 17:23):
If you want to do a contains search on phone number or identifier, you'll have to define a separate search parameter (of search type 'string') to do that.
Lloyd McKenzie (Apr 26 2021 at 17:23):
(And convince the relevant servers to implement it.)
shoho (May 03 2021 at 15:30):
Thank you all! I will follow your advice.
Last updated: Apr 12 2022 at 19:14 UTC