Pārlūkot izejas kodu

台州运行质控修改bug

hujing 5 gadi atpakaļ
vecāks
revīzija
65991f2edf

+ 2 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/crisisvaluereport/CRI0385.java

@@ -6,7 +6,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import org.springframework.stereotype.Component;
 
 /**
- * @Description:
+ * @Description: 危急值记录中无临床意义
  * @author: rengb
  * @time: 2020/3/19 19:54
  */
@@ -15,7 +15,6 @@ public class CRI0385 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-
+        status.set("0");
     }
-
 }

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/crisisvaluereport/CRI0387.java

@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
 import java.util.List;
 
 /**
- * @Description:
+ * @Description: 危急值记录中无效果观察
  * @author: rengb
  * @time: 2020/3/19 19:54
  */
@@ -18,8 +18,8 @@ public class CRI0387 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
         List<CrisisValueReportDoc> crisisValueReportDocs = inputInfo.getCrisisValueReportDocs();
 
     }
-
 }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0597.java

@@ -39,7 +39,7 @@ public class DUT0597 extends QCCatalogue {
             }
             Date rollOutRecordDate = StringUtil.parseDateTime(rollOutRecordDateStr);
             Date recordDate = StringUtil.parseDateTime(recordDateStr);
-            if (rollOutRecordDate != null && recordDate != null && !rollOutRecordDate.before(recordDate)) {
+            if (rollOutRecordDate != null && recordDate != null && rollOutRecordDate.before(recordDate)) {
                 status.set("-1");
                 return;
             }

+ 12 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0599.java

@@ -2,6 +2,7 @@ package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
+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.model.doc.ThreeLevelWardDoc;
@@ -48,8 +49,18 @@ public class DUT0599 extends QCCatalogue {
                 continue;
             }
             Date rollInRecordDate = StringUtil.parseDateTime(rollInRecordDateStr);
-            rollInDay = new ArrayList<>();
+            if (inputInfo.getLeaveHospitalDoc() != null) {
+                Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
+                String dischargeTime = leaveHospitalStructureMap.get(Content.dischargeTime);
+                //如果住院天数小于3天则不判断该条规则
+                if ( rollInRecordDate != null && StringUtil.isNotBlank(dischargeTime)) {
+                    if (!CatalogueUtil.compareTime(rollInRecordDate, StringUtil.parseDateTime(dischargeTime), 3 * 24 * 60L)) {
+                        continue;
+                    }
+                }
+            }
             for (int i = 1; i <= 3; i++) {
+                rollInDay = new ArrayList<>();
                 Date wardRecordDay = DateUtil.dateZeroClear(DateUtil.addDate(rollInRecordDate, i));
                 rollInDay.add(wardRecordDay);
             }

+ 30 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0146.java

@@ -1,12 +1,17 @@
 package com.lantone.qc.kernel.catalogue.leavehospital;
 
+import com.alibaba.fastjson.JSONArray;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
+import com.lantone.qc.kernel.structure.ai.ModelAI;
+import com.lantone.qc.kernel.util.CatalogueUtil;
 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.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -20,6 +25,8 @@ import java.util.List;
  */
 @Component
 public class LEA0146 extends QCCatalogue {
+    @Autowired
+    ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getLeaveHospitalDoc() != null) {
@@ -46,7 +53,28 @@ public class LEA0146 extends QCCatalogue {
                 putDiagToList(beHospitalizedDoc.getSuppleDiagLabel().getDiags(), beHospitalDiag); //其他诊断
             }
 
-            if (!leaveDiags.containsAll(beHospitalDiag)) {
+            String infoStr = "";
+            int matchSum = 0;
+            ModelAI modelAI = new ModelAI();
+            for (String beDiag : beHospitalDiag) {
+                JSONArray jsonArray = modelAI.loadChiefPresentSimilarAI(beDiag, leaveDiags, false
+                        , "diagnose", chiefPresentSimilarityServiceClient);
+                if (jsonArray.size() == 2) {
+                    /* 相似度最高诊断 */
+                    String symptom = jsonArray.getString(0);
+                    /* 相似度分数 */
+                    double likeRate = jsonArray.getDoubleValue(1);
+                    if (likeRate > 0.85) {
+                        matchSum++;
+                    } else {
+                        infoStr = CatalogueUtil.concatInfo(infoStr, beDiag);
+                    }
+                } else {
+                    infoStr = CatalogueUtil.concatInfo(infoStr, beDiag);
+                }
+            }
+            info.set(infoStr);
+            if (matchSum != beHospitalDiag.size()) {
                 status.set("-1");
             }
         }
@@ -54,7 +82,7 @@ public class LEA0146 extends QCCatalogue {
 
     private void putDiagToList(List<Diag> diagList, List<String> beHospitalDiag) {
         for (Diag diag : diagList) {
-            beHospitalDiag.add(diag.getName());
+            beHospitalDiag.add(diag.getHospitalDiagName());
         }
     }
 }

+ 1 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR02931.java

@@ -23,30 +23,26 @@ import java.util.Map;
 @Component
 public class THR02931 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
         if (inputInfo.getThreeLevelWardDocs().size() == 0 || inputInfo.getLeaveHospitalDoc() == null) {
-            status.set("0");
             return;
         }
         DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
         DeathCaseDiscussDoc deathCaseDiscussDoc = inputInfo.getDeathCaseDiscussDoc();
         if (deathRecordDoc != null || deathCaseDiscussDoc != null) {
-            status.set("0");
             return;
         }
         LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
         String leaveDateStr = leaveHospitalDoc.getStructureMap().get("出院时间");
         if (StringUtil.isBlank(leaveDateStr)) {
-            status.set("0");
             return;
         }
         Date leaveDate = StringUtil.parseDateTime(leaveDateStr);
         if (leaveDate == null) {
-            status.set("0");
             return;
         }
         List<ThreeLevelWardDoc> allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
         if (allDoctorWradDocs.size() == 0) {
-            status.set("0");
             return;
         }
         int j = 0; //最后两次查房记录