Skip to content

Commit

Permalink
add param include_interim=True
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Feb 16, 2024
1 parent 21e538a commit b65719c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def save(self, *args, **kwargs):
# overwrite the value of refill_end_datetime coming from
# the form with the date of next visit or appointment.
self.refill_end_datetime = getattr(
get_next_related_visit(self.related_visit), "report_datetime", None
get_next_related_visit(self.related_visit, include_interim=True),
"report_datetime",
None,
) or getattr(
get_next_appointment(self.related_visit.appointment, include_interim=True),
"appt_datetime",
Expand Down
4 changes: 3 additions & 1 deletion edc_pharmacy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def update_previous_refill_end_datetime(instance):
"""Update refill_end_datetime from previous visit relative to the
refill_start_datetime of this visit.
"""
if previous_visit := get_previous_related_visit(instance.related_visit):
if previous_visit := get_previous_related_visit(
instance.related_visit, include_interim=True
):
opts = {instance.__class__.related_visit_model_attr(): previous_visit}
try:
obj = instance.__class__.objects.get(**opts)
Expand Down

0 comments on commit b65719c

Please sign in to comment.