State indicator in contact list and update_contact transition

Describe the Feature:
Add to the config the ability to add a custon icon before or after the name of the contact in the contact liste

image

These icon could be configured to be displayed in red, yellow or green depending on a field, json key value, of the given contact

What “Pain Point” Does The Proposed Feature Address: [Is there an unmet need impacting patients, providers, managers, developers, etc?]

Once the CHW is in a household, she could scroll through the list of contacts and visually identify the contacts that need some special action, this is useful specially when the task on that contact has disappeared before being able to go to the family of the patient in question.
It could also be used with places in addition to persons

Proposed Solution:

In a similar way to the one we used to define the contact summary fields, we could have the ability to pass the “contact list fields” from the config,

{
    appliesToType: 'person', 
    appliesIf: () => contact.role === 'patient' && contact.patient_age_in_months  < 22,
    position: 'after',
    kpi-color: contact.vaccinal_state,
    kpi-icon: 'fa-solid fa-syringe',
   width:4
  }

where available icons could be documented and kpi-color must be green, yellow or red, or maybe success, warning or danger
so in this case the icon with the color indicating the state should appear after each patient

image

update_contact transition
to easily have the contact’s field update I think that this will need a second feature, this is a transition to update de contact if some data_record is submitted in a very similar way as death_reporting works but with the ability to configure wich contact’s field would be updated

The update_contact transition would be a generalization of the de death_reporting transition that adds automatically a “date_of_death” field to the contact doc getting the value from a givien “date_field” in a list of forms specified in the mark_deceased_forms array and in the undo_deceased_forms array. So, maybe, it could be something like:

mark_contact_update_forms, array of forms identifiers
form_source_field, string with the path of the field in the form to use as a source value
form_source_field_type: 'date ' | 'string' | 'integer' | 'float'

the name of the field in the contact doc would be the same as form_source_field with the same form_source_field_type

If the field exists in the contact doc , the field would be updated with the new value

additionaly if we could have a transition_history like in mute/unmute transition this would be great.

Thanks

Thanks @bamatic for the detailed post!

I’d like to better understand the pain point you mention. Initially I was thinking we could simply add the ability to view recently expired tasks, but then I read your proposed solution and can see there must be additional scenarios.

Would you mind sharing a step by step example specifying the icon and how or what criteria / action would cause the icon to change over time? For example…

Icon Criteria/Action
No Icon
Red Syringe
Orange Syringe
Green Syringe

My idea is that the involved contact should have a json field, for example, vaccinal_state, this field can have 3 values, green, yellow, red, if the value of the vaccinal_state change from red to green, the UI will show the same icon in green.

Which contact property will contain the color (red, yellow, green) will be set at the config by setting the kpi-color property of the contact list configuration object, as in the example above
I do not thing that the icon itself needs to change.
WIch icon will be used will be set in the same config object with the “kpi-icon” property, and on wich contacts the icon should be displayes is controlled by the property 'appliesIf" of the configuration object
If we want to remove the icon for all, we could erase the config object or set appliesIf to false for every contact.

If we have a form, for example, ‘vaccinal_evaluation’ that calculate a variable vaccinal_state (green, yellow, red) from the answers to the form, and a transition that update the contact of this form when a data_record is submited, the vaccinal_sate will change when the contact receives a vaccinal_evaluation and the vaccinal_state will be reflected on the list

Is this scenario you are trying to solve for?

  1. CHW submits a vaccinal_evaluation form where the vaccinal_state = red
  2. CHW receives a task to follow-up on this, but does not visit the household in time before the task disappears
  3. CHW is at the household doing proactive home visits
  4. CHW wants to know if there are any follow-ups they should be doing that they missed

Also… can you provide some examples of what the CHW would do if they saw someone on their list with a red vaccinal_state? Or a green vaccinal_state?

Yes, this is a use case, or maybe the CHW is at the household answering the task of other patient in the household, but I think that a general solution with these two features could have more uses cases not only the vaccinal state, other projects could prefer to use it for getting the state of HIV test, or whatever.

Actions to take by the CHW

  1. If the vaccinal state is green no action will need on the children
  2. If the vaccinal state is yellow she wiil use a “vaccination alert” form, verify the vaccinal cart of the child and remember parents to go to the healh center in the date indicate on the cart, this wont change the vaccinal state
  3. if the vaccinal state is red she wiil verify the vaccinal state with the vaccinal evaluation form, if the child has not gone to the health center to take the vaccins she will refer the child to the health center, the vaccinal_state will be calculate to ‘red’ and the contact’s vaccinal_state will remain red,
    but if the child has gone to the health center and has taken the vaccin, the vacccinal_state calculate variable in the form will be ‘green’ (maybe yellow) and once submited the contact vaccinal_state will change to green and the icon will change to green (maybe yellow)

the form variable will be set to ‘red’ if the child has not taken mandatory vaccins
the form variable will be set to ‘yellow’ if the child has taken the vaccins but the child has to take another vaccin in a few days
the form variable will be set to ‘green’ it the child has taken the vaccins and there are not more vaccins to take or the next vaccin to take is not into a few days

1 Like
  • I assume the actions you listed out are the same actions the CHW would take if they had not missed the task, is that true? Or are these actions different?
  • Is the vaccinal state also in the contact summary or a condition card for the individual?
  • For your project, are there some other concrete examples of how you would use this? (the vaccinal state example is very clear now, thank you)

Yes CHW are using this feature

  • I assume the actions you listed out are the same actions the CHW would take if they had not missed the task, is that true? Or are these actions different?
  • Is the vaccinal state also in the contact summary or a condition card for the individual?

Our team is developping just now the workflow and a contact summary is planned

  • For your project, are there some other concrete examples of how you would use this?

No, we have not planned to use this by now for other project

Hi @bamatic ! Just catching up on this thread and wanted to confirm the problem statement:

Once the CHW is in a household, she could scroll through the list of contacts and visually identify the contacts that need some special action, this is useful specially when the task on that contact has disappeared before being able to go to the family of the patient in question.
It could also be used with places in addition to persons

Could you please give some examples of user stories and scenarios here to help me understand the details of what we are trying to solve for?

One that I’m understanding is that:
As a CHW, I want to identify contacts with tasks that have expired so I can visit the household to perform the action.

Am I understanding correctly, or are there other scenarios or user stories you might add here?

Secondly, how is this problem being addressed in the current config today? Is there a workaround?

Thanks!

Hi thank you for your questions,

Am I understanding correctly, or are there other scenarios or user stories you might add here?

You are right, this is the use case

Secondly, how is this problem being addressed in the current config today? Is there a workaround?

We’re developping a vaccination followup workflow, in the design of this workflow we’ve planned this use case since our CHW have a lot of children in theirs areas, when they are in a household doing a home visit or doing another assessment for other member, it would be great if the CHW can verify for missed tasks by scrolling the user list
We know that from config we can not currently do this so I’ve done this feature request
Untill the feature will be ready we plan to use some info in contact summary but for this the CHW need to tap on each list item in order toenter in the contact détails screen and see if the vaccination_evaluation task is missed, so this is easier to pass over a child with an undone task
Hope this helps.