FHIR Chat · SDC questionnaire-itemContext extension type · implementers

Stream: implementers

Topic: SDC questionnaire-itemContext extension type


view this post on Zulip Gabriela Brown (Oct 07 2019 at 18:43):

Reading and implementing the data extraction docs (http://build.fhir.org/ig/HL7/sdc/extraction.html), I'm curious why the questionnaire-itemContext extension (http://build.fhir.org/ig/HL7/sdc/extension-sdc-questionnaire-itemContext.html) type is valueExpression, as opposed to something like a code from to http://hl7.org/fhir/ValueSet/resource-types . Is the intention that the context can be, for example, a full Fhirpath expression to an element of a resource? The descriptions of the extension suggest otherwise - "identify the resource that will serve as the context for any extraction" and "identifies the resource (or set of resources for a repeating item)" - but being able to use the complete expressiveness of Fhirpath seems very useful.

view this post on Zulip Lloyd McKenzie (Oct 07 2019 at 20:45):

It's not enough to just know a resource type. The context will identify the resource type, but it will also identify the existing resource to be updated. If there isn't a resource found, then you know it's an update.

view this post on Zulip Gabriela Brown (Dec 18 2019 at 22:57):

Curious what the workflow around Questionnaire/QuestionnaireResponses is supposed to be here. The itemContext extension is on the Questionnaire, not the QuestionnaireResponse, so it needs to be shared by all referencing QuestionnaireResponses. This implies that the extension expression should be general to a resource type, not specific to a resource instance. Then how do we know to resolve a context resource for an update? Is it from the QuestionnaireResponse.subject? Or we have to check for Questionnaire.items nested under itemContext that have an id element in the definition? Can an update only happen if extract is preceded by populate and sets the right reference information? The docs mention:

"If the context resource existed and was used in the population of the resource and data has changed, the resource will typically be updated. (Note that this means the system must capture the resource ids as hidden items in the Questionnaire so they're available for update.)"

But I'm not certain how to interpret it.

view this post on Zulip Lloyd McKenzie (Dec 18 2019 at 23:16):

The itemContext would be a query or expression that, based on launchContext or other information filled in for a given QuestionnaireResponse allows identifying the context for a set of questions. You would evaluate the itemContext in the context of that particular QuestionnaireResponse (and in the context of the specific item that's being populated). On an extract, you're not going to be able to update typically unless you've got an id (whether from an extract or by other means).


Last updated: Apr 12 2022 at 19:14 UTC