Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the sync strategies documentations #3530

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: 'User Assignments'
14 changes: 14 additions & 0 deletions docs/engineering/admin-dashboard/user-assignments/readme.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: User Assignments
---

## User (Practitioner) Assignments
The current user (practitioner) assignment consists of 4 main elements
- **User (Practitioner)** - This is the person using the application to collect data and execute workflows
- **CareTeam** - Caregiving users would be assigned here.
- **Team (Organization)** - Teams would be added to CareTeams as managing organizations.
- **Location** - Teams would be assigned to locations and by doing so, users would be assigned to their workstations.

Every user who is _“correctly”_ assigned as per the current implementation must have at least 1 of each of the 4 elements. These assignment information has an associated effect to how data is [synced down](/engineering/backend/info-gateway/data-sync) to the mobile applications.

These elements are then downloaded to the OpenSRP 2.0 mobile application via the **PractitionerDetail** endpoint. This is a custom endpoint built by the OpenSRP team, it aggregates all the data related to a user and returns as one response.
4 changes: 2 additions & 2 deletions docs/engineering/app/datastore/tagging.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tagging Resources

OpenSRP2 uses `meta.tag` to add additional information to resources for filtering during sycronization and analysis.
OpenSRP 2 uses `meta.tag` to add additional information to resources for filtering during sycronization and analysis.

All tags have the system prefix `https://smartregister.org/` and a system suffix based on the type of codes that they manage.

Expand All @@ -19,7 +19,7 @@ System Suffix|Display|Purpose
`practitioner-tag-id`|Practitioner|This is the Practitioner that is logged into the app when the resource is created.
`location-tag-id`|Practitioner Location|This is the Location linked to the Organization of the Practitioner that is logged into the app when the resource is created.
`organisation-tag-id`|Practitioner Organization|This is the Organization linked to the Practitioner that is logged into the app when the resource is created.
`related-entity-location-tag-id`|Related Entity Location|"Entity" here is a `Patient`, `Group`, Point of Service (as a `Location` resource), or other organizing unit, and this stores the ID of a `Location` resource (or the resource itself if it is a `Location`) lnked to that entity.
`related-entity-location-tag-id`|Related Entity Location|"Entity" here is a `Patient`, `Group`, Point of Service (as a `Location` resource), or other organizing unit, and this stores the ID of a `Location` resource (or the resource itself if it is a `Location`) linked to that entity.

## Example Tags

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Custom Endpoints
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Custom Endpoints
---
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: 'Sync Strategy'
51 changes: 51 additions & 0 deletions docs/engineering/backend/info-gateway/sync-strategy/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Sync Strategies
---

The OpenSRP 2.0 uses **five** key data elements in determining how data is synced down from the server. These elements are used to [**tag**](/engineering/app/datastore/tagging) every resource created by the OpenSRP mobile application, enabling precise synchronization.
The five elements are leveraged to define the OpenSRP sync strategies, ensuring that data is appropriately filtered and delivered to the correct users.

### Sync By Practitioner CareTeam
This strategy syncs data based on the Practitioner CareTeam, ensuring that all relevant resources tagged with a specific care team are synced down for the practitioners assigned to that CareTeam. A sample tag is provided below

```josn
{
"system": "https://smartregister.org/care-team-tag-id",
"code": "47d68cac-306f-4b75-9704-b4ed48b24f76",
"display": "Practitioner CareTeam"
}
```

### Sync By Practitioner Team (Organization)
This sync strategy is based on the Team (Organization), syncing resources related to the specific team (organization) associated with the practitioner.
- This sync strategy also includes data from any CareTeams that have the Organization as a [managing organization](https://hl7.org/fhir/R4B/careteam-definitions.html#CareTeam.managingOrganization). A sample tag is provided below

```josn
{
"system": "https://smartregister.org/organisation-tag-id",
"code": "ca7d3362-8048-4fa0-8fdd-6da33423cc6b",
"display": "Practitioner Organization"
}
```
### Sync By Practitioner Location
Syncs data based on the Location, delivering resources tagged with the Location ID of the Location that the practitioner is assigned to.
- This sync strategy also includes data from all the child locations for the Location the Practitioner is assigned to. A sample tag is provided below

```josn
{
"system": "https://smartregister.org/location-tag-id",
"code": "Not defined",
"display": "Practitioner Location"
}
```
### Sync By Related Entity Location
This strategy uses location information related to other entities (e.g Patient Location, Family (Group) Location, Service point), ensuring that data linked to specific locations associated with those entities is synced.
- This sync strategy also includes data from all the child locations linked to the Related Entity Location. A sample tag is provided below

```josn
{
"system": "https://smartregister.org/related-entity-location-tag-id",
"code": "33f45e09-f96e-41d3-9916-fb96455a4cb2",
"display": "Related Entity Location"
}
```
Loading