|
@@ -266,6 +266,7 @@ $(function () {
|
|
|
|
|
|
initYshPart();
|
|
|
initJyZdSample();
|
|
|
+ initClinicDeptNo();
|
|
|
setTimeout(function () {
|
|
|
getLodop();
|
|
|
}, 800);
|
|
@@ -819,6 +820,12 @@ $(function () {
|
|
|
|
|
|
});
|
|
|
|
|
|
+/**
|
|
|
+ * 打开科室选择页面
|
|
|
+ */
|
|
|
+function selectDeptModal() {
|
|
|
+ $("#selectDeptModal").modal("show");
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 打开配置页面
|
|
@@ -906,7 +913,7 @@ function groupIdChange() {
|
|
|
//var last = parseInt($("#groupId > option:last").val());
|
|
|
var groupId = $("#groupId").val();
|
|
|
var keys = groupIdMap.keySet();
|
|
|
- if (keys.indexOf(groupId)<0) {
|
|
|
+ if (keys.indexOf(groupId) < 0) {
|
|
|
//是新增药品清空药品输入区域
|
|
|
var updateFlag = $("#western_medicine_update_flag").val();
|
|
|
var currentCode = $("#western_medicine_current_code").val();
|
|
@@ -1990,9 +1997,11 @@ function realClinicalReception(patientId, serialNo, reqType) {
|
|
|
if (turnToConsultationIdInClick == null || turnToConsultationIdInClick == "null") {
|
|
|
turnToConsultationIdInClick = 0;
|
|
|
}
|
|
|
+ var userIdCode=localStorage.getItem("userIdCode");
|
|
|
+ var deptNo=localStorage.getItem(userIdCode);
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
- url: '/thmz/saveClinic?patientId=' + patientId + "&serialNo=" + serialNo + "&turnToConsultationId=" + turnToConsultationIdInClick,
|
|
|
+ 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")},
|
|
@@ -3736,6 +3745,38 @@ function initJyZdSample() {
|
|
|
}
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 初始化当前医生说书科室
|
|
|
+ */
|
|
|
+function initClinicDeptNo() {
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getUnitCodeByCurrentUser',
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ $.each(res.data, function (commentIndex, comment) {
|
|
|
+ html += '<option value="' + comment.code + '">' + comment.name + '</option>';
|
|
|
+ });
|
|
|
+ $('#clinicDeptNo').empty();
|
|
|
+ $('#clinicDeptNo').html(html);
|
|
|
+ $('#clinicDeptNo').selectpicker('refresh');
|
|
|
+ var userIdCode=localStorage.getItem("userIdCode");
|
|
|
+ var deptNo=localStorage.getItem(userIdCode);
|
|
|
+ if(deptNo!=null && deptNo!=""){
|
|
|
+ $('#clinicDeptNo').selectpicker('val', deptNo);
|
|
|
+ $('#clinicDeptNo').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 保存当前药品到右边处方区域
|
|
|
* @param index 0 西药 1中药 2 诊疗和社备
|
|
@@ -3759,7 +3800,7 @@ function saveWesternMedicineWithCheck(calculateTotalAmountFlag, orderNoParmams)
|
|
|
var updateFlag = $("#western_medicine_update_flag").val();
|
|
|
if (updateFlag == "true" || updateFlag == true) {
|
|
|
saveWesternMedicine(calculateTotalAmountFlag);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//当前药房编码
|
|
|
var currentGroupNo = $("#current_groupNo").val();
|
|
|
if ($("#xyTab").find("li") == null || $("#xyTab").find("li").length == 0) {
|
|
@@ -3844,14 +3885,14 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
|
|
|
//药品名称
|
|
|
var westernMedicineNamme = $("#western_medicine_name").val();
|
|
|
var tableId = $("#xyTab li.active").find("a").attr("href");
|
|
|
- if(tableId==undefined){
|
|
|
+ if (tableId == undefined) {
|
|
|
refreshNavTabs(0, currentGroupNo, null);
|
|
|
tableId = $("#xyTab li.active").find("a").attr("href");
|
|
|
}
|
|
|
var thisGroupNo = $(tableId).find("input.current_groupNo").val();
|
|
|
- if(currentGroupNo!=thisGroupNo){
|
|
|
+ if (currentGroupNo != thisGroupNo) {
|
|
|
//91 医材
|
|
|
- var type="医材";
|
|
|
+ var type = "医材";
|
|
|
if (currentGroupNo == '71') {
|
|
|
type = "普通西成药"
|
|
|
} else if (currentGroupNo == '111') {
|
|
@@ -3859,7 +3900,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
|
|
|
} else if (currentGroupNo == '131') {
|
|
|
type = "精二药物"
|
|
|
}
|
|
|
- errorMesageSimaple("【"+westernMedicineNamme+"】是"+type+",无法保存到当前处方,请切换或者新增相应的处方进行保存。");
|
|
|
+ errorMesageSimaple("【" + westernMedicineNamme + "】是" + type + ",无法保存到当前处方,请切换或者新增相应的处方进行保存。");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -4863,17 +4904,17 @@ function removeYpOrProject(index, obj) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- var temporaryItemsGroupId= $(obj).parent().find("input.temporary_items_groupId").val();
|
|
|
- var temporaryItemsGroupIds=$(obj).parent().parent().find("input.temporary_items_groupId");
|
|
|
- if(temporaryItemsGroupIds!=null && temporaryItemsGroupIds.length>0){
|
|
|
- var count=0;
|
|
|
- for(var i=0;i<temporaryItemsGroupIds.length;i++){
|
|
|
- if(temporaryItemsGroupId==$(temporaryItemsGroupIds[i]).val()){
|
|
|
+ var temporaryItemsGroupId = $(obj).parent().find("input.temporary_items_groupId").val();
|
|
|
+ var temporaryItemsGroupIds = $(obj).parent().parent().find("input.temporary_items_groupId");
|
|
|
+ if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
|
|
|
+ var count = 0;
|
|
|
+ for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
|
|
|
+ if (temporaryItemsGroupId == $(temporaryItemsGroupIds[i]).val()) {
|
|
|
count++;
|
|
|
}
|
|
|
}
|
|
|
//当前删除的药品组号是最后一个的时候,清空缓存
|
|
|
- if(count==1){
|
|
|
+ if (count == 1) {
|
|
|
groupIdMap.remove(temporaryItemsGroupId);
|
|
|
gropuIdAndOrderNoMap.remove(temporaryItemsGroupId);
|
|
|
}
|
|
@@ -4898,7 +4939,7 @@ function removeYpOrProject(index, obj) {
|
|
|
$("#current_zyClassType").val(null);
|
|
|
}
|
|
|
}
|
|
|
- if(index==0){
|
|
|
+ if (index == 0) {
|
|
|
resetGroupIdMap();
|
|
|
}
|
|
|
}
|
|
@@ -4907,19 +4948,19 @@ function removeYpOrProject(index, obj) {
|
|
|
* 重置组号与用法、频率天数缓存关系
|
|
|
*/
|
|
|
function resetGroupIdMap() {
|
|
|
- var temporaryItemsGroupIds=$("#xyTabContent").find("input.temporary_items_groupId");
|
|
|
- if(temporaryItemsGroupIds!=null && temporaryItemsGroupIds.length>0){
|
|
|
- var list=[];
|
|
|
- for(var i=0;i<temporaryItemsGroupIds.length;i++){
|
|
|
- var groupId=$(temporaryItemsGroupIds[i]).val();
|
|
|
- if(list.indexOf(groupId)<0){
|
|
|
- list.push(groupId);
|
|
|
- }
|
|
|
+ var temporaryItemsGroupIds = $("#xyTabContent").find("input.temporary_items_groupId");
|
|
|
+ if (temporaryItemsGroupIds != null && temporaryItemsGroupIds.length > 0) {
|
|
|
+ var list = [];
|
|
|
+ for (var i = 0; i < temporaryItemsGroupIds.length; i++) {
|
|
|
+ var groupId = $(temporaryItemsGroupIds[i]).val();
|
|
|
+ if (list.indexOf(groupId) < 0) {
|
|
|
+ list.push(groupId);
|
|
|
+ }
|
|
|
}
|
|
|
var keys = groupIdMap.keySet();
|
|
|
- for(var i=0;i<keys.length;i++){
|
|
|
- var key=keys[i];
|
|
|
- if(list.indexOf(key)<0){
|
|
|
+ for (var i = 0; i < keys.length; i++) {
|
|
|
+ var key = keys[i];
|
|
|
+ if (list.indexOf(key) < 0) {
|
|
|
groupIdMap.remove(key);
|
|
|
}
|
|
|
}
|
|
@@ -8075,6 +8116,7 @@ function getParamsForpPrescription(type) {
|
|
|
}
|
|
|
var jsonData = JSON.parse('' +
|
|
|
'{"patientId": "",' +
|
|
|
+ '"visitDeptCode":"",' +
|
|
|
'"firstOrNot":"",' +
|
|
|
'"icdCode": "",' +
|
|
|
'"icdText": null,' +
|
|
@@ -8113,6 +8155,9 @@ function getParamsForpPrescription(type) {
|
|
|
'"readCardResult":"",' +
|
|
|
'"readCardType":"01"}');
|
|
|
jsonData.patientId = $("#patientId").text();
|
|
|
+ var userIdCode = localStorage.getItem("userIdCode");
|
|
|
+ var visitDeptCode = localStorage.getItem(userIdCode);
|
|
|
+ jsonData.firstOrNot = visitDeptCode;
|
|
|
jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
|
|
|
jsonData.icdCode = icdCode;
|
|
|
jsonData.serialNo = $("#mzfzSerialNoInClick").val();
|
|
@@ -9510,17 +9555,17 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
|
|
|
if (zlPrescription != null && zlPrescription.length > 0) {
|
|
|
var html = "";
|
|
|
for (var i = 0; i < zlPrescription.length; i++) {
|
|
|
- var zlPrescriptionTemp=zlPrescription[i];
|
|
|
+ var zlPrescriptionTemp = zlPrescription[i];
|
|
|
html += "<tr>";
|
|
|
- html += "<td colspan='2'>"+zlPrescriptionTemp.index+"."+zlPrescriptionTemp.name+"</td>";
|
|
|
+ html += "<td colspan='2'>" + zlPrescriptionTemp.index + "." + zlPrescriptionTemp.name + "</td>";
|
|
|
html += "<td style='text-align: right;padding-right: 15px;'>X</td>";
|
|
|
- html += "<td>总量:"+zlPrescriptionTemp.quantity+"</td>";
|
|
|
+ html += "<td>总量:" + zlPrescriptionTemp.quantity + "</td>";
|
|
|
html += "</tr>";
|
|
|
html += "<tr>";
|
|
|
html += "<td width='40%'></td>";
|
|
|
- html += "<td width='20%'>单量:"+zlPrescriptionTemp.drugQuan+"</td>";
|
|
|
- html += "<td width='20%'>频率:"+zlPrescriptionTemp.frequency+"</td>";
|
|
|
- html += "<td width='20%'>天数:"+zlPrescriptionTemp.orderDays+"天</td>";
|
|
|
+ html += "<td width='20%'>单量:" + zlPrescriptionTemp.drugQuan + "</td>";
|
|
|
+ html += "<td width='20%'>频率:" + zlPrescriptionTemp.frequency + "</td>";
|
|
|
+ html += "<td width='20%'>天数:" + zlPrescriptionTemp.orderDays + "天</td>";
|
|
|
html += "</tr>";
|
|
|
}
|
|
|
if (index > 0) {
|
|
@@ -10802,12 +10847,12 @@ function showMzBlRecordModal(patientId, times, type) {
|
|
|
$("#editObstericalHistory").val(mzBlRecord.obstericalHistory == null ? "" : mzBlRecord.obstericalHistory);
|
|
|
$("#editQtjc").val(mzBlRecord.emrPe == null ? "" : mzBlRecord.emrPe);
|
|
|
setSelectedAttr("editZd", mzBlRecord.icdCode, mzBlRecord.icdText);
|
|
|
- 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;
|
|
|
+ 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);
|
|
@@ -11613,3 +11658,17 @@ function printSelfPayCommon(printType) {
|
|
|
LODOP.PRINT_SETUP();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 将科室缓存到内存中
|
|
|
+ */
|
|
|
+function saveDeptConfig() {
|
|
|
+ var clinicDeptNo = $("#clinicDeptNo").val();
|
|
|
+ if (clinicDeptNo != null && clinicDeptNo != "") {
|
|
|
+ var userIdCode = localStorage.getItem("userIdCode");
|
|
|
+ localStorage.setItem(userIdCode, clinicDeptNo);
|
|
|
+ }
|
|
|
+ $("#selectDeptModal").modal("hide");
|
|
|
+
|
|
|
+}
|