LIJU 2 週間 前
コミット
d8e6128ca7

+ 3 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yb/SiPatInfo.java

@@ -88,4 +88,7 @@ public class SiPatInfo implements Serializable {
     private String medListCodg;      // 医疗目录编码
     private String rxFlag;           // 处方药标志
     private String trdnFlag;         // 拆零标志
+    
+    // 就诊结算类型(从mz_charge_detail表关联查询得到)
+    private String mdtrtSetlType;    // 就诊结算类型
 } 

+ 7 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/yb/SiPatInfoMapper.java

@@ -94,11 +94,15 @@ public interface SiPatInfoMapper {
         "SELECT m.charge_item_code as chargeItemCode, ISNULL(m.drug_name, '') as drugName, ISNULL(m.specification, '') as specification, ",
         "1 as quantity, ISNULL(m.unit_price, 0) as unitPrice, m.drug_trac_codg as drugTracCodg, m.confirm_time as scanTime, ",
         "ISNULL(m.confirm_name, '') as scanUser, m.order_no as orderNo, m.receipt_no as receiptNo, m.real_no as realNo, ",
-        "ISNULL(y.national_code, '') as medListCodg, '0' as rxFlag, '0' as trdnFlag, ",
-        "ISNULL(p.psn_cert_type, '01') as psnCertType, ISNULL(p.certno, '') as certno ",
+        "ISNULL(y.national_code, '') as medListCodg, ",
+        "ISNULL(y.rx_flag, '0') as rxFlag, ",
+        "ISNULL(y.cl_flag, '0') as trdnFlag, ",
+        "ISNULL(p.psn_cert_type, '01') as psnCertType, ISNULL(p.certno, '') as certno, ",
+        "CASE WHEN c.hosp_appr_flag = 0 THEN '1' WHEN c.hosp_appr_flag = 2 THEN '2' ELSE '2' END as mdtrtSetlType ",
         "FROM mz_drug_trac_codg m ",
-        "LEFT JOIN yp_zd_dict y ON m.charge_item_code = y.code AND y.serial = '01' ",
+        "LEFT JOIN yp_zd_dict y ON m.charge_item_code = y.code AND y.serial = m.serial ",
         "LEFT JOIN t_si_pat_info p ON m.patient_id = p.pat_no AND m.times = p.times ",
+        "LEFT JOIN mz_charge_detail c ON m.patient_id = c.patient_id AND m.times = c.times AND m.order_no = c.order_no AND m.charge_item_code = c.charge_item_code ",
         "WHERE m.patient_id = #{patientId} AND m.times = #{times} ",
         "AND m.order_no = #{orderNo} ",
         "AND m.drug_trac_codg IS NOT NULL ",

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/yb/YbParamDetailServiceImpl.java

@@ -130,7 +130,7 @@ public class YbParamDetailServiceImpl implements YbParamDetailService {
         selinfoSold.setPharName("宋荣芝");
         selinfoSold.setSelRetnOpterName("宋荣芝");
         selinfoSold.setPharPracCertNo("HY321322000735");
-        selinfoSold.setMdtrtSetlType("2");
+        selinfoSold.setMdtrtSetlType(baseInfo.getMdtrtSetlType() != null ? baseInfo.getMdtrtSetlType() : "2");
         
         // 从药品字典表获取医保相关参数
         selinfoSold.setMedListCodg(baseInfo.getMedListCodg() != null ? baseInfo.getMedListCodg() : "");