LHNCBC / lforms

See the project website at http://lhncbc.github.io/lforms/, or view the demo website at https://lhcforms.nlm.nih.gov/lhcforms.
Other
99 stars 55 forks source link

CalculatedExpressions not working? #151

Open annabel-uzl opened 2 weeks ago

annabel-uzl commented 2 weeks ago

Hi, I was playing with fhirpath and calculatedExpressions but I could not seem to get it working. I now tried this example: https://build.fhir.org/ig/HL7/sdc/Questionnaire-questionnaire-sdc-profile-example-form-behavior.json.html to check if this works, but this also does not render e.g. the BMI. I would expect if height and weight are filled in, BMI is calculated as this is how it's advertised on https://build.fhir.org/ig/HL7/sdc/expressions.html#fhirpath "This expression allows for dynamic calculation of answers to questions as other questions are answered. It behaves similarly to initialExpression extension, but instead of only setting its value when the QuestionnaireResponse is originally created or when a question is enabled, the value updates continuously as the answers to dependent questions change." Can this be a bug in the Lforms package?

plynchnlm commented 2 weeks ago

Both calculatedExpression and initialExpression are supported. For examples, you can try the "Featured Forms" in "SDC Questionnaire App" (which uses lforms). I will have to take a look at the example form you mention to see why it isn't working.