Stream: IG creation
Topic: Recursive element constraints
Jean Duteau (Apr 06 2022 at 17:45):
I am trying to understand the new guidance on making restrictions on recursive elements. I am profiling Composition and have some restrictions on Composition.section, a different set of restrictions on Composition.section.section, and I would like those last restrictions to apply recursively to section.section.section, etc.
Here is what my differential looks like:
{
"id": "Composition.section.section",
"path": "Composition.section.section",
"type": [
{
"code": "BackboneElement",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/ProductSubmissionDocument"
],
"_profile": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element",
"valueString": "Composition.section.section"
}
]
}
]
}
],
"mustSupport": true
},
But that gets me the following error:
Caused by: org.hl7.fhir.exceptions.DefinitionException: Type mismatch processing profile http://hl7.org/fhir/us/spl/StructureDefinition/ProductSubmissionDocument at path Composition.section.section: The element type is BackboneElement, but the profile http://hl7.org/fhir/us/spl/StructureDefinition/ProductSubmissionDocument is for a different type Composition
If I change the differential to have just Composition.section in the extension:
"_profile": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element",
"valueString": "Composition.section"
}
]
}
]
that doesn't throw an error, but it reports that the snapshot generation failed and it applies the Composition constraints on Composition.section.section, i.e. it requires status, type, author, etc. that are on Composition. That sort of makes sense since I seem to be saying "apply the ProductSubmissionDocument profile to Composition.section".
So what is the proper way to say "apply all of the constraints on Composition.section.section to the recursive ...section element?
Jean Duteau (Apr 06 2022 at 17:48):
NOTE: To make this simpler, I even tried just loosening my constraints on Composition.section and tried to say that the applied to Composition.section.section, etc.
{
"id": "Composition.section",
"path": "Composition.section",
"slicing": {
"discriminator": [
{
"type": "value",
"path": "code"
}
],
"rules": "open",
"description": "Slice based on the different sections that are needed in a SPL document."
},
"type": [
{
"code": "BackboneElement",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/ProductSubmissionDocument"
],
"_profile": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element",
"valueString": "Composition.section"
}
]
}
]
}
],
"mustSupport": true
},
This got me a different error:
Caused by: org.hl7.fhir.exceptions.DefinitionException: Unable to find element Composition.section in http://hl7.org/fhir/us/spl/StructureDefinition/ProductSubmissionDocument
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1214)
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1485)
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1109)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:669)
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1203)
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1548)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:669)
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:5459)
Jean Duteau (Apr 08 2022 at 20:54):
Anyone? I hate to do this but @Grahame Grieve, do you have any guidance?
Grahame Grieve (Apr 10 2022 at 23:06):
on my todo list
Last updated: Apr 12 2022 at 19:14 UTC