Stream: conformance
Topic: slicing dose[x]
Simone Heckmann (Aug 08 2017 at 11:40):
I'm trying to slice medicationStatement.dosage.dose[x] into ...doseRange and ...doseSimpleQuantity, so I can apply different constraints to there types, but somehow Forge doesn't seem to like that (I can't define a discriminator).
Who's wrong? Me or Forge?
Simone Heckmann (Aug 08 2017 at 20:12):
I think there's generally something wrong here...
I get funny validation errors, even though I didn't constrain anything:
Element 'MedicationStatement.dosage.doseQuantity' : 'doseQuantity' has an invalid type profile constraint 'http://hl7.org/fhir/StructureDefinition/SimpleQuantity'. The target represents a profile on 'Quantity' which is incompatible with the element type 'Quantity'.
Michel Rutten (Aug 09 2017 at 09:22):
Hi @Simone Heckmann, thank you for the feedback. I've tried to recreate your profile in Forge. Initially, this seems to work fine. But after re-loading the profile, Forge displays warnings about the SimpleQuantity slice and does not expand the child elements. This is a bug. I'll investigate the issue.
Simone Heckmann (Aug 09 2017 at 09:31):
Interestingly, Simplifier also has issues rendering the Profile correctly.
When you scoll to the bottom of this profile (https://simplifier.net/medikationsplanplus/medicationstatement-1), you see two attributes called "SimpleQuantity" which should actually be maxDosePerAdministration and maxDosePerLifetime.
I can see in Forge that the two attributes have a SliceName of "SimpleQuantity", but I don't really understand why that is...
That's definitely coming from the core definition.
Michel Rutten (Aug 09 2017 at 09:47):
Hi @Simone Heckmann, yes something's strange is going on here. The core definition of Dosage does not specify any slice names, so apparently they are being added by the snapshot generator. This is a bug that we'll have to fix in the .NET FHIR API library.
Michel Rutten (Aug 10 2017 at 14:34):
Hi @Simone Heckmann, I analyzed the issue. It turns out that the SimpleQuantity core definition introduces a slice name "SimpleQuantity" on the root element definition. This appears to be a bug in the spec that causes tooling issues downstream.
I've updated the .NET FHIR API to detect and remove unexpected and invalid slice names on core definitions and/or root elements. This workaround will be included in the next Forge release, so users don't suffer from this error in the current version of the spec. Once the spec has been updated, we can deprecate the workaround.
Simone Heckmann (Aug 10 2017 at 18:27):
Thanks Michel, you're awesome
Michel Rutten (Aug 11 2017 at 08:44):
You're welcome!
Last updated: Apr 12 2022 at 19:14 UTC