diff --git a/.editorconfig b/.editorconfig index b085af9015..5235b56bb1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ [*.py] # isort settings # https://github.com/timothycrosley/isort/wiki/isort-Settings -line_length=79 +line_length=100 multi_line_output=3 include_trailing_comma=True known_first_party=tests diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eba5efe17f..1944686f05 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ before_script: # test templates .test_template: &test_definition # track debian stable version of python3 - image: python:3.7 + image: python:3.9 script: tox stage: test diff --git a/.pep8speaks.yml b/.pep8speaks.yml index 0d79f96fd7..d589dd0b5b 100644 --- a/.pep8speaks.yml +++ b/.pep8speaks.yml @@ -2,8 +2,7 @@ # https://pep8speaks.com/ pycodestyle: - # Default is 79 in PEP8 - max-line-length: 79 + max-line-length: 100 scanner: # Errors caused by only the patch are shown, not the whole file diff --git a/docker/docker-compose.prod.yaml b/docker/docker-compose.prod.yaml index d39e69c197..78174d87d6 100644 --- a/docker/docker-compose.prod.yaml +++ b/docker/docker-compose.prod.yaml @@ -32,8 +32,9 @@ services: command: sh -c ' flask generate-site-cfg && nice - celery worker + celery --app portal.celery_worker.celery + worker --loglevel debug ' @@ -49,9 +50,10 @@ services: command: sh -c ' flask generate-site-cfg && nice -n 15 - celery worker + celery --app portal.celery_worker.celery - --queue low_priority + worker + --queues low_priority --loglevel debug ' diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 664ebdbe25..c06caf6346 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -44,8 +44,9 @@ services: <<: *service_base command: sh -c ' flask generate-site-cfg && - celery worker + celery --app portal.celery_worker.celery + worker --loglevel debug ' depends_on: @@ -55,9 +56,10 @@ services: <<: *service_base command: sh -c ' flask generate-site-cfg && - celery worker + celery --app portal.celery_worker.celery - --queue low_priority + worker + --queues low_priority --loglevel debug ' depends_on: @@ -68,8 +70,9 @@ services: command: bash -c ' (wait-for-it --host=redis --port=6379 --strict -- flask set-celery-beat-healthy) & wait-for-it --timeout=120 --host=web --port=$$PORT --strict -- - celery beat + celery --app portal.celery_worker.celery + beat --loglevel debug --schedule /tmp/celerybeat-schedule.db --pidfile /tmp/celerybeat.pid diff --git a/portal/config/config.py b/portal/config/config.py index d3fecfc076..3b1ccbf910 100644 --- a/portal/config/config.py +++ b/portal/config/config.py @@ -117,6 +117,8 @@ class BaseConfig(object): TOKEN_LIFE_IN_DAYS = 30 # Used for emailed URL tokens MULTIPROCESS_LOCK_TIMEOUT = 30 # Lock on QB timeline generation + OPT_OUT_DISABLED_ORG_IDS = os.environ.get('OPT_OUT_DISABLED_ORG_IDS', []) + # Medidata integration configuration # disable creation and editing of patients when active PROTECTED_ORG = os.environ.get('PROTECTED_ORG') # use organization name diff --git a/portal/config/eproms/AppText.json b/portal/config/eproms/AppText.json index 7135b6bc42..a2f2c44ed5 100644 --- a/portal/config/eproms/AppText.json +++ b/portal/config/eproms/AppText.json @@ -186,15 +186,30 @@ "resourceType": "AppText" }, { - "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=faab8398-fa93-f1ca-9d81-3ddc38769d96", + "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=fbef98f2-53be-316c-a671-c1ebb423ed33", "name": "empro clinician trigger notification", "resourceType": "AppText" }, { - "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=86b1c0ef-e3ee-e264-0190-71678d21b6a5", + "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=a1f1a57c-b250-0cf5-548b-5b0284e82ae7", + "name": "empro clinician trigger notification partially opted out", + "resourceType": "AppText" + }, + { + "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=e875dceb-58d9-c8ce-3f44-6b95503e725a", + "name": "empro clinician trigger notification all opted out", + "resourceType": "AppText" + }, + { + "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=3d1ab756-fe6c-eef5-5eda-78f17ac669ee", "name": "empro clinician trigger reminder", "resourceType": "AppText" }, + { + "custom_text": "{config[LR_ORIGIN]}/c/portal/truenth/asset/mail?version=latest&uuid=76eff370-1b98-9387-bbfd-94ffc199ed49", + "name": "empro clinician trigger reminder partially opted out", + "resourceType": "AppText" + }, { "custom_text": "

(greeting),

This email was sent to you because you are a patient at (clinic name) and consented to participate in the Prostate Cancer Outcomes - (parent org) Registry Study.

This is an invitation to use the TrueNTH website, where you will report on your health. Your participation will help us collectively improve the care that men receive during their prostate cancer journey.

To complete your first questionnaire, please first verify your account.

Verify your account

You can also access the TrueNTH website with this link:

{0}

Save this email so that you can return to TrueNTH any time.

If you have any queries, please contact your representative at (clinic name).

", "name": "profileSendEmail invite email_body", diff --git a/portal/config/eproms/Questionnaire.json b/portal/config/eproms/Questionnaire.json index 2ace521d25..d8077ae449 100644 --- a/portal/config/eproms/Questionnaire.json +++ b/portal/config/eproms/Questionnaire.json @@ -8328,10 +8328,16 @@ ] }, { - "type": "date", + "type": "date", "linkId": "ironman_ss_post_tx.2", "text": "Date action taken" }, + { + "type": "boolean", + "linkId": "ironman_ss_post_tx.2.1", + "text": "Delayed due to local public holiday", + "required": false + }, { "type": "choice", "linkId": "ironman_ss_post_tx.3", diff --git a/portal/config/eproms/ScheduledJob.json b/portal/config/eproms/ScheduledJob.json index fbbf0f6ec9..744fab81f9 100644 --- a/portal/config/eproms/ScheduledJob.json +++ b/portal/config/eproms/ScheduledJob.json @@ -262,7 +262,7 @@ "kwargs": null, "name": "IRONMAN EMPRO Trigger Reminder Emails", "resourceType": "ScheduledJob", - "schedule": "1 4,10,16,22 * * *", + "schedule": "*/5 * * * *", "task": "process_triggers_task" }, { diff --git a/portal/config/eproms/site_persistence_file.json b/portal/config/eproms/site_persistence_file.json index 1b71aff1f1..d5849a8380 100644 --- a/portal/config/eproms/site_persistence_file.json +++ b/portal/config/eproms/site_persistence_file.json @@ -20,6 +20,7 @@ "CONSENT_EDIT_PERMISSIBLE_ROLES = ['staff', 'staff_admin', 'admin']\n", "CUSTOM_PATIENT_DETAIL = True\n", "LOCALIZED_AFFILIATE_ORG = 'TrueNTH Global Registry'\n", + "OPT_OUT_DISABLED_ORG_IDS = [14620, 14656]\n", "ORGS_W_CUSTOM_INVITES = ['TrueNTH Global Registry', 'IRONMAN']\n", "SHOW_WELCOME = False\n", "HIDE_TRUENTH_ID_FIELD = True\n", diff --git a/portal/eproms/templates/eproms/assessment_engine.html b/portal/eproms/templates/eproms/assessment_engine.html index aa86fd8526..43aec99d35 100644 --- a/portal/eproms/templates/eproms/assessment_engine.html +++ b/portal/eproms/templates/eproms/assessment_engine.html @@ -31,3 +31,7 @@
{% endif %} +{%- from "eproms/assessment_engine/ae_macros.html" import empro_thankyou_modal, empro_optout_modal -%} +{{empro_optout_modal(user)}} +{{empro_thankyou_modal(user)}} + diff --git a/portal/eproms/templates/eproms/assessment_engine/ae_base.html b/portal/eproms/templates/eproms/assessment_engine/ae_base.html index 58c9df09c4..5d2bd9b62a 100644 --- a/portal/eproms/templates/eproms/assessment_engine/ae_base.html +++ b/portal/eproms/templates/eproms/assessment_engine/ae_base.html @@ -4,3 +4,4 @@
{%- block body -%}{%- endblock -%}
+
{{_("Loading")}} ...
diff --git a/portal/eproms/templates/eproms/assessment_engine/ae_due.html b/portal/eproms/templates/eproms/assessment_engine/ae_due.html index 1352b93c85..7cf88f4ea6 100644 --- a/portal/eproms/templates/eproms/assessment_engine/ae_due.html +++ b/portal/eproms/templates/eproms/assessment_engine/ae_due.html @@ -1,4 +1,4 @@ -{%- from "eproms/assessment_engine/ae_macros.html" import render_header, render_greeting, render_card_content, render_call_to_button, due_card, completed_card, empro_due, empro_completed, empro_expired, completed_cards -%} +{%- from "eproms/assessment_engine/ae_macros.html" import render_header, render_greeting, render_card_content, render_call_to_button, due_card, completed_card, empro_due, empro_completed, empro_expired, completed_cards -%} {% extends "eproms/assessment_engine/ae_base.html" %} {% block head %} diff --git a/portal/eproms/templates/eproms/assessment_engine/ae_macros.html b/portal/eproms/templates/eproms/assessment_engine/ae_macros.html index 48ebd29e45..91827ac98c 100644 --- a/portal/eproms/templates/eproms/assessment_engine/ae_macros.html +++ b/portal/eproms/templates/eproms/assessment_engine/ae_macros.html @@ -210,9 +210,6 @@

{{_("Completed Questionnaires")}}

{% endif %} {%- endcall -%} - {% if substudy_assessment_status.overall_status == OverallStatus.completed %} - {{empro_thankyou_modal(user)}} - {% endif %} {%- endif -%} {%- endmacro -%} {%- macro empro_thankyou_card(full_name="") -%} @@ -227,6 +224,11 @@

{{_("Your Support Team")}}

{%- endmacro -%} +{%- macro empro_no_contact_notice() -%} +
+ Note: You have chosen not to be contacted about . Your care team will not discuss these issues this month. +
+{%- endmacro -%} {%- macro empro_modal_hardTrigger_supportTeam_block(organization="") -%}

{{_("Your Support Team")}}

@@ -234,6 +236,7 @@

{{_("Your Support Team")}}

+ {{empro_no_contact_notice()}}

{{_("To help address any issues, we've informed your care team and they'll be in contact with you soon.")}}

{% if organization %}

{{_("In the meantime, if you have any questions or need assistance, please contact your team at %(organization)s directly. They're happy to help.", organization=organization)}}

@@ -270,8 +273,8 @@

{{_("Your Health Tips")}}

{%- macro empro_thankyou_modal(user) -%} - - {{saveLoaderDiv("clinics")}} + {{saveLoaderDiv("clinics")}} {% endcall %}
@@ -871,7 +871,25 @@

{% if person and person.username %}{{ _("for") + " " + pe

{% endcall %} {%- endmacro -%} -{%- macro postInterventionQuestionnaire(person) -%} +{% macro postInterventionOptoutDomains() %} +
+

{{_("NOTE: The participant has chosen not to be contacted about some issues.")}}

+

{{_("NOTE: The participant has chosen not to be contacted.")}}

+

{{_("High distress areas ( do not contact ): ")}}

+
+{% endmacro %} +{%- macro adminTriggerLinks(person, current_user) %} + {% if (current_user.has_role(ROLE.ADMIN.value)) %} +
+

ADMIN USE ONLY

+ +

+ Current Triggers | + Trigger History +

+ {% endif %} +{% endmacro %} +{%- macro postInterventionQuestionnaire(person, current_user) -%}
 
@@ -883,13 +901,16 @@

{% if person and person.username %}{{ _("for") + " " + pe
-
{{_("Actions Required (for Clinicians/Site Staff)")}}
+
{{_("Actions Required (for Clinicians/Site Staff)")}}
{{_("EMPRO questionnaire completed on:")}}
-
{{_("ACTION REQUIRED for high distress areas:")}} +
+

{{_("ACTION REQUIRED for high distress areas:")}}

+

{{_("High distress areas")}}

+ {{postInterventionOptoutDomains()}}
@@ -899,8 +920,9 @@
{{_("Actions Required (
+ {{postInterventionOptoutDomains()}} -
{{_("No high distress areas indicated")}}
+
{{_("No action required")}}
{{_("View subject EMPRO report for more information")}}
@@ -911,24 +933,32 @@

{{_("Actions Required ( will be in a disabled state if the action state is "completed" or intervention_qnr_eligible flag is set to false -->
-
+
- + + - + +
+ +
+ + - - + :dataRequired="getDataRequiredAttribute(item)" + v-if="item.type == 'boolean'" /> +
@@ -940,6 +970,7 @@
{{_("Actions Required ( :dataType="item.type" :linkId="item.linkId" :value="option.valueCoding.display" + :dataRequired="getDataRequiredAttribute(item)" @change="onResponseChangeFieldEvent" > @@ -949,6 +980,7 @@
{{_("Actions Required ( dataType="string" :code="option.valueCoding.code" :linkId="item.linkId" + :dataRequired="getDataRequiredAttribute(item)" @change="onResponseChangeFieldEvent" v-if="/other/gi.test(option.valueCoding.display)" > @@ -958,6 +990,7 @@
{{_("Actions Required (