modify PatientExercise and add some DB functions