         'dw_place_events',
         'dw_patients',
         'dw_events_hospitals',
-        'dw_addresses',				-- Consider altering the table instead of creating a new one
-        'dw_email_addresses',			-- Consider altering the table instead of creating a new one
+        'dw_addresses',                -- Consider altering the table instead of creating a new one
+        'dw_email_addresses',            -- Consider altering the table instead of creating a new one
         'dw_hospitals_participations',
         'dw_lab_results',
         'dw_participations_treatments',

    hpart.medical_record_number,
    hpart.hospital_record_number
FROM
	events
	LEFT JOIN participations p
		ON (p.event_id = events.id)
	LEFT JOIN places pl
		ON (pl.entity_id = p.secondary_entity_id)
    LEFT JOIN hospitals_participations hpart
        ON (hpart.participation_id = p.id)
WHERE
	p.type = 'HospitalizationFacility'
;

CREATE TABLE dw_lab_results AS
SELECT

        'dw_place_events',
        'dw_encounters',
        'dw_encounters_labs',
        'dw_encounters_treatments',
        'dw_morbidity_patients',
        'dw_contact_patients',
        'dw_place_patients',
        'dw_encounter_patients',
        'dw_morbidity_answers',
        'dw_contact_answers',
        'dw_place_answers',
        'dw_encounter_answers',
        'dw_morbidity_questions',
        'dw_contact_questions',
        'dw_place_questions',
        'dw_encounter_questions'
    );
COMMIT;

