SimonBurrell
Technical User
Hi All
I need to calculate a Risk index that is the sum result of the following for each row in my table:
For each ROW...
If SSI_ASA > 2 THEN Count 1 ELSE Count 0
If Wound_Cl_ID> 2 THEN Count 1 ELSE Count 0
If Proc_Duration > P_75Percentile THEN Count 1 ELSE Count 0
The result column (SSI_Procedure_Risk) will be populated with either a 0,1,2,or 3 depending on the above count from the source columns.
E.g. Patient1 has SSI_ASA = 1,Wound_Cl_ID = 4 and Proc_Duration time longer than P_75Percentile therefore SSI_Procedure_Risk would be updated to 2.
Can I use local variables for the three source columns (I couldn't get this to work, but this is new to me!!) or is it best to just write an update query using multiple case functions?
Thanks heaps in advance.
Simon
I need to calculate a Risk index that is the sum result of the following for each row in my table:
For each ROW...
If SSI_ASA > 2 THEN Count 1 ELSE Count 0
If Wound_Cl_ID> 2 THEN Count 1 ELSE Count 0
If Proc_Duration > P_75Percentile THEN Count 1 ELSE Count 0
The result column (SSI_Procedure_Risk) will be populated with either a 0,1,2,or 3 depending on the above count from the source columns.
E.g. Patient1 has SSI_ASA = 1,Wound_Cl_ID = 4 and Proc_Duration time longer than P_75Percentile therefore SSI_Procedure_Risk would be updated to 2.
Can I use local variables for the three source columns (I couldn't get this to work, but this is new to me!!) or is it best to just write an update query using multiple case functions?
Thanks heaps in advance.
Simon