Browse Source

Merge branch 'hb/beilun' into his/xszyy

Gaozk 3 years ago
parent
commit
faad453882
15 changed files with 722 additions and 34 deletions
  1. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java
  2. 62 22
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java
  3. 12 3
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0225.java
  4. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP03229.java
  5. 218 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/operationdiscussion/OPE03111.java
  6. 64 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/deathcasediscuss/DEAC03232.java
  7. 64 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/deathrecord/DEAR03233.java
  8. 62 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/firstcourserecord/FIRC03230.java
  9. 63 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/leavehospital/LEA03231.java
  10. 48 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xszyy/clinicalblood/CLI0308.java
  11. 42 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xszyy/clinicalblood/CLI0568.java
  12. 7 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03111.java
  13. 43 0
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03234.java
  14. 3 3
      public/src/main/java/com/lantone/qc/pub/util/DateUtil.java
  15. 32 4
      trans/src/main/java/com/lantone/qc/trans/xszyy/util/BeiLunFirstCourseRecordHtmlAnalysis.java

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

@@ -28,7 +28,7 @@ import java.util.List;
 @Component
 public class BEH0014 extends QCCatalogue {
     private List<String> containList = Arrays.asList("体检", "发现", "检查", "因", "确诊", "诊断", "复查", "术后"
-            , "药物", "误服", "查", "撞", "伤", "跌", "月经", "暴力", "超", "术");
+            , "药物", "误服", "查", "撞", "伤", "跌", "月经", "暴力", "超", "术","不慎","出现");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getBeHospitalizedDoc() == null) {

+ 62 - 22
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java

@@ -4,8 +4,10 @@ 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.MedicalRecordInfoDoc;
 import com.lantone.qc.pub.model.label.MenstrualLabel;
 import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -17,44 +19,82 @@ import java.util.Map;
  * @Date: 2020-03-10 10:10
  */
 @Component
+@Slf4j
 public class BEH0059 extends QCCatalogue {
+    /**
+     * 1.判断住院信息表"科室"若为包含(儿科/新生儿)则通过
+     * 2..判断入院记录是否存在,若不存在则通过
+     * 3.获取性别(住院信息表/入院记录),若是性别不存在或性别为男则通过。然后获取年龄(住院信息表/入院记录),若是年龄小于10岁则通过。
+     * 4.获取入院记录结构化数据若是其中存在"月经"、"经期"、"绝经"且不为空则通过,
+     * 然后获取入院记录月经史,若不存在则报错返回,
+     * 若存在则去除符合规则‘[月经史|:|:|null]’的情况若是去除之后月经史为空则触发规则返回,若是不为空则判断其中是否包含中文字,若是包含则通过
+     */
     @Override
     protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getBeHospitalizedDoc() != null) {
-            if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
-                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
-                    || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
-                status.set("0"); //如果性别是男,就不报错
-            } else {
-                String concatMenstrualText = concatMenstrualText(inputInfo);
-                if (StringUtil.isNotBlank(concatMenstrualText)) {
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
+            //科室
+            String behDeptName = medicalRecordInfoDoc.getStructureMap().get("behDeptName");
+            if (StringUtil.isNotBlank(behDeptName) && (behDeptName.contains("儿科") || behDeptName.contains("新生儿"))) {
+                status.set("0");
+                return;
+            }
+            //性别
+            String sex = medicalRecordInfoDoc.getStructureMap().get("sex");
+            if (StringUtil.isNotBlank(sex) && (sex.contains("男"))) {
+                status.set("0");
+                return;
+            }
+        }
+
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
+            status.set("0");
+            return;
+        }
+        if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") != null &&
+                inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
+            status.set("0"); //如果性别是男,就不报错
+        }
+        //年龄
+        String age = inputInfo.getBeHospitalizedDoc().getStructureMap().get("年龄");
+        if (StringUtil.isNotBlank(age)) {
+            try {
+                age = age.replace("岁", "");
+                int ageNum = Integer.parseInt(age);
+                if (ageNum < 10) {
                     status.set("0");
                     return;
                 }
-                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
-                if (menstrualLabel == null) {
-                    return;
-                }
-                String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
-                if (StringUtil.isBlank(menstrualText)) {
-                    return;
-                }
-                boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
-                if (containChinese) {
-                    status.set("0"); //如果性别是女,不为空就不报错
-                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e + "BEH0059 :  日期转换异常");
             }
-        }else {
+        }
+        String concatMenstrualText = concatMenstrualText(inputInfo);
+        if (StringUtil.isNotBlank(concatMenstrualText)) {
             status.set("0");
             return;
         }
+        MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+        if (menstrualLabel == null) {
+            return;
+        }
+        String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
+        if (StringUtil.isBlank(menstrualText)) {
+            return;
+        }
+        boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
+        if (containChinese) {
+            status.set("0"); //如果性别是女,不为空就不报错
+        }
+
+
     }
 
     private String concatMenstrualText(InputInfo inputInfo) {
         Map<String, String> beHospitalizedStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
         StringBuilder sb = new StringBuilder();
         for (Map.Entry<String, String> bhMap : beHospitalizedStructureMap.entrySet()) {
-            if (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经")) {
+            if (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经") || bhMap.getKey().contains("月经史")) {
                 if (StringUtil.isNotBlank(bhMap.getValue())) {
                     sb.append(bhMap.getValue());
                 }

+ 12 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0225.java

@@ -5,9 +5,12 @@ 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.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -22,14 +25,20 @@ public class FIRP0225 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null
                 && inputInfo.getLeaveHospitalDoc() != null && inputInfo.getLeaveHospitalDoc().getStructureMap() != null) {
-            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
             String firstDischargeTime = firstpageStructureMap.get(Content.dischargeTime);//病案首页出院时间
             String dischargeTime = leaveHospitalStructureMap.get(Content.dischargeTime);//出院小结出院时间
-            if (StringUtil.isBlank(firstDischargeTime) || StringUtil.isBlank(dischargeTime)){
+
+            Date firstDate = DateUtil.parseDate(firstDischargeTime,DateUtil.DATE_TIME_FORMAT); //将带字符串的YYYY-DD-MM HH:MM:SS 转成日期
+            Date dischargeDate = DateUtil.parseDateTime(dischargeTime,DateUtil.FORMAT_LONG_CN_MI);
+            String firstDatStr = DateUtil.format(firstDate, DateUtil.DATE_FORMAT);  //将对应的YYYY-MM-DD HH:MM:SS 日期转成对应的YYYY-MM-DD字符串
+            String dischargeDateStr = DateUtil.format(dischargeDate, DateUtil.DATE_FORMAT);
+
+            if (StringUtil.isBlank(firstDatStr) || StringUtil.isBlank(dischargeDateStr)){
                 return;
             }
-            if (!CatalogueUtil.equalsDate(firstDischargeTime, dischargeTime, "yyyy-MM-dd")) {
+            if (!CatalogueUtil.equalsDate(firstDatStr, dischargeDateStr, "yyyy-MM-dd")) {
                 status.set("-1");
             }
         }

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

@@ -11,7 +11,7 @@ import java.util.Map;
 
 /**
  * @ClassName : FIRP03229
- * @Description : 身份证号与性别不符合
+ * @Description : 身份证信息填写与性别不符
  * @Author : wsy
  * @Date: 2022-04-12 16:13
  */

+ 218 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/ningbozhongyi/operationdiscussion/OPE03111.java

@@ -0,0 +1,218 @@
+package com.lantone.qc.kernel.catalogue.hospital.ningbozhongyi.operationdiscussion;
+
+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.model.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.PathologyShipDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : OPE03111
+ * @Description: 手术病理检查存在手术记录中无病理相关记录
+ * @author: zh
+ * @time: 2021/04/06 11:22
+ */
+@Component
+public class OPE03111 extends QCCatalogue {
+
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        boolean blHz = false;
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        //是否包含手术记录
+        if(operationDocs==null || operationDocs.size()==0){
+            return;
+        }
+        if(operationDocs!=null) {
+            for (OperationDoc operationDoc : operationDocs) {
+                OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+                if (operationRecordDoc == null) {
+                    return;
+                }
+            }
+        }
+
+        //判断医嘱是否进行了病理检查
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
+            for (DoctorAdviceDoc dad : doctorAdviceDocs) {
+                Map<String, String> dadStructureMap = dad.getStructureMap();
+                String daStatus = dadStructureMap.get(Content.doctorAdviceState);
+                String adviceType = dadStructureMap.get(Content.doctorAdviceType);
+                //取临时医嘱
+                if (StringUtil.isNotEmpty(adviceType) && adviceType.equals(Content.statOrder)) {
+                    if (StringUtil.isNotEmpty(daStatus)) {
+                        if (!Content.cancellationOrderList.contains(daStatus)) {
+                            String name = dadStructureMap.get(Content.medicalOrderName);
+                            if (bLStr(name)) {
+                                blHz = true;
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        //用首页或出院判断是否进行了病理检查
+        if(firstPageRecordDoc!=null){
+            String str = firstPageRecordDoc.getStructureMap().get("病理诊断费");
+            if ( !str.equals("0") && StringUtil.isNotEmpty(str)) {
+                double a = Double.parseDouble(str);
+                if ( a > Content.pathologicalFee) {
+                    blHz=true;
+                }
+            }
+        }
+        List<PathologyShipDoc> pathologyShipDocs = inputInfo.getPathologyShipDocs();
+        if(ListUtil.isNotEmpty(pathologyShipDocs)){
+            blHz=true;
+        }
+        //判断手术记录有无标本记录
+        if(blHz) {
+            status.set("-1");
+            if (operationDocs != null ) {
+                //有手术记录的情况下,手术记录中应该出现体现有标本
+                for (OperationDoc operationDoc : operationDocs) {
+                    String specimens = operationDoc.getOperationRecordDoc().getStructureMap().get("术中取病理标本");
+                    String pathological = operationDoc.getOperationRecordDoc().getStructureMap().get("病理检查");
+                    if(StringUtil.isNotEmpty(specimens)){
+                        if(specimens.equals("有")){
+                            status.set("0");
+                            return;
+                        }
+                        if(specimens.equals("无")){
+                            status.set("0");
+                            return;
+                        }
+                    }
+                    if (StringUtil.isNotEmpty(pathological)){
+                        if (pathological.equals("送")){
+                            status.set("0");
+                            continue;
+                        }
+                    }
+                    OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+                    if (operationRecordDoc != null) {
+                        String str = operationRecordDoc.getStructureMap().get("手术经过及处理");
+                        if (StringUtil.isNotEmpty(str)) {
+                            if (dateStr(str)) {
+                                status.set("0");
+                                return;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
+    private boolean dateStr(String string){
+        if(StringUtil.isEmpty(string)){
+            return false;
+        }
+        boolean flag=false;
+        String str = Str(string);
+        String rex="[\\s\\S]*(?=流式)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=穿透)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=癌)[^,;,;。]{0,6}(?=浸润)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=分化)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        List<String> surgeryPathologyList = Content.surgeryPathologyList;
+        for (String surgeryPathology : surgeryPathologyList) {
+            if(str.contains(surgeryPathology)){
+                flag=true;
+            }
+        }
+        if(flag || str.matches(rex1)|| str.matches(rex2)
+                ||str.matches(rex3)|| str.matches(rex4)||str.matches(rex5)|| str.matches(rex6)|| str.matches(rex)){
+            return true;
+        }
+        if(str.contains("冰冻")){
+            if(bdStr(str)){
+                return true;
+            }
+        }
+        return false;
+    }
+    private boolean bLStr(String string){
+        if(StringUtil.isEmpty(string)){
+            return false;
+        }
+        String str = Str(string);
+        List<String> doctorAdvicePathologyList = Content.doctorAdvicePathologyList;
+        for (String doctorAdvicePathology : doctorAdvicePathologyList) {
+            if(str.contains(doctorAdvicePathology)){
+                return true;
+            }
+        }
+        if(str.contains("冰冻")){
+            if(bdStr(str)){
+                return true;
+            }
+        }
+        return false;
+    }
+    //判断包含冰冻但不属于病理
+    private boolean bdStr(String str) {
+        ArrayList<String> blStrings = new ArrayList<>();
+        String rex1="[\\s\\S]{0,10}(?=冰冻)[\\s\\S]{0,10}";
+        Matcher matcher = Pattern.compile(rex1).matcher(str);
+        while (matcher.find()) {
+            String group = matcher.group();
+            blStrings.add(group);
+        }
+        List<String> notBLList = Content.notBDBLList;
+        if (ListUtil.isNotEmpty(blStrings)) {
+            for (String notBL : notBLList) {
+                for (int i = 0; i < blStrings.size(); i++) {
+                    String cfStr = blStrings.get(i);
+                    if (cfStr.contains(notBL)) {
+                        blStrings.remove(i);
+                        continue;
+                    }
+                }
+            }
+            if (blStrings.size() > 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private String Str(String str){
+        str = str.replaceAll("\\*", "\\\\*");
+        str = str.replaceAll("\\)", "\\\\)");
+        str = str.replaceAll("\\.", "\\\\.");
+        str = str.replaceAll("\\?", "\\\\?");
+        str = str.replaceAll("\\+", "\\\\+");
+        str = str.replaceAll("\\$", "\\\\$");
+        str = str.replaceAll("\\^", "\\\\^");
+        str = str.replaceAll("\\[", "\\\\[");
+        str = str.replaceAll("\\]", "\\\\]");
+        str = str.replaceAll("\\(", "\\\\(");
+        str = str.replaceAll("\\{", "\\\\{");
+        str = str.replaceAll("\\}", "\\\\}");
+        str = str.replaceAll("\\|", "\\\\|");
+        str = str.replaceAll("\\/", "\\\\/");
+        return str;
+    }
+}

+ 64 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/deathcasediscuss/DEAC03232.java

@@ -0,0 +1,64 @@
+package com.lantone.qc.kernel.catalogue.hospital.shengzhouyy.deathcasediscuss;
+
+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.DeathCaseDiscussDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : DEAC03232
+ * @Description: 死亡病例讨论记录内性别和基本信息不一致
+ * @author: wsy
+ * @time: 2022/5/18 15:15
+ */
+@Component
+public class DEAC03232 extends QCCatalogue {
+    /**
+     * 1.(死亡病例讨论记录)存在,查看文书结构化(性别)和文书内是否有包含(男性/女性/男/女/性别男/性别女),存在则统一提取出
+     * 2.获取住院信息表,查看性别和(死亡病例讨论记录)中提出的性别处理过同义词后是否一致,任一不一致则报出
+     * */
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        String gender = "";
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        DeathCaseDiscussDoc deathCaseDiscussDoc = inputInfo.getDeathCaseDiscussDoc();
+        if (medicalRecordInfoDoc == null || deathCaseDiscussDoc == null) {
+            return;
+        }
+        gender = medicalRecordInfoDoc.getStructureMap().get("sex");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        Map<String, String> structureMap = deathCaseDiscussDoc.getStructureMap();
+        String firCGender = structureMap.get("性别");
+        String text = structureMap.get("原始文本");
+        if (gender.contains("男")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("女")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("女")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (gender.contains("女")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("男")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("男")) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 64 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/deathrecord/DEAR03233.java

@@ -0,0 +1,64 @@
+package com.lantone.qc.kernel.catalogue.hospital.shengzhouyy.deathrecord;
+
+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.DeathCaseDiscussDoc;
+import com.lantone.qc.pub.model.doc.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : DEAR03233
+ * @Description: 死亡记录内性别和基本信息不一致
+ * @author: wsy
+ * @time: 2022/5/18 15:15
+ */
+@Component
+public class DEAR03233 extends QCCatalogue {
+    /**
+     * 1.(死亡记录)存在,查看文书结构化(性别)和文书内是否有包含(男性/女性/男/女/性别男/性别女),存在则统一提取出
+     * 2.获取住院信息表,查看性别和(死亡记录)中提出的性别处理过同义词后是否一致,任一不一致则报出
+     * */
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        String gender = "";
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+        if (medicalRecordInfoDoc == null || deathRecordDoc == null) {
+            return;
+        }
+        gender = medicalRecordInfoDoc.getStructureMap().get("sex");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        Map<String, String> structureMap = deathRecordDoc.getStructureMap();
+        String firCGender = structureMap.get("性别");
+        String text = structureMap.get("原始文本");
+        if (gender.contains("男")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("女")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("女")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (gender.contains("女")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("男")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("男")) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 62 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/firstcourserecord/FIRC03230.java

@@ -0,0 +1,62 @@
+package com.lantone.qc.kernel.catalogue.hospital.shengzhouyy.firstcourserecord;
+
+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.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRC03230
+ * @Description : 首次病程录内性别和基本信息不一致
+ * @Author : wangsy
+ * @Date: 2022-05-18 17:28
+ */
+@Component
+public class FIRC03230 extends QCCatalogue {
+    /**
+     * 1.首次病程录存在,查看文书结构化(性别)和文书内是否有包含(男性/女性/男/女/性别男/性别女),存在则统一提取出
+     * 2.获取住院信息表,查看性别和首次病程录中提出的性别处理过同义词后是否一致,任一不一致则报出
+     */
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        String gender = "";
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (medicalRecordInfoDoc == null || firstCourseRecordDoc == null) {
+            return;
+        }
+        gender = medicalRecordInfoDoc.getStructureMap().get("sex");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        Map<String, String> structureMap = firstCourseRecordDoc.getStructureMap();
+        String firCGender = structureMap.get("性别");
+        String text = structureMap.get("原始文本");
+        if (gender.contains("男")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("女")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("女")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (gender.contains("女")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("男")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("男")) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 63 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/shengzhouyy/leavehospital/LEA03231.java

@@ -0,0 +1,63 @@
+package com.lantone.qc.kernel.catalogue.hospital.shengzhouyy.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.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : LEA03231
+ * @Description: 出院记录内性别和基本信息不一致
+ * @author: wsy
+ * @time: 2022/5/18 15:15
+ */
+@Component
+public class LEA03231 extends QCCatalogue {
+    /**
+     * 1.(出院存小结/出院记录)存在,查看文书结构化(性别)和文书内是否有包含(男性/女性/男/女/性别男/性别女),存在则统一提取出
+     * 2.获取住院信息表,查看性别和(出院存小结/出院记录)中提出的性别处理过同义词后是否一致,任一不一致则报出
+     * */
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        String gender = "";
+        MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (medicalRecordInfoDoc == null || leaveHospitalDoc == null) {
+            return;
+        }
+        gender = medicalRecordInfoDoc.getStructureMap().get("sex");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
+        String firCGender = structureMap.get("性别");
+        String text = structureMap.get("原始文本");
+        if (gender.contains("男")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("女")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("女")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (gender.contains("女")) {
+            if (StringUtil.isNotBlank(firCGender) && firCGender.contains("男")) {
+                status.set("-1");
+                return;
+            }
+            if (StringUtil.isNotBlank(text) && text.contains("男")) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 48 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xszyy/clinicalblood/CLI0308.java

@@ -0,0 +1,48 @@
+package com.lantone.qc.kernel.catalogue.hospital.xszyy.clinicalblood;
+
+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.ClinicalBloodDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0308
+ * @Description :  输血记录中未记录是否有不良反应
+ * @Author : 贺聪聪
+ * @Date: 2022-05-23 15:10
+ */
+@Component
+public class CLI0308 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();//输血/血制品病程记录
+        if (ListUtil.isEmpty(clinicalBloodDocs)) {
+            status.set("0");
+            return;
+        }
+
+        if (clinicalBloodDocs != null && clinicalBloodDocs.size() > 0) {
+             String regex = ".*(未.*|无.*|否.*).*(输血反应|不良反应).*";
+            for (ClinicalBloodDoc cliB : clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                if(StringUtils.isNotEmpty(cliBStructureMap.get("病历内容")) && (cliBStructureMap.get("病历内容").contains("不良反应")
+                        || cliBStructureMap.get("病历内容").contains("不适") || cliBStructureMap.get("病历内容").contains("未见")
+                        || cliBStructureMap.get("病历内容").contains("未觉") || cliBStructureMap.get("病历内容").contains("不良")
+                        || cliBStructureMap.get("病历内容").contains(regex))){
+                    status.set("0");
+                    break;
+                }else {
+                    status.set("-1");
+                }
+            }
+        } else {
+            status.set("0");
+        }
+
+    }
+}

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xszyy/clinicalblood/CLI0568.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.hospital.xszyy.clinicalblood;
+
+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.model.doc.ClinicalBloodDoc;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0568
+ * @Description :  输血记录输血记录时间未填写
+ * @Author : 贺聪聪
+ * @Date: 2022-05-20 13:28
+ */
+@Component
+public class CLI0568 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();//输血/血制品病程记录
+
+        if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
+            for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
+                Map<String, String> cliBStructureMap = cliB.getStructureMap();
+                if(cliBStructureMap.containsKey("病历日期")){
+                    if(StringUtils.isEmpty(cliBStructureMap.get("病历日期"))){
+                        status.set("-1");
+                        break;
+                    }
+                }else {
+                    status.set("-1");
+                    break;
+                }
+            }
+        }
+
+    }
+}

+ 7 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03111.java

@@ -43,6 +43,13 @@ public class OPE03111 extends QCCatalogue {
                 if (operationRecordDoc == null) {
                    return;
                 }
+                String pathological = operationRecordDoc.getStructureMap().get("病理检查");
+                if (StringUtil.isNotEmpty(pathological)){
+                    if (pathological.contains("送")){
+                        status.set("0");
+                        continue;
+                    }
+                }
             }
         }
 

+ 43 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03234.java

@@ -0,0 +1,43 @@
+package com.lantone.qc.kernel.catalogue.operationdiscussion;
+
+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.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * @Description: 手术记录中手术日期未填写
+ * @author 贺聪聪
+ * @data 2022/5/23  17:25
+ */
+@Component
+public class OPE03234 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs == null || operationDocs.size() == 0){
+            status.set("0");
+            return;
+        }
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            long count = operationDocs.stream().filter(operationDoc -> {
+                boolean flag = false;
+                if (operationDoc.getOperationRecordDoc() != null
+                        && StringUtil.isBlank(operationDoc.getOperationRecordDoc().getStructureMap().get("手术日期"))) {
+                    flag = true;
+                }
+                return flag;
+            }).count();
+            if (count > 0) {
+                status.set("-1");
+            }
+        }
+    }
+}

+ 3 - 3
public/src/main/java/com/lantone/qc/pub/util/DateUtil.java

@@ -62,17 +62,17 @@ public class DateUtil {
     /**
      * 中文全称  如:2010年12月01日  23时15分06秒
      */
-    public static String FORMAT_LONG_CN = "yyyy年MM月dd日  HH时mm分ss秒";
+    public static String FORMAT_LONG_CN = "yyyy年MM月dd日 HH时mm分ss秒";
 
     /**
      * 中文全称精确到分钟  如:2010年12月01日  23时15分
      */
-    public static String FORMAT_LONG_CN_MI = "yyyy年MM月dd日  HH时mm分";
+    public static String FORMAT_LONG_CN_MI = "yyyy年MM月dd日 HH时mm分";
 
     /**
      * 精确到毫秒的完整中文时间
      */
-    public static String FORMAT_FULL_CN = "yyyy年MM月dd日  HH时mm分ss秒SSS毫秒";
+    public static String FORMAT_FULL_CN = "yyyy年MM月dd日 HH时mm分ss秒SSS毫秒";
 
 
     /**

+ 32 - 4
trans/src/main/java/com/lantone/qc/trans/xszyy/util/BeiLunFirstCourseRecordHtmlAnalysis.java

@@ -35,15 +35,43 @@ public class BeiLunFirstCourseRecordHtmlAnalysis implements BeiLunHtmlAnalysis {
             );
             String htmlContent = XszyyCommonAnalysisUtil.html2String(doc.toString());
             if (StringUtil.isNotBlank(htmlContent)) {
+                //有冒号
+                //XszyyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
                 //无冒号版本
                 XszyyCommonAnalysisUtil.html2StructureMapNoColon(titles,htmlContent,structureMap);
+                if(XszyyCommonAnalysisUtil.extractDate(htmlContent)!=null){
+                    structureMap.put("病历日期",XszyyCommonAnalysisUtil.extractDate(htmlContent.replace(":",":")));
+                }
                 if(htmlContent.contains("病历特点")){
-                    structureMap.put("病历内容",htmlContent.substring(0,htmlContent.indexOf("病历特点")));
+                    structureMap.put("病历内容",htmlContent.substring(0,htmlContent.indexOf("病历特点")).replace(recTitle,""));
                 }else if(htmlContent.contains("病例特点")){
-                    structureMap.put("病历内容",htmlContent.substring(0,htmlContent.indexOf("出院记录内容缺诊疗经过")));
+                    structureMap.put("病历内容",htmlContent.substring(0,htmlContent.indexOf("病例特点")).replace(recTitle,""));
                 }
-                if(XszyyCommonAnalysisUtil.extractDate(htmlContent)!=null){
-                    structureMap.put("病历日期",XszyyCommonAnalysisUtil.extractDate(htmlContent));
+                structureMap.put("病历内容",structureMap.get("病历内容").replace(":",":").replace(structureMap.get("病历日期"),""));
+
+                List<String> specialString = Lists.newArrayList(
+                        "无需其他特殊鉴别诊断","无需鉴别","无须鉴别"
+                );
+                if(StringUtil.isNotEmpty(structureMap.get("西医诊断依据及鉴别诊断"))){
+                    String diag=structureMap.get("西医诊断依据及鉴别诊断");
+                    if(diag.contains("入院诊断")){
+                        int index=diag.indexOf("入院诊断");
+                        structureMap.put("初步诊断",diag.substring(index));
+                        diag=diag.replace(structureMap.get("初步诊断"),"");
+                    }
+                    if(StringUtil.isEmpty(structureMap.get("西医诊断依据")) && StringUtil.isEmpty(structureMap.get("西医鉴别诊断"))){
+                        structureMap.put("西医诊断依据",diag);
+                        structureMap.put("西医诊断依据及鉴别诊断","");
+                        /*for (String specialC:specialString){
+                            if(structureMap.get("西医诊断依据").contains(specialC)){
+                                structureMap.put("西医鉴别诊断","无需鉴别");
+                            }
+                        }*/
+                    }
+                }
+                if(StringUtil.isNotEmpty(structureMap.get("拟诊讨论")) && StringUtil.isEmpty(structureMap.get("中医辨病辩证依据及鉴别诊断"))){
+                    structureMap.put("中医辨病辩证依据及鉴别诊断",structureMap.get("拟诊讨论"));
+                    structureMap.put("拟诊讨论","");
                 }
             }
             structureMap.put("标题",recTitle);