Ver Fonte

历史轨迹处方回调开发完成

hurugang há 4 anos atrás
pai
commit
eb25d37427

+ 16 - 19
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -183,15 +183,6 @@ public class ClinicController {
             } else {
                 //如果在病人表查不到的话,就代入模糊查询
                 clinic.setCommonParams("%" + clinic.getCommonParams() + "%");
-//                //当输入的手机号或者卡号时
-//                List<MzPatientMi> mzPatientMiList= mzPatientMiService.queryByCommonParams(clinic.getCommonParams());
-//                if(mzPatientMiList!=null && mzPatientMiList.size()>0){
-//                    clinic.setCommonParams(null);
-//                    clinic.setPatientIds(mzPatientMiList.stream().map(m-> m.getPatientId()).collect(Collectors.toList()));
-//                }else {
-//                    //如果在病人表查不到的话,就代入模糊查询
-//                    clinic.setCommonParams("%"+clinic.getCommonParams()+"%");
-//                }
             }
             if (StringUtils.isBlank(clinic.getBeginDate())) {
                 resultMap.put("code", -1);
@@ -213,17 +204,23 @@ public class ClinicController {
                 resultMap.put("message", "查询就诊记录失败,当前所在页参数为空");
                 return resultMap;
             }
-            User tokenUser = TokenUtil.getUser(httpServletRequest);
-            //clinic.setClinicStatuses(Arrays.asList(ClinicStatusEnum.HAD_CLINIC.code,ClinicStatusEnum.CHARGED.code,ClinicStatusEnum.REFUND.code));
-            List<String> deptCodes = mzyRequestService.queryUnitCodeByRequestDayAndDoctor(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), tokenUser.getUserIdCode());
-            if (deptCodes == null) {
-                deptCodes = new ArrayList<>();
-            }
-            //当前医生是急诊科医生,可以看全科室的病人
-            if(deptCodes.contains(Constants.EMERGENCY_WARD_CODE)){
-                clinic.setDeptCode(Constants.EMERGENCY_WARD_CODE);
+            //如果医生字段是空,说明是查询就诊轨迹,就诊轨迹不限制科室和医生
+            if(StringUtils.isBlank(clinic.getDoctorCode())){
+                User tokenUser = TokenUtil.getUser(httpServletRequest);
+                //clinic.setClinicStatuses(Arrays.asList(ClinicStatusEnum.HAD_CLINIC.code,ClinicStatusEnum.CHARGED.code,ClinicStatusEnum.REFUND.code));
+                List<String> deptCodes = mzyRequestService.queryUnitCodeByRequestDayAndDoctor(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), tokenUser.getUserIdCode());
+                if (deptCodes == null) {
+                    deptCodes = new ArrayList<>();
+                }
+                //当前医生是急诊科医生,可以看全科室的病人
+                if(deptCodes.contains(Constants.EMERGENCY_WARD_CODE)){
+                    clinic.setDeptCode(Constants.EMERGENCY_WARD_CODE);
+                }else {
+                    clinic.setDoctorCode(tokenUser.getUserIdCode());
+                }
             }else {
-                clinic.setDoctorCode(tokenUser.getUserIdCode());
+                //前端传的-1需要清空
+                clinic.setDoctorCode(null);
             }
             resultMap.put("code", 0);
             resultMap.put("message", "查询就诊记录成功");

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

@@ -1488,7 +1488,7 @@ public class MzChargeDetailController {
      * @param times
      * @param MzBlRecordFlag 如果是修改处方传false  如果是重复接诊传; true 时,只需要构造病历信息,不需要设置用药和诊疗信息
      * @param payMark 5 未缴费处 0 已缴费
-     * @param clnicId 就诊记录id
+     * @param clnicId 就诊记录id 是否需要查询就诊记录信息
      * @return
      */
     @UserLoginToken

+ 149 - 19
src/main/resources/static/js/mz/clinic.js

@@ -356,11 +356,13 @@ function fitPatientHisData() {
         dataType: "json",
         data: JSON.stringify({
             "patientId": $("#patientId").val(),
-            "clinicStatuses": [5, 6],
+            //"clinicStatuses": [5, 6],
+            "clinicStatuses": [6],
             "pageSize": 10000,
             "offset": 0,
             "beginDate": "2012-02-01 00:00:00",
-            "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss")
+            "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss"),
+            "doctorCode":"-1"
         }),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (res) {
@@ -389,7 +391,7 @@ function fitPatientHisData() {
                         html += '                            </div>';
                         html += '                            <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
                         html += '                                 title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
-                        html += '                                    onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',0)">' + icdText + '</a>';
+                        html += '                                    onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ','+data[i].clinicStatus+')">' + icdText + '</a>';
                         html += '                            </div>';
                         html += '                        </div>';
                     }
@@ -590,6 +592,7 @@ function clearUser() {
     $("#patientResponseType").html("");
     $("#first").parent().addClass("checked");
     $("#not").parent().removeClass("checked");
+    $("#not").click();
     $("#patientHisData").text("");
     $("#mzfzSerialNoInClick").val(null);
 }
@@ -942,11 +945,43 @@ function clinicalReception(patientId, serialNo) {
         $("#messageContent").html("当前有病人正在接诊,是否切换?");
         $("#messageButton").off("click").on("click", function (t) {
             $("#messageModal").modal("hide");
-            clearWorkSpace();
-            realClinicalReception(patientId, serialNo)
+            //当前有人在接诊,提示是否需要切换和保存
+            $("#messagePrescriptionModal").modal();
+            $("#confirmPrescriptionButton").off("click").on("click", function (t) {
+                $("#messagePrescriptionModal").modal("hide");
+                //先保存目前接诊信息,再切换就诊人
+                var jsonData = getParamsForOrescription();
+                $.ajax({
+                    type: "POST",
+                    url: '/thmz/savePrescription',
+                    contentType: "application/json;charset=UTF-8",
+                    dataType: "json",
+                    data: JSON.stringify(jsonData),
+                    headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                    success: function (res) {
+                        if (res == '401' || res == 401) {
+                            window.location.href = '/thmz/login/view'
+                            return;
+                        }
+                        if (res.code == 0) {
+                            clearWorkSpace();
+                            realClinicalReception(patientId, serialNo);
+                            //加载已接诊患者列表
+                            loadClinicTableList();
+                        } else {
+                            errorMesage(res);
+                        }
+                    }
+                });
+            });
+            $("#cancelPrescriptionButton").off("click").on("click", function (t) {
+                $("#messagePrescriptionModal").modal("hide");
+                clearWorkSpace();
+                realClinicalReception(patientId, serialNo);
+            });
         });
     } else {
-        realClinicalReception(patientId, serialNo)
+        realClinicalReception(patientId, serialNo);
     }
 }
 
@@ -969,9 +1004,11 @@ function setMzPatientInfo(mzPatientMi) {
     if (mzPatientMi.times == 1) {
         $("#first").parent().addClass("checked");
         $("#not").parent().removeClass("checked");
+        $("#first").click();
     } else {
         $("#not").parent().addClass("checked");
         $("#first").parent().removeClass("checked");
+        $("#not").click();
     }
     $("#patientHisData").text(mzPatientMi.name);
     fitPatientHisData();
@@ -1225,9 +1262,11 @@ function editPrescription(jsonData) {
     if (firstOrNot == 0) {
         $("#first").parent().addClass("checked");
         $("#not").parent().removeClass("checked");
+        $("#first").click();
     } else if (firstOrNot == 1) {
         $("#first").parent().removeClass("checked");
         $("#not").parent().addClass("checked");
+        $("#not").click();
     }
     $("#symptom").val(jsonData.mzBlRecord.emrChiefComplaint);
     $("#emrHpi").val(jsonData.mzBlRecord.emrHpi);
@@ -5013,13 +5052,7 @@ function modifyPatient() {
                 $('#editUserModal').modal('hide');
                 realClinicalReception($("#patientId").val(), $("#mzfzSerialNoInClick").val());
             } else {
-                new PNotify({
-                    title: '错误提示',
-                    text: res.message,
-                    type: 'error',
-                    hide: true,
-                    styling: 'bootstrap3'
-                });
+                errorMesage(res);
             }
         }
     });
@@ -5811,6 +5844,96 @@ function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
 }
 
 
+
+
+
+/**
+ * 查询病人已缴费处方信息 调用处方
+ * @param patientId
+ * @param times
+ * @param clnicId 就诊记录id
+ */
+function getMzPrescriptionVoPaid(patientId, times, clnicId) {
+    $("#visitingDetailModal").modal("hide");
+    $("#messageModal").modal();
+    $("#messageContent").html("确认调用选中处方吗?将会覆盖当前处方。");
+    $("#messageButton").off("click").on("click", function (t) {
+        $("#messageModal").modal("hide");
+        $.ajax({
+            type: "GET",
+            url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + "&times=" + times + "&MzBlRecordFlag=false&payMark=0&clnicId=null",
+            contentType: "application/json;charset=UTF-8",
+            dataType: "json",
+            headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+            success: function (res) {
+                if (res == '401' || res == 401) {
+                    window.location.href = '/thmz/login/view'
+                    return;
+                }
+                if (res.code == 0) {
+                    var mzfzSerialNoInClick=$("#mzfzSerialNoInClick").val();
+                    clearWorkSpace();
+                    setMzPatientInfo(res.mzPatientMi);
+                    editPrescription(res.data)
+                    $("#mzfzSerialNoInClick").val(mzfzSerialNoInClick);
+                } else {
+                    errorMesage(res);
+                }
+            }
+        });
+    });
+
+
+
+
+
+
+
+
+
+    var currentPatientId = $("#patientId").val();
+    //当前接诊的用户和操作接诊的是同一个人,不做任何操作
+    if (currentPatientId == patientId) {
+        return;
+    }
+    if (currentPatientId == null || currentPatientId == "") {
+        //当前没有人接诊,直接接诊
+        getMzPrescriptionVoPaidCommon(patientId, times, clnicId);
+    } else {
+        //当前有人在接诊,提示是否需要切换和保存
+        $("#messagePrescriptionModal").modal();
+        $("#confirmPrescriptionButton").off("click").on("click", function (t) {
+            $("#messagePrescriptionModal").modal("hide");
+            //先保存目前接诊信息,再切换就诊人
+            var jsonData = getParamsForOrescription();
+            $.ajax({
+                type: "POST",
+                url: '/thmz/savePrescription',
+                contentType: "application/json;charset=UTF-8",
+                dataType: "json",
+                data: JSON.stringify(jsonData),
+                headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                success: function (res) {
+                    if (res == '401' || res == 401) {
+                        window.location.href = '/thmz/login/view'
+                        return;
+                    }
+                    if (res.code == 0) {
+                        loadInClinicTableList();
+                        loadClinicTableList();
+                        getMzPrescriptionVoPaidCommon(patientId, times, clnicId);
+                    } else {
+                        errorMesage(res);
+                    }
+                }
+            });
+        });
+    }
+}
+
+
+
+
 /**
  * 重复接诊
  * @param patientId
@@ -5898,7 +6021,6 @@ function repeatAcceptsConfirm(patientId, times, clnicId) {
             repeatAcceptsCommon(patientId, times, clnicId);
         });
     }
-
 }
 
 
@@ -5951,9 +6073,15 @@ function prescriptionDetail(patientId, times, clnicId, payMark) {
  * @param patientId
  * @param times
  * @param clnicId
- * @param payMark
- */
-function visitingDetailModal(patientId, times, clnicId, payMark) {
+ * @param clinicStatus
+ */
+function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
+    var payMark =null;
+    if(clinicStatus==5){
+        payMark=5;
+    }else {
+        payMark=0;
+    }
     prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
 }
 
@@ -6000,8 +6128,10 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                 var firstOrNot = jsonData.mzBlRecord.firstOrNot;
                 if (firstOrNot == 0) {
                     $("#visitFlag").html("初诊");
+                    $("#first").click();
                 } else if (firstOrNot == 1) {
                     $("#visitFlag").html("复诊");
+                    $("#not").click();
                 }
                 if (payMark == 0) {
                     $("#chargeImage").attr("src", "/thmz/images/charge.png");
@@ -6110,8 +6240,8 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                 } else {
                     $("#printPrescription").removeClass("in").addClass("hide");
                     $("#callPrescription").removeClass("hide").addClass("in");
-                    $("#printPrescription").off("click").on("click", function (t) {
-                        alert("调用处方");
+                    $("#callPrescription").off("click").on("click", function (t) {
+                        getMzPrescriptionVoPaid(patientId, times, clnicId);
                     });
                 }
             } else {