Skip to content

Commit

Permalink
TN-3150 required a change in user.clinicians - no longer a simple rel…
Browse files Browse the repository at this point in the history
…ationship but now a hybrid property. (#4202)

Found 3 overlooked refactor points.
  • Loading branch information
pbugni authored May 3, 2022
1 parent da36d34 commit 3785944
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion portal/models/qb_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def patient_research_study_status(patient, ignore_QB_status=False):
'errors': [],
}
results[rs] = rs_status
if rs == EMPRO_RS_ID and len(patient.clinicians) == 0:
if rs == EMPRO_RS_ID and len([c for c in patient.clinicians]) == 0:
# Enforce biz rule - must have clinician on file.
trace("no clinician; not eligible")
rs_status['eligible'] = False
Expand Down
4 changes: 2 additions & 2 deletions portal/models/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def adherence_report(
if row['status'] == "Expired":
row['status'] = "Not Yet Available"
# TN-3101 include clinician even if not started on EMPRO
if research_study_id == EMPRO_RS_ID and len(patient.clinicians) > 0:
if research_study_id == EMPRO_RS_ID and len([c for c in patient.clinicians]) > 0:
row['clinician'] = ';'.join(
clinician.display_name for clinician in
patient.clinicians)
Expand All @@ -144,7 +144,7 @@ def adherence_report(
ts_reporting = TriggerStatesReporting(patient_id=patient.id)

# Add clinician and trigger data for EMPRO reports
if len(patient.clinicians) > 0:
if len([c for c in patient.clinicians]) > 0:
row['clinician'] = ';'.join(
clinician.display_name for clinician in
patient.clinicians)
Expand Down

0 comments on commit 3785944

Please sign in to comment.