浏览代码

优化处方打印时嘱托显示

hsh 6 月之前
父节点
当前提交
c0ea92aeba

+ 24 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -16,6 +16,7 @@ import cn.hnthyy.thmz.entity.his.mz.PatientAllergenInfo;
 import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
 import cn.hnthyy.thmz.entity.his.yp.YpPdQueue;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
+import cn.hnthyy.thmz.entity.his.zd.MzZdInstructionCode;
 import cn.hnthyy.thmz.entity.his.zd.ZdCommon;
 import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
 import cn.hnthyy.thmz.entity.thmz.RadSendRecord;
@@ -37,6 +38,7 @@ import cn.hnthyy.thmz.service.his.yp.YpPdQueueService;
 import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
 import cn.hnthyy.thmz.service.his.yp.YpZdManufactoryService;
 import cn.hnthyy.thmz.service.his.zd.MzYshZdFysmService;
+import cn.hnthyy.thmz.service.his.zd.MzZdInstructionCodeService;
 import cn.hnthyy.thmz.service.his.zd.ZdAllergenService;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
 import cn.hnthyy.thmz.service.thmz.DispensingSocketService;
@@ -114,6 +116,8 @@ public class MzPharmacyController {
     private ZdAllergenService zdAllergenService;
     @Autowired
     private MzDrugTracCodgService mzDrugTracCodgService;
+    @Autowired
+    private MzZdInstructionCodeService mzZdInstructionCodeService;
     /**
      * 查询处方信息
      *
@@ -880,7 +884,16 @@ public class MzPharmacyController {
                     map.put("frequencyName", chargeDetail.getFrequency());
                 }
                 map.put("jzFlag", chargeDetail.getJzFlag());//急诊标记
-                map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                if(StringUtils.isNotBlank(chargeDetail.getInstructionCode())){
+                    MzZdInstructionCode zt = mzZdInstructionCodeService.selectMzZdInstructionByCode(chargeDetail.getInstructionCode());
+                    if(null == zt || StringUtils.isBlank(zt.getInstructionText())){
+                        map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                    } else {
+                        map.put("instructionText", zt.getInstructionText());//嘱托说明
+                    }
+                } else {
+                    map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                }
                 map.put("tryResult", chargeDetail.getTryResult());//皮试结果
                 map.put("tryFlag", chargeDetail.getTryFlag());//是否需要皮试
                 map.put("drugWin", chargeDetail.getDrugWin());
@@ -1013,7 +1026,16 @@ public class MzPharmacyController {
                         map.put("frequencyName", chargeDetail.getFrequency());
                     }
                     map.put("jzFlag", chargeDetail.getJzFlag());//急诊标记
-                    map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                    if(StringUtils.isNotBlank(chargeDetail.getInstructionCode())){
+                        MzZdInstructionCode zt = mzZdInstructionCodeService.selectMzZdInstructionByCode(chargeDetail.getInstructionCode());
+                        if(null == zt || StringUtils.isBlank(zt.getInstructionText())){
+                            map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                        } else {
+                            map.put("instructionText", zt.getInstructionText());//嘱托说明
+                        }
+                    } else {
+                        map.put("instructionText", chargeDetail.getInstructionText());//嘱托说明
+                    }
                     map.put("tryResult", chargeDetail.getTryResult());//皮试结果
                     map.put("tryFlag", chargeDetail.getTryFlag());//是否需要皮试
                     map.put("drugWin", chargeDetail.getDrugWin());

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

@@ -874,7 +874,7 @@ public interface MzChargeDetailMapper {
             "SELECT c.patient_id,c.times,c.receipt_no,c.order_no,c.real_no,c.bill_item_code," +
             "c.group_no,c.charge_item_code,c.serial,c.warn_dept,c.price_time,c.doctor_code,c.confirm_id," +
             "c.quantity,c.drug_quan,c.frequency,c.charge_item_code,c.drug_unit,c.supply_code,c.doctor_code," +
-            "c.unit_price,c.yb_zf_flag,c.jz_flag,instruction_text,try_result,try_flag,c.pay_self,  " +
+            "c.unit_price,c.yb_zf_flag,c.jz_flag,c.instruction_code,c.instruction_text,c.try_result,c.try_flag,c.pay_self,  " +
             " (case when y.class_code = '210100' then 1 else 0 end ) as is_hide,c.print_flag,c.drug_win,cy_jssm,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,rtrim(cy_dj)cy_dj" +
             "    FROM mz_charge_detail c WITH(NOLOCK) ,yp_zd_dict y WITH(NOLOCK) " +
             " where  1=1 " +

+ 4 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zd/MzZdInstructionCodeMapper.java

@@ -121,4 +121,8 @@ public interface MzZdInstructionCodeMapper {
      */
     @Select("select max(code) from mz_zd_instruction_code WITH(NOLOCK) ")
     String selectMaxCode();
+
+    @Select(" select top 1 * from mz_zd_instruction_code where code = #{code} and del_flag = 0 ")
+    MzZdInstructionCode selectMzZdInstructionByCode(@Param("code") String code);
+
 }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/zd/MzZdInstructionCodeService.java

@@ -50,4 +50,13 @@ public interface MzZdInstructionCodeService {
      * @return
      */
     int saveMzZdInstructionCode(MzZdInstructionCode mzZdInstructionCode);
+
+    /**
+     * @Description 根据嘱托code查询嘱托内容
+     * @Author hsh
+     * @param code 编码
+     * @return 嘱托内容
+     * @Date 2025/3/17 17:04
+     */
+    MzZdInstructionCode selectMzZdInstructionByCode(String code);
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/MzZdInstructionCodeServiceImpl.java

@@ -46,4 +46,9 @@ public class MzZdInstructionCodeServiceImpl implements MzZdInstructionCodeServic
         mzZdInstructionCode.setCode(Integer.parseInt(code)+1+"");
         return mzZdInstructionCodeMapper.insertMzZdInstructionCode(mzZdInstructionCode);
     }
+
+    @Override
+    public MzZdInstructionCode selectMzZdInstructionByCode(String code) {
+        return mzZdInstructionCodeMapper.selectMzZdInstructionByCode(code);
+    }
 }