Stream: implementers
Topic: validator slicing error?
Michael van der Zel (Feb 22 2022 at 15:49):
I get a lot of "Slicing cannot be evaluated: Profile based discriminators must have a type with a profile", but I don't know what to do.
Lloyd McKenzie (Feb 22 2022 at 16:10):
Declare the 'type' element in the differential, not just the profile
Michael van der Zel (Feb 22 2022 at 16:38):
I get these errors for STU3 Profiles, was it a hard rule then too?
Other problem is that the profiles are not mine, but from our national institute.
Michael van der Zel (Feb 22 2022 at 16:54):
It has this in the differential element, is that what you mean @Lloyd McKenzie
"type": [ {
"code": "Reference",
"targetProfile": "http://fhir.nl/fhir/StructureDefinition/nl-core-patient"
}
]
Lloyd McKenzie (Feb 22 2022 at 17:00):
Yes, that's what I meant. It may be that in STU3, it only worked with "profile", not "targetProfile"? I'm not sure...
Michael van der Zel (Feb 22 2022 at 17:17):
If I change the targetProfile to profile I get 3 times the above mentioned error... :flushed:
Michael van der Zel (Feb 22 2022 at 17:18):
I see now, 3 for each type.
Michael van der Zel (Feb 22 2022 at 17:19):
This is the profile: https://simplifier.net/packages/nictiz.fhir.nl.stu3.zib2017/1.3.6/files/118787
Jean Duteau (Feb 22 2022 at 17:59):
Here is how I sliced contained on profile:
{
"id": "Organization.contained",
"path": "Organization.contained",
"slicing": {
"discriminator": [
{
"type": "profile",
"path": "$this"
}
],
"rules": "closed",
"description": "The specific resources that are needed for a Establishment organization."
},
"min": 1
},
{
"id": "Organization.contained:BusinessOperation",
"path": "Organization.contained",
"sliceName": "BusinessOperation",
"min": 1,
"max": "*",
"type": [
{
"code": "HealthcareService",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/EstablishmentBusinessOperation"
]
}
],
"mustSupport": true
},
{
"id": "Organization.contained:USAgentAffiliation",
"path": "Organization.contained",
"sliceName": "USAgentAffiliation",
"min": 0,
"max": "1",
"type": [
{
"code": "OrganizationAffiliation",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/USAgentAffiliation"
]
}
],
"mustSupport": true
},
{
"id": "Organization.contained:USAgent",
"path": "Organization.contained",
"sliceName": "USAgent",
"min": 0,
"max": "1",
"type": [
{
"code": "Organization",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/USAgentOrganization"
]
}
],
"mustSupport": true
},
{
"id": "Organization.contained:ImporterAffiliation",
"path": "Organization.contained",
"sliceName": "ImporterAffiliation",
"min": 0,
"max": "*",
"type": [
{
"code": "OrganizationAffiliation",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/ImporterAffiliation"
]
}
],
"mustSupport": true
},
{
"id": "Organization.contained:Importer",
"path": "Organization.contained",
"sliceName": "Importer",
"min": 0,
"max": "*",
"type": [
{
"code": "Organization",
"profile": [
"http://hl7.org/fhir/us/spl/StructureDefinition/ImporterOrganization"
]
}
],
"mustSupport": true
},
Jean Duteau (Feb 22 2022 at 18:00):
it might not apply to what you are doing because Contained has resources directly and not via reference.
Michael van der Zel (Feb 22 2022 at 19:32):
I think I get it. This is sliced on entry, which is an array. But the discriminator is of type profile, but the profile is at the "item" attribute.
Don't know what to change to make this work, though :-(
<element id="List.entry">
<path value="List.entry" />
<slicing>
<discriminator>
<type value="profile" />
<path value="item.reference.resolve()" />
</discriminator>
<rules value="open" />
</slicing>
</element>
<element id="List.entry:MedicationAgreement">
<path value="List.entry" />
<sliceName value="MedicationAgreement" />
</element>
<element id="List.entry:MedicationAgreement.item">
<path value="List.entry.item" />
<type>
<code value="Reference" />
<targetProfile value="http://nictiz.nl/fhir/StructureDefinition/zib-MedicationAgreement" />
<aggregation value="bundled" />
</type>
</element>
Grahame Grieve (Feb 24 2022 at 05:43):
@Michael van der Zel can you put this in a test case? Just an instance that shows the problem. I think that what you have there shouldn't give this error, and there's some problem in the discriminator evaluation somewhere, but just inspecting the code, I'm not sure
Michael van der Zel (Feb 24 2022 at 10:35):
I shall try.
Grahame Grieve (Feb 25 2022 at 19:44):
thanks. fixed next release
Michael van der Zel (Mar 08 2022 at 12:10):
Still getting a lot of "Slicing cannot be evaluated: Could not match discriminator ([system]) for slice Medication.ingredient.item[x]:itemCodeableConcept.coding:ingredientCodeATCCodelijst in profile http://nictiz.nl/fhir/StructureDefinition/zib-Product - the discriminator [system] does not have fixed value, binding or existence assertions", but all with the same Profile. Will investigate first.
Jake Lyn (Mar 08 2022 at 22:09):
(deleted)
Jake Lyn (Mar 08 2022 at 22:10):
New to FHIR, but generating an admit notification bundle, and getting errors in simplifier.net of "unknown symbol 'resolve', and using the java.jar validator, lots of "does not match any known slice" errors.
To validate, I tried to run the example bundle at https://hl7.org/fhir/us/davinci-alerts/STU1/Bundle-admit-notification-message-bundle-01.html through, and I get the exact same errors. Has anyone else experienced this?
Michael van der Zel (Mar 09 2022 at 07:24):
Can you show us the profile? Usually has something to do with the discriminator.
Ward Weistra (Mar 09 2022 at 10:52):
@Jake Lyn The unknown symbol 'resolve'
might not mean much, that's on Simplifier's side currently not supporting the resolve()
FHIRPath function in validation.
Here is a snippet with that example: https://simplifier.net/snippet/wardweistra/32. Can you indicate what slices the Java validator complains about?
Jake Lyn (Mar 09 2022 at 13:15):
I'm using the hl7.fhir.us.davinci-alerts profile. Running that example Ward provided through the java validator, just about every entry gives a slicing warning with the exact same warning (slice 1-8 have this warning, and messageheader.focus[0]).
This element does not match any known slicedefined_in_the_profilehttp://hl7.org/fhir/us/davinci-alerts/StructureDefinition/notifications-bundle
Bundle.entry[1]: discriminator = true and (resource is MessageHeader)
It also gives errors while it's trying to find the "References" for location, subject, individual, etc:
Bundled or contained reference not found within the bundle/resource urn:uuid:06e1f0dd-5fbe-4480-9bb4-6b54ec02d31b
almost seems like it has trouble with urn:uuid references
Grahame Grieve (Mar 14 2022 at 22:12):
what exact parameters are you passing into the validator?
Last updated: Apr 12 2022 at 19:14 UTC