refactoring, tambah pasien function