FHIR Chat · profiling on external IG and named slices · shorthand

Stream: shorthand

Topic: profiling on external IG and named slices


view this post on Zulip Bob Milius (Feb 06 2020 at 10:12):

I'm trying to create a profile based on an external profile (genomics-reporting). So I add this to the package.json

"dependencies": {
    "hl7.fhir.r4.core": "4.0.1",
    "hl7.fhir.uv.genomics-reporting": "1.0.0"
  },

and then create a fsh file that requires a named slice of a component (gene-studied) that's optional in the parent profile.

Profile:        Mygenotype
Parent:         genotype
Id:             mygenotype
Title:          "My Profile of Genotype Observation"
Description:    "Profiling genotype observation"

* component contains gene-studied 1..1

Sushi runs without any error, but when I go to build the IG, I get a

Publishing Content Failed: Unable to generate snapshot for http://example.org/fhir/hla-reporting/StructureDefinition/mygenotype in /Users/bmilius/Documents/src/fsh/hla/build/input/resources/structuredefinition-mygenotype (00:17.0464)

that's rather uninformative. Am I doing something wrong?

view this post on Zulip Nick Freiter (Feb 06 2020 at 13:46):

I can't speak to the IG publisher, but I think the FSH should be changed to:

Profile:        Mygenotype
Parent:         genotype
Id:             mygenotype
Title:          "My Profile of Genotype Observation"
Description:    "Profiling genotype observation"

* component[gene-studied] 1..1

Since the gene-studied slice already exists via the parent resource, you don't need to use the contains keyword, since that keyword is used to create slices. You can just directly access the slice and set its cardinality using the syntax shown above.

It looks like if you do use the contains keyword, we actually generate a new slice called gene-studied alongside the already existing slice, so you end up with two gene-studied slices. We should've been emitting an error to warn you this was happening incorrectly, so I'll track that as a bug in SUSHI.

view this post on Zulip Bob Milius (Feb 06 2020 at 20:21):

Thanks, @Nick Freiter That makes sense. I made the change but am still getting the IG publisher error.

view this post on Zulip May Terry (Feb 06 2020 at 20:31):

Hi @ Bob Milius - have you included the profile name into the ImplementationGuide JSON file? I think you need to manually configure that. This file would be in the ./build/input directory.
As an example, below is a snippet of how we included the mCODE CancerGeneticVariant profile in our ./build/input/ImplementationGuide-fhir.us.mcode.json file:

        {
          "reference": {
            "reference": "StructureDefinition/CancerGeneticVariant"
          },
          "name": "Cancer Genetic Variant",
          "description": "Records an alteration in the most common DNA nucleotide sequence. The term variant can be used to describe an alteration that may be benign, pathogenic, or of unknown significance. The term variant is increasingly being used in place of the term mutation.",
          "exampleBoolean": false
        }

view this post on Zulip Bob Milius (Feb 06 2020 at 20:41):

@May Terry , thanks, but yes it's already included

      {
        "reference": {
          "reference": "StructureDefinition/mygenotype"
        },
        "name": "My Profile of Genotype Observation",
        "description": "Profiling genotype observation",
        "exampleBoolean": false
      }

btw, I just noticed this msg from the IG publisher output:

Dependency 'hl7.fhir.uv.genomics-reporting' has no id, so can't be referred to in markdown in the IG (00:16.0880)

view this post on Zulip Chris Moesel (Feb 06 2020 at 21:10):

I've seen that last error before and it seems to be harmless. I'll take a look at this @ Bob Milius. If I can reproduce it on my side I might be able to figure out what's going on.

view this post on Zulip Grahame Grieve (Feb 06 2020 at 21:11):

it's significance depends on what you are doing. If you don't want to refer to the dependency in the markdown, then you don't need an id.

view this post on Zulip Chris Moesel (Feb 06 2020 at 21:42):

That makes sense -- and the message is pretty clear about that. I guess I meant that it shouldn't have an effect on things like what Bob is currently reporting. But... I think we can get the id in there too, so people can refer to them in markdown if they'd like.

view this post on Zulip Chris Moesel (Feb 06 2020 at 22:07):

@Grahame Grieve -- I'm having trouble determining the problem here. The profile that SUSHI generates seems valid to me, but the IG publisher crashes on it. Here is the SD (I removed our generated snapshot to ensure that's not the issue -- and it still fails):

{
  "resourceType": "StructureDefinition",
  "id": "mygenotype",
  "url": "http://hl7.org/fhir/sushi-test/StructureDefinition/mygenotype",
  "version": "0.1.0",
  "name": "Mygenotype",
  "title": "My Profile of Genotype Observation",
  "status": "active",
  "description": "Profiling genotype observation",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2-cg-results",
      "uri": "http://unknown.org/V2-CG-Results",
      "name": "V2-CG-Results"
    },
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "sct-concept",
      "uri": "http://snomed.info/conceptdomain",
      "name": "SNOMED CT Concept Domain Binding"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "sct-attr",
      "uri": "http://snomed.org/attributebinding",
      "name": "SNOMED CT Attribute Binding"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genotype",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "min": 1
      },
      {
        "id": "Observation.component:gene-studied",
        "path": "Observation.component",
        "min": 1,
        "max": "1"
      }
    ]
  }
}

As you can see, the diff is pretty straight-forward. And here is the exception:

org.hl7.fhir.exceptions.FHIRException: Unable to generate snapshot for http://hl7.org/fhir/sushi-test/StructureDefinition/mygenotype in /Users/cmoesel/dev/fsh/bob-ig/build/input/resources/structuredefinition-mygenotype
    at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:3958)
    at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:3910)
    at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3343)
    at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:804)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:665)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6937)
Caused by: java.lang.NullPointerException
    at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1427)
    at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:523)
    at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:3956)
    ... 5 more

view this post on Zulip Chris Moesel (Feb 06 2020 at 22:08):

For reference, here is the baseDefinition profile that it is based on: http://hl7.org/fhir/uv/genomics-reporting/genotype.html

view this post on Zulip Chris Moesel (Feb 06 2020 at 22:09):

And here is a simple FSH project (already built w/ SUSHI) that I used to demonstrate it. The buildable IG is in the build folder. mygenotype-ig.zip

view this post on Zulip Mark Kramer (Feb 07 2020 at 03:23):

(deleted)

view this post on Zulip Chris Moesel (Feb 10 2020 at 16:17):

@Nick Freiter just noticed that this bug looks a lot like another bug that was reported to us over the weekend (SUSHI #207). So it's likely that this bug has the same root cause as the other: we (SUSHI) are not repeating inherited slice names in the differential. Look for a fix in a future version of SUSHI.

view this post on Zulip Grahame Grieve (Feb 12 2020 at 06:13):

the problem was a missing slice name. Next release won't give you an NPE, but the missing slice name will still cause an error

view this post on Zulip Chris Moesel (Feb 12 2020 at 13:45):

Thanks for the confirmation, @Grahame Grieve -- we're already on it!


Last updated: Apr 12 2022 at 19:14 UTC