Browse Source

义乌 CRF处理修改取值

wangsy 4 years ago
parent
commit
d05d26c9f8

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ConsultationAI.java

@@ -30,7 +30,7 @@ public class ConsultationAI extends ModelAI {
     public static String entityRelationObject = "entity_relation_object";
     public static String entityRelationObject = "entity_relation_object";
     public static String outputs = "outputs";
     public static String outputs = "outputs";
     public static String content = "content";
     public static String content = "content";
-    public static List<String> mapKey = Lists.newArrayList("会诊意见");
+    public static List<String> mapKey = Lists.newArrayList("会诊意见", "病程内容");
 
 
     public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient) {
     public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient) {
         JSONArray crfContent = new JSONArray();
         JSONArray crfContent = new JSONArray();

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

@@ -87,7 +87,7 @@ public class FirstCourseRecordAI extends ModelAI {
                 putContent(crfContent, medicalTextType.get(2), treatPlanLabel.getAiText(), "诊疗计划");
                 putContent(crfContent, medicalTextType.get(2), treatPlanLabel.getAiText(), "诊疗计划");
             }
             }
 
 
-            String drugContent = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("疗计划"));
+            String drugContent = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("疗计划"));
             putContent(crfContent, medicalTextType.get(3), drugContent, "药品");
             putContent(crfContent, medicalTextType.get(3), drugContent, "药品");
             /*
             /*
             if (StringUtils.isNotEmpty(structureMap.get("诊疗计划")) && StringUtils.isNotEmpty(structureMap.get("需求评估"))) {
             if (StringUtils.isNotEmpty(structureMap.get("诊疗计划")) && StringUtils.isNotEmpty(structureMap.get("需求评估"))) {

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

@@ -47,7 +47,7 @@ public class OperationAI extends ModelAI {
                 OperationRecordDoc operationRecordDoc = operationDocs.get(i).getOperationRecordDoc();
                 OperationRecordDoc operationRecordDoc = operationDocs.get(i).getOperationRecordDoc();
                 Map<String, String> structureMap = operationRecordDoc.getStructureMap();
                 Map<String, String> structureMap = operationRecordDoc.getStructureMap();
                 //存放抓取的药品
                 //存放抓取的药品
-                String content = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("手术简要经过"));
+                String content = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("手术经过及处理", "手术中用药(化疗等药物)"));
                 putContent(crfContent, medicalTextType.get(1), content, "手术记录" + i + "药物");
                 putContent(crfContent, medicalTextType.get(1), content, "手术记录" + i + "药物");
             }
             }
             if (operationDocs.get(i).getOperationDiscussionDoc() != null) {
             if (operationDocs.get(i).getOperationDiscussionDoc() != null) {
@@ -56,7 +56,7 @@ public class OperationAI extends ModelAI {
                 String discussionText = CatalogueUtil.structureMapJoin(structureMap, discussionKey);
                 String discussionText = CatalogueUtil.structureMapJoin(structureMap, discussionKey);
                 putContent(crfContent, medicalTextType.get(0), discussionText, Content.operation_Discussion + i);
                 putContent(crfContent, medicalTextType.get(0), discussionText, Content.operation_Discussion + i);
                 //存放抓取的药品
                 //存放抓取的药品
-                String content = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("治疗计划和措施"));
+                String content = CatalogueUtil.structureMapJoin(structureMap, Lists.newArrayList("治疗计划和措施", "术后处理措施"));
                 putContent(crfContent, medicalTextType.get(1), content, Content.operation_Discussion + i + "药物");
                 putContent(crfContent, medicalTextType.get(1), content, Content.operation_Discussion + i + "药物");
             }
             }
         }
         }

+ 14 - 2
trans/src/main/java/com/lantone/qc/trans/yiwu/YiWuLeaveHospitalDocTrans.java

@@ -4,11 +4,14 @@ import com.google.common.collect.Lists;
 import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
 import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
 import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.model.label.LeaveHospitalDoctorAdviceLabel;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import org.apache.commons.lang3.StringUtils;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -30,8 +33,8 @@ public class YiWuLeaveHospitalDocTrans extends ModelDocTrans {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
         } else {
             Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
             Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            List<String> titles = Lists.newArrayList( "入院时间","出院时间","住院天数","入院诊断","出院诊断","出院诊断"
-                    ,"入院情况","住院经过","出院情况","出院医嘱","医师签名","签名时间","主诉","诊疗过程","医师签名时间");
+            List<String> titles = Lists.newArrayList("入院时间", "出院时间", "住院天数", "入院诊断", "出院诊断", "出院诊断"
+                    , "入院情况", "住院经过", "出院情况", "出院医嘱", "医师签名", "签名时间", "主诉", "诊疗过程", "医师签名时间");
             String text = sourceMap.get("原始文本");
             String text = sourceMap.get("原始文本");
             List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
             List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
             CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
             CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
@@ -43,9 +46,18 @@ public class YiWuLeaveHospitalDocTrans extends ModelDocTrans {
         LeaveHospitalDoc leaveHospitalDoc = new LeaveHospitalDoc();
         LeaveHospitalDoc leaveHospitalDoc = new LeaveHospitalDoc();
         leaveHospitalDoc.setStructureMap(structureMap);
         leaveHospitalDoc.setStructureMap(structureMap);
         leaveHospitalDoc.setPageData((Map) structureMap);
         leaveHospitalDoc.setPageData((Map) structureMap);
+        if (StringUtil.isNotEmpty(structureMap.get("原始文本"))) {
+            leaveHospitalDoc.setText(structureMap.get("原始文本"));
+        }
         if (structureMap.containsKey("记录医生") && "记录医师".equals(structureMap.get("记录医生"))) {
         if (structureMap.containsKey("记录医生") && "记录医师".equals(structureMap.get("记录医生"))) {
             structureMap.put("记录医生", "");
             structureMap.put("记录医生", "");
         }
         }
+        if (StringUtils.isNotEmpty(structureMap.get("出院医嘱"))) {
+            LeaveHospitalDoctorAdviceLabel leaveHospitalDoctorAdviceLabel = new LeaveHospitalDoctorAdviceLabel();
+            leaveHospitalDoctorAdviceLabel.setText(structureMap.get("出院医嘱"));
+            leaveHospitalDoctorAdviceLabel.setAiText(structureMap.get("出院医嘱"));
+            leaveHospitalDoc.setLeaveHospitalDoctorAdviceLabel(leaveHospitalDoctorAdviceLabel);
+        }
 
 
         return leaveHospitalDoc;
         return leaveHospitalDoc;
     }
     }