Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepopulate form with source data #152

Open
annabel-uzl opened this issue Jun 13, 2024 · 3 comments
Open

Prepopulate form with source data #152

annabel-uzl opened this issue Jun 13, 2024 · 3 comments

Comments

@annabel-uzl
Copy link

annabel-uzl commented Jun 13, 2024

Hi
Has anyone tried using source data as input values in the questionnaire? I was thinking of using variables of some sort 'out' of the questionnaire resource and put them in some way 'in' the questionnaire and I came by this example: https://hl7.org/fhir/uv/sdc/Questionnaire-questionnaire-sdc-test-fhirpath-prepop-source-query.json.html
They use a bundle of type batch https://build.fhir.org/bundle.html and then use contained resources to put it in their questionnaire https://build.fhir.org/references.html#contained. Has anyone tried this? Is LForms prepared for this?

EDIT: the more general question is: can Lforms handle contained resources? Other example: https://build.fhir.org/questionnaire-example-gcs.json.html

@plynchnlm
Copy link
Member

LForms supports Observation-based extraction and also the launchContext, variable, and initialExpression extensions, but not source queries. For an examples, see https://github.com/LHNCBC/lforms-fhir-app/blob/master/cypress/fixtures/R4/ussg-fhp.json or others under "R4". You can try these out in our "SDC Questionnaire App" (in the "Featured Questionnaires" section in the sidebar).

Contained ValueSets can be referenced in answerValueSet URLs, and I think contained Binary resources can be used for images.

@annabel-uzl
Copy link
Author

Mmmh okay so if I understand correctly: If our source data is not in FHIR and our FHIR store is not always updated immediately, we will not be able to use recent data in our questionnaire? (Unless we convert the source data to FHIR resources on the spot and put them in a dummy store from which we fill the Context of the form?)

@plynchnlm
Copy link
Member

LForms also supports x-fhir-query expressions, which are URLs that go to a FHIR server and fetch data. I suppose you could have a query (in a "variable" extension) that returned data that isn't FHIR (but still JSON) and then have an initialExpression that understood that format pick out the right value. The result would be something that only works for your server, obviously, but that might be okay for your goals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants