Jelajahi Sumber

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

MarkHuang 5 tahun lalu
induk
melakukan
f5a073cca7

+ 17 - 13
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0095.java

@@ -1,7 +1,6 @@
 package com.lantone.qc.kernel.catalogue.firstcourserecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
-import com.lantone.qc.kernel.util.RedisUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
@@ -9,7 +8,7 @@ import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 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 com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -24,14 +23,10 @@ import java.util.List;
  */
 @Component
 public class FIRC0095 extends QCCatalogue {
-    @Autowired
-    private RedisUtil redisUtil;
-
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-
         FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
         BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
-        if (firstCourseRecordDoc == null && beHospitalizedDoc == null) {
+        if (firstCourseRecordDoc == null || beHospitalizedDoc == null) {
             status.set("0");
             return;
         }
@@ -43,16 +38,25 @@ public class FIRC0095 extends QCCatalogue {
             List<String> firstDiags = new ArrayList<>();
             List<String> bhDiags = new ArrayList<>();
             if (diags != null && diags.size() > 0) {
-                for (Diag firdiag : diags) {
-                    firstDiags.add(firdiag.getHospitalDiagName());
-                }
-                for (Diag bhDig : diags1) {
-                    bhDiags.add(bhDig.getHospitalDiagName());
-                }
+                copyDiag(diags, firstDiags);
+                copyDiag(diags1, bhDiags);
                 if (ListUtil.equals(firstDiags, bhDiags)) {
                     status.set("0");
                 }
             }
         }
     }
+
+    private void copyDiag(List<Diag> diags, List<String> diagList) {
+        String hospitalDiagName, name;
+        for (Diag diag : diags) {
+            hospitalDiagName = diag.getHospitalDiagName();
+            name = diag.getName();
+            if (StringUtil.isNotBlank(hospitalDiagName)) {
+                diagList.add(hospitalDiagName);
+            } else if (StringUtil.isNotBlank(name)) {
+                diagList.add(name);
+            }
+        }
+    }
 }

+ 11 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0257.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -39,9 +40,12 @@ public class FIRP0257 extends QCCatalogue {
             } else {
                 situation = "不符合";
             }
-            String o_i = firstpageStructureMap.get(Content.o_i).toString();
-            if (!CatalogueUtil.isEmpty(o_i) && !CatalogueUtil.compareToken(o_i,situation)) {
-                status.set("-1");
+            Object o_iObj = firstpageStructureMap.get(Content.o_i);
+            if (o_iObj != null){
+                String o_i = o_iObj.toString();
+                if (!CatalogueUtil.isEmpty(o_i) && !CatalogueUtil.compareToken(o_i,situation)) {
+                    status.set("-1");
+                }
             }
         }
     }
@@ -57,7 +61,10 @@ public class FIRP0257 extends QCCatalogue {
     private List<String> getFirstpageDischargeDiag(List<Map<String, String>> outpatientEmergencyDiagList) {
         List<String> firstpageDischargeDiag = new ArrayList<>();
         for (Map<String, String> outpatientEmergencyDiag : outpatientEmergencyDiagList) {
-            firstpageDischargeDiag.add(outpatientEmergencyDiag.get(Content.diagnoseName));
+            String diag = outpatientEmergencyDiag.get(Content.diagnoseName);
+            if (StringUtil.isNotBlank(diag)) {
+                firstpageDischargeDiag.add(diag);
+            }
         }
         return firstpageDischargeDiag;
     }

+ 6 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java

@@ -36,19 +36,22 @@ public class LEA0149 extends QCCatalogue {
                 Map<String, String> lhStructureMap = leaveHospitalDoc.getStructureMap();
                 ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
                 if (lhStructureMap != null && chiefLabel != null) {
-                    String bhChief = chiefLabel.getText().replaceAll("[\\p{Punct}\\pP。]", "");
+                    String bhChief = chiefLabel.getText().replaceAll("[\\p{Punct}\\pP。-]", "");
                     String leaveChief = lhStructureMap.get("主诉");
                     String bhThings = lhStructureMap.get("入院情况");
+                    if (StringUtil.isNotBlank(bhThings)){
+                        bhThings = bhThings.replaceAll("[\\p{Punct}\\pP。-]", "");
+                    }
 
                     //如果出院小结结构化数据能取出主诉,则直接用该主诉和入院记录主诉比较
                     if (StringUtil.isNotBlank(leaveChief)) {
-                        leaveChief = leaveChief.replaceAll("[\\p{Punct}\\pP。]", "");
+                        leaveChief = leaveChief.replaceAll("[\\p{Punct}\\pP。-]", "");
                         if (bhChief.equals(leaveChief)) {
                             status.set("0");
                             return;
                         }
                     }
-                    if(StringUtil.isNotBlank(bhThings)&&bhThings.indexOf(bhChief)>-1){
+                    if (StringUtil.isNotBlank(bhThings) && bhThings.contains(bhChief)) {
                         status.set("0");
                         return;
                     }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0156.java

@@ -29,7 +29,7 @@ public class LEA0156 extends QCCatalogue {
         if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
             Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
             if (structureMap != null) {
-                if (StringUtils.isBlank(structureMap.get("健康教育"))) {
+                if (StringUtils.isBlank(structureMap.get("健康教育")) && StringUtils.isBlank(structureMap.get("出院医嘱"))) {
                     status.set("-1");
                 }
             }

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

@@ -60,10 +60,11 @@ public class FirstCourseRecordAI extends ModelAI {
             }
             //诊疗计划
             if (StringUtils.isNotEmpty(structureMap.get("诊疗计划")) && StringUtils.isNotEmpty(structureMap.get("需求评估"))) {
-                putContent(crfContent, medicalTextType.get(2), structureMap.get("需求评估") + StringUtils.isNotEmpty(structureMap.get("诊疗计划")), "诊疗计划");
-                firstCourseRecordDoc.getTreatPlanLabel().setText(structureMap.get("需求评估") + StringUtils.isNotEmpty(structureMap.get("诊疗计划")));
+                putContent(crfContent, medicalTextType.get(2), structureMap.get("诊疗计划") + structureMap.get("需求评估"), "诊疗计划");
+                firstCourseRecordDoc.getTreatPlanLabel().setText(structureMap.get("诊疗计划") + structureMap.get("需求评估"));
             } else if (StringUtils.isNotEmpty(structureMap.get("诊疗计划"))) {
                 putContent(crfContent, medicalTextType.get(2), structureMap.get("诊疗计划"), "诊疗计划");
+                firstCourseRecordDoc.getTreatPlanLabel().setText(structureMap.get("诊疗计划"));
             } else if (StringUtils.isNotEmpty(structureMap.get("需求评估"))) {
                 putContent(crfContent, medicalTextType.get(2), structureMap.get("需求评估"), "诊疗计划");
                 firstCourseRecordDoc.getTreatPlanLabel().setText(structureMap.get("需求评估"));

+ 11 - 6
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessOperationDiscussion.java

@@ -99,7 +99,7 @@ public class EntityProcessOperationDiscussion extends EntityProcess {
         String subContentIndex = "", title = "";
         for (int i = 0; i < lemmaList.size(); i++) {
             lemma = lemmaList.get(i);
-            if (!titleList.contains(lemma.getProperty())) {
+            if (!titleList.contains(lemma.getProperty()) && i != lemmaList.size() - 1) {
                 continue;
             }
             if (i != lemmaList.size() - 1) {
@@ -107,18 +107,23 @@ public class EntityProcessOperationDiscussion extends EntityProcess {
                     start = Integer.parseInt(lemma.getPosition());
                     title = lemma.getProperty();//截取的这一段文本的标题
                 } else {
-                    //subContent = content.substring(start + title.length(), Integer.parseInt(lemma.getPosition()));
                     subContentIndex = start + lemma.getText().length() + 1 + "," + Integer.parseInt(lemma.getPosition());
                     putSubContent(titleText, title, subContentIndex);
                     start = Integer.parseInt(lemma.getPosition());
                     title = lemma.getProperty();//截取的这一段文本的标题
                 }
             } else {
-                //如果是最后一个Lemma,文本就从start开始取,取到结束
-                //subContent = content.substring((start + lemma.getText().length()));
-                int lastIndex = content.length() - 1;
-                subContentIndex = start + lemma.getText().length() + "," + lastIndex;
+                //将倒数第二个标题存入结构
+                subContentIndex = start + "," + Integer.parseInt(lemma.getPosition());
                 putSubContent(titleText, title, subContentIndex);
+                //如果是最后一个Lemma,文本就从当前lemma的position开始取,取到结束
+                title = lemma.getProperty();//截取的这一段文本的标题
+                if (titleList.contains(title)) {
+                    start = Integer.parseInt(lemma.getPosition());
+                    int lastIndex = content.length() - 1;
+                    subContentIndex = start + "," + lastIndex;
+                    putSubContent(titleText, title, subContentIndex);
+                }
             }
         }
         return titleText;

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

@@ -60,7 +60,7 @@ public class ChangxFirstCourseRecordDocTrans extends ModelDocTrans {
         });
         Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
         for (String key : sourceMap.keySet()) {
-            retMap.put(key.replaceAll("[一二三四五六七八九十][、.]", ""), sourceMap.get(key));
+            retMap.put(key.replaceAll("[一二三四五六七八九十、.]", ""), sourceMap.get(key));
         }
         return retMap;
     }

+ 12 - 4
trans/src/main/java/com/lantone/qc/trans/changx/ChangxTransferRecordDocTrans.java

@@ -15,6 +15,7 @@ import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -37,10 +38,17 @@ public class ChangxTransferRecordDocTrans extends ModelDocTrans {
         List<String> into = contentMap.get("转入记录");
         List<String> out = contentMap.get("转出记录");
         List<String> all = new ArrayList<>();
-        all.addAll(into);
-        all.addAll(out);
-        Map<String, TransferIntoDoc> transferIntoDocMap = getTransferIntoDocMap(into);
-        Map<String, TransferOutDoc> transferOutDocMap = getTransferOutDocMap(out);
+
+        Map<String, TransferIntoDoc> transferIntoDocMap = new HashMap<>();
+        Map<String, TransferOutDoc> transferOutDocMap = new HashMap<>();
+        if (into != null){
+            all.addAll(into);
+            transferIntoDocMap = getTransferIntoDocMap(into);
+        }
+        if (out != null){
+            all.addAll(out);
+            transferOutDocMap = getTransferOutDocMap(out);
+        }
         Map<String, TransferRecordDoc> transferAllDocMap = getTransferAllDocMap(all);
 
         //转入