فهرست منبع

病历列表增加门诊病历合并操作

hurugang 3 سال پیش
والد
کامیت
dad7bfdea3

+ 104 - 28
src/main/java/cn/hnthyy/thmz/controller/mz/MzBlRecordController.java

@@ -106,9 +106,9 @@ public class MzBlRecordController {
             mzPatientMi.setGender(GenderEnum.getGenderByCode(mzPatientMi.getSex()).name);
             results.put("mzPatientMi", mzPatientMi);
             MzVisitTable mzVisitTable = mzVisitTableService.queryByPatientIdAndTimes(patientId, times);
-            String icdText=StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis())?"":mzBlRecord.getTentativeDiagnosis();
+            String icdText = StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis()) ? "" : mzBlRecord.getTentativeDiagnosis();
             if (mzVisitTable != null && mzVisitTable.getIcdText() != null && StringUtils.isNotBlank(mzVisitTable.getIcdText())) {
-                icdText+=mzVisitTable.getIcdText();
+                icdText += mzVisitTable.getIcdText();
                 //results.put("icdText", StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis())?mzVisitTable.getIcdText():mzVisitTable.getIcdText()+" "+mzBlRecord.getTentativeDiagnosis());
             }
             results.put("icdText", icdText);
@@ -130,7 +130,7 @@ public class MzBlRecordController {
      */
     @UserLoginToken
     @RequestMapping(value = "/getMzBlRecordList", method = {RequestMethod.POST})
-    public Map<String, Object> getMzBlRecordList(@RequestBody MzBlRecord mzBlRecord) {
+    public Map<String, Object> getMzBlRecordList(@RequestBody MzBlRecord mzBlRecord, HttpServletRequest httpServletRequest) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (mzBlRecord == null) {
@@ -138,15 +138,8 @@ public class MzBlRecordController {
                 resultMap.put("message", "查询病历列表失败,参数为空");
                 return resultMap;
             }
-            if (mzBlRecord.getBeginTime() == null || StringUtils.isBlank(mzBlRecord.getBeginTime())) {
-                resultMap.put("code", -1);
-                resultMap.put("message", "查询病历列表失败,开始时间为空");
-                return resultMap;
-            }
-            if (mzBlRecord.getEndTime() == null || StringUtils.isBlank(mzBlRecord.getEndTime())) {
-                resultMap.put("code", -1);
-                resultMap.put("message", "查询病历列表失败,结束时间为空");
-                return resultMap;
+            if (StringUtils.isBlank(mzBlRecord.getPatientId())) {
+                mzBlRecord.setPatientId(null);
             }
             if (StringUtils.isBlank(mzBlRecord.getDeptCode())) {
                 mzBlRecord.setDeptCode(null);
@@ -154,17 +147,34 @@ public class MzBlRecordController {
             if (StringUtils.isBlank(mzBlRecord.getDoctorCode())) {
                 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) {
-                            //数量太大,没有检索的意义
-                            mzBlRecord.setPatientIds(patientIds);
+            //全量病历列表查询的时候,如果排除的病历的次数有值说明是查询非全量的病历,是有具体患者id的,不需要模糊查询
+            if(mzBlRecord.getExceptTimes() == null){
+                if (mzBlRecord.getBeginTime() == null || StringUtils.isBlank(mzBlRecord.getBeginTime())) {
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "查询病历列表失败,开始时间为空");
+                    return resultMap;
+                }
+                if (mzBlRecord.getEndTime() == null || StringUtils.isBlank(mzBlRecord.getEndTime())) {
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "查询病历列表失败,结束时间为空");
+                    return resultMap;
+                }
+                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) {
+                                //数量太大,没有检索的意义
+                                mzBlRecord.setPatientIds(patientIds);
+                            }
                         }
                     }
                 }
+            }else {
+                //此时,就诊次数不为空,说明是合并病历时查询列表,需要带上当前医生的工号,因为合并病历只能操作本人的病历
+                User tokenUser = TokenUtil.getUser(httpServletRequest);
+                mzBlRecord.setDoctorCode(tokenUser.getUserIdCode());
             }
             Integer total = mzBlRecordService.countMzBlRecord(mzBlRecord);
             List<MzBlRecord> data = mzBlRecordService.queryMzBlRecordWithPage(mzBlRecord);
@@ -240,7 +250,7 @@ public class MzBlRecordController {
                 return resultMap;
             }
             User tokenUser = TokenUtil.getUser(httpServletRequest);
-            if(!tokenUser.getUserIdCode().equals(dbMzBlRecord.getDoctorCode())){
+            if (!tokenUser.getUserIdCode().equals(dbMzBlRecord.getDoctorCode())) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "修改门诊病历的处理意见失败,您无法修改非您本人接诊的病历!");
                 return resultMap;
@@ -251,25 +261,25 @@ public class MzBlRecordController {
             if (mzBlRecord.getEmrProcess() != null && StringUtils.isNotBlank(mzBlRecord.getEmrProcess())) {
                 dbMzBlRecord.setEmrProcess(dbMzBlRecord.getEmrProcess() + "_补充处理:" + mzBlRecord.getEmrProcess());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getEmrChiefComplaint())){
+            if (StringUtils.isNotBlank(mzBlRecord.getEmrChiefComplaint())) {
                 dbMzBlRecord.setEmrChiefComplaint(mzBlRecord.getEmrChiefComplaint());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getEmrHpi())){
+            if (StringUtils.isNotBlank(mzBlRecord.getEmrHpi())) {
                 dbMzBlRecord.setEmrHpi(mzBlRecord.getEmrHpi());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getEmrPs())){
+            if (StringUtils.isNotBlank(mzBlRecord.getEmrPs())) {
                 dbMzBlRecord.setEmrPs(mzBlRecord.getEmrPs());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getPersonalHistory())){
+            if (StringUtils.isNotBlank(mzBlRecord.getPersonalHistory())) {
                 dbMzBlRecord.setPersonalHistory(mzBlRecord.getPersonalHistory());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getFamilyHistory())){
+            if (StringUtils.isNotBlank(mzBlRecord.getFamilyHistory())) {
                 dbMzBlRecord.setFamilyHistory(mzBlRecord.getFamilyHistory());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getObstericalHistory())){
+            if (StringUtils.isNotBlank(mzBlRecord.getObstericalHistory())) {
                 dbMzBlRecord.setObstericalHistory(mzBlRecord.getObstericalHistory());
             }
-            if(StringUtils.isNotBlank(mzBlRecord.getEmrJkjy())){
+            if (StringUtils.isNotBlank(mzBlRecord.getEmrJkjy())) {
                 dbMzBlRecord.setEmrJkjy(mzBlRecord.getEmrJkjy());
             }
             mzBlRecordService.modifyMzBlRecordEmrProcess(dbMzBlRecord);
@@ -286,4 +296,70 @@ public class MzBlRecordController {
     }
 
 
+    /**
+     * 提取门诊病历的处理意见 (合并其他病历的处理意见)
+     * @param patientId 患者ID
+     * @param baseTimes 基础病历的次数(目标病历)
+     * @param times 合并内容源病历
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/extractEmrProcess", method = {RequestMethod.GET})
+    public Map<String, Object> extractEmrProcess(@RequestParam("patientId") String patientId, @RequestParam("baseTimes") Integer baseTimes, @RequestParam("times") Integer times, HttpServletRequest httpServletRequest) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,门诊ID为空");
+                return resultMap;
+            }
+            if (baseTimes == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,目标病历就诊次数为空");
+                return resultMap;
+            }
+            if (times == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,内容来源病历就诊次数为空");
+                return resultMap;
+            }
+            MzBlRecord baseMzBlRecord = mzBlRecordService.queryMzBlRecordByPatientIdAndTimes(patientId, baseTimes);
+            if (baseMzBlRecord == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,目标病历不存在");
+                return resultMap;
+            }
+            MzBlRecord targetMzBlRecord = mzBlRecordService.queryMzBlRecordByPatientIdAndTimes(patientId, times);
+            if (targetMzBlRecord == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,源病历不存在");
+                return resultMap;
+            }
+            User tokenUser = TokenUtil.getUser(httpServletRequest);
+            if ((!tokenUser.getUserIdCode().equals(baseMzBlRecord.getDoctorCode())) || (!tokenUser.getUserIdCode().equals(targetMzBlRecord.getDoctorCode()))) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "提取门诊病历的处理意见失败,您无法修改非您本人接诊的病历!");
+                return resultMap;
+            }
+            if (StringUtils.isBlank(baseMzBlRecord.getEmrProcess())) {
+                baseMzBlRecord.setEmrProcess("");
+            }
+            if (StringUtils.isBlank(targetMzBlRecord.getEmrProcess())) {
+                targetMzBlRecord.setEmrProcess("");
+            }
+            baseMzBlRecord.setEmrProcess(baseMzBlRecord.getEmrProcess()+targetMzBlRecord.getEmrProcess());
+            mzBlRecordService.modifyMzBlRecordEmrProcess(baseMzBlRecord);
+            resultMap.put("code", 0);
+            resultMap.put("message", "提取门诊病历的处理意见成功");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("提取门诊病历的处理意见失败,错误信息{}", e);
+            resultMap.put("code", -1);
+            resultMap.put("message", "提取门诊病历的处理意见失败");
+            return resultMap;
+        }
+    }
+
+
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzBlRecord.java

@@ -97,6 +97,8 @@ public class MzBlRecord extends PageBean {
     private List<String> patientIds;
     //非数据库字段,显示病人姓名
     private String patientName;
+    //病历排除的缴费次数 非数据库字段
+    private Integer exceptTimes;
     /**
      * 为空的数据转换格式
      * @param mzBlRecord

+ 14 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzBlRecordMapper.java

@@ -78,7 +78,7 @@ public interface MzBlRecordMapper {
 
 
     /**
-     * 查询符合条件的挂号数据总数
+     * 查询符合条件的病历数据总数
      *
      * @param mzBlRecord
      * @return
@@ -91,6 +91,12 @@ public interface MzBlRecordMapper {
             "#{item}",
             "</foreach>",
             "</when>",
+            "<when test='patientId!=null'>",
+            " and patient_id =#{patientId}",
+            "</when>",
+            "<when test='exceptTimes!=null'>",
+            " and times !=#{exceptTimes}",
+            "</when>",
             "<when test='deptCode!=null'>",
             " and dept_code =#{deptCode}",
             "</when>",
@@ -107,7 +113,7 @@ public interface MzBlRecordMapper {
     Integer countMzBlRecord(MzBlRecord mzBlRecord);
 
     /**
-     * 分页查询挂号信息
+     * 分页查询病历信息
      *
      * @param mzBlRecord
      * @return
@@ -124,6 +130,12 @@ public interface MzBlRecordMapper {
             "#{item}",
             "</foreach>",
             "</when>",
+            "<when test='patientId!=null'>",
+            " and patient_id =#{patientId}",
+            "</when>",
+            "<when test='exceptTimes!=null'>",
+            " and times !=#{exceptTimes}",
+            "</when>",
             "<when test='deptCode!=null'>",
             " and dept_code =#{deptCode}",
             "</when>",

+ 205 - 21
src/main/resources/static/js/mz/mz_bl_record.js

@@ -134,9 +134,9 @@ function initMzBlRecordList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="showMzBlRecordModal(\'' + row.patientId + '\','+row.times+')">编辑<i class="fa fa-edit" style="margin-left: 10px;"></i></button>';
-                    str += '<button type="button" class="btn btn-primary  btn-sm" onclick="printBlRecord(\'' + row.patientId + '\','+row.times+',1)">打印<i class="fa fa-print" style="margin-left: 10px;"></i></button>';
-                    str += '<button type="button" class="btn btn-primary  btn-sm" onclick="printBlRecord(\'' + row.patientId + '\','+row.times+',2)">打印设置<i class="fa fa-cog" style="margin-left: 10px;"></i></button>';
+                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="showMzBlRecordModal(\'' + row.patientId + '\',' + row.times + ',1)">编辑<i class="fa fa-edit" style="margin-left: 10px;"></i></button>';
+                    str += '<button type="button" class="btn btn-primary  btn-sm" onclick="printBlRecord(\'' + row.patientId + '\',' + row.times + ',1)">打印<i class="fa fa-print" style="margin-left: 10px;"></i></button>';
+                    str += '<button type="button" class="btn btn-primary  btn-sm" onclick="printBlRecord(\'' + row.patientId + '\',' + row.times + ',2)">打印设置<i class="fa fa-cog" style="margin-left: 10px;"></i></button>';
                     return [str].join('');
                 }
             },
@@ -193,13 +193,7 @@ function initMzBlRecordList() {
             var ress = eval(res);
             if (ress.code == -1) {
                 if (ress.message != null && ress.message != '') {
-                    new PNotify({
-                        title: '错误提示',
-                        text: ress.message,
-                        type: 'error',
-                        hide: true,
-                        styling: 'bootstrap3'
-                    });
+                    errorMesage(ress);
                 }
                 return {
                     "total": 0,//总页数
@@ -247,7 +241,6 @@ function initSelect() {
 }
 
 
-
 /**
  * 查询默认打印机
  */
@@ -411,7 +404,6 @@ function printBlRecord(patientId, times, printType) {
 }
 
 
-
 /**
  * 构建体征描述
  * @param mzBlRecord
@@ -472,11 +464,12 @@ function getTz(mzBlRecord) {
 
 
 /**
- * 加载病历信息
+ * 加载病历信息编辑
  * @param patientId
  * @param times
+ * @param type 1 编辑  2 预览
  */
-function showMzBlRecordModal(patientId, times) {
+function showMzBlRecordModal(patientId, times,type) {
     $.ajax({
         type: "GET",
         url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times,
@@ -556,8 +549,8 @@ function showMzBlRecordModal(patientId, times) {
                     $("#editZd").parent().parent().parent().css("display", "none");
                 }
                 if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
-                    var reg = new RegExp("</br>","g");//g,表示全部替换。
-                    $("#editEmrProcess").val(mzBlRecord.emrProcess.replace(reg,"\n"));
+                    var reg = new RegExp("</br>", "g");//g,表示全部替换。
+                    $("#editEmrProcess").val(mzBlRecord.emrProcess.replace(reg, "\n"));
                     $("#editEmrProcess").parent().parent().parent().css("display", "block");
                 } else {
                     $("#editEmrProcess").parent().parent().parent().css("display", "none");
@@ -568,6 +561,21 @@ function showMzBlRecordModal(patientId, times) {
                 } else {
                     $("#editEmrJkjy").parent().parent().parent().css("display", "none");
                 }
+                if(type==1){
+                    $("#mzBlRecorTitle").html("门诊病历【编辑】");
+                    $("#setOtherEmrProcess").removeClass("in").addClass("hide");
+                    $("#openBlRecordModel").removeClass("hide").addClass("in");
+                    $("#setEmrProcess").removeClass("hide").addClass("in");
+                    $("#newEmrProcessDiv").removeClass("hide").addClass("in");
+                }else if(type==2){
+                    $("#mzBlRecorTitle").html("门诊病历【预览】");
+                    $("#setOtherEmrProcess").removeClass("hide").addClass("in");
+                    $("#openBlRecordModel").removeClass("in").addClass("hide");
+                    $("#setEmrProcess").removeClass("in").addClass("hide");
+                    $("#newEmrProcessDiv").removeClass("in").addClass("hide");
+                    $("#baseMzBlTimes").val($("#mzBlTimes").val());
+                    $("#otherBlRecordModal").modal("hide");
+                }
                 $("#mzBlTimes").val(mzBlRecord.times);
                 $("#editMzBlRecordModal").modal();
             } else {
@@ -586,13 +594,13 @@ function setEmrProcess() {
     $("#messageModal").modal();
     $("#messageContent").html("是否保存并替换已有补充处理意见?");
     $("#messageButton").off("click").on("click", function (t) {
-        if($("#newEmrProcess").val()==null || $("#newEmrProcess").val()==""){
+        if ($("#newEmrProcess").val() == null || $("#newEmrProcess").val() == "") {
             $("#messageContent").html("当前录入的补充处理为空,是否保存并替换已有补充处理意见?");
             $("#messageButton").off("click").on("click", function (t) {
                 $("#messageModal").modal("hide");
                 sendEmrProcess();
             });
-        }else {
+        } else {
             $("#messageModal").modal("hide");
             sendEmrProcess();
         }
@@ -601,6 +609,181 @@ function setEmrProcess() {
 
 }
 
+/**
+ * 打开待合并病历列表弹框
+ */
+function openBlRecordModel() {
+    $("#editMzBlRecordModal").modal("hide");
+    $("#otherBlRecordModal").modal();
+    initOtherMzBlRecordList();
+}
+
+
+
+
+/**
+ * 病历列表
+ */
+function initOtherMzBlRecordList() {
+    $('#other_bl_record_table').bootstrapTable("destroy");
+    $('#other_bl_record_table').bootstrapTable({
+        url: '/thmz/getMzBlRecordList',         //请求后台的URL(*)
+        method: 'post',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "desc",                   //排序方式
+        queryParams: queryOtherParams,           //传递参数(*)
+        sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 5,                       //每页的记录行数(*)
+        pageList: [10, 15, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                title: '操作',
+                field: 'op',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="showMzBlRecordModal(\'' + row.patientId + '\',' + row.times + ',2)">预览<i class="fa fa-edit" style="margin-left: 10px;"></i></button>';
+                    return [str].join('');
+                }
+            },
+            {
+                field: 'patientId',
+                title: '门诊ID',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'patientName',
+                title: '患者姓名',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'deptCode',
+                title: '就诊科室',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'doctorCode',
+                title: '接诊医师',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'firstOrNot',
+                title: '初/复诊',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    if (value == '1') {
+                        return "复诊";
+                    }
+                    return "初诊";
+                }
+            }
+            , {
+                field: 'visitDate',
+                title: '就诊时间',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    if (value == null || value == "") {
+                        return "";
+                    }
+                    return format(value, "yyyy-MM-dd HH:mm:ss");
+                }
+            }
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                if (ress.message != null && ress.message != '') {
+                    errorMesage(ress);
+                }
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": ress.total,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+    });
+}
+
+
+/**
+ * 构建列表查询参数
+ * @param params
+ * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
+ */
+function queryOtherParams(params) {
+    var temp = {   //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
+        patientId: $("#editPatientId").text(),
+        exceptTimes: $("#mzBlTimes").val(),
+        pageSize: params.limit,   //页面大小
+        pageIndex: params.offset / params.limit,  //页码
+    };
+    return temp;
+}
+
+/**
+ * 提取处理意见保存
+ */
+function setOtherEmrProcess() {
+    $("#messageModal").modal();
+    $("#messageContent").html("确定要执行此次提取处理意见操作吗?");
+    $("#messageButton").off("click").on("click", function (t) {
+        $("#messageModal").modal("hide");
+        $.ajax({
+            type: "GET",
+            url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val()+ '&times=' + $("#mzBlTimes").val(),
+            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) {
+                    successMesage(res);
+                    $("#editMzBlRecordModal").modal("hide");
+                } else {
+                    errorMesage(res);
+                }
+            }
+        });
+    });
+}
+
+
+
 /**
  * 提交保存门诊病历
  */
@@ -640,7 +823,7 @@ function sendEmrProcess() {
 }
 
 /**
- * 情况区域
+ * 清空区域
  */
 function clearInput() {
     $("#editPatientId").text(null);
@@ -648,7 +831,6 @@ function clearInput() {
     $("#editPatientGender").text(null);
     $("#editPatientAge").text(null);
     $("#editEmrChiefComplaint").val(null);
-
     $("#editEmrHpi").val(null);
     $("#editEmrPs").val(null);
     $("#editPersonalHistory").val(null);
@@ -661,4 +843,6 @@ function clearInput() {
     $("#editEmrJkjy").val(null);
     $("#newEmrProcess").val(null);
     $("#mzBlTimes").val(null);
-}
+    $("#baseMzBlTimes").val(null);
+}
+

+ 33 - 3
src/main/resources/templates/mz/mz_bl_record.html

@@ -194,7 +194,7 @@
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal" onclick="clearInput()"><span aria-hidden="true">×</span>
                 </button>
-                <h4 class="modal-title modal-title-thmz">门诊病历【编辑】</h4>
+                <h4 class="modal-title modal-title-thmz" id="mzBlRecorTitle">门诊病历【编辑】</h4>
             </div>
             <div class="modal-body">
                 <form class="form-horizontal form-label-left" novalidate id="editUserForm" autocomplete="off">
@@ -312,7 +312,7 @@
                             </div>
                         </div>
                     </div>
-                    <div class="item form-group thmz_alert">
+                    <div class="item form-group thmz_alert" id="newEmrProcessDiv">
                         <div class="col-md-12 col-sm-12 col-xs-12 item">
                             <label class="control-label col-md-2 col-sm-2 col-xs-12" for="newEmrProcess">补充处理(RP.)
                             </label>
@@ -324,8 +324,13 @@
                 </form>
             </div>
             <div class="modal-footer">
+                <!--本次病历的就诊次数-->
                 <input id="mzBlTimes" type="hidden"/>
-                <button type="button" class="btn btn-primary" onclick="setEmrProcess()">保存</button>
+               <!-- 合并处方的基础就诊次数-->
+                <input id="baseMzBlTimes" type="hidden"/>
+                <button type="button" class="btn btn-primary hide" onclick="setOtherEmrProcess()" id="setOtherEmrProcess">提取处理意见</button>
+                <button type="button" class="btn btn-primary" onclick="openBlRecordModel()" id="openBlRecordModel">合并病历列</button>
+                <button type="button" class="btn btn-primary" onclick="setEmrProcess()" id="setEmrProcess">保存</button>
                 <button type="button" class="btn btn-default" data-dismiss="modal" onclick="clearInput()">取消</button>
             </div>
         </div>
@@ -363,6 +368,31 @@
 </div>
 <!--提示弹窗结尾-->
 
+
+<!--待合并病历列表弹框开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="otherBlRecordModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 980px;">
+            <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>
+                    <table id="other_bl_record_table" style="margin-top: 10px;"></table>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <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>
 </object>