Fix deprecated warning in CustomPatientForm