浏览代码

1优化简易门诊接诊后,将接诊医生科室信息设置到简易门诊
2如果患者是从已诊列表发起接诊,或者是接诊了其他医生已经接诊过的简易门诊,需要将最新接诊医生的科室设置到当前这次接诊记录,而不是继续使用上一次的科室

hurugang 2 年之前
父节点
当前提交
5af44aff0a

+ 11 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1617,6 +1617,10 @@ public class MzChargeDetailController {
                     mzPrescriptionVo.setVisitDeptCode(mzfzPatientOrder.getDeptCode());
                 }
             }
+            if(!deptCodes.contains(mzPrescriptionVo.getVisitDeptCode())){
+                //如果设置的医生接诊科室不在医生的科室列表中,说明是取的该患者上一次就诊医生所属科室,将当前医生的第一个科室替换成实际接诊科室
+                mzPrescriptionVo.setVisitDeptCode(deptCodes.get(0));
+            }
             mzPrescriptionVo.setDoctorCode(tokenUser.getUserIdCode());
             mzPrescriptionVo.setJzFlag(YesNoEnum.NO.code);
             Clinic insertClinic = mzChargeDetailService.savePrescription(mzPrescriptionVo, clinic);
@@ -2377,6 +2381,13 @@ public class MzChargeDetailController {
             if (deptNo == null || StringUtils.isBlank(deptNo)) {
                 deptNo=clinicService.queryLastByPatientIdAndDoctor(patientId, tokenUser.getUserIdCode());
             }
+            if(deptNo == null || StringUtils.isBlank(deptNo)){
+                //没有任何科室信息就将当前医生的第一个科室返回
+                List<String> deptNos=userDeptRelationService.queryAllByUserIdCode(tokenUser.getUserIdCode());
+                if(deptNos!=null && deptNos.size()>0){
+                    deptNo=deptNos.get(0);
+                }
+            }
             if (deptNo == null || StringUtils.isBlank(deptNo)) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "获取病人某次就诊科室编码失败,未查询到任何就诊科室信息");

+ 11 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ClinicServiceImpl.java

@@ -15,6 +15,7 @@ import cn.hnthyy.thmz.mapper.his.mz.MzfzPatientOrderMapper;
 import cn.hnthyy.thmz.mapper.his.mz.MzyReqrecMapper;
 import cn.hnthyy.thmz.mapper.thmz.ClinicMapper;
 import cn.hnthyy.thmz.mapper.thmz.TurnToConsultationMapper;
+import cn.hnthyy.thmz.mapper.thmz.UserDeptRelationMapper;
 import cn.hnthyy.thmz.service.his.mz.EmployeeService;
 import cn.hnthyy.thmz.service.his.mz.MzVisitTableService;
 import cn.hnthyy.thmz.service.thmz.ClinicService;
@@ -45,6 +46,9 @@ public class ClinicServiceImpl implements ClinicService {
     @SuppressWarnings("all")
     @Autowired
     private TurnToConsultationMapper turnToConsultationMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private UserDeptRelationMapper userDeptRelationMapper;
     @Override
     public int saveClinic(Clinic clinic) {
         //存在就不插入
@@ -139,6 +143,13 @@ public class ClinicServiceImpl implements ClinicService {
         updateMzfzPatientOrder.setSerialNo(Integer.valueOf(serialNo));
         updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.IN_CLINIC.code);
         updateMzfzPatientOrder.setDoctorCode(tokenUser.getUserIdCode());
+        if(Constants.JY_EXEC_CODE.equals(mzfzPatientOrder.getDeptCode())){
+            //简易门诊将医生的科室设置到分诊记录
+            List<String> deptNos=userDeptRelationMapper.selectAllByUserIdCode(tokenUser.getUserIdCode());
+            if(deptNos!=null && deptNos.size()>0){
+                updateMzfzPatientOrder.setDeptCode(deptNos.get(0));
+            }
+        }
         return mzfzPatientOrderMapper.updateMzfzPatientOrder(updateMzfzPatientOrder);
     }
 

+ 1 - 1
src/main/resources/static/js/mz/clinic.js

@@ -8872,7 +8872,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     $("#patientAgePrescription").text(mzPatientMi.ageString);
                     $("#patientIdPrescription").text(mzPatientMi.patientId);
                     $("#deptPrescription").text(deptName);
-                    $("#doctorPrescription").text(res.doctorName);
+                    //$("#doctorPrescription").text(res.doctorName);
                     $("#cfTime").text(res.opDate);
                     $("#socialNo").text(mzPatientMi.socialNo);
                     $("#zdPrescription").text(res.data.icdText);

+ 2 - 2
src/main/resources/templates/mz/clinic.html

@@ -2158,8 +2158,8 @@
                 <td id="patientIdPrescription"></td>
                 <td style="text-align: right">科室:</td>
                 <td id="deptPrescription"></td>
-                <td style="text-align: right">医生:</td>
-                <td id="doctorPrescription"></td>
+                <!--<td style="text-align: right">医生:</td>-->
+                <!--<td id="doctorPrescription"></td>-->
             </tr>
             <tr>
                 <td style="text-align: right">处方类型:</td>