refactor: Clean up OCR debug table structure and remove redundant regex checks
This commit is contained in:
@@ -272,21 +272,21 @@
|
||||
<strong>Samples:</strong> ${debug.processedSamples}/${debug.totalSamples} · <strong>Flagged series:</strong> ${debug.flaggedSeriesCount}
|
||||
</div>
|
||||
${sampleRows ? `
|
||||
<div class="table-responsive ocr-debug-table-wrap">
|
||||
<table class="table table-sm align-middle ocr-debug-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Series UID</th>
|
||||
<th>File</th>
|
||||
<th>Result</th>
|
||||
<th>Match reasons</th>
|
||||
<th>OCR preview</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${sampleRows}</tbody>
|
||||
</table>
|
||||
</div>
|
||||
` : ""}
|
||||
<div class="table-responsive ocr-debug-table-wrap">
|
||||
<table class="table table-sm align-middle ocr-debug-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Series UID</th>
|
||||
<th>File</th>
|
||||
<th>Result</th>
|
||||
<th>Match reasons</th>
|
||||
<th>OCR preview</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${sampleRows}</tbody>
|
||||
</table>
|
||||
</div>
|
||||
` : ""}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -754,13 +754,6 @@
|
||||
return getOcrPhiReasons(text).length > 0;
|
||||
}
|
||||
|
||||
return /(ref|rk9|rh8|ra9|rbz|rba)\d+/i.test(value)
|
||||
|| /\b\d{3}[\s-]?\d{3}[\s-]?\d{4}\b/.test(value)
|
||||
|| /\b\d{10}\b/.test(value)
|
||||
|| /\b\d{6,8}\b/.test(value)
|
||||
|| /\b(?:dob|d\.o\.b|birth|born)\b/.test(value);
|
||||
}
|
||||
|
||||
function buildOcrSamples(records) {
|
||||
const includeRecords = records.filter((record) => record.include);
|
||||
const seriesMap = {};
|
||||
|
||||
Reference in New Issue
Block a user