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 defaultarrow-up-right and MOSIParrow-up-right example.

circle-exclamation

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.

circle-info

Based on your own business rules based on submitted bio/demographics, such as age of child / parents IDs authenticated, you need to decide whether or not to interoperate with National ID, continue to register or reject the declaration.

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 REGISTEREDarrow-up-right or REJECTEDarrow-up-right 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 worqueueConfigarrow-up-right and ensure that the correct users have permission to view the workqueue in roles.tsarrow-up-right.

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.

triangle-exclamation

Last updated