Hello there!
We are implementing template based extraction from Structure Data Capture v4 on GCP on FHIR R4 store.
In the template-based extraction, you usually create inline contained resources on a Questionnaire, and put an extensión in the reference field (which is a primitive datatype string). This is also a common approach for other primitive datatypes.
This examples works and can be ingested on a HAPI FHIR (and I know that also works on other cloud vendors as asked on community), but when ingested on a GCP FHIR store the "_reference" field gets deleted, without a warning.
We have tested extensions on other primitive datatypes like on 20 differents resources types and this is the only field that gets this behaviour.
Right now, we make a workaround like this:
"recorder": {
"extension": [
{
"valueString": "%resource.author"
}
]
},
The extension extractValue is the one that indicates to the $extract service that needs to replace the value with the fhirPath expression written on the valueString field. In this case we are replacing the recorder with the author reference of the QuestionnaireResponse (which already has been pre-populated with some basic info like author, authored, id, etc). In this case, it will return an object with a reference field.
Right now as Questionnaires are only being used on GCP, they will work, but if we receive Questionnaires designed and stored from others non-GPC FHIR store sources, they will probably include the _reference field and wont work, as the instruction for the extraction on that field would be deleted.
Hope this could be taking into consideration for future updates.
I know SDC could be tricky to understand, I tried to be as didactic as possible.
Thanks in advance for your time,
Maico.