Stream: committers
Topic: defining the cardinality of extensions
Eric Haas (Aug 17 2016 at 21:06):
I think my understanding of the cardinality of extensions has been muddled. When creating an element in a profile whose type is extension, how do we define how many times the extension can be used? For example the extensions is defined as 0..* and I want to say in my profile you can have up to 5 repeats - do I make the element 0..5? If the extension is defined as 1..1 and I wan't 5 repeats in the profile - I'm hosed because that message is invalid or should be any way So in short the extension define what is permitted and you need to conform to that in the profile referencing the extension.
Eric Haas (Aug 17 2016 at 21:06):
I think my understanding of the cardinality of extensions has been muddled. When creating an element in a profile whose type is extension, how do we define how many times the extension can be used? For example the extensions is defined as 0..* and I want to say in my profile you can have up to 5 repeats - do I make the element 0..5? If the extension is defined as 1..1 and I wan't 5 repeats in the profile - I'm hosed because that message is invalid or should be any way So in short the extension define what is permitted and you need to conform to that in the profile referencing the extension.
Grahame Grieve (Aug 17 2016 at 21:21):
yes. if the cardinality of the extension itself is 0..1, then you can't use it 0..5
Grahame Grieve (Aug 17 2016 at 21:21):
if the extension cardinality is 0..* then you can use it as 0..1 or 0..5
Eric Haas (Aug 18 2016 at 16:10):
I need a reminder why element[x] can only have a max cardinality of 1.
Josh Mandel (Aug 18 2016 at 16:28):
I assume you're asking about value[x]
(rather than element[x]
)?
My answer: because we want to have one consistent way to control the semantics of cardinality an extension -- otherwise, what would the difference in meaning be between the following:
- extension eyeColor
- string: brown
- string: green
vs.
-
extension eyeColor
- string: brown
-
extension eyeColor
- string: green
(??) this would be quite confusing. So we limit to the latter. That's my understanding at least. I suspect this also has nice implications for conformance testing.
Eric Haas (Aug 18 2016 at 16:40):
Well that is one reason but I really was interested in element[x] for example Obsevation.value[x] or Condition.onset[x] I think its something to do with the type being undefined for the repeats.
Lloyd McKenzie (Aug 18 2016 at 18:16):
JSON doesn't like it when poly-types repeat.
Josh Mandel (Aug 18 2016 at 18:44):
Well, there's arrays for that ;-)
Grahame Grieve (Aug 18 2016 at 19:17):
arrays? we've never heard of them....
Grahame Grieve (Aug 18 2016 at 19:17):
actually, the problem is that the type is coordinated into the element name. And there's only one name for an array. So all items in the array have to have the same type
Josh Mandel (Aug 19 2016 at 00:46):
That would technically still be workable for an extension that wanted to have multiple repeating values of the same type -- but I can't see any benefit in allowing two ways of saying the same thing (and there is a cost, in confusion @Eric Haas )
Eric Haas (Aug 19 2016 at 05:04):
Thanks for the explanation.
Last updated: Apr 12 2022 at 19:14 UTC