|
@@ -3,17 +3,18 @@ package com.lantone.qc.trans.wenfuyi;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
-import com.lantone.qc.dbanaly.facade.wenfuyi.WenfuyiXmlUtil;
|
|
|
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
|
|
|
import com.lantone.qc.pub.model.doc.operation.*;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
import com.lantone.qc.pub.util.FastJsonUtils;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
|
-import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
|
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
+import com.lantone.qc.trans.wenfuyi.util.*;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
+import org.jsoup.Jsoup;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -21,14 +22,12 @@ import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* @Description: 手术文档生成
|
|
|
+ * @author: rengb
|
|
|
+ * @time: 2020/3/20 17:11
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
public class OperationDocTrans extends ModelDocTrans {
|
|
|
- /**
|
|
|
- * 手术文档包含:术后首次病程及谈话记录;手术记录;术前讨论、术前小结;手术知情同意书;手术安全核查表
|
|
|
- *
|
|
|
- * @param medrecVo
|
|
|
- * @return
|
|
|
- */
|
|
|
+
|
|
|
@Override
|
|
|
public List<OperationDoc> extract(MedrecVo medrecVo) {
|
|
|
List<OperationDoc> retList = Lists.newArrayList();
|
|
@@ -42,14 +41,12 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap((List) contentMap.get("手术记录"));
|
|
|
Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap((List) contentMap.get("术前讨论、术前小结"));
|
|
|
Map<String, OperationInformedConsentDoc> operationInformedConsentDocMap = getOperationInformedConsentDocMap((List) contentMap.get("手术知情同意书"));
|
|
|
- //Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap((List) contentMap.get("手术安全核查表"));
|
|
|
+ Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap((List) contentMap.get("手术安全核查表"));
|
|
|
|
|
|
Set<String> operationNameSet = Sets.newHashSet();
|
|
|
operationNameSet.addAll(operationDiscussionDocMap.keySet());
|
|
|
operationNameSet.addAll(operationRecordDocMap.keySet());
|
|
|
operationNameSet.addAll(preoperativeDiscussionDocMap.keySet());
|
|
|
- operationNameSet.addAll(operationInformedConsentDocMap.keySet());
|
|
|
- //operationNameSet.addAll(operationSafetyChecklistDocMap.keySet());
|
|
|
|
|
|
operationNameSet.forEach(operationName -> {
|
|
|
OperationDoc operationDoc = new OperationDoc();
|
|
@@ -58,9 +55,10 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
|
|
|
operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
|
|
|
operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
|
|
|
- //operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
|
|
|
+ operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
|
|
|
retList.add(operationDoc);
|
|
|
});
|
|
|
+
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
@@ -74,71 +72,63 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (Map<String, Object> contentMap : contentMaps) {
|
|
|
- if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ if (contentMap.get("htmlText") == null || StringUtil.isBlank(contentMap.get("htmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- operationName = index + "";
|
|
|
- OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
|
|
|
- operationDiscussionDoc.setOperationName(operationName);
|
|
|
- retMap.put(operationName, operationDiscussionDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
|
|
|
+ if (operationDiscussionDoc != null) {
|
|
|
+ operationName = index + "";
|
|
|
+ operationDiscussionDoc.setOperationName(operationName);
|
|
|
+ retMap.put(operationName, operationDiscussionDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
private OperationDiscussionDoc getOperationDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
- String modeId = "18";
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
+ String content = contentMap.get("htmlText").toString();
|
|
|
Map<String, String> structureMap = null;
|
|
|
+ OperationDiscussionDoc operationDiscussionDoc = new OperationDiscussionDoc();
|
|
|
if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(structureMap);
|
|
|
+ operationDiscussionDoc.setText(content);
|
|
|
+ operationDiscussionDoc.setPageData((Map) structureMap);
|
|
|
+ return operationDiscussionDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
} else {
|
|
|
- Map<String, String> sourceMap = WenfuyiXmlUtil.xmlToMap(content);
|
|
|
- List<String> titles = Lists.newArrayList(
|
|
|
- "术后处理措施","医师签名","患方签名",
|
|
|
- "记录医师","术后注意事项","术后处理措施","术后诊断",
|
|
|
- "手术方式","麻醉方式","术中诊断","手术结束时间","手术开始时间","手术简要经过",
|
|
|
- "手术名称","手术时间","术前诊断","手术医生","助手","手术经过","术后生命体征",
|
|
|
- "患者家属签名");
|
|
|
-
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
- List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
- CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
|
|
|
- sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
-
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts, modeId);
|
|
|
-
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
+ String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
+ WenFuYiHtmlAnalysis wenFuYiHtmlAnalysis = new OperationHtmlAnalysis();
|
|
|
+ Map<String, String> sourceMap = wenFuYiHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(structureMap);
|
|
|
+ String text = WenFuYiHtmlAnalysisUtil.blockDivToStr(Jsoup.parse(content).selectFirst("body").child(0), true);
|
|
|
+ operationDiscussionDoc.setText(text);
|
|
|
+ operationDiscussionDoc.setPageData((Map) structureMap);
|
|
|
+ return operationDiscussionDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- OperationDiscussionDoc operationDiscussionDoc = new OperationDiscussionDoc();
|
|
|
- operationDiscussionDoc.setStructureMap(structureMap);
|
|
|
- operationDiscussionDoc.setPageData((Map) structureMap);
|
|
|
-
|
|
|
- return operationDiscussionDoc;
|
|
|
}
|
|
|
|
|
|
private List<String> operationDiscussion_keyContrasts = Lists.newArrayList(
|
|
|
- "病程时间=病历日期","病程标题=标题",
|
|
|
- "本人姓名=姓名",
|
|
|
- "书写日期=记录时间",
|
|
|
- "注意事项=术后注意事项",
|
|
|
- "治疗计划和措施=术后处理措施",
|
|
|
- "术后注意观察事项=术后注意事项",
|
|
|
- "手术名称=手术名称方式",
|
|
|
- "术中诊断=术中后诊断",
|
|
|
- "术后诊断=术中后诊断",
|
|
|
- "术后诊疗计划(处理措施)=术后处理措施",
|
|
|
- "术后谈话=术后注意事项",
|
|
|
- "记录医师签名=记录医生",
|
|
|
- "医师签名=记录医生",
|
|
|
- "签名时间=记录时间",
|
|
|
- "会诊日期=手术日期",
|
|
|
- "记录医师=记录医生",
|
|
|
- "医师签名日期=记录时间",
|
|
|
- "手术经过=手术简要经过",
|
|
|
- "术后生命体征=术后注意事项"
|
|
|
+ "主刀/I助签名=主刀医师签名",
|
|
|
+ "患者/法定监护人/委托代理人签名=患方签名"
|
|
|
);
|
|
|
|
|
|
|
|
@@ -151,76 +141,56 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (Map<String, Object> contentMap : contentMaps) {
|
|
|
- if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ if (contentMap.get("htmlText") == null || StringUtil.isBlank(contentMap.get("htmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- operationName = index + "";
|
|
|
- OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
|
|
|
- operationRecordDoc.setOperationName(operationName);
|
|
|
- retMap.put(operationName, operationRecordDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
|
|
|
+ if (operationRecordDoc != null) {
|
|
|
+ operationName = index + "";
|
|
|
+ operationRecordDoc.setOperationName(operationName);
|
|
|
+ retMap.put(operationName, operationRecordDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
private OperationRecordDoc getOperationRecordDoc(Map<String, Object> contentMap) {
|
|
|
- String modeId = "17";
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
+ String content = contentMap.get("htmlText").toString();
|
|
|
Map<String, String> structureMap = null;
|
|
|
if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
} else {
|
|
|
- Map<String, String> sourceMap = WenfuyiXmlUtil.xmlToMap(content);
|
|
|
- sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- List<String> titles = Lists.newArrayList("手术开始时间", "手术结束时间","术中诊断","手术简要经过","主 刀",
|
|
|
- "第一助手", "第二助手","第三助手","洗手护士", "巡回护士","麻醉方式","手术方式","麻醉医师","手术标本","冰冻切片结果",
|
|
|
- "术中并发症","术中失血量","手术经过及处理","手术简要经过","医师签名","主刀医师签名","时间",
|
|
|
- "患方签名","记录时间");
|
|
|
-
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
- List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
- CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts, modeId);
|
|
|
- //出血量、输血量有些有ml有些没有,统一一下
|
|
|
- if(structureMap.containsKey("输血量")){
|
|
|
- structureMap.put("输血量",structureMap.get("输血量").replaceAll("ml",""));
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
+ String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
+ WenFuYiHtmlAnalysis wenFuYiHtmlAnalysis = new OperationRecordHtmlAnalysis();
|
|
|
+ Map<String, String> sourceMap = wenFuYiHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
}
|
|
|
- OrdinaryAssistant.removeBlank(structureMap);
|
|
|
+
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(structureMap);
|
|
|
+ operationRecordDoc.setPageData((Map) structureMap);
|
|
|
+ return operationRecordDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
}
|
|
|
- OperationRecordDoc operationRecordDoc = new OperationRecordDoc();
|
|
|
- operationRecordDoc.setStructureMap(structureMap);
|
|
|
- operationRecordDoc.setPageData((Map) structureMap);
|
|
|
- return operationRecordDoc;
|
|
|
}
|
|
|
|
|
|
- // 手术记录
|
|
|
private List<String> operationRecord_keyContrasts = Lists.newArrayList(
|
|
|
- "病程时间=病历日期","病程标题=标题","麻醉医师=麻醉人员","巡回护士姓名=巡回护士",
|
|
|
- "待产日期=手术日期",
|
|
|
- "医生=主刀医师签名",
|
|
|
- "助手=一助",
|
|
|
- "本人姓名=姓名",
|
|
|
- "手术记录手术开始日期=开始时间",
|
|
|
"手术开始时间=开始时间",
|
|
|
- "手术记录手术结束日期=结束时间",
|
|
|
- "手术结束日期时间=结束时间",
|
|
|
"手术结束时间=结束时间",
|
|
|
- "术后诊断=术中后诊断",
|
|
|
- "术中后诊断=术中后诊断",
|
|
|
- "术中诊断=术中后诊断",
|
|
|
- "手术记录手术过程=手术经过",
|
|
|
- "手术简要经过=手术经过",
|
|
|
- "主刀医师=主刀医师",
|
|
|
- "Ⅰ助姓名=一助",
|
|
|
- "Ⅱ助姓名=二助",
|
|
|
- "手术记录麻醉方式=麻醉方式",
|
|
|
- "麻醉医师签名=麻醉医师",
|
|
|
- "主刀医师签名=医师签名",
|
|
|
- "医师签名=医师签名",
|
|
|
- "记录时间=医师签名时间",
|
|
|
- "时间=医师签名时间"
|
|
|
+ "探查(术中所见)=探查术中所见",
|
|
|
+ "手术经过(手术小结)=手术经过",
|
|
|
+ "记录日期=记录时间"
|
|
|
);
|
|
|
|
|
|
|
|
@@ -233,59 +203,67 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (Map<String, Object> contentMap : contentMaps) {
|
|
|
- if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ if (contentMap.get("htmlText") == null || StringUtil.isBlank(contentMap.get("htmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- operationName = index + "";
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
|
|
|
- preoperativeDiscussionDoc.setOperationName(operationName);
|
|
|
- retMap.put(operationName, preoperativeDiscussionDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
|
|
|
+ if (preoperativeDiscussionDoc != null) {
|
|
|
+ operationName = index + "";
|
|
|
+ preoperativeDiscussionDoc.setOperationName(operationName);
|
|
|
+ retMap.put(operationName, preoperativeDiscussionDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
- String modeId = "11";
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
+ String content = contentMap.get("htmlText").toString();
|
|
|
Map<String, String> structureMap = null;
|
|
|
if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
} else {
|
|
|
- Map<String, String> sourceMap = WenfuyiXmlUtil.xmlToMap(content);
|
|
|
- sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- List<String> titles = Lists.newArrayList("简要病情","术前诊断","手术指征","手术禁忌症",
|
|
|
- "拟施手术名称和方式","拟施麻醉方式","其他术前相关情况","术中或术后可能发生的并发症","手术风险及防治对策",
|
|
|
- "术前与患方谈话及签定手术知情同意书情况","注意事项","术前准备","记录医师","手术名称"
|
|
|
- );
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
- List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
- CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts, modeId);
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
+ String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
+ WenFuYiHtmlAnalysis wenFuYiHtmlAnalysis = new PreoperativeHtmlAnalysis();
|
|
|
+ Map<String, String> sourceMap = wenFuYiHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> titles = Lists.newArrayList("讨论时间", "手术指征", "注意事项", "术前诊断", "医生签名", "风险及防范措施", "可替代方案", "术前准备", "参加人员");
|
|
|
+
|
|
|
+ for (String title : titles) {
|
|
|
+ eliminateDate(structureMap, title);
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(structureMap);
|
|
|
+ preoperativeDiscussionDoc.setPageData((Map) structureMap);
|
|
|
+ return preoperativeDiscussionDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void eliminateDate(Map<String, String> structureMap, String text) {
|
|
|
+ if (structureMap.containsKey(text)) {
|
|
|
+ String value = structureMap.get(text).replaceAll(text, "");
|
|
|
+ structureMap.put(text, value);
|
|
|
}
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = new PreoperativeDiscussionDoc();
|
|
|
- preoperativeDiscussionDoc.setStructureMap(structureMap);
|
|
|
- preoperativeDiscussionDoc.setPageData((Map) structureMap);
|
|
|
- return preoperativeDiscussionDoc;
|
|
|
}
|
|
|
|
|
|
private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList(
|
|
|
- "拟施手术名称和方式=拟施手术名称及方式",
|
|
|
- "拟行术式=拟施手术名称及方式",
|
|
|
- "病程标题=文书标题",
|
|
|
- "临床诊断=术前诊断",
|
|
|
- "术前准备内容=术前准备",
|
|
|
- "中术后可能出现的风险及应对措施=风险及防范措施",
|
|
|
- "术中、术后应当充分注意的事项=术中术后注意事项",
|
|
|
- "术中术后注意事项含护理事项=术中术后注意事项","注意事项=术中术后注意事项",
|
|
|
- "手术风险及防治对策=风险及防范措施",
|
|
|
- "主要术中、术后风险及防范措施=风险及防范措施",
|
|
|
- "意外及防范措施=风险及防范措施",
|
|
|
- "术前术后注意事项=注意事项",
|
|
|
- "麻醉方式=拟施麻醉方式",
|
|
|
- "记录医师签名=记录医生"
|
|
|
+ "1.拟施麻醉方式=拟施麻醉方式",
|
|
|
+ "2.术前特殊准备=术前特殊准备",
|
|
|
+ "3.主要术中、术后风险及防范措施=风险及防范措施",
|
|
|
+ "4.术中、术后注意事项(含护理事项)=术中术后注意事项"
|
|
|
+
|
|
|
);
|
|
|
|
|
|
/**********************************************手术知情同意书****************************************************/
|
|
@@ -297,7 +275,7 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (Map<String, Object> contentMap : contentMaps) {
|
|
|
- if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ if (contentMap.get("htmlText") == null || StringUtil.isBlank(contentMap.get("htmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
operationName = index + "";
|
|
@@ -311,23 +289,41 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
|
|
|
private OperationInformedConsentDoc getOperationInformedConsentDoc(Map<String, Object> contentMap) {
|
|
|
String modeId = "16";
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
- Map<String, String> structureMap = null;
|
|
|
- if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
- structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
- } else {
|
|
|
- Map<String, String> sourceMap = WenfuyiXmlUtil.xmlToMap(content);
|
|
|
- sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationInformedConsent_keyContrasts, modeId);
|
|
|
- }
|
|
|
+// String content = contentMap.get("htmlText").toString();
|
|
|
+// Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
|
|
|
+// xmlNodeValueMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
+// xmlNodeValueMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
+// Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationInformedConsent_keyContrasts, modeId);
|
|
|
+//
|
|
|
+// String text = CxXmlUtil.getXmlText(content);
|
|
|
+// Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationInformedConsent_sourceTitles, text);
|
|
|
+// cutWordMap.putAll(structureMap);
|
|
|
+//
|
|
|
+// OperationInformedConsentDoc operationInformedConsentDoc = ModelDocGenerate.operationInformedConsentDocGen(cutWordMap);
|
|
|
OperationInformedConsentDoc operationInformedConsentDoc = new OperationInformedConsentDoc();
|
|
|
- operationInformedConsentDoc.setStructureMap(structureMap);
|
|
|
- operationInformedConsentDoc.setPageData((Map) structureMap);
|
|
|
+// operationInformedConsentDoc.setText(text);
|
|
|
+// operationInformedConsentDoc.setPageData((Map) cutWordMap);
|
|
|
+
|
|
|
return operationInformedConsentDoc;
|
|
|
}
|
|
|
|
|
|
+ private List<String> operationInformedConsent_sourceTitles = Lists.newArrayList(
|
|
|
+ "姓名",
|
|
|
+ "性别",
|
|
|
+ "病区",
|
|
|
+ "床号",
|
|
|
+ "病案号",
|
|
|
+ "手术医生",
|
|
|
+ "目前诊断",
|
|
|
+ "手术名称",
|
|
|
+ "手术指征",
|
|
|
+ "风险及并发症",
|
|
|
+ "保守治疗",
|
|
|
+ "其他手术",
|
|
|
+ "签名",
|
|
|
+ "签名时间"
|
|
|
+ );
|
|
|
+
|
|
|
private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList(
|
|
|
"姓名++++患者姓名=姓名",
|
|
|
"性别=",
|
|
@@ -337,16 +333,14 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
"手术医生=",
|
|
|
"目前诊断=",
|
|
|
"手术名称=",
|
|
|
- "手术指征=手术指征与禁忌",
|
|
|
+ "手术指征=",
|
|
|
"风险及并发症=",
|
|
|
"++++保守治疗=保守治疗",
|
|
|
"++++其他手术=其他手术",
|
|
|
"签名++++=签名",
|
|
|
- "签名时间=签名时间",
|
|
|
- "术前准备内容=术前准备"
|
|
|
+ "签名时间=签名时间"
|
|
|
);
|
|
|
|
|
|
-
|
|
|
/**********************************************手术安全核查表****************************************************/
|
|
|
private Map<String, OperationSafetyChecklistDoc> getOperationSafetyChecklistDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
Map<String, OperationSafetyChecklistDoc> retMap = Maps.newHashMap();
|
|
@@ -356,7 +350,7 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (Map<String, Object> contentMap : contentMaps) {
|
|
|
- if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ if (contentMap.get("htmlText") == null || StringUtil.isBlank(contentMap.get("htmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
operationName = index + "";
|
|
@@ -370,24 +364,33 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
|
|
|
private OperationSafetyChecklistDoc getOperationSafetyChecklistDoc(Map<String, Object> contentMap) {
|
|
|
String modeId = "21";
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
- Map<String, String> structureMap = null;
|
|
|
- if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
- structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
- } else {
|
|
|
- Map<String, String> sourceMap = WenfuyiXmlUtil.xmlToMap(content);
|
|
|
- sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationSafetyChecklist_keyContrasts, modeId);
|
|
|
- }
|
|
|
+// String content = contentMap.get("htmlText").toString();
|
|
|
+// Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
|
|
|
+// xmlNodeValueMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
+// xmlNodeValueMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
+// Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, operationSafetyChecklist_keyContrasts, modeId);
|
|
|
+//
|
|
|
+// String text = CxXmlUtil.getXmlText(content);
|
|
|
+// Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationSafetyChecklist_sourceTitles, text);
|
|
|
+// cutWordMap.putAll(structureMap);
|
|
|
+
|
|
|
+// OperationSafetyChecklistDoc operationSafetyChecklistDoc = ModelDocGenerate.operationSafetyChecklistDocGen(cutWordMap);
|
|
|
OperationSafetyChecklistDoc operationSafetyChecklistDoc = new OperationSafetyChecklistDoc();
|
|
|
- operationSafetyChecklistDoc.setStructureMap(structureMap);
|
|
|
- operationSafetyChecklistDoc.setPageData((Map) structureMap);
|
|
|
+// operationSafetyChecklistDoc.setText(text);
|
|
|
+// operationSafetyChecklistDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return operationSafetyChecklistDoc;
|
|
|
}
|
|
|
|
|
|
+ private List<String> operationSafetyChecklist_sourceTitles = Lists.newArrayList(
|
|
|
+ "姓名",
|
|
|
+ "性别",
|
|
|
+ "病区",
|
|
|
+ "床号",
|
|
|
+ "病案号",
|
|
|
+ "签名"
|
|
|
+ );
|
|
|
+
|
|
|
private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
|
|
|
"姓名++++患者姓名=姓名",
|
|
|
"性别",
|
|
@@ -396,17 +399,4 @@ public class OperationDocTrans extends ModelDocTrans {
|
|
|
"病案号++++住院号=病案号",
|
|
|
"签名++++=签名"
|
|
|
);
|
|
|
-
|
|
|
- /**
|
|
|
- * 给structureMap添加一个key(映射)
|
|
|
- *
|
|
|
- * @param structureMap
|
|
|
- * @param target 需要用到的key
|
|
|
- * @param source structureMap中含有的key
|
|
|
- */
|
|
|
- protected void addKeyMapping(Map<String, String> structureMap, String target, String source) {
|
|
|
- if (StringUtils.isEmpty(structureMap.get(target)) && StringUtils.isNotEmpty(structureMap.get(source))) {
|
|
|
- structureMap.put(target, structureMap.get(source));
|
|
|
- }
|
|
|
- }
|
|
|
}
|