Procházet zdrojové kódy

出院带药口服标签打印

WANGJIALIANG před 2 roky
rodič
revize
86755fee9c

+ 8 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -880,15 +880,21 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
         }
         for (int i = 0; i < yfWardVos.size(); i++) {
             YfWardVo yfWardVo = yfWardVos.get(i);
+            YzActOrder yzActOrder = yzActOrderMapper.selectYzActOrderByActOrderNo(yfWardVo.getActOrderNo());
+            YzSupplyType yzSupplyType = yzSupplyTypeMapper.selectYzSupplyTypeByCode(yzActOrder.getSupplyCode());
             YpZdDict ypZdDict = ypZdDictMapper.selectYpZdDictByCodeAndSerial(yfWardVo.getChargeCode(), yfWardVo.getSerial());
-            if ((isByj == 0 && "d".equals(yfWardVo.getDrugClass())) || (isByj == 1 && ypZdDict.getByjFlag() == 0)) {//口服药
-                YzActOrder yzActOrder = yzActOrderMapper.selectYzActOrderByActOrderNo(yfWardVo.getActOrderNo());
+            if ((isByj == 0 && "d".equals(yfWardVo.getDrugClass())) || (isByj == 1 && ypZdDict.getByjFlag() == 0)
+                || (yfWardVo.getPageClass().equals("1") && yzSupplyType.getClassCode().equals("1"))) {//口服药
                 yfWardVo.setDose(yzActOrder.getDose());
                 yfWardVo.setInstruction(yzActOrder.getInstruction());
                 String ypUnitName = mzPharmacyMapper.selectYpUnitName(yzActOrder.getDoseUnit());
                 yfWardVo.setDoseUnit(ypUnitName);
                 ZdUnitCode zdUnitCode = zdUnitCodeMapper.selectByCode(yfWardVo.getWardCode());
                 yfWardVo.setWardName(zdUnitCode.getName());
+                if(StringUtils.isNotBlank(yzActOrder.getFrequCode())){
+                    yfWardVo.setComm(yzOrderFrequencyMapper.selectYzOrderFrequencyByCode(yzActOrder.getFrequCode()).getComm());
+                }
+                yfWardVo.setSupplyName(yzSupplyType.getSupplyName());
                 String dosage;
                 if (yzActOrder.getDoseUnit().equals(yzActOrder.getDrugVolUnit())) {
                     dosage = yzActOrder.getDose() / yzActOrder.getDrugVolume() + "";

+ 31 - 2
src/main/resources/static/js/yf/ward_prescription.js

@@ -20,6 +20,9 @@ $(function () {
     });
     $('#submitFlagSearch').html("");
     let submitFlagHtml = '';
+    if (nfdPrintIndex == null) {
+        return errorMesageSimaple('未设置内服袋打印机,请在发药参数设置中设置');
+    }
     if (groupNo == null) {
         return errorMesageSimaple('当前药房未设置,请在发药参数设置中设置');
     } else if (groupNo === '81') {
@@ -1500,8 +1503,9 @@ function printLabel(datas, isMx) {
     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);
-    if(pageClass == 5){//长期口服
+    if(pageClass == 1){//出院带药
+        printLabelKf(datas, LODOP);
+    }else if(pageClass == 5){//长期口服
         printLabelLongTime(datas, isMx, LODOP);
     }else {
         let tableDatas = getJQAllData(isMx == 1 ? "tb_detail_table" : "tb_summarizing_table");
@@ -1613,6 +1617,31 @@ function printLabelLongTime(datas, isMx, LODOP) {
     }
 }
 
+/**
+ * 打印出院带药口服标签
+ * @param datas
+ */
+function printLabelKf(datas,LODOP) {
+    for (let i = 0; i < datas.length; i++) {
+        let data = datas[i];
+        $("#NO").attr("value",(i+1));
+        $("#ypbq_name").attr("value",(data['name']));
+        $("#ypbq_patientId").attr("value",(data['inpatientNo']));
+        $("#ypbq_sex").attr("value",(getSex(data['sex'])));
+        $("#ypbq_age").attr("value",(getBirthSlot(data['birthDate'],new Date())));
+        $("#ypbq_drugname").attr("value",(data['drugName']));
+        $("#ypbq_specification").attr("value",(data['specification']));
+        $("#ypbq_quantity").attr("value",(data['amount']));
+        $("#ypbq_printName").attr("value",(data['supplyName']));
+        $("#ypbq_comm").attr("value",(data['comm']));
+        $("#ypbq_instructionText").attr("value",(data['instruction']));
+        $("#dataTime").attr("value",(formatDate(new Date())));
+        LODOP.ADD_PRINT_HTM("5mm", "2mm", "80mm", "60mm", $("div[id='print_view_bq']").html());
+        LODOP.NewPageA();
+    }
+    LODOP.PRINT();
+}
+
 /**
  * 打印报表
  */

+ 50 - 0
src/main/resources/templates/yf/ward_prescription.html

@@ -363,6 +363,56 @@
                     </table>
                 </div>
                 <!--中药处方打印结束-->
+                <!--药品标签打印开始-->
+                <div id="print_view_bq">
+                        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            <span style="font-size:18px;font-weight: 700;">住院</span>
+                            患者药品标签&nbsp;&nbsp;
+                            <input style="margin-bottom:3px;border: 0px;width: 30px;background-color: white;color: black;" disabled
+                                   value="" id="NO"/>
+                        </span>
+                    <form style="font-size: 15px;">
+                        <span style="margin-bottom:3px;">患者姓名:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 60px;background-color: white;color: black;" disabled
+                               value="" id="ypbq_name"/>
+                        <span style="margin-left: 5px;">住院号:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 70px;background-color: white;color: black;" disabled
+                               value="" id="ypbq_patientId"/>
+                        <br/>
+                        <span style="margin-bottom:3px;">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 60px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_sex"/>
+                        <span style="margin-bottom:3px;margin-left: 5px;">年龄:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 90px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_age"/>
+                        <br/>
+                        <span style="margin-bottom:3px;">药品名称:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 180px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_drugname"/>
+                        <br/>
+                        <span style="margin-bottom:3px;">规格:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 120px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_specification"/>
+                        <span style="margin-bottom:3px;margin-left: 5px;">数量:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 20px;background-color: white;color: black;text-align: right"
+                               disabled value="" id="ypbq_quantity"/>
+                        <br/>
+                        <span style="margin-bottom:3px;">用法用量:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 60px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_printName"/>
+                        <input style="margin-bottom:3px;border: 0px;width: 150px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_comm"/>
+                        <br/>
+                        <span style="margin-bottom:3px;">嘱&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;托:</span>
+                        <input style="margin-bottom:3px;border: 0px;width: 180px;background-color: white;color: black;"
+                               disabled value="" id="ypbq_instructionText"/>
+                        <br/>
+                        <input style="margin-bottom:3px;border: 0px;width: 130px;background-color: white;color: black;"
+                               disabled value="" id="dataTime"/>
+                        <br/>
+                    </form>
+                </div>
+                <!--药品标签打印结束-->
             </div>
             <div id="tb_table_div">
                 <div class="col-md-12 col-sm-12 col-xs-12">