Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
A server should be responsible to handle or offer a mechanism to handle errors once data reaches it. (Error handling mechanism is being designed by the platform).
Sync will be manually triggered by the user (except for automatically syncing configuration down on the first login).
Sync down of data is not required to support (good to have) the first rollout.
Sync will be done through bulk APIs.
Sync will send each save action performed by the field user while offline to the server to preserve an audit of actions performed by the field user.
Eg: If a field user registers an individual and saves the record and then goes back to update the individual, this will result in two API calls to the server (one create and one update).
API response compression Gzip will be turned on for all the endpoints.
Unique identifier to be used between client and server:
A Client will create a unique (client-generated) identifier per entity (clientReferenceId) to relate entities while operations are being performed offline and send this id to the server for creating operations.
Any subsequent operations (like update, delete) will be on the server gen id, so the client has to get the server gen id by searching using the client generated id. The client will call search API with clientReferenceId and will get the server generated id.
Client will update the server-generated id into the records on the client and use the server-generated id for subsequent updates for those entities.
Processing on the backend will continue to be asynchronous and not changed for the health use case.
Search API max limit and the default limit.
Service details and endpoints.
Service details and endpoints.
Number of entities sent to the server in bulk API calls
Additional fields per entity in the app.
The drop-down values or select options to be presented in the app for field users.
Configuration changes are expected to be additive for the data captured against such configuration to continue being usable.
Number of retries on API call failure after which the app should stop retrying.
Timeout for the API calls.
Access to data will be defined by the linkages of staff to the project and the corresponding boundary while respecting role-action mappings instead of the tenant-based approach.
All deletes are soft deletes.
The server is responsible to delete nested/child entities if applicable when the parent entity is deleted.
Undeletion is not permitted.
Duplicate updates do not need to be detected or filtered out. The client is responsible to send duplicate updates on entity as separate requests to server.
Since persistence in DIGIT is asynchronous but the sync process from the field worker app is likely to send dependent data in a short period, a cache is to be introduced against which dependent data can be validated if required while it is in the process of being persisted to the DB. This cache is exposed via the search API of the corresponding service and the caller is agnostic to whether the result was returned from the cache or database.
For v1, we can maintain the sequence of updates only for requests on a single entity by a single user. i.e. Updates on the same entity by multiple users will result in the last caller's updates going through.
To maintain the sequence of updates, a rowVersion field is introduced in every entity. Callers pass the rowVersion as received from the server. The server can detect if any out-of-sequence updates have come in and reject it / pass it to the error handling mechanism.
Search APIs will not return (soft) deleted data by default. If deleted data is required the includeDeleted param can be passed to the search APIs.
From the Product requirement perspective, there is no unique identification identifier, so Platform is unable to check the uniqueness of registry entities.
The articles in this section include:
The articles in this section include:
DIGIT is India’s largest open-source platform for digital governance. The health services are built on top of DIGIT. It is built on OpenAPI (OAS 2.0) and provides API-based access to various services, enabling governments to provide health campaign services with relevant new ones. It also facilitates integration with the existing system into the platform and runs seamlessly on any commercial/on-prem cloud infrastructure with scale and speed.
Health DIGIT is a micro-services-based platform that is built to scale. Micro-services are small, autonomous, and developer-friendly services that work together.
It facilitates decentralised control between teams so that its developers strive to produce useful tools that can then be used by others to solve the same problems.
Micro-services have intelligent endpoints that process information and apply logic. They receive requests, process them, and generate a response accordingly.
Parallelism in development: Micro-services architectures are mainly business-centric.
A large software or system can be broken down into multiple small components or services. These components can be designed, developed, and deployed independently without compromising the integrity of the application.
DIGIT Health follows a multi-layer or n-tiered distributed architecture pattern. As seen in the illustration above, there are different horizontal layers with some set of components such as Services, Registries, and DIGIT Core Services. Every layer consists of a set of microservices. Each layer of the layered architecture pattern has a specific role and responsibility within the application. The following are the advantages:
Layered architecture increases flexibility, maintainability, and scalability.
Multiple applications can reuse the components.
Parallelism.
Different components of the application can be independently deployed, maintained, and updated, on different time schedules.
Layered architecture also makes it possible to configure different levels of security to different components.
Layered architecture also helps users test the components independently of each other.
Health Campaign - High Level Design
The high level design is divided into:
Master data
Registries/entities
Reusable DIGIT services
Form engine support
Multi-tenancy
Android offline first app
Web app - Campaign planning + dashboard
External integration - DHIS2
Base Health Campaign on DIGIT Core 2.8.
Master data categorised on the complexity required to maintain them from the technical perspective.
Simple Masters
Roles
Additional field schemas for different entities
Project task configurations
Project type
Role-actions
Actions
Hierarchical Masters
Administrative boundary and hierarchy
Inter-Linking Masters
Field app config
Service registry
New service.
As users are registered to campaigns, populate the individual registry with basic information about them.
This registry is the first step towards the long term plans in DIGIT to move non users of the system away from the User service. However, due to the current dependency on User service for authN and authZ among other things, this registry will be a wrapper over the User service.
New service.
Collection of Individuals living together (potentially receiving shared campaign intervention).
New service.
Needed to model storage Warehouses through which stock moves.
New service.
Needed to model the resources that are distributed as part of projects both as part of stock movement and actual distribution to beneficiaries.
New service.
Models how services and benefits are typically distributed to citizens by governments.
Contains multiple endpoints within the service to map other entities such as beneficiaries, staff, facilities, resources to the projects.
New service.
Track inflow and outflow of stock resources.
Many of the DIGIT-Core services can be reused without any changes. Some of them could be extended and enhanced to support the required features.
digit-mdms-service
Digit-location / boundary service
digit-access-control
Zuul API Gateway
digit-idgen
digit-persister
digit-indexer
digit-localization
DSS
Signed Audit
No existing services being enhanced.
The Health Campaign system does not make heavy use of workflows. Most flows in v1 are single actor and end after a single step (i.e. submitting collected data).
Form engine support was pushing out timelines and has been dropped from v1 scope.
The proposal is to have a single installation to support multiple countries and multiple health campaigns within these countries. Different campaigns will need to share registries.
Leveraging multi tenancy support in DIGIT for this.
Android app is proposed to be modelled on mGramSeva app and will be built in Flutter.
This app will be used in areas with limited or no internet connectivity and hence will need to work while offline. Users will sync the data collected offline when they are in an area with network connectivity.
SQLite will be used to model structured data and ISAR will be used for unstructured data.
Out of scope for v1.
The field workers will need to see dashboards based on the data stored in the offline database. Library - TBD
Out-of-scope for v1.
The app will have some custom screens to capture information around the campaign plan.
DSS dashboards are planned to be leveraged for reporting dashboards.
This will be added to implementation scope.
Description of the attendance service
Attendance service allows users to maintain attendance registers, enrol individuals, create, update or search attendance logs and manage staff permissions.
Base Path: /health-attendance/
Here are the articles in this section:
Here are the articles in this section:
Flutter: Framework to build multi-platform apps
SQLite: SQL offline db
ISAR: NoSQL offline db
Dio: HTTP Client
https://github.com/egovernments/health-campaign-field-worker-app
Needs to work in low/no network coverage areas.
Needs to have a high level of configurability.
Needs to work on Android.
Users of the app have low-tech literacy.
Sync
Since the app is expected to be configurable, there is a need to receive these configurations from the server. Data already on the server might need to be retrieved by the app as well.
Since the app is expected to work while users are offline, there is the need to send data that has been collected while the user has been offline to the server.
These functionalities are collectively called sync. The retrieval of configuration and data is referred to as sync down while the sending of data collected using the app is called sync up. Login and sync can only be done while the user is online.
When a user logs in, a sync down is performed to fetch the required configuration and data for the field app to run. After collecting data using the app, the user can perform a sync which will perform a sync-up (to send all data collected) followed by a sync-down (to retrieve any fresh configuration). Syncing of data down is not required for the initial implementation and can be turned off.
Configurability
Configurations for the field app are managed as master data in the MDMS service. These configurations are used to manage various aspects of how the app functions. The important ones are:
If the app has to run in an offline first mode or an online mode.
The backend interfaces for the app include localisation, MDMS, and various services. This also includes the URLs for the various services and endpoints so that a fresh app build is not required if there is a new version of an API.
How long the client can use each configuration that has been previously fetched before requesting data from the server (to optimise the time taken for sync).
Values/options that need to be displayed in various fields in the app.
Additional fields are to be captured for any of the entities, if any.
Supported languages.
Op Log
Any action to create or update the data performed by the field user while the app is configured to run in the offline first mode is written to an op log. When the user performs a sync, the sync-up action reads from this op log to send the data to the server.
Permission (role-action)-Based Access and Sync
Sync is optimised to fetch configuration relevant to the logged-in user so that only the configuration/data for the actions, permissible to the user within the projects that they are assigned to, are fetched.
Network Manager
The network manager component in the app acts as an interface between the rest of the app and the backend. As a result, the other components in the app do not have to change their behaviour based on whether the app is online or offline and rely on the network manager to handle this complexity. This implies that the network manager makes an API call directly if the app is offline or saves to the local database and the op log if the device is offline, whereas the other components just make a call to the network manager to read/write data.
Down Sync of Beneficiaries
The down sync of beneficiaries feature is designed to optimise data synchronisation between the local device and the server, specifically focusing on the beneficiary records. This process helps prevent duplicate record creation by different users within the same boundary.
The down sync initiates by sending a request to the server, providing the boundary code along with offset and limit parameters. The server validates the provided parameters and responds with the total count of beneficiary records within the specified boundary.
Based on the total count received, the down sync retrieves beneficiary records from the server in batches. The batch size is dynamically adjusted according to the device's internet speed to optimise the data transfer.
The response from the server, containing beneficiary records, is written to the local entities tables on the device. This ensures that the local database stays updated with the most recent beneficiary information.
Key Features
Utilises offset and limit parameters for efficient pagination of data retrieval from the server.
Adapts the batch size based on the internet speed to enhance the overall synchronisation performance.
Essential for avoiding the creation of duplicate beneficiary records by different users within the same boundary.
Use Case
The down-sync of beneficiaries is particularly crucial in scenarios where multiple users operate within the same geographical boundary. It ensures that each user has access to the latest beneficiary data while minimising redundant record creation.
Multi-Round Campaign
The multi-round campaign streamlines beneficiary registration and delivery processes, ensuring efficient tracking of eligibility and delivery statuses across multiple cycles.
The system fetches the projectType configuration from MDMS for the selected project.
Eligibility checks are dynamically performed based on the retrieved projectType configuration.
The minimum and maximum age criteria are evaluated to determine the beneficiary's eligibility for the current cycle.
Recorded side-effects for the beneficiary in the current cycle.
There is no cycle defined in the MDMS configuration for the selected project on the current date.
Status Tracking
Not Eligible:
The minimum and maximum age criteria are evaluated to determine the beneficiary's eligibility for the current cycle.
Recorded side effects for the beneficiary in the current cycle.
There is no cycle defined in the MDMS configuration for the selected project on the current date.
Beneficiary Refused: Indicates that the beneficiary refused to accept the delivery in the current cycle.
Beneficiary Referred: Indicates that the beneficiary was referred to a health facility during the current cycle.
Visited: Indicates that a delivery was successfully made for the beneficiary in the current cycle.
Not Visited: Indicates that no delivery was made for the beneficiary in the current cycle.
Beneficiary Refused, Beneficiary Referred, and Not Eligible status, except the age eligibility, will target reset every new cycle.
Init App
Login
Sync Down