BP categorization using calculated values in survey js

BP categorization is fairly simple using conversations and calculated values in survey js. These categorizations can be used by W2H event scheduler for logic, incident generation, etc. Most BP projects involve prompting a participant to submit a 2nd BP if their 1st BP is very high/low, so that’s what this example shows. However, you can simplify the structure below for just one BP submission.

  1. In your survey js conversation, create the 2+ blood pressure questions and name them “first_reading” and “second_reading” (or adjust the calculated values below to reflect their names).

  2. Go to survey settings > logic > create the calculated values below. Make sure to check the “include into result” checkbox next to each calculated value so that you can use the values in the W2H event scheduler.

Question ID

Expression

Question ID

Expression

systolic

 

iif({second_reading.systolic}, {second_reading.systolic}, {first_reading.systolic})

diastolic

 

iif({second_reading.diastolic}, {second_reading.diastolic}, {first_reading.diastolic})

bp_category

 

iif( {systolic} >= 160 or {diastolic} >= 100, 'critically high', iif( {systolic} <= 99 or {diastolic} <= 60, 'low', iif( {systolic} >= 140 or {diastolic} >= 90, 'high', iif( {systolic} >= 100 and {systolic} < 140 and {diastolic} > 60 and {diastolic} < 90, 'normal', 'null'))))

BP_category functions like an [if, else if, else if, else] categorization mechanism from top to bottom. This means that if one criteria is met, then the evaluation will stop, otherwise it will proceed to the next row. If none of the criteria are met, the BP will be categorized as null. This also means that each BP will only be categorized once.

For example, a BP submission of 160/95 will be categorized as critically high and the evaluation won’t continue past row 1, so it won’t be categorized as high as well.

The bp_category iif statements should be prioritized from top to bottom in case the BP submitted has systolic and diastolic values that satisfy different category definitions. In the example above, low is prioritized before high because the study team receives in basket alerts for low BPs but not for high BPs. If someone were to submit a BP of 140/60 (for example), where the systolic value is high but the diastolic value is low, it will be categorized as low and the study team will be notified via in basket message.

Below is an example of how to use the bp_category calculated value to run logic, alerts, and set adherence snapshots using the TextEquals option.