Bladeren bron

医嘱检验检查的限制

xiaochan 1 maand geleden
bovenliggende
commit
48460557b0

+ 19 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -12,6 +12,7 @@ import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.dictionary.CyComboGrid;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.*;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.JyJcCheckItemDto;
+import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.RepelJyJc;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.JcJyPartOrSample;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.ViewInspectionItemDetailsVo;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.PatientTemp;
@@ -318,7 +319,7 @@ public interface JianYanJianChaDao {
             "<foreach collection='list' item='item' separator=','>" +
             "(#{item.reqNo}, #{inpatientNo}, #{name}, #{age}, #{admissTimes}, #{bedNo}, #{item.orderName}, " +
             "        #{item.actOrderNo}, #{item.orderCode}, cast(#{item.orderName} as varchar(60)) , #{item.reqNo}, #{item.reqComment}, #{userCode}, " +
-            "        #{deptCode}, #{wardCode}, #{item.execDept}, #{reqDate}, '1', #{reqType}, #{reqDate}, #{reqDate},#{item.diagCode},#{item.diagText}, " +
+            "        #{deptCode}, #{wardCode}, #{item.execDept}, #{reqDate}, '1', #{reqType}, getdate(), #{reqDate},#{item.diagCode},#{item.diagText}, " +
             "        (select class from ${orderTypeTable} where zy_order_code = #{item.orderCode})," +
             "       #{item.jzFlag},#{item.reqTzComment},#{item.reqOtherResult}," +
             "       #{item.inspectStuff}, #{item.inspectPart},#{item.quantity},#{item.chargeFee})" +
@@ -618,4 +619,21 @@ public interface JianYanJianChaDao {
             "  and parent_code is not null\n" +
             "group by parent_code")
     List<String> selectBuWeiParentCode();
+
+
+    @Select("select *\n" +
+            "from (select id, order_code, repel_code,repel_hour\n" +
+            "from repel_jy_jc\n" +
+            "where order_code = '${code}'\n" +
+            "union\n" +
+            "select id, repel_code, order_code,repel_hour\n" +
+            "from repel_jy_jc\n" +
+            "where repel_code = '${code}') tmp order by repel_hour desc")
+    List<RepelJyJc> selectRepelJyJc(String code);
+
+    @Select("select order_code, order_name, sys_date " +
+            "from ysh_yj_req " +
+            "where ${ew.sqlSegment}")
+    List<YshYjReq> selectJcJyRepel(@Param("ew") QueryWrapper<?> ew);
+
 }

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

@@ -986,7 +986,8 @@ public interface YiZhuLuRuDao {
             "                       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +
             "                       cast(isnull(NULLIF(kss_flag, ''), 0) as int)        as kss_flag, " +
             "    deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}')," +
-            "    supplyCode = ( select isnull(del_flag, 0) from yz_supply_type where supply_code = '${supplyCode}') " +
+            "    supplyCode = ( select isnull(del_flag, 0) from yz_supply_type where supply_code = '${supplyCode}')," +
+            "restriction_frequency,restriction_frequency_name = (select rtrim(yz_supply_type.supply_name) from yz_supply_type where supply_code = restriction_frequency),restriction_quantity " +
             "from yp_zd_dict a " +
             "         with (NOLOCK) " +
             "         left join yp_base_yf b on (code = b.charge_code and a.serial = b.serial) " +
@@ -1768,5 +1769,22 @@ public interface YiZhuLuRuDao {
 
 
     @Update("update t_case_frontsheet_main set zy_dismiss_way = #{type} where bah = #{patNo} and admiss_times = #{times} and file_status <> '1' ")
-    int updateZyDisWay(String patNo,Integer times, String type);
+    int updateZyDisWay(String patNo, Integer times, String type);
+
+    @Select("select repel_order from repel_order where order_code = '${code}' " +
+            "union " +
+            "select order_code from repel_order where repel_order = '${code}'")
+    Set<String> getRepelOrder(String code);
+
+/**
+ * 根据住院号和入院次数查询执行医嘱信息
+ *
+ * @param patNo 住院号,用于筛选特定患者的医嘱信息
+ * @param times 入院次数,用于筛选特定入院次数的医嘱信息
+ * @return 返回符合条件的医嘱信息列表,包含医嘱单号、医嘱代码和医嘱名称
+ */
+    @Select("select act_order_no,order_code,order_name from yz_act_order where inpatient_no = '${patNo}' " +
+            "and admiss_times = ${times} " +  // 使用入院次数进行精确匹配
+            "and status_flag in ('1','2','3','4')")  // 只查询状态为1、2、3、4的医嘱
+    List<YzActOrder> getExecuteYz(String patNo,Integer times);
 }

+ 70 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/jianyanjiancha/dto/RepelJyJc.java

@@ -0,0 +1,70 @@
+package thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto;
+
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.NoArgsConstructor;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "repel_jy_jc")
+public class RepelJyJc implements Serializable {
+
+    private static final long serialVersionUID = 6610478451535555653L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.INPUT)
+    private String id;
+
+    /**
+     * orderCode
+     */
+    @TableField(value = "order_code")
+    private String orderCode;
+
+    @TableField(exist = false)
+    private String orderName;
+
+    /**
+     * 排斥线吗
+     */
+    @TableField(value = "repel_code")
+    private String repelCode;
+
+    @TableField(exist = false)
+    private String repelName;
+
+    /**
+     * 多少个小时后可以开
+     */
+    @TableField(value = "repel_hour")
+    private Integer repelHour;
+
+    /**
+     * 2-检验 3-检查
+     */
+    @TableField(value = "type")
+    private Integer type;
+
+    public static LambdaQueryWrapper<RepelJyJc> lambdaQueryWrapper() {
+        return new LambdaQueryWrapper<>();
+    }
+
+    public static QueryWrapper<RepelJyJc> queryWrapper() {
+        return new QueryWrapper<>();
+    }
+
+
+}

+ 11 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/XinZhenYzActOrder.java

@@ -402,6 +402,17 @@ public class XinZhenYzActOrder {
     private String superiorDoctor;
     private String billItemZy;
 
+    /**
+     * 限制给药方式
+     */
+    private String restrictionFrequency;
+    private String restrictionFrequencyName;
+
+    /**
+     * 限制领量
+     */
+    private BigDecimal restrictionQuantity;
+
     public String getStatusFlagName() {
         if (statusFlag == null) return "";
         if (statusFlag.equals("1")) {

+ 52 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/dto/RepelOrder.java

@@ -0,0 +1,52 @@
+package thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.dto;
+
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.NoArgsConstructor;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "repel_order")
+public class RepelOrder implements Serializable {
+
+    private static final long serialVersionUID = 3059925655398127132L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.INPUT)
+    private String id;
+
+    /**
+     * 医嘱编码
+     */
+    @TableField(value = "order_code")
+    private String orderCode;
+
+    /**
+     * 排斥哪些医嘱
+     */
+    @TableField(value = "repel_order")
+    private String repelOrder;
+
+    public static LambdaQueryWrapper<RepelOrder> lambdaQueryWrapper() {
+        return new LambdaQueryWrapper<>();
+    }
+
+    public static QueryWrapper<RepelOrder> queryWrapper() {
+        return new QueryWrapper<>();
+    }
+
+
+}

+ 1 - 1
src/main/java/thyyxxk/webserver/service/inpatient/xmlr/XiangMuLuRuService.java

@@ -1078,7 +1078,7 @@ public class XiangMuLuRuService {
         if (rst.getCode().equals(200)) {
             ZyDetailCharge chargeData = dao.queryXiangMuByCode(rst.getData().getString("charge_code"));
             if (chargeData == null) {
-                return R.fail(ExceptionEnum.NULL_POINTER, "未找到对应的项目。");
+                return R.fail(ExceptionEnum.NULL_POINTER, "项目编码对照错误,请联系设备科。");
             }
             data.put("spdData", rst.getData());
             data.put("chargeData", chargeData);

+ 66 - 7
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/JianYanJianChaShenQingService.java

@@ -1,16 +1,18 @@
 package thyyxxk.webserver.service.zhuyuanyisheng;
 
+import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.core.util.SerializeUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.errorprone.annotations.Var;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.checkerframework.checker.units.qual.C;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.BizException;
@@ -20,13 +22,12 @@ import thyyxxk.webserver.constants.Message;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.CheckTheCallbackDao;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.JianYanJianChaDao;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
-import thyyxxk.webserver.entity.CodeName;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
-import thyyxxk.webserver.entity.dictionary.CyComboGrid;
 import thyyxxk.webserver.entity.login.UserInfo;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.*;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.JyJcCheckItemDto;
+import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.RepelJyJc;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.PrintYshReqVo;
 import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.ViewInspectionItemDetailsVo;
 import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
@@ -38,7 +39,7 @@ import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.service.hutoolcache.UserCache;
 import thyyxxk.webserver.utils.*;
 
-import java.io.Serializable;
+import java.lang.reflect.Array;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.util.*;
@@ -140,7 +141,7 @@ public class JianYanJianChaShenQingService {
                     zhuYiShiXiang.append(((String) value).trim()).append("\n");
                 }
             } catch (Exception e) {
-                e.printStackTrace();
+                log.error("错误:", e);
             }
         }
         map.put("mattersNeedingAttention", zhuYiShiXiang.toString());
@@ -610,7 +611,7 @@ public class JianYanJianChaShenQingService {
                     cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, "医嘱已停用:【" + value.getName() + "】"));
                 }
             });
-
+            jyjcRepel(huanZheXinXi, param.getList(), finalI, cuoWuXinXi, jcCodes, jyCodes, JC_TYPE.equals(param.getReqType()));
         }
 
         if (StringUtil.notBlank(cuoWuXinXi.toString())) {
@@ -627,6 +628,64 @@ public class JianYanJianChaShenQingService {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "操作成功", reqNos);
     }
 
+    private void jyjcRepel(XinZhenYiZhu huanZheXinXi,
+                           List<YshYjReq> items,
+                           int finalI,
+                           StringBuilder cuoWuXinXi,
+                           Set<String> jcCodes,
+                           Set<String> jyCodes,
+                           boolean isCheck) {
+
+        YshYjReq item = items.get(finalI - 1);
+        List<RepelJyJc> repelJyJcs = dao.selectRepelJyJc(item.getOrderCode());
+
+        if (!repelJyJcs.isEmpty()) {
+            RepelJyJc repelJyJc = repelJyJcs.get(0);
+            String dateTime = DateUtil.formatDate(DateUtil
+                    .date()
+                    .offset(DateField.HOUR, -repelJyJc.getRepelHour()), DateUtil.DEFAULT_PATTERN);
+
+            for (RepelJyJc jyJcRepel : repelJyJcs) {
+                Set<String> tmp;
+                if (isCheck) {
+                    tmp = jcCodes;
+                } else {
+                    tmp = jyCodes;
+                }
+                if (tmp.contains(jyJcRepel.getRepelCode())) {
+                    cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, "两种项目不能同时开具,项目名字:" + getName(items, jyJcRepel.getRepelCode())));
+
+                }
+            }
+
+            QueryWrapper<?> qw = new QueryWrapper<>()
+                    .eq("inpatient_no", huanZheXinXi.getInpatientNo())
+                    .eq("admiss_times", huanZheXinXi.getAdmissTimes())
+                    .in("order_code", repelJyJcs.stream().map(RepelJyJc::getRepelCode).collect(Collectors.toSet()))
+                    .ge("sys_date", dateTime);
+            List<YshYjReq> repelNames = dao.selectJcJyRepel(qw);
+            if (!repelNames.isEmpty()) {
+                for (YshYjReq tmp : repelNames) {
+                    RepelJyJc tmpRepel = repelJyJcs.stream()
+                            .filter(i -> i.getRepelCode().equals(tmp.getOrderCode()))
+                            .findFirst().orElse(new RepelJyJc());
+                    String format = StrUtil.format("当前项目和:【{}】,需要间隔:【{}】小时才能重新开具", tmp.getOrderName(),
+                            tmpRepel.getRepelHour());
+                    cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, format));
+                }
+            }
+        }
+    }
+
+    private String getName(List<YshYjReq> data, String code) {
+        return data.stream()
+                .filter(item -> item.getOrderCode().equals(code))
+                .findFirst()
+                .map(YshYjReq::getOrderName)
+                .orElse("");
+    }
+
+
     private Map<String, JyJcCheckItemDto> getItemInfo(Set<String> itemCodes, Boolean isCheck) {
         Map<String, JyJcCheckItemDto> collect = new HashMap<>();
         if (!itemCodes.isEmpty()) {

+ 8 - 6
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -1648,13 +1648,15 @@ public class YiZhuLuRuServer {
         return rst;
     }
 
-/**
- * 更新患者就诊方式的方法
- * @param patNo 患者编号,用于唯一标识一位患者
- * @param type 就诊类型,表示患者的就诊方式或类型
- */
-    public void updateZyDisWay(String patNo, String type) {
 
+    /**
+     * 自费同意书
+     *
+     * @return
+     */
+    public ResultVo<String> selfFundedConsentForm(String patNo, Integer times) {
+        return R.ok();
     }
 
+
 }

+ 51 - 8
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/yizhuverify/YiZhuCheckData.java

@@ -8,6 +8,7 @@ import org.jetbrains.annotations.NotNull;
 import thyyxxk.webserver.config.envionment.YzConfig;
 import thyyxxk.webserver.constants.Capacity;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.login.UserInfo;
 import thyyxxk.webserver.entity.medicine.YpZdGroupName;
 import thyyxxk.webserver.entity.yzcheck.ChargeLimitations;
@@ -20,6 +21,7 @@ import thyyxxk.webserver.utils.*;
 import java.util.*;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @Slf4j
 public class YiZhuCheckData {
@@ -57,6 +59,8 @@ public class YiZhuCheckData {
      */
     private final CacheOnce<ChargeLimitations> yiBaoLimitation = new CacheOnce<>();
 
+    private final CacheOnce<Set<String>> repelOrder = new CacheOnce<>();
+
     /**
      * 患者信息
      */
@@ -76,6 +80,7 @@ public class YiZhuCheckData {
     private Boolean passTheAudit = true;
     private final List<String> groupList = extraCache.getYf().get("xy").stream().map(YpZdGroupName::getGroupNo).collect(Collectors.toList());
     private boolean checkForRestrictedMedication = false;
+    private List<YzActOrder> executeYz = new ArrayList<>();
 
     /**
      * 全排斥医嘱
@@ -92,7 +97,10 @@ public class YiZhuCheckData {
         userInfo = dao.selectedUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
         this.list = list;
         this.patientInformation = patientInformation;
-        strictVerification = patientInformation != null;
+        if (patientInformation != null) {
+            strictVerification = true;
+            this.executeYz = dao.getExecuteYz(patientInformation.getInpatientNo(), patientInformation.getAdmissTimes());
+        }
         return this;
     }
 
@@ -155,10 +163,11 @@ public class YiZhuCheckData {
 
     private void itemCheck(XinZhenYzActOrder item) {
         List<XinZhenYzActOrder> projectDetails = project.get(item.getOrderCode(), dao::itemDataOne);
-        XinZhenYzActOrder yzItemInio = yzItem.get(item.getOrderCode(), dao::yzItem);
 
-        if (yzItemInio != null) {
-            if (yzItemInio.getDelFlag() == 1) {
+        XinZhenYzActOrder yzItemInfo = yzItem.get(item.getOrderCode(), dao::yzItem);
+
+        if (yzItemInfo != null) {
+            if (yzItemInfo.getDelFlag() == 1) {
                 errorMessage.add("该医嘱已被停用,请联系物价。");
             }
         }
@@ -179,13 +188,17 @@ public class YiZhuCheckData {
         }
 
 
-        if (strictVerification && specialMedicalAdvice.containsKey(item.getOrderCode())) {
-            YzZdOrderItemConfirm confirm = specialMedicalAdvice.get(item.getOrderCode());
-            if (confirm.getCount() > 0 && dao.selectCountByOrderCode(patientInformation.getInpatientNo(), patientInformation.getAdmissTimes(), item.getOrderCode()) > confirm.getCount()) {
-                errorMessage.add("该医嘱只能开一条,请先作废上一条医嘱");
+        if (strictVerification) {
+            if (specialMedicalAdvice.containsKey(item.getOrderCode())) {
+                YzZdOrderItemConfirm confirm = specialMedicalAdvice.get(item.getOrderCode());
+                if (confirm.getCount() > 0 && dao.selectCountByOrderCode(patientInformation.getInpatientNo(), patientInformation.getAdmissTimes(), item.getOrderCode()) > confirm.getCount()) {
+                    errorMessage.add("该医嘱只能开一条,请先作废上一条医嘱");
+                }
             }
+            exclusionVerification(item.getOrderCode());
         }
 
+
         if (ZK_CODE_LIST.contains(item.getOrderCode())) {
             if (StringUtil.isBlank(item.getZkWardCode())) {
                 errorMessage.add("转科病房不能为空");
@@ -323,6 +336,7 @@ public class YiZhuCheckData {
                     }
                 }
             }
+
 //            校验医保限制用药(item);
         }
         String 出院带药 = "007";
@@ -337,6 +351,14 @@ public class YiZhuCheckData {
             if (item.getDrugOcc() == null) {
                 errorMessage.add("医嘱领量错误,请重新选择【剂量单位】,或这可能药房剂量维护错误。");
             }
+            if (strictVerification) {
+                if (StrUtil.isNotBlank(detailsOfDrugs.getRestrictionFrequency()) && !item.getSupplyCode().equals(detailsOfDrugs.getRestrictionFrequency())) {
+                    errorMessage.add("当前给药方式只能是:" + detailsOfDrugs.getRestrictionFrequencyName());
+                }
+                if (detailsOfDrugs.getRestrictionQuantity() != null && BigUtils.bigDaYu(item.getDrugQuan(), detailsOfDrugs.getRestrictionQuantity())) {
+                    errorMessage.add("当前药品限制领量:" + detailsOfDrugs.getRestrictionQuantity());
+                }
+            }
         }
     }
 
@@ -484,4 +506,25 @@ public class YiZhuCheckData {
         return this;
     }
 
+    /**
+     * 与其他的医嘱排斥
+     *
+     * @param orderCode 项目编码
+     */
+    public void exclusionVerification(String orderCode) {
+        Set<String> repelOrderList = repelOrder.get(orderCode, dao::getRepelOrder);
+        if (repelOrderList == null) return;
+        StringBuilder sb = new StringBuilder();
+        List<YzActOrder> collect = executeYz.stream()
+                .filter(tmp -> repelOrderList.contains(tmp.getOrderCode()))
+                .collect(Collectors.toList());
+        collect.forEach(item -> {
+            sb.append("医嘱号:").append(item.getActOrderNoStr()).append("名字:").append(item.getOrderName()).append("\n");
+        });
+
+        if (!collect.isEmpty()) {
+            errorMessage.add("该医嘱与这些医嘱排斥,把医嘱状态设置为停止就可以开了。:" + sb);
+        }
+    }
+
 }

+ 3 - 1
src/main/java/thyyxxk/webserver/utils/ListUtil.java

@@ -9,8 +9,11 @@ import org.apache.ibatis.session.SqlSessionFactory;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 import java.util.function.BiConsumer;
 import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -65,5 +68,4 @@ public class ListUtil {
         tmp.add(data);
         return tmp;
     }
-
 }

+ 99 - 0
update/2025-10-20.md

@@ -0,0 +1,99 @@
+# 新增限制的字段
+
+```sql
+alter table yp_zd_dict
+    add restriction_frequency varchar(8)
+go
+alter table yp_zd_dict
+    add restriction_quantity decimal(10, 2)
+go
+
+exec sp_addextendedproperty 'MS_Description', N'限制给药方式', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_dict', 'COLUMN',
+     'restriction_frequency'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'限制一次用药数量', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_dict', 'COLUMN',
+     'restriction_quantity'
+go
+
+
+```
+
+# 新增医嘱相互排斥表
+
+```sql
+-- auto-generated definition
+create table repel_order
+(
+    id          varchar(18) not null
+        constraint repel_order_pk
+            primary key,
+    order_code  varchar(12) not null,
+    repel_order varchar(12) not null
+)
+go
+
+exec sp_addextendedproperty 'MS_Description', N'医嘱相互排斥', 'SCHEMA', 'dbo', 'TABLE', 'repel_order'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'主键', 'SCHEMA', 'dbo', 'TABLE', 'repel_order', 'COLUMN', 'id'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'医嘱编码', 'SCHEMA', 'dbo', 'TABLE', 'repel_order', 'COLUMN',
+     'order_code'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'排斥哪些医嘱', 'SCHEMA', 'dbo', 'TABLE', 'repel_order', 'COLUMN',
+     'repel_order'
+go
+
+create index repel_order_order_code_index
+    on repel_order (order_code)
+go
+
+create index repel_order_repel_order_index
+    on repel_order (repel_order)
+go
+
+
+```
+
+# 检验检查排斥
+
+```sql
+-- auto-generated definition
+create table repel_jy_jc
+(
+    id         varchar(18) not null
+        constraint repel_jy_jc_pk
+            primary key,
+    order_code varchar(20) not null,
+    repel_code varchar(18) not null,
+    repel_hour int         not null
+)
+go
+
+exec sp_addextendedproperty 'MS_Description', N'检验检查配置', 'SCHEMA', 'dbo', 'TABLE', 'repel_jy_jc'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'主键', 'SCHEMA', 'dbo', 'TABLE', 'repel_jy_jc', 'COLUMN', 'id'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'排斥线吗', 'SCHEMA', 'dbo', 'TABLE', 'repel_jy_jc', 'COLUMN',
+     'repel_code'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'多少个小时后可以开', 'SCHEMA', 'dbo', 'TABLE', 'repel_jy_jc', 'COLUMN',
+     'repel_hour'
+go
+
+create index repel_jy_jc_order_code_index
+    on repel_jy_jc (order_code)
+go
+
+create index repel_jy_jc_repel_code_index
+    on repel_jy_jc (repel_code)
+go
+
+
+```