insert ETL_0730_ZY_WXS.`cap_statistics_qc_common`(
uuid,
patient_guid,
patient_name,
patient_gender,
patient_age,
patient_age_type,
inpatient_department,
doctor_name,
admission_time,
discharge_time,
project_id,
project_name,
project_status
)
-- 获取满足严重肺部病变的小儿肺炎患者信息
select detail.uuid, detail.patient_guid, detail.patient_name, detail.patient_gender, detail.patient_age, detail.patient_age_type,
detail.inpatient_department, detail.doctor_name, detail.admission_date, detail.discharge_date, NULL,
"严重肺部病变" as project_name, 1 as project_status
from ETL_0730_ZY_WXS.yd_patient_11_basic_info as detail
join
(
SELECT distinct concat(customer_id, "-", record_id) as uuid
from pt_patient_examination_item
where examination_item_name like "%肺不张%"
or examination_item_name like "%胸腔积液%"
or examination_item_name like "%肺实变%"
or
(examination_item_name like "%肺叶受累%"
and (examination_item_value_attributive like "%双侧%" or examination_item_value_attributive like "%多侧%")
)
) as part1
on detail.uuid=part1.uuid
网友评论