浏览代码

患者360优化

xiaochan 1 年之前
父节点
当前提交
29ae727c9e

+ 2 - 1
src/main/java/thyyxxk/webserver/dao/his/view/Patient360Dao.java

@@ -102,7 +102,8 @@ public interface Patient360Dao {
             "where a.patient_id = #{mzNo}\n" +
             "  and pay_mark = 0\n" +
             "  and confirm_flag != 4\n" +
-            "  and isnull(cash_id, '') != '99998'\n" +
+            "  and isnull(cash_id, '') != '99998'" +
+            "  and charge_date is not null " +
             "group by patient_id,\n" +
             "         CONVERT(varchar(100), charge_date, 23)\n" +
             "order by date;")

+ 7 - 4
src/main/java/thyyxxk/webserver/service/view/Patient360Server.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.service.view;
 
 import com.alibaba.fastjson.JSONObject;
 import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.dao.his.medicalinsurance.SiMzDao;
@@ -20,18 +21,19 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.YiZhuFeiYongChaXunTiaoJ
 import thyyxxk.webserver.service.zhuyuanyisheng.YiZhuLuRuServer;
 import thyyxxk.webserver.service.zhuyuanyisheng.emr.EmrServer;
 import thyyxxk.webserver.utils.DateUtil;
+import thyyxxk.webserver.utils.ListUtil;
 import thyyxxk.webserver.utils.ResultVoUtil;
 import thyyxxk.webserver.utils.StringUtil;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Comparator;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
 
 @Service
+@Slf4j
 public class Patient360Server {
     private final Patient360Dao dao;
 
@@ -60,13 +62,14 @@ public class Patient360Server {
         }
 
         List<MedicalTrack> list = new ArrayList<>();
-
         //   住院时间
         list.addAll(dao.getHospMedicalTrack(patientInfo360.getInpatientNo()));
         // 门诊时间
         list.addAll(dao.getMzMedicalTrack(patientInfo360.getMzNo()));
-        // list 根据 date 字段字符串排序
-        list = list.stream().sorted(Comparator.comparing(MedicalTrack::getDate)).collect(Collectors.toList());
+        if (ListUtil.notBlank(list)) {
+            // list 根据 date 字段字符串排序
+            list = list.stream().sorted(Comparator.comparing(MedicalTrack::getDate)).collect(Collectors.toList());
+        }
         patientInfo360.getMedicalTrackList().addAll(list);
         return ResultVoUtil.success(patientInfo360);
     }