Browse Source

处方优化

lihong 1 year ago
parent
commit
26b61c677a

+ 17 - 2
src/main/java/cn/hnthyy/thmz/controller/zy/APatientMiController.java

@@ -13,6 +13,7 @@ import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
 import cn.hnthyy.thmz.service.his.zy.APatientMiService;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -267,8 +268,22 @@ public class APatientMiController {
             resultMap.put("message", "住院证号码类型不能为空");
             return true;
         }
-        if (StringUtils.isBlank(aPatientMi.getHomeStreet())) {
-            aPatientMi.setHomeStreet("-");
+        if(NumberUtil.isNumber(aPatientMi.getBirthPlace()) && aPatientMi.getBirthPlace().length()==6){
+            if(StringUtils.isBlank(aPatientMi.getProvinceCode())){
+                aPatientMi.setProvinceCode(aPatientMi.getBirthPlace().substring(0,2)+"0000");
+            }
+
+            if(StringUtils.isBlank(aPatientMi.getCityCode())){
+                aPatientMi.setCityCode(aPatientMi.getBirthPlace().substring(0,4)+"00");
+            }
+
+            if(StringUtils.isBlank(aPatientMi.getDistrictCode())){
+                aPatientMi.setDistrictCode(aPatientMi.getBirthPlace());
+            }
+        }
+
+        if (StringUtils.isBlank(aPatientMi.getHomeStreet()) || "-".equals(aPatientMi.getHomeStreet())) {
+            aPatientMi.setHomeStreet(aPatientMi.getAccountStreet());
         }
         if(aPatientMi.getHomeStreet().length()>16){
             aPatientMi.setHomeStreet(aPatientMi.getHomeStreet().substring(0, 16));

+ 14 - 0
src/main/resources/static/js/mz/clinic.js

@@ -10680,6 +10680,17 @@ function setPrint() {
     });
 }
 
+//获取处方编码
+function getOrderNum(patientId,times,prescriptionDetail) {
+    let num = '1'
+    if(prescriptionDetail.length > 0){
+        if(!stringIsBlank(prescriptionDetail[0].orderCode)){
+            num = prescriptionDetail[0].orderCode.split("_")[3]
+        }
+    }
+    return patientId + times + num;
+}
+
 function setTableHtml(prescriptionDetail) {
     //设置成组处方符号
     if (prescriptionDetail.length > 1) {
@@ -10909,6 +10920,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                             var j = __ret.j;
                             $("#typePrescription").text("麻、精一处方");
                             $("#cfTitle").text("麻、精一");
+                            $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
                             $("#prescriptionDetail").html(html);
                             $("#cfAmountPrint").text(mjPrescription[i].amount + "元 (不含注射费)");
                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
@@ -10928,12 +10940,14 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                             var j = __ret.j;
                             $("#typePrescription").text("精二处方");
                             $("#cfTitle").text("精二");
+                            $("#cfOrderNumTitle").text(getOrderNum(patientId,times,prescriptionDetail));
                             $("#prescriptionDetail").html(html);
                             $("#cfAmountPrint").text(jePrescription[i].amount + "元 (不含注射费)");
                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                             index++;
                         }
                     }
+                    $("#cfOrderNumTitle").text(null)
                     //中药处方
                     if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0) {
                         var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;zyPrescription

+ 3 - 1
src/main/resources/templates/mz/clinic.html

@@ -2582,7 +2582,9 @@
                 <svg id="cfBarcode" height="20"></svg>
             </div>
             <div style="text-align:left;font-weight: 700;margin-left: 160px">长沙泰和医院</div>
-            <div style="float: right;color: red;margin-right: 30px;border: 1px solid red;width: 60px;text-align: center;position: absolute;top: 0px;right: 0px;"
+            <div style="float: right;margin-right: 100px;width: 110px;text-align: center;position: absolute;top: 0px;right: 0px;"
+                 id="cfOrderNumTitle"></div>
+            <div style="float: right;color: red;margin-right: 30px;border: 1px solid red;width: 70px;text-align: center;position: absolute;top: 0px;right: 0px;"
                  id="cfTitle"></div>
         </div>
         <div style="text-align:left;font-weight: 700;margin-left: 185px">处方笺</div>