From c374af979e11995f0376133cb7fd345e2059c7c7 Mon Sep 17 00:00:00 2001 From: Paul Bugni Date: Tue, 3 Apr 2018 22:15:17 -0700 Subject: [PATCH] Fix TN-947 - don't include observations with null issued when looking for trigger date. --- portal/models/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portal/models/user.py b/portal/models/user.py index 51e1ddc723..c09d165d38 100644 --- a/portal/models/user.py +++ b/portal/models/user.py @@ -726,7 +726,8 @@ def fetch_datetime_for_concept(self, codeable_concept): codeable_concept = codeable_concept.add_if_not_found() matching_observations = [ obs for obs in self.observations if - obs.codeable_concept_id == codeable_concept.id] + obs.codeable_concept_id == codeable_concept.id and + obs.issued is not None] if not matching_observations: return None newest = max(o.issued for o in matching_observations