Ver código fonte

患者信息查询

xiaochan 1 ano atrás
pai
commit
730952426e

+ 16 - 5
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/PatientInfoQueryDao.java

@@ -52,16 +52,27 @@ public interface PatientInfoQueryDao {
             "       move_flag, " +
             "       owe_flag, " +
             "       admiss_diag_str, " +
-            "       responce_type, " +
-            "       responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," +
+            "       a.responce_type, " +
+            "       responce_name = (select rtrim(name) name from zy_zd_responce_type where code = a.responce_type)," +
             "       balance, " +
             "       total_charge, " +
             "       zk_ward," +
-            "       admissWardName = (select rtrim(name) from zd_unit_code where code = admiss_ward)," +
+            "       admissWardName = (select rtrim(name) from zd_unit_code where code = a.admiss_ward)," +
             "       zkWardName     = (select rtrim(name) from zd_unit_code where code = zk_ward)," +
             "       birth_date     = (select birth_date from a_patient_mi c where a.inpatient_no = c.inpatient_no)," +
-            "       emr_audit       = (select count(1) from emr_audit_detail where pat_no = inpatient_no and times = admiss_times) " +
-            "FROM ${tableName} a " +
+            "       emr_audit       = (select count(1) from emr_audit_detail where pat_no = a.inpatient_no and times = a.admiss_times)," +
+            "       act_ipt_days=(datediff(day, a.admiss_date, isnull(a.dis_date,getdate())))," +
+            "       admissPhysicianName = (select name from a_employee_mi where code = admiss_physician),\n" +
+            "       referPhysicianName = (select name from a_employee_mi where code = refer_physician),\n" +
+            "      zyDismissWay =  (select name from zd_zy_dismiss_way where code = zy_dismiss_way),\n" +
+            "      disDeptName =  (select name from zd_unit_code where code = dis_dept),\n" +
+            "       disMainDiag = (select name\n" +
+            "        from t_case_frontsheet_disdiag disdiag\n" +
+            "        where disdiag.bah = a.inpatient_no\n" +
+            "          and disdiag.times = a.admiss_times\n" +
+            "          and no = 1) " +
+            "FROM ${tableName} a" +
+            "  left join t_case_frontsheet_main b on (a.inpatient_no = b.bah and a.admiss_times = b.admiss_times) " +
             " ${ew.customSqlSegment} ")
     List<Patient> getPatInfo(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
                              @Param("tableName") String tableName);

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/patient/Patient.java

@@ -86,6 +86,11 @@ public class Patient {
     private String injurySerialNo;
     private String actIptDays; // 入院时间
     private String revokeRemark;
+
+    /**
+     * 离院方式
+     */
+    private String zyDismissWay;
     /**
      * 患者居住地
      */
@@ -196,6 +201,9 @@ public class Patient {
 
     private String crmName;
 
+    private String disDeptName;
+    private String disMainDiag;
+
     public String getSexName() {
         if (sex == null) {
             return "";
@@ -235,4 +243,8 @@ public class Patient {
     public String mainInfo() {
         return "姓名:" + name + ",住院号:" + inpatientNo + ",住院次数:" + admissTimes;
     }
+
+    public String getPatId() {
+        return inpatientNo + "_" + admissTimes;
+    }
 }

+ 6 - 6
src/main/java/thyyxxk/webserver/service/inpatient/XiangMuLuRuService.java

@@ -321,6 +321,11 @@ public class XiangMuLuRuService {
         // 录入人的id
         param.setOpIdCode(TokenUtil.getInstance().getTokenUserId());
         List<ZyDetailCharge> yaoPingShenQingDan = new ArrayList<>();
+
+        Integer settlementFlag = dao.getHuanZheSFJieSuan(param.getInpatientNo(), param.getAdmissTimes());
+        if (settlementFlag == null || settlementFlag != 0) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者已经结算了");
+        }
         // 药品
         for (ZyDetailCharge zyDetailCharge : param.getList()) {
             switch (zyDetailCharge.getBillItemCode()) {
@@ -361,10 +366,6 @@ public class XiangMuLuRuService {
             if (zyDetailCharge.getChargeCodeMx() == null) {
                 zyDetailCharge.setChargeCodeMx(zyDetailCharge.getChargeCode());
             }
-            Integer settlementFlag = dao.getHuanZheSFJieSuan(param.getInpatientNo(), param.getAdmissTimes());
-            if (settlementFlag == null || settlementFlag != 0) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者已经结算了");
-            }
             // 0 - 住院费用  3 - 门急诊 6 - 医技
             if (param.getOrderNo() != null) {
                 zyDetailCharge.setOrderNo(param.getOrderNo());
@@ -389,9 +390,8 @@ public class XiangMuLuRuService {
         if (ListUtil.notBlank(yaoPingShenQingDan)) {
             dao.shenQingYaoPing(param, yaoPingShenQingDan, infantFlag, ledgerSn, TokenUtil.getInstance().getTokenUserId());
         }
-
         log.info("项目录入费用上传 ==》 操作人:{},数据:{}", param.getOpIdCode(), JSON.toJSONString(param));
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "费用上传成功。<( ̄︶ ̄)>");
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "费用上传成功。");
     }
 
     /**

+ 1 - 1
src/main/resources/application-cytest.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8708
+  port: 8706
   tomcat:
     uri-encoding: utf-8
     threads: