2019-08-14: 重症肺炎患儿加入标签表

2019-08-14  本文已影响0人  AI_Finance

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 yd_patient_11_basic_info as detail
join 
(
select uuid from mid_patient_info_t 
where (first_diagnosis_list like "%社区获得性肺炎,重症%" or first_diagnosis_list like "%重症肺炎%") and patient_age<18
union
(
select distinct CONCAT(customer_id, "-", record_id) as uuid
                    from pt_patient_assess 
                    where assess_name like "%cap严重程度评估%" and assess_value='重度'
)
) as part1
on detail.uuid=part1.uuid
上一篇 下一篇

猜你喜欢

热点阅读