Stream: shorthand
Topic: Assigning Identifier pattern
Patrick Werner (Apr 12 2021 at 13:11):
I tried to add a pattern to an Identifier, but without luck. I first tried to use the syntax from CodeabelConcepts:
* identifier = http://example.org#test
Patrick Werner (Apr 12 2021 at 13:12):
which obviously can't work.
Patrick Werner (Apr 12 2021 at 13:12):
But i think this would be a nice syntax for assigning identifier pattern
Christian Nau (Apr 12 2021 at 13:13):
I tried to use slicing for identifier rules. But this didn't work for me as well, see https://fshschool.org/FSHOnline/#/share/3295tLA
Christian Nau (Apr 12 2021 at 13:13):
But I agree, this would be a nice syntax for assigning identifier patterns.
Patrick Werner (Apr 12 2021 at 13:14):
also tried to use: * identifier^patternIdentifier or * identifier^pattern[x]
But i'm always getting path errors.
Is there a Syntax to assign an object to pattern[x] in Elementdefinition
Patrick Werner (Apr 12 2021 at 13:19):
i fixed it: https://fshschool.org/FSHOnline/#/share/3sfZvmp
Chris Moesel (Apr 12 2021 at 14:49):
@Patrick Werner and @Christian Nau -- I see that in Patrick's version linked above, it sets the pattern on identifier.system, which is fine (since you also updated the slicing to slice on system). But if anyone is following this and wants to know how to do it on identifier itself, there are currently two approaches which should work.:
- Use
^patternIdentifier.systemto create apatternIdentifierw/systemproperty.
* identifier[myPatientNumber] ^patternIdentifier.system = MPN
If you wanted to set other parts of the pattern, you could do that too using subsequent statements. E.g.:
* identifier[myPatientNumber] ^patternIdentifier.use = #official
* identifier[myPatientNumber] ^patternIdentifier.system = MPN
- Create an inline
Instanceof anIdentifier...
Instance: MPNIdentifierPattern
InstanceOf: Identifier
Usage: #inline
* use = #official
* system = MPN
... and then assign it:
* identifier[myPatientNumber] = MPNIdentifierPattern
FSHOnline demonstrating both approaches above
Chris Moesel (Apr 12 2021 at 14:51):
That said, I agree that {system}#{value} is worth considering as a shorthand approach. I'll add it to our list of things to consider.
Jean Duteau (Apr 12 2021 at 14:51):
I used to always try the {system}#{value} for Identifiers when I was first learning FSH, so +1 to that.
Patrick Werner (Apr 12 2021 at 14:56):
Chris Moesel said:
That said, I agree that
{system}#{value}is worth considering as a shorthand approach. I'll add it to our list of things to consider.
i can see it for profiling, but also for creating the instance
Christian Nau (Apr 12 2021 at 14:57):
Thanks @Chris Moesel for your notes! Could you me point me to the part of the FHIR Shorthand-Documentation where I could have found this ^patternIdentifier? I'm trying to figure out how to get along with FSH with as little help as possible but I'm afraid that I'm missing some central parts.
Chris Moesel (Apr 12 2021 at 15:02):
That exact use case (using it for a pattern[x]) is not enumerated in the spec, but it's really just a more specific use of the general "caret path" approach documented here: http://hl7.org/fhir/uv/shorthand/reference.html#caret-paths
When you're using ^ with an element (e.g., * some-element-path ^some-caret-path), you can see the valid paths that go after the ^ by looking at the definition of ElementDefinition: http://hl7.org/fhir/R4/elementdefinition.html#ElementDefinition
(Although patternIdentifier is not enumerated there because it's just one of many possibilities for pattern[x]).
Christian Nau (Apr 12 2021 at 15:05):
Thank you! It's getting more clear now. :)
Chris Moesel (Apr 22 2021 at 13:23):
Regarding using {system}#{value} as a shorthand for Identifier... I discussed this with @Mark Kramer, and his concern is that we always use # to denote a code. In this case, the bit after # is a string -- so supporting this would break that rule about # indicating a code (although he also noted that code is technically a string). @Christian Nau, @Patrick Werner, @Jean Duteau, @David Pyke -- what do you think about that?
David Pyke (Apr 22 2021 at 13:26):
I like the syntax but not the delimiter. Can we use something else like "@"? (technically we could do {value}@{system})
Patrick Werner (Apr 22 2021 at 13:26):
David Pyke said:
I like the syntax but not the delimiter. Can we use something else like "@"? (technically we could do {value}@{system})
:+1:
Patrick Werner (Apr 22 2021 at 13:27):
but i would prefer {system}@{value} to keep it alligned with Codings
Christian Nau (Apr 22 2021 at 13:30):
Having any kind of shorthand for assigning identifier patterns would be great.
John Moehrke (Apr 22 2021 at 14:35):
lets go back to HL7 v2.... use the ^
Martin Höcker (Apr 22 2021 at 17:10):
Personally, I don't mind using # as a delimiter betwen both system#code (Coding) and sytem#value (Identifier). The pattern reminds me of the token-search (see examples under https://www.hl7.org/fhir/search.html#token). The token search uses | as delimiter, which in my opinion would also have been a good choice for FSH. But I don't think changing # to | would bring enough joy to the FSH users to justify the incompatible change.
Lloyd McKenzie (Apr 22 2021 at 19:31):
Whatever we use, it needs to be something that can't appear in a legal URI.
Last updated: Apr 12 2022 at 19:14 UTC