|
@@ -1,419 +0,0 @@
|
|
-package com.lantone.qc.trans.yiwu;
|
|
|
|
-
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
|
-import com.google.common.collect.Maps;
|
|
|
|
-import com.google.common.collect.Sets;
|
|
|
|
-import com.lantone.qc.dbanaly.facade.taizhou.TzXmlUtil;
|
|
|
|
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
|
|
|
|
-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.OperationInformedConsentDoc;
|
|
|
|
-import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
|
|
|
|
-import com.lantone.qc.pub.model.doc.operation.OperationSafetyChecklistDoc;
|
|
|
|
-import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
|
|
|
|
-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.OrdinaryAssistant;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * @Description: 手术文档生成
|
|
|
|
- * @author: rengb
|
|
|
|
- * @time: 2020/3/20 17:11
|
|
|
|
- */
|
|
|
|
-public class YiWuOperationDocTrans extends ModelDocTrans {
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 手术文档包含:术后首次病程及谈话记录;手术记录;术前讨论、术前小结;手术知情同意书;手术安全核查表
|
|
|
|
- *
|
|
|
|
- * @param medrecVo
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- public List<OperationDoc> extract(MedrecVo medrecVo) {
|
|
|
|
- List<OperationDoc> retList = Lists.newArrayList();
|
|
|
|
-
|
|
|
|
- Map<String, List<String>> contentMap = (Map) medrecVo.getContent().get("content");
|
|
|
|
- if (contentMap == null) {
|
|
|
|
- return retList;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- 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());
|
|
|
|
- operationNameSet.addAll(operationRecordDocMap.keySet());
|
|
|
|
- operationNameSet.addAll(preoperativeDiscussionDocMap.keySet());
|
|
|
|
- operationNameSet.addAll(operationInformedConsentDocMap.keySet());
|
|
|
|
- operationNameSet.addAll(operationSafetyChecklistDocMap.keySet());
|
|
|
|
-
|
|
|
|
- operationNameSet.forEach(operationName -> {
|
|
|
|
- OperationDoc operationDoc = new OperationDoc();
|
|
|
|
- operationDoc.setOperationName(operationName);
|
|
|
|
- operationDoc.setOperationDiscussionDoc(operationDiscussionDocMap.get(operationName));
|
|
|
|
- operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
|
|
|
|
- operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
|
|
|
|
- operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
|
|
|
|
- operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
|
|
|
|
- retList.add(operationDoc);
|
|
|
|
- });
|
|
|
|
- return retList;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /*******************************************术后首次病程及谈话记录***************************************************/
|
|
|
|
- private Map<String, OperationDiscussionDoc> getOperationDiscussionDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
|
- Map<String, OperationDiscussionDoc> 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 + "";
|
|
|
|
- OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
|
|
|
|
- operationDiscussionDoc.setOperationName(operationName);
|
|
|
|
- retMap.put(operationName, operationDiscussionDoc);
|
|
|
|
- index++;
|
|
|
|
- }
|
|
|
|
- return retMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private OperationDiscussionDoc getOperationDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
|
- String modeId = "18";
|
|
|
|
- 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 = YiWuXmlUtil.xmlToMap(content);
|
|
|
|
- List<String> titles = Lists.newArrayList("手术开始时间","术中诊断","麻醉方式","手术方式",
|
|
|
|
- "手术简要经过(包括术中所见)","术后诊疗计划(处理措施)","术后注意观察事项","医师签名",
|
|
|
|
- "签名时间","患者或代理人签名","签名时间");
|
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
|
- CommonAnalysisUtil.cutByTitles(text,titles,0,sourceMap);
|
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
|
- int index = 0;
|
|
|
|
- if(text.contains("手术开始时间")){
|
|
|
|
- index=text.indexOf("手术开始时间")+8;
|
|
|
|
- }
|
|
|
|
- String timevalue=text.substring(index,index+18);
|
|
|
|
- sourceMap.put("手术开始时间",timevalue);
|
|
|
|
- String [] str = new String[3];
|
|
|
|
- String s="";
|
|
|
|
- if(text.contains("术中诊断")){
|
|
|
|
- str=text.split("术中诊断");
|
|
|
|
- s=str[1].replace(":","");
|
|
|
|
- }
|
|
|
|
- sourceMap.put("术中诊断",s);
|
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts, modeId);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- OperationDiscussionDoc operationDiscussionDoc = new OperationDiscussionDoc();
|
|
|
|
- operationDiscussionDoc.setStructureMap(structureMap);
|
|
|
|
- operationDiscussionDoc.setPageData((Map) structureMap);
|
|
|
|
-
|
|
|
|
- return operationDiscussionDoc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private List<String> operationDiscussion_keyContrasts = Lists.newArrayList(
|
|
|
|
- "本人姓名=姓名",
|
|
|
|
- "书写日期=记录日期",
|
|
|
|
- "注意事项=术后注意事项",
|
|
|
|
- "治疗计划和措施=术后诊疗计划处理措施",
|
|
|
|
- "术后注意观察事项=术后注意事项",
|
|
|
|
- "手术方式=手术名称方式",
|
|
|
|
- "手术简要经过(包括术中所见)=手术简要经过",
|
|
|
|
- "术中诊断=术中后诊断",
|
|
|
|
- "术后诊疗计划(处理措施)=术后诊疗计划处理措施",
|
|
|
|
- "手术开始时间=开始时间"
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**********************************************手术记录*************************************************************/
|
|
|
|
- private Map<String, OperationRecordDoc> getOperationRecordDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
|
- Map<String, OperationRecordDoc> 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 + "";
|
|
|
|
- OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
|
|
|
|
- operationRecordDoc.setOperationName(operationName);
|
|
|
|
- retMap.put(operationName, operationRecordDoc);
|
|
|
|
- index++;
|
|
|
|
- }
|
|
|
|
- return retMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private OperationRecordDoc getOperationRecordDoc(Map<String, Object> contentMap) {
|
|
|
|
- String modeId = "17";
|
|
|
|
- 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 = YiWuXmlUtil.xmlToMap(content);
|
|
|
|
- List<String> titles = Lists.newArrayList("手术开始时间","手术结束时间","术前诊断","术(中)后诊断",
|
|
|
|
- "手术名称","手术医师","助手医师","麻醉方式",
|
|
|
|
- "麻醉医师","手术护士","巡回护士","手术中用药(化疗等药物)","手术切口类别(可选)","术中出血量","输血量"
|
|
|
|
- ,"围术期并发症","手术切除标本","冰冻切片结果","标本件数","是否有植入物","手术步骤","记录者签名","记录日期");
|
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
|
- CommonAnalysisUtil.cutByTitles(text,titles,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);
|
|
|
|
- OrdinaryAssistant.removeBlank(structureMap);
|
|
|
|
- }
|
|
|
|
- OperationRecordDoc operationRecordDoc = new OperationRecordDoc();
|
|
|
|
- operationRecordDoc.setStructureMap(structureMap);
|
|
|
|
- operationRecordDoc.setPageData((Map) structureMap);
|
|
|
|
- return operationRecordDoc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 手术记录
|
|
|
|
- private List<String> operationRecord_keyContrasts = Lists.newArrayList(
|
|
|
|
- /*"结束时间=手术结束时间",
|
|
|
|
- "开始时间=手术开始时间",*/
|
|
|
|
- "医生=主刀医师签名",
|
|
|
|
- "助手=一助",
|
|
|
|
- "本人姓名=姓名",
|
|
|
|
- "手术开始日期时间=开始时间",
|
|
|
|
- "手术结束日期时间=结束时间",
|
|
|
|
- "术后诊断=术中后诊断",
|
|
|
|
- "麻醉方法代码=麻醉方式",
|
|
|
|
- "麻醉医师签名=麻醉医师",
|
|
|
|
- "手术过程的详细描述=手术经过及处理",
|
|
|
|
- "手术开始时间=开始时间",
|
|
|
|
- "手术结束时间=结束时间",
|
|
|
|
- "主刀医师=手术医师",
|
|
|
|
- "手术中用药=手术中用药化疗等药物",
|
|
|
|
- "术后送检病理无有标本件数=标本件数",
|
|
|
|
- "出血量=出血",
|
|
|
|
- "是否有植入物=是否术中植入物",
|
|
|
|
- "手术切口类别(可选)=切口类别",
|
|
|
|
- "手术步骤=手术经过及处理",
|
|
|
|
- "记录者签名=记录医生",
|
|
|
|
- "记录日期=记录时间"
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**********************************************术前讨论、术前小结****************************************************/
|
|
|
|
- private Map<String, PreoperativeDiscussionDoc> getPreoperativeDiscussionDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
|
- Map<String, PreoperativeDiscussionDoc> 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 + "";
|
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
|
|
|
|
- preoperativeDiscussionDoc.setOperationName(operationName);
|
|
|
|
- retMap.put(operationName, preoperativeDiscussionDoc);
|
|
|
|
- index++;
|
|
|
|
- }
|
|
|
|
- return retMap;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
|
- String modeId = "11";
|
|
|
|
- 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 = YiWuXmlUtil.xmlToMap(content);
|
|
|
|
- List<String> titles = Lists.newArrayList("讨论时间","讨论地点","主持人","经治医师",
|
|
|
|
- "参加人员及技术职称","讨论方式","讨论记录","主持人签名","记录人签名");
|
|
|
|
- String text = sourceMap.get("原始文本");
|
|
|
|
- CommonAnalysisUtil.cutByTitles(text,titles,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);
|
|
|
|
- addKeyMapping(structureMap, "麻醉方式", "拟施手术名称及麻醉方式");
|
|
|
|
- addKeyMapping(structureMap, "主刀医师签名", "主刀医生");
|
|
|
|
- addKeyMapping(structureMap, "既往疾病史", "其他");
|
|
|
|
- addKeyMapping(structureMap, "诊疗计划", "治疗计划和措施");
|
|
|
|
- }
|
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = new PreoperativeDiscussionDoc();
|
|
|
|
- preoperativeDiscussionDoc.setStructureMap(structureMap);
|
|
|
|
- preoperativeDiscussionDoc.setPageData((Map) structureMap);
|
|
|
|
- return preoperativeDiscussionDoc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList(
|
|
|
|
- "参加人员及职称=参加人员",
|
|
|
|
- "主刀医师=主刀医师签名",
|
|
|
|
- "注意事项=术前术后注意事项",
|
|
|
|
- "其他术前相关情况=术前术后注意事项",
|
|
|
|
- "辅助检查结果=辅助检查",
|
|
|
|
- "术中、术后防范措施=可能意外和防范措施",
|
|
|
|
- "现病史- 发病情况=发病经过",
|
|
|
|
- "本人姓名=姓名",
|
|
|
|
- "拟施手术名称和方式=拟行术式",
|
|
|
|
- "手术名称=拟行术式",
|
|
|
|
- "拟实施麻醉方法代码=拟施麻醉方式",
|
|
|
|
- "拟实施手术及操作名称=拟施手术方式、名称及可能的变更与禁忌症",
|
|
|
|
- "术前术后注意事项=主要术中、术后风险及防范措施",
|
|
|
|
- "时间=讨论时间",
|
|
|
|
- "手术指征与禁忌症=手术指征与禁忌",
|
|
|
|
- "讨论日期时间=讨论时间",
|
|
|
|
- "讨论日期=讨论时间",
|
|
|
|
- "参加人员及技术职称=参加人员",
|
|
|
|
- "主持人姓名=讨论主持人",
|
|
|
|
- "拟施手术名称和方式及可能的变更=拟施手术方式、名称及可能的变更与禁忌症",
|
|
|
|
- "术前准备内容=术前准备",
|
|
|
|
- "经治医师=手术者签名",
|
|
|
|
- "记录人签名=记录医生",
|
|
|
|
- "讨论记录=讨论意见"
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- /**********************************************手术知情同意书****************************************************/
|
|
|
|
- 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> structureMap = null;
|
|
|
|
- if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
|
- structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
|
- } else {
|
|
|
|
- Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
|
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationInformedConsent_keyContrasts, modeId);
|
|
|
|
- }
|
|
|
|
- OperationInformedConsentDoc operationInformedConsentDoc = new OperationInformedConsentDoc();
|
|
|
|
- operationInformedConsentDoc.setStructureMap(structureMap);
|
|
|
|
- operationInformedConsentDoc.setPageData((Map) structureMap);
|
|
|
|
- return operationInformedConsentDoc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- 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> structureMap = null;
|
|
|
|
- if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
|
- structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
|
- } else {
|
|
|
|
- Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
|
|
|
|
- sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
|
- sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationSafetyChecklist_keyContrasts, modeId);
|
|
|
|
- }
|
|
|
|
- OperationSafetyChecklistDoc operationSafetyChecklistDoc = new OperationSafetyChecklistDoc();
|
|
|
|
- operationSafetyChecklistDoc.setStructureMap(structureMap);
|
|
|
|
- operationSafetyChecklistDoc.setPageData((Map) structureMap);
|
|
|
|
-
|
|
|
|
- return operationSafetyChecklistDoc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
|
|
|
|
- "姓名++++患者姓名=姓名",
|
|
|
|
- "性别",
|
|
|
|
- "病区",
|
|
|
|
- "床号",
|
|
|
|
- "病案号++++住院号=病案号",
|
|
|
|
- "签名++++=签名"
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 给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));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|