So, is this done something like this?
SELECT
r.patientmedicalrecordnumber,
r.callreceiveddatetime as date
FROM table r
LEFT OUTER JOIN table p
ON r.pageid = p.pageid
WHERE p.pagetype = 6
and cast(r.callreceiveddatetime as date) = current_date() - 1
df.groupBy (r.window("event_time","5 minutes"))
ORDER BY r.callreceiveddatetime