Registration integration
In the OpenCRVS UI, when a registrar clicks the "Register" button on a fully complete and validated declaration, the legal authority has been given to create a birth registration. It is then possible to integrate with a National ID system, both synchronously and asynchronously.
Synchronous integration - birth & death
Once internal audit has taken place of that action in the "workflow" microservice, the following endpoint in the configurable countryconfig microservice is called while the registration is in a WAITING_VALIDATION status:
/trigger/events/${Event.id}/actions/${ActionType.REGISTER}`Refer to our default and MOSIP example.
The JWT token that is sent to this payload should be used to communicate back with OpenCRVS using a client from our toolkit: import { createClient } from '@opencrvs/toolkit/api'
In our example we create a birth / death registration number at this point and return the amended payload to OpenCRVS. Any interaction with a National ID system can take place here.
You can access properties of the declaration and the submitting user (via pendingAction) to perform logical decision making like so:
export async function onBirthActionHandler(
request: ActionConfirmationRequest,
h: Hapi.ResponseToolkit
) {
const token = request.auth.artifacts.token as string
const event = request.payload
const pendingAction = getPendingAction(event.actions)
const declaration = deepMerge(
aggregateActionDeclarations(event),
pendingAction.declaration
)
/*
declaration['child.dob']
declaration['mother.nid']
declaration['mother.verified'] !== 'authenticated'
*/Using the JWT, you can process your integration and respond to OpenCRVS as you wish, progressing the declaration to a REGISTERED or REJECTED status accordingly.
Aynchronous integration - birth & death
It is possible to use the same endpoint asynchronously. But first, you must configure an in-external-validation workqueue in your worqueueConfig and ensure that the correct users have permission to view the workqueue in roles.ts.
workqueueConfig.ts
roles.ts
This configuration setting enables a work-queue "In external validation" that can hold records in a WAITING_VALIDATION status until an asynchronous process completes.

The JWT token that is sent to countryconfig must be stored by your asynchronous process in order to communicate back with OpenCRVS. In our MOSIP example, it is stored in an SQLite DB.
Last updated