Browse Source

草药诊断问题

lihong 1 month ago
parent
commit
9364501e7e

+ 1 - 0
src/main/java/cn/hnthyy/thmz/enums/YpTypeNumberEnum.java

@@ -7,6 +7,7 @@ import java.util.List;
  * 药品类别code范围划分
  */
 public enum YpTypeNumberEnum {
+    // 1 西药 2 西成药 3草药 4医材
     ONE(1,"29999","00000"),
     TWO(2,"39999","30000"),
     THREE(3,"49999","40000"),

+ 6 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDictMapper.java

@@ -325,5 +325,10 @@ public interface YpZdDictMapper {
 
     @Update(" update yp_zd_dict set health_flag = #{healthFlag}, health_content = #{healthContent} where code = #{code} ")
     int saveDrugHealthFlag(@Param("code") String code, @Param("healthFlag") String healthFlag, @Param("healthContent") String healthContent);
-
+    @Select(" select count(*) " +
+            "from yp_zd_dict a " +
+            "         join yp_zd_drug_kind b on a.drug_kind = b.code " +
+            "    and b.yp_type = '3' " +
+            "    and a.code =#{code} ")
+    int selectCyCount(String code);
 }

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/yp/YpZdDictService.java

@@ -123,5 +123,13 @@ public interface YpZdDictService {
      * @return: java.lang.String
      **/
     String getHealthContent(List<String> ypCodeList);
+    /**
+     * @description: 是否草药
+     * @author: lihong
+     * @date: 2025/7/10 10:51
+     * @param: code
+     * @return: boolean
+     **/
+    boolean isCy(String code);
 
 }

+ 4 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1365,7 +1365,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (mzPrescriptionVo.getIcdText() != null && mzPrescriptionVo.getIcdText().length() > 2000) {
             throw new MzException("标准诊断长度超过最大值,请删除部分诊断,您可以在初步诊断继续填其他写诊断!");
         }
-        if (realIcdText == null && StringUtils.isBlank(mzPrescriptionVo.getTcmIcdText())) {
+        if (realIcdText == null && (StringUtils.isBlank(mzPrescriptionVo.getTcmIcdText()) || StringUtils.isBlank(mzPrescriptionVo.getTcmIcdText().replaceAll(",","")))) {
             throw new MzException("标准诊断或中医诊断不能为同时为空!");
         }
         //if (mzPrescriptionVo.getMzZyReq() !=null || CollUtil.isNotEmpty(mzPrescriptionVo.getMzYjReqList())) {
@@ -3847,10 +3847,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                  if(NumberEnum.ONE.getCode().equals(employee.getOrderYn()) && (mjSet.contains(md.getChargeItemCode()) || jeSet.contains(md.getChargeItemCode()))){
                     throw new MzException("您没有开毒麻药处方的权限,如要开通该权限,请找医务部开通权限!");
                 }
-                if(Constants.CYF.equals(md.getBillItemCode()) && Convert.toInt(employee.getDoctorZy(),0) == 0){
+                boolean cyFlag = ypZdDictService.isCy(md.getChargeItemCode());
+                if( cyFlag && Convert.toInt(employee.getDoctorZy(),0) == 0){
                     throw new MzException("您没有开中草药["+md.getTcName()+"]处方权限,如要开通该权限,请找医务部开通权限!");
                 }
-                if(Constants.CYF.equals(md.getBillItemCode()) && StrUtil.isBlank(mzPrescriptionVo.getTcmIcdCode())){
+                if(cyFlag && StrUtil.isBlank(mzPrescriptionVo.getTcmIcdCode())){
                     throw new MzException("您开具中草药["+md.getTcName()+"],中医诊断不能为空!");
                 }
             }

+ 6 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpZdDictServiceImpl.java

@@ -304,4 +304,10 @@ public class YpZdDictServiceImpl implements YpZdDictService {
         }
         return ypHealthEducation;
     }
+
+    @Override
+    public boolean isCy(String code) {
+        int count =  ypZdDictMapper.selectCyCount(code);
+        return count > 0;
+    }
 }