Skip to content
Prev 316585 / 398506 Next

Locate Patients who have multiple high blood pressure readings

On Thu, Jan 31, 2013 at 10:51 AM, Weijia Wang <wwang.nyu at gmail.com> wrote:
This can be specified in a reasonably natural fashion using SQL. Here
DF is the input data frame.:
+       PT_ID,
+       sum(Blood_Pressure >= 90 and OBS_TYPE == 'DBP') DBP,
+       sum(Blood_Pressure >= 140 and OBS_TYPE == 'SBP') SBP
+    from DF
+    group by PT_ID
+    having DBP >= 2 or SBP >= 2")
  PT_ID DBP SBP
1  1900   2   0