FHIR Chat · Is SUSHI generating the proper slices? · shorthand

Stream: shorthand

Topic: Is SUSHI generating the proper slices?


view this post on Zulip Jean Duteau (Sep 05 2021 at 14:20):

I have a profile where I slice on the boolean value of an extension:

* careTeam MS
* careTeam.extension contains CareTeamClaimScope named careTeamClaimScope 1..1 MS
* careTeam.sequence MS
* careTeam.provider MS
* careTeam.provider only Reference(PASPractitioner or PASOrganization)
* careTeam.role MS
* careTeam.qualification MS
* careTeam ^slicing.discriminator.type = #value
* careTeam ^slicing.discriminator.path = "extension('http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope').value"
* careTeam ^slicing.rules = #open
* careTeam ^slicing.description = "Slice based on whether the care team member belongs to the overall claim or to an individual claim item."
* careTeam contains OverallClaimMember 0..14 and ItemClaimMember 0..10
* careTeam[OverallClaimMember].extension[careTeamClaimScope].valueBoolean 1..1
* careTeam[OverallClaimMember].extension[careTeamClaimScope].valueBoolean = true
* careTeam[ItemClaimMember].extension[careTeamClaimScope].valueBoolean 1..1
* careTeam[ItemClaimMember].extension[careTeamClaimScope].valueBoolean = false

I'm unsure if the slicing discriminator path is correct because I'm getting an error about it:

Slicing cannot be evaluated: Unable to resolve discriminator in definitions: extension('http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope').value (@char 1)

But I've tried all sorts of paths and always get that error. When I look at the generated StructureDefinition, I'm slightly confused because of the slicing on extension that happens:

      {
        "id": "Claim.careTeam",
        "path": "Claim.careTeam",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "extension('http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope').value"
            }
          ],
          "rules": "open",
          "description": "Slice based on whether the care team member belongs to the overall claim or to an individual claim item."
        },
        "mustSupport": true
      },
      {
        "id": "Claim.careTeam.extension",
        "path": "Claim.careTeam.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },

The first slicing is my slice on careTeam, the second is the default slicing on extension that occurs. Then I get the extension slice:

      {
        "id": "Claim.careTeam.extension:careTeamClaimScope",
        "path": "Claim.careTeam.extension",
        "sliceName": "careTeamClaimScope",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope"
            ]
          }
        ],
        "mustSupport": true
      },

And then I get four entries that are about slices, but I'm not sure if they are correct:

      {
        "id": "Claim.careTeam:OverallClaimMember",
        "path": "Claim.careTeam",
        "sliceName": "OverallClaimMember",
        "min": 0,
        "max": "14"
      },
      {
        "id": "Claim.careTeam:OverallClaimMember.extension:careTeamClaimScope",
        "path": "Claim.careTeam.extension",
        "sliceName": "careTeamClaimScope"
      },
      {
        "id": "Claim.careTeam:OverallClaimMember.extension:careTeamClaimScope.value[x]",
        "path": "Claim.careTeam.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Claim.careTeam:OverallClaimMember.extension:careTeamClaimScope.valueBoolean",
        "path": "Claim.careTeam.extension.valueBoolean",
        "min": 1,
        "max": "1",
        "patternBoolean": true
      },

view this post on Zulip Chris Moesel (Sep 07 2021 at 12:42):

Ugh. Slicing is always tricky. I'm not sure what is going on here. A few thoughts:

  • Everything you've shown seems OK to me based on my knowledge of slicing, but when you get into slices within nested slices, and then nested slices again -- it's hard to know how the publisher/validator handles that.
  • You could potentially eliminate one level of slicing (the type slicing) by changing careTeam[OverallClaimMember].extension[careTeamClaimScope].valueBoolean to just careTeam[OverallClaimMember].extension[careTeamClaimScope].value[x] (assuming it has already been constrained to only boolean). Maybe that would help?
  • You did not say anything about the ItemClaimNumber slice, but I assume you have four entries about that slice group as well (just like OverallClaimNumber). Right?
  • I doubt it would make a difference, but you could also try changing your discriminator to use $this: "$this.extension('http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-careTeamClaimScope').value".

view this post on Zulip Jean Duteau (Sep 07 2021 at 13:35):

okay, then I think this is a problem in the validator. changing it to use $this didn't change anything mainly because the publisher strips that out.

view this post on Zulip Chris Moesel (Sep 07 2021 at 14:19):

OK. Please report back if/when you hear anything -- especially if it turns out that there is an issue w/ the slicing itself!


Last updated: Apr 12 2022 at 19:14 UTC