FHIR Chat · IG error - contained referencing other contained · genomics/committers

Stream: genomics/committers

Topic: IG error - contained referencing other contained


view this post on Zulip Kevin Power (Oct 21 2019 at 21:57):

I am not sure how long this has been occurring, but I noticed an error that seems new after reviewing the latest QA (on AnnotationExample.json). This example is a DiagnosticReport with two Observation resources as 'contained' inside the DR. One of the contained Observation resources tries to 'derivedFrom' the other contained Observation resource, but it throws this error:

SHALL have a contained resource if a local reference is provided ( (url: 2; ids: )) [reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))]

It seems that one contained resource cannot reference another contained resource even when they are in the same container?

view this post on Zulip Jamie Jones (Oct 21 2019 at 22:17):

I don't think it was tracking that error before but it is a great catch and makes sense re: contained resources. That effectively means we can't do implications as contained, should push for sending them as bundles.

view this post on Zulip Jamie Jones (Oct 21 2019 at 22:18):

Contained resources aren't exposed to queries as far as I know as well

view this post on Zulip Bret H (Oct 21 2019 at 22:22):

are both observations in the results section of the diagnostic report?

view this post on Zulip Kevin Power (Oct 21 2019 at 22:25):

Agree with the move to bundles. And yes, they are referenced from the results section of diagnostic report. But that works since the report is the container.

view this post on Zulip Bret H (Oct 21 2019 at 22:27):

I'm confused. Sorry. from the above I see 'one contained resource...' and then 'that works since the report is the container.' What is the example url?

view this post on Zulip Kevin Power (Oct 22 2019 at 04:08):

http://build.fhir.org/ig/HL7/genomics-reporting/AnnotationExample.html

view this post on Zulip Kevin Power (Oct 22 2019 at 14:08):

@Lloyd McKenzie - I assume you concur this is a real error? And if so, is there some way to fix it while keeping the contained resources? I know contained resources are meant to stay 'contained' within the container - but does that imply the contained resources should not be able to refer to each other?

view this post on Zulip Kevin Power (Oct 22 2019 at 14:24):

After doing some more research on this - I did find another example in FHIR core that does this (one contained resource referring to another): http://build.fhir.org/claim-example-oral-contained.xml.html

The Coverage resource (id = coverage-1) has two properties (subscriber, beneficiary) that reference #patient-1, which is another contained resource. I did run the validator on it, and it does generate the same errors as we are seeing.

view this post on Zulip Lloyd McKenzie (Oct 22 2019 at 14:47):

Contained resources should be able to refer to each other using #id

view this post on Zulip Lloyd McKenzie (Oct 22 2019 at 14:47):

They just can't (easily) refer to resources contained in a different resource

view this post on Zulip Kevin Power (Oct 22 2019 at 17:33):

If this should be OK, then this is a problem in the validator? Seems perhaps we should log a tracker?

view this post on Zulip Lloyd McKenzie (Oct 22 2019 at 21:04):

Y

view this post on Zulip Kevin Power (Oct 22 2019 at 21:14):

GF#25042

view this post on Zulip Jamie Jones (Oct 23 2019 at 15:44):

We ought to consider guidance on where contained resources are most/least appropriate for future release as well

view this post on Zulip Kevin Power (Oct 23 2019 at 16:05):

-1 for contained :slight_smile:


Last updated: Apr 12 2022 at 19:14 UTC