Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot rendering of a contained Observation fails #1018

Open
xlammer opened this issue Jan 9, 2025 · 2 comments
Open

Snapshot rendering of a contained Observation fails #1018

xlammer opened this issue Jan 9, 2025 · 2 comments
Labels
Approved Change has been reviewed and accepted and can now be applied to the templates bug Something isn't working

Comments

@xlammer
Copy link

xlammer commented Jan 9, 2025

Given FSH

Profile: SomeProfile
Parent: Composition
Id: some-profile
Title: "Test profile"
* ^status = #draft
* ^publisher = "Me"
* contained ^slicing.discriminator.type = #type
* contained ^slicing.discriminator.path = "resource"
* contained ^slicing.rules = #open
* contained contains Observation 0..1
* contained[Observation] only Observation
* contained[Observation] ^short = "Observation short working"
* contained[Observation].code ^short = "Observation code short failing"

Last line fails on a HTML generation step with the following exception:

Exception in thread "main" java.lang.Error: getElementByName: can't find #Composition.contained.referenceRange in [Composition, Composition.id, Composition.meta, Composition.implicitRules, Composition.language, Composition.text, Composition.contained, Composition.extension, Composition.modifierExtension, Composition.url, Composition.identifier, Composition.version, Composition.status, Composition.type, Composition.category, Composition.subject, Composition.encounter, Composition.date, Composition.useContext, Composition.author, Composition.name, Composition.title, Composition.note, Composition.attester, Composition.attester.id, Composition.attester.extension, Composition.attester.modifierExtension, Composition.attester.mode, Composition.attester.time, Composition.attester.party, Composition.custodian, Composition.relatesTo, Composition.event, Composition.event.id, Composition.event.extension, Composition.event.modifierExtension, Composition.event.period, Composition.event.detail, Composition.section, Composition.section.id, Composition.section.extension, Composition.section.modifierExtension, Composition.section.title, Composition.section.code, Composition.section.author, Composition.section.focus, Composition.section.text, Composition.section.orderedBy, Composition.section.entry, Composition.section.emptyReason, Composition.section.section] from http://hl7.org/fhir/StructureDefinition/Composition
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.getElementByName(StructureDefinitionRenderer.java:511)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genTypes(StructureDefinitionRenderer.java:1923)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genElementCells(StructureDefinitionRenderer.java:1203)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genElement(StructureDefinitionRenderer.java:844)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genElement(StructureDefinitionRenderer.java:969)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genElement(StructureDefinitionRenderer.java:969)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.genElement(StructureDefinitionRenderer.java:969)
        at org.hl7.fhir.r5.renderers.StructureDefinitionRenderer.generateTable(StructureDefinitionRenderer.java:589)
        at org.hl7.fhir.igtools.renderers.StructureDefinitionRenderer.snapshot(StructureDefinitionRenderer.java:502)
        at org.hl7.fhir.igtools.publisher.Publisher.generateOutputsStructureDefinition(Publisher.java:13182)
        at org.hl7.fhir.igtools.publisher.Publisher.generateResourceHtmlInner(Publisher.java:11964)
        at org.hl7.fhir.igtools.publisher.Publisher.generateResourceHtml(Publisher.java:11936)
        at org.hl7.fhir.igtools.publisher.Publisher.generateHtmlOutputs(Publisher.java:11339)
        at org.hl7.fhir.igtools.publisher.Publisher.generate(Publisher.java:7985)
        at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:1187)
        at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:1002)
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:14284)

FHIR IG Publisher Version 1.8.6 (Git# ee78712). Built 2025-01-05T06:01:16.464Z (4 days old)
Java version: 17.0.13 from /usr/lib/jvm/java-17-openjdk-arm64 on Linux/aarch64 (64bit).
Running SUSHI v3.14.0 (implements FHIR Shorthand specification v3.0.0)

@lmckenzi
Copy link
Contributor

@xlammer can you point to a repository where we can reproduce this issue?

@lmckenzi lmckenzi added bug Something isn't working Approved Change has been reviewed and accepted and can now be applied to the templates labels Jan 21, 2025
@lmckenzi lmckenzi moved this from Inbox to To do in IG Publisher issue board Jan 21, 2025
@costateixeira
Copy link
Collaborator

for info, this is the file generated by sushi:

{
  "resourceType": "StructureDefinition",
  "id": "some-profile",
  "url": "http://example.com/fhir/example/StructureDefinition/some-profile",
  "name": "SomeProfile",
  "title": "Test profile",
  "status": "draft",
  "publisher": "Me",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Composition",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Composition",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Composition.contained",
        "path": "Composition.contained",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "resource"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Composition.contained:Observation",
        "path": "Composition.contained",
        "sliceName": "Observation",
        "short": "Observation short working",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Observation"
          }
        ]
      },
      {
        "id": "Composition.contained:Observation.code",
        "path": "Composition.contained.code",
        "short": "Observation code short failing"
      }
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Change has been reviewed and accepted and can now be applied to the templates bug Something isn't working
Projects
Development

No branches or pull requests

3 participants