Prechádzať zdrojové kódy

门诊停用处方回调和模板调用不能调出

hurugang 2 rokov pred
rodič
commit
1302f3559b

+ 22 - 5
src/main/java/cn/hnthyy/thmz/controller/mz/YpZdDictController.java

@@ -1,11 +1,11 @@
 package cn.hnthyy.thmz.controller.mz;
 
 import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
-import cn.hnthyy.thmz.service.his.yp.YpZdDeptService;
-import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
-import cn.hnthyy.thmz.service.his.yp.YpZdManufactoryService;
-import cn.hnthyy.thmz.service.his.yp.YpZdSupplyService;
+import cn.hnthyy.thmz.enums.YesNoEnum;
+import cn.hnthyy.thmz.service.his.yp.*;
+import cn.hnthyy.thmz.vo.YpBaseYfVo;
 import cn.hnthyy.thmz.vo.YpZdDictVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -28,17 +28,20 @@ public class YpZdDictController {
     private YpZdSupplyService ypZdSupplyService;
     @Autowired
     private YpZdDeptService ypZdDeptService;
+    @Autowired
+    private YpBaseYfService ypBaseYfService;
 
     /**
      * 根据药品编码和规格查询药品信息
      * @param code 药品编码
      * @param serial 药品规格
      * @param deptNo 当前患者就诊科室
+     * @param groupNo 药房编码
      * @return
      */
     @UserLoginToken
     @RequestMapping(value = "/getYpZdDictByCodeAndSerial", method = {RequestMethod.GET})
-    public Map<String, Object> getYpZdDictByCodeAndSerial(@RequestParam("code") String code, @RequestParam("serial") String serial, @RequestParam("deptNo") String deptNo) {
+    public Map<String, Object> getYpZdDictByCodeAndSerial(@RequestParam("code") String code, @RequestParam("serial") String serial, @RequestParam("deptNo") String deptNo, @RequestParam("groupNo") String groupNo) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (StringUtils.isBlank(code)) {
@@ -57,6 +60,20 @@ public class YpZdDictController {
                 resultMap.put("message", "未查询到符合条件的药品");
                 return resultMap;
             }
+            if(YesNoEnum.YES.code.toString().equals(ypZdDict.getDelFlag())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "该药品已经停用");
+                return resultMap;
+            }
+            if(Constants.XY_ZCY_GROUP_NO.equals(groupNo) && Constants.CLF.equals(ypZdDict.getBillItemMz())){
+                groupNo=Constants.YC_GROUP_NO;
+            }
+            YpBaseYfVo ypBaseYfVo=ypBaseYfService.queryYpBaseYfVoByChargeCodeAndSerialAndGroupNo(code,serial,groupNo);
+            if (ypBaseYfVo ==null || YesNoEnum.YES.code.toString().equals(ypBaseYfVo.getVisibleFlagMz())) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "未查询到符合条件的药品");
+                return resultMap;
+            }
            int num=ypZdDeptService.queryCountByCodedAndDept(code,deptNo);
             if (num >0) {
                 resultMap.put("code", -1);

+ 11 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpBaseYfMapper.java

@@ -271,4 +271,15 @@ public interface YpBaseYfMapper {
             "       x.charge_code=#{chargeCode} and" +
             "       x.group_no =#{groupNo}")
     Double selectLargeStockAmount(@Param("chargeCode") String chargeCode, @Param("groupNo") String groupNo);
+
+
+    /**
+     * 根据药品编码和规格与药房查询药品基础信息
+     * @param chargeCode
+     * @param serial
+     * @param groupNo
+     * @return
+     */
+    @Select("select * from yp_base_yf WITH(NOLOCK) where charge_code=#{chargeCode} and serial=#{serial} and group_no =#{groupNo}")
+    YpBaseYfVo selectYpBaseYfVoByChargeCodeAndSerialAndGroupNo(@Param("chargeCode") String chargeCode,@Param("serial") String serial, @Param("groupNo") String groupNo);
 }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/yp/YpBaseYfService.java

@@ -62,4 +62,13 @@ public interface YpBaseYfService {
      * @return
      */
     List<YpBaseYfVo> queryYpByChargeCodeAndGroupNo(String chargeCode,String groupNo);
+
+    /**
+     * 根据药品编码和规格与药房查询药品基础信息
+     * @param chargeCode
+     * @param serial
+     * @param groupNo
+     * @return
+     */
+    YpBaseYfVo queryYpBaseYfVoByChargeCodeAndSerialAndGroupNo(String chargeCode,String serial,String groupNo);
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseYfServiceImpl.java

@@ -202,4 +202,9 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
     public List<YpBaseYfVo> queryYpByChargeCodeAndGroupNo(String chargeCode, String groupNo) {
         return ypBaseYfMapper.selectYpByChargeCodeAndGroupNo(chargeCode, groupNo);
     }
+
+    @Override
+    public YpBaseYfVo queryYpBaseYfVoByChargeCodeAndSerialAndGroupNo(String chargeCode, String serial, String groupNo) {
+        return ypBaseYfMapper.selectYpBaseYfVoByChargeCodeAndSerialAndGroupNo(chargeCode,serial,groupNo);
+    }
 }

+ 29 - 10
src/main/resources/static/js/mz/clinic.js

@@ -522,7 +522,7 @@ $(function () {
                         var tableData = $("#tb_table_chinese_medicine").bootstrapTable('getData');
                         if (tableData != null && tableData.length > 0 && dataIndex != null) {
                             var trData = tableData[dataIndex];
-                            checkZyInfo(trData.code, trData.serial, true);
+                            checkZyInfo(trData.code, trData.serial, $("#zyClassType").val(), true);
                             $("#chinese_medicine_name").click();
                         }
                     } else {
@@ -2746,13 +2746,13 @@ function resetNewGroupId(type) {
                         }
                         $(formGroups[j]).find("span.groupId").text(newGroupId);
                         $(formGroups[j]).find("input.temporary_items_groupId").val(newGroupId);
-                        var map = groupIdMap.get(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);
+                            groupIdMap.put(newGroupId + '', map);
                         }
                         if (prevGroupId == null || tempGroupId != prevGroupId) {
                             prevGroupId = tempGroupId;
@@ -3024,7 +3024,7 @@ function editPrescription(jsonData, type) {
                     continue;
                 }
                 //中药与颗粒剂
-                checkZyInfo(code, serial, false);
+                checkZyInfo(code, serial, groupNo, false);
                 //类型
                 $("#zyClassType").selectpicker('val', groupNo);
                 $('#zyClassType').selectpicker('refresh');
@@ -4308,7 +4308,7 @@ function editWesternMedicine(obj) {
     $("#categoriesFlag").val($(parentObject).find("input.temporary_items_categoriesFlag").val());
     $.ajax({
         type: "GET",
-        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo"),
+        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=71",
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -6485,7 +6485,7 @@ function loadYpList(index, event) {
                 checkYpInfo(row.code, row.serial, row.ypType, true, null, 3);
             }
             if (index == 1) {
-                checkZyInfo(row.code, row.serial, true);
+                checkZyInfo(row.code, row.serial, $("#zyClassType").val(), true);
             }
         }
     });
@@ -6511,7 +6511,7 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo, type) {
     //$("#treeButton").webuiPopover('hide');
     $.ajax({
         type: "GET",
-        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo"),
+        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=71",
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -6662,16 +6662,17 @@ function hintProjectSelfPayInfo(selfpayProp, projectDesc) {
  * 按照药品的编码 和药品拆零规格查询药品信息 中药
  * @param code
  * @param serial
+ * @param groupNo 药房信息
  * @param async 当用户操作的时候 true 异步, 范文和处方回写的时候false同步 因为需要等数据加载完才能设置对应的值
  */
-function checkZyInfo(code, serial, async) {
+function checkZyInfo(code, serial, groupNo, async) {
     //判断是否有重复的项目  返回true 说明有重复的
     if (verifyRepeat(code, serial, null, 1)) {
         return;
     }
     $.ajax({
         type: "GET",
-        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo"),
+        url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial + "&deptNo=" + localStorage.getItem("currentDeptNo") + "&groupNo=" + groupNo,
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -9731,13 +9732,31 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                         $("#jcReqTz").text(tz);
                         $("#jcReqReqDept").text(res.deptName);
                         $("#jcReqReqDoctor").text(res.doctorName);
+
+                        // $("#patientIdJyReq").text(mzPatientMi.patientId);
+                        // $("#patientNameJyReq").text(mzPatientMi.name);
+                        // $("#patientGenderJyReq").text(mzPatientMi.gender);
+                        // $("#patientAgeJyReq").text(mzPatientMi.ageString);
+                        // $("#patientCardNoJyReq").text(mzPatientMi.icCardNo);
+                        // $("#responseTypeJyReq").text(mzPatientMi.responseTypeName);
+                        // $("#icdTextJyReq").text(res.data.icdText);
+                        // $("#jyReqEmrChiefComplaint").text(mzBlRecord.emrChiefComplaint);
+                        // $("#jyReqHis").text(mzBlRecord.emrHpi);
+                        // $("#jyReqTz").text(tz);
+                        // $("#jyReqReqDept").text(res.deptName);
+                        // $("#jyReqReqDoctor").text(res.doctorName);
+
                         for (var i = 0; i < mzYjReqList.length; i++) {
                             var mzYjReq = mzYjReqList[i];
+                            if (mzYjReq == null) {
+                                continue;
+                            }
                             if (i == 0) {
                                 var dateStr = format(mzYjReq.reqDate, "yyyy-MM-dd");
                                 $("#jcReqReqDate").text(dateStr);
+                                // $("#jyReqReqDoctor").text(dateStr);
                             }
-                            if (mzYjReq == null || mzYjReq.reqType == 2) {
+                            if (mzYjReq.reqType == 2) {
                                 continue;
                             }
                             if ((i == 0 && index > 0) || i > 0) {