Stream: shorthand
Topic: slicing an extension on a slice
John Moehrke (Dec 04 2021 at 15:53):
I am struggling with defining a slice on an extension that is inside a slice. where the slice discriminator is the extension's valueReference.identifier.type. I have defined this, which does build
* agent.extension contains OtherId named otherId 0..* MS
* agent[user].extension[otherId] ^slicing.discriminator.type = #pattern
* agent[user].extension[otherId] ^slicing.discriminator.path = "valueReference.identifier.type"
* agent[user].extension[otherId] ^slicing.rules = #open
* agent[user].extension[otherId] contains
subject-id 0..1 and
npi 0..1 and
provider-id 0..1
* agent[user].extension[otherId][subject-id].valueReference.identifier.type = OtherIdentifierTypes#SAML-subject-id
* agent[user].extension[otherId][subject-id].valueReference.identifier.value 1..1 MS
* agent[user].extension[otherId][subject-id].valueReference.identifier.value ^short = "SAML Attribute subject-id"
but my examples having this...
* agent[user].extension[otherId][subject-id].valueReference.identifier.type = OtherIdentifierTypes#SAML-subject-id
* agent[user].extension[otherId][subject-id].valueReference.identifier.value = "JohnDoe"
get build error thrown by the build
error Slicing cannot be evaluated: Could not match discriminator ([url]) for slice AuditEvent.agent:user.extension:otherId/subject-id in profile http://profiles.ihe.net/ITI/BasicAudit/StructureDefinition/ITI.BasicAudit.SAMLaccessTokenUse.Comprehensive - the discriminator [url] does not have fixed value, binding or existence assertions
First, not sure I did the slice in sushi right, but it seems happy at the sushi level.
John Moehrke (Dec 04 2021 at 15:53):
Oh, this is on AuditEvent resource
John Moehrke (Dec 04 2021 at 15:55):
Here is the IG build, pointing at the example that fails - http://build.fhir.org/ig/IHE/ITI.BasicAudit/branches/main/AuditEvent-ex-auditPoke-SAML-Comp.html
John Moehrke (Dec 04 2021 at 15:59):
SPECIFICALLY is the following discriminator path legal?
^slicing.discriminator.path = "valueReference.identifier.type"
John Moehrke (Dec 04 2021 at 16:01):
or does the discriminator path MUST be at the root of the slice?
Elliot Silver (Dec 05 2021 at 00:08):
It seems a long shot, but should valueReference
be value[x]:valueReference
throughout?
Elliot Silver (Dec 05 2021 at 00:10):
I'm pretty sure a discriminator doesn't need to be at the root.
Jean Duteau (Dec 05 2021 at 00:35):
I believe that, in FHIRPath, there is no valueReference, there is just value. so "(value as Reference).identifier.type" should/might work.
Jean Duteau (Dec 05 2021 at 00:41):
nope, just tried it and it gets the same error. sorry.
Jean Duteau (Dec 05 2021 at 00:49):
this might be the problem that I had with davinci PAS. I think that SUSHI has been updated to fix it? or this is entirely new and you've found a new edge case :)
Chris Moesel (Dec 06 2021 at 20:25):
This conversation is continuing on the #IG creation stream here: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/slicing.20sliced.20extension
John Moehrke (Dec 06 2021 at 22:24):
so, a possible sushi problem... Many problems went away when I brought the original definition of the first slice into the second profile. Let me explain. I had a base profile that defined the slice and a set of criteria, I had a second profile that derived off of that first one, adding a bunch more things. This works for some kinds of things, but didn't seem to get everything right. When I copyied the first profile constraints into the second, then some of my problems went away..... Still working on the other issues, so not fully clear yet.
John Moehrke (Dec 06 2021 at 22:32):
so it was not specifically a profile derived on a profile. It seems I needed to add the extensions to the .agent in the first profile, adding them in the second is what didn't work as well. Not a problem for me to add them in the first profile, but they are not really needed there.
Chris Moesel (Dec 07 2021 at 13:33):
Interesting. It's still not clear to me if this is an issue w/ SUSHI or an issue w/ the snapshot generator. As I noted in the other thread, the snapshot generator did not seem to be correctly generating the slices (it dropped the extension type). So it's possible that your fix somehow addressed the limitation in the snapshot generator.
John Moehrke (Dec 07 2021 at 14:27):
yup, I was just trying to update this stream about that specific hack that got me a bit further. That hack is that I needed to add the extensions in my primary profile, couldn't add them in the secondary profile.
John Moehrke (Mar 15 2022 at 15:32):
I am still having trouble slicing an extension in a slice ... Here is my test IG that focuses ONLY on this issue - http://build.fhir.org/ig/JohnMoehrke/SlicingSlicedExtension/branches/main/index.html
John Moehrke (Mar 15 2022 at 20:24):
@Lloyd McKenzie I augmented the json that sushi spits out, and suppressed sushi running.. .but I still get the same error, so I don't think I understood fully the augmention you recommended.
adding in the base and type as shown here.
{
"id": "AuditEvent.agent:user.extension:extOtherId/npi",
"path": "AuditEvent.agent.extension",
"sliceName": "extOtherId/npi",
"min": 0,
"max": "1",
"base": {
"path": "Element.extension",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Extension"
}
]
},
{
"id": "AuditEvent.agent:user.extension:extOtherId/npi.valueReference",
"path": "AuditEvent.agent.extension.valueReference"
},
{
"id": "AuditEvent.agent:user.extension:extOtherId/npi.valueReference.identifier.type",
"path": "AuditEvent.agent.extension.valueReference.identifier.type",
"patternCodeableConcept": {
"coding": [
{
"code": "NPI",
"system": "http://terminology.hl7.org/CodeSystem/v2-0203"
}
]
}
},
Lloyd McKenzie (Mar 15 2022 at 20:45):
I'm still seeing a bare type="Extension" and no profile declared on extension:extOtherId/npi
Lloyd McKenzie (Mar 15 2022 at 20:45):
That declaration needs to include the extension profile
John Moehrke (Mar 15 2022 at 20:51):
ah, Ill try that
John Moehrke (Mar 15 2022 at 21:01):
didn't help.. but I might have still done it wrong
John Moehrke (Mar 15 2022 at 22:07):
I committed to github the enhanced json project - https://github.com/JohnMoehrke/SlicingSlicedExtension
John Moehrke (Mar 15 2022 at 22:07):
I welcome further enhancements to make it work
Chris Moesel (Mar 16 2022 at 21:07):
I've done some more investigation on this and found some interesting issues in snapshot generation. Since this topic is in two streams now, I'll just direct you to the other stream where I noted my findings: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/slicing.20sliced.20extension/near/275577171
Last updated: Apr 12 2022 at 19:14 UTC