Stop splitting vaccinename so we can detect AZ correctly

* Because we were splitting on space, "COVID-19 COVISHIELD"  was being converted to
  just "COVID-19" which broke AZ detection for Covishield
This commit is contained in:
Ryan Slobojan 2021-09-30 18:27:20 -04:00
parent 1db3095ec1
commit 75c25c1c5b
2 changed files with 1 additions and 6 deletions

View File

@ -58,8 +58,7 @@ export class Payload {
vaccineNameProper = 'Pfizer (Comirnaty)'
if (vaccineName.includes('MODERNA'))
vaccineNameProper = 'Moderna (SpikeVax)'
// vaccineNameProper = 'Pfizer (Comirnaty)'
vaccineNameProper = 'Moderna (SpikeVax)'
if (vaccineName.includes('ASTRAZENECA') || vaccineName.includes('COVISHIELD'))
vaccineNameProper = 'AstraZeneca (Vaxzevria)'

View File

@ -120,8 +120,6 @@ async function loadPDF(signedPdfBuffer : ArrayBuffer): Promise<HashTable<Receipt
}
return Promise.reject(e);
}
}
async function getPdfDetails(fileBuffer: ArrayBuffer): Promise<HashTable<Receipt>> {
@ -152,7 +150,6 @@ async function getPdfDetails(fileBuffer: ArrayBuffer): Promise<HashTable<Receipt
}
if (value.includes('Product name')) {
vaccineName = (content.items[i+1] as TextItem).str;
vaccineName = vaccineName.split(' ')[0];
}
if (value.includes('Date of birth'))
dateOfBirth = (content.items[i+1] as TextItem).str;
@ -169,5 +166,4 @@ async function getPdfDetails(fileBuffer: ArrayBuffer): Promise<HashTable<Receipt
Sentry.captureException(e);
return Promise.reject(e);
}
}