FHIR Chat · SDC - Separate resources vs Extension vs contained · implementers

Stream: implementers

Topic: SDC - Separate resources vs Extension vs contained


view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 17:26):

I have a Questionnaire asking for "date of test" and "date of sepecimen collection". Normally this will map to Observation and to Specimen.
Question: since my specimen is only needed for that attribute, should I:

  1. Force the creation of the 2 resources, Observation and Specimen
  2. Just use a contained resource
  3. Simply add an extension to my Observation, for "collection date"?

My preference is 1, otherwise 2, else 3. Thoughts?
For 1. it's not clear how I'd automatically populate the relation Observation-Specimen.

view this post on Zulip Eric Prud'hommeaux (Dec 28 2020 at 17:31):

assuming some code (called "Importer") is consuming some external data and translating into a FHIR Questionnaire, is the challenge populating the Obs and Specimen (which would apply to 1 and 2) or more extending Importer's capabilities to invent additional FHIR Resources?

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 17:41):

the conversion would be from a QuestionnaireResponse to the other 2 resources.

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 17:44):

question is more if there is any recommendation or best practice.

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 17:44):

I plan to use the approach defined in SDC which defines that resources can be updated or created (I'll get to that operation soon).
But I do not recall any reference to creating 2 resources AND a relation between them.

view this post on Zulip Eric Prud'hommeaux (Dec 28 2020 at 17:51):

still trying to grok this (which I'll need to do for some NHS stuff), the challenge isn't in creating the Obs or the Specimen, but in creating them and populating the specimen property in the observation?

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 18:02):

yes, since those will be created at the same time, and I don't see if there is any provision for that

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 18:03):

I don't know if there is any (reference) implementation for this kind of operation
https://build.fhir.org/ig/HL7/sdc/extraction.html#structuremap-based-extraction

view this post on Zulip Lloyd McKenzie (Dec 28 2020 at 18:48):

Whether you create two independent resources or one resource with a second contained resource stems from whether you have enough information for both resources to be useful independently. If all you've got is a collected date, that doesn't sound like enough information for a stand-alone resource to me. (If you're querying a server and getting back a bunch of specimens with no information other than collected date, they're going to be nigh impossible to differentiate or do anything useful with.) On the other hand, if the QuestionnaireResponse had more information about the specimen such that, when populated, it would actually form a useful independent resource, then it should certainly be handled as an independent resource.

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 18:55):

I only need specimen collected date and place.

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 18:56):

(Requirements always change, but this one is not going far from here)

view this post on Zulip Eric Prud'hommeaux (Dec 28 2020 at 19:03):

@Lloyd McKenzie, I think you're advocating for @Jose Costa Teixeira's choice #2. Does that mean he should invent a local name for the contained Specimen to populate the contained Observation's specimen property?

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 19:05):

Indeed, in this case I'll also need to populate specimen.id

view this post on Zulip Lloyd McKenzie (Dec 28 2020 at 19:11):

Right. He'd use a contained resource and need to define a local id for it he can use to reference it within the observation (e.g. #spec)

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 19:47):

The collection place is an extension. So I'll have a contained resource with one attribute and one extension...

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 19:48):

I presume I'd need to be able to search on those. Will that cause suffering?

view this post on Zulip Lloyd McKenzie (Dec 28 2020 at 19:53):

You can search on specimen properties in the context of the Observation using chaining. Searching directly on the contained Specimen is theoretically possible but not widely supported.

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 20:08):

Chaining applies only if it's not contained, correct?

view this post on Zulip Jose Costa Teixeira (Dec 28 2020 at 20:08):

is there any implementation using the techniques described in SDC?
I'm looking for examples of the mappings (would be really neat to see if there is an OperationDefinition out there)

view this post on Zulip Lloyd McKenzie (Dec 28 2020 at 20:30):

Chained search works whether it's contained or not.

view this post on Zulip Lloyd McKenzie (Dec 28 2020 at 20:31):

With SDC, you can't do contained for Observation-based extraction. It would be straight-forward for map-based extraction. I'm not sure if we'd have to add anything special for path-based extraction or not.


Last updated: Apr 12 2022 at 19:14 UTC