Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (await Context.Procedures
- .Where(p => p.SessionId == null && p.WaitingList != null &&
- (p.WaitingList.Consultant == null || p.WaitingList.Consultant.UserId.HasValue) &&
- (!siteIds.Any(id => id != 0) || siteIds.Contains(p.WaitingList.Site.Id)) &&
- (!specialityIds.Any(id => id != 0) || specialityIds.Contains(p.Speciality.Id)) &&
- (!consultantIds.Any(id => id != 0) ||
- consultantIds.Contains(p.WaitingList.Consultant.UserId.Value)))
- .Where(w => w.Speciality.Id == userSpecialityId || specialityAccess)
- .Include(p => p.Admission)
- .Include(p => p.WaitingList)
- .Include(p => p.WaitingList).Include(w => w.Admission)
- .Include(p => p.WaitingList).ThenInclude(wl => wl.IntendedProcedureCode)
- .Include(p => p.WaitingList).ThenInclude(wl => wl.Consultant)
- .Include(p => p.WaitingList).ThenInclude(wl => wl.Pathway)
- .Include(p => p.WaitingList).ThenInclude(wl => wl.Pathway).ThenInclude(pth => pth.PathwayThresholds)
- .Include(p => p.WaitingList).ThenInclude(wl => wl.Patient).ThenInclude(p => p.Allergies).ThenInclude(p => p.Allergy)
- .Include(p => p.Patient)
- .Include(p => p.Patient).ThenInclude(wt => wt.Allergies)
- .Include(p => p.Patient).ThenInclude(wt => wt.Allergies).ThenInclude(a => a.Allergy)
- .ToListAsync())
- .Select(p => p.WaitingList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement