patient-mini/test_bultra_parser.js
@zuopngfei 746614c2cc dsdd
2025-08-04 18:11:46 +08:00

34 lines
834 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 测试B超报告解析功能
import { parseBUltraReportText } from './api/BOcr.js';
// 测试数据
const testText = `上海复旦大学儿科医院
阴道屈笼中儿童 B秒
肝肋下: 32mm
肝剑突下: 42mm
肝回声
门静脉流速: 15.5cm/s
肝回声
肝性性形影像像最大数字: 10.5ka
肝回声
肝性性形影像像中测数字: 25.5ka
门静脉主干内径: 4.5mm
门静脉主干内径: 6.5mm
胆囊大小: 15.5mm×5.5mm
胆囊大小: 21mm×11mm
膀肋下: 未触及
膀总管: 显示不清
膀性声像:`;
// 执行解析
const result = parseBUltraReportText(testText);
// 输出结果
console.log('解析结果:');
console.log(JSON.stringify(result, null, 2));
// 验证结果
console.log('\n验证结果:');
result.forEach((item, index) => {
console.log(`${index + 1}. ${item.name}: ${item.value}`);
});