HCM-MOZ-IMPL SERVICE API Documentation

HCM-MOZ-IMPL SERVICE

The Ingestion APIs are for Boundary, Project, facility, and User ingestion. We do the initial setup for any health campaign using these APIs.

Requirements:

  1. Prior Knowledge of Java/J2EE.

  2. Prior Knowledge of Spring Boot.

  3. Prior Knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.

  4. Prior knowledge of Git.

  5. Advanced knowledge on how to operate JSON data would be an added advantage to understand the service.

Keys:

Boundary: An area for a campaign. We divide the entire area into smaller sections called boundaries.

Project: A project, in this context, refers to a campaign. For each boundary, a new project needs to be created. Each project should include start and end dates of the campaign, targets (such as households, individuals, and products), boundary information (including hierarchy details), and a reference to the parent project.

Facility: In our context, 'facility' equates to a 'warehouse.' The warehouse serves as the storage location for products utilized in the campaign. Warehouses can be categorized into two types: permanent or satellite (temporary). All of this information is derived from the microplan

facilityIngestionFlow.png

User: User refers to all members that come one in the DIGIT platform.

UserIngestionFlow.png

  1. Event History: The Event History table contains all the information related to errors encountered during the ingestion process.

  2. Job Record: This table stores information about all jobs that have started and successfully completed the ingestion process..

 

Functionalities:

ingest/v1: This introduces functionality to take the file store ID and perform ingestion based on the ingestion type (Boundary, Project, Facility, User). Internally, it calls the file store service to retrieve the Excel data..

 

Search data: The Ingestion service provides two search APIs: eventHistory and jobRecord search. Both search APIs are fully backward compatible..

 

 

API Details:

Endpoint 1: Boundary Ingestion

  • Path: /hcm-moz-impl/v1/dhis2/boundary/ingest

  • Description: Takes RequestInfo and a CSV file in the request body as form-data. Generates boundaries based on the file and stores the data in GitHub.

Endpoint 2: Project Ingestion

  • Path: /hcm-moz-impl/v1/dhis2/project/ingest

  • Description: Accepts RequestInfo and a CSV file in the request body as form-data. Creates a project for each boundary specified in the file.

Endpoint 3: User Ingestion

  • Path: /hcm-moz-impl/v1/dhis2/users/ingest

  • Description: Requires RequestInfo and a CSV file in the request body as form-data. Internally calls the HRMS service to create all users.

Endpoint 4: Facilities Ingestion

  • Path: /hcm-moz-impl/v1/dhis2/facilities/ingest

  • Description: Takes RequestInfo and a CSV file in the request body as form-data. Internally calls the facility service to create both temporary and permanent facilities.

Endpoint 5: Comprehensive Ingestion

  • Path: /hcm-moz-impl/v1/ingest

  • Description: Takes RequestInfo in the request body and ingestion type, along with file store ID as parameters. Internally triggers all ingestion processes (Boundary, Project, Facility, User) based on the specified ingestion type. Additionally, calls the file store service to fetch the file using the file store ID for further ingestions.

Endpoint 6: Event History Search

  • Path: /hcm-moz-impl/v1/eventHistory/_search

  • Description: A backward-compatible API that accepts RequestInfo in the request body and job ID as parameters. Returns a list of all objects sharing the same job ID.

Endpoint 7: Job Record Search

  • Path: /hcm-moz-impl/v1/jobrecord/_search

  • Description: Other backward-compatible API that takes RequestInfo and IngestionSearchCriteria in the request body. It returns data based on the provided search criteria, considering order, record count, and offset as additional parameters.

Endpoint 8: Reset Table

  • Path: /hcm-moz-impl/v1/_reset

  • Description: This is the API that reset the eg_dhis2_boundary table and eg_digit_mapping table.

Postman Collection for Ingestion APIs:

https://drive.google.com/file/d/11RIsyeqwzR8zasuKnK6QZJDprLikRk6n/view?usp=sharing