Pārlūkot izejas kodu

优化病历模块

hurugang 3 gadi atpakaļ
vecāks
revīzija
8622a82206

+ 25 - 22
src/main/java/cn/hnthyy/thmz/controller/mz/MzBlRecordController.java

@@ -149,11 +149,11 @@ public class MzBlRecordController {
                 mzBlRecord.setDoctorCode(null);
             }
             if (mzBlRecord.getPatientId() != null && StringUtils.isNotBlank(mzBlRecord.getPatientId())) {
-                List<MzPatientMi> mzPatientMiList= mzPatientMiService.queryByCommonParams(mzBlRecord.getPatientId());
-                if(mzPatientMiList!=null && mzPatientMiList.size()>0){
-                    List<String> patientIds= mzPatientMiList.stream().map(m->m.getPatientId()).collect(Collectors.toList());
-                    if(patientIds!=null && patientIds.size()>0){
-                        if(patientIds.size()<1000){
+                List<MzPatientMi> mzPatientMiList = mzPatientMiService.queryByCommonParams(mzBlRecord.getPatientId());
+                if (mzPatientMiList != null && mzPatientMiList.size() > 0) {
+                    List<String> patientIds = mzPatientMiList.stream().map(m -> m.getPatientId()).collect(Collectors.toList());
+                    if (patientIds != null && patientIds.size() > 0) {
+                        if (patientIds.size() < 1000) {
                             //数量太大,没有检索的意义
                             mzBlRecord.setPatientIds(patientIds);
                         }
@@ -167,14 +167,14 @@ public class MzBlRecordController {
                 resultMap.put("message", "查询病历失败,暂时没有对应的报告");
                 return resultMap;
             }
-            Map<String,String> patientMap = new HashMap<>();
-            for (MzBlRecord mr:data){
+            Map<String, String> patientMap = new HashMap<>();
+            for (MzBlRecord mr : data) {
                 String name = patientMap.get(mr.getPatientId());
-                if(name==null){
-                    MzPatientMi mzPatientMi= mzPatientMiService.queryByPatientId(mr.getPatientId());
-                    if(mzPatientMi!=null){
-                        name=  mzPatientMi.getName();
-                        patientMap.put(mr.getPatientId(),name);
+                if (name == null) {
+                    MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mr.getPatientId());
+                    if (mzPatientMi != null) {
+                        name = mzPatientMi.getName();
+                        patientMap.put(mr.getPatientId(), name);
                     }
                 }
                 mr.setPatientName(name);
@@ -197,7 +197,6 @@ public class MzBlRecordController {
     }
 
 
-
     /**
      * 修改门诊病历的处理意见
      *
@@ -223,18 +222,23 @@ public class MzBlRecordController {
                 resultMap.put("message", "修改门诊病历的处理意见失败,就诊次数为空");
                 return resultMap;
             }
-            if(mzBlRecord.getEmrProcess()==null || StringUtils.isBlank(mzBlRecord.getEmrProcess())){
-                resultMap.put("code", -1);
-                resultMap.put("message", "修改门诊病历的处理意见失败,补充处理意见为空");
-                return resultMap;
-            }
-            MzBlRecord dbMzBlRecord= mzBlRecordService.queryMzBlRecordByPatientIdAndTimes(mzBlRecord.getPatientId(),mzBlRecord.getTimes());
-            if(dbMzBlRecord==null){
+//            if(mzBlRecord.getEmrProcess()==null || StringUtils.isBlank(mzBlRecord.getEmrProcess())){
+//                resultMap.put("code", -1);
+//                resultMap.put("message", "修改门诊病历的处理意见失败,补充处理意见为空");
+//                return resultMap;
+//            }
+            MzBlRecord dbMzBlRecord = mzBlRecordService.queryMzBlRecordByPatientIdAndTimes(mzBlRecord.getPatientId(), mzBlRecord.getTimes());
+            if (dbMzBlRecord == null) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "修改门诊病历的处理意见失败,病历不存在");
                 return resultMap;
             }
-            dbMzBlRecord.setEmrProcess(dbMzBlRecord.getEmrProcess()+"_补充处理:"+mzBlRecord.getEmrProcess());
+            if (dbMzBlRecord.getEmrProcess().indexOf("_补充处理:") > 0) {
+                dbMzBlRecord.setEmrProcess(dbMzBlRecord.getEmrProcess().substring(0, dbMzBlRecord.getEmrProcess().indexOf("_补充处理:")));
+            }
+            if (mzBlRecord.getEmrProcess() != null && StringUtils.isNotBlank(mzBlRecord.getEmrProcess())) {
+                dbMzBlRecord.setEmrProcess(dbMzBlRecord.getEmrProcess() + "_补充处理:" + mzBlRecord.getEmrProcess());
+            }
             mzBlRecordService.modifyMzBlRecordEmrProcess(dbMzBlRecord);
             resultMap.put("code", 0);
             resultMap.put("message", "修改门诊病历的处理意见成功");
@@ -249,5 +253,4 @@ public class MzBlRecordController {
     }
 
 
-
 }

+ 28 - 24
src/main/resources/static/js/mz/clinic.js

@@ -2460,7 +2460,7 @@ function editJyJcItem(obj) {
 function saveJyJcItem(calculateTotalAmountFlag) {
     //6岁内提示加价
     var patientAge = $("#patientAge").text();
-    if (patientAge < 6) {
+    if (patientAge != null && patientAge != "" && patientAge < 6) {
         $.ajax({
             type: "GET",
             url: '/thmz/checkAdditionally?code=' + $("#current_code").val(),
@@ -2702,12 +2702,12 @@ function removeYpOrProject(index, obj) {
     //var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
     //calculateCfAmount(tableId, totalRetprice, null, index, 1);
     //医技的序号调整一下
-    if(index == 2){
+    if (index == 2) {
         var nextAll = $(obj).parent().nextAll();
-        if(nextAll!=null && nextAll.length>0){
-            for(var i=0;i<nextAll.length;i++){
-               var index= $(nextAll[i]).find(".jcjyItemGroupId").text();
-                $(nextAll[i]).find(".jcjyItemGroupId").text(index-1);
+        if (nextAll != null && nextAll.length > 0) {
+            for (var i = 0; i < nextAll.length; i++) {
+                var index = $(nextAll[i]).find(".jcjyItemGroupId").text();
+                $(nextAll[i]).find(".jcjyItemGroupId").text(index - 1);
             }
         }
     }
@@ -5076,90 +5076,90 @@ function initWorkspaceConfigForCurrent() {
             if (res.code == 0) {
                 if (res.data.symptomFlag == 1) {
                     $("#symptomFlag").removeClass("in").addClass("hide");
-                    if($("#symptomFlagCheck").parent().hasClass("checked")){
+                    if ($("#symptomFlagCheck").parent().hasClass("checked")) {
                         $("#symptomFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.symptomFlag == 0) {
                     $("#symptomFlag").removeClass("hide").addClass("in");
-                    if(!$("#symptomFlagCheck").parent().hasClass("checked")){
+                    if (!$("#symptomFlagCheck").parent().hasClass("checked")) {
                         $("#symptomFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.emrHpiFlag == 1) {
                     $("#emrHpiFlag").removeClass("in").addClass("hide");
-                    if($("#emrHpiFlagCheck").parent().hasClass("checked")){
+                    if ($("#emrHpiFlagCheck").parent().hasClass("checked")) {
                         $("#emrHpiFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.emrHpiFlag == 0) {
                     $("#emrHpiFlag").removeClass("hide").addClass("in");
-                    if(!$("#emrHpiFlagCheck").parent().hasClass("checked")){
+                    if (!$("#emrHpiFlagCheck").parent().hasClass("checked")) {
                         $("#emrHpiFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
 
                 if (res.data.emrPsFlag == 1) {
                     $("#emrPsFlag").removeClass("in").addClass("hide");
-                    if($("#emrPsFlagCheck").parent().hasClass("checked")){
+                    if ($("#emrPsFlagCheck").parent().hasClass("checked")) {
                         $("#emrPsFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.emrPsFlag == 0) {
                     $("#emrPsFlag").removeClass("hide").addClass("in");
-                    if(!$("#emrPsFlagCheck").parent().hasClass("checked")){
+                    if (!$("#emrPsFlagCheck").parent().hasClass("checked")) {
                         $("#emrPsFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.personalHistoryFlag == 1) {
                     $("#personalHistoryFlag").removeClass("in").addClass("hide");
-                    if($("#personalHistoryFlagCheck").parent().hasClass("checked")){
+                    if ($("#personalHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#personalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.personalHistoryFlag == 0) {
                     $("#personalHistoryFlag").removeClass("hide").addClass("in");
-                    if(!$("#personalHistoryFlagCheck").parent().hasClass("checked")){
+                    if (!$("#personalHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#personalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.familyHistoryFlag == 1) {
                     $("#familyHistoryFlag").removeClass("in").addClass("hide");
-                    if($("#familyHistoryFlagCheck").parent().hasClass("checked")){
+                    if ($("#familyHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#familyHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.familyHistoryFlag == 0) {
                     $("#familyHistoryFlag").removeClass("hide").addClass("in");
-                    if(!$("#familyHistoryFlagCheck").parent().hasClass("checked")){
+                    if (!$("#familyHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#familyHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.obstericalHistoryFlag == 1) {
                     $("#obstericalHistoryFlag").removeClass("in").addClass("hide");
-                    if($("#obstericalHistoryFlagCheck").parent().hasClass("checked")){
+                    if ($("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#obstericalHistoryFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.obstericalHistoryFlag == 0) {
                     $("#obstericalHistoryFlag").removeClass("hide").addClass("in");
-                    if(!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")){
+                    if (!$("#obstericalHistoryFlagCheck").parent().hasClass("checked")) {
                         $("#obstericalHistoryFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.pressureLeftFlag == 1) {
                     $("#pressureLeftFlag").removeClass("in").addClass("hide");
-                    if($("#pressureLeftFlagCheck").parent().hasClass("checked")){
+                    if ($("#pressureLeftFlagCheck").parent().hasClass("checked")) {
                         $("#pressureLeftFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.pressureLeftFlag == 0) {
                     $("#pressureLeftFlag").removeClass("hide").addClass("in");
-                    if(!$("#pressureLeftFlagCheck").parent().hasClass("checked")){
+                    if (!$("#pressureLeftFlagCheck").parent().hasClass("checked")) {
                         $("#pressureLeftFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
                 if (res.data.tentativeDiagnosisFlag == 1) {
                     $("#tentativeDiagnosisFlag").removeClass("in").addClass("hide");
-                    if($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")){
+                    if ($("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
                         $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前选中改为不选中
                     }
                 } else if (res.data.tentativeDiagnosisFlag == 0) {
                     $("#tentativeDiagnosisFlag").removeClass("hide").addClass("in");
-                    if(!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")){
+                    if (!$("#tentativeDiagnosisFlagCheck").parent().hasClass("checked")) {
                         $("#tentativeDiagnosisFlagCheck").parent().parent().click();//当前不选中改为选中
                     }
                 }
@@ -5171,7 +5171,6 @@ function initWorkspaceConfigForCurrent() {
 }
 
 
-
 /**
  * 保存医生工作台配置
  */
@@ -6218,6 +6217,12 @@ function printPrescription(patientId, times, clnicId, payMark) {
             if (res.code == 0) {
                 var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
                 if (prescriptionDetail != null && prescriptionDetail != "") {
+                    var prescriptionDetailJson = JSON.parse(prescriptionDetail);
+                    //当前处方只开了住院证则只打印住院证
+                    if (prescriptionDetailJson.xyPrescription.jePrescription.length == 0 && prescriptionDetailJson.xyPrescription.mjPrescription.length == 0 && prescriptionDetailJson.xyPrescription.pyPrescription.length == 0 && prescriptionDetailJson.xyPrescription.ycPrescription.length == 0 && prescriptionDetailJson.zlPrescription.length == 0 && prescriptionDetailJson.zyPrescription.length == 0 && prescriptionDetailJson.zyReqPrescription.length > 0) {
+                        printZyReq(patientId);
+                        return;
+                    }
                     var index = 0;
                     setPrint();
                     LODOP = getLodop();
@@ -6250,7 +6255,6 @@ function printPrescription(patientId, times, clnicId, payMark) {
                     $("#patientIdGuideCard").text(mzPatientMi.patientId);
                     $("#patientNameGuideCard").text(mzPatientMi.name);
                     $("#patientDateGuideCard").text(format(new Date(), "yyyy-MM-dd"));
-                    var prescriptionDetailJson = JSON.parse(prescriptionDetail);
                     //普药处方
                     var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
                     if (pyPrescription != null && pyPrescription.length > 0) {

+ 22 - 1
src/main/resources/static/js/mz/mz_bl_record.js

@@ -575,6 +575,28 @@ function showMzBlRecordModal(patientId, times) {
  * 保存门诊病历
  */
 function setEmrProcess() {
+    $("#messageModal").modal();
+    $("#messageContent").html("是否保存并替换已有补充处理意见?");
+    $("#messageButton").off("click").on("click", function (t) {
+        if($("#newEmrProcess").val()==null || $("#newEmrProcess").val()==""){
+            $("#messageContent").html("当前录入的补充处理为空,是否保存并替换已有补充处理意见?");
+            $("#messageButton").off("click").on("click", function (t) {
+                $("#messageModal").modal("hide");
+                sendEmrProcess();
+            });
+        }else {
+            $("#messageModal").modal("hide");
+            sendEmrProcess();
+        }
+    });
+
+
+}
+
+/**
+ * 提交保存门诊病历
+ */
+function sendEmrProcess() {
     $.ajax({
         type: "POST",
         url: '/thmz/setEmrProcess',
@@ -602,7 +624,6 @@ function setEmrProcess() {
     });
 }
 
-
 /**
  * 情况区域
  */

+ 31 - 2
src/main/resources/templates/mz/mz_bl_record.html

@@ -299,7 +299,7 @@
                             <label class="control-label col-md-2 col-sm-2 col-xs-12" for="editEmrProcess">已有处理(RP.)
                             </label>
                             <div class="col-md-8 col-sm-8 col-xs-12">
-                                <textarea id="editEmrProcess" class="form-control col-md-7 col-xs-12" readonly></textarea>
+                                <textarea id="editEmrProcess" class="form-control col-md-7 col-xs-12" readonly style="min-height: 250px;"></textarea>
                             </div>
                         </div>
                     </div>
@@ -308,7 +308,7 @@
                             <label class="control-label col-md-2 col-sm-2 col-xs-12" for="newEmrProcess">补充处理(RP.)
                             </label>
                             <div class="col-md-8 col-sm-8 col-xs-12">
-                                <textarea id="newEmrProcess" class="form-control col-md-7 col-xs-12"></textarea>
+                                <textarea id="newEmrProcess" class="form-control col-md-7 col-xs-12" style="min-height: 100px;"></textarea>
                             </div>
                         </div>
                     </div>
@@ -333,6 +333,35 @@
 </div>
 <!--病历编辑弹窗结尾-->
 
+<!--提示弹窗开始-->
+<div class="modal fade bs-example-modal-sm in" tabindex="-1" role="dialog" aria-hidden="true" id="messageModal"
+     style="top:20%;">
+    <div class="modal-dialog modal-sm">
+        <div class="modal-content" style="width: 480px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">提示</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal form-label-left" novalidate>
+                    <div class="col-md-2 col-sm-2 col-xs-12">
+                        <i class="fa fa-info-circle blue fa-3x"></i>
+                    </div>
+                    <div class="col-md-10 col-sm-10 col-xs-12"
+                         style="font-size: 14px;font-weight: 700;min-height: 39px;line-height: 39px;" id="messageContent">
+                        当前有病人正在接诊,是否切换?
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="messageButton">确定</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--提示弹窗结尾-->
 
 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>