|
@@ -50,56 +50,46 @@ public class OrdinaryAssistant {
|
|
|
|
|
|
public static void changx() {
|
|
|
String content = FileUtil.fileRead("C:\\Users\\RGB\\Desktop\\调试\\入院记录.txt");
|
|
|
+
|
|
|
+ Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
|
|
|
+ Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, keyContrasts);
|
|
|
+
|
|
|
String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region/Content_Text");
|
|
|
if (StringUtil.isBlank(text)) {
|
|
|
text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
|
|
|
}
|
|
|
- Map<String, String> cutWordMap = getCutWordMap(text);
|
|
|
- Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
|
|
|
- cutWordMap.putAll(xmlNodeValueMap);
|
|
|
- Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(cutWordMap, keyContrasts);
|
|
|
- structureMap.put("记录时间", structureMap.get("记录日期"));
|
|
|
- structureMap.put("查房日期", structureMap.get("记录日期"));
|
|
|
- structureMap.put("病情记录", text);
|
|
|
- int endIndex = text.indexOf("查房记录");
|
|
|
- if (endIndex > 0) {
|
|
|
- String title = text.substring(0, endIndex);
|
|
|
- title = title.substring(title.lastIndexOf(" ") + 1) + "查房记录";
|
|
|
- structureMap.put("查房标题", title);
|
|
|
- }
|
|
|
+ Map<String, String> cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
+
|
|
|
|
|
|
- structureMap.keySet().forEach(key -> {
|
|
|
- System.out.println(key + "-----------" + structureMap.get(key));
|
|
|
+ cutWordMap.keySet().forEach(key -> {
|
|
|
+ System.out.println(key + "----" + cutWordMap.get(key));
|
|
|
});
|
|
|
|
|
|
- }
|
|
|
+
|
|
|
+// xmlNodeValueMap.keySet().forEach(key -> {
|
|
|
+// System.out.println("\"" + key + "=\",");
|
|
|
+//
|
|
|
+// });
|
|
|
|
|
|
|
|
|
- private static Map<String, String> getCutWordMap(String content) {
|
|
|
- if (StringUtil.isBlank(content)) {
|
|
|
- return Maps.newHashMap();
|
|
|
- }
|
|
|
- List<String> targetTitles = Lists.newArrayList();
|
|
|
- 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);
|
|
|
- });
|
|
|
- return Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
}
|
|
|
|
|
|
private static List<String> sourceTitles = Lists.newArrayList(
|
|
|
- "记录医生"
|
|
|
+ "抢救时间",
|
|
|
+ "记录时间",
|
|
|
+ "记录医师",
|
|
|
+ "抢救过程",
|
|
|
+ "参与人员"
|
|
|
);
|
|
|
|
|
|
private static List<String> keyContrasts = Lists.newArrayList(
|
|
|
- "记录医生=记录医师"
|
|
|
+ "记录日期=记录时间",
|
|
|
+ "病情变化情况=",
|
|
|
+ "抢救时间及措施++++抢救措施=抢救过程",
|
|
|
+ "参加抢救者的姓名及专业技术职称++++参加现场抢救的医师及护理人员=参与人员",
|
|
|
+ "签名++++=记录医师",
|
|
|
+ "签名时间=抢救时间"
|
|
|
);
|
|
|
|
|
|
}
|