Browse Source

1.病案首页trans添加list非空判断

hujing 5 years ago
parent
commit
989108ee3a

+ 15 - 14
trans/src/main/java/com/lantone/qc/trans/changx/ChangxFirstPageRecordDocTrans.java

@@ -1,12 +1,11 @@
 package com.lantone.qc.trans.changx;
 package com.lantone.qc.trans.changx;
 
 
 import com.google.common.collect.Maps;
 import com.google.common.collect.Maps;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
 import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.pub.util.FastJsonUtils;
+import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.ModelDocTrans;
 
 
 import java.util.HashMap;
 import java.util.HashMap;
@@ -30,24 +29,26 @@ public class ChangxFirstPageRecordDocTrans extends ModelDocTrans {
         Map<String, Object> structureExtMap = Maps.newHashMap();
         Map<String, Object> structureExtMap = Maps.newHashMap();
         structureExtMap.putAll(content);
         structureExtMap.putAll(content);
         structureExtMap.put(Content.diagnose_cts, FastJsonUtils.getJsonToBean(content.get(Content.diagnose_cts), Object.class));
         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.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.operative_information, FastJsonUtils.getJsonToBean(content.get(Content.operative_information), Object.class));
         structureExtMap.put(Content.dischargeDiag, FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class));
         structureExtMap.put(Content.dischargeDiag, FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class));
-//        structureExtMap.put(Content.pathologyDiagnose, FastJsonUtils.getJsonToBean(content.get(Content.pathologyDiagnose), Object.class));
+        //        structureExtMap.put(Content.pathologyDiagnose, FastJsonUtils.getJsonToBean(content.get(Content.pathologyDiagnose), Object.class));
         firstPageRecordDoc.setStructureExtMap(structureExtMap);
         firstPageRecordDoc.setStructureExtMap(structureExtMap);
         //病案首页出院诊断页面信息只保留主要诊断和其他诊断
         //病案首页出院诊断页面信息只保留主要诊断和其他诊断
-        List<Map<String,String>> list = (List<Map<String, String>>) FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class);
-        Iterator<Map<String,String>> iterator = list.iterator();
-        Map<String,String> map = new HashMap<>();
-        while (iterator.hasNext()) {
-            map = new HashMap<>();
-            map = iterator.next();
-            if(!((map.get("诊断类别") != null && map.get("诊断类别").equals("主要诊断"))
-                    || (map.get("诊断类别") != null && map.get("诊断类别").equals("其他诊断")))){
-                iterator.remove();
+        List<Map<String, String>> list = (List<Map<String, String>>) FastJsonUtils.getJsonToBean(content.get(Content.dischargeDiag), Object.class);
+        if (ListUtil.isNotEmpty(list)) {
+            Iterator<Map<String, String>> iterator = list.iterator();
+            Map<String, String> map = new HashMap<>();
+            while (iterator.hasNext()) {
+                map = new HashMap<>();
+                map = iterator.next();
+                if (!((map.get("诊断类别") != null && map.get("诊断类别").equals("主要诊断"))
+                        || (map.get("诊断类别") != null && map.get("诊断类别").equals("其他诊断")))) {
+                    iterator.remove();
+                }
             }
             }
+            medrecVo.getContent().put("出院诊断", list.toString());
         }
         }
-        medrecVo.getContent().put("出院诊断",list.toString());
         firstPageRecordDoc.setPageData(medrecVo.getContent());
         firstPageRecordDoc.setPageData(medrecVo.getContent());
         return firstPageRecordDoc;
         return firstPageRecordDoc;
     }
     }