Registration integration
Using MOSIP's Packet Manager API for asynchronous integration at the point of registration
Asynchronous integration
handler: async (request, h) => {
const url = env.isProd ? 'http://mosip-api:2024' : 'http://localhost:2024'
const result = await verify({ url, request })
const bundle = request.payload as fhir3.Bundle
if (shouldForwardToIDSystem(request.payload as fhir3.Bundle, result)) {
const payload =
getEventType(bundle) === 'BIRTH'
? fhirBirthToMosip(bundle)
: fhirDeathToMosip(bundle)
logger.info(
'Passed country specified custom logic check for id creation. Forwarding to MOSIP...'
)
return mosipRegistrationHandler({
url,
headers: request.headers,
payload
})(request, h)
} else {
logger.info(
'Failed country specified custom logic check for id creation. Bypassing id system...'
)
return eventRegistrationHandler(request, h)
}
}shouldForwardToIDSystem
fhirBirthToMosip / fhirDeathToMosip
mosipRegistrationHandler
confirmRegistration mutation on MOSIP WebSub credential issuance
Last updated