-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EMPRO opt out UI #4335
EMPRO opt out UI #4335
Conversation
@pbugni this is an example of the data that the frontend will be sending back to the backend to be saved in the database, once the user has selected one or more domains to opt out:
I am not sure if that is the right format and what API the frontend should submit the chosen options to to be saved in the db? |
…rs, not previous answers!
… counts, so the test db can be switched over to a hotfix without this migration.
…er moving patient timeline.
log rather than blow up, when a finding missing SDC observations.
…g errors. improve logging when trigger_states become out of sync with qb_timeline due to consent change.
…rom consent changes.
… into feature/opt-out-UI
….com/uwcirg/true_nth_usa_portal into feature/opt-out-UI
Hello @achen2401! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Hi @achen2401 , yes, let's use ad-hoc JSON such as the following. This would set it for the same two domains only, from your example above. I'm attempting to use the same format you get from
please PUT/POST that to |
…th_usa_portal into feature/opt-out-UI
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @achen2401 just had one question...
portal/static/js/src/empro.js
Outdated
emproObj.prototype.handleSubmitOptoutData = function () { | ||
if (!EmproObj.hasSelectedOptOutDomains()) { | ||
EmproObj.setOptoutError( | ||
"Please check at least one checkbox. Otherwise click 'Continue'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this referring to the button labelled "DISMISS", not "Continue"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @mcjustin. I have fixed the text now so when the user didn't select a checkbox, this is what will show:
Does the "Continue" button seem redundant? If so, I will remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems redundant. Thanks for this screenshot... stepping back a bit, I don't recall that they should check at least one checkbox. Do you see that documented anywhere?
If it's not a requirement, then if they click DISMISS and they haven't selected anything yet, perhaps we should show text that says "Are you certain that you don't want to select anything? If so, click DISMISS again."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcjustin right, I don't recall either, that it is a requirement. I made the changes and attached is the latest screenshot after the user clicks DISMISS and hasn't selected anything:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks Amy!
9c29d3b
to
7f4bb5e
Compare
….com/uwcirg/true_nth_usa_portal into feature/opt-out-UI
….com/uwcirg/true_nth_usa_portal into feature/opt-out-UI
….com/uwcirg/true_nth_usa_portal into feature/opt-out-UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @achen2401
7b16760
into
feature/sequential-hard-triggers-fix
https://movember.atlassian.net/browse/TN-3252 - Frontend calls the trigger api, i.e. `/api/patient/[userId]/trigger` to retrieve the latest triggers and check if there is any that has `_sequential_hard_trigger_count` > 1 (meaning then that it has been asked previously) (see example triggers JSON): ``` { ... "timestamp": "2023-07-31T23:17:03+00:00", "triggers": { "domains": { "anxious": { "ironman_ss.11": "hard", "ironman_ss.12": "hard", "ironman_ss.13": "hard", "_sequential_hard_trigger_count": 3 }, "fatigue": { "ironman_ss.10": "hard", "ironman_ss.9": "hard", "_sequential_hard_trigger_count": 2 }, "general_pain": { "ironman_ss.1": "hard", "ironman_ss.2": "hard", "ironman_ss.3": "hard", "_sequential_hard_trigger_count": 3 }, "joint_pain": { "ironman_ss.4": "hard", "ironman_ss.5": "hard", "ironman_ss.6": "hard", "_sequential_hard_trigger_count": 2 }, "sad": { "ironman_ss.17": "hard", "ironman_ss.18": "hard", "ironman_ss.19": "hard", "_sequential_hard_trigger_count": 3 }, } } ... } ``` - If it finds any qualifying domains, it will present the OPT-OUT UI modal to the user, with the checkbox(es) that allow user to select which domain(s) to opt out: ![OptoutInputs](https://github.com/uwcirg/truenth-portal/assets/12942714/e4679692-1f3a-4e75-bed0-27a22376d55f) - frontend submits the domain(s) that user has chosen to opt out to the backend API, `/api/patient/<user_id>/triggers/opt_out`, to be saved on the database for later use (e.g. use in clinician email, adherence report) - One user submits the request, the EMPRO thank you modal that follows will display which(s) domains the user has chosen to opt out: ![OptoutChosen](https://github.com/uwcirg/truenth-portal/assets/12942714/5752b438-eb89-4e4c-a113-98d9a8497a40) --------- Co-authored-by: Amy Chen <[email protected]> Co-authored-by: Paul Bugni <[email protected]>
https://movember.atlassian.net/browse/TN-3252 - Frontend calls the trigger api, i.e. `/api/patient/[userId]/trigger` to retrieve the latest triggers and check if there is any that has `_sequential_hard_trigger_count` > 1 (meaning then that it has been asked previously) (see example triggers JSON): ``` { ... "timestamp": "2023-07-31T23:17:03+00:00", "triggers": { "domains": { "anxious": { "ironman_ss.11": "hard", "ironman_ss.12": "hard", "ironman_ss.13": "hard", "_sequential_hard_trigger_count": 3 }, "fatigue": { "ironman_ss.10": "hard", "ironman_ss.9": "hard", "_sequential_hard_trigger_count": 2 }, "general_pain": { "ironman_ss.1": "hard", "ironman_ss.2": "hard", "ironman_ss.3": "hard", "_sequential_hard_trigger_count": 3 }, "joint_pain": { "ironman_ss.4": "hard", "ironman_ss.5": "hard", "ironman_ss.6": "hard", "_sequential_hard_trigger_count": 2 }, "sad": { "ironman_ss.17": "hard", "ironman_ss.18": "hard", "ironman_ss.19": "hard", "_sequential_hard_trigger_count": 3 }, } } ... } ``` - If it finds any qualifying domains, it will present the OPT-OUT UI modal to the user, with the checkbox(es) that allow user to select which domain(s) to opt out: ![OptoutInputs](https://github.com/uwcirg/truenth-portal/assets/12942714/e4679692-1f3a-4e75-bed0-27a22376d55f) - frontend submits the domain(s) that user has chosen to opt out to the backend API, `/api/patient/<user_id>/triggers/opt_out`, to be saved on the database for later use (e.g. use in clinician email, adherence report) - One user submits the request, the EMPRO thank you modal that follows will display which(s) domains the user has chosen to opt out: ![OptoutChosen](https://github.com/uwcirg/truenth-portal/assets/12942714/5752b438-eb89-4e4c-a113-98d9a8497a40) --------- Co-authored-by: Amy Chen <[email protected]> Co-authored-by: Paul Bugni <[email protected]>
Monster PR to implement the opt-out feature. included front end changes from #4335 reused a migration (by altering the order defined within the migration files `down_revision` variable), and corrected as the previous sequential counts we not keeping up. (TN-3274) includes implementations for: - TN-3236 - TN-3237 - TN-3238 - TN-3243 - TN-3289 - TN-3240 --------- Co-authored-by: Amy Chen <[email protected]> Co-authored-by: Amy Chen <[email protected]> Co-authored-by: Justin McReynolds <[email protected]> Co-authored-by: Ivan Cvitkovic <[email protected]>
https://movember.atlassian.net/browse/TN-3252
/api/patient/[userId]/trigger
to retrieve the latest triggers and check if there is any that has_sequential_hard_trigger_count
> 1 (meaning then that it has been asked previously) (see example triggers JSON):If it finds any qualifying domains, it will present the OPT-OUT UI modal to the user, with the checkbox(es) that allow user to select which domain(s) to opt out:
frontend submits the domain(s) that user has chosen to opt out to the backend API,
/api/patient/<user_id>/triggers/opt_out
, to be saved on the database for later use (e.g. use in clinician email, adherence report)One user submits the request, the EMPRO thank you modal that follows will display which(s) domains the user has chosen to opt out: