Search…
Step 2: Configure the QR code content
The template for the QR code generation is provided here under vaccination-context. The QR code structure must match the vaccination-context. Any updates made in the QR code content must reflect in the vaccination-context.js file.
Steps:
a. Open the file main.js.
b. Go to the function transformW3 and add the fields according to your requirement. This function will read the data received from the certificate generation API call and convert it into QR code Json format.
1
function transformW3(cert, certificateId) {
2
const certificateType = R.pathOr('', ['meta', 'certificateType'], cert);
3
const namespace = certificateType === CERTIFICATE_TYPE_V3 ? CERTIFICATE_NAMESPACE_V2 : CERTIFICATE_NAMESPACE;
4
const recipientIdentifier = R.pathOr('', ['recipient', 'identity'], cert);
5
const preEnrollmentCode = R.pathOr('', ['preEnrollmentCode'], cert);
6
const recipientName = R.pathOr('', ['recipient', 'name'], cert);
7
const recipientGender = R.pathOr('', ['recipient', 'gender'], cert);
8
const recipientNationality = R.pathOr('', ['recipient', 'nationality'], cert);
9
const recipientParentName = R.pathOr('', ['recipient', 'parentName'], cert);
Copied!
c. Add the newly-added field to the data variable
1
let data = {
2
namespace, recipientIdentifier, preEnrollmentCode, recipientName, recipientGender, recipientDob, recipientAge, recipientNationality, recipientParentName, recipientAddressLine1, recipientAddressLine2, recipientAddressDistrict, recipientAddressCity, recipientAddressRegion, recipientAddressCountry, recipientAddressPostalCode,
3
issuer, issuanceDate, evidenceId, InfoUrl, feedbackUrl,
4
certificateId, batch, vaccine, icd11Code, prophylaxis, manufacturer, vaccinationDate, effectiveStart, effectiveUntil, dose, totalDoses,
5
verifierName,
6
facilityName, facilityAddressLine1, facilityAddressLine2, facilityAddressDistrict, facilityAddressCity, facilityAddressRegion, facilityAddressCountry, facilityAddressPostalCode
7
};
Copied!
Note:
Certain constant values are also listed in the main.js. If you want to update any of the constant values such as “certificate controller,” please refer to the DockerFile.
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Export as PDF
Copy link
Edit on GitHub