Pārlūkot izejas kodu

口服药标签打印按单个药每次服用打印,口服单格式调整

WANGJIALIANG 2 gadi atpakaļ
vecāks
revīzija
8bd7290ac2

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yz/YzOrderFrequencyMapper.java

@@ -21,7 +21,7 @@ public interface YzOrderFrequencyMapper {
             "isnull(day_1800,0)day_1800,isnull(day_1830,0)day_1830,isnull(day_1900,0)day_1900,isnull(day_1930,0)day_1930,isnull(day_2000,0)day_2000,isnull(day_2030,0)day_2030,isnull(day_2100,0)day_2100,isnull(day_2130,0)day_2130,isnull(day_2200,0)day_2200," +
             "isnull(day_2230,0)day_2230,isnull(day_2300,0)day_2300,isnull(day_2330,0)day_2330,isnull(day_2400,0)day_2400,isnull(day_030,0)day_030,isnull(day_100,0)day_100,isnull(day_130,0)day_130,isnull(day_200,0)day_200,isnull(day_230,0)day_230,isnull(day_300,0)day_300," +
             "isnull(day_330,0)day_330,isnull(day_400,0)day_400,isnull(day_430,0)day_430,isnull(day_500,0)day_500,isnull(day_530,0)day_530,isnull(day_600,0)day_600,isnull(day_630,0)day_630,isnull(day_700,0)day_700,isnull(day_730,0)day_730,week_day," +
-            "comm,donot_modify,del_flag,print_name,sort_code,times,special_flag,self_buy,use_time" +
+            "rtrim(comm)comm,donot_modify,del_flag,rtrim(print_name)print_name,sort_code,times,special_flag,self_buy,use_time" +
             " from yz_order_frequency WITH(NOLOCK) where code=#{code}")
     YzOrderFrequency selectYzOrderFrequencyByCode(@Param("code") String code);
 }

+ 31 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zy/YpZyPatientMapper.java

@@ -1,6 +1,8 @@
 package cn.hnthyy.thmz.mapper.his.zy;
 
+import cn.hnthyy.thmz.entity.his.yz.YzYpPageNo;
 import cn.hnthyy.thmz.entity.his.zy.YpZyPatient;
+import cn.hnthyy.thmz.vo.YzYpPageNoVo;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -166,4 +168,33 @@ public interface YpZyPatientMapper {
             "update yp_zy_patient set manu_no=#{manuNo} where page_no = #{pageNo} and charge_code = #{chargeCode} and acct_sign != 2",
             "</script>"})
     int updateManuNo(YpZyPatient ypZyPatient);
+
+
+    /**
+     * 查询医嘱药品请领单
+     * @param yzYpPageNoVo
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT page_no,dept_code,ward_code,page_type,max(confirm_time)confirm_time," +
+                    "max(drawer) as submit_name,max(keeper) as contirm_id  from yp_zy_patient WITH(NOLOCK)" +
+            " where group_no = #{groupNo} " +
+            "<when test='pageNo!=null'>",
+            " and page_no =#{pageNo}",
+            "</when>",
+            "<when test='wardCode!=null'>",
+            " and ward_code =#{wardCode}",
+            "</when>",
+            "<when test='pageClass!=null'>",
+            " and page_type =#{pageClass}",
+            "</when>",
+            "<when test='submitBeginDate!=null'>",
+            " and confirm_time &gt;=#{submitBeginDate,jdbcType=TIMESTAMP}",
+            "</when>",
+            "<when test='submitEndDate!=null'>",
+            " and confirm_time &lt;=#{submitEndDate,jdbcType=TIMESTAMP}",
+            "</when>" +
+            " group by  page_no,dept_code,ward_code,page_type order by confirm_time desc"
+            , "</script>"})
+    List<YzYpPageNo> selectYzYpPageNo(YzYpPageNoVo yzYpPageNoVo);
 }

+ 13 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -6,10 +6,7 @@ import cn.hnthyy.thmz.entity.his.YzActOrder;
 import cn.hnthyy.thmz.entity.his.mz.Employee;
 import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
-import cn.hnthyy.thmz.entity.his.yz.YzActOrderCy;
-import cn.hnthyy.thmz.entity.his.yz.YzActOrderCyDetail;
-import cn.hnthyy.thmz.entity.his.yz.YzYpPageNo;
-import cn.hnthyy.thmz.entity.his.yz.YzYpZyOrder;
+import cn.hnthyy.thmz.entity.his.yz.*;
 import cn.hnthyy.thmz.entity.his.zd.ZdCommon;
 import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
 import cn.hnthyy.thmz.entity.his.zy.*;
@@ -118,10 +115,20 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
     @SuppressWarnings("all")
     @Autowired
     private YpMzFytjMapper ypMzFytjMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private YzOrderFrequencyMapper yzOrderFrequencyMapper;
 
     @Override
     public List<YzYpPageNoVo> queryYzYpPageNo(YzYpPageNoVo yzYpPageNoVo) {
         List<YzYpPageNoVo> yzYpPageNoVos = new ArrayList<>();
+        /*List<YzYpPageNo> yzYpPageNos = new ArrayList<>();
+        //查询已发状态药单在发药记录查询,解决同一药单存在已发和未发药品
+        if(yzYpPageNoVo.getSubmitFlag().equals("3")){
+            yzYpPageNos = ypZyPatientMapper.selectYzYpPageNo(yzYpPageNoVo);
+        }else{
+            yzYpPageNos = yzYpPageNoMapper.selectYzYpPageNo(yzYpPageNoVo);
+        }*/
         List<YzYpPageNo> yzYpPageNos = yzYpPageNoMapper.selectYzYpPageNo(yzYpPageNoVo);
         yzYpPageNos.forEach(yzYpPageNo -> {
             YzYpPageNoVo vo = new YzYpPageNoVo();
@@ -806,6 +813,8 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
                 }
                 if (yzActOrder.getDrugWeight() <= 0 || Double.parseDouble(dosage) < 1) {
                     dosage = NumberFormat.getInstance().format(yfWardVo.getDose()) + ypUnitName;
+                }else{
+                    dosage += mzPharmacyMapper.selectYpUnitName(ypZdDict.getPackUnit());
                 }
                 yfWardVo.setDosage(dosage);
                 APatientMi aPatientMi = aPatientMiMapper.selectPatientMiByInPatientNo(yfWardVo.getInpatientNo());

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/YfWardVo.java

@@ -211,4 +211,6 @@ public class YfWardVo {
     private String nationalCode;
     //发药批号
     private String manuNo;
+    //用药频率
+    private String comm;
 }

+ 52 - 7
src/main/resources/static/js/yf/ward_prescription.js

@@ -14,7 +14,7 @@ var lastcell;//最后编辑单元格的列
 var searchData = {};//搜索条件
 $(function () {
     init_daterangepicker();
-    $('#reportrange span').html(moment().subtract(10, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
+    $('#reportrange span').html(moment().subtract(5, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
     $(".selectpicker").selectpicker({
         dropuAuto: false
     });
@@ -41,7 +41,11 @@ $(function () {
     initTbTable();
     clearInterval(tableInterval);
     //五分钟刷新一次请领单列表数据
-    tableInterval = setInterval(initTbTable, 50000);
+    tableInterval = setInterval(function (){
+        if($("#submitFlagSearch").val() === "1"){
+            initTbTable()
+        }
+    }, 50000);
     initDynamicSelect("allUnitCode", "wardCode");
     //重置查询参数
     $('#btn_clean').click(function () {
@@ -180,8 +184,10 @@ function initButtonChange(object, realIndex) {
         $("#wardCode").removeAttr('disabled');
         $("#pageNoSearch").removeAttr('disabled');
         $("#pageClassSearch").removeAttr('disabled');
+        $("#submitFlagSearch").removeAttr('disabled');
         $("#wardCode").selectpicker('refresh');
         $("#pageClassSearch").selectpicker('refresh');
+        $("#submitFlagSearch").selectpicker('refresh');
         $("#btn_query").removeAttr('disabled');
         $("#btn_clean").removeAttr('disabled');
         $("#barCode").attr('disabled', true);
@@ -209,6 +215,7 @@ function setFrom() {
     $("#wardCode").attr('disabled', true);
     $("#pageNoSearch").attr('disabled', true);
     $("#pageClassSearch").attr('disabled', true);
+    $("#submitFlagSearch").attr('disabled', true);
     $("#btn_clean").attr('disabled', true);
     $("#btn_query").attr('disabled', true);
 }
@@ -542,7 +549,7 @@ function loadSummarizingTable() {
 }
 
 /**
- * 加载药单汇总信息表格
+ * 加载药单详细信息表格
  */
 function loadDetailTable() {
     initDetailHtml();
@@ -1306,7 +1313,7 @@ function printDetailHtml(datas, flag) {
             html += '<td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">年龄:' + getBirthSlot(data.birthDate, new Date()) + '</td>';
             html += '<td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">性别:' + getSex(data.sex) + '</td>';
             html += '<td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">身份:' + data.responceName + '</td>';
-            html += '<td colspan="7" class="xtd" style="text-align: left;border: transparent !important;">诊断:';
+            html += '<td colspan="8" class="xtd" style="text-align: left;border: transparent !important;">诊断:';
             if (data.admissDiagStr != null) {
                 html += data.admissDiagStr
             }
@@ -1371,7 +1378,7 @@ function printDetailHtml(datas, flag) {
             html += '<td class="xtd" style="text-align: center;">' + data.supplyName + '</td>';
             html += '<td class="xtd" style="text-align: center;">' + data.doctorNameStr + '</td>';
         }
-        html += '<td class="xtd" style="text-align: center;">' + (isEmpty(data.manuNo) ? "" : data.manuNo) + '</td>';
+        /*html += '<td class="xtd" style="text-align: center;">' + (isEmpty(data.manuNo) ? "" : data.manuNo) + '</td>';*/
         html += '</tr>';
         totalMoney += parseFloat(data.totalMoney);
     }
@@ -1466,9 +1473,47 @@ function printZyLabelData() {
     $('#zydybqModal').modal();
 }
 
+function printLabel(datas, isMx) {
+    LODOP = getLodop();
+    LODOP.PRINT_INITA(6, 0, "80mm", "60mm", "住院患者内服袋打印");
+    LODOP.SET_PRINT_PAGESIZE(1, "80mm", "60mm", "");
+    //设置打印机
+    LODOP.SET_PRINTER_INDEX(nfdPrintIndex);
+    LODOP.SET_PRINT_STYLE("FontSize", 10); //字体大小
+    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
+    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
+    var strStyle = "<style>table,td,th {border-width: 1px;" +
+        "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 16px}.xtd{border: 1px solid black;}</style>";
+    let tableDatas = getJQAllData(isMx == 1 ? "tb_detail_table" : "tb_summarizing_table");
+    for (var i = 0; i < datas.length; i++) {
+        let data = datas[i];
+        for (let j = 0; j < tableDatas.length; j++) {
+            if (tableDatas[j].fybz.indexOf("发药") != -1 && tableDatas[j].chargeCode == data.chargeCode
+                && tableDatas[j].serial == data.serial && (tableDatas[j].occTime == data.occTime || isMx == 0)) {
+                $(".inpatientNo").text($.trim(data.inpatientNo));
+                $(".bedNo").text($.trim(data.bedNo));
+                $(".name").text($.trim(data.name));
+                $(".age").text(getBirthSlot(data.birthDate, new Date()));
+                $(".sex").text(getSex(data.sex));
+                $(".occTime").text(format(data.occTime, "yyyy/MM/dd HH:mm"));
+                $(".drugName").text(data.drugName);
+                $(".specification").text(data.specification);
+                $(".dose").text(data.dose + data.doseUnit);
+                $(".dosage").text(data.dosage.replace(".0", ""));
+                break;
+            }
+        }
+        LODOP.ADD_PRINT_HTM("1mm", "3mm", "RightMargin:1mm", "BottomMargin:3mm", strStyle + document.getElementById("bqdy_table_div").innerHTML);
+        LODOP.NewPageA();
+    }
+    LODOP.PRINT();
+    /*LODOP.NewPageA();*/
+    //LODOP.PRINT_DESIGN();
+}
+
 /**
  * 打印标签
- */
+
 function printLabel(datas, isMx) {
     LODOP = getLodop();
     LODOP.PRINT_INITA(6, 0, "80mm", "60mm", "住院患者内服袋打印");
@@ -1548,7 +1593,7 @@ function printLabel(datas, isMx) {
         LODOP.PRINT();
         //LODOP.PRINT_DESIGN();
     }
-}
+}*/
 
 /**
  * 打印报表

+ 33 - 12
src/main/resources/templates/yf/ward_prescription.html

@@ -172,13 +172,13 @@
                         </tr>
                         <tr>
                             <td class="xtd zyh" style="text-align: center;width: 60px;">住院号</td>
-                            <td class="xtd" style="text-align: center;width: 60px;">姓名</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">姓名</td>
                             <td class="xtd" style="text-align: center;width: 40px;">床号</td>
-                            <td class="xtd" style="text-align: center;width: 150px;">药品名称</td>
+                            <td class="xtd" style="text-align: center;width: 170px;">药品名称</td>
                             <td class="xtd" style="text-align: center;width: 60px;">规格</td>
                             <td class="xtd" style="text-align: center;width: 40px;">请领量</td>
                             <td class="xtd" style="text-align: center;width: 40px;">发药量</td>
-                            <td class="xtd kfmxtd" style="text-align: center;width: 60px;">频率</td>
+                            <td class="xtd kfmxtd" style="text-align: center;width: 50px;">频率</td>
                             <td class="xtd kfmxtd" style="text-align: center;width: 40px;">剂量</td>
                             <td class="xtd kfmxtd" style="text-align: center;width: 40px;">单位</td>
                             <td class="xtd kfmxtd" style="text-align: center;width: 80px;">嘱托</td>
@@ -189,7 +189,7 @@
                             <td class="xtd yjmxtd" style="text-align: center;width: 60px;">零售价</td>
                             <td class="xtd yjmxtd" style="text-align: center;width: 80px;">金额</td>
                             <td class="xtd yjmxtd" style="text-align: center;width: 80px;">执行时间</td>
-                            <td class="xtd" style="text-align: center;width: 40px;">批号</td>
+                            <!--<td class="xtd" style="text-align: center;width: 40px;">批号</td>-->
                         </tr>
                     </table>
                 </div>
@@ -203,30 +203,51 @@
                         </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
-                                <span>科室:</span><span class="wardName" style="width: 80px;display: inline-block;">三病室</span>
-                                <span>住院号:</span><span class="inpatientNo" style="font-weight: 700;width: 60px;display: inline-block;">0367892</span>
-                                <span>床号:</span><span class="bedNo" style="font-weight: 700;font-size: 16px;">55</span>
+                                <span>科&nbsp;&nbsp;&nbsp;&nbsp;室:</span><span class="wardName" style="display: inline-block;">三病室</span>
                             </td>
                         </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
-                                <span>姓名:</span><span class="name" style="font-weight: 700;font-size: 16px;width: 80px;display: inline-block;">温晴霖</span>
-                                <span>年&nbsp;&nbsp;&nbsp;&nbsp;龄:</span><span class="age" style="width: 60px;display: inline-block;">91岁</span>
-                                <span>性别:</span><span class="sex">男</span>
+                                <span>住院号:</span><span class="inpatientNo" style="font-weight: 700;width: 80px;display: inline-block;">0367892</span>
+                                <span>性别:</span><span class="sex" style="width: 40px;display: inline-block;">男</span>
+                                <span>床号:</span><span class="bedNo" style="font-weight: 700;font-size: 26px;">55</span>
                             </td>
                         </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
-                                <span>服药时间:</span><span class="occTime">2022-2-8 04:00p</span>
+                                <span>姓&nbsp;&nbsp;&nbsp;&nbsp;名:</span><span class="name" style="font-weight: 700;font-size: 16px;width: 80px;display: inline-block;">温晴霖</span>
+                                <span>年龄:</span><span class="age" style="display: inline-block;">91岁</span>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="5" style="text-align: left;border: transparent !important;"><span style="font-size: 10px;">&nbsp;</span>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="5" style="text-align: left;border: transparent !important;">
+                                <span>药品名称:</span><span class="drugName">2022-2-8 04:00p</span>
                             </td>
                         </tr>
                         <tr>
+                            <td colspan="3" style="text-align: left;border: transparent !important;">
+                                <span>规格:</span><span class="specification">2022-2-8 04:00p</span>
+                            </td>
+                            <td colspan="2" style="text-align: left;border: transparent !important;">
+                                <span>剂量:</span><span class="dose" style="font-weight: 700;">2022-2-8 04:00p</span>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="5" style="text-align: left;border: transparent !important;">
+                                <span>服药时间:</span><span class="occTime">2022-2-8 04:00p</span>
+                            </td>
+                        </tr>
+                        <!--<tr>
                             <td class="xtd" style="text-align: center;width: 35%;">药品</td>
                             <td class="xtd" style="text-align: center;width: 15%;">剂量</td>
                             <td class="xtd" style="text-align: center;width: 20%;">规格</td>
                             <td class="xtd" style="text-align: center;width: 15%;">服量</td>
                             <td class="xtd" style="text-align: center;width: 15%;">领量</td>
-                        </tr>
+                        </tr>-->
                     </table>
                 </div>
                 <!--中药药品标签打印开始-->