Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHM-8010 consult_encounter failing #289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jobs/sql/extractions/consult_encounters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ max(case when concept_id = @trauma_type then concept_name(value_coded,@locale) e
max(case when concept_id = @return_visit_date then value_datetime end) "return_visit_date",
max(case when concept_id = @disposition then concept_name(value_coded,@locale) end) "disposition",
max(case when concept_id = @disposition then value_coded end) "disposition_code",
max(case when concept_id = @location_within then location_name(value_text) end) "location_within",
max(case when concept_id = @location_within then location_name(if(value_text<999,value_text,null)) end) "location_within",
max(case when concept_id = @location_out then concept_name(value_coded,@locale) end) "location_out",
max(case when concept_id = @adm_location then location_name(value_text) end) "adm_location"
max(case when concept_id = @adm_location then location_name(if(value_text<999,value_text,null)) end) "adm_location"
from temp_obs
group by encounter_id;

Expand Down Expand Up @@ -133,4 +133,4 @@ CASE WHEN disposition_code=concept_from_mapping('PIH','8623') THEN location_with
CASE WHEN disposition_code=concept_from_mapping('PIH','8624') THEN location_out ELSE NULL END AS external_transfer_location,
index_asc,
index_desc
FROM temp_consult_encs;
FROM temp_consult_encs;