|
@@ -1,9 +1,11 @@
|
|
package com.lantone.qc.trans.changx;
|
|
package com.lantone.qc.trans.changx;
|
|
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
|
|
import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
|
|
import com.lantone.qc.pub.model.keys.ModelStandardKeys;
|
|
import com.lantone.qc.pub.model.keys.ModelStandardKeys;
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
|
+import com.lantone.qc.pub.util.MapUtil;
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
@@ -21,15 +23,29 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
|
|
@Override
|
|
@Override
|
|
public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
|
|
public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
|
|
String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
|
|
String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
|
|
- Map<String, String> structureMap =
|
|
|
|
- Preproc.extract_doc_pub(
|
|
|
|
- false,
|
|
|
|
- ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.deathCaseDiscuss : medrecVo.getLabel(),
|
|
|
|
- content
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- DeathCaseDiscussDoc deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(structureMap);
|
|
|
|
|
|
+
|
|
|
|
+ List<String> targetTitles = Lists.newArrayList();
|
|
|
|
+ List<String> sourceTitles = ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.deathCaseDiscuss : medrecVo.getLabel();
|
|
|
|
+ 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(false, targetTitles, content);
|
|
|
|
+ Map<String, String> targetMap = MapUtil.copyMap((Map) sourceMap);
|
|
|
|
+ targetMap.put("记录时间", targetMap.get("病程记录时间"));
|
|
|
|
+ targetMap.remove("病程记录时间");
|
|
|
|
+
|
|
|
|
+ DeathCaseDiscussDoc deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(targetMap);
|
|
deathCaseDiscussDoc.setText(content);
|
|
deathCaseDiscussDoc.setText(content);
|
|
|
|
+ deathCaseDiscussDoc.setPageData((Map) sourceMap);
|
|
|
|
|
|
return deathCaseDiscussDoc;
|
|
return deathCaseDiscussDoc;
|
|
}
|
|
}
|