Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. (await Context.Procedures
  2. .Where(p => p.SessionId == null && p.WaitingList != null &&
  3. (p.WaitingList.Consultant == null || p.WaitingList.Consultant.UserId.HasValue) &&
  4. (!siteIds.Any(id => id != 0) || siteIds.Contains(p.WaitingList.Site.Id)) &&
  5. (!specialityIds.Any(id => id != 0) || specialityIds.Contains(p.Speciality.Id)) &&
  6. (!consultantIds.Any(id => id != 0) ||
  7. consultantIds.Contains(p.WaitingList.Consultant.UserId.Value)))
  8. .Where(w => w.Speciality.Id == userSpecialityId || specialityAccess)
  9. .Include(p => p.Admission)
  10. .Include(p => p.WaitingList)
  11. .Include(p => p.WaitingList).Include(w => w.Admission)
  12. .Include(p => p.WaitingList).ThenInclude(wl => wl.IntendedProcedureCode)
  13. .Include(p => p.WaitingList).ThenInclude(wl => wl.Consultant)
  14. .Include(p => p.WaitingList).ThenInclude(wl => wl.Pathway)
  15. .Include(p => p.WaitingList).ThenInclude(wl => wl.Pathway).ThenInclude(pth => pth.PathwayThresholds)
  16. .Include(p => p.WaitingList).ThenInclude(wl => wl.Patient).ThenInclude(p => p.Allergies).ThenInclude(p => p.Allergy)
  17. .Include(p => p.Patient)
  18. .Include(p => p.Patient).ThenInclude(wt => wt.Allergies)
  19. .Include(p => p.Patient).ThenInclude(wt => wt.Allergies).ThenInclude(a => a.Allergy)
  20. .ToListAsync())
  21. .Select(p => p.WaitingList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement