ORM date=integer SQL issue

I’m getting a date = integer operator does not exist when using an ORM query. I thought Lucee should automatically cast this as a date and include the date in single quotes if I use the below ormExecuteQuery?

result = ormExecuteQuery("select t1 from orcases as t1 join t1.patinfo t2 join t1.scheduledprocedureinfo t3 WHERE t2.mrn = :mrn AND t1.surgdate=:surgdate AND t3.procedureid=:procedureid AND t1.deleted=:deleted",
      {surgDate = dateToView,
       mrn = (tSurgRec.patinfo.mrn),
       procedureid= (tSurgRec.scheduledprocedureinfo.procedureid),
       deleted= false}, true);


select orcases0_.orrmscaseid as orrmscas1_34_, orcases0_.hospitalcaseid as hospital2_34_ from orcases orcases0_ inner join patinfo patinfo1_ on orcases0_.patid=patinfo1_.patid inner join proceduresettings procedures2_ on orcases0_.scheduledprocedureid=procedures2_.id where patinfo1_.mrn='1' and orcases0_.surgdate=2017-11-24 and procedures2_.procedureid='1' and orcases0_.deleted=false

org.postgresql.util.PSQLException: ERROR: operator does not exist: date = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.