# UHC mode not working for Supervisors in v3.7.x

**URL:** <https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541>\
**Category:** Technical Support\
**Tags:** uhc\
**Created:** [November 2, 2021, 9:30am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541 "2021-11-02T09:30:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kymoraa](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kymoraa/32/942_2.png) [@Kymoraa](https://forum.communityhealthtoolkit.org/u/Kymoraa)\
**Post date:** [November 2, 2021, 9:30am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/1 "2021-11-02T09:30:20Z")

</div>

**Describe the Bug**  
We recently migrated to cht-core v3.7.1 in Uganda and we have noted that the UHC mode is not working for supervisors as it did in the previous v3.6.x which we were running.  
The doc on setting up UHC mode permissions here [Configuring UHC Mode | Community Health Toolkit](https://docs.communityhealthtoolkit.org/apps/guides/forms/uhc-mode/) does make a point to note that it is usually for CHWs.  
However, by setting up permissions like below;

```auto
"can_view_last_visited_date": [
      "district_admin",
      "branch_manager"
    ]

```

and also specifying the `visited_contact_uuid` within the chp\_visit form, we were able to have this visited date/count metric tracked whenever the supervisor conducted a chp visit on a CHW Area.

With the same configuration, the visited date/count metric is not visible in v3.7.1

**How To Reproduce The Issue**

1. Configure the UHC mode permissions on the app\_settings and the chp\_visit form
2. Push the settings and forms to an instance running on cht-core v3.7.x
3. Log in as a supervisor
4. Submit a chp\_visit form

**Expected Behavior**  
The visited count and date should be displayed on the CHW Area

**Screenshots**  
This is a screenshot of a supervisor who has just submitted a chp\_visit for on v3.6.x  
Visited date updated to today, count = 1

 ![Screenshot 2021-11-02 at 11.22.21](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/7d99c1653845acb47d2760f25f7f12517818b983.png)

Below, the same supervisor. A number of chp\_visit forms submitted.

 ![Screenshot 2021-11-02 at 12.28.20](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/4/4684cdeca452e023d464fed3dadf4fdf0c1e2db4.png)

Note that, in the report, the `visited_contact_uuid` is however being captured.

 ![Screenshot 2021-11-02 at 12.28.59](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/e24b4f02eefccc37b4bb1041d4e8293b90a9c884.png)

**Environment**

- Browser: Chrome
- Client platform: MacOS
- Version: 3.7.1

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [November 2, 2021, 9:43am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/2 "2021-11-02T09:43:20Z")

</div>

Hi @Kymoraa

Is UHC mode working for users with other roles?  
With 3.7 and configurable hierarchies, in order for a contact\_type to support visit counts, it needs to have a truthy `count_visits` property. Like this: [cht-core/config/default/app\_settings.json at master · medic/cht-core · GitHub](https://github.com/medic/cht-core/blob/master/config/default/app_settings.json#L323)

---

<div class="post-metadata">

**Author:** ![Kymoraa](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kymoraa/32/942_2.png) [@Kymoraa](https://forum.communityhealthtoolkit.org/u/Kymoraa)\
**Post date:** [November 2, 2021, 11:19am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/3 "2021-11-02T11:19:26Z")

</div>

Thank you for your response @diana

Yes, on the same v3.7.1, the UHC mode works for VHT Members (CHW). It is configured on the home\_visit form. When it is submitted, one is able to track this count. See screenshot below.

 ![Screenshot 2021-11-02 at 14.11.47](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/76c53beb7c66d6fc8f31762607ce6eec37b34e28.png)

I have noted that there are differences in the app\_settings that we are using and the one you shared.  
We currently don’t have the bit on this

> “contact\_types”: […]

which you have shared in your reply. Among other parts as well… 🤔

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [November 2, 2021, 11:25am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/4 "2021-11-02T11:25:21Z")

</div>

Please take the default configuration for 3.7.x as a sample: [cht-core/config/default/app\_settings.json at 3.7.x · medic/cht-core · GitHub](https://github.com/medic/cht-core/blob/3.7.x/config/default/app_settings.json#L298)

By default, visits are only counted for contacts of type “clinic” (as can be seen here: [cht-core/config/default/app\_settings.json at 3.7.x · medic/cht-core · GitHub](https://github.com/medic/cht-core/blob/3.7.x/config/default/app_settings.json#L334)).

From your screenshots, I can tell this is working. Supervisors, however, see another contact type in their list (health\_center?). Can you try enabling `count_visits` for health centers as well?

---

<div class="post-metadata">

**Author:** ![Kymoraa](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kymoraa/32/942_2.png) [@Kymoraa](https://forum.communityhealthtoolkit.org/u/Kymoraa)\
**Post date:** [November 2, 2021, 11:43am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/5 "2021-11-02T11:43:41Z")

</div>

Okay. Let me do that and I will get back to you.  
Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Kymoraa](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/kymoraa/32/942_2.png) [@Kymoraa](https://forum.communityhealthtoolkit.org/u/Kymoraa)\
**Post date:** [November 4, 2021, 10:41am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/6 "2021-11-04T10:41:48Z")

</div>

Hello @diana  
Update on the issue. Using the default configurations suggestion for v3.7.x and adding `count_visits` for health centers enabled this mode for the Supervisors. Thank you

---

<div class="post-metadata">

**Author:** ![sheila\_abby](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sheila_abby/32/1320_2.png) [@sheila\_abby](https://forum.communityhealthtoolkit.org/u/sheila_abby)\
**Post date:** [May 4, 2022, 9:46am UTC](https://forum.communityhealthtoolkit.org/t/uhc-mode-not-working-for-supervisors-in-v3-7-x/1541/7 "2022-05-04T09:46:20Z")

</div>

@jonathan Updating the app\_settings.json file - configurable hierarchy suggestion BUT still maintaining the current hierarchy structure on v3.13 and adding `count_visits` for health centers enabled the UHC mode for the Supervisors.  
Thanks for the support! Works!

However, we need to update the contact creation workflows, e.g clinic create, health\_center-create as documented here

> <https://github.com/medic/medic-docs/blob/master/configuration/forms.md>
