medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 209 forks source link

Expose certain user metrics from API #8340

Open 1yuv opened 1 year ago

1yuv commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, we collect certain metrics from partner(s) for reporting purpose after partner agree to share those aggregated metrics. Some partner(s) might opt to provide these data and they might have data warehouse, but some may not have. This is the request asking if certain metrics are calculable on CouchDB directly and can be exposed via API. In this case, after having Data usage Agreement with partner(s) we can poll those data directly from API without needing to setup rdbms and have additional resoures used for that purpose.

Describe the solution you'd like Provide following data from API (whichever are possible)

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

garethbowen commented 1 year ago

Because contacts are configurable we can't know for sure what is a "patient" or "household" - would it be sufficient to return the count of contacts grouped by the contact type, which would need some knowledge of context to do the translation, eg:

{
  "contacts": {
    "person": 590,
    "clinic": 15,
    "something": 1
  }
}

I'm assuming "active" in this context is syncing at least one caring activity (data_record)?

1yuv commented 1 year ago

Hi @garethbowen, Yes, contacts grouped by the contact type would be absolutely fine, and probably best.

I'm assuming "active" in this context is syncing at least one caring activity (data_record)?

Yes.

garethbowen commented 1 year ago

Some ideas on the right views to serve these requests...

garethbowen commented 11 months ago

Additional metrics which may be useful...