Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pbugni committed Mar 21, 2024
2 parents 66815a9 + 08ad9ad commit c8552a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions portal/models/qb_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,15 @@ def qb_status_visit_name(user_id, research_study_id, as_of_date):
QBT.at <= as_of_date).order_by(
QBT.at.desc(), QBT.id.desc()).first()
if qbt:
# now that timelines are built beyond withdrawal, check for a
# withdrawal row before the one found above
withdrawn_qbt = (QBT.query.filter(QBT.user_id == user_id).filter(
QBT.research_study_id == research_study_id).filter(
QBT.at <= qbt.at).filter(
QBT.status == OverallStatus.withdrawn)).first()
if withdrawn_qbt:
qbt = withdrawn_qbt

results['status'] = qbt.status
results['visit_name'] = visit_name(qbt.qbd())

Expand Down

0 comments on commit c8552a2

Please sign in to comment.