Stream: shorthand
Topic: Proposed Syntax Change for Extensions
Chris Moesel (Feb 27 2020 at 17:11):
@David Hay raised an issue a while ago about our current approach for adding inline extensions (mostly relevant to complex extensions). The problem is that when you say something like extension contains maxSize
, SUSHI assumes you mean to reference the existing maxSize
extension from FHIR core -- which you might mean, but you also might mean to declare a new inline extension called maxSize
. See FHIR/sushi#86 for details.
To remove the ambiguity, we propose the following changes for declaring extensions:
- For declaring inline extensions, the syntax remains the same:
Extension: CapacityDetails * extension contains maxSize 0..1 * extension[maxSize].value[x] only integer // ...
SUSHI would always recognize this style as an inline extension.
- For declaring use of an externally defined extension (defined inside or outside the IG, but not inline), you must declare a slicename and the reference to the extension:
Alias: MaxSizeExtension = http://hl7.org/fhir/StructureDefinition/maxSize Extension: CapacityDetails * extension contains MaxSizeExtension named maxSize 0..1 * extension[maxSize].value[x] only integer
@David Hay (and others), what do you think of this approach? It will be a breaking change, but we're early on in FSH/SUSHI, so now is the time to make breaking changes!
Chris Moesel (Feb 27 2020 at 17:13):
NOTE: This would apply to extensions wherever you declare them, so it would also apply to profiles, e.g.:
Alias: USCoreRaceExtension = http://hl7.org/fhir/us/core/StructureDefinition/us-core-race Profile: MyPatient Parent: Patient * extension contains USCoreRaceExtension named race 0..1
David Hay (Feb 27 2020 at 18:43):
works for me!
Last updated: Apr 12 2022 at 19:14 UTC