Use getPatientData instead of calling sqlQuery manually.