|
@@ -5,7 +5,7 @@ var bqPrintIndex = window.localStorage["bqPrintIndex"];
|
|
|
var fskPrintIndex = window.localStorage["fskPrintIndex"];
|
|
|
var winNo = window.localStorage["winNo"];
|
|
|
var groupNo = window.localStorage["groupNo"];
|
|
|
-
|
|
|
+let coreId // 病人id
|
|
|
$(function () {
|
|
|
init_daterangepicker();
|
|
|
$(".selectpicker").selectpicker({
|
|
@@ -34,6 +34,13 @@ $(function () {
|
|
|
cleanParams();
|
|
|
});
|
|
|
|
|
|
+ $('#btn_clean_history').click(function () {
|
|
|
+ $('#reportRangeList span').html(moment().subtract(30, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
+ });
|
|
|
+ $("#btn_query_history").click(function (t) {
|
|
|
+ callHistoryDetail();
|
|
|
+ });
|
|
|
+
|
|
|
$("#btn_query").click(function (t) {
|
|
|
initTbTable();
|
|
|
});
|
|
@@ -357,6 +364,7 @@ function initTbTable(pageIndex) {
|
|
|
str += '<button type="button" class="registration-no-color-foot-button" title="发药" id="sendDrug" onclick="sendMedicineProcessing(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.name + '\')"><i class="fa fa-check-square-o"></i></button>';
|
|
|
}
|
|
|
str += '<button type="button" class="registration-no-color-foot-button" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.confirmFlag + '\')"><i class="fa fa-plus"></i></button>';
|
|
|
+ str += '<button type="button" class="registration-no-color-foot-button" title="历史处方" onclick="prescriptionHistoryDetail(\'' + row.patientId + '\',\'' + 0 +'\')"><i class="fa fa-eye"></i></button>';
|
|
|
}
|
|
|
return str;
|
|
|
}
|
|
@@ -1721,5 +1729,317 @@ function callAllergenInfo(allergenList){
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function callHistoryDetail() {
|
|
|
+ if(coreId){
|
|
|
+ prescriptionHistoryDetail(coreId, '1');
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 查看历史处方
|
|
|
+let $historyTable
|
|
|
+function prescriptionHistoryDetail(patientId, type){
|
|
|
+ coreId = patientId
|
|
|
+ if(type === '0'){
|
|
|
+ daterangepickerNew('reportRangeList', 'center');
|
|
|
+ initSelectHistory();
|
|
|
+ }
|
|
|
+ let rePortRangeArr = getRePortRangeArr1();
|
|
|
+ let temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
|
|
+ patientId: patientId,
|
|
|
+ beginTime: rePortRangeArr[0],
|
|
|
+ endTime: rePortRangeArr[1],
|
|
|
+ // pageSize: params.limit, //页面大小
|
|
|
+ // pageIndex: params.offset / params.limit, //页码
|
|
|
+ };
|
|
|
+ $('#tb_table_history').bootstrapTable("destroy");
|
|
|
+ $historyTable = $('#tb_table_history').bootstrapTable({
|
|
|
+ url: '/thmz/getMzBlRecordList', //请求后台的URL(*)
|
|
|
+ method: 'post', //请求方式(*)
|
|
|
+ toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
+ striped: true, //是否显示行间隔色
|
|
|
+ cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
+ pagination: true, //是否显示分页(*)
|
|
|
+ sortable: true, //是否启用排序
|
|
|
+ sortOrder: "desc", //排序方式
|
|
|
+ queryParams: temp, //传递参数(*)
|
|
|
+ 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 + ',3)">查看</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 //数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
+ $("#historyModal").modal();
|
|
|
+}
|
|
|
+
|
|
|
+function showMzBlRecordModal(patientId, times, type) {
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getMzBlrecord?patientId=' + patientId + '×=' + times,
|
|
|
+ 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 mzPatientMi = res.mzPatientMi;
|
|
|
+ $("#editPatientId").text(mzPatientMi.patientId);
|
|
|
+ $("#editPatientName").text(mzPatientMi.name);
|
|
|
+ $("#editPatientGender").text(mzPatientMi.gender);
|
|
|
+ $("#editPatientAge").text(mzPatientMi.ageString);
|
|
|
+ var mzBlRecord = res.mzBlRecord;
|
|
|
+ $("#editEmrChiefComplaint").val(mzBlRecord.emrChiefComplaint == null ? "" : mzBlRecord.emrChiefComplaint);
|
|
|
+ $("#editEmrHpi").val(mzBlRecord.emrHpi == null ? "" : mzBlRecord.emrHpi);
|
|
|
+ $("#editEmrPs").val(mzBlRecord.emrPs == null ? "" : mzBlRecord.emrPs);
|
|
|
+ $("#editPersonalHistory").val(mzBlRecord.personalHistory == null ? "" : mzBlRecord.personalHistory);
|
|
|
+ $("#editFamilyHistory").val(mzBlRecord.familyHistory == null ? "" : mzBlRecord.familyHistory);
|
|
|
+ $("#editObstericalHistory").val(mzBlRecord.obstericalHistory == null ? "" : mzBlRecord.obstericalHistory);
|
|
|
+ $("#editQtjc").val(mzBlRecord.emrPe == null ? "" : mzBlRecord.emrPe);
|
|
|
+ setSelectedAttr("editZd", mzBlRecord.icdCode, mzBlRecord.icdText);
|
|
|
+ var patientAllergenInfoList = res.patientAllergenInfoList;
|
|
|
+ if (patientAllergenInfoList != null && patientAllergenInfoList.length > 0) {
|
|
|
+ var zdAllergen = [];
|
|
|
+ var ypDitList = [];
|
|
|
+ var zdAllergenHtml = '';
|
|
|
+ var ypDitListHtml = '';
|
|
|
+ var zdAllergeCodes = null;
|
|
|
+ var zdAllergeTexts = null;
|
|
|
+ var ypDitListodes = null;
|
|
|
+ var ypDitListTexts = null;
|
|
|
+ for (var i = 0; i < patientAllergenInfoList.length; i++) {
|
|
|
+ var patientAllergenInfo = patientAllergenInfoList[i];
|
|
|
+ if (patientAllergenInfo.type == 0 || patientAllergenInfo.type == '0') {
|
|
|
+ zdAllergen[zdAllergen.length] = patientAllergenInfo.allergenCode;
|
|
|
+ zdAllergenHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
|
|
|
+ if (zdAllergeCodes == null) {
|
|
|
+ zdAllergeCodes = patientAllergenInfo.allergenCode;
|
|
|
+ zdAllergeTexts = patientAllergenInfo.allergenName;
|
|
|
+ } else {
|
|
|
+ zdAllergeCodes += "," + patientAllergenInfo.allergenCode;
|
|
|
+ zdAllergeTexts += "," + patientAllergenInfo.allergenName;
|
|
|
+ }
|
|
|
+ } else if (patientAllergenInfo.type == 1 || patientAllergenInfo.type == '1') {
|
|
|
+ ypDitList[ypDitList.length] = patientAllergenInfo.allergenCode;
|
|
|
+ ypDitListHtml += '<option value="' + patientAllergenInfo.allergenCode + '">' + patientAllergenInfo.allergenName + '</option>';
|
|
|
+ if (zdAllergeCodes == null) {
|
|
|
+ ypDitListodes = patientAllergenInfo.allergenCode;
|
|
|
+ ypDitListTexts = patientAllergenInfo.allergenName;
|
|
|
+ } else {
|
|
|
+ ypDitListodes += "," + patientAllergenInfo.allergenCode;
|
|
|
+ ypDitListTexts += "," + patientAllergenInfo.allergenName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $("#editZdAllergen").empty();
|
|
|
+ $('#editZdAllergen').append(zdAllergenHtml);
|
|
|
+ $('#editZdAllergen').selectpicker('refresh');
|
|
|
+ $("#editYpDitList").empty();
|
|
|
+ $('#editYpDitList').append(ypDitListHtml);
|
|
|
+ $('#editYpDitList').selectpicker('refresh');
|
|
|
+ $("#editZdAllergen").selectpicker('val', zdAllergen);
|
|
|
+ $("#editZdAllergen").selectpicker('refresh');
|
|
|
+ $("#editYpDitList").selectpicker('val', ypDitList);
|
|
|
+ $("#editYpDitList").selectpicker('refresh');
|
|
|
+ $("#editZdAllergen").attr("selectedCodes", zdAllergeCodes);
|
|
|
+ $("#editZdAllergen").attr("selectedTexts", zdAllergeTexts);
|
|
|
+ $("#editYpDitList").attr("selectedCodes", ypDitListodes);
|
|
|
+ $("#editYpDitList").attr("selectedTexts", ypDitListTexts);
|
|
|
+ }
|
|
|
+ var tentativeDiagnosis = mzBlRecord.tentativeDiagnosis == null ? "" : mzBlRecord.tentativeDiagnosis;
|
|
|
+ if ((mzBlRecord.icdCode == null || mzBlRecord.icdCode == "") && mzBlRecord.icdText != null && mzBlRecord.icdText != "") {
|
|
|
+ if (tentativeDiagnosis == null || tentativeDiagnosis == "") {
|
|
|
+ tentativeDiagnosis = mzBlRecord.icdText;
|
|
|
+ } else {
|
|
|
+ tentativeDiagnosis = mzBlRecord.icdText + " " + tentativeDiagnosis;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $("#edittentativeDiagnosis").val(tentativeDiagnosis);
|
|
|
+ $("#editEmrJkjy").val(mzBlRecord.emrJkjy == null ? "" : mzBlRecord.emrJkjy);
|
|
|
+ $("#bl_weight").val(mzBlRecord.weight == 0 ? null : mzBlRecord.weight);
|
|
|
+ $("#bl_temperature").val(mzBlRecord.temperature == 0 ? null : mzBlRecord.temperature);
|
|
|
+ $("#bl_sphygmus").val(mzBlRecord.sphygmus == 0 ? null : mzBlRecord.sphygmus);
|
|
|
+ $("#bl_breathe").val(mzBlRecord.breathe == 0 ? null : mzBlRecord.breathe);
|
|
|
+ $("#bl_pressure_high").val(mzBlRecord.pressureHigh == 0 ? null : mzBlRecord.pressureHigh);
|
|
|
+ $("#bl_pressure_floor").val(mzBlRecord.pressureFloor == 0 ? null : mzBlRecord.pressureFloor);
|
|
|
+ $("#bl_pressure_high_left").val(mzBlRecord.pressureHighLeft == 0 ? null : mzBlRecord.pressureHighLeft);
|
|
|
+ $("#bl_pressure_floor_left").val(mzBlRecord.pressureFloorLeft == 0 ? null : mzBlRecord.pressureFloorLeft);
|
|
|
+ if (mzBlRecord.emrProcess != null && mzBlRecord.emrProcess != "") {
|
|
|
+ var reg = new RegExp("</br>", "g");//g,表示全部替换。
|
|
|
+ var editEmrProcess = mzBlRecord.emrProcess.replace(reg, "\n");
|
|
|
+ reg = new RegExp(" ", "g");//g,表示全部替换。
|
|
|
+ editEmrProcess = editEmrProcess.replace(reg, "");
|
|
|
+ $("#editEmrProcess").val(editEmrProcess);
|
|
|
+ } else {
|
|
|
+ $("#editEmrProcess").val("");
|
|
|
+ }
|
|
|
+ if (type == 1) {
|
|
|
+ $("#mzBlRecorTitle").html("门诊病历【编辑】");
|
|
|
+ $("#setOtherEmrProcess").removeClass("in").addClass("hide");
|
|
|
+ $("#openBlRecordModel").removeClass("hide").addClass("in");
|
|
|
+ $("#setEmrProcess").removeClass("hide").addClass("in");
|
|
|
+ $("#visitingDetailModal").modal("hide");
|
|
|
+ } else if (type == 2 || type == 3) {
|
|
|
+ $("#mzBlRecorTitle").html("门诊病历【查询】");
|
|
|
+ if(type==2){
|
|
|
+ $("#setOtherEmrProcess").removeClass("hide").addClass("in");
|
|
|
+ }else {
|
|
|
+ $("#setOtherEmrProcess").removeClass("in").addClass("hide");
|
|
|
+ }
|
|
|
+ $("#openBlRecordModel").removeClass("in").addClass("hide");
|
|
|
+ $("#setEmrProcess").removeClass("in").addClass("hide");
|
|
|
+ //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
|
|
|
+ if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
|
|
|
+ $("#baseMzBlTimes").val($("#mzBlTimes").val());
|
|
|
+ }
|
|
|
+ $("#otherBlRecordModal").modal("hide");
|
|
|
+ }
|
|
|
+ $("#mzBlTimes").val(mzBlRecord.times);
|
|
|
+ $("#editMzBlRecordModal").modal();
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function getRePortRangeArr1() {
|
|
|
+ var rePortRange = $('#reportRangeList span').html();
|
|
|
+ var rePortRangeArr = rePortRange.split(" - ");
|
|
|
+ rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
|
|
|
+ rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
|
|
|
+ return rePortRangeArr;
|
|
|
+}
|
|
|
|
|
|
+/**
|
|
|
+ * 清空区域
|
|
|
+ */
|
|
|
+function clearInput() {
|
|
|
+ $("#editPatientId").text(null);
|
|
|
+ $("#editPatientName").text(null);
|
|
|
+ $("#editPatientGender").text(null);
|
|
|
+ $("#editPatientAge").text(null);
|
|
|
+ $("#editEmrChiefComplaint").val(null);
|
|
|
+ $("#editEmrHpi").val(null);
|
|
|
+ $("#editEmrPs").val(null);
|
|
|
+ $("#editPersonalHistory").val(null);
|
|
|
+ $("#editFamilyHistory").val(null);
|
|
|
+ $("#editObstericalHistory").val(null);
|
|
|
+ $("#bl_weight").val(null);
|
|
|
+ $("#bl_sphygmus").val(null);
|
|
|
+ $("#bl_breathe").val(null);
|
|
|
+ $("#bl_pressure_high").val(null);
|
|
|
+ $("#bl_pressure_floor").val(null);
|
|
|
+ $("#bl_pressure_high_left").val(null);
|
|
|
+ $("#bl_pressure_floor_left").val(null);
|
|
|
+ $("#editQtjc").val(null);
|
|
|
+ $("#editZd").selectpicker('val', null);
|
|
|
+ $("#editZd").selectpicker('refresh');
|
|
|
+ $("#edittentativeDiagnosis").val(null);
|
|
|
+ $("#editEmrProcess").val(null);
|
|
|
+ $("#editEmrJkjy").val(null);
|
|
|
+ $("#mzBlTimes").val(null);
|
|
|
+}
|
|
|
|
|
|
+function initSelectHistory() {
|
|
|
+ $('#reportRangeList span').html(moment().subtract(30, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
+ //select 从后台加载数据,并保留之前选择的内容
|
|
|
+ dynamicSelectWithOri("editZd", '/thmz/getAllZdIcdCommonParams?commonParams=',false);
|
|
|
+ //过敏源
|
|
|
+ dynamicSelectWithOri("editZdAllergen", '/thmz/getZdAllergenListByCode?code=', false);
|
|
|
+ //药品列表
|
|
|
+ dynamicSelectWithOri("editYpDitList", '/thmz/getYpZdDictListByCode?code=', false);
|
|
|
+}
|