Stream: conformance
Topic: Having a profiled type AND childconstraints
Ewout Kramer (Aug 03 2017 at 07:54):
In a discussion with my profiling colleagues yesterday the following issue came up:
Say, you have a profile on Patient, and your national SDO has provided you with a profiled version of HumanName
, called HumanNameNL
. You'd like that use that profiled version of HumanName
but wish to express some additional constraints on it.
Would it be useful to be able to constrain Patient.name
in your new profile to HumanNameNL
and add additional constraints to it "in place" in your profile (instead of you first defining MyHumanNameNL
with those additional constraints and then pointing to that)?
If yes - my question to myself and other StructureDefinition-veterans: This can obviously be expressed in a StructureDefinition by having a TypeRef with a profile
plus child constraints, but did we ever consider this? Do our tools support it?
Michel Rutten (Aug 03 2017 at 08:58):
In my understanding, yes, this is allowed. @Chris Grenz has done a great job working out the details and Forge has been supporting this since DSTU2 release. Note that Forge users are actually creating (production) profiles that rely on this technique.
Michel Rutten (Aug 03 2017 at 08:59):
See here: https://github.com/chrisgrenz/FHIR-Primer/wiki/Snapshots-Determining-Refines
Lloyd McKenzie (Aug 03 2017 at 15:16):
@Ewout Kramer I do it all the time :) So definitely supported by the IGPublisher and Validator
Grahame Grieve (Aug 03 2017 at 21:18):
this is already supported by the validator?
Grahame Grieve (Aug 03 2017 at 21:18):
do have a test case in the tests for it?
Ewout Kramer (Aug 04 2017 at 07:40):
@Ewout Kramer I do it all the time :) So definitely supported by the IGPublisher and Validator
As evident as this is for the end-user (;-)) it's actually pretty hard to support (at least for the snapshot generator and the validator): when I built this part in the .NET validator last year I discussed this with Grahame and concluded this was not a supported scenario. So, I double checked with Grahame last week - and he was not too sure he supported it. And as far as I can see, this is not something that you'd support accidentally...
Ewout Kramer (Aug 04 2017 at 07:43):
Well, to be perfectly honest, it's easy to support in a non-performant or user-unfriendly way (mostly resulting in duplication of errors and unnecessary running the same validations twice), to do it well requires work.
Lloyd McKenzie (Aug 04 2017 at 15:24):
I don't know if there are test cases, but this happens all the time when you constrain child elements of extensions - which I do all the time. Pointing to an extension is done by declaring the type. Then I list the value[whatever] element and sometimes assert child extensions for that. I've done it with other data type profiles too.
Grahame Grieve (Aug 04 2017 at 20:25):
I'd feel good if we had a test case checking that this is is handled ok
Last updated: Apr 12 2022 at 19:14 UTC