{{_("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)}}
+ {{_("About your preference to be contacted by your care team for these ongoing issues.")}}
+
+
+
+
{{_("We’ve noticed you’re continuing to experience challenges with the issues listed below.")}}
+
+ {{_("If you prefer not to be contacted by your care team for any (or all) of these issues, please check the box(es) below.")}}
+
+
+ {{_("Your care team will continue to contact you as usual for other identified issues.")}}
+ {{_("If you have any questions or need assistance, please contact your team directly at %(organization)s. They'll be happy to help.", organization=user.organizations[0].name if user else "")}}
+
+
+
{{_("Please do not contact me about:")}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+{%- endmacro -%}
{%- macro empro_script() -%}
{%- endmacro -%}
diff --git a/portal/static/js/src/data/common/test/SubStudyQuestionnaireTestData.json b/portal/static/js/src/data/common/test/SubStudyQuestionnaireTestData.json
new file mode 100644
index 0000000000..2b2ff3b0f2
--- /dev/null
+++ b/portal/static/js/src/data/common/test/SubStudyQuestionnaireTestData.json
@@ -0,0 +1,371 @@
+{
+ "entry": [
+ {
+ "author": {
+ "display": "patient demographics",
+ "reference": "https://eproms-test.cirg.washington.edu/api/demographics/4118"
+ },
+ "authored": "2024-03-15T23:16:54Z",
+ "extension": [
+ {
+ "url": "http://us.truenth.org/identity-codes/visit-name",
+ "visit_name": "Month 1"
+ }
+ ],
+ "group": {
+ "question": [
+ {
+ "answer": [
+ {
+ "valueString": "Frequently"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.1.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Frequently"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.1",
+ "text": "In the last 7 days, how OFTEN did you have pain?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.2.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.2",
+ "text": "In the last 7 days, what was the SEVERITY of your PAIN at its WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.3.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.3",
+ "text": "In the last 7 days, how much did PAIN INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Frequently"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.4.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Frequently"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.4",
+ "text": "In the last 7 days, how OFTEN did you have ACHING JOINTS (SUCH AS ELBOWS, KNEES, SHOULDERS)?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.5.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.5",
+ "text": "In the last 7 days, what was the SEVERITY of your ACHING JOINTS (SUCH AS ELBOWS, KNEES, SHOULDERS) at their WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.6.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.6",
+ "text": "In the last 7 days, how much did ACHING JOINTS (SUCH AS ELBOWS, KNEES, SHOULDERS) INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.7.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.7",
+ "text": "In the last 7 days, what was the SEVERITY of your INSOMNIA (INCLUDING DIFFICULTY FALLING ASLEEP, STAYING ASLEEP, OR WAKING UP EARLY) at its worst?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.8.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.8",
+ "text": "In the last 7 days, how much did INSOMNIA (INCLUDING DIFFICULTY FALLING ASLEEP, STAYING ASLEEP, OR WAKING UP EARLY) INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.9.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.9",
+ "text": "In the last 7 days, what was the SEVERITY of your FATIGUE, TIREDNESS, OR LACK OF ENERGY at its WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.10.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.10",
+ "text": "In the last 7 days, how much did FATIGUE, TIREDNESS, OR LACK OF ENERGY INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Frequently"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.11.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Frequently"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.11",
+ "text": "In the last 7 days, how OFTEN did you feel ANXIETY?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.12.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.12",
+ "text": "In the last 7 days, what was the SEVERITY of your ANXIETY at its WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.13.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.13",
+ "text": "In the last 7 days, how much did ANXIETY INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Frequently"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.14.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Frequently"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.14",
+ "text": "In the last 7 days, how OFTEN did you FEEL THAT NOTHING COULD CHEER YOU UP?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.15.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.15",
+ "text": "In the last 7 days, what was the SEVERITY of your FEELINGS THAT NOTHING COULD CHEER YOU UP at THEIR WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.16.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.16",
+ "text": "In the last 7 days, how much did THE FEELING THAT NOTHING COULD CHEER YOU UP INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Frequently"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.17.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Frequently"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.17",
+ "text": "In the last 7 days, how OFTEN did you have SAD OR UNHAPPY FEELINGS?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Severe"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.18.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Severe"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.18",
+ "text": "In the last 7 days, what was the SEVERITY of your SAD OR UNHAPPY FEELINGS at their WORST?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.19.4",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.19",
+ "text": "In the last 7 days, how much did SAD OR UNHAPPY FEELINGS INTERFERE with your usual or daily activities?"
+ },
+ {
+ "answer": [
+ {
+ "valueString": "Quite a bit"
+ },
+ {
+ "valueCoding": {
+ "code": "ironman_ss.20.3",
+ "system": "https://eproms-test.cirg.washington.edu/api/codings/assessment",
+ "text": "Quite a bit"
+ }
+ }
+ ],
+ "linkId": "ironman_ss.20",
+ "text": "During the past week: Has your physical condition or medical treatment interfered with your social activities?"
+ }
+ ]
+ },
+ "identifier": {
+ "label": "cPRO survey session ID",
+ "system": "https://ae-eproms-test.cirg.washington.edu",
+ "use": "official",
+ "value": "3706.0"
+ },
+ "questionnaire": {
+ "display": "Treatment symptoms and side effects",
+ "reference": "https://eproms-test.cirg.washington.edu/api/questionnaires/ironman_ss"
+ },
+ "resourceType": "QuestionnaireResponse",
+ "source": {
+ "display": "patient demographics",
+ "reference": "https://eproms-test.cirg.washington.edu/api/demographics/4118"
+ },
+ "status": "completed",
+ "subject": {
+ "display": "patient demographics",
+ "reference": "https://eproms-test.cirg.washington.edu/api/demographics/4118"
+ }
+ }
+ ],
+ "link": [
+ {
+ "href": "https://eproms-test.cirg.washington.edu/api/patient/4118/assessment/ironman_ss",
+ "rel": "self"
+ }
+ ],
+ "resourceType": "Bundle",
+ "total": 1,
+ "type": "searchset",
+ "updated": "2023-07-12T22:20:17.897095Z"
+}
diff --git a/portal/static/js/src/data/common/test/TestTriggersData.json b/portal/static/js/src/data/common/test/TestTriggersData.json
new file mode 100644
index 0000000000..e504b860f7
--- /dev/null
+++ b/portal/static/js/src/data/common/test/TestTriggersData.json
@@ -0,0 +1,111 @@
+{
+ "state": "resolved",
+ "timestamp": "2023-07-31T23:17:03+00:00",
+ "triggers": {
+ "action_state": "completed",
+ "actions": {
+ "email": [
+ {
+ "context": "patient thank you",
+ "email_message_id": 147757,
+ "timestamp": "2023-07-10T23:17:04.336385Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147758,
+ "timestamp": "2023-07-10T23:17:04.767591Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147759,
+ "timestamp": "2023-07-10T23:17:04.981972Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147760,
+ "timestamp": "2023-07-10T23:17:05.197306Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147761,
+ "timestamp": "2023-07-10T23:17:05.413215Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147762,
+ "timestamp": "2023-07-10T23:17:05.657467Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147763,
+ "timestamp": "2023-07-10T23:17:05.879160Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147764,
+ "timestamp": "2023-07-10T23:17:06.088223Z"
+ },
+ {
+ "context": "initial staff alert",
+ "email_message_id": 147765,
+ "timestamp": "2023-07-10T23:17:06.284333Z"
+ }
+ ]
+ },
+ "domain": {
+ "anxious": {
+ "ironman_ss.11": "hard",
+ "ironman_ss.12": "hard",
+ "ironman_ss.13": "hard",
+ "_sequential_hard_trigger_count": 2
+ },
+ "discouraged": {
+ "ironman_ss.14": "hard",
+ "ironman_ss.15": "hard",
+ "ironman_ss.16": "hard",
+ "_sequential_hard_trigger_count": 2
+ },
+ "fatigue": {
+ "ironman_ss.10": "hard",
+ "ironman_ss.9": "hard",
+ "_sequential_hard_trigger_count": 0
+ },
+ "general_pain": {
+ "ironman_ss.1": "hard",
+ "ironman_ss.2": "hard",
+ "ironman_ss.3": "hard",
+ "_sequential_hard_trigger_count": 2
+ },
+ "insomnia": { "ironman_ss.7": "hard", "ironman_ss.8": "hard" },
+ "joint_pain": {
+ "ironman_ss.4": "hard",
+ "ironman_ss.5": "hard",
+ "ironman_ss.6": "hard",
+ "_sequential_hard_trigger_count": 0
+ },
+ "sad": {
+ "ironman_ss.17": "hard",
+ "ironman_ss.18": "hard",
+ "ironman_ss.19": "hard",
+ "_sequential_hard_trigger_count": 2
+ },
+ "social_isolation": {
+ "ironman_ss.20": "hard",
+ "_sequential_hard_trigger_count": 2
+ }
+ },
+ "resolution": {
+ "authored": "2023-07-25T16:21:24Z",
+ "qb_iteration": null,
+ "qnr_id": 4162
+ },
+ "source": {
+ "authored": "2023-07-25T23:16:54Z",
+ "qb_id": 114,
+ "qb_iteration": null,
+ "qnr_id": 4161
+ }
+ },
+ "user_id": 4118,
+ "visit_month": 1
+}
diff --git a/portal/static/js/src/empro.js b/portal/static/js/src/empro.js
index b2122845cf..57c061adc0 100644
--- a/portal/static/js/src/empro.js
+++ b/portal/static/js/src/empro.js
@@ -1,204 +1,551 @@
import EMPRO_DOMAIN_MAPPINGS from "./data/common/empro_domain_mappings.json";
-import {EPROMS_SUBSTUDY_ID, EPROMS_SUBSTUDY_QUESTIONNAIRE_IDENTIFIER} from "./data/common/consts.js";
+import {
+ EPROMS_SUBSTUDY_ID,
+ EPROMS_SUBSTUDY_QUESTIONNAIRE_IDENTIFIER,
+} from "./data/common/consts.js";
import tnthAjax from "./modules/TnthAjax.js";
import tnthDate from "./modules/TnthDate.js";
+import TestResponsesJson from "./data/common/test/SubStudyQuestionnaireTestData.json";
+import TestTriggersJson from "./data/common/test/TestTriggersData.json";
+import { getUrlParameter } from "./modules/Utility";
-var emproObj = function() {
- this.domains = [];
- this.mappedDomains = [];
- this.hardTriggerDomains = [];
- this.softTriggerDomains = [];
- this.hasHardTrigger = false;
- this.hasSoftTrigger = false;
- this.userId = 0;
-};
-emproObj.prototype.populateDomainDisplay = function() {
- this.mappedDomains.forEach(domain => {
- $("#emproModal .triggersButtonsContainer").append(
- `
- ${i18next.t("{domain} Tips").replace("{domain}", domain.replace(/\_/g, " "))}
- `
- );
+var emproObj = function () {
+ this.domains = [];
+ this.mappedDomains = [];
+ this.hardTriggerDomains = [];
+ this.softTriggerDomains = [];
+ this.optOutDomains = [];
+ this.selectedOptOutDomains = [];
+ this.submittedOptOutDomains = [];
+ this.optOutSubmitData = null;
+ this.hasHardTrigger = false;
+ this.hasSoftTrigger = false;
+ this.userId = 0;
+ this.visitMonth = 0;
+ this.authorDate = null;
+ this.cachedAccessKey = null;
+};
+emproObj.prototype.getDomainDisplay = function (domain) {
+ if (!domain) return "";
+ return domain.replace(/_/g, " ");
+};
+emproObj.prototype.populateDomainDisplay = function () {
+ var triggerButtonsContainerElement = $(
+ "#emproModal .triggersButtonsContainer"
+ );
+ if (!triggerButtonsContainerElement.hasClass("added")) {
+ this.mappedDomains.forEach((domain) => {
+ triggerButtonsContainerElement.append(
+ `
+ ${i18next
+ .t("{domain} Tips")
+ .replace("{domain}", this.getDomainDisplay(domain))}
+ `
+ );
});
- this.hardTriggerDomains.forEach(domain => {
- $("#emproModal .hardTriggersDisplayList").append(`