public ActionResult CreatePatient()
        {
            int maxNumber = patientRepository.GetMaxPatientNumber();
            var model = new PatientViewModel {
                Id = 0,
                PatientNumber = maxNumber + 1,
                Caption = "New Patient",
                IsActive = true
            };

            return PartialView("_EditPatient", model);
        }
        public ActionResult ViewEditPatient(bool? isPatientEditing, int patientNumber)
        {
            Patient patient = patientRepository.GetPatientByUniqueNumber(patientNumber);

            if (patient == null) {
                return RedirectToAction("CreatePatient");
            }

            var model = new PatientViewModel {
                Id = patient.Id,
                Caption = patient.Caption,
                PatientNumber = patient.PatientNumber,
                EnrollDate = patient.EnrollDate,
                IsActive = patient.IsActive,
                IsEnrolled = patient.IsEnrolled,
                PatientInitials = patient.PatientInitials,
                RandomisationDate = patient.RandomisationDate,
                RandomisationNumber = patient.RandomisationNumber
            };

            if (patient.IsCompleted && !(isPatientEditing ?? false))
                return PartialView("_ViewPatient", model);
            return PartialView("_EditPatient", model);
        }