|
@@ -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 ",
|