openimis-be-individual_py

The openimis-be-individual_py module is dedicated to handling individual references within the OpenIMIS system. It provides services and functionalities for managing individual records, including creating, updating, and deleting individual data.

Introduction

The OpenIMIS Backend Individual Reference Module is a crucial component of the OpenIMIS system. This module is dedicated to handling individual references within the system. It provides services, functionalities, and GraphQL queries related to individual and group management. The Individual Reference Module is designed to be deployed as a module of openimis-be_py, the OpenIMIS backend application.

This documentation aims to provide a comprehensive guide on how to utilize, configure, and interact with the Individual Reference Module effectively.

ORM Mapping

The module uses Object-Relational Mapping (ORM) to map data from the database to Python objects. The following ORM mappings are used:

  • individual_individual, individual_historicalindividual -> Individual: Represents an individual entity.

  • individual_individualdataSource, individual_historicalindividualdataSource -> IndividualDataSource: Represents the data source associated with an individual.

  • individual_individualdatasourceupload, individual_historicalindividualdatasourceupload -> IndividualDataSourceUpload: Represents data uploads associated with an individual data source.

  • individual_group, individual_historicalgroup -> Group: Represents a group entity.

  • individual_groupindividual, individual_historicalgroupindividual -> GroupIndividual: Represents the association between a group and an individual.

Developers can access and manipulate individual and group-related data using these mapped objects, which abstract away the underlying database complexities.

individual_orm.png

GraphQL Queries

The module provides several GraphQL queries to retrieve individual and group-related information:

  • individual: Retrieves individual data based on specified criteria.

  • individualDataSource: Retrieves individual data source information based on specified criteria.

  • individualDataSourceUpload: Retrieves individual data source upload information based on specified criteria.

  • group: Retrieves group data based on specified criteria.

  • groupIndividual: Retrieves group-individual association data based on specified criteria.

These GraphQL queries provide a flexible and efficient way to retrieve relevant individual and group data.

GraphQL Mutations

The Individual Reference Module offers GraphQL mutations to manage individual and group data. Each mutation emits default signals and returns standard error lists following the conventions of openimis-be-core_py.

List of available mutations:

  • createIndividual: Creates a new individual record.

  • updateIndividual: Updates an existing individual record.

  • deleteIndividual: Deletes an individual record.

  • createGroup: Creates a new group record.

  • updateGroup: Updates an existing group record.

  • deleteGroup: Deletes a group record.

  • addIndividualToGroup: Adds an individual to a group.

  • editIndividualInGroup: Edits an individual in a group.

  • removeIndividualFromGroup: Removes an individual from a group.

  • createGroupIndividuals: Creates multiple group-individual associations.

These mutations enable seamless management of individual and group data within the OpenIMIS system.

Services

The module provides the following services:

  • IndividualService: Offers methods to create, update, and delete individual records.

  • IndividualDataSourceService: Provides methods to create, update, and delete individual data sources.

  • IndividualDataSourceUploadService: Offers methods to create, update, and delete individual data source uploads.

  • GroupService: Provides methods to create, update, and delete group records.

  • GroupIndividualService: Offers methods to create, update, and delete group-individual associations.

Developers can interact with these services to perform various operations related to individual and group management.

Configuration Options

The behavior of the Individual Reference Module can be customized through configuration options, which can be modified via core.ModuleConfiguration. The available configuration options are:

  • gql_individual_search_perms: Specifies the required rights to call the individual GraphQL query. (Default: ["159001"])

  • gql_individual_create_perms: Specifies the required rights to call the createIndividual GraphQL mutation. (Default: ["159002"])

  • gql_individual_update_perms: Specifies the required rights to call the updateIndividual GraphQL mutation. (Default: ["159003"])

  • gql_individual_delete_perms: Specifies the required rights to call the deleteIndividual GraphQL mutation. (Default: ["159004"])

  • gql_group_search_perms: Specifies the required rights to call the group GraphQL query. (Default: ["180001"])

  • gql_group_create_perms: Specifies the required rights to call the createGroup, addIndividualToGroup, and createGroupIndividuals GraphQL mutations. (Default: ["180002"])

  • gql_group_update_perms: Specifies the required rights to call the updateGroup and editIndividualInGroup GraphQL mutations. (Default: ["180003"])

  • gql_group_delete_perms: Specifies the required rights to call the deleteGroup and removeIndividualFromGroup GraphQL mutations. (Default: ["180004"])

Developers can adjust these options to control access and permissions related to individual and group management operations.

OpenIMIS Modules Dependencies

The Individual Reference Module relies on the following module:

  • core: Provides core functionality and utilities for the OpenIMIS system.

Ensure that the core module is correctly installed and configured for the Individual Reference Module to function properly.

 

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/