|
@@ -7,7 +7,6 @@ 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.pub.model.keys.ModelStandardKeys;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
@@ -29,29 +28,15 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
@Override
|
|
|
public List<OperationDoc> extract(MedrecVo medrecVo) {
|
|
|
List<OperationDoc> retList = Lists.newArrayList();
|
|
|
- Map<String, Object> content = medrecVo.getContent();
|
|
|
-
|
|
|
- List<String>
|
|
|
- operationDiscussionLabel = null, operationDiscussionContent = null,
|
|
|
- operationRecordLabel = null, operationRecordContent = null,
|
|
|
- preoperativeDiscussionLabel = null, preoperativeDiscussionContent = null;
|
|
|
-
|
|
|
- Map<String, List<String>> labelMap = (Map) content.get("label");
|
|
|
- if (labelMap != null) {
|
|
|
- operationDiscussionLabel = labelMap.get("术后首次病程及谈话记录");
|
|
|
- operationRecordLabel = labelMap.get("手术记录");
|
|
|
- preoperativeDiscussionLabel = labelMap.get("术前讨论、术前小结");
|
|
|
- }
|
|
|
- Map<String, List<String>> contentMap = (Map) content.get("content");
|
|
|
- if (contentMap != null) {
|
|
|
- operationDiscussionContent = contentMap.get("术后首次病程及谈话记录");
|
|
|
- operationRecordContent = contentMap.get("手术记录");
|
|
|
- preoperativeDiscussionContent = contentMap.get("术前讨论、术前小结");
|
|
|
+
|
|
|
+ Map<String, List<String>> contentMap = (Map) medrecVo.getContent().get("content");
|
|
|
+ if (contentMap == null) {
|
|
|
+ return retList;
|
|
|
}
|
|
|
|
|
|
- Map<String, OperationDiscussionDoc> operationDiscussionDocMap = getOperationDiscussionDocMap(operationDiscussionContent, operationDiscussionLabel);
|
|
|
- Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap(operationRecordContent, operationRecordLabel);
|
|
|
- Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap(preoperativeDiscussionContent, preoperativeDiscussionLabel);
|
|
|
+ Map<String, OperationDiscussionDoc> operationDiscussionDocMap = getOperationDiscussionDocMap(contentMap.get("术后首次病程及谈话记录"));
|
|
|
+ Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap(contentMap.get("手术记录"));
|
|
|
+ Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap(contentMap.get("术前讨论、术前小结"));
|
|
|
|
|
|
Set<String> operationNameSet = Sets.newHashSet();
|
|
|
operationNameSet.addAll(operationDiscussionDocMap.keySet());
|
|
@@ -70,23 +55,21 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- private Map<String, OperationDiscussionDoc> getOperationDiscussionDocMap(List<String> contents, List<String> label) {
|
|
|
+
|
|
|
+ /*******************************************术后首次病程及谈话记录***************************************************/
|
|
|
+ private Map<String, OperationDiscussionDoc> getOperationDiscussionDocMap(List<String> contents) {
|
|
|
Map<String, OperationDiscussionDoc> retMap = Maps.newHashMap();
|
|
|
if (ListUtil.isEmpty(contents)) {
|
|
|
return retMap;
|
|
|
}
|
|
|
- label = ListUtil.isEmpty(label) ? ModelStandardKeys.operationDiscussion : label;
|
|
|
- Map<String, String> operationDiscussionStructureMap = null;
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (String content : contents) {
|
|
|
if (StringUtil.isBlank(content)) {
|
|
|
continue;
|
|
|
}
|
|
|
- operationDiscussionStructureMap = Preproc.extract_doc_pub(false, label, content);
|
|
|
operationName = index + "";
|
|
|
- OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(operationDiscussionStructureMap);
|
|
|
- operationDiscussionDoc.setText(content);
|
|
|
+ OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(content);
|
|
|
operationDiscussionDoc.setOperationName(operationName);
|
|
|
retMap.put(operationName, operationDiscussionDoc);
|
|
|
index++;
|
|
@@ -94,23 +77,80 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- private Map<String, OperationRecordDoc> getOperationRecordDocMap(List<String> contents, List<String> label) {
|
|
|
+ private OperationDiscussionDoc getOperationDiscussionDoc(String content) {
|
|
|
+ Map<String, String> pageData = Preproc.extract_doc_pub(true, operationDiscussion_pageDataTitles, content);
|
|
|
+ pageData.put("病程记录内容",
|
|
|
+ pageData.get("病程记录内容")
|
|
|
+ .replace(pageData.get("病程记录时间"), "")
|
|
|
+ .replace(pageData.get("病程记录名称"), "")
|
|
|
+ );
|
|
|
+
|
|
|
+ List<String> targetTitles = Lists.newArrayList();
|
|
|
+ operationDiscussion_sourceTitles.forEach(sourceTitle -> {
|
|
|
+ String targetTitle = "";
|
|
|
+ for (int index = 0; index < sourceTitle.length(); index++) {
|
|
|
+ if (index == sourceTitle.length() - 1) {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1);
|
|
|
+ } else {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ targetTitles.add(targetTitle);
|
|
|
+ });
|
|
|
+
|
|
|
+ Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
+ sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
+
|
|
|
+ OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(sourceMap);
|
|
|
+ operationDiscussionDoc.setText(content);
|
|
|
+ operationDiscussionDoc.setPageData((Map) pageData);
|
|
|
+
|
|
|
+ return operationDiscussionDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> operationDiscussion_pageDataTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师"
|
|
|
+ );
|
|
|
+ private List<String> operationDiscussion_sourceTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师",
|
|
|
+ "记录时间",
|
|
|
+ "手术时间",
|
|
|
+ "麻醉方式",
|
|
|
+ "手术方式",
|
|
|
+ "术中诊断",
|
|
|
+ "手术简要经过",
|
|
|
+ "患者术后情况",
|
|
|
+ "术后处理措施",
|
|
|
+ "术后可能出现的并发症及预防措施",
|
|
|
+ "术后注意事项",
|
|
|
+ "谈话医师签字",
|
|
|
+ "患者签名",
|
|
|
+ "患者签名时间",
|
|
|
+ "被授权人/代理人签名",
|
|
|
+ "代理人签名时间"
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************手术记录*************************************************************/
|
|
|
+ private Map<String, OperationRecordDoc> getOperationRecordDocMap(List<String> contents) {
|
|
|
Map<String, OperationRecordDoc> retMap = Maps.newHashMap();
|
|
|
if (ListUtil.isEmpty(contents)) {
|
|
|
return retMap;
|
|
|
}
|
|
|
- label = ListUtil.isEmpty(label) ? ModelStandardKeys.operationRecord : label;
|
|
|
- Map<String, String> operationRecordStructureMap = null;
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (String content : contents) {
|
|
|
if (StringUtil.isBlank(content)) {
|
|
|
continue;
|
|
|
}
|
|
|
- operationRecordStructureMap = Preproc.extract_doc_pub(false, label, content);
|
|
|
operationName = index + "";
|
|
|
- OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(operationRecordStructureMap);
|
|
|
- operationRecordDoc.setText(content);
|
|
|
+ OperationRecordDoc operationRecordDoc = getOperationRecordDoc(content);
|
|
|
operationRecordDoc.setOperationName(operationName);
|
|
|
retMap.put(operationName, operationRecordDoc);
|
|
|
index++;
|
|
@@ -118,35 +158,71 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- private Map<String, PreoperativeDiscussionDoc> getPreoperativeDiscussionDocMap(List<String> contents, List<String> label) {
|
|
|
+ private OperationRecordDoc getOperationRecordDoc(String content) {
|
|
|
+ Map<String, String> pageData = Preproc.extract_doc_pub(true, operationRecord_pageDataTitles, content);
|
|
|
+ pageData.put("病程记录内容",
|
|
|
+ pageData.get("病程记录内容")
|
|
|
+ .replace(pageData.get("病程记录时间"), "")
|
|
|
+ .replace(pageData.get("病程记录名称"), "")
|
|
|
+ );
|
|
|
+
|
|
|
+ List<String> targetTitles = Lists.newArrayList();
|
|
|
+ operationRecord_sourceTitles.forEach(sourceTitle -> {
|
|
|
+ String targetTitle = "";
|
|
|
+ for (int index = 0; index < sourceTitle.length(); index++) {
|
|
|
+ if (index == sourceTitle.length() - 1) {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1);
|
|
|
+ } else {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ targetTitles.add(targetTitle);
|
|
|
+ });
|
|
|
+
|
|
|
+ Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
+ sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
+
|
|
|
+ OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(sourceMap);
|
|
|
+ operationRecordDoc.setText(content);
|
|
|
+ operationRecordDoc.setPageData((Map) pageData);
|
|
|
+
|
|
|
+ return operationRecordDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> operationRecord_pageDataTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师"
|
|
|
+ );
|
|
|
+ private List<String> operationRecord_sourceTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师",
|
|
|
+ "记录时间",
|
|
|
+ "手术名称",
|
|
|
+ "麻醉方式",
|
|
|
+ "术前诊断",
|
|
|
+ "术后诊断",
|
|
|
+ "手术经过"
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************术前讨论、术前小结****************************************************/
|
|
|
+ private Map<String, PreoperativeDiscussionDoc> getPreoperativeDiscussionDocMap(List<String> contents) {
|
|
|
Map<String, PreoperativeDiscussionDoc> retMap = Maps.newHashMap();
|
|
|
if (ListUtil.isEmpty(contents)) {
|
|
|
return retMap;
|
|
|
}
|
|
|
- label = ListUtil.isEmpty(label) ? ModelStandardKeys.preoperativeDiscussion : label;
|
|
|
- Map<String, String> preoperativeDiscussionStructureMap = null;
|
|
|
int index = 1;
|
|
|
String operationName = null;
|
|
|
for (String content : contents) {
|
|
|
if (StringUtil.isBlank(content)) {
|
|
|
continue;
|
|
|
}
|
|
|
- preoperativeDiscussionStructureMap = Preproc.extract_doc_pub(false, label, content);
|
|
|
operationName = index + "";
|
|
|
- preoperativeDiscussionStructureMap.put("拟行术式", preoperativeDiscussionStructureMap.get("拟施手术方式、名称及可能的变更"));
|
|
|
- preoperativeDiscussionStructureMap.remove("拟施手术方式、名称及可能的变更");
|
|
|
- preoperativeDiscussionStructureMap.put("手术指征", preoperativeDiscussionStructureMap.get("手术指征与禁忌征"));
|
|
|
- preoperativeDiscussionStructureMap.remove("手术指征与禁忌征");
|
|
|
- preoperativeDiscussionStructureMap.put("可能意外和防范措施", preoperativeDiscussionStructureMap.get("主要术中、术后风险及防范措施"));
|
|
|
- preoperativeDiscussionStructureMap.remove("主要术中、术后风险及防范措施");
|
|
|
- preoperativeDiscussionStructureMap.put("术前术后注意事项", preoperativeDiscussionStructureMap.get("术中、术后注意事项(含护理事项)"));
|
|
|
- preoperativeDiscussionStructureMap.remove("术中、术后注意事项(含护理事项)");
|
|
|
- preoperativeDiscussionStructureMap.put("麻醉方式", preoperativeDiscussionStructureMap.get("拟施麻醉方式"));
|
|
|
- preoperativeDiscussionStructureMap.remove("拟施麻醉方式");
|
|
|
- preoperativeDiscussionStructureMap.put("术前准备内容", preoperativeDiscussionStructureMap.get("术前特殊准备"));
|
|
|
- preoperativeDiscussionStructureMap.remove("术前特殊准备");
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(preoperativeDiscussionStructureMap);
|
|
|
- preoperativeDiscussionDoc.setText(content);
|
|
|
+ PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(content);
|
|
|
preoperativeDiscussionDoc.setOperationName(operationName);
|
|
|
retMap.put(operationName, preoperativeDiscussionDoc);
|
|
|
index++;
|
|
@@ -154,4 +230,69 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
+ private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(String content) {
|
|
|
+ Map<String, String> pageData = Preproc.extract_doc_pub(true, preoperativeDiscussion_pageDataTitles, content);
|
|
|
+ pageData.put("病程记录内容",
|
|
|
+ pageData.get("病程记录内容")
|
|
|
+ .replace(pageData.get("病程记录时间"), "")
|
|
|
+ .replace(pageData.get("病程记录名称"), "")
|
|
|
+ );
|
|
|
+
|
|
|
+ List<String> targetTitles = Lists.newArrayList();
|
|
|
+ preoperativeDiscussion_sourceTitles.forEach(sourceTitle -> {
|
|
|
+ String targetTitle = "";
|
|
|
+ for (int index = 0; index < sourceTitle.length(); index++) {
|
|
|
+ if (index == sourceTitle.length() - 1) {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1);
|
|
|
+ } else {
|
|
|
+ targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ targetTitles.add(targetTitle);
|
|
|
+ });
|
|
|
+
|
|
|
+ Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
+ sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
+ sourceMap.put("拟行术式", sourceMap.get("拟施手术方式、名称及可能的变更"));
|
|
|
+ sourceMap.put("手术指征", sourceMap.get("手术指征与禁忌征"));
|
|
|
+ sourceMap.put("可能意外和防范措施", sourceMap.get("主要术中、术后风险及防范措施"));
|
|
|
+ sourceMap.put("术前术后注意事项", sourceMap.get("术中、术后注意事项(含护理事项)"));
|
|
|
+ sourceMap.put("麻醉方式", sourceMap.get("拟施麻醉方式"));
|
|
|
+ sourceMap.put("术前准备内容", sourceMap.get("术前特殊准备"));
|
|
|
+
|
|
|
+ PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(sourceMap);
|
|
|
+ preoperativeDiscussionDoc.setText(content);
|
|
|
+ preoperativeDiscussionDoc.setPageData((Map) pageData);
|
|
|
+
|
|
|
+ return preoperativeDiscussionDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> preoperativeDiscussion_pageDataTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师"
|
|
|
+ );
|
|
|
+ private List<String> preoperativeDiscussion_sourceTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师",
|
|
|
+ "记录时间",
|
|
|
+ "讨论方式",
|
|
|
+ "参加人员",
|
|
|
+ "简要病情",
|
|
|
+ "讨论结论",
|
|
|
+ "经治医师签名",
|
|
|
+ "经治医师签字时间",
|
|
|
+ "主刀医师签名",
|
|
|
+ "主刀医师签字时间",
|
|
|
+ "手术指征",
|
|
|
+ "麻醉方式",
|
|
|
+ "术前准备内容",
|
|
|
+ "术前术后注意事项",
|
|
|
+ "可能意外和防范措施",
|
|
|
+ "拟行术式"
|
|
|
+ );
|
|
|
+
|
|
|
}
|