Skip to content

Instantly share code, notes, and snippets.

@cbare
Created January 30, 2020 22:01
Show Gist options
  • Save cbare/56d741a298fa35919b85dd4324c390aa to your computer and use it in GitHub Desktop.
Save cbare/56d741a298fa35919b85dd4324c390aa to your computer and use it in GitHub Desktop.
Look up ICD10 codes.
"""
Look up ICD10 codes.
Using data from the CDC's refence page here:
https://www.cdc.gov/nchs/icd/icd10cm.htm
"""
import sys
from xml.etree import ElementTree as et
x = et.parse('/Users/christopherbare/Downloads/icd10cm_tabular_2020.xml')
icd10 = {d.find('name').text:d.find('desc').text
for d in x.findall('.//diag')}
if __name__ == "__main__":
for line in sys.stdin:
code = line.strip()
print(f'{code:10} {icd10[code]}')
@cbare
Copy link
Author

cbare commented Jan 30, 2020

Useage:

http post localhost:5000/20190701/diagnosis/ICD-10-CM
text='I have flu symptoms with aches, chills and sore throat'
age:=33
sex=M
"Authorization:Bearer $JWT" |
jq -r '.diagnoses[].id' |
sort |
python3 ~/Documents/projects/scripts/icd10.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment