Stream: implementers
Topic: value[x] and Quantity
Michele Mottini (Jul 18 2018 at 17:26):
If an element can have multiple types including Quantity (e.g. the extension value: http://hl7.org/fhir/STU3/extensibility.html#Extension) can it also use the sub-types of Quantity (Age, Count etc.) - even if they are not explicitly listed?
Michele Mottini (Jul 18 2018 at 17:28):
In other words is this legal:
Michele Mottini (Jul 18 2018 at 17:28):
(deleted)
Michele Mottini (Jul 18 2018 at 17:28):
"extension": [ { "url": "https://bluebutton.cms.gov/resources/variables/prpayamt", "valueMoney": { "value": 0.0, "system": "urn:iso:std:iso:4217", "code": "USD" } },
Michele Mottini (Jul 18 2018 at 17:30):
The specs at http://hl7.org/fhir/STU3/formats.html#choice sat 'The table view shows each of these names explicitly.' so I'd say 'no' but I am not sure
Jean Duteau (Jul 18 2018 at 17:31):
Since all subtypes of Quantity are valid Quantities, yes.
Michele Mottini (Jul 18 2018 at 17:33):
...if that's the case maybe the specs should be fixed? Because in that case you can use type names that are not listed explicitly
Jean Duteau (Jul 18 2018 at 17:46):
Ah, I see what you are saying now. No, you couldn't send 'valueMoney', you would have to send 'valueQuantity'.
Michele Mottini (Jul 18 2018 at 17:46):
Yes, that's what I though...but then I was not sure
Jean Duteau (Jul 18 2018 at 17:47):
i originally read your question as "can I send a Money in a Quantity slot?" so my bad for not reading properly. :)
Lloyd McKenzie (Jul 18 2018 at 18:24):
This is an interesting space because the rules have changed over time. In R2, Money, Count, etc. were "profiles", not real data types. So the element name would always have been valueQuantity and you could indicate whatever profile you liked. However, it created pain because things like "Age" and "Duration" both showed up over the wire as "Quantity" - which created confusion, especially if there was a choice between the two of them. So in R3, they became first order data types. That means that the element name becomes valueMoney or valueCount. It also means that they are not substitutable at runtime. If the allowed type is Quantity, you can't send valueAge. (Though you could send a Quantity that happens to meet the constraints of age). In R4, there's an additional change: Money will no longer be derived from Quantity at all. The objective there is to make Money lighter weight, because right now it's rather unpleasant to work with in the financial resources.
Michele Mottini (Jul 18 2018 at 18:49):
OK, thanks Lloyd
Last updated: Apr 12 2022 at 19:14 UTC