|
@@ -34,7 +34,6 @@ import java.util.*;
|
|
public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
|
|
|
|
private List<OperationDoc> operationDocs;
|
|
private List<OperationDoc> operationDocs;
|
|
- private List<String> containList = Arrays.asList("查房", "主任", "主治", "主刀", "日常病程", "病程记录", "术后第");
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<ThreeLevelWardDoc> extract(MedrecVo medrecVo) {
|
|
public List<ThreeLevelWardDoc> extract(MedrecVo medrecVo) {
|
|
@@ -53,89 +52,78 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
}
|
|
}
|
|
|
|
|
|
private void classifyThreeLevelWardDoc(ThreeLevelWardDoc threeLevelWardDoc, Map<String, Object> contentMap) {
|
|
private void classifyThreeLevelWardDoc(ThreeLevelWardDoc threeLevelWardDoc, Map<String, Object> contentMap) {
|
|
- if (contentMap.get("recTitle") != null && StringUtil.isNotBlank(contentMap.get("recTitle").toString())) {
|
|
|
|
- boolean flag = false;
|
|
|
|
- for (String word : containList) {
|
|
|
|
- if (contentMap.get("recTitle").toString().contains(word)) {
|
|
|
|
- flag = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ 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 {
|
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
|
+ String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
|
+ BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunThreeLevelWardHtmlAnalysis();
|
|
|
|
+ Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
}
|
|
}
|
|
- if (flag) {
|
|
|
|
- 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 {
|
|
|
|
- String recTitle = contentMap.get("recTitle").toString();
|
|
|
|
- String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
|
- BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunThreeLevelWardHtmlAnalysis();
|
|
|
|
- Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
|
- if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
|
- structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
|
- structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (MapUtils.isEmpty(structureMap)) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (structureMap.containsKey("病情记录")) {
|
|
|
|
- structureMap.put("病情记录", structureMap.get("病情记录").replace(" ", ""));
|
|
|
|
- }
|
|
|
|
- //structureMap.put("查房日期", structureMap.get("记录时间"));
|
|
|
|
|
|
+ }
|
|
|
|
+ if (MapUtils.isEmpty(structureMap)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- /*Map<String, String> cutWordMap = Maps.newHashMap();
|
|
|
|
- String text = CxXmlUtil.getXmlText(content);
|
|
|
|
- if (StringUtil.isNotBlank(text)) {
|
|
|
|
- if (StringUtil.isBlank(structureMap.get("病情记录"))) {
|
|
|
|
- structureMap.put("病情记录", text);
|
|
|
|
|
|
+ if (structureMap.containsKey("病情记录")) {
|
|
|
|
+ structureMap.put("病情记录", structureMap.get("病情记录").replace(" ", ""));
|
|
|
|
+ }
|
|
|
|
+ //structureMap.put("查房日期", structureMap.get("记录时间"));
|
|
|
|
+ /*Map<String, String> cutWordMap = Maps.newHashMap();
|
|
|
|
+ String text = CxXmlUtil.getXmlText(content);
|
|
|
|
+ if (StringUtil.isNotBlank(text)) {
|
|
|
|
+ if (StringUtil.isBlank(structureMap.get("病情记录"))) {
|
|
|
|
+ structureMap.put("病情记录", text);
|
|
|
|
+ }
|
|
|
|
+ cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
|
|
|
|
+ if (StringUtil.isBlank(structureMap.get("记录医师"))) {
|
|
|
|
+ Pattern p = Pattern.compile("^[^\\u4e00-\\u9fa5]+$");//分词结果如果不包含中文为日期,则不覆盖
|
|
|
|
+ if (StringUtil.isNotEmpty(cutWordMap.get("医师签名"))) {
|
|
|
|
+ Matcher m = p.matcher(cutWordMap.get("医师签名"));
|
|
|
|
+ if (!m.matches()) {
|
|
|
|
+ structureMap.put("记录医师", cutWordMap.get("医师签名"));
|
|
}
|
|
}
|
|
- cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
|
|
|
|
- if (StringUtil.isBlank(structureMap.get("记录医师"))) {
|
|
|
|
- Pattern p = Pattern.compile("^[^\\u4e00-\\u9fa5]+$");//分词结果如果不包含中文为日期,则不覆盖
|
|
|
|
- if (StringUtil.isNotEmpty(cutWordMap.get("医师签名"))) {
|
|
|
|
- Matcher m = p.matcher(cutWordMap.get("医师签名"));
|
|
|
|
- if (!m.matches()) {
|
|
|
|
- structureMap.put("记录医师", cutWordMap.get("医师签名"));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(cutWordMap.get("记录医生"))) {
|
|
|
|
- Matcher m = p.matcher(cutWordMap.get("记录医生"));
|
|
|
|
- if (!m.matches()) {
|
|
|
|
- structureMap.put("记录医师", cutWordMap.get("记录医生"));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.isNotEmpty(cutWordMap.get("记录医生"))) {
|
|
|
|
+ Matcher m = p.matcher(cutWordMap.get("记录医生"));
|
|
|
|
+ if (!m.matches()) {
|
|
|
|
+ structureMap.put("记录医师", cutWordMap.get("记录医生"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- */
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
|
|
- //总的查房记录 汇总
|
|
|
|
- ThreeLevelWardDoc allDoctorWradDoc = new ThreeLevelWardDoc();
|
|
|
|
- allDoctorWradDoc.setStructureMap(structureMap);
|
|
|
|
- allDoctorWradDoc.setPageData((Map) structureMap);
|
|
|
|
- threeLevelWardDoc.addAllDoctorWradDoc(allDoctorWradDoc);
|
|
|
|
|
|
+ //总的查房记录 汇总
|
|
|
|
+ ThreeLevelWardDoc allDoctorWradDoc = new ThreeLevelWardDoc();
|
|
|
|
+ allDoctorWradDoc.setStructureMap(structureMap);
|
|
|
|
+ allDoctorWradDoc.setPageData((Map) structureMap);
|
|
|
|
+ threeLevelWardDoc.addAllDoctorWradDoc(allDoctorWradDoc);
|
|
|
|
|
|
- //主任医师查房
|
|
|
|
- DirectorDoctorWardDoc directorDoctorWardDoc = findDirectorDoctorWardDoc(structureMap);
|
|
|
|
- if (directorDoctorWardDoc != null) {
|
|
|
|
- threeLevelWardDoc.addDirectorDoctorWardDoc(findDirectorDoctorWardDoc(structureMap));
|
|
|
|
- }
|
|
|
|
- //主治医师查房
|
|
|
|
- AttendingDoctorWardDoc attendingDoctorWardDoc = findAttendingDoctorWardDoc(structureMap);
|
|
|
|
- if (attendingDoctorWardDoc != null) {
|
|
|
|
- threeLevelWardDoc.addAttendingDoctorWardDoc(attendingDoctorWardDoc);
|
|
|
|
- }
|
|
|
|
- //普通医师查房
|
|
|
|
- if (directorDoctorWardDoc == null && attendingDoctorWardDoc == null) {
|
|
|
|
- GeneralDoctorWardDoc generalDoctorWardDoc = new GeneralDoctorWardDoc();
|
|
|
|
- generalDoctorWardDoc.setStructureMap(structureMap);
|
|
|
|
- generalDoctorWardDoc.setPageData((Map) structureMap);
|
|
|
|
- threeLevelWardDoc.addGeneralDoctorWardDoc(generalDoctorWardDoc);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //主任医师查房
|
|
|
|
+ DirectorDoctorWardDoc directorDoctorWardDoc = findDirectorDoctorWardDoc(structureMap);
|
|
|
|
+ if (directorDoctorWardDoc != null) {
|
|
|
|
+ threeLevelWardDoc.addDirectorDoctorWardDoc(findDirectorDoctorWardDoc(structureMap));
|
|
|
|
+ }
|
|
|
|
+ //主治医师查房
|
|
|
|
+ AttendingDoctorWardDoc attendingDoctorWardDoc = findAttendingDoctorWardDoc(structureMap);
|
|
|
|
+ if (attendingDoctorWardDoc != null) {
|
|
|
|
+ threeLevelWardDoc.addAttendingDoctorWardDoc(attendingDoctorWardDoc);
|
|
}
|
|
}
|
|
|
|
+ //普通医师查房
|
|
|
|
+ if (directorDoctorWardDoc == null && attendingDoctorWardDoc == null) {
|
|
|
|
+ GeneralDoctorWardDoc generalDoctorWardDoc = new GeneralDoctorWardDoc();
|
|
|
|
+ generalDoctorWardDoc.setStructureMap(structureMap);
|
|
|
|
+ generalDoctorWardDoc.setPageData((Map) structureMap);
|
|
|
|
+ threeLevelWardDoc.addGeneralDoctorWardDoc(generalDoctorWardDoc);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -160,7 +148,7 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
title = title.replace("一助", doctorTitle);
|
|
title = title.replace("一助", doctorTitle);
|
|
}
|
|
}
|
|
if ((StringUtils.isNotEmpty(subTitle(title)) && subTitle(title).contains("主任")) || findDirector(content)
|
|
if ((StringUtils.isNotEmpty(subTitle(title)) && subTitle(title).contains("主任")) || findDirector(content)
|
|
- || title.contains("三级医师查房")) {
|
|
|
|
|
|
+ || title.contains("三级")) {
|
|
directorDoctorWardDoc = new DirectorDoctorWardDoc();
|
|
directorDoctorWardDoc = new DirectorDoctorWardDoc();
|
|
directorDoctorWardDoc.setStructureMap(structureMap);
|
|
directorDoctorWardDoc.setStructureMap(structureMap);
|
|
directorDoctorWardDoc.setPageData((Map) structureMap);
|
|
directorDoctorWardDoc.setPageData((Map) structureMap);
|
|
@@ -176,7 +164,7 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
writTitle = writTitle.replace("一助", doctorTitle);
|
|
writTitle = writTitle.replace("一助", doctorTitle);
|
|
}
|
|
}
|
|
if ((StringUtils.isNotEmpty(subTitle(writTitle)) && subTitle(writTitle).contains("主任")) || findDirector(content)
|
|
if ((StringUtils.isNotEmpty(subTitle(writTitle)) && subTitle(writTitle).contains("主任")) || findDirector(content)
|
|
- || writTitle.contains("三级医师查房")) {
|
|
|
|
|
|
+ || writTitle.contains("三级")) {
|
|
directorDoctorWardDoc = new DirectorDoctorWardDoc();
|
|
directorDoctorWardDoc = new DirectorDoctorWardDoc();
|
|
directorDoctorWardDoc.setStructureMap(structureMap);
|
|
directorDoctorWardDoc.setStructureMap(structureMap);
|
|
directorDoctorWardDoc.setPageData((Map) structureMap);
|
|
directorDoctorWardDoc.setPageData((Map) structureMap);
|
|
@@ -207,7 +195,7 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
title = title.replace("一助", doctorTitle);
|
|
title = title.replace("一助", doctorTitle);
|
|
}
|
|
}
|
|
if ((StringUtils.isNotEmpty(subTitle(title)) && subTitle(title).contains("主治"))
|
|
if ((StringUtils.isNotEmpty(subTitle(title)) && subTitle(title).contains("主治"))
|
|
- || findAttend(content) || title.contains("三级医师查房")) {
|
|
|
|
|
|
+ || findAttend(content) || title.contains("三级")) {
|
|
attendingDoctorWardDoc = new AttendingDoctorWardDoc();
|
|
attendingDoctorWardDoc = new AttendingDoctorWardDoc();
|
|
attendingDoctorWardDoc.setStructureMap(structureMap);
|
|
attendingDoctorWardDoc.setStructureMap(structureMap);
|
|
attendingDoctorWardDoc.setPageData((Map) structureMap);
|
|
attendingDoctorWardDoc.setPageData((Map) structureMap);
|
|
@@ -224,7 +212,7 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
writTitle = writTitle.replace("一助", doctorTitle);
|
|
writTitle = writTitle.replace("一助", doctorTitle);
|
|
}
|
|
}
|
|
if ((StringUtils.isNotEmpty(subTitle(writTitle)) && subTitle(writTitle).contains("主治"))
|
|
if ((StringUtils.isNotEmpty(subTitle(writTitle)) && subTitle(writTitle).contains("主治"))
|
|
- || findAttend(content) || writTitle.contains("三级医师查房")) {
|
|
|
|
|
|
+ || findAttend(content) || writTitle.contains("三级")) {
|
|
attendingDoctorWardDoc = new AttendingDoctorWardDoc();
|
|
attendingDoctorWardDoc = new AttendingDoctorWardDoc();
|
|
attendingDoctorWardDoc.setStructureMap(structureMap);
|
|
attendingDoctorWardDoc.setStructureMap(structureMap);
|
|
attendingDoctorWardDoc.setPageData((Map) structureMap);
|
|
attendingDoctorWardDoc.setPageData((Map) structureMap);
|
|
@@ -299,10 +287,10 @@ public class BeiLunThreeLevelWardDocTrans extends ModelDocTrans {
|
|
Map<String, String> structureMap = operationRecordDoc.getStructureMap();
|
|
Map<String, String> structureMap = operationRecordDoc.getStructureMap();
|
|
String chiefSurgeon = structureMap.get(findTitle);
|
|
String chiefSurgeon = structureMap.get(findTitle);
|
|
String operatorEndDateStr = structureMap.get("手术结束时间");
|
|
String operatorEndDateStr = structureMap.get("手术结束时间");
|
|
- if(StringUtil.isBlank(chiefSurgeon)){
|
|
|
|
|
|
+ if (StringUtil.isBlank(chiefSurgeon)) {
|
|
chiefSurgeon = structureMap.get("手术者及助手名称");
|
|
chiefSurgeon = structureMap.get("手术者及助手名称");
|
|
- if(StringUtil.isNotBlank(chiefSurgeon) && chiefSurgeon.contains("、")){
|
|
|
|
- chiefSurgeon = chiefSurgeon.split("、")[0].replace("主刀:","");
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(chiefSurgeon) && chiefSurgeon.contains("、")) {
|
|
|
|
+ chiefSurgeon = chiefSurgeon.split("、")[0].replace("主刀:", "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (StringUtil.isBlank(chiefSurgeon) || StringUtil.isBlank(operatorEndDateStr)) {
|
|
if (StringUtil.isBlank(chiefSurgeon) || StringUtil.isBlank(operatorEndDateStr)) {
|