|
@@ -2,12 +2,15 @@ package com.lantone.qc.trans.yiwu;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuFirstPageRecordXmlUtil;
|
|
|
import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
|
|
|
+import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
import com.lantone.qc.pub.util.FastJsonUtils;
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
|
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -22,22 +25,37 @@ public class YiWuFirstPageRecordDocTrans extends ModelDocTrans {
|
|
|
|
|
|
@Override
|
|
|
public FirstPageRecordDoc extract(MedrecVo medrecVo) {
|
|
|
- //Map<String, String> content = (Map) medrecVo.getContent();
|
|
|
- Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
|
|
|
- String content = contentMap.get("xmlText").toString();
|
|
|
+ // 与长兴一直,直接传json
|
|
|
+ Map<String, String> content = (Map) medrecVo.getContent();
|
|
|
FirstPageRecordDoc firstPageRecordDoc = new FirstPageRecordDoc();
|
|
|
- Map<String, Object> structureExtMap = null;
|
|
|
- Map<String, String> structureMap = Maps.newHashMap();
|
|
|
- if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
- structureExtMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
- } else {
|
|
|
- structureExtMap = YiWuFirstPageRecordXmlUtil.process(content);
|
|
|
- structureExtMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
- firstPageRecordDoc.setStructureExtMap(structureExtMap);
|
|
|
- }
|
|
|
- structureExtMap.forEach((k, v) -> structureMap.put(k, v.toString()));
|
|
|
+ Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(content, keyContrasts);
|
|
|
firstPageRecordDoc.setStructureMap(structureMap);
|
|
|
- firstPageRecordDoc.setPageData(structureExtMap);
|
|
|
+ //如果有入院时间,优先使用
|
|
|
+ if (StringUtils.isEmpty(structureMap.get("入院时间")) && StringUtils.isNotEmpty(structureMap.get("病人入院日期"))) {
|
|
|
+ structureMap.put("入院时间", structureMap.get("病人入院日期"));
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> structureExtMap = Maps.newHashMap();
|
|
|
+ structureExtMap.putAll(content);
|
|
|
+ structureExtMap.put(Content.diagnose_cts, FastJsonUtils.getJsonToBean(content.get(Content.diagnose_cts), Object.class));
|
|
|
+ /* structureExtMap.put(Content.outpatientEmergencyDiag, FastJsonUtils.getJsonToBean(content.get(Content.outpatientEmergencyDiag), Object.class));*/
|
|
|
+ structureExtMap.put(Content.operative_information, FastJsonUtils.getJsonToBean(content.get(Content.operative_information), Object.class));
|
|
|
+ structureExtMap.put(Content.dischargeDiag, FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class));
|
|
|
+
|
|
|
+ List<Map<String, String>> dischargeDiag = (List) structureExtMap.get(Content.dischargeDiag);
|
|
|
+ if (dischargeDiag != null && dischargeDiag.size() > 0) {
|
|
|
+ for (Map<String, String> diag : dischargeDiag) {
|
|
|
+ String diagCategory = diag.get("诊断类别");
|
|
|
+ if (StringUtil.isNotBlank(diagCategory) && "1".equals(diagCategory)) {
|
|
|
+ diag.put("诊断类别", "主要诊断");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // structureExtMap.put(Content.pathologyDiagnose, FastJsonUtils.getJsonToBean(content.get(Content.pathologyDiagnose), Object.class));
|
|
|
+ firstPageRecordDoc.setStructureExtMap(structureExtMap);
|
|
|
+ medrecVo.getContent().put("mode_id", ModuleMappingUtil.getStandardModuleId("6"));
|
|
|
+ firstPageRecordDoc.setPageData(medrecVo.getContent());
|
|
|
return firstPageRecordDoc;
|
|
|
}
|
|
|
|