Feature testing: Offline User Replace

With Allies’ effort of Bulk User Upload being a success (shipping in 3.16!), we’re excited at to solve a problem all CHWs and Supervisors face at some point: when you have zero connectivity, how do you replace a CHW?

In our research, we found that sometimes Supervisor will hand the phone to another CHW. This results in poor data continuity - you can not tell which CHW gave care when and reporting/targets will be inaccurate.

Our solution is for Supervisors to submit a new CHW form protected by a PIN only the Supervisor knows, but will leverage entirely offline validation of the PIN. Filling out the form takes just a few minutes, and the new CHW can start giving care immediately, training aside. They may continue using the phone entirely offline for days, weeks or months.

The magic happens when the new CHW goes to sync next. When they do, the CHT will:

  1. Upload all documents for both old and new CHWs
  2. Note the presence and time stamp of the new CHW form
  3. Create a new user for the new CHW based on the information in the form. They will be in the same place in the hierarchy and have the same role as the old CHW.
  4. For any documents submitted after new CHW form, re-parent them to the new CHW contact to maintain accurate ownership and reporting.
  5. Log out the old CHW and promptly send the new CHW a Magic Link via SMS to immediately log them back in as their new user.

We normally release code in a Feature Release (FR), but we instead have a “Beta 0” to demo today which comes before a traditional Beta 1 FR. For those that like to test the bleeding edge, see this the public GitHub ticket. For the rest of you, here’s a video showing the feature in action below.

Please post any comments or questions here. Next week I’ll update this post with how to test this in a Feature Release - stay tuned!



This is a massively useful feature - and I cannot wait to get a go ahead to share this with our partners. I did not see the execution of the magic link - which i suppose also implies the existence of an SMS gateway (this is not currently set up for the partners I have in mind).

@brian - Yay! I’m so glad to hear this feature is well received - thanks for the validation.

You are correct in assuming an SMS gateway is set up for sending the token login links. With the ease at which something like RapidPro can be setup, we’re hopeful SMS gateways will be more common in current and future deployments. Having an out of band method to log in a CHW is a powerful tool!

You are also correct in that there is currently no other option to log the user in when an SMS gateway. As we get closer to validating the Feature Release as a success and thus merging it to master, we’ll have to account for what happens when Token Login is not an option. Excellent point - thank you!

Hi @mrjones, this is indeed a great step towards simplifying user management. When we retire a CHV in our project, we normally add a flag in their couch doc to indicate that they have retired. In addition, we capture the retirement reason.

  1. Could that be something that could be captured via UI?
  2. Also, will the profile of the replaced CHV be greyed out to indicate that they are inactive?