Преглед на файлове

解决没有接诊的病人无法查看历史处方的问题

hurugang преди 3 години
родител
ревизия
16a032e6a7

+ 5 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -246,6 +246,7 @@ public class ClinicController {
                 resultMap.put("message", "查询就诊记录失败,参数为空");
                 return resultMap;
             }
+            String patientId=null;
             if (StringUtils.isBlank(clinic.getPatientName())) {
                 clinic.setPatientName(null);
             } else {
@@ -254,6 +255,7 @@ public class ClinicController {
             if (StringUtils.isBlank(clinic.getPatientId())) {
                 clinic.setPatientId(null);
             } else {
+                patientId=clinic.getPatientId();
                 clinic.setPatientId("%" + clinic.getPatientId() + "%");
             }
             if (StringUtils.isBlank(clinic.getCommonParams())) {
@@ -303,6 +305,9 @@ public class ClinicController {
             Integer total = clinicService.queryCountClinic(clinic);
             List<Clinic> clinicList = clinicService.queryClinicWithPage(clinic);
             setGender(clinicList);
+            if (StringUtils.isNotBlank(patientId)) {
+                resultMap.put("mzPatientMi", mzPatientMiService.queryByPatientId(patientId));
+            }
             resultMap.put("data", clinicList);
             resultMap.put("total", total);
             return resultMap;

+ 22 - 14
src/main/resources/static/js/mz/clinic.js

@@ -501,17 +501,21 @@ function fitPatientHisData() {
         return;
     }
     var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
-    if ($("#patientId").val() == null || $("#patientId").val() == "") {
+    if (($("#patientId").text() == null || $("#patientId").text() == "")&& ($("#userName").val()==null || $("#userName").val()=="")) {
         $("#patientHisDataForm").html(emptyHtml);
         return;
     }
+    var patientId=$("#patientId").text();
+    if(patientId==null || patientId==""){
+        patientId=$("#userName").val();
+    }
     $.ajax({
         type: "POST",
         url: '/thmz/getClinicWithPage',
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         data: JSON.stringify({
-            "patientId": $("#patientId").val(),
+            "patientId": patientId,
             //"clinicStatuses": [5, 6],
             "clinicStatuses": [6],
             "pageSize": 10000,
@@ -552,8 +556,12 @@ function fitPatientHisData() {
                         html += '                        </div>';
                     }
                 }
-                $("#patientHisData").text($("#patientName").text() + "的");
-                if ($("#patientId").val() == null || $("#patientId").val() == "") {
+                var patientName=$("#patientName").text();
+                if((patientName==null || patientName=="") && res.mzPatientMi!=null){
+                    patientName=res.mzPatientMi.name;
+                }
+                $("#patientHisData").text(patientName + "的");
+                if (($("#patientId").text() == null || $("#patientId").text() == "")&& ($("#userName").val()==null || $("#userName").val()=="")) {
                     $("#patientHisDataForm").html(emptyHtml);
                 } else {
                     $("#patientHisDataForm").html(html);
@@ -743,7 +751,7 @@ function clearUser(flag) {
     $("#patientName").html("");
     $("#patientAge").html("");
     $("#patientGender").html("");
-    $("#patientId").val(null);
+    $("#patientId").text(null);
     $("#editUser").css("display", "none");
     $("#clearUser").css("display", "none");
     $("#patientPhone").html("");
@@ -1100,7 +1108,7 @@ function clinicCallNumber(serialNo) {
  * @param serialNo 分诊流水号
  */
 function clinicalReception(patientId, serialNo) {
-    var existPatientId = $("#patientId").val();
+    var existPatientId = $("#patientId").text();
     if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
         $("#messageModal").modal();
         $("#messageContent").html("当前有病人正在接诊,是否切换?");
@@ -1154,7 +1162,7 @@ function setMzPatientInfo(mzPatientMi) {
     $("#patientName").html(mzPatientMi.name);
     $("#patientAge").html(mzPatientMi.age);
     $("#patientGender").html(mzPatientMi.gender);
-    $("#patientId").val(mzPatientMi.patientId);
+    $("#patientId").text(mzPatientMi.patientId);
     $("#editUser").css("display", "inline-block");
     $("#clearUser").css("display", "inline-block");
     if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != '') {
@@ -3170,7 +3178,7 @@ function calculateTotalAmount() {
 //     //根据病人门诊id查询病人的入院申请
 //     $.ajax({
 //         type: "GET",
-//         url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").val(),
+//         url: '/thmz/getMzZyReqByPatientId?patientId=' + $("#patientId").text(),
 //         contentType: "application/json;charset=UTF-8",
 //         dataType: "json",
 //         headers: {
@@ -3208,7 +3216,7 @@ function editUserModal() {
     $("#editUserModal").modal();
     $.ajax({
         type: "GET",
-        url: '/thmz/getByPatientId?patientId=' + $("#patientId").val(),
+        url: '/thmz/getByPatientId?patientId=' + $("#patientId").text(),
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -5216,7 +5224,7 @@ function modifyPatient() {
             }
             if (res.code == 0) {
                 $('#editUserModal').modal('hide');
-                realClinicalReception($("#patientId").val(), $("#mzfzSerialNoInClick").val());
+                realClinicalReception($("#patientId").text(), $("#mzfzSerialNoInClick").val());
             } else {
                 errorMesage(res);
             }
@@ -5235,7 +5243,7 @@ function modifyPatient() {
 //         contentType: "application/json;charset=UTF-8",
 //         dataType: "json",
 //         data: JSON.stringify({
-//             "patientId": $("#patientId").val(),
+//             "patientId": $("#patientId").text(),
 //             "icdCode": $("#icdCodeBeHospitalized").val(),
 //             "icdText": $("#icdTextBeHospitalized").val(),
 //             "reqDept": $("#inpatientWardBeHospitalized").val(),
@@ -5560,7 +5568,7 @@ function getParamsForpPrescription() {
         }
     }
     var jsonData = JSON.parse('{"patientId": "","firstOrNot":"","icdCode": "","icdText": null,"jzFlag": "0","serialNo":"","mzBlRecord": {"firstOrNot": "","emrChiefComplaint": "","emrHpi": "","emrPs": "","emrPe": "","emrFzjc": null,"emrProcess": null,"emrXyy": "无","emrYypg": "无","emrGnpg": "无","emrJkjy": "","personalHistory": "","familyHistory": "","obstericalHistory": "","weight": "","temperature": "","sphygmus": "","breathe": "","pressureHigh": "","pressureFloor": "","pressureHighLeft": "","pressureFloorLeft": "","tentativeDiagnosis":"","prescriptionDetail":""},"mzChargeDetailList": [],"mzYjReqList": [],"mzZyReq": {"reqDept": "","smallDept": "","admissStatus": ""}}');
-    jsonData.patientId = $("#patientId").val();
+    jsonData.patientId = $("#patientId").text();
     jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
     jsonData.icdCode = icdCode;
     jsonData.serialNo = $("#mzfzSerialNoInClick").val();
@@ -5869,7 +5877,7 @@ function clearApidAcceptsModal() {
  * @param clnicId 就诊记录id
  */
 function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
-    var currentPatientId = $("#patientId").val();
+    var currentPatientId = $("#patientId").text();
     //当前接诊的用户和操作接诊的是同一个人,不做任何操作
     if (currentPatientId == patientId) {
         warningMesageSimaple("当前病人正在接诊中,请勿重复操作!");
@@ -6031,7 +6039,7 @@ function repeatAccepts(patientId, times, clnicId, deptCode) {
  * @param clnicId
  */
 function repeatAcceptsConfirm(patientId, times, clnicId) {
-    var currentPatientId = $("#patientId").val();
+    var currentPatientId = $("#patientId").text();
     //当前接诊的用户和操作接诊的是同一个人,不做任何操作
     if (currentPatientId == patientId) {
         return;

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

@@ -343,13 +343,14 @@
                 <div style="background-color: #E0E0D9;height: 30px;line-height: 30px;">
                     <div class="col-md-8 col-sm-8 col-xs-12">
                         <span>姓名:</span> <label><span id="patientName"></span></label>&nbsp;&nbsp;
+                        <span>门诊ID:</span> <label><span id="patientId"></span></label>&nbsp;&nbsp;
                         <span>年龄: </span> <label><span id="patientAge"></span></label>&nbsp;&nbsp;
                         <span>性别: </span> <label><span id="patientGender"></span></label>&nbsp;&nbsp;
                         <label style="font-weight:normal" id="patientPhoneLabel" hidden><span>手机号: </span> <label><span
                                 id="patientPhone"></span></label>&nbsp;&nbsp;</label>
                         <span>病人性质: </span> <label><span id="patientResponseType"></span></label>
                         <!--当前接诊病人id-->
-                        <input id="patientId" type="hidden"/>
+                      <!--  <input id="patientId" type="hidden"/>-->
                         <!--当前接诊病人分诊流水号-->
                         <input type="hidden" id="mzfzSerialNoInClick"/>
                     </div>