浏览代码

GCP就诊

lihong 9 月之前
父节点
当前提交
9b4e336ba9

+ 0 - 10
src/main/java/cn/hnthyy/thmz/Utils/Tools.java

@@ -735,16 +735,6 @@ public class Tools {
     }
 
     public static void main(String[] args) {
-        String num1 = "1";
-        Integer num2 = 0;
-        if(num1 == null){
-            System.out.println(0);
-        }else if(num2 == 0){
-            System.out.println(1);
-        }else {
-            System.out.println(2);
-        }
-
     }
 
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPatientMiMapper.java

@@ -309,4 +309,6 @@ public interface MzPatientMiMapper {
     String selectChronicDiseaseType(MzPatientMi mzPatientMi);
     @Select(" select name from crm_zd_visit_type where code in (${code}) ")
     List<String> selectCrmTypeName(String code);
+    @Select(" select count(1) from t_si_setlinfo where pat_no=#{patientId} and times=#{times} and revoked=0 ")
+    Integer countYbJs(@Param("patientId") String patientId,@Param("times") Integer times);
 }

+ 4 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzyReqrecMapper.java

@@ -462,4 +462,8 @@ public interface MzyReqrecMapper {
     List<String> selectFzDept(@Param("patientId") String patientId, @Param("visitTime") String visitTime,@Param("disTime") String disTime);
     @Select(" select max(isnull(visit_date,request_day))  from mzy_reqrec where charge_type !='11' and patient_id=#{patientId} and unit_code=#{visitDept} ")
     Date selectMaxRequestDateByPatientIdAndUnitCode(MzyReqrec reqrec);
+    @Select(" select charge_type from mzy_reqrec where patient_id = #{patientId} " +
+            "                          and request_day >= DATEADD(DD,-3,getdate())  " +
+            " order by request_day desc ")
+    List<String> selectChargeType(String patientId);
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/his/zd/DictDataService.java

@@ -12,4 +12,14 @@ public interface DictDataService {
    void updateDictVlaue(DictData dictData);
 
   String queryDictVlaue(String dictType,String dictName,String defaultValue);
+  /**
+   * @description: 不用缓存
+   * @author: lihong
+   * @date: 2024/11/26 10:42
+   * @param: dictType
+   * @param: dictName
+   * @param: defaultValue
+   * @return: java.lang.String
+   **/
+  String queryDictValueNotCach(String dictType, String dictName, String defaultValue);
 }

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

@@ -1489,6 +1489,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if(mzOrderLock != null && Convert.toInt(mzOrderLock.getLockFlag(),0) == 1){
             throw new MzException("处方在缴费中,不能删除处方");
         }
+       Integer count = mzPatientMiMapper.countYbJs(clinic.getPatientId(), clinic.getTimes());
+        if(count != null && count > 0){
+            throw new MzException("处方已经结算,不能删除处方,如要删除请找医保科取消医保结算再删除");
+        }
         int num = clinicMapper.deleteById(clnicId);
         mzVisitTableMapper.deleteByPatientIdAndTimes(clinic.getPatientId(), clinic.getTimes());
         mzBaRecordMapper.deleteByPatientIdAndTimes(clinic.getPatientId(), clinic.getTimes());

+ 25 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/DictDataServiceImpl.java

@@ -51,4 +51,29 @@ public class DictDataServiceImpl implements DictDataService {
         }
         return defaultValue;
     }
+
+    /**
+     * @param dictType
+     * @param dictName
+     * @param defaultValue
+     * @description: 不用缓存
+     * @author: lihong
+     * @date: 2024/11/26 10:42
+     * @param: dictType
+     * @param: dictName
+     * @param: defaultValue
+     * @return: java.lang.String
+     */
+    @Override
+    public String queryDictValueNotCach(String dictType, String dictName, String defaultValue) {
+        DictData dictData = new DictData();
+        dictData.setDictType(dictType);
+        dictData.setDictName(dictName);
+        List<DictData> list = mapper.selectDictData(dictData);
+        if(CollUtil.isNotEmpty(list)){
+            return list.get(0).getDictValue();
+        }else {
+            return defaultValue;
+        }
+    }
 }

+ 14 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/zy/ZyActpatientServiceImpl.java

@@ -15,6 +15,7 @@ import cn.hnthyy.thmz.enums.SettleTypeEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.enums.ZyReqEnum;
 import cn.hnthyy.thmz.mapper.his.mz.MzZyReqMapper;
+import cn.hnthyy.thmz.mapper.his.mz.MzyReqrecMapper;
 import cn.hnthyy.thmz.mapper.his.zy.PatientMiSfzMapper;
 import cn.hnthyy.thmz.mapper.his.yz.YzActOrderMapper;
 import cn.hnthyy.thmz.mapper.his.zy.*;
@@ -86,6 +87,8 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
     private MzPatientMiService mzPatientMiService;
     @Resource
     DictDataService dictDataService;
+    @Resource
+    MzyReqrecMapper mzyReqrecMapper;
 
 
     @Override
@@ -609,7 +612,7 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
 
     /**
      * @param patientId
-     * @description: 判断是否在院
+     * @description: 判断是否在院 单病种 挂号/住院 GCP  可以开处方
      * @author: lihong
      * @date: 2023/12/19 17:15
      * @param: patientId
@@ -618,8 +621,17 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
     @Override
     public boolean checkZaiYuan(String patientId) {
         if(StrUtil.isBlank(patientId)) return false;
+        List<String> chargeTypeList = mzyReqrecMapper.selectChargeType(patientId);
+        String ghChTypeStr = dictDataService.queryDictVlaue("3.0", "gh_ch_type", "45");
+        List<String> ghChTypes = CollUtil.newArrayList(ghChTypeStr.split(","));
+        if(CollUtil.isNotEmpty(chargeTypeList)){
+            //交集不为空
+            if(CollUtil.isNotEmpty(CollUtil.intersection(chargeTypeList,ghChTypes))){
+                return false;
+            }
+        }
         List<String> inPatientNoList = aPatientMiMapper.selectInPatientNoByMzNo(patientId);
-        String dictVlaue = dictDataService.queryDictVlaue("2.4", "responce_type", "ae,11");
+        String dictVlaue = dictDataService.queryDictVlaue("2.4", "responce_type", "ae,a0");
         List<String> dictVlaues = CollUtil.newArrayList(dictVlaue.split(","));
         if (CollUtil.isNotEmpty(inPatientNoList)) {
             for (String inPatientNo : inPatientNoList) {