Skip to content

Instantly share code, notes, and snippets.

@TerribleDev
Last active April 2, 2016 23:14
Show Gist options
  • Save TerribleDev/99caa1ceb84120610ef1bc1c47f84a3b to your computer and use it in GitHub Desktop.
Save TerribleDev/99caa1ceb84120610ef1bc1c47f84a3b to your computer and use it in GitHub Desktop.
rewrite
private IEnumerable<string> DetermineListOfAllergicMedications(List<string> medications, Dictionary<string, bool> lookupPatientsKnownAllergies)
{
return
medications
.Where(a => allergyLookup.ContainsKey(a))
.Select(a => new Tuple<string, List<string>>(a, allergyLookup[a]))
.Where(a => a.Item2.Any(c => lookupPatientsKnownAllergies.ContainsKey(c)))
.Select(a => a.Item1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment