Skip to content

Commit

Permalink
Use boolean results or 'None' (#24)
Browse files Browse the repository at this point in the history
* "No" result replaced with boolean/None as appropriate for COVID Diagnosis and/or PCR

* updated to fix linter complaints

* fixed LINTER complaint

* LINTER is a pesky eater :)
  • Loading branch information
comorbidity authored Aug 16, 2023
1 parent bccd336 commit bdc314f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions cumulus_library_covid/covid_symptom/table_prevalence_ed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,12 @@ join_2020 AS (
p.enc_class_code,
p.subject_ref,
p.encounter_ref,
COALESCE(pcr.covid_pcr_result_display, 'No PCR') AS covid_pcr_result,
CASE
WHEN dx.cond_code IS NOT NULL THEN 'COVID ICD10' ELSE 'No COVID ICD10'
END AS covid_icd10,
CASE
WHEN
(dx.cond_code IS NOT NULL OR pcr.covid_pcr_result_display = 'POSITIVE')
THEN 'COVID DX'
ELSE 'No COVID DX'
END AS covid_dx,
COALESCE(nlp.symptom_display, 'No Symptom') AS covid_symptom,
COALESCE(icd10.icd10_display, 'No Symptom ICD10') AS symptom_icd10_display
COALESCE(pcr.covid_pcr_result_display, 'None') AS covid_pcr_result,
COALESCE(dx.cond_code, 'None') AS covid_icd10,
(dx.cond_code IS NOT NULL OR pcr.covid_pcr_result_display = 'POSITIVE')
AS covid_dx,
COALESCE(nlp.symptom_display, 'None') AS covid_symptom,
COALESCE(icd10.icd10_display, 'None') AS symptom_icd10_display
FROM from_period AS p
LEFT JOIN covid_symptom__dx AS dx ON p.encounter_ref = dx.encounter_ref
LEFT JOIN covid_symptom__pcr AS pcr ON p.encounter_ref = pcr.encounter_ref
Expand Down

0 comments on commit bdc314f

Please sign in to comment.