瀏覽代碼

Merge remote-tracking branch 'origin/dev-1.2' into dev

hujing 5 年之前
父節點
當前提交
e261169c7f

+ 15 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java

@@ -4,6 +4,7 @@ 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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -22,7 +23,7 @@ public class BEH0026 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             status.set("0");
             return;
         }
@@ -31,14 +32,23 @@ public class BEH0026 extends QCCatalogue {
             status.set("0");
             return;
         }
-
-        List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("食物过敏史")) {
+            status.set("0");
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
         if (ListUtil.isNotEmpty(allergies)) {
             long count = allergies.stream().filter(
                     i -> i != null
                             && StringUtil.isNotBlank(i.getName())
-//                            && i.getAllergyFood() != null
-//                            && StringUtil.isNotBlank(i.getAllergyFood().getName())
+                    //                            && i.getAllergyFood() != null
+                    //                            && StringUtil.isNotBlank(i.getAllergyFood().getName())
             ).count();
             if (count > 0) {
                 status.set("0");

+ 14 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0028.java

@@ -4,6 +4,7 @@ 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.BloodTransfusion;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -22,11 +23,21 @@ public class BEH0028 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             status.set("0");
             return;
         }
-        List<BloodTransfusion> bloodTransfusions = inputInfo.getBeHospitalizedDoc().getPastLabel().getBloodTransfusions();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("输血")) {
+            status.set("0");
+            return;
+        }
+        List<BloodTransfusion> bloodTransfusions = pastLabel.getBloodTransfusions();
         if (ListUtil.isNotEmpty(bloodTransfusions)) {
             if (bloodTransfusions.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
                 status.set("0");
@@ -34,9 +45,8 @@ public class BEH0028 extends QCCatalogue {
             }
         }
         Map<String, String> structureMap_beh = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        if(StringUtils.isNotEmpty(structureMap_beh.get("输血史"))){
+        if (StringUtils.isNotEmpty(structureMap_beh.get("输血史"))) {
             status.set("0");
-            return;
         }
     }
 

+ 13 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0037.java

@@ -4,6 +4,7 @@ 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.Wound;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -21,10 +22,14 @@ public class BEH0037 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
-        List<Wound> wounds = inputInfo.getBeHospitalizedDoc().getPastLabel().getWounds();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        List<Wound> wounds = pastLabel.getWounds();
         if (ListUtil.isEmpty(wounds)) {
             return;
         }
@@ -41,6 +46,12 @@ public class BEH0037 extends QCCatalogue {
                 info.set(info.get() + wound.getName() + " ");
             }
         }
+        //硬规则匹配
+        String pastLabelText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastLabelText) && pastLabelText.contains("外伤")) {
+            status.set("0");
+            return;
+        }
         if (StringUtil.isNotBlank(info.get())) {
             status.set("-1");
         }

+ 11 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0038.java

@@ -4,6 +4,7 @@ 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.BloodTransfusion;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -21,10 +22,18 @@ public class BEH0038 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
-        List<BloodTransfusion> bloodTransfusions = inputInfo.getBeHospitalizedDoc().getPastLabel().getBloodTransfusions();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("输血")) {
+            return;
+        }
+        List<BloodTransfusion> bloodTransfusions = pastLabel.getBloodTransfusions();
         if (ListUtil.isEmpty(bloodTransfusions)) {
             return;
         }

+ 11 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0039.java

@@ -4,6 +4,7 @@ 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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -21,10 +22,18 @@ public class BEH0039 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
-        List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("食物过敏史")) {
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
         if (ListUtil.isEmpty(allergies)) {
             return;
         }

+ 11 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0040.java

@@ -4,6 +4,7 @@ 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.Allergy;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -21,10 +22,18 @@ public class BEH0040 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
-        List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel == null) {
+            return;
+        }
+        String pastText = pastLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("药物过敏史")) {
+            return;
+        }
+        List<Allergy> allergies = pastLabel.getAllergies();
         if (ListUtil.isEmpty(allergies)) {
             return;
         }

+ 13 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0046.java

@@ -4,6 +4,7 @@ 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.Smoking;
+import com.lantone.qc.pub.model.label.PersonalLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
@@ -20,22 +21,28 @@ public class BEH0046 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             status.set("0");
             return;
         }
         //台州结构化
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        if(StringUtils.isNotEmpty(structureMap.get("吸烟"))){
+        if (StringUtils.isNotEmpty(structureMap.get("吸烟"))) {
             status.set("0");
             return;
         }
-        Smoking smoking = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getSmoking();
-        if (smoking != null && StringUtil.isNotBlank(smoking.getName())) {
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (StringUtil.isNotBlank(personalText) && (personalText.contains("偶有") || personalText.contains("烟"))) {
             status.set("0");
+            return;
         }
-        //硬匹配规则
-        if (inputInfo.getBeHospitalizedDoc().getPersonalLabel().getText().contains("烟")) {
+        Smoking smoking = personalLabel.getSmoking();
+        if (smoking != null && StringUtil.isNotBlank(smoking.getName())) {
             status.set("0");
         }
     }

+ 13 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0047.java

@@ -4,6 +4,7 @@ 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.Drinking;
+import com.lantone.qc.pub.model.label.PersonalLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
@@ -20,7 +21,7 @@ public class BEH0047 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             status.set("0");
             return;
         }
@@ -29,8 +30,18 @@ public class BEH0047 extends QCCatalogue {
             status.set("0");
             return;
         }
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = personalLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("饮酒")) {
+            status.set("0");
+            return;
+        }
 
-        Drinking drinking = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getDrinking();
+        Drinking drinking = personalLabel.getDrinking();
         if (drinking != null && StringUtil.isNotBlank(drinking.getName())) {
             status.set("0");
         }

+ 12 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0050.java

@@ -5,6 +5,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Smoking;
 import com.lantone.qc.pub.model.entity.Usage;
+import com.lantone.qc.pub.model.label.PersonalLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -22,7 +23,17 @@ public class BEH0050 extends QCCatalogue {
             status.set("0");
             return;
         }
-        Smoking smoking = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getSmoking();
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null){
+            status.set("0");
+            return;
+        }
+        String personalText = personalLabel.getText();
+        if (StringUtil.isNotBlank(personalText) && personalText.contains("偶有")){
+            status.set("0");
+            return;
+        }
+        Smoking smoking = personalLabel.getSmoking();
         if (smoking == null
                 || StringUtil.isBlank(smoking.getName())
                 || (smoking.getNegative() != null && StringUtil.isNotBlank(smoking.getNegative().getName()))

+ 13 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0051.java

@@ -5,6 +5,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Drinking;
 import com.lantone.qc.pub.model.entity.Usage;
+import com.lantone.qc.pub.model.label.PersonalLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
@@ -18,11 +19,21 @@ public class BEH0051 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             status.set("0");
             return;
         }
-        Drinking drinking = inputInfo.getBeHospitalizedDoc().getPersonalLabel().getDrinking();
+        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
+        if (personalLabel == null) {
+            status.set("0");
+            return;
+        }
+        String pastText = personalLabel.getText();
+        if (StringUtil.isNotBlank(pastText) && pastText.contains("饮酒")) {
+            status.set("0");
+            return;
+        }
+        Drinking drinking = personalLabel.getDrinking();
         if (drinking == null
                 || StringUtil.isBlank(drinking.getName())
                 || (drinking.getNegative() != null && StringUtil.isNotBlank(drinking.getNegative().getName()))

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0436.java

@@ -76,7 +76,7 @@ public class THR0436 extends QCCatalogue {
         String recordTime = "", title = "";
         for (RescueDoc rescueDoc : rescueDocs) {
             Map<String, String> rescueStructureMap = rescueDoc.getStructureMap();
-            recordTime = rescueStructureMap.get("抢救时间");
+            recordTime = rescueStructureMap.get("抢救结束时间");
             Date recordDate = StringUtil.parseDateTime(recordTime);
             if (recordDate == null || CatalogueUtil.equalsDate(recordDate, timeOfComparison, "yyyy-MM-dd")) {
                 continue;
@@ -98,14 +98,14 @@ public class THR0436 extends QCCatalogue {
 
         List<Map<String, String>> dateRecordList = new ArrayList<>(dateRecord.values());
         //如果最后一条是抢救记录,则之后肯定没有查房记录
-        if (dateRecordList.get(dateRecordList.size() - 1).containsKey("抢救时间")) {
+        if (dateRecordList.get(dateRecordList.size() - 1).containsKey("抢救结束时间")) {
             status.set("-1");
             return;
         }
         for (int i = 0; i < dateRecordList.size(); i++) {
             if (i != dateRecordList.size() - 1) {
                 //当前为抢救记录
-                if (!dateRecordList.get(i).containsKey("抢救时间")) {
+                if (!dateRecordList.get(i).containsKey("抢救结束时间")) {
                     continue;
                 }
                 //抢救记录下一条不是查房记录则报错

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ThreeLevelWardAI.java

@@ -256,7 +256,7 @@ public class ThreeLevelWardAI extends ModelAI {
         String recordTime = "", title = "";
         for (RescueDoc rescueDoc : rescueDocs) {
             Map<String, String> rescueStructureMap = rescueDoc.getStructureMap();
-            recordTime = rescueStructureMap.get("抢救时间");
+            recordTime = rescueStructureMap.get("抢救结束时间");
             if(recordTime == null){
                 continue;
             }
@@ -279,14 +279,14 @@ public class ThreeLevelWardAI extends ModelAI {
         }
         List<Map<String, String>> dateRecordList = new ArrayList<>(dateRecord.values());
         //如果最后一条是抢救记录,则之后肯定没有查房记录
-        if (ListUtil.isNotEmpty(dateRecordList) && dateRecordList.get(dateRecordList.size() - 1).containsKey("抢救时间")) {
+        if (ListUtil.isNotEmpty(dateRecordList) && dateRecordList.get(dateRecordList.size() - 1).containsKey("抢救结束时间")) {
             record = new ArrayList<>();
             return record;
         }
         for (int i = 0; i < dateRecordList.size(); i++) {
             if (i != dateRecordList.size() - 1) {
                 //当前为抢救记录
-                if (!dateRecordList.get(i).containsKey("抢救时间")) {
+                if (!dateRecordList.get(i).containsKey("抢救结束时间")) {
                     continue;
                 }
                 //抢救记录下一条不是查房记录则清空list