We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!
We have a CRF that a central cardiologist reads an ECHO and enters three values for certain fields. We created a calculated field on that CRF to take the average of the three reads. We have found that if one of the fields is missing (for example one of the three images can't be read) the calculation does not work. Is there a way to write the calculation so it takes the average as long as at least one field is entered? This calculation is part of inclusion criteria so it must be on the CRF, we can't do the calculation after downloading the data. We had hoped to have the database do it automatically otherwise we rely on the cardiologist to do it by hand. Thanks, Adrienne
One way would be to make the field required and ask that a value be entered if not done (or null); for example "999". Then, in the calculation you can use decode. In the example below I'm using ITEM1, ITEM2, ITEM3 as the ITEM_NAMEs. In the first part of the calculation I'm basically saying, look up item1, if the response value is "999" return a 0, else retun its value. In this case I'm adding the 3 values and if 999 it will be summed as "0". In the second part of the calculation I am trying to do a count. I use decode to say if the value is "999" then return a "0" else return a "1". I first do a sum of the values and then divide by the count. I didn't test this specific example but I've used this type of calculation before.
If only one field is entered, then that value is the average and you have no problem. Likewise if all three fields are entered there is no problem, I guess you can construct the CRF with two options. If all three values are available, enter on line 1 and write a calculation for this.
If only two values are available enter them on line 2. Here you write a calculation for two values.
If only one value is available the you do need to calculate anything. It is clumsy and maybe Gerben, Christian or someone else can come up with a better idea. I'm sure that you could resolve it with a rule where you have more options.
Hello Adrienne, I haven't tested that specifically. I am not sure if that would work. I do know that it will not work with "" e.g.( ITEM1,,0,ITEM1 ). I think it also would depend on your data type. If you get a chance to test it out could you let us know? I think it only works with numeric but would like to know your findings.
Answers
Adrienne,
If only one field is entered, then that value is the average and you have no problem. Likewise if all three fields are entered there is no problem, I guess you can construct the CRF with two options. If all three values are available, enter on line 1 and write a calculation for this.
If only two values are available enter them on line 2. Here you write a calculation for two values.
If only one value is available the you do need to calculate anything. It is clumsy and maybe Gerben, Christian or someone else can come up with a better idea. I'm sure that you could resolve it with a rule where you have more options.
Instead of using 999 would decode work if I put "." for missing? For example: decode(ITEM1,.,0,ITEM1). Or do you have to have a value?
I haven't tested that specifically. I am not sure if that would work. I do know that it will not work with "" e.g.( ITEM1,,0,ITEM1 ). I think it also would depend on your data type. If you get a chance to test it out could you let us know? I think it only works with numeric but would like to know your findings.
Best,
Alicia