|
@@ -3,10 +3,8 @@ package com.lantone.qc.trans.beilun;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
-import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
|
|
|
-import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
-import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
|
-import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
|
|
|
+import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
|
|
|
+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;
|
|
@@ -15,6 +13,7 @@ import com.lantone.qc.trans.ModelDocTrans;
|
|
|
import com.lantone.qc.trans.beilun.util.*;
|
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
+import com.lantone.qc.trans.comsis.Preproc;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.jsoup.Jsoup;
|
|
@@ -43,6 +42,8 @@ public class BeiLunOperationDocTrans extends ModelDocTrans {
|
|
|
Map<String, OperationDiscussionDoc> operationDiscussionDocMap = getOperationDiscussionDocMap((List) contentMap.get("术后首次病程及谈话记录"));
|
|
|
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("手术安全核查表"));
|
|
|
|
|
|
Set<String> operationNameSet = Sets.newHashSet();
|
|
|
operationNameSet.addAll(operationDiscussionDocMap.keySet());
|
|
@@ -260,4 +261,134 @@ public class BeiLunOperationDocTrans extends ModelDocTrans {
|
|
|
"经治医生签字时间=记录时间"
|
|
|
);
|
|
|
|
|
|
+ /**********************************************手术知情同意书****************************************************/
|
|
|
+ private Map<String, OperationInformedConsentDoc> getOperationInformedConsentDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
+ Map<String, OperationInformedConsentDoc> retMap = Maps.newHashMap();
|
|
|
+ if (ListUtil.isEmpty(contentMaps)) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ int index = 1;
|
|
|
+ String operationName = null;
|
|
|
+ for (Map<String, Object> contentMap : contentMaps) {
|
|
|
+ if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ operationName = index + "";
|
|
|
+ OperationInformedConsentDoc operationInformedConsentDoc = getOperationInformedConsentDoc(contentMap);
|
|
|
+ operationInformedConsentDoc.setOperationName(operationName);
|
|
|
+ retMap.put(operationName, operationInformedConsentDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OperationInformedConsentDoc getOperationInformedConsentDoc(Map<String, Object> contentMap) {
|
|
|
+ String modeId = "16";
|
|
|
+ String content = contentMap.get("xmlText").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.setText(text);
|
|
|
+ operationInformedConsentDoc.setPageData((Map) cutWordMap);
|
|
|
+
|
|
|
+ return operationInformedConsentDoc;
|
|
|
+ }
|
|
|
+ private List<String> operationInformedConsent_sourceTitles = Lists.newArrayList(
|
|
|
+ "姓名",
|
|
|
+ "性别",
|
|
|
+ "病区",
|
|
|
+ "床号",
|
|
|
+ "病案号",
|
|
|
+ "手术医生",
|
|
|
+ "目前诊断",
|
|
|
+ "手术名称",
|
|
|
+ "手术指征",
|
|
|
+ "风险及并发症",
|
|
|
+ "保守治疗",
|
|
|
+ "其他手术",
|
|
|
+ "签名",
|
|
|
+ "签名时间"
|
|
|
+ );
|
|
|
+
|
|
|
+ private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList(
|
|
|
+ "姓名++++患者姓名=姓名",
|
|
|
+ "性别=",
|
|
|
+ "病区++++病区名称=病区",
|
|
|
+ "床号=",
|
|
|
+ "病案号++++住院号=病案号",
|
|
|
+ "手术医生=",
|
|
|
+ "目前诊断=",
|
|
|
+ "手术名称=",
|
|
|
+ "手术指征=",
|
|
|
+ "风险及并发症=",
|
|
|
+ "++++保守治疗=保守治疗",
|
|
|
+ "++++其他手术=其他手术",
|
|
|
+ "签名++++=签名",
|
|
|
+ "签名时间=签名时间"
|
|
|
+ );
|
|
|
+
|
|
|
+ /**********************************************手术安全核查表****************************************************/
|
|
|
+ private Map<String, OperationSafetyChecklistDoc> getOperationSafetyChecklistDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
+ Map<String, OperationSafetyChecklistDoc> retMap = Maps.newHashMap();
|
|
|
+ if (ListUtil.isEmpty(contentMaps)) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ int index = 1;
|
|
|
+ String operationName = null;
|
|
|
+ for (Map<String, Object> contentMap : contentMaps) {
|
|
|
+ if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ operationName = index + "";
|
|
|
+ OperationSafetyChecklistDoc operationSafetyChecklistDoc = getOperationSafetyChecklistDoc(contentMap);
|
|
|
+ operationSafetyChecklistDoc.setOperationName(operationName);
|
|
|
+ retMap.put(operationName, operationSafetyChecklistDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OperationSafetyChecklistDoc getOperationSafetyChecklistDoc(Map<String, Object> contentMap) {
|
|
|
+ String modeId = "21";
|
|
|
+ String content = contentMap.get("xmlText").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.setText(text);
|
|
|
+ operationSafetyChecklistDoc.setPageData((Map) cutWordMap);
|
|
|
+
|
|
|
+ return operationSafetyChecklistDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> operationSafetyChecklist_sourceTitles = Lists.newArrayList(
|
|
|
+ "姓名",
|
|
|
+ "性别",
|
|
|
+ "病区",
|
|
|
+ "床号",
|
|
|
+ "病案号",
|
|
|
+ "签名"
|
|
|
+ );
|
|
|
+
|
|
|
+ private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
|
|
|
+ "姓名++++患者姓名=姓名",
|
|
|
+ "性别",
|
|
|
+ "病区",
|
|
|
+ "床号",
|
|
|
+ "病案号++++住院号=病案号",
|
|
|
+ "签名++++=签名"
|
|
|
+ );
|
|
|
}
|