public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CurrentUser = await _userManager.GetUserAsync(User);

            if (CurrentUser.CompleteStudy)
            {
                return(NotFound());
            }

            CaseId = id.HasValue ? id.Value : 0;

            if (CurrentUser == null)
            {
                return(NotFound());
            }

            CaseReportViewModel = await _caseReportService.GetCaseReportForUser(CurrentUser.Id, id.Value);

            Cases = await _caseReportService.GetOrderedCasesAsync();

            SubmittedReports = _caseReportService.GetSubmittedCaseReportIds(CurrentUser.Id);

            if (CaseReportViewModel == null)
            {
                return(RedirectToPage("./Summary"));
            }

            return(Page());
        }
        public async Task <IActionResult> OnGetAsync()
        {
            LVIStudyUser user = await _userManager.GetUserAsync(User);

            if (user == null || user.CompleteStudy)
            {
                return(NotFound());
            }
            Cases = await _caseReportService.GetOrderedCasesAsync();

            Reports = await _reportService.GetUserReportsOrderedByCase(user.Id);

            SubmittedReports = new List <int>();
            foreach (var report in Reports)
            {
                SubmittedReports.Add(report.CaseId);
            }

            return(Page());
        }