BIDMCDigitalPsychiatry / LAMP-platform

The LAMP Platform (issues and documentation).
https://docs.lamp.digital/
Other
13 stars 10 forks source link

Allow Users to Configure Email Notifications Based on ActivityEvents #818

Open MattMatt27 opened 1 month ago

MattMatt27 commented 1 month ago

Is your feature request related to a problem? Please describe. We have now received requests from a few researchers to configure automated emails to go out when a certain mindLAMP activity results in a value above a particular threshold. This could be specific survey questions, complete cognitive tests, or other mindLAMP activities depending on what is technically feasible.

Describe the solution you'd like For example, in PHQ-9 surveys, it would be nice to allow users to configure question 9 to send an automated encrypted email to the clinician associated with the project for any value 2 or higher. The email would include the participant name, contact information, the activity, the score, and the date/time of the survey response. And the configuration options would be: contact role (Clinician, RA, PI, etc.), contact email (email address), email body text (configurable text field that allows for inclusion of all or some of the previously mentioned participant information)

By default we don't expect users to configure any notifications so it would not be something we would want to prompt users to configure every time they create a question, rather it would be nice to have it as an additional option that they could configure if needed.

Describe alternatives you've considered Currently this functionality is handled through automated jobs that pull the mindLAMP data periodically, or by manual checking performed by RAs. Automated jobs could likely continue to serve this purpose, but it would be cleaner if it were possible to integrate into the platform itself.

Additional context This may not be technically feasible, or would have security implications that make automatic jobs on our encrypted servers preferable to implementing it through the app itself. Happy to provide more information about the specific requests we have received if needed.

sarithapillai8 commented 1 month ago

@MattMatt27 Please confirm below:

For surveys, include an email configuration option for each survey question. This could be implemented by expanding that section when a link or button is clicked. Otherwise, we don't have any option to make a condition per question if the requirement is to send an email notification based on a survey answer.

For other games, we can include the email option configuration as part of the activity settings.

Do you have any other suggestions?

MattMatt27 commented 1 month ago

@sarithapillai8 For survey questions, would it be possible to add a couple fields to the warning section (shown below) to let researchers configure an email template and a contact email address in addition to the patient facing warnings?

image

Having the option to configure email notifications for complete games/cognitive tests as part of the activity settings would work perfectly for the needs that researchers have communicated.

sarithapillai8 commented 1 month ago

@MattMatt27 We can add that as a common option to configure email settings and we can add the notification settings as you mentioned under the warnings section.

MattMatt27 commented 4 weeks ago

That sounds perfect, thank you! And no rush on this issue, its a nice-to-have feature but we have only gotten a couple requests for it so far so it's not high priority at the moment.