Skip to content

Commit

Permalink
Merge pull request #277 from smart-on-fhir/mikix/covid-codes
Browse files Browse the repository at this point in the history
feat(covid-symptom): add BCH/Cerner-specific ED codes
  • Loading branch information
mikix authored Oct 3, 2023
2 parents 31c2557 + 2e20fbf commit 0cdf86d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
39 changes: 27 additions & 12 deletions cumulus_etl/etl/studies/covid_symptom/covid_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@

# List of recognized emergency department note types. We'll add more as we discover them in use.
ED_CODES = {
"http://cumulus.smarthealthit.org/i2b2": {
"NOTE:3710480",
"NOTE:3807712",
"NOTE:149798455",
"NOTE:159552404",
"NOTE:189094576",
"NOTE:189094619",
"NOTE:189094644",
"NOTE:318198107",
"NOTE:318198110",
"NOTE:318198113",
},
"http://loinc.org": {
"18842-5", # Discharge Summary
"28568-4", # Physician Emergency department Note
Expand All @@ -41,6 +29,33 @@
"74187-6", # InterRAI Emergency Screener for Psychiatry (ESP) Document
"74211-4", # Summary of episode note Emergency department+Hospital
},
# The above _should_ be enough if everything is coded well.
# But sometimes not every document has a LOINC coding included.
# Below are some site-specific coding systems and their ED codes, to help fill in those gaps.
"http://cumulus.smarthealthit.org/i2b2": { # BCH i2b2
"NOTE:3710480", # ED Consultation
"NOTE:3807712", # ED Note
"NOTE:149798455", # Emergency MD
"NOTE:159552404", # ED Note Scanned
"NOTE:189094576", # ED Scanned
"NOTE:189094619", # SANE Report
"NOTE:189094644", # Emergency Dept Scanned Forms
"NOTE:318198107", # ED Social Work Assessment
"NOTE:318198110", # ED Social Work Brief Screening
"NOTE:318198113", # ED Social Work
},
"https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/72": { # BCH Cerner
"3710480", # ED Consultation
"3807712", # ED Note
"149798455", # Emergency MD
"159552404", # ED Note Scanned
"189094576", # ED Scanned
"189094619", # SANE Report
"189094644", # Emergency Dept Scanned Forms
"318198107", # ED Social Work Assessment
"318198110", # ED Social Work Brief Screening
"318198113", # ED Social Work
},
}


Expand Down
5 changes: 5 additions & 0 deletions tests/covid_symptom/test_nlp_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ async def test_unknown_modifier_extensions_skipped_for_nlp_symptoms(self):
# Invalid codes
([], False),
([{"system": "http://cumulus.smarthealthit.org/i2b2", "code": "NOTE:0"}], False),
([{"system": "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/72", "code": "0"}], False),
([{"system": "http://loinc.org", "code": "00000-0"}], False),
([{"system": "http://example.org", "code": "nope"}], False),
# Valid codes
([{"system": "http://cumulus.smarthealthit.org/i2b2", "code": "NOTE:3710480"}], True),
(
[{"system": "https://fhir.cerner.com/96976f07-eccb-424c-9825-e0d0b887148b/codeSet/72", "code": "3710480"}],
True,
),
([{"system": "http://loinc.org", "code": "57053-1"}], True),
([{"system": "nope", "code": "nope"}, {"system": "http://loinc.org", "code": "57053-1"}], True),
)
Expand Down

0 comments on commit 0cdf86d

Please sign in to comment.