Refactor db and gui and start patient form