Browse Source

住院医生三级医生设置

DESKTOP-0GD05B0\Administrator 2 năm trước cách đây
mục cha
commit
96ab735757

+ 3 - 2
src/main/java/thyyxxk/webserver/controller/PublicController.java

@@ -50,8 +50,9 @@ public class PublicController {
 
 
     @GetMapping("/getRenYuan")
-    public ResultVo<List<GetDropdownBox>> getRenYuan(@RequestParam("code") String code) {
-        return service.getRenYuan(code);
+    public ResultVo<List<GetDropdownBox>> getRenYuan(@RequestParam("code") String code,
+                                                     @RequestParam("deptCode") String deptCode) {
+        return service.getRenYuan(code, deptCode);
     }
 
     @GetMapping("/getChargeCode")

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

@@ -8,6 +8,7 @@ import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
+import thyyxxk.webserver.entity.inpatient.patient.Overview;
 import thyyxxk.webserver.entity.inpatient.patient.Patient;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
 import thyyxxk.webserver.service.zhuyuanyisheng.YiZhuLuRuServer;
@@ -224,4 +225,9 @@ public class YizhuLuRuController {
         return server.drugWithdrawal(param);
     }
 
+    @PostMapping("/saveTheThirdLevelDoctor")
+    public ResultVo<String> saveTheThirdLevelDoctor(@RequestBody Overview param) {
+        return server.saveTheThirdLevelDoctor(param);
+    }
+
 }

+ 8 - 3
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -123,14 +123,19 @@ public interface PublicDao {
      * @param code 人员代码
      * @return 返回人员
      */
-    @Select("select distinct rtrim(code) code,rtrim(name) name," +
+    @Select("<script>" +
+            "select distinct rtrim(code) code,rtrim(name) name," +
             " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," +
             " emp_tit_name  = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," +
             " rtrim(yb_code) as  yb_code " +
             "from a_employee_mi where " +
             "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " +
-            "and isnull(del_flag,0) = 0 ")
-    List<GetDropdownBox> getRenYuan(String code);
+            "and isnull(del_flag,0) = 0 " +
+            "<if test=\"deptCode != null and deptCode != '' \">" +
+            "and dept_code = #{deptCode} " +
+            "</if>" +
+            "</script>")
+    List<GetDropdownBox> getRenYuan(String code,String deptCode);
 
     /**
      * @param pyCode 拼音编码

+ 7 - 1
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -30,7 +30,13 @@ public interface PatientDao {
             "                    where a.inpatient_no = c.inpatient_no " +
             "                      and c.admiss_times = a.admiss_times " +
             "                      and c.status_flag = '1' " +
-            "                      and c.enter_oper = #{userCode}) " +
+            "                      and c.enter_oper = #{userCode}), " +
+            "                   refer_physician, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +
+            "                   consult_physician, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +
+            "                   dept_director, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as dept_director_name " +
             "from zy_actpatient a where a.ward like #{ward} and charindex('$',a.inpatient_no)=0 " +
             "ORDER BY cast(a.bed_no AS int)")
     List<Overview> getOverView(@Param("ward") String ward,

+ 37 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 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.DoctorSOrderFee;
 import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
@@ -29,8 +30,33 @@ import java.util.stream.Stream;
 public interface YiZhuLuRuDao {
 
 
-    @Select("SELECT inpatient_no, admiss_times, sex, name, bed_no " +
-            "FROM zy_actpatient " +
+    @Select("SELECT " +
+            "RTRIM(a.bed_no) bedNo, " +
+            "RTRIM(a.inpatient_no) inpatientNo, " +
+            "a.admiss_times, " +
+            "RTRIM(a.name) as name, " +
+            "sex=isnull(a.sex, 9), " +
+            "mdtrtId=(select b.mdtrt_id from t_si_pat_info b where b.pat_no=a.inpatient_no " +
+            "and b.times=a.admiss_times and b.ledger_sn=a.times_billed), " +
+            "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
+            "and times=a.admiss_times and ledger_sn=a.times_billed), " +
+            "medType=a.med_type, " +
+            "dismissOrder=(select count(1) from yz_act_order b where b.inpatient_no=a.inpatient_no " +
+            "and b.admiss_times=a.admiss_times and status_flag > '1' and isnull(group_no,'00')='00' " +
+            "and order_code in ('06026','06053','05973'))," +
+            "orderNoCount = (select count(1) " +
+            "                    from yz_act_order c " +
+            "                    where a.inpatient_no = c.inpatient_no " +
+            "                      and c.admiss_times = a.admiss_times " +
+            "                      and c.status_flag = '1' " +
+            "                      and c.enter_oper = #{userCode}), " +
+            "                   refer_physician, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +
+            "                   consult_physician, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +
+            "                   dept_director, " +
+            "                   (select name from a_employee_mi where code = refer_physician) as dept_director_name " +
+            "FROM zy_actpatient a " +
             "where refer_physician = #{code} " +
             "ORDER BY cast(bed_no AS int) ")
     List<Patient> getMyPatient(String code);
@@ -1461,4 +1487,13 @@ public interface YiZhuLuRuDao {
                             @Param("list") List<YzActOrder> list);
 
 
+    @Update("UPDATE zy_actpatient " +
+            "SET refer_physician   = #{param.referPhysician}, " +
+            "    consult_physician = #{param.consultPhysician}, " +
+            "    dept_director     = #{param.deptDirector} " +
+            "WHERE inpatient_no = #{param.inpatientNo} " +
+            "  AND admiss_times = #{param.admissTimes} ")
+    void updateTheThirdLevelDoctor(@Param("param") Overview param);
+
+
 }

+ 23 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/patient/Overview.java

@@ -28,8 +28,31 @@ public class Overview {
     private Date endtime;
 
     private Integer status;
+
+    /**
+     * 未确认的医嘱
+     */
     private Integer orderNoCount;
 
+    /**
+     * 管床医生
+     */
+    private String referPhysician;
+    private String referPhysicianName;
+
+    /**
+     * 主治医生
+     */
+    private String consultPhysician;
+    private String consultPhysicianName;
+
+    /**
+     * 主任医生
+     */
+    private String deptDirector;
+    private String deptDirectorName;
+
+
     public Integer getStatus() {
         if (StringUtil.notBlank(mdtrtId) || StringUtil.notBlank(injurySerialNo)) {
             return 1;

+ 2 - 2
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -281,8 +281,8 @@ public class PublicServer {
      * @param code 人员代码
      * @return 返回人员
      */
-    public ResultVo<List<GetDropdownBox>> getRenYuan(String code) {
-        return ResultVoUtil.success(dao.getRenYuan(StringUtil.isContainChinese(code)));
+    public ResultVo<List<GetDropdownBox>> getRenYuan(String code, String deptCode) {
+        return ResultVoUtil.success(dao.getRenYuan(StringUtil.isContainChinese(code),deptCode));
     }
 
     /**

+ 16 - 4
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -19,6 +19,7 @@ import thyyxxk.webserver.entity.RoleCode;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 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.login.UserInfo;
 import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;
@@ -238,7 +239,6 @@ public class YiZhuLuRuServer {
         Map<String, Object> map = new HashMap<>();
         List<BigDecimal> confirmOrderInformation = new ArrayList<>();
 
-
         Date excludeOrders = null;
         BigDecimal orderNo = null;
 
@@ -272,13 +272,12 @@ public class YiZhuLuRuServer {
         if (excludeOrders != null) {
             int count = dao.thereAreUnexecutedOrders(param.getInpatientNo(), param.getAdmissTimes(), orderNo);
             if (count > 0) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "有未确认和未执行的医嘱,无法开排斥医嘱。");
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "有未确认和未执行的医嘱,无法确认。");
             }
+            dao.stopOrder(param.getInpatientNo(), param.getAdmissTimes(), excludeOrders, userCode);
         }
 
         dao.confirmOrders(confirmOrderInformation, TokenUtil.getTokenUserId(), param.getInpatientNo(), param.getAdmissTimes());
-        dao.stopOrder(param.getInpatientNo(), param.getAdmissTimes(), excludeOrders, userCode);
-
 
         log.info("确认的医嘱:{}", JSON.toJSONString(yiZhuList));
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
@@ -1463,6 +1462,7 @@ public class YiZhuLuRuServer {
      * @param param 医嘱数组
      * @return 返回提示
      */
+    @Deprecated
     public ResultVo<String> drugWithdrawal(List<String> param) {
         if (ListUtil.isBlank(param)) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有可以退的药品。");
@@ -1490,5 +1490,17 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "退药成功。");
     }
 
+    /**
+     * 设置患者三级医生
+     *
+     * @param param 参数
+     * @return 返回值
+     */
+    public ResultVo<String> saveTheThirdLevelDoctor(Overview param) {
+        log.info("设置三级医生:==> 操作人{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(param));
+        dao.updateTheThirdLevelDoctor(param);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
+    }
+
 
 }