hujing преди 5 години
родител
ревизия
3556aa359d

+ 38 - 11
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0296.java

@@ -1,6 +1,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.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
@@ -31,19 +32,17 @@ public class DUT0296 extends QCCatalogue {
         if (leaveHospitalDoc == null) {
             return;
         }
+
+        List<StagesSummaryDoc> stagesSummaryDocs = inputInfo.getStagesSummaryDocs();
+        TransferRecordDoc transferRecordDoc = inputInfo.getTransferRecordDocs();//转科记录
+
         Map<String, String> structureMap_leave = leaveHospitalDoc.getStructureMap();
         String beDate = structureMap_leave.get("入院时间"); //2019-12-07 08:48
         String leaveDate = structureMap_leave.get("出院时间");//2019-12-10 10:49
-        if (StringUtil.isBlank(beDate) || StringUtil.isBlank(leaveDate)) {
-            return;
-        }
-        List<StagesSummaryDoc> stagesSummaryDocs = inputInfo.getStagesSummaryDocs();
-
-        TransferRecordDoc transferRecordDoc = inputInfo.getTransferRecordDocs();//转科记录
         if (transferRecordDoc != null) {
             List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
             String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
-            if (StringUtil.isNotBlank(firstOutRecordDate)) {
+            if (StringUtil.isNotBlank(firstOutRecordDate) && StringUtil.isNotBlank(beDate)) {
                 //入院时间到第一次转出时间,大于30天则报错
                 int dateDifference = dateDifference(beDate, firstOutRecordDate);
                 if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
@@ -52,7 +51,7 @@ public class DUT0296 extends QCCatalogue {
                 }
             }
             String lastInrecordDate = getLastInrecordDate(allTransferDocs);
-            if (StringUtil.isNotBlank(lastInrecordDate)) {
+            if (StringUtil.isNotBlank(lastInrecordDate) && StringUtil.isNotBlank(leaveDate)) {
                 //最后一次转入时间到出院时间,大于30天则报错
                 int dateDifference = dateDifference(lastInrecordDate, leaveDate);
                 if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
@@ -71,11 +70,35 @@ public class DUT0296 extends QCCatalogue {
             }
         } else {
             //没有转科记录,直接入院时间和出院时间比
-            int dateDifference = dateDifference(beDate, leaveDate);
-            if (dateDifference >= 31 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
-                status.set("-1");
+            if (StringUtil.isNotBlank(beDate) && StringUtil.isNotBlank(leaveDate)) {
+                int dateDifference = dateDifference(beDate, leaveDate);
+                if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
+                    status.set("-1");
+                }
+                if (!checkDays(stagesSummaryDocs, dateDifference)) {
+                    status.set("-1");
+                    return;
+                }
             }
+
+            String lengthOfStay = structureMap_leave.get("住院天数");
+            if (StringUtil.isNotBlank(lengthOfStay)) {
+                int lengthOfStayNum = onlyNum(lengthOfStay);
+                if (!checkDays(stagesSummaryDocs, lengthOfStayNum)) {
+                    status.set("-1");
+                }
+            }
+
         }
+
+    }
+
+    private boolean checkDays(List<StagesSummaryDoc> stagesSummaryDocs, int dateDifference) {
+        if (stagesSummaryDocs != null && stagesSummaryDocs.size() > 0) {
+            double sum = Math.floor(dateDifference / 30);
+            return sum == stagesSummaryDocs.size();
+        }
+        return false;
     }
 
     /**
@@ -159,4 +182,8 @@ public class DUT0296 extends QCCatalogue {
         }
         return day;
     }
+
+    private int onlyNum (String str){
+        return Integer.parseInt(str.replaceAll("[^0-9]",""));
+    }
 }

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0199.java

@@ -5,6 +5,7 @@ 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.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -30,7 +31,7 @@ public class FIRP0199 extends QCCatalogue {
 
              */
             String newbornWeight = firstpageStructureMap.get(Content.newbornWeight);
-            if (CatalogueUtil.isEmpty(newbornWeight)) {
+            if (StringUtil.isBlank(newbornWeight)) {
                 status.set("-1");
             }
         }

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

@@ -21,11 +21,10 @@ public class FIRP0274 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
-            String age = firstpageStructureMap.get(Content.age);
+            /*String age = firstpageStructureMap.get(Content.age);*/
             String infantAgeMonths = firstpageStructureMap.get(Content.newbornAgeMonths);
             String infantAgeDays = firstpageStructureMap.get(Content.newbornAgeDays);
-            if (CatalogueUtil.isEmpty(age)
-                    && CatalogueUtil.isEmpty(infantAgeMonths)
+            if (CatalogueUtil.isEmpty(infantAgeMonths)
                     && CatalogueUtil.isEmpty(infantAgeDays)) {
                 status.set("-1");
             }

+ 0 - 5
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCController.java

@@ -37,11 +37,6 @@ public class QCController {
     public Response<OutputInfo> extract(@RequestBody QueryVo queryVo) {
         Response response = new Response();
         try {
-//            Map<String, String> map1 = new LinkedHashMap<>();
-//            map1.put("code","FIRP02904");
-//            map1.put("precond","");
-//            map1.put("name","辅助检查未注明时间");
-//            queryVo.getInputCatalogueMap().put("FIRP02904",map1);
             response.setData(qCAnalysis.anlysis(queryVo));
         } catch (AIException aie) {
             response.setRet(-1);

+ 2 - 2
public/src/main/java/com/lantone/qc/pub/Content.java

@@ -128,8 +128,8 @@ public class Content {
     public static final String age = "年龄";
     public static final String nationality = "国籍";
     public static final String birth_date = "出生日期";
-    public static final String newbornAgeMonths = "新生儿年龄月数";
-    public static final String newbornAgeDays = "新生儿年龄天数";
+    public static final String newbornAgeMonths = "新生儿出生月数";
+    public static final String newbornAgeDays = "新生儿出生天数";
     public static final String newbornWeight = "新生儿出生体重";
     public static final String newbornAdmisWeight = "新生儿入院体重";
     public static final String birth_address = "出生地";

+ 2 - 1
trans/src/main/java/com/lantone/qc/trans/changx/ChangxClinicBloodEffectDocTrans.java

@@ -61,6 +61,7 @@ public class ChangxClinicBloodEffectDocTrans extends ModelDocTrans {
             "记录日期=记录时间",
             "签名++++=记录医师",
             "签名时间=",
-            "输血效果评价=输注后效果评价"
+            "输血效果评价=输注后效果评价",
+            "日常病程记录++++文本框=输注后效果评价"
     );
 }