Skip to content

calculatedExpression not correctly populating some CVD risk items #1832

@liambarnes

Description

@liambarnes

Describe the bug
3 items in the CVD risk section of the Aboriginal and Torres Straight Islander Health Check are not populating correctly according to their calculatedExpressions. The items affected have the following linkIds:

  • cvdrisk-bmi-weight-decimal
  • cvdrisk-bmi-height-decimal
  • 818ce640-c8dd-457d-b607-3aaa8da38524

Their calculated expressions should be populated with a newly added value from another item if it exists, otherwise populate with a different value from another item.

E.g. iif(%weight.exists() and %CVDWeightNewResultDate > (now() - 12 months), %weight, %bmiWeightDecimalPrepop)

This expression does not result in the item being populated with %weight value even though the conditional criteria is met. Instead %bmiWeightDecimalPrepop is used.

To Reproduce

  1. Open Aboriginal and Torres Straight Islander Health Check in playground
  2. Prepop using patient "CVDRisk-DS-AdamPopper-Patient"
  3. Go to "Absolute cardiovascular disease risk calculation" section
  4. Observe values of items: Systolic blood pressure, Weight and Height. These are the last result values of the examination section items: Blood pressure (systolic), Height and Weight. This is correct behaviour.
  5. Now, in the examination section, add new results for items: Blood pressure (systolic), Height and Weight.
  6. Go back to "Absolute cardiovascular disease risk calculation" section and note the values have not been updated with these new values as expected.
  7. If you look at the fhirPathContext tab in the Playground's advanced properties, you will see the variables are being correctly updated, however in the calculatedExpressions tab you can see, the expression is not returning the expected result.

Expected behavior
New values entered should update the CVD risk section items: Systolic blood pressure, Weight and Height

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions