From 555308e97f621acb519f24ccabf01eeeb4fcf69e Mon Sep 17 00:00:00 2001 From: inportb Date: Sat, 1 Oct 2022 01:36:13 -0400 Subject: [PATCH] Improved lab report edge case parsing --- htdocs/reportparser.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/reportparser.mjs b/htdocs/reportparser.mjs index 91ab80a..67a0d8a 100644 --- a/htdocs/reportparser.mjs +++ b/htdocs/reportparser.mjs @@ -53,10 +53,7 @@ function lab_parse1default(data) { else x.comment = [line.substring(12)]; } else console.log('DANGLING:', line); } else if(m = line.match(/^\b(?.*?)\s{2,}(?.*?)(?: (?L\*|L|H\*|H))?\s+(?:(?.{10}) (?.*?)(?: \[(?\d+)\])?)?$/)) { - if(m.groups.name.startsWith('COVID-19 SCR (CEPHEID-RAPID)')) { - m = line.substring(28).match(/^(?.*?)(?: (?L\*|L|H\*|H))?\s+(?:(?.{10}) (?.*?)(?: \[(?\d+)\])?)?$/); - m.groups.name = 'COVID-19 SCR (CEPHEID-RAPID)'; - } + if(x = line.match(/^\b(?.*?)(?(?:positive|negative|reactive|not detected|collected - specimen in lab|test not performed))(?: (?L\*|L|H\*|H))?\s+(?:(?.{10}) (?.*?)(?: \[(?\d+)\])?)?$/i)) m = x; if((m.groups.range) && (m.groups.range.startsWith('Ref: '))) m.groups.range = m.groups.range.substring(5); results.push(x = m.groups); if((x.value === '') && (m = x.name.match(/^(?.*?)(?(?:[\d\.]+|positive|negative|reactive|not detected|collected - specimen in lab|test not performed))\s*$/i))) {