浏览代码

Merge remote-tracking branch 'upstream/master'

hsh 2 年之前
父节点
当前提交
e47419d5da

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

@@ -89,8 +89,9 @@ public class YizhuLuRuController {
     }
 
     @GetMapping("/huoQuXiangMu")
-    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(String code) {
-        return server.huoQuXiangMu(code);
+    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(@RequestParam("code") String code,
+                                                      @RequestParam("groupNo") String groupNo) {
+        return server.huoQuXiangMu(code,groupNo);
     }
 
     @GetMapping("/huoQuFeiYongXinXi")

+ 0 - 6
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/BasSelectOverviewDao.java

@@ -43,12 +43,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "dismiss_date<=#{end} order by admiss_dept,admiss_doctor")
     List<SheetOverview> selectPatientsFromSignedBase(GetOutSheet param);
 
-    @Select("select sign_datetime as signDate,bah,times,name,gender as sex,status as fileStatus, " +
-            "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=apply_staff) " +
-            "from t_frontsheet_sign_apply with(nolock) " +
-            "where bah=#{bah} and status=#{status}")
-    List<SheetOverview> selectSignApply(@Param("bah") String bah, @Param("status") int status);
-
     @Select("select " +
             "fileStatus=0, " +
             "bedNo=rtrim(a.bed_no), " +

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/CaseFrontSheetDao.java

@@ -500,7 +500,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "#{assistantTwo},#{cut},#{heal},#{anaesthesia},#{anaesthesiaor},#{date},#{opEndDate},#{anstStartDate},#{anstEndDate})")
     void writeNewZySurgeryRecord(CaseFrontsheetSurgery surgery);
 
-    @Update("update t_case_frontsheet_main set file_status=1, sign_datetime=getdate() where bah=#{bah} and admiss_times=#{times}")
+    @Update("update t_case_frontsheet_main set file_status=1, sign_date=getdate() where bah=#{bah} and admiss_times=#{times}")
     void updateSignStatus(@Param("bah") String bah, @Param("times") int times);
 
     @Delete("delete from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times}; " +

+ 4 - 3
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -3,6 +3,7 @@ package thyyxxk.webserver.dao.his.zhuyuanyisheng;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.*;
+import org.springframework.web.bind.annotation.RequestParam;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
@@ -272,7 +273,7 @@ public interface YiZhuLuRuDao {
                      Integer times);
 
 
-    @Select("SELECT         distinct        rtrim(a.code) + rtrim(serial) as id, " +
+    @Select("SELECT         rtrim(a.code) + rtrim(serial) as id, " +
             "               py_code=a.py_code, " +
             "                d_code =a.d_code, " +
             "                order_code =a.code, " +
@@ -308,14 +309,14 @@ public interface YiZhuLuRuDao {
             "                yb_type, " +
             "                yb_flag_new," +
             "                father_flag, " +
-            "                manu_name=(select name from yp_zd_manufactory with (NOLOCK) where code *= a.manu_code), " +
+            "                manu_name=(select name from yp_zd_manufactory with (NOLOCK) where code = a.manu_code), " +
             "                stock_amount=a.stock_amount, " +
             "                national_code," +
             "                national_name " +
             "FROM view_yp_zd_dict_base_yf a with (NOLOCK) " +
             "WHERE isnull(a.visible_flag_zy, '') <> '1' " +
             "  and (a.py_code like #{code} or a.name like #{code} or code like #{code}) " +
-            "  and group_no = #{groupNo}  ")
+            "  and group_no in ('${groupNo}') ")
     List<YiZhuMingChen> yiZhuYaoPing(@Param("code") String code,
                                      @Param("groupNo") String groupNo);
 

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

@@ -30,9 +30,9 @@ public class YiZhuMingChen {
     private String discription;
     private String serial;
     private String groupNo;
+    private String groupName;
     private String infusionFlag;
     private String drugFlag;
-    private String groupName;
     private float packSize;
     private String orderClass;
     private String specPack;

+ 1 - 4
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetMainService.java

@@ -160,10 +160,7 @@ public class CaseFrontSheetMainService {
             if (param.getFileStatus() == 0) {
                 list = basDao.selectPatientsForBasByBah(param);
                 if (list.isEmpty()) {
-                    list = basDao.selectSignApply(param.getBah(), param.getFileStatus());
-                    if (list.isEmpty()) {
-                        return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有找到此患者的未归档病案。");
-                    }
+                    return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有找到此患者的未归档病案。");
                 }
             } else {
                 list = basDao.selectPatientsFromSignedBase(param);

+ 71 - 69
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -191,10 +191,10 @@ public class YiZhuLuRuServer {
      * @param code 拼音首字母,中文,编码来进行搜索
      * @return 返回项目信息
      */
-    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(String code) {
+    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(String code, String groupNo) {
         code = StringUtil.isContainChinese(code);
         // 药品
-        List<YiZhuMingChen> list = dao.yiZhuYaoPing(code, publicServer.getGroupNo());
+        List<YiZhuMingChen> list = dao.yiZhuYaoPing(code, groupNo);
         // 项目
         list.addAll(dao.yiZhuXiangMu(code));
         // 模板
@@ -929,56 +929,58 @@ public class YiZhuLuRuServer {
     }
 
     private Map<String, Object> checkData(XinZhenYzActOrder item, Map<String, XinZhenYzActOrder> drug, Map<String, List<XinZhenYzActOrder>> project, XinZhenYiZhu huanZheXinXi, Integer 医生级别) {
-        boolean 严格校验 = huanZheXinXi != null;
-        List<String> 错误信息 = new ArrayList<>();
-        List<String> 警告信息 = new ArrayList<>();
-
+        boolean strictVerification = huanZheXinXi != null;
+        List<String> errorMessage = new ArrayList<>();
+        List<String> warningMessage = new ArrayList<>();
+        if (StringUtil.isBlank(item.getGroupNo())) {
+            errorMessage.add("没有药房请重新开。");
+        }
         if (ITEM.equals(item.getSerial())) {
-            List<XinZhenYzActOrder> 项目明细 = project.get(item.getOrderCode());
+            List<XinZhenYzActOrder> projectDetails = project.get(item.getOrderCode());
             // 如果这个项目下面没有费用明细,那么这就是一条口头医,口头医嘱每次只能开一个
-            if (ListUtil.notBlank(项目明细)) {
-                for (XinZhenYzActOrder 明细 : 项目明细) {
-                    if (明细.getDelFlag() == 1) {
-                        错误信息.add(String.format("项目:【%s】,已经被物价停用了", 明细.getOrderName()));
+            if (ListUtil.notBlank(projectDetails)) {
+                for (XinZhenYzActOrder detailed : projectDetails) {
+                    if (detailed.getDelFlag() == 1) {
+                        errorMessage.add(String.format("项目:【%s】,已经被物价停用了", detailed.getOrderName()));
                     }
-                    if (StringUtil.isBlank(明细.getNationalCode())) {
-                        警告信息.add(String.format("项目:【%s】,没有匹配医保码", 明细.getOrderName()));
+                    if (StringUtil.isBlank(detailed.getNationalCode())) {
+                        warningMessage.add(String.format("项目:【%s】,没有匹配医保码", detailed.getOrderName()));
                     }
                 }
             }
             item.setDrugOcc(item.getDrugQuan());
         } else {
-            XinZhenYzActOrder feiYongXinXi = drug.get(item.getOrderCode().trim() + item.getSerial().trim() + item.getGroupNo().trim());
-            if (feiYongXinXi != null) {
-                if (feiYongXinXi.getDelFlag() == 1) {
-                    错误信息.add("药品已经被停用了,请联系药剂科");
+            XinZhenYzActOrder detailsOfDrugs = drug.get(item.getOrderCode().trim() + item.getSerial().trim() + item.getGroupNo().trim());
+            if (detailsOfDrugs != null) {
+                if (detailsOfDrugs.getDelFlag() == 1) {
+                    errorMessage.add("药品已经被停用了,请联系药剂科");
                 }
-                if (feiYongXinXi.getYpLevel() > 医生级别) {
-                    错误信息.add("您没有开此药品的权限");
+                if (detailsOfDrugs.getYpLevel() > 医生级别) {
+                    errorMessage.add("您没有开此药品的权限");
                 }
-                if (StringUtil.isBlank(feiYongXinXi.getNationalCode())) {
-                    警告信息.add("该药品没有医保编码");
+                if (StringUtil.isBlank(detailsOfDrugs.getNationalCode())) {
+                    warningMessage.add("该药品没有医保编码");
                 }
-                if (BigUtils.bigXiaoYu(feiYongXinXi.getStockAmount(), 10)) {
-                    警告信息.add(String.format("该药品剩余数量为:【%s】", feiYongXinXi.getStockAmount().stripTrailingZeros().toPlainString()));
+                if (BigUtils.bigXiaoYu(detailsOfDrugs.getStockAmount(), 10)) {
+                    warningMessage.add(String.format("该药品剩余数量为:【%s】", detailsOfDrugs.getStockAmount().stripTrailingZeros().toPlainString()));
                 }
-                if (BigUtils.bigDaYu(item.getDrugQuan(), feiYongXinXi.getStockAmount())) {
-                    错误信息.add("药品领量大于药品的库存,当前库存量" + feiYongXinXi.getStockAmount().stripTrailingZeros().toPlainString());
+                if (BigUtils.bigDaYu(item.getDrugQuan(), detailsOfDrugs.getStockAmount())) {
+                    errorMessage.add("药品领量大于药品的库存,当前库存量" + detailsOfDrugs.getStockAmount().stripTrailingZeros().toPlainString());
                 }
-                if (严格校验) {
-                    if (feiYongXinXi.getDeptRestrictions() > 0) {
-                        错误信息.add("该药品禁止在患者所在的科室使用。");
+                if (strictVerification) {
+                    if (detailsOfDrugs.getDeptRestrictions() > 0) {
+                        errorMessage.add("该药品禁止在患者所在的科室使用。");
                     }
-                    if (feiYongXinXi.getVisibleFlagZy() == 1) {
-                        错误信息.add("该药品禁止住院患者使用。");
+                    if (detailsOfDrugs.getVisibleFlagZy() == 1) {
+                        errorMessage.add("该药品禁止住院患者使用。");
                     }
-                    item.setKjywFlag(feiYongXinXi.getKjywFlag());
-                    if (feiYongXinXi.getKjywFlag() == 1) {
+                    item.setKjywFlag(detailsOfDrugs.getKjywFlag());
+                    if (detailsOfDrugs.getKjywFlag() == 1) {
                         if (item.getYyfs() == null) {
-                            错误信息.add("请填写抗菌药物医嘱附注信息录入");
+                            errorMessage.add("请填写抗菌药物医嘱附注信息录入");
                         } else if (item.getYyfs() == 1 || item.getYyfs() == 2) {
                             if (item.getSsqk() == null) {
-                                错误信息.add("当用药方式为 1 或 2 时,手术切口和用药时间不能为空");
+                                errorMessage.add("当用药方式为 1 或 2 时,手术切口和用药时间不能为空");
                             }
                         }
                     }
@@ -989,101 +991,101 @@ public class YiZhuLuRuServer {
                         item.setEndTime(item.getStartTime());
                     }
                     if (dao.dischargeWithMedicationAdministration(item.getSupplyCode()) == 0) {
-                        错误信息.add("出院带药给药方式不能包含费用。");
+                        errorMessage.add("出院带药给药方式不能包含费用。");
                     }
 
                     int day = 1;
                     if (item.getStartTime() == null) {
-                        错误信息.add("出院带药请输入开始时间。");
+                        errorMessage.add("出院带药请输入开始时间。");
                     }
                     if (item.getEndTime() == null) {
-                        错误信息.add("出院带药请输入结束时间。");
+                        errorMessage.add("出院带药请输入结束时间。");
                     } else {
                         long cha = item.getEndTime().getTime() - item.getStartTime().getTime();
                         long nd = 1000 * 24 * 60 * 60;
                         day = (int) (cha / nd);
                         if (day > 出院带药限制天数) {
-                            错误信息.add("出院带药天数不得超过 15 天,计算方式结束时间减去开始时间。");
+                            errorMessage.add("出院带药天数不得超过 15 天,计算方式结束时间减去开始时间。");
                         }
                     }
                     BigDecimal total = getTotal(item, day);
-                    if (StringUtil.notBlank(feiYongXinXi.getDrugWeightUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getDrugWeightUnit().trim())) {
-                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getDrugWeight(), 0, RoundingMode.UP));
+                    if (StringUtil.notBlank(detailsOfDrugs.getDrugWeightUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugWeightUnit().trim())) {
+                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(detailsOfDrugs.getDrugWeight(), 0, RoundingMode.UP));
                         item.setDrugOcc(item.getDrugQuan());
-                    } else if (StringUtil.notBlank(feiYongXinXi.getDrugVolUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getDrugVolUnit())) {
-                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getDrugVolume(), 0, RoundingMode.UP));
+                    } else if (StringUtil.notBlank(detailsOfDrugs.getDrugVolUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugVolUnit())) {
+                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(detailsOfDrugs.getDrugVolume(), 0, RoundingMode.UP));
                         item.setDrugOcc(item.getDrugQuan());
-                    } else if (StringUtil.notBlank(feiYongXinXi.getPackUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getPackUnit())) {
+                    } else if (StringUtil.notBlank(detailsOfDrugs.getPackUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getPackUnit())) {
                         if (new BigDecimal(item.getDose().intValue()).compareTo(item.getDose()) != 0) {
-                            错误信息.add("已经是最小单位了请不要带小数点");
+                            errorMessage.add("已经是最小单位了请不要带小数点");
                         }
-                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getPackSize(), 0, RoundingMode.UP));
+                        item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(detailsOfDrugs.getPackSize(), 0, RoundingMode.UP));
                         item.setDrugOcc(item.getDrugQuan());
                     }
                 } else {
                     // 计算普通药品的领量 durg_quan durg_occ
-                    calculateDrugAmount(item, feiYongXinXi, 错误信息);
+                    calculateDrugAmount(item, detailsOfDrugs, errorMessage);
                 }
 
             }
         }
 
         if (StringUtil.isBlank(item.getOrderCode())) {
-            错误信息.add("项目编码不能为空");
+            errorMessage.add("项目编码不能为空");
         }
         if (StringUtil.isBlank(item.getOrderName())) {
-            错误信息.add("项目名称不能为空");
+            errorMessage.add("项目名称不能为空");
         }
         if (StringUtil.isBlank(item.getExecUnit())) {
-            错误信息.add("执行科室不能为空");
+            errorMessage.add("执行科室不能为空");
         } else if (item.getExecUnit().startsWith("8")) {
-            错误信息.add("执行科室不能选择为病区");
+            errorMessage.add("执行科室不能选择为病区");
         }
 
         if (ZK_CODE.equals(item.getOrderCode())) {
             if (StringUtil.isBlank(item.getZkWardCode())) {
-                错误信息.add("转科病房不能为空");
+                errorMessage.add("转科病房不能为空");
             }
             if (StringUtil.isBlank(item.getZkDeptCode())) {
-                错误信息.add("转科科室不能为空");
+                errorMessage.add("转科科室不能为空");
             }
         }
 
         if (StringUtil.isBlank(item.getFrequCode())) {
-            错误信息.add("频次不能为空");
+            errorMessage.add("频次不能为空");
         }
 
         // 药品的校验
         if (!ITEM.equals(item.getSerial().trim())) {
             if (StringUtil.isBlank(item.getDrugSpecification())) {
-                错误信息.add("药品规格不能为空");
+                errorMessage.add("药品规格不能为空");
             }
             if (StringUtil.isBlank(item.getSupplyCode())) {
-                错误信息.add("给药方式不能为空");
+                errorMessage.add("给药方式不能为空");
             }
             if (item.getDose() == null || BigUtils.dengYu(item.getDose(), 0)) {
-                错误信息.add("一次计量不能为空");
+                errorMessage.add("一次计量不能为空");
             }
             if (StringUtil.isBlank(item.getDoseUnit())) {
-                错误信息.add("计量单位不能为空");
+                errorMessage.add("计量单位不能为空");
             }
             if (StringUtil.isBlank(item.getSerial())) {
-                错误信息.add("包装大小不能为空");
+                errorMessage.add("包装大小不能为空");
             }
         }
 
-        if (严格校验) {
+        if (strictVerification) {
             // 获取患者的入院时间
             if (item.getOrderTime() == null) {
-                错误信息.add("医嘱时间不能为空");
+                errorMessage.add("医嘱时间不能为空");
             } else if (item.getStartTime() == null) {
-                错误信息.add("开始时间不能为空");
+                errorMessage.add("开始时间不能为空");
             } else if (huanZheXinXi.getAdmissDate() == null) {
-                错误信息.add("没有查询到患者的入院时间");
+                errorMessage.add("没有查询到患者的入院时间");
             } else if (DateUtil.shiJianDaXiao(item.getStartTime(), huanZheXinXi.getAdmissDate(), "<")) {
-                错误信息.add("开始时间不能在患者入院之前,患者入院时间" + DateUtil.formatDatetime(huanZheXinXi.getAdmissDate()));
+                errorMessage.add("开始时间不能在患者入院之前,患者入院时间" + DateUtil.formatDatetime(huanZheXinXi.getAdmissDate()));
             } else if (DateUtil.shiJianDaXiao(item.getStartTime(), item.getOrderTime(), "<")) {
-                错误信息.add("开始时间不能在开医嘱之前");
+                errorMessage.add("开始时间不能在开医嘱之前");
             }
 
             if (item.getEndTime() != null) {
@@ -1091,18 +1093,18 @@ public class YiZhuLuRuServer {
                     item.setEndTime(null);
                 } else {
                     if (DateUtil.shiJianDaXiao(item.getEndTime(), item.getStartTime(), "<")) {
-                        错误信息.add("结束时间不能在开始时间之前");
+                        errorMessage.add("结束时间不能在开始时间之前");
                     }
                 }
             }
         }
 
         Map<String, Object> map = new HashMap<>(Capacity.TWO);
-        if (ListUtil.notBlank(错误信息)) {
-            map.put("error", 错误信息);
+        if (ListUtil.notBlank(errorMessage)) {
+            map.put("error", errorMessage);
         }
-        if (ListUtil.notBlank(警告信息)) {
-            map.put("warning", 警告信息);
+        if (ListUtil.notBlank(warningMessage)) {
+            map.put("warning", warningMessage);
         }
         return map;
     }