|
@@ -4,8 +4,11 @@ import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.pub.model.doc.DutyShiftSystemDoc;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
|
+import com.lantone.qc.trans.beilun.util.BeiLunCrisisValueReportHtmlAnalysis;
|
|
|
+import com.lantone.qc.trans.beilun.util.BeiLunDutyShiftSystemHtmlAnalysis;
|
|
|
+import com.lantone.qc.trans.beilun.util.BeiLunHtmlAnalysis;
|
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
-import com.lantone.qc.trans.comsis.Preproc;
|
|
|
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -20,57 +23,30 @@ public class BeiLunDutyShiftSystemDocTrans extends ModelDocTrans {
|
|
|
@Override
|
|
|
public List<DutyShiftSystemDoc> extract(MedrecVo medrecVo) {
|
|
|
List<DutyShiftSystemDoc> retList = Lists.newArrayList();
|
|
|
- List<String> contents = (List) medrecVo.getContent().get("content");
|
|
|
- contents.forEach(content -> {
|
|
|
- retList.add(getDutyShiftSystemDoc(content));
|
|
|
+ List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
|
|
|
+ contentMaps.forEach(contentMap -> {
|
|
|
+ retList.add(getDutyShiftSystemDoc(contentMap));
|
|
|
});
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- private DutyShiftSystemDoc getDutyShiftSystemDoc(String content) {
|
|
|
- Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
|
|
|
- pageData.put("病程记录内容",
|
|
|
- pageData.get("病程记录内容")
|
|
|
- .replace(pageData.get("病程记录时间"), "")
|
|
|
- .replace(pageData.get("病程记录名称"), "")
|
|
|
- );
|
|
|
+ private DutyShiftSystemDoc getDutyShiftSystemDoc(Map<String, Object> contentMap) {
|
|
|
+ String content = contentMap.get("xmlText").toString();
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
+ String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
+ BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunDutyShiftSystemHtmlAnalysis();
|
|
|
+ Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
+ Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
|
|
|
- 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);
|
|
|
- });
|
|
|
-
|
|
|
- Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
- sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
-
|
|
|
- DutyShiftSystemDoc dutyShiftSystemDoc = ModelDocGenerate.dutyShiftSystemDocGen(sourceMap);
|
|
|
+ DutyShiftSystemDoc dutyShiftSystemDoc = ModelDocGenerate.dutyShiftSystemDocGen(structureMap);
|
|
|
dutyShiftSystemDoc.setText(content);
|
|
|
- dutyShiftSystemDoc.setPageData((Map) pageData);
|
|
|
+ dutyShiftSystemDoc.setPageData((Map) structureMap);
|
|
|
|
|
|
return dutyShiftSystemDoc;
|
|
|
}
|
|
|
|
|
|
- private List<String> pageDataTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "记录医师"
|
|
|
- );
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList(
|
|
|
|
|
|
- private List<String> sourceTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "记录时间",
|
|
|
- "记录医师"
|
|
|
);
|
|
|
|
|
|
}
|