Bladeren bron

台州修改bug

hujing 5 jaren geleden
bovenliggende
commit
409cb3c9b4

+ 31 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02855.java

@@ -0,0 +1,31 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+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.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+
+/**
+ * @ClassName : BEH02855
+ * @Description : 过敏史未填写
+ * @Author : 胡敬
+ * @Date: 2020-06-15 16:09
+ */
+@Component
+public class BEH02855 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> bhMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        if (StringUtil.isNotEmpty(bhMap.get("过敏史"))) {
+            status.set("0");
+        }
+    }
+}

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0648.java

@@ -33,10 +33,10 @@ public class OPE0648 extends QCCatalogue {
                 long count = operationDocs.stream().filter(operationDoc -> {
                     boolean flag = false;
                     if (operationDoc.getOperationRecordDoc() != null) {
-                        String surgeon = operationDoc.getOperationRecordDoc().getStructureMap().get("手术医师");
+                        String surgeon = operationDoc.getOperationRecordDoc().getStructureMap().get("主刀医师");
                         String assist1 = operationDoc.getOperationRecordDoc().getStructureMap().get("一助");
                         String asssit2 = operationDoc.getOperationRecordDoc().getStructureMap().get("助手II");
-                        String signature = operationDoc.getOperationRecordDoc().getStructureMap().get("主刀医师签名");
+                        String signature = operationDoc.getOperationRecordDoc().getStructureMap().get("医生");
 
                         String operator = surgeon + ", " + assist1 + ", " + asssit2;
 

+ 56 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/preoperativediscussion/PRE0328.java

@@ -6,11 +6,16 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 手术患者无术前讨论记录
@@ -35,11 +40,8 @@ public class PRE0328 extends QCCatalogue {
         boolean emergencyOperation = findEmergencyOperation(inputInfo);
         boolean emergencyOperationFromWardRecord = findEmergencyOperationFromWardRecord(inputInfo);
 
-        int i = 0, j = 0;
+        int i = getOperationSum(operationDocs), j = 0;
         for (OperationDoc operationDoc : operationDocs) {
-            if (operationDoc.getOperationRecordDoc() != null) {
-                i++;
-            }
             if (operationDoc.getPreoperativeDiscussionDoc() != null) {
                 j++;
             }
@@ -86,4 +88,54 @@ public class PRE0328 extends QCCatalogue {
         return false;
     }
 
+    /**
+     * 获取手术记录次数
+     * @param operationDocs
+     * @return
+     */
+    private int getOperationSum(List<OperationDoc> operationDocs) {
+        List<Map<String, Date>> operationDateList = new ArrayList<>();
+        Map<String, Date> operationDate = null;
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            String operationStartDateStr = structureMap.get("手术开始时间");
+            String operationEndDateStr = structureMap.get("手术结束时间");
+            if (StringUtil.isNotBlank(operationStartDateStr) && StringUtil.isNotBlank(operationEndDateStr)) {
+                Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
+                Date operationEndDate = StringUtil.parseDateTime(operationEndDateStr);
+                if (operationStartDate != null && operationEndDate != null) {
+                    /* 放第一个手术记录的时间到operationDateList */
+                    if (operationDateList.size() == 0) {
+                        operationDate = new HashMap<>();
+                        operationDate.put("手术开始时间", operationStartDate);
+                        operationDate.put("手术结束时间", operationEndDate);
+                        operationDateList.add(operationDate);
+                        continue;
+                    }
+                    /* 如果其中一个手术记录的开始时间到结束时间之间还包含另一个手术,就不往operationDateList里加 */
+                    boolean findInnerOperation = false;
+                    for (Map<String, Date> date : operationDateList) {
+                        Date listStartDate = date.get("手术开始时间");
+                        Date listEndDate = date.get("手术结束时间");
+                        if (listStartDate.before(operationStartDate) && operationEndDate.before(listEndDate)) {
+                            findInnerOperation = true;
+                            break;
+                        }
+                    }
+                    if (!findInnerOperation) {
+                        operationDate = new HashMap<>();
+                        operationDate.put("手术开始时间", operationStartDate);
+                        operationDate.put("手术结束时间", operationEndDate);
+                        operationDateList.add(operationDate);
+                    }
+                }
+            }
+        }
+        return operationDateList.size();
+    }
+
 }