Prechádzať zdrojové kódy

住院医生,以及一个审核的bug

xiaochan 3 rokov pred
rodič
commit
6fc08397d2

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>1</version>
+    <version>2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

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

@@ -10,6 +10,7 @@ import thyyxxk.webserver.entity.yibao.ZyActpatient;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
 import thyyxxk.webserver.service.zhuyuanyisheng.YiZhuLuRuServer;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -117,4 +118,11 @@ public class YizhuLuRuController {
         return server.muBanCaoZuo(patternCode, patternName, deptCode, sortNo, flag);
     }
 
+
+    @GetMapping("/yiZhuChaoZuo")
+    public ResultVo<String> yiZhuChaoZuo(@RequestParam("actOrderNo") BigDecimal actOrderNo,
+                                         @RequestParam("flag") Integer flag,
+                                         @RequestParam("content") String content) {
+        return server.yiZhuChaoZuo(actOrderNo, flag, content);
+    }
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/datamodify/YzActOrderModifyVerifyDao.java

@@ -80,7 +80,7 @@ public interface YzActOrderModifyVerifyDao extends BaseMapper<TYzActOrderModify>
     List<TYzActOrderModify> getCount();
 
     @Select("select admiss_date " +
-            "from zy_actpatien " +
+            "from zy_actpatient " +
             "where inpatient_no = #{patNo} ")
     Date huanZaiRuYuanShiJian(@Param("patNo") String patNo);
 

+ 46 - 7
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -6,6 +6,7 @@ import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.yibao.ZyActpatient;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Set;
 
@@ -107,7 +108,6 @@ public interface YiZhuLuRuDao {
             "       order_time, " +
             "       physician, " +
             "       start_time, " +
-            "       end_time, " +
             "       drug_specification, " +
             "       drug_quan, " +
             "       drug_quan_name = (select name from yp_zd_unit with (NOLOCK) where code = mini_unit)," +
@@ -139,7 +139,6 @@ public interface YiZhuLuRuDao {
             "       serial, " +
             "       group_no, " +
             "       signer, " +
-            "       modifier, " +
             "       cl_code, " +
             "       doctor_flag, " +
             "       emergency_flag, " +
@@ -160,12 +159,16 @@ public interface YiZhuLuRuDao {
             "       kf_flag, " +
             "       refer_physician, " +
             "       consult_physician, " +
-            "    /* 开这个医嘱的医生 */ " +
-            "       physician_name = (select  top(1) rtrim(name) from a_employee_mi with (NOLOCK) where code = physician), " +
+            "       physician_name = (select  top(1) rtrim(name) from a_employee_mi with (NOLOCK) where code = physician) /* 开这个医嘱的医生 */, " +
             "       exec_unit_name = (select  top(1) rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit), " +
             "    /*管床医生*/ " +
             "       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 temp.group_no = group_no) " +
+            "       group_no_name = (select rtrim(group_name) from yp_zd_group_name with (NOLOCK) where temp.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 /*停止时间*/ " +
             "from ( " +
             "         select top ${pageSize} * " +
             "         from (select row_number() over (order by act_order_no) rowIndex, * " +
@@ -181,6 +184,18 @@ public interface YiZhuLuRuDao {
             "<if test=\"frequCode != null and frequCode != '' \">" +
             " and frequ_code = #{frequCode}" +
             "</if>" +
+            "<if test=\"zhuangTai != 0 and zhuangTai != 3  and zhuangTai != 6 and zhuangTai != 7 \">" +
+            " and status_flag = #{zhuangTai} /*触发*/" +
+            "</if>" +
+            "<if test=\"zhuangTai == 3 \">" +
+            " and status_flag in (3,4) " +
+            "</if>" +
+            "<if test=\"zhuangTai == 6 \">" +
+            " and frequ_code &lt;&gt; 'ONCE' and end_time is null and doctor_flag = '1' and status_flag &lt;&gt; '5' " +
+            "</if>" +
+            "<if test=\"zhuangTai == 7 \">" +
+            " and  doctor_flag = '1' and status_flag &gt;= '2' and start_time &gt;= dateadd(hour , -24, getdate()) " +
+            "</if>" +
             "              ) page " +
             "         where rowIndex > (${currentPage} - 1) * ${pageSize} " +
             "     ) temp" +
@@ -192,7 +207,8 @@ public interface YiZhuLuRuDao {
                                      @Param("startTime") String startTime,
                                      @Param("endTime") String endTime,
                                      @Param("frequCode") String frequCode,
-                                     @Param("orderName") String orderName);
+                                     @Param("orderName") String orderName,
+                                     @Param("zhuangTai") Integer zhuangTai);
 
 
     @Select("<script>" +
@@ -210,6 +226,18 @@ public interface YiZhuLuRuDao {
             "<if test=\"orderName != null and orderName != '' \">" +
             " and order_name = #{orderName}" +
             "</if>" +
+            "<if test=\"zhuangTai != 3 and zhuangTai != 0 \">" +
+            " and status_flag = #{zhuangTai} " +
+            "</if>" +
+            "<if test=\"zhuangTai == 3 \">" +
+            " and status_flag in (3,4) " +
+            "</if>" +
+            "<if test=\"zhuangTai == 6 \">" +
+            " and frequ_code &lt;&gt; 'ONCE' and end_time is null and doctor_flag = '1' and status_flag &lt;&gt; '5' " +
+            "</if>" +
+            "<if test=\"zhuangTai == 7 \">" +
+            " and  doctor_flag = '1' and status_flag &gt;= '2' and start_time &gt;= dateadd(hour , -24, getdate()) " +
+            "</if>" +
             " and isnull(parent_no, '') = '' " +
             "</script>")
     long huoQuYiZhuShuJuTotal(@Param("patNo") String patNo,
@@ -217,7 +245,8 @@ public interface YiZhuLuRuDao {
                               @Param("startTime") String startTime,
                               @Param("endTime") String endTime,
                               @Param("frequCode") String frequCode,
-                              @Param("orderName") String orderName);
+                              @Param("orderName") String orderName,
+                              @Param("zhuangTai") Integer zhuangTai);
 
 
     @Select("SELECT distinct py_code=a.py_code, " +
@@ -860,5 +889,15 @@ public interface YiZhuLuRuDao {
                        @Param("inputId") String inputId,
                        @Param("collectCode") String collectCode);
 
+    @Select("select * " +
+            "from yz_act_order " +
+            "where act_order_no = #{actOrderNo} ")
+    YzActOrder chaXunYiZhuXinXin(BigDecimal actOrderNo);
+
+    @Update("update yz_act_order set emergency_flag = #{emergencyFlag} " +
+            "where act_order_no = #{actOrderNo} ")
+    void sheZhiJinJi(@Param("actOrderNo") BigDecimal actOrderNo,
+                     @Param("emergencyFlag") String emergencyFlag);
+
 
 }

+ 11 - 8
src/main/java/thyyxxk/webserver/entity/datamodify/YzActOrder.java

@@ -62,8 +62,10 @@ public class YzActOrder implements Serializable {
 
     private String endTimeString;
 
+    /**
+     * 停止人
+     */
     private String modifier;
-
     private String modifierName;
 
     private String infantFlag;
@@ -82,7 +84,11 @@ public class YzActOrder implements Serializable {
 
     private Date confirmTime;
 
+    /**
+     * 确认人
+     */
     private String signer;
+    private String signerName;
 
     private String statusFlag;
 
@@ -274,7 +280,10 @@ public class YzActOrder implements Serializable {
      * 抗菌药物 专用 需要在 yz_act_record_kss 中插入
      */
     private String kjywFlag;
-
+    /**
+     * 取模板时候的 id
+     */
+    private BigDecimal id;
 
     /* 费用标志 自备标志 1 自备 2 嘱托 3 基数药 */
     public String getSelfBuyName() {
@@ -291,12 +300,6 @@ public class YzActOrder implements Serializable {
         }
     }
 
-    /**
-     * 取模板时候的 id
-     */
-    private BigDecimal id;
-
-
     public String getDrugFlagName() {
         if (drugFlag == null) return "";
         switch (drugFlag) {

+ 7 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/YaoPingJiLiang.java

@@ -26,4 +26,11 @@ public class YaoPingJiLiang implements Serializable {
         this.name = name;
         this.value = value;
     }
+
+    public BigDecimal getValue() {
+        if (value == null) {
+            return new BigDecimal(1);
+        }
+        return value;
+    }
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/YiZhuFeiYongChaXunTiaoJian.java

@@ -27,4 +27,5 @@ public class YiZhuFeiYongChaXunTiaoJian {
     private String endTime;
     private String frequCode;
     private String orderName;
+    private Integer zhuangTai;
 }

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

@@ -74,20 +74,22 @@ public class YiZhuLuRuServer {
         }
         PatientTemp patient = EntityCopy.Copy(resPpatient.getData(), PatientTemp.class);
         HuanZheFeiYong feiYong = dao.feiYongXinXi(patient.getInpatientNo(), patient.getAdmissTimes(), patient.getLedgerSn());
-        // 余额
-        patient.setBalance(feiYong.getBalance());
-        // 总费用
-        patient.setTotalCharge(feiYong.getTotalCharge());
-        // 药品 百分比
-        patient.setYp(DecimalUtil.getPercent(Double.parseDouble(feiYong.getYp()), Double.parseDouble(feiYong.getTotalCharge())));
-        // 检验检查 百分比
-        patient.setJyjc(DecimalUtil.getPercent(Double.parseDouble(feiYong.getJyjc()), Double.parseDouble(feiYong.getTotalCharge())));
-        // 医保 费用
-        patient.setChargeYb(feiYong.getChargeYb());
-        // 年龄
-        patient.setAge(DateUtil.calculateAge(patient.getBirthDate()));
-        // 医保百分比
-        patient.setYb(DecimalUtil.getPercent(Double.parseDouble(feiYong.getChargeYb()), Double.parseDouble(feiYong.getTotalCharge())));
+        if (feiYong != null) {
+            // 余额
+            patient.setBalance(feiYong.getBalance());
+            // 总费用
+            patient.setTotalCharge(feiYong.getTotalCharge());
+            // 药品 百分比
+            patient.setYp(DecimalUtil.getPercent(Double.parseDouble(feiYong.getYp()), Double.parseDouble(feiYong.getTotalCharge())));
+            // 检验检查 百分比
+            patient.setJyjc(DecimalUtil.getPercent(Double.parseDouble(feiYong.getJyjc()), Double.parseDouble(feiYong.getTotalCharge())));
+            // 医保 费用
+            patient.setChargeYb(feiYong.getChargeYb());
+            // 年龄
+            patient.setAge(DateUtil.calculateAge(patient.getBirthDate()));
+            // 医保百分比
+            patient.setYb(DecimalUtil.getPercent(Double.parseDouble(feiYong.getChargeYb()), Double.parseDouble(feiYong.getTotalCharge())));
+        }
         return ResultVoUtil.success(patient);
     }
 
@@ -125,12 +127,12 @@ public class YiZhuLuRuServer {
         IPage<YzActOrder> page = new Page<>();
         if (param.getTotal() == 0) {
             page.setTotal(dao.huoQuYiZhuShuJuTotal(param.getPatNo(),
-                    param.getTimes(), param.getStartTime(), param.getEndTime(), param.getFrequCode(), param.getOrderName()));
+                    param.getTimes(), param.getStartTime(), param.getEndTime(), param.getFrequCode(), param.getOrderName(), param.getZhuangTai()));
         } else {
             page.setTotal(param.getTotal());
         }
         List<YzActOrder> yiZhuList = dao.huoQuYiZhuShuJu(param.getCurrentPage(), param.getPageSize(), param.getPatNo(),
-                param.getTimes(), param.getStartTime(), param.getEndTime(), param.getFrequCode(), param.getOrderName());
+                param.getTimes(), param.getStartTime(), param.getEndTime(), param.getFrequCode(), param.getOrderName(), param.getZhuangTai());
 
         // 还有那些没有被匹配的子级医嘱
         Map<BigDecimal, YzActOrder> wuFuJiYiZhu = yiZhuList.stream().collect(
@@ -690,4 +692,33 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success();
     }
 
+    /**
+     * 医嘱操作
+     *
+     * @param actOrderNo 医嘱号
+     * @param flag       标志 1-设为紧急 2-撤销 3-停止
+     * @return 返回提示
+     */
+    public ResultVo<String> yiZhuChaoZuo(BigDecimal actOrderNo, Integer flag, String content) {
+        log.info("医嘱操作:医嘱号:{},标志:{}", actOrderNo, flag);
+        YzActOrder yz = dao.chaXunYiZhuXinXin(actOrderNo);
+        if (yz == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有查询到该医嘱可能已经被撤销了");
+        }
+        switch (flag) {
+            case 1:
+                return sheZhiJinJi(yz);
+        }
+        return ResultVoUtil.success();
+    }
+
+    public ResultVo<String> sheZhiJinJi(YzActOrder yz) {
+        String emergencyFlag = null;
+        if (yz.getEmergencyFlag() == null || !yz.getEmergencyFlag().trim().equals("1")) {
+            emergencyFlag = "1";
+        }
+        dao.sheZhiJinJi(yz.getActOrderNo(), emergencyFlag);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
+    }
+
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/utils/ResultVoUtil.java

@@ -20,6 +20,10 @@ public class ResultVoUtil {
         return new ResultVo<>(exceptionEnum, message);
     }
 
+    public static <T> ResultVo<T> success(ExceptionEnum exceptionEnum) {
+        return new ResultVo<>(exceptionEnum);
+    }
+
     public static <T> ResultVo<T> fail(ExceptionEnum exceptionEnum) {
         return new ResultVo<>(exceptionEnum);
     }