Explorar el Código

出院计算时决断是否有未发药的中草药/颗粒剂

lighter hace 1 año
padre
commit
530201b509

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

@@ -73,6 +73,10 @@ public interface DismissDao {
             "and status_flag='1' and page_no=0")
     int hasUnSubmitDrugList(@Param("patNo") String patNo, @Param("times") Integer times);
 
+    @Select("select count(1) from yz_act_order_cy where inpatient_no=#{patNo} " +
+            "and admiss_times=#{times} and status_flag='3'")
+    int hasUnDeliverHerbal(@Param("patNo") String patNo, @Param("times") Integer times);
+
     @Select("select b.group_name,pageNo=cast(a.page_no as decimal),a.page_no_ty " +
             "from yz_yp_zy_order a with(nolock),yp_zd_group_name b with(nolock) where a.inpatient_no=#{patNo} " +
             "and a.admiss_times=#{times} and (a.amount>0 or (a.amount<0 and a.drug_class!='d')) and " +

+ 5 - 0
src/main/java/thyyxxk/webserver/service/inpatient/DismissService.java

@@ -256,6 +256,11 @@ public class DismissService {
             exception.setMessage("此患者有未提交的药单。");
             throw new BizException(exception);
         }
+        if (dao.hasUnDeliverHerbal(patNo, times) > 0) {
+            ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
+            exception.setMessage("此患者有未发药的中草药/颗粒剂。");
+            throw new BizException(exception);
+        }
         List<IllegalFee> unhandledList = dao.hasUntreatedDrugOrder(patNo, times);
         if (!unhandledList.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.EXIST_UNHANDLED_DRUG_ORDER, unhandledList);