Stream: shorthand
Topic: suggestions / discussion
Jose Costa Teixeira (Jan 06 2021 at 14:40):
A couple of things I've been thinking of, hope they are worth discussing:
Jose Costa Teixeira (Jan 06 2021 at 14:41):
- does sushi / shorthand need to be so sensitive about the whitespace before or after the = sign?
Jose Costa Teixeira (Jan 06 2021 at 14:53):
- perhaps this is covered by macros: Does / should shorthand support complex objects as aliases?
If we could say:
Alias: $professionalID =
* identifier.system = "..."
* identifier.type = http://terminology.hl7.org/CodeSystem/v2-0203#PRN
* identifier.use = #official
...
then when we make instances, we could have
performer.identifier = $professionalID
...
reporter.identifier = $professionalID
(sorry for poor example, i'm looking for feedback)
Elliot Silver (Jan 06 2021 at 17:44):
Jose Costa Teixeira said:
- does sushi / shorthand need to be so sensitive about the whitespace before or after the = sign?
Please make it not care.
Nick Freiter (Jan 06 2021 at 19:27):
@Jose Costa Teixeira, in response to 2, is this something you could do using an Inline Instance of an Identifier? Here is an example of how that would look:
Instance: ObservationInstance
InstanceOf: Observation
* identifier[0] = IdentifierInstance
Instance: IdentifierInstance
InstanceOf: Identifier
Usage: #inline
* system = "http://some-system.com"
* type = http://terminology.hl7.org/CodeSystem/v2-0203#PRN
* use = #official
The IdentifierInstance
can be re-used anywhere you want that Identifier.
Jose Costa Teixeira (Jan 06 2021 at 19:30):
@Nick Freiter right, we could do that. My purpose was to stimulate discussion around the language, because I think it would be very interesting.
Jose Costa Teixeira (Jan 06 2021 at 19:31):
if we allow this AND the with
syntax, I expect some hours of work to be saved
Chris Moesel (Jan 06 2021 at 20:12):
To be clear, what @Nick Freiter posted above (w/ inline instance of Identifier
) is valid FSH STU1 syntax and supported today.
Regarding with
, yeah -- that would then allow you to do something like this using with
and a ruleset instead (which would be slightly fewer lines of code).
Regarding =
, I think we have it on our list to look at that. It will require a grammar update, but I think it should be possible.
David Hay (Jan 06 2021 at 22:25):
I haven't tried it, but do mixins help with #2?
Jose Costa Teixeira (Jan 07 2021 at 00:22):
That would indeed be the same / similar principle, I guess.
Jose Costa Teixeira (Jan 07 2021 at 00:23):
maybe my #2 topic is "do we have a generic syntax for reusing mixins with any kind of content?"
Last updated: Apr 12 2022 at 19:14 UTC