fix: harden sentinel quick verify findings
This commit is contained in:
@@ -1187,17 +1187,37 @@ function safeDetailValue(value) {
|
||||
|
||||
function checkDisplay(item) {
|
||||
const rawCode = rawCheckCode(item);
|
||||
const registered = checkDisplayCatalog[rawCode];
|
||||
if (registered) return registered;
|
||||
const rawId = rawFindingId(item);
|
||||
const registered = checkDisplayCatalog[rawId] || checkDisplayCatalog[rawCode];
|
||||
const serviceCode = displayCheckCode(item?.checkCode || item?.check?.code);
|
||||
if (registered) {
|
||||
return {
|
||||
...registered,
|
||||
code: serviceCode || registered.code,
|
||||
title: safeUserText(item?.checkTitleZh || item?.check?.titleZh) || registered.title,
|
||||
summary: safeUserText(item?.checkSummaryZh || item?.summary || item?.evidenceSummary || item?.check?.summaryZh) || registered.summary,
|
||||
};
|
||||
}
|
||||
return {
|
||||
code: stableCheckCode(rawCode),
|
||||
code: serviceCode || displayCheckCode(rawId || rawCode) || stableCheckCode(rawCode),
|
||||
title: safeUserText(item?.checkTitleZh || item?.check?.titleZh) || "未登记监测项",
|
||||
summary: safeUserText(item?.checkSummaryZh || item?.summary || item?.evidenceSummary) || "已记录监测项详情,见报告原文。",
|
||||
};
|
||||
}
|
||||
|
||||
function rawCheckCode(item) {
|
||||
return String(item?.checkCode || item?.check?.code || item?.code || item?.findingId || item?.kind || "unknown");
|
||||
return String(item?.checkCode || item?.check?.code || rawFindingId(item) || "unknown");
|
||||
}
|
||||
|
||||
function rawFindingId(item) {
|
||||
const value = item?.findingId || item?.finding_id || item?.id || item?.kind || item?.code;
|
||||
return value === null || value === undefined || value === "" ? "" : String(value);
|
||||
}
|
||||
|
||||
function displayCheckCode(value) {
|
||||
const text = String(value || "").replace(/\s+/g, " ").trim();
|
||||
if (text.length === 0 || text === "unknown") return "";
|
||||
return text;
|
||||
}
|
||||
|
||||
function stableCheckCode(value) {
|
||||
|
||||
Reference in New Issue
Block a user