tracits / rodant

New repository for the new data collection tool
MIT License
0 stars 2 forks source link

Testing for dct = 99 and tct != 99 does not work #81

Open martingerdin opened 4 years ago

martingerdin commented 4 years ago

This is a specific case, but the fix probably solves a general problem. Even if a specific value, such as 99, is valid for certain fields, the combination of this value with other values is not valid, regardless of whether there are calculated fields or not. For example, in the test codebook, 99 for dct or tct means that the ct was done before the patient came to the hospitals. In other words, if dct is 99 then tct should also be 99. Therefore it would be good to have a logic check that fails if dct is 99 but tct is not, or vice versa. However, dct == 99 && tct != 99 does not yield the desired result.

kebabskal commented 4 years ago

Are there usecases outside of dates and times? With the json-rewrite I intend to not have date and time as separate fields at all. Solves many issues like this one.

martingerdin commented 4 years ago

There are definitely use cases that involve the general principle of testing if one variable equals a specific value while another does not. I think however that testing for this is not an issue in other variables, and I guess that's because they are formatted differently, i.e. not as dates and times. A temporary quick fix for this would be helpful if the json implementation is not likely to happen very soon.