Explorar el Código

出院申请需要确认患者是否已死亡

lighter hace 2 años
padre
commit
34a052df8d

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/DismissDao.java

@@ -118,6 +118,10 @@ public interface DismissDao {
             "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')")
     Integer countDisActOrders(@Param("patNo") String patNo, @Param("times") Integer times);
 
+    @Select("select count(1) from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
+            "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code='05973' ")
+    Integer selectDeathOrderCount(@Param("patNo") String patNo, @Param("times") Integer times);
+
     @Select("select count(1) from yz_inact_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
             "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')")
     Integer countDisActOrders2(@Param("patNo") String patNo, @Param("times") Integer times);

+ 5 - 5
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiSettleApplyDao.java

@@ -21,7 +21,7 @@ public interface SiSettleApplyDao {
             "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
     Date selectActOrderDisDate(@Param("table") String table, @Param("patNo") String patNo, @Param("times") Integer times);
 
-    @Select("select status,handle_comment,type,settle_datetime,acct_used_flag from t_si_settle_apply with(nolock) " +
+    @Select("select status,handle_comment,type,settle_datetime,acct_used_flag,death_flag from t_si_settle_apply with(nolock) " +
             "where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledger} and type=#{type}")
     SiSettleApply selectSettleApply(@Param("patNo") String patNo,
                                     @Param("times") int times,
@@ -35,12 +35,12 @@ public interface SiSettleApplyDao {
                            @Param("type") int type);
 
     @Insert("insert into t_si_settle_apply (pat_no,times,ledger_sn,input_staff,input_comment,input_datetime,status,type," +
-            "settle_datetime,settled,acct_used_flag) values (#{patNo},#{times},#{ledgerSn},#{inputStaff},#{inputComment},getdate()," +
-            "0,#{type},#{settleDatetime},0,#{acctUsedFlag})")
+            "settle_datetime,settled,acct_used_flag,death_flag) values (#{patNo},#{times},#{ledgerSn},#{inputStaff}," +
+            "#{inputComment},getdate(),0,#{type},#{settleDatetime},0,#{acctUsedFlag},#{deathFlag})")
     void insertSettleApply(SiSettleApply apply);
 
     @Select("select a.pat_no,a.times,a.ledger_sn,a.status,a.type,c.sex as gender,rtrim(c.name) as name,b.med_type, " +
-            "wardName=(select rtrim(name) from zd_unit_code with(nolock) where code=c.ward) " +
+            "wardName=(select rtrim(name) from zd_unit_code with(nolock) where code=c.ward),a.death_flag " +
             "from t_si_settle_apply a with(nolock), t_si_pat_info b with(nolock), zy_actpatient c with(nolock) " +
             "where a.settled=0 and a.pat_no=b.pat_no and a.times=b.times " +
             "and a.ledger_sn=b.ledger_sn and a.pat_no=c.inpatient_no")
@@ -55,7 +55,7 @@ public interface SiSettleApplyDao {
             "medinsTotalCharge=(select isnull(sum(charge_fee),0) from zy_detail_charge c with(nolock) where c.inpatient_no=a.pat_no " +
             "and c.admiss_times=a.times and c.ledger_sn=a.ledger_sn and trans_flag_yb=1), " +
             "fundpay=(select isnull(charge_yb,0) from zy_ledger_file c with(nolock) where c.inpatient_no=a.pat_no " +
-            "and c.admiss_times=a.times and c.ledger_sn=a.ledger_sn) " +
+            "and c.admiss_times=a.times and c.ledger_sn=a.ledger_sn),death_flag " +
             "from t_si_settle_apply a with(nolock), t_si_pat_info b with(nolock) where a.pat_no=#{patNo} and a.times=#{times} and " +
             "a.ledger_sn=#{ledgerSn} and a.type=#{type} and a.pat_no=b.pat_no and a.times=b.times and a.ledger_sn=b.ledger_sn")
     SiSettleApply selectCurrentApply(SiSettleApply apply);

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

@@ -126,6 +126,7 @@ public class Patient {
     private String diseCode;
     private String diseName;
     private String expContent;
+    private Boolean deathFlag;
 
     public String getSexName() {
         if (sex == null) {

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/SiSettleApply.java

@@ -75,6 +75,11 @@ public class SiSettleApply implements Serializable {
 	 * */
 	private String acctUsedFlag;
 
+	/**
+	 * 死亡标志
+	 * */
+	private Boolean deathFlag;
+
 	private String mdtrtId;
 
 	private String wardName;

+ 7 - 1
src/main/java/thyyxxk/webserver/service/inpatient/DismissService.java

@@ -263,6 +263,13 @@ public class DismissService {
                 exception.setMessage("此患者没有医保出院诊断。");
                 throw new BizException(exception);
             }
+            if (null != param.getDeathFlag() && param.getDeathFlag()) {
+                return ResultVoUtil.success();
+            }
+            Integer deathOrderCount = dao.selectDeathOrderCount(patNo, times);
+            if (null != deathOrderCount && deathOrderCount > 0) {
+                return ResultVoUtil.success();
+            }
             if (medinfo.getMedType().equals(MedType.INJURY_HOSPITALIZATION.getCode())) {
                 if (param.getMidSetl()) {
                     param.setBegntime(begntime);
@@ -297,7 +304,6 @@ public class DismissService {
         return ResultVoUtil.success();
     }
 
-
     private String dischargeErrorMessage(List<String> messages) {
         StringBuilder str = new StringBuilder("此患者有未接收的药单" + "<br />");
         for (String message : messages) {