user29725330
user29725330

Reputation: 1

Problem with programming calculated field in Redcap (Clincal Scores)

When programming a calculated field in Redcap database (to auto-calculate a clinical score like NEWS score) the system won't accept the formula and freeze on saving the field. I coded the responses of the preceding fields to assign a value to every parameter (fields nominated news_1_sc, news_2_sc, etc). I want the result to be the auto-sum of the assignated values. Here's the formula:

sum(
  if([news_1_sc]=3, 3, if([news_1_sc]=2, 2, if([news_1_sc]=1, 1, if([news_1_sc]=0, 0, if([news_1_sc]=4, 3, ''))))),
  if([news_2_sc]=2, 3, if([news_2_sc]=1, 1, if([news_2_sc]=0, 0, if([news_2_sc]=4, 1, if([news_2_sc]=5, 2, if([news_2_sc]=3, 3, '')))))),
  if([news_3_sc]=4, 3, if([news_3_sc]=0, 1, if([news_3_sc]=1, 0, if([news_3_sc]=2, 2, if([news_3_sc]=3, 3, ''))))),
  if([news_4_sc]=3, 3, if([news_4_sc]=1, 2, if([news_4_sc]=0, 1, if([news_4_sc]=2, 0, '')))),
  if([news_5_sc]=2, 2, if([news_5_sc]=1, 0, '')),
  if([news_6_sc]=3, 3, if([news_6_sc]=1, 1, if([news_6_sc]=0, 0, if([news_6_sc]=4, 1, if([news_6_sc]=2, 2, ''))))),
  if([news_7_sc]=0, 0, if([news_7_sc]=1, 3, if([news_7_sc]=2, 3, if([news_7_sc]=3, 3, ''))))
)

Thank you for your help.

According to chatGPT the synthax is correct for Redcap database. Even inserting the third value (0 in every case) or inserting the field as text between ' ' isn't working (still freezing).

Upvotes: 0

Views: 13

Answers (0)

Related Questions