finish edit function of the patient page