Stream: shorthand
Topic: valueSet with regex
John Moehrke (Aug 13 2021 at 13:14):
I am trying to re-create the iso3166-1-3 valueSet in sushi (for some reason that valueset does not work today).
All I need to do is include all the codes from iso3166 given a regex, but I can't get that regex to work. I have pulled the regex from the above valueset, but don't seem to be able to get sushi valueset include regex syntax right
* include codes from system ISO where code regex "[A-Z]{3}"
Nick Freiter (Aug 13 2021 at 14:08):
For regex codes, the FSH requires that the value "[A-Z]{3}"
be specified using regex syntax, indicated by leading and trailing /
. So in this case the value would be /[A-Z]{3}/
. See this example.
John Moehrke (Aug 13 2021 at 14:29):
thanks. I forgot to check fsh school.. I was focused on the shorthand specification that simply indicated regex and pointed at the FHIR core where what I had was fine. So this special pattern should be in the shorthand specification
Nick Freiter (Aug 13 2021 at 14:50):
Yeah you're right, it isn't very well documented.
Nick Freiter (Aug 13 2021 at 14:51):
Or rather isn't documented at all in the spec
John Moehrke (Aug 13 2021 at 14:55):
my position is that it is documented... and it is documented to be different than it actually is.
Nick Freiter (Aug 13 2021 at 16:01):
Where are you seeing it documented? I don't see any place in the shorthand spec where we discuss the syntax for a regular expression in a ValueSet
include statement.
John Moehrke (Aug 13 2021 at 16:05):
https://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#filters
John Moehrke (Aug 13 2021 at 16:06):
A filter is a logical statement in the form {property} {operator} {value}, where operator is chosen from the FilterOperator value set. Not all operators in that value set are valid for all code systems. The property and value are dependent on the code system. For choices for the most common code systems, see the FHIR documentation on filters.
John Moehrke (Aug 13 2021 at 16:06):
which I followed the link
John Moehrke (Aug 13 2021 at 16:09):
hmm, I thought that at one of those FHIR core links was something helpful.. but I don't find it..
Mark Kramer (Aug 13 2021 at 16:09):
If it doesn't work, it might be that ISO is either unknown to the terminology server or that code system doesn't expose the property "code" in FHIR.
John Moehrke (Aug 13 2021 at 16:09):
what I did find, because I was focused on 3166-1-3; was to look at that and pull the regex out of that.
Mark Kramer (Aug 13 2021 at 16:10):
John, you can probably get around it using an invariant
John Moehrke (Aug 13 2021 at 16:10):
@Mark Kramer I got sushi to work... @Nick Freiter explained my problem
Mark Kramer (Aug 13 2021 at 16:10):
:+1:
John Moehrke (Aug 13 2021 at 16:10):
I am stuck on a vocabulary support issue.. but that is down in the vocabulary stream
John Moehrke (Aug 13 2021 at 16:11):
my residual sushi problem is that it was not clear reading shorthand specification how to do regex and that I needed to use /
rather than "
Nick Freiter (Aug 13 2021 at 16:11):
But @Mark Kramer, this does point to a problem in the shorthand spec. Namely that regex values are undocumented.
Mark Kramer (Aug 13 2021 at 16:13):
We don't attempt to document property-operator-value combinations because they are specific to individual code systems. But Regex is an excellent example, it should be added.
John Moehrke (Aug 13 2021 at 16:14):
yup, should not need to define everything. A simple example likely would have been enough.
John Moehrke (Aug 13 2021 at 16:14):
* include codes from system urn:iso:std:iso:3166 where code regex /[A-Z]{3}/
Last updated: Apr 12 2022 at 19:14 UTC