Use getPatientData instead of manually calling sqlQuery.