Added parameters to PatientHistory and some refactoring