Pārlūkot izejas kodu

阶段小结/抢救记录

chengyao 4 gadi atpakaļ
vecāks
revīzija
f191540a1e

+ 3 - 7
structure-center/src/main/java/com/lantone/structure/facade/StructureFacade.java

@@ -3,11 +3,7 @@ package com.lantone.structure.facade;
 import com.lantone.structure.client.CRFServiceClient;
 import com.lantone.structure.client.SimilarityServiceClient;
 import com.lantone.structure.dto.AnalysisDTO;
-import com.lantone.structure.facade.tran.CesareanSectionTran;
-import com.lantone.structure.facade.tran.ClinicalBloodTran;
-import com.lantone.structure.facade.tran.RescueTran;
-import com.lantone.structure.facade.tran.StagesSummaryTran;
-import com.lantone.structure.facade.tran.TargetTran;
+import com.lantone.structure.facade.tran.*;
 import com.lantone.structure.vo.AnalysisVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,7 +30,7 @@ public class StructureFacade {
             case "剖宫产记录":
                 targetTran = new CesareanSectionTran();
                 break;
-            /*case "输血记录":
+            case "输血记录":
                 targetTran = new ClinicalBloodTran();
                 break;
             case "抢救记录":
@@ -42,7 +38,7 @@ public class StructureFacade {
                 break;
             case "阶段小结":
                 targetTran = new StagesSummaryTran();
-                break;*/
+                break;
             default:
                 break;
         }

+ 58 - 67
structure-center/src/main/java/com/lantone/structure/facade/tran/ClinicalBloodTran.java

@@ -1,15 +1,13 @@
 package com.lantone.structure.facade.tran;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONException;
-import com.alibaba.fastjson.JSONObject;
-import com.lantone.common.util.FastJsonUtils;
+import com.lantone.common.util.ListUtil;
 import com.lantone.structure.model.doc.ClinicalBloodDoc;
-import com.lantone.structure.util.MapUtil;
+import com.lantone.structure.model.entity.Indication;
+import com.lantone.structure.model.entity.ResponseType;
+import com.lantone.structure.model.label.ClinicalBloodLabel;
 import lombok.extern.slf4j.Slf4j;
-
+import org.apache.commons.lang3.StringUtils;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -28,79 +26,72 @@ public class ClinicalBloodTran extends TargetTran {
         clinicalBloodDoc.setText(text);
         clinicalBloodDocList.add(clinicalBloodDoc);
         inputInfo.setClinicalBloodDocs(clinicalBloodDocList);
-        return null;
+        aiProcess();
+        Map<String, String> structureMap = new HashMap<>();
+        bloodContrast(inputInfo.getClinicalBloodDocs(), structureMap);
+        return structureMap;
     }
 
-    public void bloodKeyContrastCommon(Map sourceMap, Map<String, String> keyContrastMap, Map<String, String> retMap) {
-        Map<String, Object> sourceMap_ = MapUtil.copyMap(sourceMap);
-        for (Map.Entry<String, Object> dateEntry : sourceMap_.entrySet()) {
-            try {
-                Object object = JSON.parse(FastJsonUtils.getBeanToJson(dateEntry.getValue()));
-                if (object instanceof JSONObject) {
-                    Map<String, Object> firstJsonMap = FastJsonUtils.getJsonToMap(FastJsonUtils.getBeanToJson(dateEntry.getValue()));
-                    if (firstJsonMap.size() == 1) {
-                        String key = keyContrastMap.get(dateEntry.getKey());
-                        retMap.put(key, (String) firstJsonMap.get("name"));
-                    } else {
-                        StringBuffer sbX = new StringBuffer();
-                        for (Map.Entry<String, Object> firstDateEntry : firstJsonMap.entrySet()) {
-                            String beanToJson = FastJsonUtils.getBeanToJson(firstDateEntry.getValue());
-                            if (beanToJson.contains("name") || beanToJson.contains("measurementUnit")) {
-                                Map<String, Object> jsonToMap = FastJsonUtils.getJsonToMap(FastJsonUtils.getBeanToJson(firstDateEntry.getValue()));
-                                if (jsonToMap.size() == 1) {
-                                    String childKey = keyContrastMap.get(firstDateEntry.getKey());
-                                    if (retMap.containsKey(keyContrastMap.get(firstDateEntry.getKey()))) {
-                                        retMap.put(keyContrastMap.get(dateEntry.getKey()) + childKey, (String) jsonToMap.get("name"));
-                                    } else {
-                                        retMap.put(childKey, (String) jsonToMap.get("name"));
-                                    }
-                                } else {
-                                    for (Map.Entry<String, Object> typeObjectEntry : jsonToMap.entrySet()) {
-                                        Object value = typeObjectEntry.getValue();
-                                        if (value instanceof JSONObject) {
-                                            Map<String, Object> objToMap = FastJsonUtils.getJsonToMap(FastJsonUtils.getBeanToJson(value));
-                                            sbX.append(objToMap.get("name"));
-                                        } else {
-                                            sbX.append(jsonToMap.get("name"));
-                                        }
+        public void bloodContrast( List<ClinicalBloodDoc> clinicalBloodDocs, Map<String, String> retMap) {
+            if(ListUtil.isNotEmpty(clinicalBloodDocs)){
+                clinicalBloodDocs.forEach(clinicalBloodDoc -> {
+                    int indicationCount = 1;
+                    int responseTypeCount = 1;
+                    StringBuffer indicationString = new StringBuffer();
+                    StringBuffer responseTypeString  = new StringBuffer();
+                    ClinicalBloodLabel clinicalBlood = clinicalBloodDoc.getClinicalBloodLabel();
 
+                        if(ListUtil.isNotEmpty(clinicalBlood.getIndication())){
+                            for (Indication indications : clinicalBlood.getIndication()) {
+                                if(StringUtils.isNotEmpty( indications.getName())){
+                                    if(clinicalBlood.getIndication().size()>1){
+                                        indicationString.append((indicationCount++) + "." );
                                     }
+                                    indicationString.append(indications.getName());
                                 }
-                            } else {
-                                sbX.append(firstDateEntry.getValue());
+
                             }
-                            retMap.put(keyContrastMap.get(dateEntry.getKey()), sbX.toString());
+                            retMap.put("输血指征",indicationString.toString());
                         }
 
+                    if(clinicalBlood.getType()!= null){
+                        if(clinicalBlood.getType().getAmount()!= null && clinicalBlood.getType().getAmount().getMeasurementUnit()!= null &&
+                                StringUtils.isNotEmpty(clinicalBlood.getType().getAmount().getMeasurementUnit().getName())){
+                            retMap.put("输血量计量单位",clinicalBlood.getType().getAmount().getMeasurementUnit().getName());
+                        }
+                        if(clinicalBlood.getType().getAmount()!= null &&  StringUtils.isNotEmpty(clinicalBlood.getType().getAmount().getMeasurementUnit().getName())){
+                            retMap.put("输血量(mL)",clinicalBlood.getType().getAmount().getName());
+                        }
+                        if (StringUtils.isNotEmpty(clinicalBlood.getType().getName())){
+                            retMap.put("输血类型",clinicalBlood.getType().getName());
+                        }
+
+                    }
+                    if(clinicalBlood.getReason()!= null && StringUtils.isNotEmpty(clinicalBlood.getReason().getName())){
+                        retMap.put("输血原因",clinicalBlood.getReason().getName());
                     }
-                } else if (object instanceof JSONArray) {
-                    List<Map<String, Object>> jsonToListMap = FastJsonUtils.getJsonToListMap(FastJsonUtils.getBeanToJson(dateEntry.getValue()));
-                    int count = 1;
-                    StringBuffer sb = new StringBuffer();
-                    if (jsonToListMap.size() == 1) {
-                        Object name = jsonToListMap.get(0).get("name");
-                        retMap.put(keyContrastMap.get(dateEntry.getKey()), String.valueOf(name));
-                    } else {
-                        for (Map<String, Object> mapList : jsonToListMap) {
-                            for (Map.Entry<String, Object> stringObjectEntry : mapList.entrySet()) {
-                                if (stringObjectEntry.getKey() == "negative") {
-                                    Map<String, Object> negativeJsonMap = FastJsonUtils.getJsonToMap(FastJsonUtils.getBeanToJson(stringObjectEntry.getValue()));
-                                    Object negativeObject = negativeJsonMap.get("name");
-                                    sb.append((count++) + "." + (negativeObject == null ? "" : negativeObject));
-                                } else if (stringObjectEntry.getKey() == "name") {
-                                    sb.append(stringObjectEntry.getValue());
+                    if(clinicalBlood.getStartTime()!= null && StringUtils.isNotEmpty(clinicalBlood.getStartTime().getName())){
+                        retMap.put("输血开始时间",clinicalBlood.getStartTime().getName());
+                    }
+                    if(clinicalBlood.getEndTime()!= null && StringUtils.isNotEmpty(clinicalBlood.getEndTime().getName())){
+                        retMap.put("输血结束时间",clinicalBlood.getEndTime().getName());
+                    }
+
+                        if (ListUtil.isNotEmpty(clinicalBlood.getResponseType())) {
+                            for (ResponseType responseTypes : clinicalBlood.getResponseType()) {
+                                if(StringUtils.isNotEmpty( responseTypes.getName())){
+                                    if(clinicalBlood.getResponseType().size()>1){
+                                        responseTypeString.append((responseTypeCount++) + "." );
+                                    }
+                                    responseTypeString.append(responseTypes.getNegative().getName() + responseTypes.getName());
                                 }
                             }
+                            retMap.put("输血反应类型", responseTypeString.toString());
                         }
-                        retMap.put(keyContrastMap.get(dateEntry.getKey()), sb.toString());
-                    }
-
-                }
 
-            } catch (JSONException e) {
-                log.error(keyContrastMap.get(dateEntry.getKey()) + "json为空");
+                });
             }
         }
-    }
+
 
 }

+ 202 - 2
structure-center/src/main/java/com/lantone/structure/facade/tran/RescueTran.java

@@ -1,8 +1,14 @@
 package com.lantone.structure.facade.tran;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.common.util.ListUtil;
+import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
 import com.lantone.structure.model.doc.RescueDoc;
+import com.lantone.structure.model.entity.*;
+import com.lantone.structure.model.label.RescueLabel;
 import lombok.extern.slf4j.Slf4j;
-
+import org.apache.commons.lang3.StringUtils;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -22,7 +28,201 @@ public class RescueTran extends TargetTran {
         rescueDoc.setText(text);
         rescueDocList.add(rescueDoc);
         inputInfo.setRescueDocs(rescueDocList);
-        return null;
+        aiProcess();
+        Map<String, String> structureMap = cutWord(text);
+        rescueContrast(inputInfo.getRescueDocs(), structureMap);
+        return structureMap;
+    }
+
+    private Map<String, String> cutWord(String text) {
+        Map<String, String> sourceMap = Maps.newHashMap();
+        List<String> titles = CommonAnalysisUtil.sortTitles(
+                Lists.newArrayList("抢救措施","参与现场抢救的医务人员","注意事项"),
+                text
+        );
+        CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
+        if(sourceMap.containsKey("参与现场抢救的医务人员")){
+            sourceMap.remove("参与现场抢救的医务人员");
+        }
+        return sourceMap;
     }
 
+
+    public void rescueContrast( List<RescueDoc> rescueDocs,Map<String, String> retMap) {
+        if(ListUtil.isNotEmpty(rescueDocs)){
+            rescueDocs.forEach(rescueDoc -> {
+                int auxiliaryCount = 1;
+                int auxiliaryResultCount = 1;
+                int operationsCount = 1;
+                int operationLocationCount = 1;
+                int methodsCount = 1;
+                int count = 1;
+                int interventionCount = 1;
+                int conditionsCount = 1;
+                int diagnosisCount = 1;
+                int drugsCount = 1;
+                StringBuffer auxiliaryTestString = new StringBuffer();
+                StringBuffer auxiliaryResultString  = new StringBuffer();
+                StringBuffer operationsString = new StringBuffer();
+                StringBuffer operationLocationString = new StringBuffer();
+                StringBuffer methodsString = new StringBuffer();
+                StringBuffer countString = new StringBuffer();
+                StringBuffer conditionsString = new StringBuffer();
+                StringBuffer diagnosisString = new StringBuffer();
+                StringBuffer interventionString = new StringBuffer();
+                StringBuffer drugsString = new StringBuffer();
+                StringBuffer resMedString = new StringBuffer();
+
+                RescueLabel rescueLabel = rescueDoc.getRescueLabel();
+                    if(ListUtil.isNotEmpty( rescueLabel.getAuxiliaryTest())){
+                        for (AuxiliaryTest auxiliaryTest : rescueLabel.getAuxiliaryTest()) {
+                                for (AuxiliaryResult auxiliaryResult : auxiliaryTest.getAuxiliaryResult()) {
+                                    if(StringUtils.isNotEmpty( auxiliaryResult.getName())){
+                                        if(auxiliaryTest.getAuxiliaryResult().size()>1){
+                                            auxiliaryResultString.append((auxiliaryResultCount++) + ".");
+                                        }
+                                        auxiliaryResultString.append(auxiliaryResult.getName());
+                                    }
+                                }
+
+                            if(StringUtils.isNotEmpty(auxiliaryTest.getName())){
+                                if(rescueLabel.getAuxiliaryTest().size()>1) {
+                                    auxiliaryTestString.append((auxiliaryCount++) + ".");
+                                }
+                                auxiliaryTestString.append(auxiliaryTest.getName());
+                            }
+
+                        }
+                        retMap.put("检查/检验项目名称", auxiliaryTestString.toString());
+                        retMap.put("检查/检验结果", auxiliaryResultString.toString());
+                       }
+
+
+                    if(ListUtil.isNotEmpty( rescueLabel.getOperations())){
+                        for (Operation operations : rescueLabel.getOperations()) {
+                            if(StringUtils.isNotEmpty( operations.getOperationLocation().getName())){
+                                if(rescueLabel.getOperations().size()>1){
+                                    operationLocationString.append((operationLocationCount++) + ".");
+                                }
+                                operationLocationString.append(operations.getOperationLocation().getName());
+                            }
+                            if(StringUtils.isNotEmpty(operations.getName())){
+                                if(rescueLabel.getOperations().size()>1){
+                                    operationsString.append((operationsCount++) + ".");
+                                }
+                                operationsString.append( operations.getName());
+                            }
+
+                        }
+                        retMap.put("手术及操作名称", operationsString.toString());
+                        retMap.put("手术及操作目标部位名称", operationLocationString.toString());
+                        if(StringUtils.isNotEmpty(retMap.get("手术及操作名称"))){
+                            resMedString.append("手术及操作名称"+":"+retMap.get("手术及操作名称")+";");
+                        }
+
+                        if(StringUtils.isNotEmpty(retMap.get("手术及操作目标部位名称"))){
+                            resMedString.append("手术及操作目标部位名称"+":"+retMap.get("手术及操作目标部位名称")+";");
+                        }
+
+                  }
+
+
+                    if(ListUtil.isNotEmpty(rescueLabel.getMethods())){
+                        for (Method methods : rescueLabel.getMethods()) {
+                            if(StringUtils.isNotEmpty(methods.getName())){
+                                if(rescueLabel.getMethods().size()>1){
+                                    methodsString.append((methodsCount++) + ".");
+                                }
+                                methodsString.append( methods.getName());
+                            }
+                            if( methods.getCount() != null){
+                                if(rescueLabel.getMethods().size()>1){
+                                    countString.append((count++) + ".");
+                                }
+                                countString.append(methods.getName()+methods.getCount().getName());
+                            }
+                        }
+                        retMap.put("操作方法", methodsString.toString());
+                        retMap.put("操作次数", countString.toString());
+                        if(StringUtils.isNotEmpty(retMap.get("操作方法"))){
+                            resMedString.append("操作方法"+":"+retMap.get("操作方法")+";");
+                        }
+                        if(StringUtils.isNotEmpty(retMap.get("操作次数"))){
+                            resMedString.append("操作次数"+":"+retMap.get("操作次数")+";");
+                        }
+
+                        }
+
+
+                    if(ListUtil.isNotEmpty(rescueLabel.getInterventions())){
+                        for (Intervention intervention : rescueLabel.getInterventions()) {
+                            if(StringUtils.isNotEmpty(intervention.getName())){
+                                if(rescueLabel.getInterventions().size()>1){
+                                    interventionString.append((interventionCount++) + ".");
+                                }
+                                interventionString.append(intervention.getName());
+                            }
+                        }
+                        retMap.put("介入物名称",interventionString.toString());
+                    }
+
+
+
+                    if(ListUtil.isNotEmpty(rescueLabel.getConditions())){
+                        if(rescueLabel.getConditions().size()>1){
+                            if( null != (rescueLabel.getConditions().get(0).getPd()) && StringUtils.isNotEmpty(rescueLabel.getConditions().get(0).getPd().getValue())){
+                                retMap.put("抢救开始日期时间",rescueLabel.getConditions().get(0).getPd().getValue());
+                            }
+
+                            if( null != (rescueLabel.getConditions().get(rescueLabel.getConditions().size()-1).getPd()) && StringUtils.isNotEmpty(rescueLabel.getConditions().get(rescueLabel.getConditions().size()-1).getPd().getValue())){
+                                retMap.put("抢救开始日期时间",rescueLabel.getConditions().get(rescueLabel.getConditions().size()-1).getPd().getValue());
+                            }
+                        }
+                    for (Condition conditions : rescueLabel.getConditions()) {
+                        if(StringUtils.isNotEmpty(conditions.getName())){
+                            if(rescueLabel.getInterventions().size()>1){
+                                conditionsString.append((conditionsCount++) + ".");
+                            }
+                            conditionsString.append(conditions.getName());
+                        }
+
+                    }
+                    retMap.put("病情变化情况",conditionsString.toString());
+                  }
+
+
+
+                    if(ListUtil.isNotEmpty(rescueLabel.getDiagnosis())){
+                    for (Diagnosis diagnosis : rescueLabel.getDiagnosis()) {
+                        if(StringUtils.isNotEmpty(diagnosis.getName())){
+                            if(rescueLabel.getInterventions().size()>1){
+                                diagnosisString.append((diagnosisCount++) + ".");
+                            }
+                            diagnosisString.append(diagnosis.getName());
+                        }
+                    }
+                    retMap.put("疾病诊断名称", diagnosisString.toString());
+                  }
+
+
+                if(!retMap.containsKey("抢救措施")&&StringUtils.isEmpty(retMap.get("抢救措施"))){
+                    //抢救药品只会出现在抢救措施里面
+                    if(ListUtil.isNotEmpty(rescueLabel.getDrugs())){
+                        for (Drug drugs : rescueLabel.getDrugs()) {
+                            if(StringUtils.isNotEmpty(drugs.getName())){
+                                if(rescueLabel.getDrugs().size()>1){
+                                    drugsString.append((drugsCount++) + ".");
+                                }
+                                drugsString.append(drugs.getName());
+                            }
+                        }
+                        if(StringUtils.isNotEmpty( drugsString.toString())){
+                            resMedString.append("抢救药品"+":"+ drugsString.toString()+";");
+                        }
+                    }
+                    retMap.put("抢救措施",resMedString.toString());
+                }
+            });
+        }
+    }
 }

+ 184 - 3
structure-center/src/main/java/com/lantone/structure/facade/tran/StagesSummaryTran.java

@@ -1,11 +1,23 @@
 package com.lantone.structure.facade.tran;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.util.StringUtil;
+import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
 import com.lantone.structure.model.doc.StagesSummaryDoc;
+import com.lantone.structure.model.entity.AuxiliaryExamination;
+import com.lantone.structure.model.entity.Drug;
+import com.lantone.structure.model.entity.Laboratory;
+import com.lantone.structure.model.entity.Surgery;
+import com.lantone.structure.model.label.StagesSummaryLabel;
+import com.lantone.structure.util.MapUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @Description:
@@ -22,8 +34,177 @@ public class StagesSummaryTran extends TargetTran {
         stagesSummaryDoc.setText(text);
         stagesSummaryDocList.add(stagesSummaryDoc);
         inputInfo.setStagesSummaryDocs(stagesSummaryDocList);
+        aiProcess();
+        Map<String, String> structureMap = cutWord(text);
+        Map<String, String> retMap = new HashMap<String, String>();
+        stagesContrast(inputInfo.getStagesSummaryDocs(), structureMap);
+        mapKeyContrastCommon(structureMap,stagesContrasts,retMap);
+        return retMap;
+    }
+
+    private List<String> stagesContrasts = Lists.newArrayList(
+            "诊疗经过=诊疗过程描述",
+            "诊疗计划=今后治疗方案"
+    );
+    private Map<String, String> cutWord(String text) {
+        Map<String, String> sourceMap = Maps.newHashMap();
+        List<String> titles = CommonAnalysisUtil.sortTitles(
+                Lists.newArrayList("入院情况","辅助检查", "诊疗经过", "目前情况", "诊疗计划"),
+                text
+        );
+        String retStr = parseBook(text);
+        sourceMap.put("主诉",retStr);
+        String stringDate =extractDate(text) ;
+        if(StringUtils.isNotEmpty(stringDate)){
+            sourceMap.put("小结日期时间",stringDate);
+        }
+        CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
+        if(sourceMap.containsKey("辅助检查")){
+            sourceMap.remove("辅助检查");
+        }
+        return sourceMap;
+    }
+
+    public static String parseBook(String text){
+        String[] sourceStr = text.split("因");
+        String[] targetStr = {""};
+        String retStr = "";
+        if(sourceStr!=null&&sourceStr.length>1){
+           targetStr = sourceStr[1].split("”", 0);
+        }
+        if(targetStr!=null&&targetStr.length>1){
+             retStr = targetStr[1];
+        }
+        return retStr;
+    };
+
+    public static void mapKeyContrastCommon(Map sourceMap, List<String> keyContrasts, Map<String, String> retMap) {
+        Map<String, String> sourceMap_ = MapUtil.copyMap(sourceMap);
+        String[] arry = null;
+        String sourceKey = null, targetKey;
+        Set<String> removeKey = new HashSet<>();
+        for (String keyContrast : keyContrasts) {
+            arry = keyContrast.split("=");
+            sourceKey = arry[0];
+            if (arry.length == 1) {
+                targetKey = arry[0];
+            } else {
+                targetKey = arry[1];
+            }
+            if (StringUtil.isNotBlank(sourceMap_.get(sourceKey))
+                    && (!retMap.containsKey(targetKey) || StringUtil.isBlank(retMap.get(targetKey)))) {
+                retMap.put(targetKey, sourceMap_.get(sourceKey));
+            }
+            removeKey.add(sourceKey);
+        }
+        Set<String> keySet = retMap.keySet();
+        for (String key : sourceMap_.keySet()) {
+            if (!keySet.contains(key) && !removeKey.contains(key)) { // 如果之前已放过key就不用放了
+                retMap.put(key, sourceMap_.get(key));
+            }
+        }
+    }
+
 
+    /**
+     * 抽取文本中的第一个时间
+     *
+     * @param top
+     * @return
+     */
+    public static String extractDate(String top) {
+        Pattern pattern = Pattern.compile("[0-9]{4}[-][0-9]{1,2}[-][0-9]{1,2}([ ][0-9]{1,2}[:][0-9]{1,2}([:][0-9]{1,2})?)?");
+        Matcher matcher = pattern.matcher(top);
+        if (matcher.find()) {
+            return matcher.group(0);
+        } else {
+            Pattern p1 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
+            Matcher m1 = p1.matcher(top);
+            if (m1.find()) {
+                return m1.group(0);
+            }
+        }
         return null;
     }
 
+    public void stagesContrast( List<StagesSummaryDoc> stagesSummaryDocs, Map<String, String> retMap) {
+        if(ListUtil.isNotEmpty(stagesSummaryDocs)){
+            stagesSummaryDocs.forEach(stagesSummaryDoc -> {
+                int auxCount = 1;
+                int laboratoryCount = 1;
+                int surgerysCount = 1;
+                int drugsCount = 1;
+                StringBuffer adviceString = new StringBuffer();
+                StagesSummaryLabel stagesSummaryLabe = stagesSummaryDoc.getStagesSummaryLabel();
+                if (ListUtil.isNotEmpty(stagesSummaryLabe.getAuxiliaryExaminations())) {
+                        if (ListUtil.isNotEmpty(stagesSummaryLabe.getAuxiliaryExaminations())) {
+                            adviceString.append( "辅助检查" + ":");
+                            for (AuxiliaryExamination auxiliaryExaminations : stagesSummaryLabe.getAuxiliaryExaminations()) {
+                                if(StringUtils.isNotEmpty( auxiliaryExaminations.getName())){
+                                    if(stagesSummaryLabe.getAuxiliaryExaminations().size()>1){
+                                        adviceString.append((auxCount++) + ".");
+                                    }
+                                    adviceString.append(auxiliaryExaminations.getName());
+                                }
+                            }
+                            adviceString.append(";");
+                        }
+
+                }
+
+                if (ListUtil.isNotEmpty(stagesSummaryLabe.getLaboratory())) {
+                        if (ListUtil.isNotEmpty(stagesSummaryLabe.getLaboratory())) {
+                            adviceString.append( "实验室检查"+ ":");
+                            for (Laboratory laboratory : stagesSummaryLabe.getLaboratory()) {
+                                if(StringUtils.isNotEmpty( laboratory.getName())){
+                                    if(stagesSummaryLabe.getLaboratory().size()>1){
+                                        adviceString.append((laboratoryCount++)+ ".");
+                                    }
+                                    adviceString.append(laboratory.getName());
+                                }
+
+                            }
+                            adviceString.append(";");
+                        }
+
+                }
+
+                if (ListUtil.isNotEmpty(stagesSummaryLabe.getSurgerys())) {
+                        if (ListUtil.isNotEmpty(stagesSummaryLabe.getSurgerys())) {
+                            adviceString.append("手术名称" + ":");
+                            for (Surgery surgerys : stagesSummaryLabe.getSurgerys()) {
+                                if(StringUtils.isNotEmpty( surgerys.getName())){
+                                    if(stagesSummaryLabe.getSurgerys().size()>1){
+                                        adviceString.append((surgerysCount++)+ ".");
+                                    }
+                                    adviceString.append(surgerys.getName());
+                                }
+
+                            }
+                            adviceString.append(";");
+                        }
+
+                }
+                if (ListUtil.isNotEmpty(stagesSummaryLabe.getDrugs())) {
+                    if (ListUtil.isNotEmpty(stagesSummaryLabe.getDrugs())) {
+                        adviceString.append( "抢救药品"+ ":");
+                        for (Drug drugs : stagesSummaryLabe.getDrugs()) {
+                            if(StringUtils.isNotEmpty( drugs.getName())){
+                                if(stagesSummaryLabe.getDrugs().size()>1){
+                                    adviceString.append((drugsCount++)+ ".");
+                                }
+                                adviceString.append(drugs.getName());
+                            }
+
+                        }
+                        adviceString.append(";");
+                    }
+
+            }
+                retMap.put("医嘱内容",adviceString.toString());
+            });
+        }
+    }
+
+
 }