Stream: terminology
Topic: ValueSet `regex` op
Michael Lawley (Feb 24 2021 at 00:16):
The documentation on ValueSet filters where op
= regex
is incomplete.
Two key issues are:
- what flavour of regex?
- are these regex's implicitly "anchored"? More specifically, is it expected that the regex must match the entire value or not? Looking at the definition of http://hl7.org/fhir/ValueSet/iso3166-1-3, which is documented as:
This value set defines the ISO 3166 Part 1 3-letter codes
and has the following filter:
"include" : [{
"system" : "urn:iso:std:iso:3166",
"filter" : [{
"property" : "code",
"op" : "regex",
"value" : "[A-Z]{3}"
}]
}]
it would appear so. i.e., the regex should be interpreted as ^[A-Z]{3}$
This then raises the question of what the regex ^[A-Z]{3}$
should match? i.e., are the ^
and $
characters to be treated literally or not (hence question 1. what flavour of regex)
Grahame Grieve (Feb 24 2021 at 02:17):
yes it should be understood to be anchored. I do not know how to resolve the falvor question
Rob Hausam (Feb 24 2021 at 02:21):
In lieu of deciding on a single flavor for everyone, the server could (should) at least declare which flavor it supports?
Last updated: Apr 12 2022 at 19:14 UTC