Browse Source

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

wangyu 5 years ago
parent
commit
63b81824f0

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

@@ -2,6 +2,7 @@ package com.lantone.qc.kernel.structure.ai;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.client.CRFServiceClient;
 import com.lantone.qc.kernel.client.SimilarityServiceClient;
 import com.lantone.qc.kernel.structure.ai.process.EntityProcessClinic;
@@ -68,6 +69,10 @@ public class FirstCourseRecordAI extends ModelAI {
                 putContent(crfContent, medicalTextType.get(1), diffDiag, "鉴别诊断");
             }
             //诊疗计划
+            List<String> keys = Lists.newArrayList("需求评估", "预期目标", "诊疗计划", "治疗监测计划");
+            String treatPlanJoin = treatPlanJoin(structureMap, keys);
+            putContent(crfContent, medicalTextType.get(2), treatPlanJoin, "诊疗计划");
+            /*
             if (StringUtils.isNotEmpty(structureMap.get("诊疗计划")) && StringUtils.isNotEmpty(structureMap.get("需求评估"))) {
                 putContent(crfContent, medicalTextType.get(2), structureMap.get("诊疗计划") + structureMap.get("需求评估"), "诊疗计划");
                 firstCourseRecordDoc.getTreatPlanLabel().setText(structureMap.get("诊疗计划") + structureMap.get("需求评估"));
@@ -80,6 +85,7 @@ public class FirstCourseRecordAI extends ModelAI {
             } else {
                 putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getTreatPlanLabel().getText(), "诊疗计划");
             }
+             */
 
             //病历特点与现病史比较相似度
             if (inputInfo.getBeHospitalizedDoc() != null && StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getPresentLabel().getText())) {
@@ -87,10 +93,10 @@ public class FirstCourseRecordAI extends ModelAI {
                 if (StringUtil.isNotBlank(structureMap.get("现病史"))) {
                     putContent(similarContent, structureMap.get("现病史"), inputInfo.getBeHospitalizedDoc().getPresentLabel().getText());
                 }
-//                else if (firstCourseRecordDoc.getCaseCharacteristicLabel() != null && StringUtil.isNotBlank(firstCourseRecordDoc.getCaseCharacteristicLabel().getText())) {
-//                    //再从doc找病例特点
-//                    putContent(similarContent, firstCourseRecordDoc.getCaseCharacteristicLabel().getText(), inputInfo.getBeHospitalizedDoc().getPresentLabel().getText());
-//                }
+                //                else if (firstCourseRecordDoc.getCaseCharacteristicLabel() != null && StringUtil.isNotBlank(firstCourseRecordDoc.getCaseCharacteristicLabel().getText())) {
+                //                    //再从doc找病例特点
+                //                    putContent(similarContent, firstCourseRecordDoc.getCaseCharacteristicLabel().getText(), inputInfo.getBeHospitalizedDoc().getPresentLabel().getText());
+                //                }
             }
 
             JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
@@ -213,4 +219,17 @@ public class FirstCourseRecordAI extends ModelAI {
         treatPlanLabel.setText(inputInfo.getFirstCourseRecordDoc().getTreatPlanLabel().getText());
         inputInfo.getFirstCourseRecordDoc().setTreatPlanLabel(treatPlanLabel);
     }
+
+    /**
+     * 拼接诊疗计划
+     **/
+    private String treatPlanJoin(Map<String, String> structureMap, List<String> keys) {
+        String treatPlan = "";
+        for (String key : keys) {
+            if (StringUtil.isNotBlank(structureMap.get(key))) {
+                treatPlan += key + ":" + structureMap.get(key) + "\n";
+            }
+        }
+        return treatPlan;
+    }
 }