|
@@ -4,13 +4,9 @@ import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
|
|
|
-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.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;
|
|
@@ -28,7 +24,6 @@ import java.util.Set;
|
|
|
* @time: 2020/3/20 17:11
|
|
|
*/
|
|
|
public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
-
|
|
|
@Override
|
|
|
public List<OperationDoc> extract(MedrecVo medrecVo) {
|
|
|
List<OperationDoc> retList = Lists.newArrayList();
|
|
@@ -88,24 +83,31 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
private OperationDiscussionDoc getOperationDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
+ String modeId = "18";
|
|
|
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, operationDiscussion_keyContrasts);
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("手术开始时间"))) {
|
|
|
- structureMap.put("手术时间", structureMap.get("手术开始时间"));
|
|
|
- }
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
- structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
- }
|
|
|
+ Map<String, String> cutWordMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ cutWordMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ 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, operationDiscussion_keyContrasts, modeId);
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("手术开始时间"))) {
|
|
|
+ structureMap.put("手术时间", structureMap.get("手术开始时间"));
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
+ structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
+ }
|
|
|
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
- Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationDiscussion_sourceTitles, text);
|
|
|
- cutWordMap.putAll(structureMap);
|
|
|
+ String text = CxXmlUtil.getXmlText(content);
|
|
|
+ structureMap.put("text", text);
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, operationDiscussion_sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+ }
|
|
|
|
|
|
OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(cutWordMap);
|
|
|
- operationDiscussionDoc.setText(text);
|
|
|
+ operationDiscussionDoc.setText(cutWordMap.get("text"));
|
|
|
operationDiscussionDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return operationDiscussionDoc;
|
|
@@ -176,21 +178,28 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
private OperationRecordDoc getOperationRecordDoc(Map<String, Object> contentMap) {
|
|
|
+ String modeId = "17";
|
|
|
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, operationRecord_keyContrasts);
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
- structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
- }
|
|
|
+ Map<String, String> cutWordMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ cutWordMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ 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, operationRecord_keyContrasts, modeId);
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
+ structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
+ }
|
|
|
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
- Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationRecord_sourceTitles, text);
|
|
|
- cutWordMap.putAll(structureMap);
|
|
|
+ String text = CxXmlUtil.getXmlText(content);
|
|
|
+ structureMap.put("text", text);
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, operationRecord_sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+ }
|
|
|
|
|
|
OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(cutWordMap);
|
|
|
- operationRecordDoc.setText(text);
|
|
|
+ operationRecordDoc.setText(cutWordMap.get("text"));
|
|
|
operationRecordDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return operationRecordDoc;
|
|
@@ -267,36 +276,43 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
|
|
|
+ String modeId = "11";
|
|
|
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, preoperativeDiscussion_keyContrasts);
|
|
|
- structureMap.put(
|
|
|
- "术前准备内容",
|
|
|
- (StringUtil.isBlank(structureMap.get("术前准备内容")) ? "" : structureMap.get("术前准备内容")) + (StringUtil.isBlank(structureMap.get("术前准备++++术前准备情况")) ? "" : structureMap.get("术前准备++++术前准备情况"))
|
|
|
- );
|
|
|
- structureMap.put(
|
|
|
- "术前术后注意事项",
|
|
|
- (StringUtil.isBlank(structureMap.get("术前术后注意事项")) ? "" : structureMap.get("术前术后注意事项")) + (StringUtil.isBlank(structureMap.get("术后注意事项")) ? "" : structureMap.get("术后注意事项"))
|
|
|
- );
|
|
|
- structureMap.put("讨论时间", structureMap.get("记录时间"));
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
- structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
- }
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("拟行治疗指征及禁忌症"))) {
|
|
|
- structureMap.put("拟行术式", structureMap.get("拟行治疗指征及禁忌症"));
|
|
|
- } else if (StringUtil.isNotBlank(structureMap.get("拟施手术方式"))) {
|
|
|
- structureMap.put("拟行术式", structureMap.get("拟施手术方式"));
|
|
|
- }
|
|
|
+ Map<String, String> cutWordMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ cutWordMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ 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, preoperativeDiscussion_keyContrasts, modeId);
|
|
|
+ structureMap.put(
|
|
|
+ "术前准备内容",
|
|
|
+ (StringUtil.isBlank(structureMap.get("术前准备内容")) ? "" : structureMap.get("术前准备内容")) + (StringUtil.isBlank(structureMap.get("术前准备++++术前准备情况")) ? "" : structureMap.get("术前准备++++术前准备情况"))
|
|
|
+ );
|
|
|
+ structureMap.put(
|
|
|
+ "术前术后注意事项",
|
|
|
+ (StringUtil.isBlank(structureMap.get("术前术后注意事项")) ? "" : structureMap.get("术前术后注意事项")) + (StringUtil.isBlank(structureMap.get("术后注意事项")) ? "" : structureMap.get("术后注意事项"))
|
|
|
+ );
|
|
|
+ structureMap.put("讨论时间", structureMap.get("记录时间"));
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("签名"))) {
|
|
|
+ structureMap.put("记录医师", structureMap.get("签名"));
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("拟行治疗指征及禁忌症"))) {
|
|
|
+ structureMap.put("拟行术式", structureMap.get("拟行治疗指征及禁忌症"));
|
|
|
+ } else if (StringUtil.isNotBlank(structureMap.get("拟施手术方式"))) {
|
|
|
+ structureMap.put("拟行术式", structureMap.get("拟施手术方式"));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
- Map<String, String> cutWordMap = Preproc.getCutWordMap(true, preoperativeDiscussion_sourceTitles, text);
|
|
|
- cutWordMap.putAll(structureMap);
|
|
|
+ String text = CxXmlUtil.getXmlText(content);
|
|
|
+ structureMap.put("text", text);
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, preoperativeDiscussion_sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+ }
|
|
|
|
|
|
PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(cutWordMap);
|
|
|
- preoperativeDiscussionDoc.setText(text);
|
|
|
+ preoperativeDiscussionDoc.setText(cutWordMap.get("text"));
|
|
|
preoperativeDiscussionDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return preoperativeDiscussionDoc;
|
|
@@ -367,18 +383,25 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
-
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
- Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationInformedConsent_sourceTitles, text);
|
|
|
- cutWordMap.putAll(structureMap);
|
|
|
+ Map<String, String> cutWordMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ cutWordMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ structureMap.put("text", text);
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, operationInformedConsent_sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+ }
|
|
|
|
|
|
OperationInformedConsentDoc operationInformedConsentDoc = ModelDocGenerate.operationInformedConsentDocGen(cutWordMap);
|
|
|
- operationInformedConsentDoc.setText(text);
|
|
|
+ operationInformedConsentDoc.setText(cutWordMap.get("text"));
|
|
|
operationInformedConsentDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return operationInformedConsentDoc;
|
|
@@ -441,18 +464,25 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
-
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
- Map<String, String> cutWordMap = Preproc.getCutWordMap(true, operationSafetyChecklist_sourceTitles, text);
|
|
|
- cutWordMap.putAll(structureMap);
|
|
|
+ Map<String, String> cutWordMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ cutWordMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ structureMap.put("text", text);
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, operationSafetyChecklist_sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+ }
|
|
|
|
|
|
OperationSafetyChecklistDoc operationSafetyChecklistDoc = ModelDocGenerate.operationSafetyChecklistDocGen(cutWordMap);
|
|
|
- operationSafetyChecklistDoc.setText(text);
|
|
|
+ operationSafetyChecklistDoc.setText(cutWordMap.get("text"));
|
|
|
operationSafetyChecklistDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
return operationSafetyChecklistDoc;
|