Fixed controller logic to retrieve alerts for patients