I am using Microsoft SQL Server Management Studio 2008.
I have a Blood_Pressure_Systolic field and a Blood_Pressure_Diastolic field. I need to use these two fields to identify normal blood pressure, prehypertension, stage 1 hypertension, and stage 2 hypertension based on the Mayo Clinic's categories here: Mayo Clinic Blood Pressure Chart
I'm currently using the CASE expression below to filter the systolic ranges and the diastolic ranges for each category. However, if a person has a systolic blood pressure in a lower range and a diastolic blood pressure in a higher range, I want to return the higher range, and vice versa. For example, if John Smith has 125 systolic (prehypertension) and 95 diastolic (Stage 1 hypertension), then I want the field to return that he has Stage 1 hypertension.
CASE WHEN BP_Systolic < '120' AND BP_Diastolic < '80' THEN 'Normal'
WHEN BP_Systolic BETWEEN '120' AND '139' OR BP_Diastolic BETWEEN '80' AND '89' THEN 'Prehypertension'
WHEN BP_Systolic BETWEEN '140' AND '159' OR BP_Diastolic BETWEEN '90' AND '99' THEN 'Stage 1 Hypertension'
WHEN BP_Systolic >= '160' OR BP_Diastolic >= '100' THEN 'Stage 2 Hypertension'
END AS BP_Category