Community Health Toolkit

Is it OK to have multiple user-settings associated to the same contact_id / facility_id combo?

I’ve identified several cases in a v3.4 environment where a place/contact combo has multiple user-settings associated to it. See the screenshot below for an example of this.

  • Is this common?
  • Will this configuration cause any problems?
  • Should it be allowed?
  • What are some scenarios where this might be useful?

2 Likes

Having multiple user-settings with the same facility_id is supported. The facility_id isn’t well named any more but it’s essentially the place in the hierarchy below which you are allowed to see data. So in this case user1 and user2 can both see data at the district_hospital.

However, having multiple user-settings with the same contact_id is probably not safe. The contact_id is used for assigning a report or contact to the person that created them. In this case reports created from either users will have contact: { _id: '123' } and it will not be clear who actually filed the report. I can’t think of a valid use case for this setup, and it is not currently supported. I don’t think it will cause any problems other than not being able to work out who did what from the data.

1 Like

Thanks. If it’s not currently supported and will prevent us from knowing who submitted the report, is it worth preventing this configuration from happening?

1 Like

Yes I think so - please report it in github.

2 Likes

Follow along here: https://github.com/medic/cht-core/issues/6074

1 Like