Sfoglia il codice sorgente

住院申请单状态控制

hurugang 2 anni fa
parent
commit
92fce1d4fe

+ 3 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/ZyReqController.java

@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.entity.his.mz.Employee;
 import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
 import cn.hnthyy.thmz.entity.his.mz.MzZyReq;
 import cn.hnthyy.thmz.enums.GenderEnum;
+import cn.hnthyy.thmz.enums.ZyReqEnum;
 import cn.hnthyy.thmz.service.his.RegionService;
 import cn.hnthyy.thmz.service.his.ResponceTypeService;
 import cn.hnthyy.thmz.service.his.mz.EmployeeService;
@@ -52,7 +53,7 @@ public class ZyReqController {
                 resultMap.put("message", "查询病人的住院证失败,病人id为空");
                 return resultMap;
             }
-            List<MzZyReq> list = mzZyReqService.queryMzZyReqByPatientId(patientId);
+            List<MzZyReq> list = mzZyReqService.queryMzZyReqByPatientId(patientId,ZyReqEnum.CONFIRMED.code);
             if (list == null || list.size() == 0) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "查询病人的住院证失败,当前病人没有对应的住院证");
@@ -87,7 +88,7 @@ public class ZyReqController {
                 resultMap.put("message", "打印入院通知单失败,病人id为空");
                 return resultMap;
             }
-            List<MzZyReq> list = mzZyReqService.queryMzZyReqByPatientId(patientId);
+            List<MzZyReq> list = mzZyReqService.queryMzZyReqByPatientId(patientId,null);
             if (list == null || list.size() == 0) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "打印入院通知单失败,当前病人没有对应的住院证");

+ 7 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzZyReqMapper.java

@@ -21,10 +21,15 @@ public interface MzZyReqMapper {
     /**
      * 查询病人的入院证(有效)
      * @param patientId
+     * @param reqStatus
      * @return
      */
-    @Select("select * from mz_zy_req WITH(NOLOCK) where patient_id=#{patientId} and req_status = 1 order by visit_date desc ")
-    List<MzZyReq> selectMzZyReqByPatientId(@Param("patientId") String patientId);
+    @Select({"<script>" ,"select * from mz_zy_req WITH(NOLOCK) where patient_id=#{patientId} " ,
+            "<when test='reqStatus!=null'>",
+            " and req_status = #{reqStatus}  ",
+            "</when>",
+            " order by visit_date desc ","</script>"})
+    List<MzZyReq> selectMzZyReqByPatientId(@Param("patientId") String patientId,@Param("reqStatus") String reqStatus);
 
     /**
      * 设置门诊祝愿证为已经入院

+ 1 - 2
src/main/java/cn/hnthyy/thmz/service/his/mz/MzZyReqService.java

@@ -1,6 +1,5 @@
 package cn.hnthyy.thmz.service.his.mz;
 
-import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.mz.MzZyReq;
 
 import java.util.List;
@@ -12,7 +11,7 @@ public interface MzZyReqService {
      * @param patientId
      * @return
      */
-    List<MzZyReq> queryMzZyReqByPatientId(String patientId);
+    List<MzZyReq> queryMzZyReqByPatientId(String patientId,String reqStatus);
 
 
     /**

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

@@ -2986,7 +2986,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             return mzPrescriptionVo;
         }
         if (mzBlRecord.getEmrProcess() != null && mzBlRecord.getEmrProcess().indexOf("收住院") >= 0) {
-            List<MzZyReq> mzZyReqs = mzZyReqMapper.selectMzZyReqByPatientId(patientId);
+            List<MzZyReq> mzZyReqs = mzZyReqMapper.selectMzZyReqByPatientId(patientId,null);
             if (mzZyReqs != null && mzZyReqs.size() > 0) {
                 MzZyReq mzZyReq = mzZyReqs.get(0);
                 if (mzZyReq.getDeptCode() != null && StringUtils.isNotBlank(mzZyReq.getDeptCode())) {

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzZyReqServiceImpl.java

@@ -32,8 +32,8 @@ public class MzZyReqServiceImpl implements MzZyReqService {
 //    @Autowired
 //    private MzYshConfigService mzYshConfigService;
     @Override
-    public List<MzZyReq> queryMzZyReqByPatientId(String patientId) {
-        return mzZyReqMapper.selectMzZyReqByPatientId(patientId);
+    public List<MzZyReq> queryMzZyReqByPatientId(String patientId,String reqStatus) {
+        return mzZyReqMapper.selectMzZyReqByPatientId(patientId,reqStatus);
     }
 
     @Override