FHIR Chat · populate in LHC-Forms · questionnaire

Stream: questionnaire

Topic: populate in LHC-Forms


view this post on Zulip Diane (Apr 09 2021 at 00:25):

A few questions about populate, in conjunction with using LHC-Forms to render the Questionnaire. This is for a demo/proof of concept website. It is not for production.

We are trying to find one source (not many different resources) to use as the source data for pre-populate of our multiple types of Questionnaires, if possible.

  1. With LHC-Forms, is it possible to pre-populate a Questionnaire based on information from a non-FHIR database (eg. mySQL)? The SDC IG at http://hl7.org/fhir/uv/sdc/2019May/populate.html mentions using the REST interface, but I didn't know if the IG was only discussing FHIR REST queries.

In looking at the example at https://sqlonfhir-r4.azurewebsites.net/fhir/Questionnaire/new-prepop:

<entry >
<fullUrl value="urn:uuid:785869a5-60d8-41d6-bdfa-7df0e4f48919"/>
<request >
<method value="GET"/>
<url value="RelatedPerson?patient=pat2"/>
</request>
</entry>

It seems like I would need to put the database URL (and connection string?) into the fullURL value and then in url value, I would put the mySQL query such as "SELECT employeeLastName FROM employees WHERE employeeID=1234 AND ..."

If the Questionnaire expects to receive back a FHIR resource (eg. Practitioner), then would I need to "convert" the results of the SQL query to a FHIR resource before LHC Forms can populate the Questionnaire?

  1. Instead of having the data in a separate mySQL database, could I collect and store the data in a repeating block using a Questionnaire and Questionnaire Response? Would FHIRPath-based Population work for a Questionnaire Response? I am unsure of this approach because the Questionnaire Response linkID, text and answer elements do not appear to be searchable (according to https://www.hl7.org/fhir/R4/questionnaireresponse.html). Do the elements have to be searchable to use FHIRPath?

view this post on Zulip Paul Lynch (Apr 09 2021 at 00:45):

LHC-Forms only populates with data from a FHIR server. Some renderers will make use of a $populate operation, which might talk to non-FHIR databases to get the data, but the $populate operation is something that would run on a server. If you need to access non-FHIR data, you could either convert the data to FHIR, or check the list of SDC implementations to see if something there implements $populate that you could use. (However, note that LHC-Forms does not make use of $populate, because it does its own population. I suppose we could add that a configuration option.)

BTW, the current SDC IG URL is https://build.fhir.org/ig/HL7/sdc/

I don't know of any way to put SQL into a Questionnaire.

To answer your question about FHIRPath, FHIRPath in a Questionnaire can access anything in the Questionnaire or QuestionnaireResponse. The elements do not have to be searchable.

view this post on Zulip Diane (Apr 09 2021 at 02:30):

It sounds like the easiest way to make the populate happen will be to use data that is stored somewhere on the FHIR server, so that we can use LHC-Forms to do the populating and so that there will be less manipulating of the data to get it into FHIR format. Since FHIRPath is compatible with the Questionnaire and QuestionnaireResponse elements, that opens up a lot of options for us.

view this post on Zulip Lloyd McKenzie (Apr 09 2021 at 04:38):

The driver to use FHIRPath rather than opening up to something like SQL is that there's no standard SQL layout, so any such system would be very limited to where it could get data - and any change to your database layout would break your questionnaires. It doesn't mean it couldn't be done, but it would require a custom operation - or at least an extension of the 'standard' $extract. It would also be outside the scope of the standard and would thus be less likely to be widely supported.


Last updated: Apr 12 2022 at 19:14 UTC