Skip to content

Commit

Permalink
Check for QB results before migrating
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed May 15, 2020
1 parent 01d28e8 commit 5261a78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions portal/migrations/versions/f93d9608c372_.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ def existing_qnr_deets(patient_id, missing_qb_id):


def upgrade():
three_mo_qb = QuestionnaireBank.query.filter(
QuestionnaireBank.name == 'IRONMAN_v3_recurring_3mo_pattern').first().id
six_mo_qb = QuestionnaireBank.query.filter(
QuestionnaireBank.name == 'IRONMAN_v3_recurring_6mo_pattern').first().id
QuestionnaireBank.name == 'IRONMAN_v3_recurring_6mo_pattern').first()
if not six_mo_qb:
# System w/o problem QB - nothing needed
return
six_mo_qb = six_mo_qb.id
three_mo_qb = QuestionnaireBank.query.filter(
QuestionnaireBank.name == 'IRONMAN_v3_recurring_3mo_pattern').first().id

candidate_patients = [p[0] for p in session.query(QBT).filter(
QBT.qb_id == three_mo_qb).distinct(
Expand Down

0 comments on commit 5261a78

Please sign in to comment.