Skip to content

Commit

Permalink
for sorting of patient list by visit, include translation table in op…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
pbugni committed Nov 20, 2024
1 parent fc8f17f commit b78a4ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions portal/views/patients.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,17 @@ def requested_orgs(user, research_study_id):
distinct_action = PatientList.query.distinct(PatientList.action_state).with_entities(
PatientList.action_state)
options.append({"action_state": [(state[0], _(state[0])) for state in distinct_action]})
distinct_visits = PatientList.query.distinct(PatientList.empro_visit).with_entities(
PatientList.empro_visit)
options.append({"empro_visit": [(visit[0], _(visit[0])) for visit in distinct_visits]})
else:
distinct_status = PatientList.query.distinct(
PatientList.questionnaire_status).with_entities(PatientList.questionnaire_status)
options.append(
{"questionnaire_status": [(status[0], _(status[0])) for status in distinct_status]})
distinct_visits = PatientList.query.distinct(PatientList.visit).with_entities(
PatientList.visit)
options.append({"visit": [(visit[0], _(visit[0])) for visit in distinct_visits]})

viewable_orgs = requested_orgs(user, research_study_id)
query = PatientList.query.filter(PatientList.org_id.in_(viewable_orgs))
Expand Down

0 comments on commit b78a4ec

Please sign in to comment.