浏览代码

处方打印功能开发

hurugang 4 年之前
父节点
当前提交
318d417549

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzBlRecord.java

@@ -89,4 +89,6 @@ public class MzBlRecord {
     private Integer pressureFloorLeft;
     //初步诊断
     private String tentativeDiagnosis;
+    //药品与诊疗的处方明细,json 结构   {"zyPrescription": [],"zlPrescription":[],"xyPrescription": {"pyPrescription":[],"ycPrescription":[],"mjPrescription":[],"jePrescription":[]}}
+    private String prescriptionDetail;
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzChargeDetail.java

@@ -47,7 +47,7 @@ public class MzChargeDetail implements Serializable,Comparable<MzChargeDetail> {
     private Date chargeDate;
     //发药时间
     private Date confirmTime;
-    //发药药房  如果是00 说明是医技套餐项目
+    //发药药房  如果是00 说明是医技套餐项目   71 普药 91 医材  111 麻精一  131 精二
     private String groupNo;
     //发药人
     private String confirmId;
@@ -77,7 +77,7 @@ public class MzChargeDetail implements Serializable,Comparable<MzChargeDetail> {
     private Integer confirmFlag;
     //申请科室
     private String warnDept;
-    //急诊标记   1 急诊
+    //急诊标记  0普通处方  1 急诊处方 2 精一  3 精二
     private String jzFlag;
     //药品组:输液用  分组 组号
     private Integer groupOrder;

+ 3 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzBlRecordMapper.java

@@ -15,12 +15,12 @@ import java.util.Map;
 public interface MzBlRecordMapper {
     @Insert("insert into mz_bl_record(patient_id,times,emr_no,emr_type,visit_date,doctor_code,dept_code,first_or_not,emr_chief_complaint,emr_hpi,emr_ps,emr_pe,emr_fzjc," +
             "emr_process,emr_xyy,emr_yypg,emr_gnpg,emr_jkjy,personal_history,family_history,obsterical_history,weight,temperature,sphygmus,breathe,pressure_high," +
-            "pressure_floor,pressure_high_left,pressure_floor_left,tentative_diagnosis) VALUES (#{patientId,jdbcType=CHAR}," +
+            "pressure_floor,pressure_high_left,pressure_floor_left,tentative_diagnosis,prescription_detail) VALUES (#{patientId,jdbcType=CHAR}," +
             "#{times,jdbcType=INTEGER},#{emrNo,jdbcType=VARCHAR},#{emrType,jdbcType=CHAR},#{visitDate,jdbcType=TIMESTAMP},#{doctorCode,jdbcType=CHAR}," +
             "#{deptCode,jdbcType=VARCHAR},#{firstOrNot,jdbcType=CHAR},#{emrChiefComplaint,jdbcType=VARCHAR},#{emrHpi,jdbcType=VARCHAR},#{emrPs,jdbcType=VARCHAR}," +
             "#{emrPe,jdbcType=VARCHAR},#{emrFzjc,jdbcType=VARCHAR},#{emrProcess,jdbcType=VARCHAR},#{emrXyy,jdbcType=VARCHAR},#{emrYypg,jdbcType=VARCHAR}," +
             "#{emrGnpg,jdbcType=VARCHAR},#{emrJkjy,jdbcType=VARCHAR},#{personalHistory},#{familyHistory},#{obstericalHistory},#{weight},#{temperature},#{sphygmus}" +
-            ",#{breathe},#{pressureHigh},#{pressureFloor},#{pressureHighLeft},#{pressureFloorLeft},#{tentativeDiagnosis})")
+            ",#{breathe},#{pressureHigh},#{pressureFloor},#{pressureHighLeft},#{pressureFloorLeft},#{tentativeDiagnosis},#{prescriptionDetail})")
     int insertMzBlRecord(MzBlRecord mzBlRecord);
 
 
@@ -42,7 +42,7 @@ public interface MzBlRecordMapper {
      */
     @Select("select patient_id,times,emr_no,emr_type,visit_date,doctor_code,dept_code,first_or_not,emr_chief_complaint," +
             "emr_hpi,emr_ps,emr_pe,emr_fzjc,emr_process,emr_xyy,emr_yypg,emr_gnpg,emr_jkjy,personal_history,family_history," +
-            "obsterical_history,weight,temperature,sphygmus,breathe,pressure_high,pressure_floor,pressure_high_left,pressure_floor_left,tentative_diagnosis " +
+            "obsterical_history,weight,temperature,sphygmus,breathe,pressure_high,pressure_floor,pressure_high_left,pressure_floor_left,tentative_diagnosis,prescription_detail " +
             " from mz_bl_record where patient_id= #{patientId,jdbcType=VARCHAR} and times =#{times}")
     MzBlRecord selectMzBlRecordByPatientIdAndTimes(@Param("patientId") String patientId,@Param("times") Integer times);
 

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -327,7 +327,7 @@ public interface MzChargeDetailMapper {
                     "<when test='receiptNo!=null'>",
             " and receipt_no=#{receiptNo} ",
             "</when>",
-                    "order by order_no desc",
+                    "order by order_no asc",
             "</script>"})
     List<MzChargeDetail> selectMzChargeDetailByPatientId(@Param("patientId") String patientId, @Param("times") Integer times,@Param("receiptNo") Integer receiptNo, @Param("payMark") String payMark);
 

+ 49 - 7
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hnthyy.thmz.common.SpringUtil;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.entity.his.mz.*;
+import cn.hnthyy.thmz.entity.his.zd.MzZdYpYsh;
 import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 import cn.hnthyy.thmz.entity.thmz.Clinic;
 import cn.hnthyy.thmz.entity.thmz.Discount;
@@ -15,6 +16,7 @@ import cn.hnthyy.thmz.entity.thmz.Windows;
 import cn.hnthyy.thmz.enums.*;
 import cn.hnthyy.thmz.mapper.his.*;
 import cn.hnthyy.thmz.mapper.his.mz.*;
+import cn.hnthyy.thmz.mapper.his.zd.MzZdYpYshMapper;
 import cn.hnthyy.thmz.mapper.thmz.ClinicMapper;
 import cn.hnthyy.thmz.mapper.thmz.WindowsMapper;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
@@ -133,7 +135,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     private ClinicMapper clinicMapper;
     @Autowired
     private TsmzService tsmzService;
-
+    @SuppressWarnings("all")
+    @Autowired
+    private MzZdYpYshMapper mzZdYpYshMapper;
     @Override
     public int countMzChargeDetail(MzChargeDetailPageDto mzChargeDetailPageDto) {
         mzChargeDetailPageDto.setTableName("mz_charge_detail");
@@ -903,7 +907,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         String reqTzComment = getReqTzComment(mzPrescriptionVo.getMzBlRecord());
         //保存医技入库
         if (mzPrescriptionVo.getMzYjReqList() != null && mzPrescriptionVo.getMzYjReqList().size() > 0) {
-
             for (MzYjReq mzYjReq : mzPrescriptionVo.getMzYjReqList()) {
                 if (StringUtils.isBlank(mzYjReq.getOrderCode())) {
                     throw new MzException("保存处方失败,医技项目编码不能为空");
@@ -956,6 +959,18 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         //保存药品入库
         int itemNo = 1;
         if (mzPrescriptionVo.getMzChargeDetailList() != null && mzPrescriptionVo.getMzChargeDetailList().size() > 0) {
+            //处方类型
+            Map<Integer,String> orderNoMap = new HashMap<>();
+            //精一药品编码
+            Set<String> mjSet=null;
+            //精二药品编码
+            Set<String> jeSet=null;
+            if(needPatient){
+                List<MzZdYpYsh> mjList = mzZdYpYshMapper.selectMjyByCommonParams(null, null, null,null);
+                List<MzZdYpYsh> jeList = mzZdYpYshMapper.selectJeByCommonParams(null, null, null,null);
+                mjSet=mjList.stream().map(m->m.getCode()).collect(Collectors.toSet());
+                jeSet=jeList.stream().map(m->m.getCode()).collect(Collectors.toSet());
+            }
             for (MzChargeDetail mzChargeDetail : mzPrescriptionVo.getMzChargeDetailList()) {
                 if (StringUtils.isBlank(mzChargeDetail.getChargeItemCode())) {
                     throw new MzException("保存处方失败,第" + itemNo + "行药品缴费编码不能为空");
@@ -981,12 +996,28 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 //                if (StringUtils.isBlank(mzChargeDetail.getSupplyExec())) {
 //                    throw new MzException("保存处方失败,第" + itemNo + "行药品给药方式执行科室不能为空");
 //                }
+                if(needPatient){
+                    //设置处方类型
+                    String jzFlag = orderNoMap.get(mzChargeDetail.getOrderNo());
+                    if(jzFlag==null){
+                        if(mjSet.contains(mzChargeDetail.getChargeItemCode())){
+                            jzFlag="2";
+                        }else if(jeSet.contains(mzChargeDetail.getChargeItemCode())){
+                            jzFlag="3";
+                        }else if(Constants.EMERGENCY_WARD_CODE.equals(mzPrescriptionVo.getVisitDeptCode())){
+                            jzFlag="1";
+                        }else {
+                            jzFlag="0";
+                        }
+                        orderNoMap.put(mzChargeDetail.getOrderNo(),jzFlag);
+                    }
+                    mzChargeDetail.setJzFlag(jzFlag);
+                }
                 mzChargeDetail.setPatientId(mzPrescriptionVo.getPatientId());
                 mzChargeDetail.setTimes(times);
                 mzChargeDetail.setReceiptNo(0);
                 mzChargeDetail.setSerialNo(0);
                 mzChargeDetail.setConfirmFlag(0);
-                mzChargeDetail.setJzFlag(mzPrescriptionVo.getJzFlag().toString());
                 mzChargeDetail.setItemNo(itemNo);
                 mzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
                 if (Arrays.asList(OrderFrequencyEnum.ALWAYS.code, OrderFrequencyEnum.IRREG.code, OrderFrequencyEnum.ONCE.code).contains(mzChargeDetail.getFrequency())) {
@@ -1362,14 +1393,25 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             return mzPrescriptionVo;
         }
         List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId(patientId, times, null, payMark);
-        if (PayMarkEnum.CHARGED.code.equals(payMark)) {
-            //对于已经收费的药品记录查询,只需要查询医生开立的药品,给要方式等记录需要过滤
-            List<MzChargeDetail> removeList = new ArrayList<>();
-            for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
+        List<MzChargeDetail> removeList =null;
+        for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
+            if (PayMarkEnum.CHARGED.code.equals(payMark)) {
+                //对于已经收费的药品记录查询,只需要查询医生开立的药品,给要方式等记录需要过滤
+                if(removeList==null){
+                    removeList = new ArrayList<>();
+                }
                 if (YesNoEnum.YES.code != (mzChargeDetail.getGroupId())) {
                     removeList.add(mzChargeDetail);
                 }
             }
+            if("2".equals(mzChargeDetail.getJzFlag())){
+                mzChargeDetail.setGroupNo("111");
+            }else if("3".equals(mzChargeDetail.getJzFlag())){
+                mzChargeDetail.setGroupNo("131");
+            }
+        }
+        if (PayMarkEnum.CHARGED.code.equals(payMark)) {
+            //对于已经收费的药品记录查询,只需要查询医生开立的药品,给要方式等记录需要过滤
             mzChargeDetailList.removeAll(removeList);
         }
         mzPrescriptionVo.setMzChargeDetailList(mzChargeDetailList);

+ 0 - 4
src/main/java/cn/hnthyy/thmz/vo/MzPrescriptionVo.java

@@ -3,12 +3,8 @@ package cn.hnthyy.thmz.vo;
 import cn.hnthyy.thmz.entity.his.mz.MzBlRecord;
 import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
 import cn.hnthyy.thmz.entity.his.mz.MzYjReq;
-import cn.hnthyy.thmz.entity.thmz.Clinic;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
 
-import java.util.Date;
 import java.util.List;
 
 /**

+ 80 - 41
src/main/resources/static/js/mz/clinic.js

@@ -346,7 +346,7 @@ function fitPatientHisData() {
             "offset": 0,
             "beginDate": "2012-02-01 00:00:00",
             "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss"),
-            "doctorCode":"-1"
+            "doctorCode": "-1"
         }),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (res) {
@@ -375,7 +375,7 @@ function fitPatientHisData() {
                         html += '                            </div>';
                         html += '                            <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
                         html += '                                 title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
-                        html += '                                    onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ','+data[i].clinicStatus+')">' + icdText + '</a>';
+                        html += '                                    onclick="visitingDetailModal(\'' + data[i].patientId + '\',' + data[i].times + ',' + data[i].id + ',' + data[i].clinicStatus + ')">' + icdText + '</a>';
                         html += '                            </div>';
                         html += '                        </div>';
                     }
@@ -934,7 +934,7 @@ function clinicalReception(patientId, serialNo) {
             $("#confirmPrescriptionButton").off("click").on("click", function (t) {
                 $("#messagePrescriptionModal").modal("hide");
                 //先保存目前接诊信息,再切换就诊人
-                var jsonData = getParamsForOrescription();
+                var jsonData = getParamsForpPrescription();
                 $.ajax({
                     type: "POST",
                     url: '/thmz/savePrescription',
@@ -1600,8 +1600,6 @@ function initTemplateTypeSelect() {
 }
 
 
-
-
 /**
  * 初始频次下拉选
  * @param id
@@ -1742,7 +1740,6 @@ function initJyZdSample() {
 }
 
 
-
 /**
  * 保存当前药品到右边处方区域
  * @param index 0 西药 1中药 2 诊疗和社备
@@ -2535,12 +2532,11 @@ function clearJyJcItem() {
 }
 
 
-
 /**
  * 计算总金额
  */
 function calculateTotalAmount() {
-    var jsonData = getParamsForOrescription();
+    var jsonData = getParamsForpPrescription();
     $.ajax({
         type: "POST",
         url: '/thmz/getAmountForTempPrescription',
@@ -2631,7 +2627,6 @@ function billItemButtonChange(object, objectIndex) {
 }
 
 
-
 /**
  * 打开快速接诊窗口
  * @param data
@@ -2745,8 +2740,6 @@ function clearRapidAccepts() {
 }
 
 
-
-
 /**
  * 根据病人姓名输入框内容动态加载病人列表
  */
@@ -4422,7 +4415,6 @@ function calculateZyAmount() {
 }
 
 
-
 /**
  * 将病人信息填入患者信息修改form
  * @param patinet
@@ -4459,10 +4451,6 @@ function fillPlusPatinet(patinet) {
 }
 
 
-
-
-
-
 /**
  * 修改病人信息
  */
@@ -4503,7 +4491,6 @@ function modifyPatient() {
 }
 
 
-
 /**
  * 获取按钮组选择的下标
  * @param id
@@ -4534,7 +4521,6 @@ function getRePortRangeArr() {
 }
 
 
-
 /**
  * 初始医生工作太配置
  */
@@ -4763,8 +4749,8 @@ function zTreeOnClick(event, treeId, treeNode) {
  * 构建处方参数
  * @returns {any}
  */
-function getParamsForOrescription() {
-    var jsonData = JSON.parse('{"patientId": "","firstOrNot":"","icdCode": "","icdText": null,"jzFlag": "0","serialNo":"","mzBlRecord": {"firstOrNot": "","emrChiefComplaint": "","emrHpi": "","emrPs": "","emrPe": "","emrFzjc": null,"emrProcess": null,"emrXyy": "无","emrYypg": "无","emrGnpg": "无","emrJkjy": "","personalHistory": "","familyHistory": "","obstericalHistory": "","weight": "","temperature": "","sphygmus": "","breathe": "","pressureHigh": "","pressureFloor": "","pressureHighLeft": "","pressureFloorLeft": "","tentativeDiagnosis":""},"mzChargeDetailList": [],"mzYjReqList": []}');
+function getParamsForpPrescription() {
+    var jsonData = JSON.parse('{"patientId": "","firstOrNot":"","icdCode": "","icdText": null,"jzFlag": "0","serialNo":"","mzBlRecord": {"firstOrNot": "","emrChiefComplaint": "","emrHpi": "","emrPs": "","emrPe": "","emrFzjc": null,"emrProcess": null,"emrXyy": "无","emrYypg": "无","emrGnpg": "无","emrJkjy": "","personalHistory": "","familyHistory": "","obstericalHistory": "","weight": "","temperature": "","sphygmus": "","breathe": "","pressureHigh": "","pressureFloor": "","pressureHighLeft": "","pressureFloorLeft": "","tentativeDiagnosis":"","prescriptionDetail":""},"mzChargeDetailList": [],"mzYjReqList": []}');
     jsonData.patientId = $("#patientId").val();
     jsonData.firstOrNot = $("input[name='firstOrNot']:checked").val();
     jsonData.icdCode = $("#diagnoseValue").val();
@@ -4794,6 +4780,7 @@ function getParamsForOrescription() {
     var xyTabContents = $("#xyTabContent").find("div.tab-pane");
     //处方号
     var orderNo = 0;
+    var jsonDataPrescription = JSON.parse('{"zyPrescription": [],"zlPrescription":[],"xyPrescription": {"pyPrescription":[],"ycPrescription":[],"mjPrescription":[],"jePrescription":[]}}');
     //西药设置
     if (xyTabContents != null && xyTabContents.length > 0) {
         for (var i = 0; i < xyTabContents.length; i++) {
@@ -4806,6 +4793,7 @@ function getParamsForOrescription() {
                 } else if (i != xyTabContents.length - 1) {
                     emrProcess += "_";
                 }
+                var detailPrescription = JSON.parse('[]');
                 for (var j = 0; j < formGroups.length; j++) {
                     // var cfAmount = $(xyTabContents[i]).find("span.cf_amount").parent().text();
                     // emrProcess += $(formGroups[j]).text().replace(cfAmount, "") + "-";
@@ -4814,6 +4802,7 @@ function getParamsForOrescription() {
                     } else {
                         emrProcess += $(formGroups[j]).text() + "_";
                     }
+                    detailPrescription[detailPrescription.length] = $(formGroups[j]).text();
                     var tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "","drugQuan": "","drugUnit": "","frequency": "","orderDays": "","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":""}');
                     tempJson.chargeItemCode = $(formGroups[j]).find("input.temporary_items_code").val();
                     tempJson.serial = $(formGroups[j]).find("input.temporary_items_serial").val();
@@ -4835,6 +4824,26 @@ function getParamsForOrescription() {
                     }
                     jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
                 }
+                if (currentGroupNo == "71") {
+                    //普药
+                    var pyPrescription = jsonDataPrescription.xyPrescription.pyPrescription;
+                    pyPrescription[pyPrescription.length] = detailPrescription;
+                }
+                if (currentGroupNo == "91") {
+                    //医材
+                    var ycPrescription = jsonDataPrescription.xyPrescription.ycPrescription;
+                    ycPrescription[ycPrescription.length] = detailPrescription;
+                }
+                if (currentGroupNo == "111") {
+                    //麻精一
+                    var mjPrescription = jsonDataPrescription.xyPrescription.mjPrescription;
+                    mjPrescription[mjPrescription.length] = detailPrescription;
+                }
+                if (currentGroupNo == "131") {
+                    //精二
+                    var jePrescription = jsonDataPrescription.xyPrescription.jePrescription;
+                    jePrescription[jePrescription.length] = detailPrescription;
+                }
             }
         }
     }
@@ -4870,6 +4879,7 @@ function getParamsForOrescription() {
             tempJson.orderNo = orderNo;
             tempJson.groupNo = currentZyClassType;
             jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
+            jsonDataPrescription.zyPrescription[jsonDataPrescription.zyPrescription.length] = $(zyTabContents[i]).text();
         }
     }
     //设置诊疗与医技
@@ -4914,6 +4924,7 @@ function getParamsForOrescription() {
                 tempJson.orderNo = orderNo;
                 jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
             }
+            jsonDataPrescription.zlPrescription[jsonDataPrescription.zlPrescription.length] = $(zlTabContents[i]).text();
         }
     }
     //设置诊断名称
@@ -4931,6 +4942,7 @@ function getParamsForOrescription() {
     jsonData.icdText = icdText;
     jsonData.mzBlRecord.emrFzjc = emrFzjc;
     jsonData.mzBlRecord.emrProcess = emrProcess;
+    jsonData.mzBlRecord.prescriptionDetail = JSON.stringify(jsonDataPrescription);
     return jsonData;
 }
 
@@ -4942,7 +4954,7 @@ function savePrescription() {
     $("#messageContent").html("确认保存处方吗?");
     $("#messageButton").off("click").on("click", function (t) {
         $("#messageModal").modal("hide");
-        var jsonData = getParamsForOrescription();
+        var jsonData = getParamsForpPrescription();
         $.ajax({
             type: "POST",
             url: '/thmz/savePrescription',
@@ -4993,7 +5005,7 @@ function saveapidAccepts() {
     $("#messageContent").html("确认保存医疗范文吗?");
     $("#messageButton").off("click").on("click", function (t) {
         $("#messageModal").modal("hide");
-        var jsonData = getParamsForOrescription();
+        var jsonData = getParamsForpPrescription();
         $.ajax({
             type: "POST",
             url: '/thmz/saveTemplate',
@@ -5094,7 +5106,7 @@ function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
         $("#confirmPrescriptionButton").off("click").on("click", function (t) {
             $("#messagePrescriptionModal").modal("hide");
             //先保存目前接诊信息,再切换就诊人
-            var jsonData = getParamsForOrescription();
+            var jsonData = getParamsForpPrescription();
             $.ajax({
                 type: "POST",
                 url: '/thmz/savePrescription',
@@ -5157,9 +5169,6 @@ function getMzPrescriptionVoUnPaidCommon(patientId, times, clnicId) {
 }
 
 
-
-
-
 /**
  * 查询病人已缴费处方信息 调用处方
  * @param patientId
@@ -5184,7 +5193,7 @@ function getMzPrescriptionVoPaid(patientId, times, clnicId) {
                     return;
                 }
                 if (res.code == 0) {
-                    var mzfzSerialNoInClick=$("#mzfzSerialNoInClick").val();
+                    var mzfzSerialNoInClick = $("#mzfzSerialNoInClick").val();
                     clearWorkSpace();
                     setMzPatientInfo(res.mzPatientMi);
                     editPrescription(res.data)
@@ -5198,8 +5207,6 @@ function getMzPrescriptionVoPaid(patientId, times, clnicId) {
 }
 
 
-
-
 /**
  * 重复接诊
  * @param patientId
@@ -5259,7 +5266,7 @@ function repeatAcceptsConfirm(patientId, times, clnicId) {
         $("#confirmPrescriptionButton").off("click").on("click", function (t) {
             $("#messagePrescriptionModal").modal("hide");
             //先保存目前接诊信息,再切换就诊人
-            var jsonData = getParamsForOrescription();
+            var jsonData = getParamsForpPrescription();
             $.ajax({
                 type: "POST",
                 url: '/thmz/savePrescription',
@@ -5342,11 +5349,11 @@ function prescriptionDetail(patientId, times, clnicId, payMark) {
  * @param clinicStatus
  */
 function visitingDetailModal(patientId, times, clnicId, clinicStatus) {
-    var payMark =null;
-    if(clinicStatus==5){
-        payMark=5;
-    }else {
-        payMark=0;
+    var payMark = null;
+    if (clinicStatus == 5) {
+        payMark = 5;
+    } else {
+        payMark = 0;
     }
     prescriptionDetailCommon(patientId, times, clnicId, payMark, 1);
 }
@@ -5549,19 +5556,51 @@ function setPrint() {
 /**
  * 打印门诊处方
  */
-function printPrescription() {
+function printPrescription(patientId, times, clnicId) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=0&clnicId=' + clnicId,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
+                if (prescriptionDetail != null && prescriptionDetail != "") {
+                    var prescriptionDetailJson = JSON.parse(prescriptionDetail);
+                    var pyPrescription =prescriptionDetailJson.xyPrescription.pyPrescription;
+                    if(pyPrescription!=null && pyPrescription.length>0){
+
+                    }
+                }
+
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
+
+
     // $("#dcountDate").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss"));
     // $("#dcountDate_gh").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss"));
     setPrint();
     LODOP = getLodop();
-    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "湖南泰和医院处方笺");
+    LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院处方笺");
     LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
     //设置默认打印机
     LODOP.SET_PRINTER_INDEX(printIndex);
-    LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
-    LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "297mm");
-    var strStyle="<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>";
-    LODOP.ADD_PRINT_HTM("0mm", "5mm", "200mm", "280mm",strStyle+ document.getElementById("prescription_table").innerHTML);
+    LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
+    LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
+    LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
+    LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
+    LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
+
+    var strStyle = "<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,td,th {}</style>";
+    LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
     //LODOP.PRINT();
     LODOP.PREVIEW();
     //刷新数据

+ 34 - 51
src/main/resources/templates/mz/clinic.html

@@ -1570,73 +1570,56 @@
 <div id="prescription_table" class="hide"
      style="width:920px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 16px;padding: 40px 20px 40px 20px;overflow-y: auto; overflow-x:hidden;">
     <div id="report_table_1">
-        <h2 style="text-align:center;font-weight: 700;">湖南泰和医院处方笺</h2>
-        <div style="margin-top: 20px;">
-            <span>收费员:</span><span id=""></span><span
-                style="margin-left: 120px;">工号:</span><span id="userIdCode"></span><span
-                style="margin-left: 120px;">结账时间:</span><span id="dcountDate"></span></div>
-        <table class="table table-striped table-bordered">
+        <h3 style="text-align:center;font-weight: 700;">湖南泰和医院</h3>
+        <h3 style="text-align:center;font-weight: 700;">处方笺</h3>
+       <!-- <div style="float: right;color: red;">精二</div>-->
+        <table class="table table-striped table-bordered" style="border-bottom: 1px solid black">
             <tbody>
             <tr>
-                <td>挂号费</td>
-                <td id="charge1">0.00</td>
-                <td>其他</td>
-                <td id="charge9">0.00</td>
-                <td>消毒费</td>
-                <td id="charge16">0.00</td>
+                <td>姓名:</td>
+                <td id="patientNamePrescription">林某</td>
+                <td>性别:</td>
+                <td id="patientGenderPrescription">男</td>
+                <td>年龄:</td>
+                <td id="patientAgePrescription">29</td>
             </tr>
             <tr>
-                <td>床位费</td>
-                <td id="charge2">0.00</td>
-                <td>西药费</td>
-                <td id="charge10">0.00</td>
-                <td>材料费</td>
-                <td id="charge18">0.00</td>
+                <td>门诊ID:</td>
+                <td id="patientIdPrescription">290509-4</td>
+                <td>科室:</td>
+                <td id="deptPrescription">急诊科</td>
+                <td>医生:</td>
+                <td id="doctorPrescription">测试医生</td>
             </tr>
             <tr>
-                <td>诊查费</td>
-                <td id="charge3">0.00</td>
-                <td>中成药费</td>
-                <td id="charge11">0.00</td>
-                <td>麻醉费</td>
-                <td id="charge19">0.00</td>
+                <td>处方类型:</td>
+                <td id="typePrescription">精二</td>
+                <td>处方时间:</td>
+                <td id="cfTime" colspan="3">2021-09-22 15:30:32</td>
             </tr>
             <tr>
-                <td>检查费</td>
-                <td id="charge4">0.00</td>
-                <td>中草药费</td>
-                <td id="charge12">0.00</td>
-                <td>四舍五入</td>
-                <td id="charge20">0.00</td>
+                <td>诊断:</td>
+                <td id="zdPrescription" colspan="5">测试诊断</td>
             </tr>
+            </tbody>
+        </table>
+        <table class="table table-striped table-bordered" style="border-bottom: 1px solid black">
+            <tbody>
             <tr>
-                <td>治疗费</td>
-                <td id="charge5">0.00</td>
-                <td>特殊材料费</td>
-                <td id="charge13">0.00</td>
-                <td>护理费</td>
-                <td id="charge6">0.00</td>
+                <td>1.重酒石酸去甲肾上腺素注射液 2mg 2mg 共18支用法:鞘内注射(QNZS) 频次:一次/4h(Q4H) 3天</td>
             </tr>
             <tr>
-                <td>输血费</td>
-                <td id="charge14">0.00</td>
-                <td>手术费</td>
-                <td id="charge7">0.00</td>
-                <td>鉴定费</td>
-                <td id="charge15">0.00</td>
+                <td>1.重酒石酸去甲肾上腺素注射液 2mg 2mg 共18支用法:鞘内注射(QNZS) 频次:一次/4h(Q4H) 3天</td>
             </tr>
             <tr>
-                <td>化验费</td>
-                <td id="charge8">0.00</td>
-                <td>手术器械使用费</td>
-                <td id="charge17">0.00</td>
-                <td></td>
-                <td></td>
+                <td>1.重酒石酸去甲肾上腺素注射液 2mg 2mg 共18支用法:鞘内注射(QNZS) 频次:一次/4h(Q4H) 3天</td>
             </tr>
+            </tbody>
+        </table>
+        <table class="table table-striped table-bordered">
+            <tbody>
             <tr>
-                <td>合计:</td>
-                <td id="totalCharge">0.00</td>
-                <td id="totalChargeStr" colspan="5">零元整</td>
+                <td style="float: right">医师:<span style="text-decoration: underline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
             </tr>
             </tbody>
         </table>