ソースを参照

fix(report): 肠道菌群报告缺失增强字段(肠道预测年龄/肠型)不阻断入库

体检型菌群检测等合法报告不输出增强字段,从 expected_indicators 剔除避免卡草稿。
Xiaogang Liao 1 週間 前
親
コミット
f22ccd1359

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/ReportCollectService.java

@@ -1127,6 +1127,11 @@ public class ReportCollectService {
         if (expected == null || expected.isEmpty()) {
             return true;
         }
+        // 肠道菌群家族:肠道预测年龄/肠型 为摘要增强字段,部分报告(如体检型菌群检测)不输出,
+        // 缺失不阻断入库,避免合法报告因缺少增强字段卡在草稿
+        if (isGutFloraType(typeId)) {
+            expected.removeAll(GUT_FLORA_OPTIONAL_INDICATORS);
+        }
         List<String> missing = new ArrayList<>();
         int matched = 0;
         for (String exp : expected) {
@@ -1156,6 +1161,10 @@ public class ReportCollectService {
         return missing.isEmpty();
     }
 
+    /** 肠道菌群家族校验可选指标(report_type_registry.expected_indicators 中缺失不阻断入库) */
+    private static final Set<String> GUT_FLORA_OPTIONAL_INDICATORS =
+            new HashSet<>(Arrays.asList("肠道预测年龄", "肠型"));
+
     /** 是否为肠道菌群家族类型(report_type_registry.family = gut_flora) */
     private boolean isGutFloraType(String typeId) {
         if (typeId == null) {