|
@@ -2,12 +2,16 @@ 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.operation.OperationDoc;
|
|
|
import com.lantone.structure.model.doc.operation.OperationRecordDoc;
|
|
|
+import com.lantone.structure.model.entity.Intervention;
|
|
|
+import com.lantone.structure.model.label.OperationRecordLabel;
|
|
|
import com.lantone.structure.util.MapUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -37,13 +41,94 @@ public class OperationRecordDocTran extends TargetTran {
|
|
|
Map<String, String> structureMap = cutWord(text);
|
|
|
Map<String, String> retMap = new HashMap<String, String>();
|
|
|
CommonAnalysisUtil.mapKeyContrastCommon(structureMap, keyContrasts, retMap);
|
|
|
+ fetchModelData(inputInfo.getOperationDocs(), retMap);
|
|
|
retMap.entrySet().removeIf(entry -> StringUtil.isBlank(entry.getValue()));
|
|
|
- retMap.entrySet().removeIf(entry -> !entry.getValue().matches("\\d") && "医师签名日期时间".equals(entry.getKey()));
|
|
|
+ retMap.entrySet().removeIf(entry -> !entry.getValue().matches("[\\d]+年[\\d]+月[\\d]+日[\\d]+时[\\d]+分") && "医师签名日期时间".equals(entry.getKey()));
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
+ private void fetchModelData(List<OperationDoc> operationDocs, Map<String, String> retMap) {
|
|
|
+ if (ListUtil.isNotEmpty(operationDocs)) operationDocs.forEach(operationDoc -> {
|
|
|
+ OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
|
|
|
+ if (operationRecordDoc != null) {
|
|
|
+ int interventionCount = 1;
|
|
|
+ StringBuffer interventionString = new StringBuffer();
|
|
|
+ OperationRecordLabel operationRecordLabel = operationRecordDoc.getOperationRecordLabel();
|
|
|
+ //手术目标部位名称
|
|
|
+ if (StringUtil.isNotBlank(operationRecordLabel.getOpBottomName())) {
|
|
|
+ retMap.put("手术目标部位名称", operationRecordLabel.getOpBottomName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //介入物名称
|
|
|
+ if (ListUtil.isNotEmpty(operationRecordLabel.getInterventions())) {
|
|
|
+ for (Intervention interventions : operationRecordLabel.getInterventions()) {
|
|
|
+ if (StringUtils.isNotEmpty(interventions.getName())) {
|
|
|
+ if (operationRecordLabel.getInterventions().size() > 1) {
|
|
|
+ interventionString.append((interventionCount++) + ".");
|
|
|
+ }
|
|
|
+ interventionString.append(interventions.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ retMap.put("介入物名称", interventionString.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //皮肤消毒描述
|
|
|
+ if (operationRecordLabel.getSkinSterilize() != null && StringUtils.isNotEmpty(operationRecordLabel.getSkinSterilize().getName())) {
|
|
|
+ retMap.put("皮肤消毒描述", operationRecordLabel.getSkinSterilize().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //手术切口描述
|
|
|
+ if (operationRecordLabel.getOperationIncision() != null && StringUtils.isNotEmpty(operationRecordLabel.getOperationIncision().getName())) {
|
|
|
+ retMap.put("手术切口描述", operationRecordLabel.getOperationIncision().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //出血量(mL)
|
|
|
+ if (operationRecordLabel.getBleedQuantity() != null && StringUtils.isNotEmpty(operationRecordLabel.getBleedQuantity().getName())) {
|
|
|
+ retMap.put("出血量(mL)", operationRecordLabel.getBleedQuantity().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //输液量(mL)
|
|
|
+ if (operationRecordLabel.getTransfuseQuantity() != null && StringUtils.isNotEmpty(operationRecordLabel.getTransfuseQuantity().getName())) {
|
|
|
+ retMap.put("输液量(mL)", operationRecordLabel.getTransfuseQuantity().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //输血量(mL)
|
|
|
+ if (operationRecordLabel.getBloodQuantity() != null && StringUtils.isNotEmpty(operationRecordLabel.getBloodQuantity().getName())) {
|
|
|
+ retMap.put("输血量(mL)", operationRecordLabel.getBloodQuantity().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //术前用药
|
|
|
+ if (operationRecordLabel.getPreoperativeDrugs() != null && StringUtils.isNotEmpty(operationRecordLabel.getPreoperativeDrugs().getName())) {
|
|
|
+ retMap.put("术前用药", operationRecordLabel.getPreoperativeDrugs().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //术中用药
|
|
|
+ if (operationRecordLabel.getDuringDrugs() != null && StringUtils.isNotEmpty(operationRecordLabel.getDuringDrugs().getName())) {
|
|
|
+ retMap.put("术中用药", operationRecordLabel.getDuringDrugs().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //引流材料名称
|
|
|
+ if (operationRecordLabel.getDrainageMaterialsName() != null && StringUtils.isNotEmpty(operationRecordLabel.getDrainageMaterialsName().getName())) {
|
|
|
+ retMap.put("引流材料名称", operationRecordLabel.getDrainageMaterialsName().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //引流材料数目
|
|
|
+ if (operationRecordLabel.getDrainageMaterialsAmount() != null && StringUtils.isNotEmpty(operationRecordLabel.getDrainageMaterialsAmount().getName())) {
|
|
|
+ retMap.put("引流材料数目", operationRecordLabel.getDrainageMaterialsAmount().getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //放置部位
|
|
|
+ if (operationRecordLabel.getPlacePosition() != null && StringUtils.isNotEmpty(operationRecordLabel.getPlacePosition().getName())) {
|
|
|
+ retMap.put("放置部位", operationRecordLabel.getPlacePosition().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private Map<String, String> cutWord(String text) {
|
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
+ text = text.replace("年 月 日 时 分", "");
|
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
|
Lists.newArrayList("手术开始时间", "手术结束时间", "术前诊断", "手术名称", "术中诊断", "手 术 者", "助手", "麻醉方法", "麻 醉 者", "手术标本",
|
|
|
"术中并发症", "术中失血量", "手术经过", "记录者", "主刀医生"),
|
|
@@ -99,9 +184,8 @@ public class OperationRecordDocTran extends TargetTran {
|
|
|
"手术开始时间=手术开始日期时间",
|
|
|
"手术结束时间=手术结束日期时间",
|
|
|
"手术经过=手术过程描述",
|
|
|
- "手 术 者=手术者姓名",
|
|
|
- "助手=Ⅰ助姓名",
|
|
|
- "麻 醉 者=麻醉医师姓名",
|
|
|
+ "手术者=手术者姓名",
|
|
|
+ "麻醉者=麻醉医师姓名",
|
|
|
"医护人员陈述=手术者签名",
|
|
|
"主刀医生=手术者签名"
|
|
|
);
|