G2PRegisterDefinition

g2p_register_definitions - the principal metadata information on Registers

This table - g2p_register_definitionsarrow-up-right - stores the core metadata definition for all register types within the platform.

Every dataset in the registry—whether it is a REGISTER, TABLE, or PROGRAM_REGISTER—must have a corresponding entry in this table.


Core Attributes

Attribute
Description

register_id

Primary key of the table. Uniquely identifies a register definition.

register_mnemonic

Short name for the register. This is a critical configuration field. The platform dynamically derives the underlying models, history models, and service classes based on this mnemonic.

register_subject

A short label describing the subject or entity represented by the register.

register_description

A detailed description of the purpose of the register.


Dynamic Class Resolution

The platform dynamically constructs class names based on the register_mnemonic.

Component
Derived Class

ORM Model

G2PRegister{Mnemonic}

History Model

G2PRegisterHistory{Mnemonic}

Service Class

G2PRegisterService{Mnemonic}

For example, if the register mnemonic is Farmer, the platform will resolve:

Type
Derived Class

ORM Model

G2PRegisterFarmer

History Model

G2PRegisterHistoryFarmer

Service Class

G2PRegisterServiceFarmer

This mechanism allows the platform to load domain-specific implementations dynamically.


Register Hierarchy Configuration

Attribute
Description

master_register_id

Defines hierarchical relationships between registers and tables.

For example:

Register
Master Register

Household Register

None

Individual Register

Household Register

Subscriptions Table

Individual Register

This hierarchy enables the platform to understand parent-child relationships between datasets.


Register Display Configuration

Attribute
Description

register_rank

Determines the order in which registers appear in UI dropdowns. Registers with a lower rank value appear higher in the list.

register_icon

UI icon associated with the register.

has_image

Indicates whether records in the register include image attributes.


Register Type Configuration

Attribute
Description

register_purpose

Specifies the classification of the register. Possible values include: REGISTER, TABLE, and PROGRAM_REGISTER.


Program Register Configuration

These fields are applicable only when the register type is PROGRAM_REGISTER.

Attribute
Description

program_id

Identifier of the benefit program associated with the program register.

program_mnemonic

Short mnemonic representing the benefit program.

This configuration links the register with the Program and Benefit Management System (PBMS).


Deduplication Configuration

The platform supports record de-duplication during data entry or change requests.

Attribute
Description

dedup_is_enabled

Indicates whether deduplication should be applied to the register.

dedup_threshold_score

Defines the threshold score used by the deduplication algorithm to classify records as potential duplicates.

The specific attributes used for deduplication are defined as a JSON configuration in the table:

g2p_register_schemasarrow-up-right

The deduplication process typically runs during change request processing, where newly submitted records are compared against existing records to identify potential duplicates.

Reference Implementation

A reference implementation of the register metadata configuration can be found in the Farmer Registry extension.

The SQL script that initializes the g2p_register_definition table and other registry metadata is available in the OpenG2P Registry Extensions repositoryarrow-up-right — Farmer Extension.

The g2p_register_definition database script for Farmer Registry is available herearrow-up-right.

Last updated

Was this helpful?