瀏覽代碼

优化代码以及查询医嘱费用

xiaochan 2 年之前
父節點
當前提交
e566e5d31b

+ 6 - 6
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/YizhuLuRuController.java

@@ -10,6 +10,7 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.SelectV2;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
+import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.patient.Overview;
 import thyyxxk.webserver.entity.inpatient.patient.Patient;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
@@ -131,12 +132,6 @@ public class YizhuLuRuController {
         return server.huoQuZhuYuanPinLv(code);
     }
 
-    @GetMapping("/huoQuGeiYaoFangShi")
-    @PassToken
-    public ResultVo<List<GetDropdownBox>> huoQuGeiYaoFangShi(String code) {
-        return server.huoQuGeiYaoFangShi(code);
-    }
-
     @GetMapping("/huoQuZhiXinKeShi")
     public ResultVo<List<GetDropdownBox>> huoQuZhiXinKeShi(String code) {
         return server.huoQuZhiXinKeShi(code);
@@ -229,4 +224,9 @@ public class YizhuLuRuController {
         return server.copyOrder(copyOrder);
     }
 
+    @GetMapping("/queryFeeByOrderNo")
+    public ResultVo<List<ZyDetailCharge>> queryFeeByOrderNo(@RequestParam("actOrderNo") BigDecimal actOrderNo) {
+        return server.queryFeeByOrderNo(actOrderNo);
+    }
+
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/XiangMuLuRuDao.java

@@ -951,4 +951,5 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
     List<DrugReturnForm> getAPrescriptionByPageNo(Integer pageNo);
 
 
+
 }

+ 28 - 117
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -225,123 +225,6 @@ public interface YiZhuLuRuDao {
     List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq);
 
 
-    @Select("select                     a.act_order_no, " +
-            "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
-            "    newOrderFlag         = (select count(*) " +
-            "                            from new_act_order_recording " +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
-            "                           order_code, " +
-            "                           order_name, " +
-            "                           rtrim(frequ_code)                                frequ_code, " +
-            "    frequ_code_name      = (select rtrim(comm) " +
-            "                            from yz_order_frequency " +
-            "                            where code = frequ_code), " +
-            "                           instruction, " +
-            "                           discription, " +
-            "                           infant_flag, " +
-            "                           order_time, " +
-            "                           physician, " +
-            "                           start_time, " +
-            "                           drug_specification, " +
-            "                           drug_quan, " +
-            "    mini_unit_name      = (select name " +
-            "                            from yp_zd_unit with (NOLOCK) " +
-            "                            where code = mini_unit), " +
-            "                           rtrim(supply_code)                               supply_code, " +
-            "    supply_code_name     = (select rtrim(supply_name) " +
-            "                            from yz_supply_type with (NOLOCK) " +
-            "                            where yz_supply_type.supply_code = a.supply_code), " +
-            "                           a.inpatient_no, " +
-            "                           a.admiss_times, " +
-            "                           drug_flag, " +
-            "                           enter_oper, " +
-            "    enter_oper_name      = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = enter_oper) /* 录入人 */, " +
-            "                           enter_time, " +
-            "                           mini_unit, " +
-            "                           drug_weight, " +
-            "                           drug_weight_unit, " +
-            "                           rtrim(status_flag)                               status_flag, " +
-            "                           status_time, " +
-            "                           parent_no, " +
-            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no), " +
-            "                           self_buy, " +
-            "                           dose, " +
-            "                           dose_unit, " +
-            "    dose_unit_name       = (select name " +
-            "                            from yp_zd_unit with (NOLOCK) " +
-            "                            where dose_unit = code), " +
-            "                           drug_occ, " +
-            "                           drug_volume, " +
-            "                           drug_vol_unit, " +
-            "                           exclu_back_time, " +
-            "                           exclu_act_order_no, " +
-            "                           pay_self, " +
-            "                           serial, " +
-            "                           group_no, " +
-            "                           signer, " +
-            "                           cl_code, " +
-            "                           doctor_flag, " +
-            "                           emergency_flag, " +
-            "    exclu_type='', " +
-            "    end_time_b=end_time, " +
-            "    new_flag='0', " +
-            "    order_no_pattern=0, " +
-            "    suprice_flag='', " +
-            "    self_flag            ='', " +
-            "    pack_size=0.0, " +
-            "    parent_no_c=           -1000, " +
-            "                           reg_flag, " +
-            "    parent_flag='', " +
-            "                           yb_self_flag, " +
-            "                           kf_flag, " +
-            "                           refer_physician, " +
-            "                           consult_physician, " +
-            "    physician_name       = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = physician) /* 开这个医嘱的医生 */, \\ " +
-            "                           exec_unit, " +
-            "    exec_unit_name       = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = exec_unit), " +
-            "                           a.dept_code, " +
-            "    dept_name            = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = dept_code), " +
-            "                           a.ward_code, " +
-            "    ward_name            = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = a.ward_code), " +
-            "    /*管床医生*/ " +
-            "    refer_physician_name = (select rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = refer_physician), " +
-            "    group_no_name        = (select rtrim(group_name) " +
-            "                            from yp_zd_group_name with (NOLOCK) " +
-            "                            where a.group_no = group_no), " +
-            "    signer_name          = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = signer) /*确认人*/, " +
-            "                           confirm_time /*确认时间*/, " +
-            "                           modifier, " +
-            "    modifier_name        = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = modifier) /*停止人*/, " +
-            "                           end_time /*停止时间*/, " +
-            "                           b.new_ward as                                    zkWardCode, " +
-            "                           b.new_dept as                                    zkDeptCode, " +
-            "                           kss.yyfs, " +
-            "                           kss.ssqk, " +
-            "                           kss.yysj, " +
-            "    executer1            = (select name from a_employee_mi where code = executer1), " +
-            "    executer2=             (select name from a_employee_mi where code = executer2) " +
-            "from yz_inact_order a  with (NOLOCK) left join " +
-            "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
-            "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +
-            " ${ew.customSqlSegment} ")
-    List<XinZhenYzActOrder> selectInOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq);
-
     @Select("select act_order_no, " +
             "rtrim(status_flag) status_flag," +
             "frequ_code," +
@@ -1497,4 +1380,32 @@ public interface YiZhuLuRuDao {
     void associateOrders(BigDecimal children, XinZhenYzActOrder order);
 
 
+    @Select("SELECT                 a.gen_time,\n" +
+            "                       inpatient_no,\n" +
+            "                       admiss_times,\n" +
+            "                       ledger_sn,\n" +
+            "                       a.detail_sn,\n" +
+            "                       a.charge_date,\n" +
+            "                       a.charge_code_mx,\n" +
+            "    charge_code_name = (case\n" +
+            "                            when serial = '99' or serial = '01'\n" +
+            "                                then (select top 1 rtrim(name)\n" +
+            "                                      from yp_zd_dict\n" +
+            "                                      where code = charge_code_mx\n" +
+            "                                        and yp_zd_dict.serial = a.serial)\n" +
+            "                            else (select rtrim(name) from zd_charge_item where code = charge_code_mx) end),\n" +
+            "                       a.charge_fee,\n" +
+            "                       a.charge_status,\n" +
+            "                       a.serial,\n" +
+            "    charge_amount=a.charge_amount,\n" +
+            "    exec_dept=(select name from zd_unit_code where code = a.exec_unit),\n" +
+            "    dept_code        = (select name from zd_unit_code where code = a.ward_code),\n" +
+            "                       isnull(a.ori_detail_sn, 0) as ori_detail_sn " +
+            "FROM zy_detail_charge a " +
+            "where order_no = #{yz.actOrderNo} " +
+            "  and inpatient_no = #{yz.inpatientNo} " +
+            "  and admiss_times = #{yz.admissTimes} order by charge_date desc ")
+    List<ZyDetailCharge> selectOrderFee(@Param("yz") XinZhenYzActOrder yz);
+
+
 }

+ 11 - 13
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -128,7 +128,7 @@ public class YiZhuLuRuServer {
         qw.orderByAsc("a.order_time");
 
 
-        List<XinZhenYzActOrder> yiZhuList =  dao.selectOrderNo(qw);
+        List<XinZhenYzActOrder> yiZhuList = dao.selectOrderNo(qw);
         // 还有那些没有被匹配的子级医嘱
         Map<BigDecimal, XinZhenYzActOrder> wuFuJiYiZhu = yiZhuList.stream().collect(Collectors.toMap(XinZhenYzActOrder::getActOrderNo, a -> a, (k1, k2) -> k1));
 
@@ -836,17 +836,6 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(dao.huoQuZhuYuanPinLv("%" + code.toUpperCase() + "%"));
     }
 
-    /**
-     * 获取给药方式
-     *
-     * @param code 五笔,拼音,中文,编码
-     * @return 返回对应的数据
-     */
-    @Deprecated
-    public ResultVo<List<GetDropdownBox>> huoQuGeiYaoFangShi(String code) {
-        return ResultVoUtil.success(dao.huoQuGeiYaoFangShi(StringUtil.isContainChinese(code)));
-    }
-
     /**
      * 获取执行科室
      *
@@ -870,7 +859,7 @@ public class YiZhuLuRuServer {
         Map<String, Object> errorMessage = checkData.startCheck(null);
         Map<String, Object> returnMap = new HashMap<>();
         returnMap.put("data", param.getList().get(0));
-        returnMap.put("message", errorMessage.get(param.getList().get(0).getId()) );
+        returnMap.put("message", errorMessage.get(param.getList().get(0).getId()));
         return ResultVoUtil.success(returnMap);
     }
 
@@ -1158,6 +1147,7 @@ public class YiZhuLuRuServer {
      * @param times 住院次数
      * @return 返回
      */
+    @Deprecated
     public ResultVo<Map<String, Object>> expensesForGettingADoctorSOrder(String patNo, Integer times) {
         List<DoctorSOrderFee> feeDate = dao.expensesForGettingADoctorSOrder(patNo, times);
         // 这些编码的医嘱都是有问题的
@@ -1368,4 +1358,12 @@ public class YiZhuLuRuServer {
     }
 
 
+    public ResultVo<List<ZyDetailCharge>> queryFeeByOrderNo(BigDecimal actOrderNo) {
+        XinZhenYzActOrder yz = dao.getActOrderNoOne(actOrderNo.stripTrailingZeros().toPlainString());
+        List<ZyDetailCharge> feeList = dao.selectOrderFee(yz);
+
+        return ResultVoUtil.success(feeList);
+    }
+
+
 }