Procházet zdrojové kódy

增加黄码免费核酸24小时防重
诊疗与检查检验增加停用判断

hurugang před 2 roky
rodič
revize
6cefb640ec

+ 22 - 7
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzYjReqMapper.java

@@ -193,6 +193,7 @@ public interface MzYjReqMapper {
 
     /**
      * 查询检验检查的总数
+     *
      * @param mzYjReq
      * @return
      */
@@ -223,7 +224,7 @@ public interface MzYjReqMapper {
             "<when test='endTime!=null'>",
             "  and req_date <![CDATA[<=]]>#{endTime} ",
             "</when>",
-             "</script>"})
+            "</script>"})
     Integer selectCountMzYjReq(MzYjReq mzYjReq);
 
     /**
@@ -267,9 +268,9 @@ public interface MzYjReqMapper {
     List<MzYjReq> selectMzYjReqByPatientIdAndReqDateWithPage(MzYjReq mzYjReq);
 
 
-
     /**
      * 查询检验人名称列表的总数
+     *
      * @param mzYjReq
      * @return
      */
@@ -321,21 +322,22 @@ public interface MzYjReqMapper {
     List<MzYjReq> selectReqNameByPatientIdAndReqDateWithPage(MzYjReq mzYjReq);
 
 
-
     /**
      * 医技申请确认费用
-     * @param flag 1:医技已接收 =2:结果已返回
-     * @param opId 操作人ID
+     *
+     * @param flag        1:医技已接收 =2:结果已返回
+     * @param opId        操作人ID
      * @param confirmTime 确认时间
-     * @param reqNo 申请单号
+     * @param reqNo       申请单号
      * @return
      */
     @Update("update mz_yj_req set receive_flag=#{flag},confirm_flag=#{flag},confirm_id=#{opId},confirm_time=#{confirmTime},exec_dept=isnull(exec_dept,'2010000')" +
             "where  req_no = #{reqNo}")
-    int updateReceiveFlagAndConfirmFlag(@Param("flag") String flag, @Param("opId") String opId, @Param("confirmTime") Date confirmTime,@Param("reqNo") Integer reqNo);
+    int updateReceiveFlagAndConfirmFlag(@Param("flag") String flag, @Param("opId") String opId, @Param("confirmTime") Date confirmTime, @Param("reqNo") Integer reqNo);
 
     /**
      * 按照门诊ID和就诊次数查询医技申请日期
+     *
      * @param patientId
      * @param times
      * @return
@@ -345,6 +347,7 @@ public interface MzYjReqMapper {
 
     /**
      * 查询患者是否有医技申请
+     *
      * @param patientId
      * @return
      */
@@ -354,6 +357,7 @@ public interface MzYjReqMapper {
 
     /**
      * 按照门诊ID查询第一次医技申请日期
+     *
      * @param patientId
      * @return
      */
@@ -363,6 +367,7 @@ public interface MzYjReqMapper {
 
     /**
      * 按照门诊ID查询最后一次医技申请日期
+     *
      * @param patientId
      * @return
      */
@@ -371,9 +376,19 @@ public interface MzYjReqMapper {
 
     /**
      * 根据门诊id查询检查病人ID
+     *
      * @param patientId
      * @return
      */
     @Select("select jc_id from yj_jc_patient where mz_id =#{patientId}")
     String selectJcIdFromYjJcPatient(@Param("patientId") String patientId);
+
+    /**
+     * 根据医嘱编码查询24小时内是否有已经缴费的记录
+     * @param patientId
+     * @param orderCode
+     * @return
+     */
+    @Select("select * from  mz_yj_req where patient_id=#{patientId} and order_code =#{orderCode} and pay_mark = 0 and DateDiff(hh,req_date,getDate()) <=24 ")
+    int select24HourReqByCode(@Param("patientId") String patientId,@Param("orderCode") String orderCode);
 }

+ 13 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1962,6 +1962,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 mzYjReq.setReqComment("主诉:" + mzPrescriptionVo.getMzBlRecord().getEmrChiefComplaint() + " 现病史:" + mzPrescriptionVo.getMzBlRecord().getEmrHpi() + " 既往史:" + mzPrescriptionVo.getMzBlRecord().getEmrPs());
                 JcZdItem jcZdItem = jcZdItemMapper.selectJcZdItemByCode(mzYjReq.getOrderCode());
                 if (jcZdItem != null) {
+                    if (YesNoEnum.YES.code.equals(jcZdItem.getDelFlag())||YesNoEnum.YES.code.equals(jcZdItem.getMzFlag())){
+                        throw new MzException("保存处方失败,辅助检查【" + jcZdItem.getName() + "】已经停用,无法继续使用!");
+                    }
                     mzYjReq.setOrderName(jcZdItem.getName());
                     mzYjReq.setGroupName(jcZdItem.getName());
                     mzYjReq.setReqType(ReqTypeEnum.JIAN_CHA.code);
@@ -1975,6 +1978,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     if (jyZdItem == null) {
                         throw new MzException("没有找到医技编码【" + mzYjReq.getOrderCode() + "】对应的医技项目,请确认参数是否正确!");
                     }
+                    if (YesNoEnum.YES.code.equals(jyZdItem.getDelFlag())||YesNoEnum.YES.code.equals(jyZdItem.getMzFlag())){
+                        throw new MzException("保存处方失败,检验项目【" + jyZdItem.getName() + "】已经停用,无法继续使用!");
+                    }
                     mzYjReq.setOrderName(jyZdItem.getName());
                     mzYjReq.setGroupName(jyZdItem.getName());
                     mzYjReq.setReqType(ReqTypeEnum.JIAN_YAN.code);
@@ -2145,6 +2151,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     if (zdChargeItem == null) {
                         continue;
                     }
+                    if(YesNoEnum.YES.code.equals(zdChargeItem.getDelFlag())){
+                        throw new MzException("保存处方失败,诊疗项目【" + zdChargeItem.getName() + "】已经停用,无法继续使用!");
+                    }
                     mzChargeDetail.setChargeBillCode(Constants.BILL_ITEM_CODE_prev +zdChargeItem.getBillItemMz().substring(1));
                     mzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount());
                     mzChargeDetail.setOrigPrice(zdChargeItem.getChargeAmount());
@@ -2420,7 +2429,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     public Clinic nucleicOnlyYellowAcidApplication(String patientId, String opId) throws MzException {
-
+        int num=mzYjReqMapper.select24HourReqByCode(patientId,Constants.NUCLEIC_ORDER_ONLY_YELLOW_CODE);
+        if(num>0){
+            throw new MzException("您在24小时内已经采过样了,请不要重复申请!");
+        }
         return getNucleicAcidApplication(patientId, opId,Constants.NUCLEIC_ORDER_ONLY_YELLOW_CODE);
     }