public async Task <IActionResult> OnGetAsync(long?patientId = null, long?clinicalDataId = null)
        {
            if (patientId == null)
            {
                return(NotFound());
            }

            var patient = await repository.GetPatientAsync(patientId.Value);

            if (patient == null)
            {
                return(NotFound());
            }
            PatientName = patient.Name;

            if (clinicalDataId == null)
            {
                ClinicalData = new ClinicalData
                {
                    PatientId = patientId.Value
                };
            }
            else
            {
                ClinicalData = await repository.GetClinicalDataAsync(clinicalDataId.Value);

                if (ClinicalData == null)
                {
                    return(NotFound());
                }
            }
            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(long Id)
        {
            if (await repository.GetPatientAsync(Id) == null)
            {
                return(NotFound());
            }
            PatientId   = Id;
            Departments = await repository.GetDepartmentsAsync();

            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(long?id = null)
        {
            if (id == null)
            {
                EditMode = false;
                return(Page());
            }
            var patient = await repository.GetPatientAsync(id.Value);

            if (patient == null)
            {
                return(NotFound());
            }
            Patient  = patient;
            EditMode = true;
            return(Page());
        }