Browse Source

中药处方权限

lihong 1 year ago
parent
commit
054c4647b8

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/Employee.java

@@ -33,4 +33,6 @@ public class Employee {
     private String wbCode;
     //医生的医保赋码
     private String ybCode;
+    //中药处方权 0:未授权,1:授权
+    private Integer doctorZy;
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/mz/EmployeeMapper.java

@@ -68,7 +68,7 @@ public interface EmployeeMapper {
      * @return
      */
     //select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code from a_employee_mi  where  code =#{code} and (del_flag is null or del_flag =0 )
-    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK) where  code =#{code} ")
+    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,doctor_zy from a_employee_mi WITH(NOLOCK) where  code =#{code} ")
     Employee selectByUserCode(@Param("code") String code);
 
 

+ 27 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1254,8 +1254,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             if (mzPrescriptionVo.getMzBlRecord().getEmrPs() == null || StringUtils.isBlank(mzPrescriptionVo.getMzBlRecord().getEmrPs())) {
                 throw new MzException("请完善既往史内容!");
             }
+            if (StrUtil.isBlank(mzPrescriptionVo.getMzBlRecord().getEmrJkjy()) || mzPrescriptionVo.getMzBlRecord().getEmrJkjy().length() < 10) {
+                throw new MzException("健康教育为必填且不能少于10个字符!");
+            }
         }
+
+
         setFullMzPrescriptionVo(mzPrescriptionVo, true, true);
+        verifyDoctorZy(mzPrescriptionVo.getMzChargeDetailList(), TokenUtil.getUser().getUserIdCode());
         MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(mzPrescriptionVo.getPatientId());
         if (mzPatientMi == null) {
             throw new MzException("当前病人信息不存在,请先保存病人信息!");
@@ -3369,6 +3375,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     @Override
     public Map<String, Object> getAmountForTempPrescription(MzPrescriptionVo mzPrescriptionVo) throws MzException {
         setFullMzPrescriptionVo(mzPrescriptionVo, false, true);
+        verifyDoctorZy(mzPrescriptionVo.getMzChargeDetailList(),TokenUtil.getUser().getUserIdCode());
         if (mzPrescriptionVo == null || (mzPrescriptionVo.getMzChargeDetailList() == null || mzPrescriptionVo.getMzYjReqList() == null)) {
             throw new MzException("处方内容为空,无需进行计算!");
         }
@@ -3427,6 +3434,26 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         resultMap.put("amountList", amountList);
         return resultMap;
     }
+    /**
+     * @description: 效验 中药处方权限
+     * @author: lihong
+     * @date: 2024/10/9 10:21
+     * @param: mzChargeDetailList
+     * @param: userIdCode
+     **/
+    private void verifyDoctorZy(List<MzChargeDetail> mzChargeDetailList, String userIdCode) throws MzException{
+        if(StrUtil.isBlank(userIdCode) || CollUtil.isEmpty(mzChargeDetailList)) return;
+        Employee employee = employeeService.queryByUserCode(userIdCode);
+        if(employee == null) return;
+        for(MzChargeDetail md : mzChargeDetailList){
+            if(Constants.KL_GROUP_NO.equals(md.getGroupNo()) && Convert.toInt(employee.getDoctorZy(),0) == 0){
+                throw new MzException("您没有开颗粒剂处方权限,如要开通该权限,请找医务部开通权限!");
+            }
+            if(Constants.CYF.equals(md.getBillItemCode()) && Convert.toInt(employee.getDoctorZy(),0) == 0){
+                throw new MzException("您没有开中草药["+md.getTcName()+"]处方权限,如要开通该权限,请找医务部开通权限!");
+            }
+        }
+    }
 
     @Override
     public MzPrescriptionVo getMzPrescriptionVo(String patientId, Integer times, Boolean MzBlRecordFlag, String payMark) throws MzException {