FHIR Chat · New error about contained resources · IG creation

Stream: IG creation

Topic: New error about contained resources


view this post on Zulip Jean Duteau (Oct 01 2021 at 14:56):

I just updated my IG publisher from 1.1.73 to 1.1.81 and I'm getting a new error around contained resources and I'm pretty sure that the error is incorrect, but I'll welcome a change in my understanding. In a repository that ran clean before (
https://github.com/hl7/fhir-spl), the new error I'm getting is:

ref-1: 'SHALL have a contained resource if a local reference is provided' 'SHALL have a contained resource if a local reference is provided' ( (url: usagent; ids: ))

The resource in question has three contained resources. One OrganizationAffilation references the containing resource and references another contained resource:

{
      "resourceType" : "OrganizationAffiliation",
      "id" : "SampleLabelerUSAgentAffiliation",
      "meta" : {
        "profile" : [
          "http://hl7.org/fhir/us/spl/StructureDefinition/USAgentAffiliation"
        ]
      },
      "organization" : {
        "reference" : "#"
      },
      "participatingOrganization" : {
        "reference" : "#usagent"
      },
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl",
              "code" : "C73330",
              "display" : "Foreign Facility's United States Agent"
            }
          ]
        }
      ]
    },

This is the resource that is getting the error and from the error message, I'm assuming that it's taking the #usagent and expecting that to be in a contained resource within the resource itself. But a) contained resources can't contain resources and b) the relative link is intended to be to other contained resources.

view this post on Zulip Lloyd McKenzie (Oct 01 2021 at 16:38):

And #usagent exists as a resource in a sibling contained resource?

view this post on Zulip Jean Duteau (Oct 01 2021 at 17:57):

Yep, it's in the same array of contained resources. Organization-SampleLabelerOrganization.json

view this post on Zulip Lloyd McKenzie (Oct 02 2021 at 01:30):

@Grahame Grieve

view this post on Zulip Grahame Grieve (Oct 04 2021 at 03:31):

well this one is weird. Certainly nothing has changed in the validation layer that has anything to do with this

view this post on Zulip Jean Duteau (Oct 04 2021 at 03:48):

like I said, it wasn't an error in 1.1.73 but it is in 1.1.81

view this post on Zulip Grahame Grieve (Oct 04 2021 at 04:10):

oh this might be Lloyd's changes around invariant validation

view this post on Zulip Lloyd McKenzie (Oct 04 2021 at 04:12):

Did I mess up, or is it just now checking something it wasn't before?

view this post on Zulip Grahame Grieve (Oct 04 2021 at 04:15):

well, the error actually happens when it's checking slicing. So it shouldn't be recorded (as well as it shouldn't happen)

view this post on Zulip Grahame Grieve (Oct 04 2021 at 04:19):

the underlying issue is that conformsTo() jumps into the bundle in the contained resource, without the context, so the contained references can't be resolved.

view this post on Zulip Grahame Grieve (Oct 04 2021 at 05:23):

fixed next release. Seems like some sort of discovered check, because the issue has always been there

view this post on Zulip Ramandeep Dhanoa (Nov 29 2021 at 20:10):

I feel like I have similar scenario here. I have QuestionnaireResponse who has 2 contained resources - Questionnaire and ValueSet. Questionnaire contained resource is referencing ValueSet as #VSPHQ9 (where VSPHQ9 is the id of the contained ValueSet). In QA - I am getting this warning message "ValueSet #VSPHQ9 not found by validator" - Any insights on why this might be happening?

view this post on Zulip Grahame Grieve (Nov 29 2021 at 20:14):

no. how would I reproduce?

view this post on Zulip Ramandeep Dhanoa (Nov 29 2021 at 20:26):

I have pushed the example in the CI-build. Here is the example: https://build.fhir.org/ig/HL7/sdc/QuestionnaireResponse-adaptive-questionnaireresponse-sdc-example-phq9.html
and warning message:
https://build.fhir.org/ig/HL7/sdc/qa.html#_scratch_ig-build-temp-1S9L3Q_repo_input_examples_adaptive-questionnaireresponse-sdc-profile-example-PHQ9

view this post on Zulip Grahame Grieve (Dec 02 2021 at 02:44):

fixed next release, though you'll get lots of validation errors once it's fixed.

view this post on Zulip John Moehrke (Dec 14 2021 at 16:21):

did this get fixed? I seem to have this showing up

view this post on Zulip Grahame Grieve (Dec 14 2021 at 18:58):

what specifically is showing up?

view this post on Zulip John Moehrke (Dec 14 2021 at 22:16):

@Grahame Grieve I am getting errors using "rel-1" where I have contained resoruces. I don't know how to make it more contained than it already is.


Last updated: Apr 12 2022 at 19:14 UTC