Created
January 30, 2020 22:01
-
-
Save cbare/56d741a298fa35919b85dd4324c390aa to your computer and use it in GitHub Desktop.
Look up ICD10 codes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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]}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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