Skip to content

Commit

Permalink
EMPRO expired status is ambiguous - can mean "not yet available" or "…
Browse files Browse the repository at this point in the history
…expired". Added comparison with consent to correct.
  • Loading branch information
pbugni committed Dec 12, 2023
1 parent e53c159 commit 72760e9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions portal/models/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,14 @@ def empro_row_detail(row, ts_reporting):
# build up data until we find valid cache for patient's history
status = str(qb_stats.overall_status)
row = patient_data(patient)
row["status"] = status
if status == "Expired" and research_study_id == EMPRO_RS_ID:
row["status"] = "Not Yet Available"
else:
row["status"] = status
# Expired status ambiguous for EMPRO - either not available
# due to complex business rules around start or walked off
# the end. Assume if consent + 1year > now, it's the former.
consent = datetime.strptime(row["consent"], "%d-%b-%Y %H:%M:%S")
if consent + timedelta(days=365) > as_of_date:
row["status"] = "Not Yet Available"

if last_viable:
general_row_detail(row, patient, last_viable)
Expand Down

0 comments on commit 72760e9

Please sign in to comment.