Bläddra i källkod

诊疗处方开立完成

hurugang 4 år sedan
förälder
incheckning
4f23d7b41f

+ 7 - 6
src/main/java/cn/hnthyy/thmz/entity/his/mz/JyZdItem.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 import java.math.BigDecimal;
 
+
 /**
  * 检验字典
  */
@@ -42,10 +43,10 @@ public class JyZdItem {
     //执行科室名称
     private String execUnitName;
 
-//    //规格 非数据库字段 是诊疗查询的时候需要用
-//    private String specification;
-//    //单价 非数据库字段 是诊疗查询的时候需要用
-//    private BigDecimal chargeAmount;
-//    //项目说明 非数据库字段 是诊疗查询的时候需要用
-//    private String ybComment;
+    //规格 非数据库字段 是诊疗查询的时候需要用
+    private String specification;
+    //单价 非数据库字段 是诊疗查询的时候需要用
+    private BigDecimal chargeAmount;
+    //项目说明 非数据库字段 是诊疗查询的时候需要用
+    private String ybComment;
 }

+ 34 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zd/ZdChargeItemMapper.java

@@ -1,5 +1,6 @@
 package cn.hnthyy.thmz.mapper.his.zd;
 
+import cn.hnthyy.thmz.entity.his.mz.JyZdItem;
 import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 import cn.hnthyy.thmz.pageDto.ZdChargeItemDto;
 import org.apache.ibatis.annotations.Insert;
@@ -257,4 +258,37 @@ public interface ZdChargeItemMapper {
     List<ZdChargeItem> selectAllInUsedZdCharge();
 
 
+
+    /**
+     * 根据通用查询参数查询诊疗项目
+     * @param commonParams
+     * @param letterParamsUpperCase 字母大写参数  因为老系统区分大小写,但是又不能改数据库结构,所以需要兼容
+     * @param letterParamsLowerCase 字母小写参数  因为老系统区分大小写,但是又不能改数据库结构,所以需要兼容
+     * @param pageSize 查询的数据条数
+     * @return
+     */
+    @Select({
+            "<script>",
+            "SELECT  distinct ",
+            "<when test='pageSize!=null'>",
+            " top ${pageSize} ",
+            "</when>",
+            "  code=rtrim(code),name,specification=charge_unit,charge_amount,manufactory=yb_comment,exec_unit,group_no='00'   ",
+            "    FROM zd_charge_item (nolock)  ",
+            "where  1=1 ",
+            "<when test='commonParams!=null'>",
+            " and (py_code like #{commonParams} or d_code  like #{commonParams} or code like #{commonParams} or name like #{commonParams} or class_code like #{commonParams}",
+            "<when test='letterParamsLowerCase!=null'>",
+            " or py_code like #{letterParamsLowerCase} or d_code  like #{letterParamsLowerCase} or code like #{letterParamsLowerCase} or name like #{letterParamsLowerCase}  ",
+            "</when>",
+            "<when test='letterParamsUpperCase!=null'>",
+            " or py_code like #{letterParamsUpperCase} or d_code  like #{letterParamsUpperCase} or code like #{letterParamsUpperCase} or name like #{letterParamsUpperCase}  ",
+            "</when>",
+            ") ",
+            "</when>",
+          /*  " order by stock_amount_virtual desc",*/
+            "</script>"})
+    List<JyZdItem> selectZlByCommonParams(@Param("commonParams") String commonParams, @Param("letterParamsLowerCase") String letterParamsLowerCase, @Param("letterParamsUpperCase") String letterParamsUpperCase, @Param("pageSize") Integer pageSize);
+
+
 }

+ 6 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/JcJyItemChargeServiceImpl.java

@@ -51,6 +51,12 @@ public class JcJyItemChargeServiceImpl implements JcJyItemChargeService {
             commonParams = "%" + commonParams.toUpperCase() + "%";
         }
         List<JyZdItem> jyZdItemList = jcJyItemChargeMapper.selectJcJyItemByCommonParams(commonParams);
+        List<JyZdItem> zlList = zdChargeItemMapper.selectZlByCommonParams(commonParams, null, null,20);
+        if(jyZdItemList==null){
+            jyZdItemList=zlList;
+        }else {
+            jyZdItemList.addAll(zlList);
+        }
         if (jyZdItemList != null && jyZdItemList.size() > 0) {
             jyZdItemList.stream().forEach(j -> {
                 if (StringUtils.isNotBlank(j.getExecUnit())) {

+ 3 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/MzZdYpYshServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.his.zd.MzZdYpYsh;
 import cn.hnthyy.thmz.enums.UnitTypeEnum;
 import cn.hnthyy.thmz.mapper.his.zd.MzZdYpYshMapper;
+import cn.hnthyy.thmz.mapper.his.zd.ZdChargeItemMapper;
 import cn.hnthyy.thmz.service.his.zd.MzZdYpYshService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -19,6 +20,7 @@ public class MzZdYpYshServiceImpl implements MzZdYpYshService {
     @Autowired
     private MzZdYpYshMapper mzZdYpYshMapper;
 
+
     @Override
     public List<MzZdYpYsh> queryMzZdYpYshByCommonParamsAndGroupNo(String commonParams, String groupNo) {
         String letterLowerParamsCase = null;
@@ -57,7 +59,7 @@ public class MzZdYpYshServiceImpl implements MzZdYpYshService {
                     }
                 } catch (Exception e) {
                     m.setDrugWinDesc("1");
-                    log.error("设置药品记录描述出错,药品规格是{}", m.getSpecification());
+                    log.info("设置药品记录描述出错,药品规格是{}", m.getSpecification());
                 }
             });
         }

+ 47 - 6
src/main/resources/static/js/mz/clinic.js

@@ -1770,7 +1770,9 @@ function saveJyJcItem() {
     html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
     html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
     html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(2,this)"></i>';
-    html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\')"></i>';
+    if($("#jcJyItemChargeDetail").hasClass("in")){
+        html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\')"></i>';
+    }
     html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
     html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
     html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
@@ -1846,6 +1848,11 @@ function removeYpOrProject(index, obj) {
         if(index == 0){
             //西药被清空后,重置药房类型编码
             $(tableId).find("input.current_groupNo").val(null);
+            //当本处方内容都被删除完后,也删除处方table
+            $("#" + tabId).find("a[href=\""+tableId+"\"]").parent().remove();
+            $(tableId).remove();
+            //切换处方 最后一个被选中
+            $("#" + tabId).find("li:last > a").off("click").tab('show');
         }else if (index == 1) {
             //当中药处方被清空完后,重置当前中药类型为空
             $("#current_zyClassType").val(null);
@@ -2042,6 +2049,8 @@ function clearJyJcItem() {
     $("#jcjyItemPrice").val(null);
     //备注
     $("#remark").val(null);
+    //描述
+    $("#chargeUnit").val(null);
 }
 
 /**
@@ -3192,6 +3201,9 @@ function checkYpInfo(code, serial, groupNo) {
                             } else if (groupNo == '131') {
                                 message = "精二药物需要单独处方,是否需要新增处方?"
                             }
+                            // else if(groupNo=='151'){
+                            //     message = "诊疗项目需要单独处方,是否需要新增处方?"
+                            // }
                             $("#messageModal").modal();
                             $("#messageContent").html(message);
                             $("#messageButton").off("click").on("click", function (t) {
@@ -3202,6 +3214,22 @@ function checkYpInfo(code, serial, groupNo) {
                         }
                         //当前编辑的处方非普通西药处方
                     } else {
+                        //如果
+                        if($("#xyTab").find("li") ==null || $("#xyTab").find("li").length==0){
+                            initNavTabs(0);
+                        }
+                        var cfdesc='普药';
+                        if(groupNo=='91'){
+                            cfdesc='医材';
+                        }else if(groupNo=='111'){
+                            cfdesc='麻、精一';
+                        }else if(groupNo=='131'){
+                            cfdesc='精二';
+                        }
+                        // else if(groupNo=='151'){
+                        //     cfdesc='诊疗';
+                        // }
+                        $("#xyTab li.active").find("a").find("small.cfdesc").text("("+cfdesc+")");
                         fitWesternMedicine(res);
                     }
                 }
@@ -3363,6 +3391,16 @@ function loadjcJyItemList() {
         },
         onClickRow: function (row, $element) {
             $('#jcJyItem').webuiPopover('hide');
+            if(row.chargeAmount!=null){
+                $("#jcJyItem").val(row.name);
+                $("#jcJyItem").blur();
+                $("#jcjyItemPrice").val(row.chargeAmount);
+                $("#chargeUnit").val(row.specification);
+                $("#current_code").val(row.code);
+                $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
+                return;
+            }
+            $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
             checkJcJyItemInfo(row.code, row.name);
         }
     });
@@ -3621,10 +3659,10 @@ function initNavTabs(index) {
         tabId = "zlTab";
         tabContentId = "zlTabContent";
         paneId = "zlcf_1";
-        cfdesc='医技';
+        cfdesc='医技与诊疗';
     }
     if ($("#" + tabId).children().length == 0) {
-        $("#" + tabId).append('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方一 <small>('+cfdesc+')</small></a></li>');
+        $("#" + tabId).append('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方一 <small class="cfdesc">('+cfdesc+')</small></a></li>');
         var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
         html += '<input class="current_groupNo" type="hidden"/>';
         html += '                   <div class="cf_content rb_item" style="height: 250px;padding-top: 5px;"></div>' +
@@ -3693,7 +3731,7 @@ function initNavTabs(index) {
 /**
  * 添加处方分页
  * @param index 0 西药 1 中药 2 诊疗
- * @param groupNo 71 普通西药  91 医材  111 麻、精一  131 精二
+ * @param groupNo 71 普通西药  91 医材  111 麻、精一  131 精二  151 诊疗
  */
 function refreshNavTabs(index,groupNo) {
     var tabId = null;
@@ -3712,6 +3750,9 @@ function refreshNavTabs(index,groupNo) {
         }else if(groupNo=='131'){
             cfdesc='精二';
         }
+        // else if(groupNo=='151'){
+        //     cfdesc='诊疗';
+        // }
     } else if (index == 1) {
         //中草药
         tabId = "zyTab";
@@ -3723,7 +3764,7 @@ function refreshNavTabs(index,groupNo) {
         tabId = "zlTab";
         tabContentId = "zlTabContent";
         paneIdPrfix = "zlcf_";
-        cfdesc='医技';
+        cfdesc='医技与诊疗';
     }
     // var tableId = $("#"+tabId+" li.active").find("a").attr("href");
     // var length = $(tableId).find("div:eq(0)").children().length;
@@ -3733,7 +3774,7 @@ function refreshNavTabs(index,groupNo) {
     // }
     var childrens = $("#" + tabId).children().length;
     childrens++;
-    var cfTitle = "处方" + numToChineseNum(childrens)+" <small>("+cfdesc+")</small>";
+    var cfTitle = "处方" + numToChineseNum(childrens)+" <small class=\"cfdesc\">("+cfdesc+")</small>";
     var paneId = paneIdPrfix + childrens;
     //清除选中的样式
     $("#" + tabId).find("li.active").removeClass("active");

+ 9 - 9
src/main/resources/templates/mz/clinic.html

@@ -413,13 +413,13 @@
                     <div class="item form-group">
                         <div class="btn-group" id="bill_item_group" style="float: left">
                             <button class="btn btn-sm btn-primary" type="button" onclick="billItemButtonChange(this,0)">
-                                &nbsp;&nbsp;西成药与诊疗&nbsp;&nbsp;
+                                &nbsp;&nbsp;西成药&nbsp;&nbsp;
                             </button>
                             <button class="btn btn-sm btn-default" type="button" onclick="billItemButtonChange(this,1)">
                                 &nbsp;&nbsp;中草药&nbsp;&nbsp;
                             </button>
                             <button class="btn btn-sm btn-default" type="button" onclick="billItemButtonChange(this,2)">
-                                &nbsp;&nbsp;医技&nbsp;&nbsp;
+                                &nbsp;&nbsp;医技与诊疗&nbsp;&nbsp;
                             </button>
                             <!--<button class="btn btn-sm btn-default" type="button" onclick="billItemButtonChange(this)">&nbsp;&nbsp;麻、精一&nbsp;&nbsp;-->
                             <!--</button>-->
@@ -662,12 +662,12 @@
                                         <input type="text" class="form-control my_label_input_2" id="jcjyItemPrice"
                                                style="padding-left: 10px;" readonly>
                                     </div>
-                                    <!--<div style="width: 256px;float: left;">-->
-                                        <!--<label class="my_label">总量<span-->
-                                                <!--class="required">*</span>:</label>-->
-                                        <!--<input type="text" class="form-control my_label_input_2" id="symptom120"-->
-                                               <!--style="padding-left: 10px;" required="required">-->
-                                    <!--</div>-->
+                                    <div style="width: 256px;float: left;">
+                                        <label class="my_label">描述<span
+                                                class="required">*</span>:</label>
+                                        <input type="text" class="form-control my_label_input_2" id="chargeUnit"
+                                               style="padding-left: 10px;" required="required">
+                                    </div>
                                 </div>
                                 <!--<div class="item form-group">-->
                                 <!--<div style="width: 100%">-->
@@ -687,7 +687,7 @@
                                     <div style="float: left;display: inline-block;"><a onclick="clearJyJcItem()"
                                                                                        style="cursor: pointer;font-size: 14px;color: #2e69eb!important;"><i
                                             class="fa fa-trash">&nbsp;&nbsp;清空</i></a>
-                                        <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-left: 20px;" onclick="getJcJyItemChargeByCode(null)"><i
+                                        <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-left: 20px;" onclick="getJcJyItemChargeByCode(null)" id="jcJyItemChargeDetail" class="hide"><i
                                                 class="fa fa-eye">&nbsp;&nbsp;查看明细</i></a>
                                     </div>