hujing 5 лет назад
Родитель
Сommit
691efc28fc

+ 57 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0490.java

@@ -0,0 +1,57 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.entity.PD;
+import com.lantone.qc.pub.model.entity.Pacs;
+import com.lantone.qc.pub.model.label.PacsLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0490
+ * @Description : 实验室检查未注明时间和地点
+ * @Author : 胡敬
+ * @Date: 2020-06-03 13:34
+ */
+@Component
+public class BEH0490 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+
+        PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
+        if (pacsLabel == null || StringUtil.isBlank(pacsLabel.getText())) {
+            return;
+        }
+
+        String pacsText = pacsLabel.getText();
+        List<Pacs> pacses = pacsLabel.getPacses();
+        for (Pacs pacs : pacses) {
+            if (pacs.getName() == null && pacs.getPd() == null) {
+                status.set("-1");
+                return;
+            } else {
+                PD pd = pacs.getPd();
+                if (pd == null) {
+                    continue;
+                }
+                String name = pd.getName();
+                int timeIndex = pacsText.indexOf(name);
+                String beforeTimeText = pacsText.substring(Math.max(timeIndex - 5, 0), timeIndex);
+                String afterTimeText = pacsText.substring(timeIndex + name.length(), timeIndex + name.length() + 10);
+                if (!beforeTimeText.contains("院") && !afterTimeText.contains("院")) {
+                    status.set("-1");
+                    return;
+                }
+            }
+        }
+    }
+}

+ 2 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0178.java

@@ -47,12 +47,11 @@ public class FIRP0178 extends QCCatalogue {
             List<Diag> leaveDiags = leaveDiagLabel.getDiags();
             List<String> leaveDiagsStr = putDiagToList(leaveDiags);
 
-            /*
-            if (firstpageLeaveDiags.size() != leaveDiagsStr.size()) {
+            /* 病案首页出院诊断会把主诊断去掉,所以size会少一个,这里将出院小结里的出院诊断size也-1 */
+            if (firstpageLeaveDiags.size() != leaveDiagsStr.size() - 1) {
                 status.set("-1");
                 return;
             }
-            */
 
             /* 目前相似度算法是针对文本的,在此处并不适用,如 截瘫 - 高位截瘫,相似度为0 */
             ModelAI modelAI = new ModelAI();

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0252.java

@@ -0,0 +1,33 @@
+package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.pub.Content;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRP0252
+ * @Description : 单病种管理填写错误
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28ss
+ */
+@Component
+public class FIRP0252 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getFirstPageRecordDoc() == null){
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
+            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String name = firstpageStructureMap.get(Content.single_disease_management);
+            if (StringUtil.isNotBlank(name)){
+                status.set("0");
+            }
+        }
+    }
+}

+ 44 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0146.java

@@ -3,20 +3,58 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import com.lantone.qc.pub.util.ListUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
- * @Description:
- * @author: rengb
- * @time: 2020/3/10 13:53
+ * @ClassName : LEA0146
+ * @Description :出院其他诊断不完全
+ * @Author : 胡敬
+ * @Date: 2020-03-16 14:01
  */
 @Component
 public class LEA0146 extends QCCatalogue {
-
-    @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getLeaveHospitalDoc() != null) {
+            DiagLabel leaveDiagLabel = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel();
+            if (leaveDiagLabel == null) {
+                return;
+            }
+            List<Diag> dischargeDiag = leaveDiagLabel.getDiags();
+            if (ListUtil.isEmpty(dischargeDiag)) {
+                return;
+            }
+            List<String> leaveDiags = new ArrayList<>();
+            putDiagToList(dischargeDiag, leaveDiags);
+
+            BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+            List<String> beHospitalDiag = new ArrayList<>();//收集入院记录中初步诊断、修正诊断、其他诊断所有诊断
+            if (beHospitalizedDoc.getInitialDiagLabel() != null) {
+                putDiagToList(beHospitalizedDoc.getInitialDiagLabel().getDiags(), beHospitalDiag); //初步诊断
+            }
+            if (beHospitalizedDoc.getRevisedDiagLabel() != null) {
+                putDiagToList(beHospitalizedDoc.getRevisedDiagLabel().getDiags(), beHospitalDiag); //修正诊断
+            }
+            if (beHospitalizedDoc.getSuppleDiagLabel() != null) {
+                putDiagToList(beHospitalizedDoc.getSuppleDiagLabel().getDiags(), beHospitalDiag); //其他诊断
+            }
+
+            if (!leaveDiags.containsAll(beHospitalDiag)) {
+                status.set("-1");
+            }
+        }
+    }
 
+    private void putDiagToList(List<Diag> diagList, List<String> beHospitalDiag) {
+        for (Diag diag : diagList) {
+            beHospitalDiag.add(diag.getName());
+        }
     }
-    
 }