From 062859ae2bf8cad5d7a01870a2209ecf52b4b98a Mon Sep 17 00:00:00 2001 From: Benjamin Mwalimu Date: Wed, 2 Oct 2024 23:55:35 +0300 Subject: [PATCH] - Adding the sync strategies documentations --- .../user-assignments/_category_.yml | 1 + .../user-assignments/readme.mdx | 14 +++++ docs/engineering/app/datastore/tagging.mdx | 4 +- .../custom-endpoints/_category_.yml | 1 + .../info-gateway/custom-endpoints/readme.mdx | 3 ++ .../readme.mdx} | 0 .../info-gateway/sync-strategy/_category_.yml | 1 + .../info-gateway/sync-strategy/readme.md | 51 +++++++++++++++++++ 8 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 docs/engineering/admin-dashboard/user-assignments/_category_.yml create mode 100644 docs/engineering/admin-dashboard/user-assignments/readme.mdx create mode 100644 docs/engineering/backend/info-gateway/custom-endpoints/_category_.yml create mode 100644 docs/engineering/backend/info-gateway/custom-endpoints/readme.mdx rename docs/engineering/backend/{info-gateway.mdx => info-gateway/readme.mdx} (100%) create mode 100644 docs/engineering/backend/info-gateway/sync-strategy/_category_.yml create mode 100644 docs/engineering/backend/info-gateway/sync-strategy/readme.md diff --git a/docs/engineering/admin-dashboard/user-assignments/_category_.yml b/docs/engineering/admin-dashboard/user-assignments/_category_.yml new file mode 100644 index 0000000000..781a96c7e8 --- /dev/null +++ b/docs/engineering/admin-dashboard/user-assignments/_category_.yml @@ -0,0 +1 @@ +label: 'User Assignments' diff --git a/docs/engineering/admin-dashboard/user-assignments/readme.mdx b/docs/engineering/admin-dashboard/user-assignments/readme.mdx new file mode 100644 index 0000000000..91ef542601 --- /dev/null +++ b/docs/engineering/admin-dashboard/user-assignments/readme.mdx @@ -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. \ No newline at end of file diff --git a/docs/engineering/app/datastore/tagging.mdx b/docs/engineering/app/datastore/tagging.mdx index 0690ca00f6..21e98b53d9 100644 --- a/docs/engineering/app/datastore/tagging.mdx +++ b/docs/engineering/app/datastore/tagging.mdx @@ -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. @@ -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 diff --git a/docs/engineering/backend/info-gateway/custom-endpoints/_category_.yml b/docs/engineering/backend/info-gateway/custom-endpoints/_category_.yml new file mode 100644 index 0000000000..e7b4d7e285 --- /dev/null +++ b/docs/engineering/backend/info-gateway/custom-endpoints/_category_.yml @@ -0,0 +1 @@ +label: Custom Endpoints diff --git a/docs/engineering/backend/info-gateway/custom-endpoints/readme.mdx b/docs/engineering/backend/info-gateway/custom-endpoints/readme.mdx new file mode 100644 index 0000000000..db88ed4168 --- /dev/null +++ b/docs/engineering/backend/info-gateway/custom-endpoints/readme.mdx @@ -0,0 +1,3 @@ +--- +title: Custom Endpoints +--- \ No newline at end of file diff --git a/docs/engineering/backend/info-gateway.mdx b/docs/engineering/backend/info-gateway/readme.mdx similarity index 100% rename from docs/engineering/backend/info-gateway.mdx rename to docs/engineering/backend/info-gateway/readme.mdx diff --git a/docs/engineering/backend/info-gateway/sync-strategy/_category_.yml b/docs/engineering/backend/info-gateway/sync-strategy/_category_.yml new file mode 100644 index 0000000000..cd6c6b8681 --- /dev/null +++ b/docs/engineering/backend/info-gateway/sync-strategy/_category_.yml @@ -0,0 +1 @@ +label: 'Sync Strategy' diff --git a/docs/engineering/backend/info-gateway/sync-strategy/readme.md b/docs/engineering/backend/info-gateway/sync-strategy/readme.md new file mode 100644 index 0000000000..99168f162c --- /dev/null +++ b/docs/engineering/backend/info-gateway/sync-strategy/readme.md @@ -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" + } +```