Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- MAX(ehr_conditions.id) as id,
- MAX(ehr_conditions.encounter_id) as encounter_id,
- ehr_conditions.patient_id as patient_id,
- ehr_conditions.employee_id as employee_id,
- ehr_conditions.code as code,
- ehr_conditions.title as title,
- ehr_conditions.role as role,
- MAX(ehr_conditions.diagnose_id) as diagnose_id,
- receptions.legal_entity_id as legal_entity_id,
- CAST(receptions.asserted_date as date) as asserted_date
- FROM mv_stat_lvl_0_ehr_conditions as ehr_conditions
- INNER JOIN mv_stat_lvl_0_receptions receptions ON ehr_conditions.encounter_id = receptions.id
- GROUP BY (ehr_conditions.patient_id, ehr_conditions.employee_id, ehr_conditions.code, ehr_conditions.title , ehr_conditions.role,
- CAST(receptions.asserted_date as date), receptions.legal_entity_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement