Finished search visit record and fixed bug in search patient.