LHNCBC / lforms-fhir-app

A SMART on FHIR app that uses lforms widget to handle Questionnaire and QuestionnaireResponse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for existing functionality?

greshje opened this issue · comments

I'm working through the capabilities of LHC-Forms (LForms) in github here:

https://github.com/lhncbc/lforms-fhir-app

Looking at the example here:

https://lhcforms.nlm.nih.gov/sdc

There is a button that lets the user see a FHIR QuestionnaireResponse based on the form and the data entered in the form. Using the debugging/Elements tool in my browser, the button has a javascript:void(0) method for href. What does LForms use to generate the QuestionnaireResponse from the form displayed on the page? Is this documented somewhere?

image

Documentation for LHC-Forms is at http://lhncbc.github.io/lforms/. Following the "Exporting FHIR" link on the left (http://lhncbc.github.io/lforms/#retrieving-fhir-data), you will see it provides this API call for getting back a FHIR Resource:

LForms.Util.getFormFHIRData(resourceType, fhirVersion, formDataSource, options)

So, for an R4 QuestionnaireResponse, one could write:

LForms.Util.getFormFHIRData("QuestionnaireResponse", "R4")