Don't allow cancellation under 24 hours?

Is there a way to restrict cancellation of an appointment if it's under 24 hours?
We want to require 24 hour notice of cancellation, or you'll be unable to cancel.

Is there a way to do this?

Thanks!