Merge pull request #34 from billylo1/covishield-as-az

Stop splitting vaccinename so we can detect AZ correctly
This commit is contained in:
Ryan Slobojan 2021-09-30 18:34:54 -04:00 committed by GitHub
commit 2e373857a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

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

View File

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