-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Ability to mute people and places #4767
Comments
Given that some of the above will be covered by configuration (eg the mute form, not generating Tasks for muted contacts), I'll try to summarize the changes/features needed, along with some questions before we implement. Once outstanding questions are answered we spawn new issues for individual parts of this issues, or just leave them all part of this one. Configurable FieldAn field in app_settings that can contain an array of form IDs that mute a contact, and another field for unmuting contacts. We already have a similar fields for muting SMS notifications:
It makes sense to combine this new muting with the existing muting of SMS notifications since the reasons for muting via SMS should also mean there shouldn't be Tasks in the app for that contact. We should first verify though that this is compatible with how projects use the existing SMS version. If that is the case, this field would need to change from accepting only a single form to also accepting an array of form fields. Updating a docIf a submitted report's form ID is on the mute list then the contact the report is about should get a muted flag (eg Rejecting SMS if the person's place is mutedAs mentioned in the issue, we cannot have an unmuted person/place in a muted place. We can avoid this situation in the webapp by setting form context accordingly. By SMS however, we'd need to be able to validate the unmute form by checking that no parent of the contact is muted. We likely either need to allow validation on notification reports, and ensure that fields for all levels of the lineage can be accessed, or perhaps just an Displaying muted contactsAmanda has clearly laid out what a muted contact looks like in the list. Curious if this is necessary for the first version of this feature, or if we are better off with a simpler implementation (eg just graying out the contact in the contact list) until we get real project use and feedback of the feature. Not showing Tasks for muted contactsDone via configuration by checking for any muted parent in lineage. Muting SMS notificationsDone via pre-exisiting feature to turn notifications off, if we can combine with that feature. Modal warning prior to actions on muted contactsWhen opening an action form for a muted contact, if the form is not an unmute form then show a modal before continuing eg “This person belongs to a family that is currently muted. Are you sure you want to proceed? Yes/No". Some outstanding questions:
|
|
Agreed... I think this'll need to be decided on a target-by-target basis. For simple form counts, I think you will want to include them because the Mute feature should prevent submission of forms while the contact is muted anyway... and if they weren't muted at the time of form submission, they should be counted. However, I can definitely imagine some other scenarios where you wouldn't want to include them... perhaps in some denominators for expected home visits, for example. I don't know exactly how Targets are configured, but I imagine some of the processing could also be pretty heavy if you have to look for muting. For example.... if you needed to calculate something like |
Ok, thanks for the info. Since the muting will be on the place it will be easy to include or exclude it on a per widget basis. It means that we still need to process all contacts, and shouldn't exclude them from Nools just because they are muted. We'll be able to handle the muted contacts in config of targets pretty easily. |
I assume you mean 'in addition to' the |
Also... sorry I just noticed this comment
Which means my comment
Is not necessarily true. Totally fine, just means we'll need to be more diligent in configuring targets and determining when to include/exclude things. |
I wouldn't assume that, but gather that is what you want? When muting a place (aka family) adding the muted flag to every person within place seems problematic as it would mean changes to more docs. I was thinking a person would be muted if they themselves, or any of their parents have the muted flag.
The muted flag would be available in the person' lineage docs. |
Sorry... I'm OK with family muting only updating the When you say any of their parents, I take that to mean this includes muting |
Some additional questions/comments:
|
Collection of responses below:
Correct
I don't see a good reason why we wouldn't make it generic enough to mute any place level.
We are unlikely to add a migration for this due to the performance costs (eg rebuilding views, re-downloading all contacts). Given that the absence of a muted flag means that the place is not muted, what is the advantage of adding Answers to the additional listed questions:
Yes, I believe that is the best way to proceed.
The reports that turn notifications OFF set the state of scheduled messages to
That is a good point, and I would not have assumed that as it is not how it currently works -- but it is worth specifying as such. In config we should make sure that the response mentions that the patient is muted if that is the case.
Would this be only at doc creation, eg |
Actually... I guess it's less about muting the place, but rather muting the contact of that place. What I'm specifically looking for is the ability to know which CHW's are still with the program and therefore should show up in dropdowns in analytics, for example. This was discussed in https://github.com/medic/medic-projects/issues/1894 . This is different than muting the place (
The data model (and all our queries) will be much cleaner, not to mention easier to understand for the community, if we can simply check the value of a field that is known to exist rather than having to always check to see if fields exist first, and then check the value of them. As far as I am aware, we don't have any other situations where the existence of a field is conditional (other than fields being added later, but from that point on they always exist). Based on the first part of your response, I recognize we'll have to first check for the existence of that field for projects that have upgraded from a previous version, but ideally all projects that start from this release onwards would have the field no matter what.
Not necessarily... just wanted to understand the plan. This will make it pretty tricky to know why a particular schedule was muted (OFF message, individual muted, family muted, etc...), but you can figure it out by looking at the timeline of potential mute messages and comparing to the schedule date/time.
I was specifically thinking of the first one ( |
@abbyad @michaelkohn I'm trying to follow the convo you're having. These are some assumptions I have about our muting workflow. Can you confirm which are still true? cc @amandacilek -- muting a household mutes the people in that household -- unmuting a person in a household unmutes the household. this is to prevent us from having "active" people in hidden households. you can then individually mute members of the household. -- I had expected that if you reported for a muted person, particularly if it is a schedule-creating form, this would prompt you to unmute the person. It sounds like that is not a given, and I'm curious about that. If a CHW is actively treating a person but choosing not to receive notifications about them (and hiding them from their list, and some targets), what is the reason for this? This seems to signal a different motivation for mute than what was requested (if a person moved away or doesn't want to receive services anymore) and worth deeper consideration before we allow it. -- OFF and mute are functionally the same, but we haven't had a "OFF" form for households yet (I think in part because it was created for SMS projects and we don't have households on SMS yet). Continuing to use "OFF" for muting individuals (or even naming it that way for households) works for me, as this is how our users have been trained and are used to it. -- In order to keep the scope of this issue in check, we hadn't designed this for other levels of the hierarchy yet or taken into consider unique rules that might affect muting a place like a branch and applying that to all the people in that place, i.e. CHPs. It makes sense to build it to work generically, but we'll want to think through that before we broadcast to teams that it can be used for that. |
First to note that family muting and individual muting have been written as separate issues. My understanding has been that family muting is the primary focus for right now (and for this ticket) and that enhancements to turn on/off into a true individual muting feature are nice to have but not required and not necessarily bundled together with this work.
|
I keep trying to work this out - it seems that we're already supporting individual muting. What individual muting features are left in the backlog beyond what we can already do? Are you referring to changes such as showing muted people differently in the household list or selectively muting schedules on a profile? |
I believe this sentence is originally from Gareth: "we need to make an extension of that to also mark the patient muted and make the UI changes to their profile to reflect the “Muted” status". My interpretation of this was that it's not just a matter of the UI changes to the profile. I guess we currently don't "mark" the patient as muted in the way that we need to. |
Got it. That sounds like the field that Michael was suggesting. Muted: true/false. |
((My above 3 answers are based on my original understanding of the plan, may not reflect what Michael and Marc have been discussing. Curious to hear their thoughts. Also, I am clearly not the expert in how this should be handled on the back end - I wrote the original issue but I'm relying on Michael and Marc to fill in the gaps and give recommendations or suggestions if something needs to be changed)) |
Yeah I think that would be good. So we could easily show when they were muted |
Thanks! |
Hey @newtewt & co. I did a few tests and I think this works well for me. Just an observation/bug; after muting a Health Facility, then I click on a CHV Area I'm able to unmute the CHV Area, other CHV Areas plus the Health Facility. |
A contact's muting_history log is saved in the sentinel info doc. Each time the muted status is changed, an entry is added in the muting_history log. A contact's muted property now contains a human readable date (in ISO8601 format). When unmuting, the property is removed altogether, avoiding having mixed data types for the same property. The muted field value (when existent) is exposed to ContactViewModel, instead of a Boolean true. #4767
A contact's muting_history log is saved in the sentinel info doc. Each time the muted status is changed, an entry is added in the muting_history log. A contact's muted property now contains a human readable date (in ISO8601 format). When unmuting, the property is removed altogether, avoiding having mixed data types for the same property. The muted field value (when existent) is exposed to ContactViewModel, instead of a Boolean true. #4767 (cherry picked from commit 4d5212f)
A contact's muting_history log is saved in the sentinel info doc. Each time the muted status is changed, an entry is added in the muting_history log. A contact's muted property now contains a human readable date (in ISO8601 format). When unmuting, the property is removed altogether, avoiding having mixed data types for the same property. The muted field value (when existent) is exposed to ContactViewModel, instead of a Boolean true. #4767
Merged into |
This looks good to me. I'm waiting for responses on feedback and will then close this out. |
From a data architecture perspective, this ended up being implemented as follows. When a mute or unmute form ( medic DB
Example of a muted
|
This is a really helpful summary @michaelkohn! We should make sure it is persisted as documentation too. Can you add it to this doc, or a separate one in medic-docs/configuration? |
In response to medic/medic-projects#4329
Full details and additional screenshots can be found in the design spec: https://docs.google.com/document/d/1we_Qu1B4x8PuAi9pxiIu4MeXtdH1kY9W29kMidHThsc/edit?usp=sharing
Summary of muting in general
Muting households
UI changes to main People page list
UI changes to profiles
The text was updated successfully, but these errors were encountered: