|
@@ -468,9 +468,9 @@ $(function () {
|
|
|
$("#zlItem").focus();
|
|
|
} else if (id == 'inpatientWardBeHospitalized') {
|
|
|
$("#smallWardBeHospitalized").next().click();
|
|
|
- } else if (id == 'smallWardBeHospitalized') {
|
|
|
+ } else if (id == 'smallWardBeHospitalized') {
|
|
|
$("#conditionCode").next().click();
|
|
|
- }else if (id == 'conditionCode') {
|
|
|
+ } else if (id == 'conditionCode') {
|
|
|
$("#routeOfAdmission").next().click();
|
|
|
} else if (id == 'routeOfAdmission') {
|
|
|
$("#admissStatus").next().click();
|
|
@@ -492,7 +492,7 @@ $(function () {
|
|
|
var tableData = $("#tb_table_western_medicine").bootstrapTable('getData');
|
|
|
if (tableData != null && tableData.length > 0 && dataIndex != null) {
|
|
|
var trData = tableData[dataIndex];
|
|
|
- checkYpInfo(trData.code, trData.serial, trData.ypType, true, null,3);
|
|
|
+ checkYpInfo(trData.code, trData.serial, trData.ypType, true, null, 3);
|
|
|
$("#western_medicine_name").click();
|
|
|
}
|
|
|
} else {
|
|
@@ -2001,14 +2001,14 @@ function realClinicalReception(patientId, serialNo, reqType) {
|
|
|
if (turnToConsultationIdInClick == null || turnToConsultationIdInClick == "null") {
|
|
|
turnToConsultationIdInClick = 0;
|
|
|
}
|
|
|
- var userIdCode=localStorage.getItem("userIdCode");
|
|
|
- var deptNo=localStorage.getItem(userIdCode);
|
|
|
- if(deptNo==null){
|
|
|
- deptNo="";
|
|
|
+ var userIdCode = localStorage.getItem("userIdCode");
|
|
|
+ var deptNo = localStorage.getItem(userIdCode);
|
|
|
+ if (deptNo == null) {
|
|
|
+ deptNo = "";
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick+"&deptNo="+deptNo,
|
|
|
+ url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick + "&deptNo=" + deptNo,
|
|
|
contentType: "application/json;charset=UTF-8",
|
|
|
dataType: "json",
|
|
|
headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
@@ -2439,10 +2439,10 @@ function fitZyReqContent(zyReqPrescription, contentId, titleId, checkBox) {
|
|
|
zyReqHtml += zyReqPrescription.admissStatus;
|
|
|
}
|
|
|
if (zyReqPrescription.conditionCode != null && zyReqPrescription.conditionCode != "") {
|
|
|
- zyReqHtml += " "+zyReqPrescription.conditionCode;
|
|
|
+ zyReqHtml += " " + zyReqPrescription.conditionCode;
|
|
|
}
|
|
|
if (zyReqPrescription.routeOfAdmission != null && zyReqPrescription.routeOfAdmission != "") {
|
|
|
- zyReqHtml += " "+zyReqPrescription.routeOfAdmission;
|
|
|
+ zyReqHtml += " " + zyReqPrescription.routeOfAdmission;
|
|
|
}
|
|
|
zyReqHtml += " 侯床";
|
|
|
if (checkBox) {
|
|
@@ -2721,6 +2721,50 @@ function callBackZlDetail(code, mzChargeDetail) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 处方模板回调和历史处方调用自动重置组号
|
|
|
+ * @param type
|
|
|
+ */
|
|
|
+function resetNewGroupId(type) {
|
|
|
+ if (type == 1 || type == 2) {
|
|
|
+ var xyTabContents = $("#xyTabContent").find("div.tab-pane");
|
|
|
+ //西药设置
|
|
|
+ if (xyTabContents != null && xyTabContents.length > 0) {
|
|
|
+ groupIdMap = new Map();
|
|
|
+ gropuIdAndOrderNoMap = new Map();
|
|
|
+ var newGroupId = 1;
|
|
|
+ gropuIdAndOrderNoMap.put(1, 0);
|
|
|
+ var prevGroupId = null;
|
|
|
+ for (var i = 0; i < xyTabContents.length; i++) {
|
|
|
+ var formGroups = $(xyTabContents[i]).find("div.form-group");
|
|
|
+ if (formGroups != null && formGroups.length > 0) {
|
|
|
+ for (var j = 0; j < formGroups.length; j++) {
|
|
|
+ var tempGroupId = $(formGroups[j]).find("input.temporary_items_groupId").val();
|
|
|
+ if (prevGroupId != null && tempGroupId != prevGroupId) {
|
|
|
+ newGroupId++;
|
|
|
+ gropuIdAndOrderNoMap.put(newGroupId, i);
|
|
|
+ }
|
|
|
+ $(formGroups[j]).find("span.groupId").text(newGroupId);
|
|
|
+ $(formGroups[j]).find("input.temporary_items_groupId").val(newGroupId);
|
|
|
+ var map = groupIdMap.get(newGroupId+'');
|
|
|
+ if (map == null) {
|
|
|
+ map = new Map();
|
|
|
+ map.put("supplyType", $(formGroups[j]).find("input.temporary_items_supplyType").val());
|
|
|
+ map.put("orderFrequency", $(formGroups[j]).find("input.temporary_items_orderFrequency").val());
|
|
|
+ map.put("dayNum", $(formGroups[j]).find("input.temporary_items_dayNum").val());
|
|
|
+ groupIdMap.put(newGroupId+'', map);
|
|
|
+ }
|
|
|
+ if (prevGroupId == null || tempGroupId != prevGroupId) {
|
|
|
+ prevGroupId = tempGroupId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resetGroupIdSelect();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 处方回写
|
|
|
* @param jsonData 处方数据
|
|
@@ -2897,7 +2941,7 @@ function editPrescription(jsonData, type) {
|
|
|
//appendGroupOrder()
|
|
|
$("#groupId").selectpicker('val', groupOrder);
|
|
|
$('#groupId').selectpicker('refresh');
|
|
|
- if(type==1 || type==2){
|
|
|
+ if (type == 1 || type == 2) {
|
|
|
//模板和历史轨迹回调的时候,如果前一个处方不满5个,就将后面的处方的药品添加到上一个处方中,但如果同一组药不能全部添加到上一个处方,就不会追加到该处方中
|
|
|
var orderNoLength = orderNoAndLengthMap.get(orderNo);
|
|
|
if (currentOrderNo == null) {
|
|
@@ -2948,7 +2992,7 @@ function editPrescription(jsonData, type) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- checkYpInfo(code, serial, groupNo, false, orderNo,type);
|
|
|
+ checkYpInfo(code, serial, groupNo, false, orderNo, type);
|
|
|
// 给药方式 同组药品给药方式相同
|
|
|
$("#supplyType").selectpicker('val', mzChargeDetail.supplyCode);
|
|
|
$('#supplyType').selectpicker('refresh');
|
|
@@ -3069,6 +3113,7 @@ function editPrescription(jsonData, type) {
|
|
|
//清空映射map
|
|
|
orderNoAndTableIdMap = null;
|
|
|
tableIdAndOrderNoMap = null;
|
|
|
+ resetNewGroupId(type);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3795,9 +3840,9 @@ function initClinicDeptNo() {
|
|
|
$('#clinicDeptNo').empty();
|
|
|
$('#clinicDeptNo').html(html);
|
|
|
$('#clinicDeptNo').selectpicker('refresh');
|
|
|
- var userIdCode=localStorage.getItem("userIdCode");
|
|
|
- var deptNo=localStorage.getItem(userIdCode);
|
|
|
- if(deptNo!=null && deptNo!=""){
|
|
|
+ var userIdCode = localStorage.getItem("userIdCode");
|
|
|
+ var deptNo = localStorage.getItem(userIdCode);
|
|
|
+ if (deptNo != null && deptNo != "") {
|
|
|
$('#clinicDeptNo').selectpicker('val', deptNo);
|
|
|
$('#clinicDeptNo').selectpicker('refresh');
|
|
|
}
|
|
@@ -3936,7 +3981,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
|
|
|
//当前处方选项卡下标
|
|
|
var xyTabIndex = $("#xyTab li.active").index();
|
|
|
//组号
|
|
|
- var groupId = $("#groupId").val();
|
|
|
+ var groupId = parseInt($("#groupId").val());
|
|
|
if (gropuIdAndOrderNoMap == null) {
|
|
|
gropuIdAndOrderNoMap = new Map();
|
|
|
}
|
|
@@ -4030,7 +4075,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
|
|
|
}
|
|
|
var manufactoryName = $("#manufactoryName").val();
|
|
|
var html = '<div class="form-group">';
|
|
|
- html += groupId + '.<span style="margin-left: 5px"></span>';
|
|
|
+ html += '<span class="groupId">' + groupId + '</span>' + '.<span style="margin-left: 5px"></span>';
|
|
|
html += westernMedicineNamme;
|
|
|
if (manufactoryName != null && manufactoryName != 'null' && manufactoryName != "") {
|
|
|
html += "(" + manufactoryName + ")"
|
|
@@ -4138,7 +4183,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
|
|
|
if (calculateTotalAmountFlag) {
|
|
|
//设置总金额
|
|
|
calculateTotalAmount(true);
|
|
|
- resetGroupIdSelect()
|
|
|
+ resetGroupIdSelect();
|
|
|
}
|
|
|
//判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
|
|
|
var groupIdLast = $("#groupId option:last-child").text();
|
|
@@ -4903,13 +4948,13 @@ function saveZyReq(messageFlag) {
|
|
|
html += "]";
|
|
|
}
|
|
|
if (admissStatusText != null) {
|
|
|
- html += " "+admissStatusText;
|
|
|
+ html += " " + admissStatusText;
|
|
|
}
|
|
|
if (conditionCodeText != null) {
|
|
|
- html += " "+conditionCodeText;
|
|
|
+ html += " " + conditionCodeText;
|
|
|
}
|
|
|
if (routeOfAdmissionText != null) {
|
|
|
- html += " "+routeOfAdmissionText;
|
|
|
+ html += " " + routeOfAdmissionText;
|
|
|
}
|
|
|
|
|
|
html += ' 侯床';
|
|
@@ -6437,7 +6482,7 @@ function loadYpList(index, event) {
|
|
|
$('#' + MedicineName).webuiPopover('hide');
|
|
|
if (index == 0) {
|
|
|
clearWesternMedicine(false);
|
|
|
- checkYpInfo(row.code, row.serial, row.ypType, true, null,3);
|
|
|
+ checkYpInfo(row.code, row.serial, row.ypType, true, null, 3);
|
|
|
}
|
|
|
if (index == 1) {
|
|
|
checkZyInfo(row.code, row.serial, true);
|
|
@@ -6456,7 +6501,7 @@ function loadYpList(index, event) {
|
|
|
* @param orderNo 处方号,回写的时候需要用,因为有的处方没有满5个
|
|
|
* @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
|
|
|
*/
|
|
|
-function checkYpInfo(code, serial, groupNo, needNotice, orderNo,type) {
|
|
|
+function checkYpInfo(code, serial, groupNo, needNotice, orderNo, type) {
|
|
|
//判断是否有重复的项目 返回true 说明有重复的
|
|
|
if (verifyRepeat(code, serial, null, 0)) {
|
|
|
return;
|
|
@@ -6516,7 +6561,7 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo,type) {
|
|
|
//$("#xyTab").find("a[href='#" + tableId + "']").off("click").click();
|
|
|
//因为存在没有满5个的处方页,直接保存到该页
|
|
|
needAddTable = false;
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -6536,14 +6581,14 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo,type) {
|
|
|
$("#messageButton").off("click").on("click", function (t) {
|
|
|
$("#messageModal").modal("hide");
|
|
|
refreshNavTabs(0, groupNo, orderNo);
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
// //选中药品后,光标默认到用法
|
|
|
// $("#supplyType").next().click();
|
|
|
});
|
|
|
$("#cancelButton").off("click");
|
|
|
} else {
|
|
|
refreshNavTabs(0, groupNo, orderNo);
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
}
|
|
|
}
|
|
|
//当前编辑的处方非普通西药处方
|
|
@@ -6554,12 +6599,12 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo,type) {
|
|
|
$("#messageButton").off("click").on("click", function (t) {
|
|
|
$("#messageModal").modal("hide");
|
|
|
refreshNavTabs(0, groupNo, orderNo);
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
});
|
|
|
$("#cancelButton").off("click");
|
|
|
} else {
|
|
|
refreshNavTabs(0, groupNo, orderNo);
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
}
|
|
|
} else {
|
|
|
//修改药品
|
|
@@ -6580,10 +6625,10 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo,type) {
|
|
|
} else {
|
|
|
refreshNavTabs(0, groupNo, orderNo);
|
|
|
}
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
} else {
|
|
|
$("#xyTab li.active").find("a").find("small.cfdesc").text("(" + cfdesc + ")");
|
|
|
- fitWesternMedicine(res, groupNo,type);
|
|
|
+ fitWesternMedicine(res, groupNo, type);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -7500,9 +7545,9 @@ function autoAddGroupId(res) {
|
|
|
* @param groupNo
|
|
|
* @param type 操作类型 0 修改 1 医疗范文 2 就诊详情 3 处方开立
|
|
|
*/
|
|
|
-function fitWesternMedicine(res, groupNo,type) {
|
|
|
+function fitWesternMedicine(res, groupNo, type) {
|
|
|
hintProjectSelfPayInfo(res.data.selfpayProp, "药品");
|
|
|
- if(type!=0){
|
|
|
+ if (type != 0) {
|
|
|
//处方修改的时候不改变组号
|
|
|
autoAddGroupId(res);
|
|
|
}
|
|
@@ -8230,8 +8275,8 @@ function getParamsForpPrescription(type) {
|
|
|
jsonData.patientId = $("#patientId").text();
|
|
|
var userIdCode = localStorage.getItem("userIdCode");
|
|
|
var visitDeptCode = localStorage.getItem(userIdCode);
|
|
|
- if(visitDeptCode==null){
|
|
|
- visitDeptCode="";
|
|
|
+ if (visitDeptCode == null) {
|
|
|
+ visitDeptCode = "";
|
|
|
}
|
|
|
jsonData.firstOrNot = visitDeptCode;
|
|
|
jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
|