├── requirements.txt ├── .gitignore ├── tests ├── data │ ├── input │ │ ├── icd10_to_snomed_concept_relationship.csv │ │ ├── icd10_to_snomed_concept.csv │ │ └── icd10.csv │ ├── source_icd10_to_snomed_failed_mappings_example_expected_result.csv │ └── expected │ │ ├── icd10_to_snomed_failed_mappings.csv │ │ └── icd10_to_snomed.csv └── test_cwmed.py ├── pyproject.toml ├── LICENSE ├── .github └── workflows │ └── crosswalk-tests.yml ├── sample-data ├── output │ ├── icd10_to_snomed_failed_mappings.csv │ └── icd10_to_snomed.csv └── input │ └── icd10.csv ├── README.md ├── demo.ipynb └── cwmed └── __init__.py /requirements.txt: -------------------------------------------------------------------------------- 1 | pandas==1.5.0 2 | requests==2.28.1 3 | pytest==7.1.3 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # DICTIONARIES 2 | concept.csv 3 | concept_relationship.csv 4 | 5 | # OSX MAC FILE 6 | .DS_Store 7 | 8 | # ipynb chekcpoints ignore 9 | 10 | .ipynb_checkpoints/*.* 11 | 12 | -------------------------------------------------------------------------------- /tests/data/input/icd10_to_snomed_concept_relationship.csv: -------------------------------------------------------------------------------- 1 | concept_id_1 concept_id_2 relationship_id valid_start_date valid_end_date invalid_reason 2 | 35205417 192815 Maps to 19700101 20991231 3 | 35206332 1567619 Is a 20160325 20991231 -------------------------------------------------------------------------------- /tests/data/input/icd10_to_snomed_concept.csv: -------------------------------------------------------------------------------- 1 | concept_id concept_name domain_id vocabulary_id concept_class_id standard_concept concept_code valid_start_date valid_end_date invalid_reason 2 | 35205417 Other intestinal Escherichia coli infections Condition ICD10CM 4-char billing code A04.4 20070101 20991231 3 | 192815 Intestinal infection due to E. coli Condition SNOMED Clinical Finding S 111839008 20020131 20991231 4 | 35206332 Secondary malignant neoplasm of liver and intrahepatic bile duct Measurement ICD10CM 4-char billing code C78.7 20070101 20991231 5 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "cwmed" 3 | version = "0.1.0" 4 | description = "Crosswalk Medical: crosswalk between source and target medical terminologies." 5 | authors = [ 6 | { name="The Laboratory for Computational Physiology", email="contact@physionet.org" }, 7 | ] 8 | readme = "README.md" 9 | license = { file="LICENSE" } 10 | requires-python = ">=3.7" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | 17 | 18 | 19 | dependencies = [ 20 | "requests >= 2.8.1", 21 | "pandas >= 1.0.0", 22 | ] 23 | 24 | [project.urls] 25 | "Homepage" = "https://github.com/MIT-LCP/cwmed" 26 | "Bug Tracker" = "https://github.com/MIT-LCP/cwmed" 27 | 28 | [tool.setuptools] 29 | packages=["cwmed"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 xborrat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/crosswalk-tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions 3 | 4 | name: Python package 5 | 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ "main" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | python-version: ["3.9", "3.10"] 20 | include: 21 | - python-version: "3.10" 22 | coverage: 1 23 | steps: 24 | - uses: actions/checkout@v3 25 | - name: Set up Python ${{ matrix.python-version }} 26 | uses: actions/setup-python@v3 27 | with: 28 | python-version: ${{ matrix.python-version }} 29 | cache: 'pip' 30 | - name: Install dependencies 31 | run: | 32 | python -m pip install . 33 | python -m pip install --upgrade pip 34 | python -m pip install flake8 pytest 35 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 36 | - name: Lint with flake8 37 | run: | 38 | # stop the build if there are Python syntax errors or undefined names 39 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics 40 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide 41 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics 42 | - name: Test with pytest 43 | run: | 44 | pytest 45 | -------------------------------------------------------------------------------- /sample-data/output/icd10_to_snomed_failed_mappings.csv: -------------------------------------------------------------------------------- 1 | ICD10CM,ICD10CM_label,ICD10CM_omop_id,SNOMED,SNOMED_label,SNOMED_omop_id 2 | C78.7,Secondary malignant neoplasm of liver and intrahepatic bile duct,,,, 3 | Z77.22,Contact with and (suspected) exposure to environmental tobacco smoke (acute) (chronic),,,, 4 | Z85.038,Personal history of other malignant neoplasm of large intestine,,,, 5 | Z85.048,"Personal history of other malignant neoplasm of rectum, rectosigmoid junction, and anus",,,, 6 | Z85.05,Personal history of malignant neoplasm of liver,,,, 7 | Z85.118,Personal history of other malignant neoplasm of bronchus and lung,,,, 8 | Z85.21,Personal history of malignant neoplasm of larynx,,,, 9 | Z85.3,Personal history of malignant neoplasm of breast,,,, 10 | Z85.46,Personal history of malignant neoplasm of prostate,,,, 11 | Z85.51,Personal history of malignant neoplasm of bladder,,,, 12 | Z85.528,Personal history of other malignant neoplasm of kidney,,,, 13 | Z85.820,Personal history of malignant melanoma of skin,,,, 14 | Z85.89,Personal history of malignant neoplasm of other organs and systems,,,, 15 | Z86.010,Personal history of colonic polyps,,,, 16 | Z86.11,Personal history of tuberculosis,,,, 17 | Z86.61,Personal history of infections of the central nervous system,,,, 18 | Z86.711,Personal history of pulmonary embolism,,,, 19 | Z86.718,Personal history of other venous thrombosis and embolism,,,, 20 | Z86.73,"Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits",,,, 21 | Z87.11,Personal history of peptic ulcer disease,,,, 22 | Z87.440,Personal history of urinary (tract) infections,,,, 23 | Z87.81,Personal history of (healed) traumatic fracture,,,, 24 | Z87.820,Personal history of traumatic brain injury,,,, 25 | Z87.891,Personal history of nicotine dependence,,,, 26 | Z90.10,Acquired absence of unspecified breast and nipple,,,, 27 | Z90.12,Acquired absence of left breast and nipple,,,, 28 | Z90.79,Acquired absence of other genital organ(s),,,, 29 | Z91.81,History of falling,,,, 30 | Z92.21,Personal history of antineoplastic chemotherapy,,,, 31 | Z92.25,Personal history of immunosuppression therapy,,,, 32 | Z92.3,Personal history of irradiation,,,, 33 | Z94.83,Pancreas transplant status,,,, 34 | Z94.84,Stem cells transplant status,,,, 35 | Z95.810,Presence of automatic (implantable) cardiac defibrillator,,,, 36 | Z95.820,Peripheral vascular angioplasty status with implants and grafts,,,, 37 | Z95.828,Presence of other vascular implants and grafts,,,, 38 | Z96.0,Presence of urogenital implants,,,, 39 | Z96.642,Presence of left artificial hip joint,,,, 40 | Z98.0,Intestinal bypass and anastomosis status,,,, 41 | Z98.84,Bariatric surgery status,,,, 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Crosswalk Medical 2 | 3 | ## Introduction 4 | 5 | Crosswalk medical faciliates the conversion of clinical terminology between two different coding systems. This enables seemless data exchange, integration and interoperability between different healthcare information systems, overcoming barries imposed by disparate coding systems. 6 | 7 | ## Documentation and Usage 8 | 9 | Crosswalk medical is a Python package to assist the semantic interoperability when federating clinical databases. The objective of the package is to guide the crosswalk from one standard source vocabulary to a target vocabulary by defining concepts and utilizing semantic relationships avaliable via downloadable source and target dictionaries on [Athena](https://athena.ohdsi.org/vocabulary/list) that capture associations between two different concepts. 10 | 11 | See [Downloading Source and Target Vocabularies](#download-vocabs) section for downloading source and target vocabularies. 12 | 13 | See [Installation](#install) section for package installation. 14 | 15 | See [demo.ipynb](https://github.com/MIT-LCP/cwmed/blob/main/demo.ipynb) notebook file for example use cases. 16 | 17 | ## Installation 18 | 19 | The distribution is hosted on PyPI at: https://pypi.org/project/cwmed/0.1.0/. The package can be directly installed from PyPI using pip: 20 | 21 | ```sh 22 | pip install cwmed 23 | ``` 24 | 25 | ## Downloading Source and Target Vocabularies 26 | 27 | Register on [Athena](https://athena.ohdsi.org/vocabulary/list), log in, and select the desired source and target vocabularies for download. 28 | 29 | A link will be sent to your registered email to enable the download of a ZIP file that will include these dependencies: 30 | 31 | CONCEPT.csv: This dictionary contains the relation between concept_code and concept_id.
32 | CONCEPT_RELATIONSHIP.csv: This dictionary contains the relationships between the different `concept_id(s). We will use the "Maps to" type of relation to translate codes between dictionaries. 33 | These files are dictionaries that need to be stored in the same folder as the python notebook. 34 | 35 | Few examaples of downloadable vocabularies avaliable on Athena: 36 | 37 | LOINC - Logical Observation Identifiers Names and Codes (Regenstrief Institute)
38 | SNOMED - Systematic Nomenclature of Medicine - Clinical Terms (IHTSDO)
39 | NDC - National Drug Code (FDA and manufacturers)
40 | RxNorm Extension - RxNorm Extension (OHDSI)
41 | RxNorm - RxNorm (NLM)
42 | ICD10CM - International Classification of Diseases, Tenth Revision, Clinical Modification (NCHS)
43 | ICD9CM - International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 1 and 2 (NCHS)
44 | ICD9Proc - International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 3 (NCHS)
45 | CPT4 - Current Procedural Terminology version 4 (AMA)
46 | OMOP Extension - OMOP Extension (OHDSI)
47 | 48 | ### Crosswalk Medical Recipe 49 | 50 | Definitions: 51 | `concept_code`: code from the source vocabulary that represents one concept. 52 | Example: For the concept (0.5 ML Fondaparinux sodium 5 MG/ML Prefilled Syringe [Arixtra] the concept_code for NDC is: 00007323001 53 | `concept_id`: code from [OMOP](https://www.ohdsi.org/data-standardization/) that corresponds to a concept_code. 54 | Example: For concept (0.5 ML Fondaparinux sodium 5 MG/ML Prefilled Syringe [Arixtra] the concept_id corresponding to concept_code 00007323001 is 44838028. 55 | 56 | Every concept_code has a related `concept_id`. The `concept_code` does not converge to a `concept_id`: For the same concept(amoxicillin 250mg Oral Capsule), there will be different OMOP codes(concept_id) one for each vocabulary. Those `concept_id`(s) are related in the dictionary concept_relationship. 57 | |DRUG | VOCAB | concept_code | concept_id | 58 | |-------------------------------| -------- | ------------ | ------- | 59 | amoxicillin 250 MG Oral Capsule | RX NORM | 308182 | 19073183 | 60 | amoxicillin 250 MG Oral Capsule| NDC | 44420386 | 43858035231 | 61 | 62 | Every `concept_code` has a different `concept_id` even though they represent the same concept in the real world. In the above table, the same drug has two different `concept_code`s for each vocabulary and also a different `concept_id`. 63 | 64 | 65 | ### Use Case 66 | 67 | Use Case: Translate [amoxicillin 250 MG Oral Capsule] from RxNorm code to NDC code. 68 | 69 | Step 1: 70 | Translate the source code to the OMOP code. 71 | CONCEPT_CODE(SOURCE CODE)-- CONCEPT --> CONCEPT_ID(OMOP CODE) 72 | 73 | 74 | | VOCAB | concept_code (RX NORM) | concept_id | 75 | | -------- | ------------ | ------- | 76 | | RX NORM | 308182 | 19073183 | 77 | 78 | Step 2: 79 | Use the concept_relationship dictionary to relate the `concept_id` obtained from step 1 and map it to the target vocabulary `concept_id` . 80 | 81 | CONCEPT_ID_1(OMOP CODE FROM SOURCE VOCAB) --> CONCEPT_RELATIONSHIP --> CONCEPT_ID_2(OMOP CODE FROM TARGET VOCAB) 82 | 83 | source concept_id is concept_id_1 and target concept_id is concept_id_2 84 | 85 | | concept_id_1 | concept_id_2 | 86 | | --------- | ---------- | 87 | | 19073183 | 44420386 | 88 | 89 | Step 3: 90 | Use the new concept_id_2 to obtain the `concept_code` of the target vocabulary. 91 | 92 | CONCEPT_ID_2(OMOP CODE FROM TARGET VOCAB) -->CONCEPT--> CONCEPT_CODE(TARGET CODE) 93 | 94 | | VOCAB | concept_id| concept_code (NDC) | 95 | | -------- | ------------ | ------- | 96 | | NDC | 44420386 | 43858035231 | 97 | -------------------------------------------------------------------------------- /tests/test_cwmed.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tempfile 3 | import unittest 4 | 5 | import numpy as np 6 | import pandas as pd 7 | from pandas.testing import assert_frame_equal 8 | import filecmp 9 | 10 | import cwmed as cw 11 | 12 | class TestCW(unittest.TestCase): 13 | 14 | def setUp(self): 15 | """ 16 | Initializes a VocabTranslator object with the following details: 17 | - Source file path: 'tests/data/input/icd10.csv' (column 'icd10' contains the ICD10 codes) 18 | - Concept mapping file: 'tests/data/input/icd10_to_snomed_concept.csv' 19 | - Vocabulary values: Source as 'ICD10CM' and target as 'SNOMED' 20 | - Relationship mapping file: 'tests/data/input/icd10_to_snomed_concept_relationship.csv' 21 | 22 | Additionally, sets up a temporary directory for testing. Within this directory, an output file named 23 | 'output.csv' is specified, and its complete path is determined and stored for later use. 24 | """ 25 | 26 | self.vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 27 | source_code_col = 'icd10', 28 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 29 | source_vocab_value = 'ICD10CM', 30 | target_vocab_value = 'SNOMED', 31 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 32 | self.temp_directory = tempfile.TemporaryDirectory() 33 | self.temp_path_to_directory = self.temp_directory.name 34 | self.output_file = 'output.csv' 35 | self.output_path = os.path.join(self.temp_path_to_directory,self.output_file) 36 | 37 | def tearDown(self): 38 | """ 39 | Deletes the temporary directory created during test setup. 40 | """ 41 | 42 | self.temp_directory.cleanup() 43 | 44 | def test_crosswalk_between_icd10_snomed(self): 45 | """ 46 | Tests that the source code, e.g. icd10 code of 'A04.4' from the source file 47 | is mapped to the expected target standardized code, e.g. snomed code, '111839008' 48 | in the source to target file. 49 | """ 50 | target_df = self.vocab.target_table 51 | target_column = self.vocab.target_vocab_value 52 | source_column = self.vocab.source_vocab_value 53 | target_row = target_df.loc[target_df[source_column] == 'A04.4'] 54 | snomed_target_code = target_row[target_column].values 55 | expected_target_code = ['111839008'] 56 | self.assertEqual(expected_target_code, snomed_target_code) 57 | 58 | def test_save_source_to_target_function(self): 59 | """ 60 | Tests that the saved source to target dataframe for icd10 code 'A04.4' 61 | and snomed code '111839008' is equal to the expected dataframe. 62 | """ 63 | self.vocab.save_source_to_target(self.output_path) 64 | result = pd.read_csv(self.output_path) 65 | source_column = self.vocab.source_vocab_value 66 | result = result.loc[result[source_column] == 'A04.4'] 67 | expected = pd.read_csv('tests/data/expected/icd10_to_snomed.csv') 68 | expected = expected.loc[expected[source_column] == 'A04.4'] 69 | self._compare_csvfiles(self.output_path,'tests/data/expected/icd10_to_snomed.csv') 70 | assert_frame_equal(result, expected) 71 | 72 | def test_save_source_to_target_failed_mappings_function(self): 73 | """ 74 | Tests that the dataframe containing source code e.g. icd10 of 'C78.7' from the source file 75 | has failed to map to a snomed code as part of the failed mappings csv. 76 | """ 77 | self.vocab.save_source_to_target_failed_mappings(self.output_path) 78 | result = pd.read_csv(self.output_path) 79 | source_column = self.vocab.source_vocab_value 80 | result = result.loc[result[source_column] == 'C78.7'] 81 | expected = pd.read_csv('tests/data/expected/icd10_to_snomed_failed_mappings.csv') 82 | expected = expected.loc[expected[source_column] == 'C78.7'] 83 | self._compare_csvfiles(self.output_path,'tests/data/expected/icd10_to_snomed_failed_mappings.csv') 84 | assert_frame_equal(result, expected) 85 | 86 | def _compare_csvfiles(self,file1,file2): 87 | """ 88 | Compares two CSV files and asserts that they are identical. 89 | 90 | Args: 91 | file1 (str): The path to the first CSV file. 92 | file2 (str): The path to the second CSV file. 93 | """ 94 | self.assertTrue(filecmp.cmp(file1, file2)) 95 | 96 | def test_get_unique_vocab_returns_expected_output_as_np_ndarray(self): 97 | """ 98 | Tests the get_unique_vocab function from the 99 | cw module. It asserts that the output of the function is of the same 100 | type and has the same elements as the expected output, which is an array 101 | containing the strings 'ICD10CM' and 'SNOMED'. The function is passed the 102 | file path 'tests/data/input/icd10_to_snomed_concept.csv' as an argument. 103 | """ 104 | expected_output = np.array(['ICD10CM', 'SNOMED']) 105 | filepath = 'tests/data/input/icd10_to_snomed_concept.csv' 106 | output = cw.get_unique_vocab(filepath) 107 | assert (type(expected_output) == type(output) and 108 | np.array_equal(expected_output, output)) 109 | 110 | if __name__=='__main__': 111 | unittest.main() -------------------------------------------------------------------------------- /sample-data/input/icd10.csv: -------------------------------------------------------------------------------- 1 | icd10 2 | A04.4 3 | A04.7 4 | A04.72 5 | A07.1 6 | A08.11 7 | A31.8 8 | A41.51 9 | A41.81 10 | A41.89 11 | A41.9 12 | A87.2 13 | B02.9 14 | B18.2 15 | B20 16 | B37.1 17 | B44.1 18 | B57.2 19 | B95.2 20 | B95.7 21 | B96.1 22 | B96.20 23 | B96.5 24 | B96.89 25 | C16.0 26 | C18.1 27 | C18.2 28 | C18.8 29 | C34.31 30 | C34.90 31 | C44.311 32 | C44.319 33 | C78.00 34 | C78.02 35 | C78.7 36 | C79.51 37 | C79.70 38 | C79.89 39 | C82.90 40 | C83.00 41 | C83.39 42 | C88.4 43 | C90.10 44 | C92.02 45 | D18.03 46 | D22.39 47 | D46.9 48 | D47.2 49 | D47.Z1 50 | D50.0 51 | D50.8 52 | D50.9 53 | D52.0 54 | D53.8 55 | D59.1 56 | D59.9 57 | D63.1 58 | D63.8 59 | D64.9 60 | D68.51 61 | D69.49 62 | D69.6 63 | D70.1 64 | D70.3 65 | D72.820 66 | D89.811 67 | E03.8 68 | E03.9 69 | E04.2 70 | E05.90 71 | E09.9 72 | E10.21 73 | E10.22 74 | E10.319 75 | E10.3559 76 | E10.40 77 | E10.43 78 | E10.51 79 | E10.610 80 | E10.65 81 | E11.21 82 | E11.22 83 | E11.319 84 | E11.51 85 | E11.649 86 | E11.65 87 | E11.9 88 | E21.1 89 | E21.3 90 | E22.1 91 | E22.2 92 | E53.8 93 | E55.9 94 | E66.3 95 | E66.9 96 | E78.00 97 | E78.1 98 | E78.5 99 | E79.0 100 | E80.4 101 | E83.42 102 | E83.51 103 | E86.0 104 | E87.1 105 | E87.5 106 | E87.6 107 | E89.0 108 | F01.50 109 | F05 110 | F10.10 111 | F10.21 112 | F14.10 113 | F17.210 114 | F17.290 115 | F20.0 116 | F25.1 117 | F32.9 118 | F41.1 119 | F41.8 120 | F41.9 121 | F91.8 122 | G20 123 | G31.84 124 | G31.89 125 | G47.33 126 | G50.0 127 | G81.91 128 | G81.94 129 | G89.21 130 | G89.3 131 | G93.49 132 | H11.30 133 | H26.9 134 | H35.3290 135 | H35.52 136 | H40.9 137 | H44.522 138 | H49.21 139 | H52.202 140 | H53.2 141 | H54.0 142 | H54.51 143 | H54.7 144 | H91.10 145 | H91.93 146 | I08.0 147 | I10 148 | I11.0 149 | I12.0 150 | I12.9 151 | I13.0 152 | I21.29 153 | I21.4 154 | I25.10 155 | I25.2 156 | I25.82 157 | I26.99 158 | I27.2 159 | I28.0 160 | I30.0 161 | I31.1 162 | I31.3 163 | I31.4 164 | I42.0 165 | I42.2 166 | I44.2 167 | I46.9 168 | I47.2 169 | I48.0 170 | I48.91 171 | I49.01 172 | I50.1 173 | I50.33 174 | I50.9 175 | I51.89 176 | I51.9 177 | I61.8 178 | I63.231 179 | I63.411 180 | I65.29 181 | I67.82 182 | I70.213 183 | I70.293 184 | I70.90 185 | I72.2 186 | I73.9 187 | I74.3 188 | I77.6 189 | I81 190 | I82.611 191 | I87.2 192 | I97.131 193 | I97.191 194 | J15.0 195 | J18.9 196 | J22 197 | J33.9 198 | J38.02 199 | J38.4 200 | J43.9 201 | J44.0 202 | J44.1 203 | J44.9 204 | J45.909 205 | J47.0 206 | J47.1 207 | J47.9 208 | J69.0 209 | J84.116 210 | J90 211 | J91.8 212 | J93.12 213 | J96.00 214 | J96.01 215 | J98.11 216 | J98.4 217 | K22.2 218 | K29.80 219 | K31.7 220 | K31.84 221 | K31.89 222 | K35.3 223 | K40.90 224 | K42.9 225 | K43.2 226 | K44.9 227 | K52.3 228 | K52.89 229 | K55.21 230 | K56.0 231 | K57.10 232 | K57.30 233 | K57.31 234 | K58.9 235 | K59.00 236 | K62.6 237 | K63.5 238 | K64.0 239 | K64.8 240 | K65.1 241 | K65.9 242 | K66.1 243 | K68.11 244 | K68.12 245 | K70.30 246 | K75.4 247 | K76.6 248 | K76.89 249 | K81.0 250 | K82.8 251 | K90.0 252 | K91.840 253 | K92.1 254 | L03.113 255 | L03.818 256 | L27.0 257 | L80 258 | L97.919 259 | M08.29 260 | M10.9 261 | M12.9 262 | M15.9 263 | M19.011 264 | M19.91 265 | M1A.0221 266 | M20.12 267 | M23.321 268 | M23.8X2 269 | M32.9 270 | M35.2 271 | M41.20 272 | M47.12 273 | M51.26 274 | M54.5 275 | M81.0 276 | M84.48XA 277 | M84.58XA 278 | M85.9 279 | M87.052 280 | N04.9 281 | N10 282 | N17.0 283 | N17.9 284 | N18.3 285 | N18.4 286 | N18.5 287 | N18.6 288 | N18.9 289 | N20.0 290 | N28.1 291 | N39.0 292 | N39.498 293 | N40.0 294 | N41.0 295 | N81.3 296 | N84.1 297 | Q24.8 298 | Q25.0 299 | Q44.6 300 | Q61.3 301 | Q89.09 302 | R04.2 303 | R10.13 304 | R13.19 305 | R19.7 306 | R26.89 307 | R29.705 308 | R29.710 309 | R29.720 310 | R31.0 311 | R33.8 312 | R33.9 313 | R40.4 314 | R42 315 | R43.2 316 | R47.1 317 | R50.81 318 | R55 319 | R60.1 320 | R65.21 321 | R74.0 322 | R78.81 323 | R79.1 324 | R82.71 325 | R82.99 326 | R91.8 327 | S20.212A 328 | S30.0XXA 329 | S32.431A 330 | S32.601A 331 | S32.89XD 332 | S83.122A 333 | T36.1X5A 334 | T40.2X5A 335 | T42.4X5A 336 | T45.1X5A 337 | T46.2X5A 338 | T81.4XXA 339 | T82.867A 340 | T82.868A 341 | T82.897A 342 | T85.611A 343 | T86.11 344 | T86.19 345 | T86.41 346 | T86.891 347 | T87.89 348 | W18.30XA 349 | W18.39XD 350 | Y83.0 351 | Y83.1 352 | Y83.5 353 | Y83.8 354 | Y84.1 355 | Y84.8 356 | Y95 357 | Z00.00 358 | Z15.09 359 | Z16.12 360 | Z16.35 361 | Z21 362 | Z22.1 363 | Z22.39 364 | Z45.010 365 | Z51.6 366 | Z53.09 367 | Z53.32 368 | Z53.8 369 | Z59.3 370 | Z60.2 371 | Z63.8 372 | Z68.29 373 | Z74.3 374 | Z77.22 375 | Z79.01 376 | Z79.02 377 | Z79.4 378 | Z79.52 379 | Z79.82 380 | Z79.84 381 | Z80.0 382 | Z81.8 383 | Z85.038 384 | Z85.048 385 | Z85.05 386 | Z85.118 387 | Z85.21 388 | Z85.3 389 | Z85.46 390 | Z85.51 391 | Z85.528 392 | Z85.820 393 | Z85.89 394 | Z86.010 395 | Z86.11 396 | Z86.61 397 | Z86.711 398 | Z86.718 399 | Z86.73 400 | Z87.11 401 | Z87.440 402 | Z87.81 403 | Z87.820 404 | Z87.891 405 | Z88.0 406 | Z88.1 407 | Z88.2 408 | Z88.6 409 | Z88.8 410 | Z89.029 411 | Z89.411 412 | Z89.412 413 | Z89.421 414 | Z89.422 415 | Z89.511 416 | Z89.512 417 | Z90.10 418 | Z90.12 419 | Z90.2 420 | Z90.3 421 | Z90.49 422 | Z90.5 423 | Z90.79 424 | Z91.041 425 | Z91.09 426 | Z91.19 427 | Z91.81 428 | Z92.21 429 | Z92.25 430 | Z92.3 431 | Z93.2 432 | Z93.3 433 | Z94.0 434 | Z94.4 435 | Z94.7 436 | Z94.83 437 | Z94.84 438 | Z95.0 439 | Z95.1 440 | Z95.2 441 | Z95.3 442 | Z95.5 443 | Z95.810 444 | Z95.820 445 | Z95.828 446 | Z96.0 447 | Z96.642 448 | Z98.0 449 | Z98.84 450 | Z99.2 451 | Z99.3 452 | Z99.89 453 | -------------------------------------------------------------------------------- /tests/data/input/icd10.csv: -------------------------------------------------------------------------------- 1 | icd10 2 | A04.4 3 | A04.7 4 | A04.72 5 | A07.1 6 | A08.11 7 | A31.8 8 | A41.51 9 | A41.81 10 | A41.89 11 | A41.9 12 | A87.2 13 | B02.9 14 | B18.2 15 | B20 16 | B37.1 17 | B44.1 18 | B57.2 19 | B95.2 20 | B95.7 21 | B96.1 22 | B96.20 23 | B96.5 24 | B96.89 25 | C16.0 26 | C18.1 27 | C18.2 28 | C18.8 29 | C34.31 30 | C34.90 31 | C44.311 32 | C44.319 33 | C78.00 34 | C78.02 35 | C78.7 36 | C79.51 37 | C79.70 38 | C79.89 39 | C82.90 40 | C83.00 41 | C83.39 42 | C88.4 43 | C90.10 44 | C92.02 45 | D18.03 46 | D22.39 47 | D46.9 48 | D47.2 49 | D47.Z1 50 | D50.0 51 | D50.8 52 | D50.9 53 | D52.0 54 | D53.8 55 | D59.1 56 | D59.9 57 | D63.1 58 | D63.8 59 | D64.9 60 | D68.51 61 | D69.49 62 | D69.6 63 | D70.1 64 | D70.3 65 | D72.820 66 | D89.811 67 | E03.8 68 | E03.9 69 | E04.2 70 | E05.90 71 | E09.9 72 | E10.21 73 | E10.22 74 | E10.319 75 | E10.3559 76 | E10.40 77 | E10.43 78 | E10.51 79 | E10.610 80 | E10.65 81 | E11.21 82 | E11.22 83 | E11.319 84 | E11.51 85 | E11.649 86 | E11.65 87 | E11.9 88 | E21.1 89 | E21.3 90 | E22.1 91 | E22.2 92 | E53.8 93 | E55.9 94 | E66.3 95 | E66.9 96 | E78.00 97 | E78.1 98 | E78.5 99 | E79.0 100 | E80.4 101 | E83.42 102 | E83.51 103 | E86.0 104 | E87.1 105 | E87.5 106 | E87.6 107 | E89.0 108 | F01.50 109 | F05 110 | F10.10 111 | F10.21 112 | F14.10 113 | F17.210 114 | F17.290 115 | F20.0 116 | F25.1 117 | F32.9 118 | F41.1 119 | F41.8 120 | F41.9 121 | F91.8 122 | G20 123 | G31.84 124 | G31.89 125 | G47.33 126 | G50.0 127 | G81.91 128 | G81.94 129 | G89.21 130 | G89.3 131 | G93.49 132 | H11.30 133 | H26.9 134 | H35.3290 135 | H35.52 136 | H40.9 137 | H44.522 138 | H49.21 139 | H52.202 140 | H53.2 141 | H54.0 142 | H54.51 143 | H54.7 144 | H91.10 145 | H91.93 146 | I08.0 147 | I10 148 | I11.0 149 | I12.0 150 | I12.9 151 | I13.0 152 | I21.29 153 | I21.4 154 | I25.10 155 | I25.2 156 | I25.82 157 | I26.99 158 | I27.2 159 | I28.0 160 | I30.0 161 | I31.1 162 | I31.3 163 | I31.4 164 | I42.0 165 | I42.2 166 | I44.2 167 | I46.9 168 | I47.2 169 | I48.0 170 | I48.91 171 | I49.01 172 | I50.1 173 | I50.33 174 | I50.9 175 | I51.89 176 | I51.9 177 | I61.8 178 | I63.231 179 | I63.411 180 | I65.29 181 | I67.82 182 | I70.213 183 | I70.293 184 | I70.90 185 | I72.2 186 | I73.9 187 | I74.3 188 | I77.6 189 | I81 190 | I82.611 191 | I87.2 192 | I97.131 193 | I97.191 194 | J15.0 195 | J18.9 196 | J22 197 | J33.9 198 | J38.02 199 | J38.4 200 | J43.9 201 | J44.0 202 | J44.1 203 | J44.9 204 | J45.909 205 | J47.0 206 | J47.1 207 | J47.9 208 | J69.0 209 | J84.116 210 | J90 211 | J91.8 212 | J93.12 213 | J96.00 214 | J96.01 215 | J98.11 216 | J98.4 217 | K22.2 218 | K29.80 219 | K31.7 220 | K31.84 221 | K31.89 222 | K35.3 223 | K40.90 224 | K42.9 225 | K43.2 226 | K44.9 227 | K52.3 228 | K52.89 229 | K55.21 230 | K56.0 231 | K57.10 232 | K57.30 233 | K57.31 234 | K58.9 235 | K59.00 236 | K62.6 237 | K63.5 238 | K64.0 239 | K64.8 240 | K65.1 241 | K65.9 242 | K66.1 243 | K68.11 244 | K68.12 245 | K70.30 246 | K75.4 247 | K76.6 248 | K76.89 249 | K81.0 250 | K82.8 251 | K90.0 252 | K91.840 253 | K92.1 254 | L03.113 255 | L03.818 256 | L27.0 257 | L80 258 | L97.919 259 | M08.29 260 | M10.9 261 | M12.9 262 | M15.9 263 | M19.011 264 | M19.91 265 | M1A.0221 266 | M20.12 267 | M23.321 268 | M23.8X2 269 | M32.9 270 | M35.2 271 | M41.20 272 | M47.12 273 | M51.26 274 | M54.5 275 | M81.0 276 | M84.48XA 277 | M84.58XA 278 | M85.9 279 | M87.052 280 | N04.9 281 | N10 282 | N17.0 283 | N17.9 284 | N18.3 285 | N18.4 286 | N18.5 287 | N18.6 288 | N18.9 289 | N20.0 290 | N28.1 291 | N39.0 292 | N39.498 293 | N40.0 294 | N41.0 295 | N81.3 296 | N84.1 297 | Q24.8 298 | Q25.0 299 | Q44.6 300 | Q61.3 301 | Q89.09 302 | R04.2 303 | R10.13 304 | R13.19 305 | R19.7 306 | R26.89 307 | R29.705 308 | R29.710 309 | R29.720 310 | R31.0 311 | R33.8 312 | R33.9 313 | R40.4 314 | R42 315 | R43.2 316 | R47.1 317 | R50.81 318 | R55 319 | R60.1 320 | R65.21 321 | R74.0 322 | R78.81 323 | R79.1 324 | R82.71 325 | R82.99 326 | R91.8 327 | S20.212A 328 | S30.0XXA 329 | S32.431A 330 | S32.601A 331 | S32.89XD 332 | S83.122A 333 | T36.1X5A 334 | T40.2X5A 335 | T42.4X5A 336 | T45.1X5A 337 | T46.2X5A 338 | T81.4XXA 339 | T82.867A 340 | T82.868A 341 | T82.897A 342 | T85.611A 343 | T86.11 344 | T86.19 345 | T86.41 346 | T86.891 347 | T87.89 348 | W18.30XA 349 | W18.39XD 350 | Y83.0 351 | Y83.1 352 | Y83.5 353 | Y83.8 354 | Y84.1 355 | Y84.8 356 | Y95 357 | Z00.00 358 | Z15.09 359 | Z16.12 360 | Z16.35 361 | Z21 362 | Z22.1 363 | Z22.39 364 | Z45.010 365 | Z51.6 366 | Z53.09 367 | Z53.32 368 | Z53.8 369 | Z59.3 370 | Z60.2 371 | Z63.8 372 | Z68.29 373 | Z74.3 374 | Z77.22 375 | Z79.01 376 | Z79.02 377 | Z79.4 378 | Z79.52 379 | Z79.82 380 | Z79.84 381 | Z80.0 382 | Z81.8 383 | Z85.038 384 | Z85.048 385 | Z85.05 386 | Z85.118 387 | Z85.21 388 | Z85.3 389 | Z85.46 390 | Z85.51 391 | Z85.528 392 | Z85.820 393 | Z85.89 394 | Z86.010 395 | Z86.11 396 | Z86.61 397 | Z86.711 398 | Z86.718 399 | Z86.73 400 | Z87.11 401 | Z87.440 402 | Z87.81 403 | Z87.820 404 | Z87.891 405 | Z88.0 406 | Z88.1 407 | Z88.2 408 | Z88.6 409 | Z88.8 410 | Z89.029 411 | Z89.411 412 | Z89.412 413 | Z89.421 414 | Z89.422 415 | Z89.511 416 | Z89.512 417 | Z90.10 418 | Z90.12 419 | Z90.2 420 | Z90.3 421 | Z90.49 422 | Z90.5 423 | Z90.79 424 | Z91.041 425 | Z91.09 426 | Z91.19 427 | Z91.81 428 | Z92.21 429 | Z92.25 430 | Z92.3 431 | Z93.2 432 | Z93.3 433 | Z94.0 434 | Z94.4 435 | Z94.7 436 | Z94.83 437 | Z94.84 438 | Z95.0 439 | Z95.1 440 | Z95.2 441 | Z95.3 442 | Z95.5 443 | Z95.810 444 | Z95.820 445 | Z95.828 446 | Z96.0 447 | Z96.642 448 | Z98.0 449 | Z98.84 450 | Z99.2 451 | Z99.3 452 | Z99.89 453 | -------------------------------------------------------------------------------- /tests/data/source_icd10_to_snomed_failed_mappings_example_expected_result.csv: -------------------------------------------------------------------------------- 1 | icd10,concept_id_x,concept_id_SNOMED,concept_id_ICD10CM,SNOMED,concept_name 2 | A04.7,,,,, 3 | A04.72,,,,, 4 | A07.1,,,,, 5 | A08.11,,,,, 6 | A31.8,,,,, 7 | A41.51,,,,, 8 | A41.81,,,,, 9 | A41.89,,,,, 10 | A41.9,,,,, 11 | A87.2,,,,, 12 | B02.9,,,,, 13 | B18.2,,,,, 14 | B20,,,,, 15 | B37.1,,,,, 16 | B44.1,,,,, 17 | B57.2,,,,, 18 | B95.2,,,,, 19 | B95.7,,,,, 20 | B96.1,,,,, 21 | B96.20,,,,, 22 | B96.5,,,,, 23 | B96.89,,,,, 24 | C16.0,,,,, 25 | C18.1,,,,, 26 | C18.2,,,,, 27 | C18.8,,,,, 28 | C34.31,,,,, 29 | C34.90,,,,, 30 | C44.311,,,,, 31 | C44.319,,,,, 32 | C78.00,,,,, 33 | C78.02,,,,, 34 | C78.7,35206332,,,, 35 | C79.51,,,,, 36 | C79.70,,,,, 37 | C79.89,,,,, 38 | C82.90,,,,, 39 | C83.00,,,,, 40 | C83.39,,,,, 41 | C88.4,,,,, 42 | C90.10,,,,, 43 | C92.02,,,,, 44 | D18.03,,,,, 45 | D22.39,,,,, 46 | D46.9,,,,, 47 | D47.2,,,,, 48 | D47.Z1,,,,, 49 | D50.0,,,,, 50 | D50.8,,,,, 51 | D50.9,,,,, 52 | D52.0,,,,, 53 | D53.8,,,,, 54 | D59.1,,,,, 55 | D59.9,,,,, 56 | D63.1,,,,, 57 | D63.8,,,,, 58 | D64.9,,,,, 59 | D68.51,,,,, 60 | D69.49,,,,, 61 | D69.6,,,,, 62 | D70.1,,,,, 63 | D70.3,,,,, 64 | D72.820,,,,, 65 | D89.811,,,,, 66 | E03.8,,,,, 67 | E03.9,,,,, 68 | E04.2,,,,, 69 | E05.90,,,,, 70 | E09.9,,,,, 71 | E10.21,,,,, 72 | E10.22,,,,, 73 | E10.319,,,,, 74 | E10.3559,,,,, 75 | E10.40,,,,, 76 | E10.43,,,,, 77 | E10.51,,,,, 78 | E10.610,,,,, 79 | E10.65,,,,, 80 | E11.21,,,,, 81 | E11.22,,,,, 82 | E11.319,,,,, 83 | E11.51,,,,, 84 | E11.649,,,,, 85 | E11.65,,,,, 86 | E11.9,,,,, 87 | E21.1,,,,, 88 | E21.3,,,,, 89 | E22.1,,,,, 90 | E22.2,,,,, 91 | E53.8,,,,, 92 | E55.9,,,,, 93 | E66.3,,,,, 94 | E66.9,,,,, 95 | E78.00,,,,, 96 | E78.1,,,,, 97 | E78.5,,,,, 98 | E79.0,,,,, 99 | E80.4,,,,, 100 | E83.42,,,,, 101 | E83.51,,,,, 102 | E86.0,,,,, 103 | E87.1,,,,, 104 | E87.5,,,,, 105 | E87.6,,,,, 106 | E89.0,,,,, 107 | F01.50,,,,, 108 | F05,,,,, 109 | F10.10,,,,, 110 | F10.21,,,,, 111 | F14.10,,,,, 112 | F17.210,,,,, 113 | F17.290,,,,, 114 | F20.0,,,,, 115 | F25.1,,,,, 116 | F32.9,,,,, 117 | F41.1,,,,, 118 | F41.8,,,,, 119 | F41.9,,,,, 120 | F91.8,,,,, 121 | G20,,,,, 122 | G31.84,,,,, 123 | G31.89,,,,, 124 | G47.33,,,,, 125 | G50.0,,,,, 126 | G81.91,,,,, 127 | G81.94,,,,, 128 | G89.21,,,,, 129 | G89.3,,,,, 130 | G93.49,,,,, 131 | H11.30,,,,, 132 | H26.9,,,,, 133 | H35.3290,,,,, 134 | H35.52,,,,, 135 | H40.9,,,,, 136 | H44.522,,,,, 137 | H49.21,,,,, 138 | H52.202,,,,, 139 | H53.2,,,,, 140 | H54.0,,,,, 141 | H54.51,,,,, 142 | H54.7,,,,, 143 | H91.10,,,,, 144 | H91.93,,,,, 145 | I08.0,,,,, 146 | I10,,,,, 147 | I11.0,,,,, 148 | I12.0,,,,, 149 | I12.9,,,,, 150 | I13.0,,,,, 151 | I21.29,,,,, 152 | I21.4,,,,, 153 | I25.10,,,,, 154 | I25.2,,,,, 155 | I25.82,,,,, 156 | I26.99,,,,, 157 | I27.2,,,,, 158 | I28.0,,,,, 159 | I30.0,,,,, 160 | I31.1,,,,, 161 | I31.3,,,,, 162 | I31.4,,,,, 163 | I42.0,,,,, 164 | I42.2,,,,, 165 | I44.2,,,,, 166 | I46.9,,,,, 167 | I47.2,,,,, 168 | I48.0,,,,, 169 | I48.91,,,,, 170 | I49.01,,,,, 171 | I50.1,,,,, 172 | I50.33,,,,, 173 | I50.9,,,,, 174 | I51.89,,,,, 175 | I51.9,,,,, 176 | I61.8,,,,, 177 | I63.231,,,,, 178 | I63.411,,,,, 179 | I65.29,,,,, 180 | I67.82,,,,, 181 | I70.213,,,,, 182 | I70.293,,,,, 183 | I70.90,,,,, 184 | I72.2,,,,, 185 | I73.9,,,,, 186 | I74.3,,,,, 187 | I77.6,,,,, 188 | I81,,,,, 189 | I82.611,,,,, 190 | I87.2,,,,, 191 | I97.131,,,,, 192 | I97.191,,,,, 193 | J15.0,,,,, 194 | J18.9,,,,, 195 | J22,,,,, 196 | J33.9,,,,, 197 | J38.02,,,,, 198 | J38.4,,,,, 199 | J43.9,,,,, 200 | J44.0,,,,, 201 | J44.1,,,,, 202 | J44.9,,,,, 203 | J45.909,,,,, 204 | J47.0,,,,, 205 | J47.1,,,,, 206 | J47.9,,,,, 207 | J69.0,,,,, 208 | J84.116,,,,, 209 | J90,,,,, 210 | J91.8,,,,, 211 | J93.12,,,,, 212 | J96.00,,,,, 213 | J96.01,,,,, 214 | J98.11,,,,, 215 | J98.4,,,,, 216 | K22.2,,,,, 217 | K29.80,,,,, 218 | K31.7,,,,, 219 | K31.84,,,,, 220 | K31.89,,,,, 221 | K35.3,,,,, 222 | K40.90,,,,, 223 | K42.9,,,,, 224 | K43.2,,,,, 225 | K44.9,,,,, 226 | K52.3,,,,, 227 | K52.89,,,,, 228 | K55.21,,,,, 229 | K56.0,,,,, 230 | K57.10,,,,, 231 | K57.30,,,,, 232 | K57.31,,,,, 233 | K58.9,,,,, 234 | K59.00,,,,, 235 | K62.6,,,,, 236 | K63.5,,,,, 237 | K64.0,,,,, 238 | K64.8,,,,, 239 | K65.1,,,,, 240 | K65.9,,,,, 241 | K66.1,,,,, 242 | K68.11,,,,, 243 | K68.12,,,,, 244 | K70.30,,,,, 245 | K75.4,,,,, 246 | K76.6,,,,, 247 | K76.89,,,,, 248 | K81.0,,,,, 249 | K82.8,,,,, 250 | K90.0,,,,, 251 | K91.840,,,,, 252 | K92.1,,,,, 253 | L03.113,,,,, 254 | L03.818,,,,, 255 | L27.0,,,,, 256 | L80,,,,, 257 | L97.919,,,,, 258 | M08.29,,,,, 259 | M10.9,,,,, 260 | M12.9,,,,, 261 | M15.9,,,,, 262 | M19.011,,,,, 263 | M19.91,,,,, 264 | M1A.0221,,,,, 265 | M20.12,,,,, 266 | M23.321,,,,, 267 | M23.8X2,,,,, 268 | M32.9,,,,, 269 | M35.2,,,,, 270 | M41.20,,,,, 271 | M47.12,,,,, 272 | M51.26,,,,, 273 | M54.5,,,,, 274 | M81.0,,,,, 275 | M84.48XA,,,,, 276 | M84.58XA,,,,, 277 | M85.9,,,,, 278 | M87.052,,,,, 279 | N04.9,,,,, 280 | N10,,,,, 281 | N17.0,,,,, 282 | N17.9,,,,, 283 | N18.3,,,,, 284 | N18.4,,,,, 285 | N18.5,,,,, 286 | N18.6,,,,, 287 | N18.9,,,,, 288 | N20.0,,,,, 289 | N28.1,,,,, 290 | N39.0,,,,, 291 | N39.498,,,,, 292 | N40.0,,,,, 293 | N41.0,,,,, 294 | N81.3,,,,, 295 | N84.1,,,,, 296 | Q24.8,,,,, 297 | Q25.0,,,,, 298 | Q44.6,,,,, 299 | Q61.3,,,,, 300 | Q89.09,,,,, 301 | R04.2,,,,, 302 | R10.13,,,,, 303 | R13.19,,,,, 304 | R19.7,,,,, 305 | R26.89,,,,, 306 | R29.705,,,,, 307 | R29.710,,,,, 308 | R29.720,,,,, 309 | R31.0,,,,, 310 | R33.8,,,,, 311 | R33.9,,,,, 312 | R40.4,,,,, 313 | R42,,,,, 314 | R43.2,,,,, 315 | R47.1,,,,, 316 | R50.81,,,,, 317 | R55,,,,, 318 | R60.1,,,,, 319 | R65.21,,,,, 320 | R74.0,,,,, 321 | R78.81,,,,, 322 | R79.1,,,,, 323 | R82.71,,,,, 324 | R82.99,,,,, 325 | R91.8,,,,, 326 | S20.212A,,,,, 327 | S30.0XXA,,,,, 328 | S32.431A,,,,, 329 | S32.601A,,,,, 330 | S32.89XD,,,,, 331 | S83.122A,,,,, 332 | T36.1X5A,,,,, 333 | T40.2X5A,,,,, 334 | T42.4X5A,,,,, 335 | T45.1X5A,,,,, 336 | T46.2X5A,,,,, 337 | T81.4XXA,,,,, 338 | T82.867A,,,,, 339 | T82.868A,,,,, 340 | T82.897A,,,,, 341 | T85.611A,,,,, 342 | T86.11,,,,, 343 | T86.19,,,,, 344 | T86.41,,,,, 345 | T86.891,,,,, 346 | T87.89,,,,, 347 | W18.30XA,,,,, 348 | W18.39XD,,,,, 349 | Y83.0,,,,, 350 | Y83.1,,,,, 351 | Y83.5,,,,, 352 | Y83.8,,,,, 353 | Y84.1,,,,, 354 | Y84.8,,,,, 355 | Y95,,,,, 356 | Z00.00,,,,, 357 | Z15.09,,,,, 358 | Z16.12,,,,, 359 | Z16.35,,,,, 360 | Z21,,,,, 361 | Z22.1,,,,, 362 | Z22.39,,,,, 363 | Z45.010,,,,, 364 | Z51.6,,,,, 365 | Z53.09,,,,, 366 | Z53.32,,,,, 367 | Z53.8,,,,, 368 | Z59.3,,,,, 369 | Z60.2,,,,, 370 | Z63.8,,,,, 371 | Z68.29,,,,, 372 | Z74.3,,,,, 373 | Z77.22,,,,, 374 | Z79.01,,,,, 375 | Z79.02,,,,, 376 | Z79.4,,,,, 377 | Z79.52,,,,, 378 | Z79.82,,,,, 379 | Z79.84,,,,, 380 | Z80.0,,,,, 381 | Z81.8,,,,, 382 | Z85.038,,,,, 383 | Z85.048,,,,, 384 | Z85.05,,,,, 385 | Z85.118,,,,, 386 | Z85.21,,,,, 387 | Z85.3,,,,, 388 | Z85.46,,,,, 389 | Z85.51,,,,, 390 | Z85.528,,,,, 391 | Z85.820,,,,, 392 | Z85.89,,,,, 393 | Z86.010,,,,, 394 | Z86.11,,,,, 395 | Z86.61,,,,, 396 | Z86.711,,,,, 397 | Z86.718,,,,, 398 | Z86.73,,,,, 399 | Z87.11,,,,, 400 | Z87.440,,,,, 401 | Z87.81,,,,, 402 | Z87.820,,,,, 403 | Z87.891,,,,, 404 | Z88.0,,,,, 405 | Z88.1,,,,, 406 | Z88.2,,,,, 407 | Z88.6,,,,, 408 | Z88.8,,,,, 409 | Z89.029,,,,, 410 | Z89.411,,,,, 411 | Z89.412,,,,, 412 | Z89.421,,,,, 413 | Z89.422,,,,, 414 | Z89.511,,,,, 415 | Z89.512,,,,, 416 | Z90.10,,,,, 417 | Z90.12,,,,, 418 | Z90.2,,,,, 419 | Z90.3,,,,, 420 | Z90.49,,,,, 421 | Z90.5,,,,, 422 | Z90.79,,,,, 423 | Z91.041,,,,, 424 | Z91.09,,,,, 425 | Z91.19,,,,, 426 | Z91.81,,,,, 427 | Z92.21,,,,, 428 | Z92.25,,,,, 429 | Z92.3,,,,, 430 | Z93.2,,,,, 431 | Z93.3,,,,, 432 | Z94.0,,,,, 433 | Z94.4,,,,, 434 | Z94.7,,,,, 435 | Z94.83,,,,, 436 | Z94.84,,,,, 437 | Z95.0,,,,, 438 | Z95.1,,,,, 439 | Z95.2,,,,, 440 | Z95.3,,,,, 441 | Z95.5,,,,, 442 | Z95.810,,,,, 443 | Z95.820,,,,, 444 | Z95.828,,,,, 445 | Z96.0,,,,, 446 | Z96.642,,,,, 447 | Z98.0,,,,, 448 | Z98.84,,,,, 449 | Z99.2,,,,, 450 | Z99.3,,,,, 451 | Z99.89,,,,, 452 | -------------------------------------------------------------------------------- /tests/data/expected/icd10_to_snomed_failed_mappings.csv: -------------------------------------------------------------------------------- 1 | ICD10CM,ICD10CM_label,ICD10CM_omop_id,SNOMED,SNOMED_label,SNOMED_omop_id 2 | A04.7,,,,, 3 | A04.72,,,,, 4 | A07.1,,,,, 5 | A08.11,,,,, 6 | A31.8,,,,, 7 | A41.51,,,,, 8 | A41.81,,,,, 9 | A41.89,,,,, 10 | A41.9,,,,, 11 | A87.2,,,,, 12 | B02.9,,,,, 13 | B18.2,,,,, 14 | B20,,,,, 15 | B37.1,,,,, 16 | B44.1,,,,, 17 | B57.2,,,,, 18 | B95.2,,,,, 19 | B95.7,,,,, 20 | B96.1,,,,, 21 | B96.20,,,,, 22 | B96.5,,,,, 23 | B96.89,,,,, 24 | C16.0,,,,, 25 | C18.1,,,,, 26 | C18.2,,,,, 27 | C18.8,,,,, 28 | C34.31,,,,, 29 | C34.90,,,,, 30 | C44.311,,,,, 31 | C44.319,,,,, 32 | C78.00,,,,, 33 | C78.02,,,,, 34 | C78.7,Secondary malignant neoplasm of liver and intrahepatic bile duct,,,, 35 | C79.51,,,,, 36 | C79.70,,,,, 37 | C79.89,,,,, 38 | C82.90,,,,, 39 | C83.00,,,,, 40 | C83.39,,,,, 41 | C88.4,,,,, 42 | C90.10,,,,, 43 | C92.02,,,,, 44 | D18.03,,,,, 45 | D22.39,,,,, 46 | D46.9,,,,, 47 | D47.2,,,,, 48 | D47.Z1,,,,, 49 | D50.0,,,,, 50 | D50.8,,,,, 51 | D50.9,,,,, 52 | D52.0,,,,, 53 | D53.8,,,,, 54 | D59.1,,,,, 55 | D59.9,,,,, 56 | D63.1,,,,, 57 | D63.8,,,,, 58 | D64.9,,,,, 59 | D68.51,,,,, 60 | D69.49,,,,, 61 | D69.6,,,,, 62 | D70.1,,,,, 63 | D70.3,,,,, 64 | D72.820,,,,, 65 | D89.811,,,,, 66 | E03.8,,,,, 67 | E03.9,,,,, 68 | E04.2,,,,, 69 | E05.90,,,,, 70 | E09.9,,,,, 71 | E10.21,,,,, 72 | E10.22,,,,, 73 | E10.319,,,,, 74 | E10.3559,,,,, 75 | E10.40,,,,, 76 | E10.43,,,,, 77 | E10.51,,,,, 78 | E10.610,,,,, 79 | E10.65,,,,, 80 | E11.21,,,,, 81 | E11.22,,,,, 82 | E11.319,,,,, 83 | E11.51,,,,, 84 | E11.649,,,,, 85 | E11.65,,,,, 86 | E11.9,,,,, 87 | E21.1,,,,, 88 | E21.3,,,,, 89 | E22.1,,,,, 90 | E22.2,,,,, 91 | E53.8,,,,, 92 | E55.9,,,,, 93 | E66.3,,,,, 94 | E66.9,,,,, 95 | E78.00,,,,, 96 | E78.1,,,,, 97 | E78.5,,,,, 98 | E79.0,,,,, 99 | E80.4,,,,, 100 | E83.42,,,,, 101 | E83.51,,,,, 102 | E86.0,,,,, 103 | E87.1,,,,, 104 | E87.5,,,,, 105 | E87.6,,,,, 106 | E89.0,,,,, 107 | F01.50,,,,, 108 | F05,,,,, 109 | F10.10,,,,, 110 | F10.21,,,,, 111 | F14.10,,,,, 112 | F17.210,,,,, 113 | F17.290,,,,, 114 | F20.0,,,,, 115 | F25.1,,,,, 116 | F32.9,,,,, 117 | F41.1,,,,, 118 | F41.8,,,,, 119 | F41.9,,,,, 120 | F91.8,,,,, 121 | G20,,,,, 122 | G31.84,,,,, 123 | G31.89,,,,, 124 | G47.33,,,,, 125 | G50.0,,,,, 126 | G81.91,,,,, 127 | G81.94,,,,, 128 | G89.21,,,,, 129 | G89.3,,,,, 130 | G93.49,,,,, 131 | H11.30,,,,, 132 | H26.9,,,,, 133 | H35.3290,,,,, 134 | H35.52,,,,, 135 | H40.9,,,,, 136 | H44.522,,,,, 137 | H49.21,,,,, 138 | H52.202,,,,, 139 | H53.2,,,,, 140 | H54.0,,,,, 141 | H54.51,,,,, 142 | H54.7,,,,, 143 | H91.10,,,,, 144 | H91.93,,,,, 145 | I08.0,,,,, 146 | I10,,,,, 147 | I11.0,,,,, 148 | I12.0,,,,, 149 | I12.9,,,,, 150 | I13.0,,,,, 151 | I21.29,,,,, 152 | I21.4,,,,, 153 | I25.10,,,,, 154 | I25.2,,,,, 155 | I25.82,,,,, 156 | I26.99,,,,, 157 | I27.2,,,,, 158 | I28.0,,,,, 159 | I30.0,,,,, 160 | I31.1,,,,, 161 | I31.3,,,,, 162 | I31.4,,,,, 163 | I42.0,,,,, 164 | I42.2,,,,, 165 | I44.2,,,,, 166 | I46.9,,,,, 167 | I47.2,,,,, 168 | I48.0,,,,, 169 | I48.91,,,,, 170 | I49.01,,,,, 171 | I50.1,,,,, 172 | I50.33,,,,, 173 | I50.9,,,,, 174 | I51.89,,,,, 175 | I51.9,,,,, 176 | I61.8,,,,, 177 | I63.231,,,,, 178 | I63.411,,,,, 179 | I65.29,,,,, 180 | I67.82,,,,, 181 | I70.213,,,,, 182 | I70.293,,,,, 183 | I70.90,,,,, 184 | I72.2,,,,, 185 | I73.9,,,,, 186 | I74.3,,,,, 187 | I77.6,,,,, 188 | I81,,,,, 189 | I82.611,,,,, 190 | I87.2,,,,, 191 | I97.131,,,,, 192 | I97.191,,,,, 193 | J15.0,,,,, 194 | J18.9,,,,, 195 | J22,,,,, 196 | J33.9,,,,, 197 | J38.02,,,,, 198 | J38.4,,,,, 199 | J43.9,,,,, 200 | J44.0,,,,, 201 | J44.1,,,,, 202 | J44.9,,,,, 203 | J45.909,,,,, 204 | J47.0,,,,, 205 | J47.1,,,,, 206 | J47.9,,,,, 207 | J69.0,,,,, 208 | J84.116,,,,, 209 | J90,,,,, 210 | J91.8,,,,, 211 | J93.12,,,,, 212 | J96.00,,,,, 213 | J96.01,,,,, 214 | J98.11,,,,, 215 | J98.4,,,,, 216 | K22.2,,,,, 217 | K29.80,,,,, 218 | K31.7,,,,, 219 | K31.84,,,,, 220 | K31.89,,,,, 221 | K35.3,,,,, 222 | K40.90,,,,, 223 | K42.9,,,,, 224 | K43.2,,,,, 225 | K44.9,,,,, 226 | K52.3,,,,, 227 | K52.89,,,,, 228 | K55.21,,,,, 229 | K56.0,,,,, 230 | K57.10,,,,, 231 | K57.30,,,,, 232 | K57.31,,,,, 233 | K58.9,,,,, 234 | K59.00,,,,, 235 | K62.6,,,,, 236 | K63.5,,,,, 237 | K64.0,,,,, 238 | K64.8,,,,, 239 | K65.1,,,,, 240 | K65.9,,,,, 241 | K66.1,,,,, 242 | K68.11,,,,, 243 | K68.12,,,,, 244 | K70.30,,,,, 245 | K75.4,,,,, 246 | K76.6,,,,, 247 | K76.89,,,,, 248 | K81.0,,,,, 249 | K82.8,,,,, 250 | K90.0,,,,, 251 | K91.840,,,,, 252 | K92.1,,,,, 253 | L03.113,,,,, 254 | L03.818,,,,, 255 | L27.0,,,,, 256 | L80,,,,, 257 | L97.919,,,,, 258 | M08.29,,,,, 259 | M10.9,,,,, 260 | M12.9,,,,, 261 | M15.9,,,,, 262 | M19.011,,,,, 263 | M19.91,,,,, 264 | M1A.0221,,,,, 265 | M20.12,,,,, 266 | M23.321,,,,, 267 | M23.8X2,,,,, 268 | M32.9,,,,, 269 | M35.2,,,,, 270 | M41.20,,,,, 271 | M47.12,,,,, 272 | M51.26,,,,, 273 | M54.5,,,,, 274 | M81.0,,,,, 275 | M84.48XA,,,,, 276 | M84.58XA,,,,, 277 | M85.9,,,,, 278 | M87.052,,,,, 279 | N04.9,,,,, 280 | N10,,,,, 281 | N17.0,,,,, 282 | N17.9,,,,, 283 | N18.3,,,,, 284 | N18.4,,,,, 285 | N18.5,,,,, 286 | N18.6,,,,, 287 | N18.9,,,,, 288 | N20.0,,,,, 289 | N28.1,,,,, 290 | N39.0,,,,, 291 | N39.498,,,,, 292 | N40.0,,,,, 293 | N41.0,,,,, 294 | N81.3,,,,, 295 | N84.1,,,,, 296 | Q24.8,,,,, 297 | Q25.0,,,,, 298 | Q44.6,,,,, 299 | Q61.3,,,,, 300 | Q89.09,,,,, 301 | R04.2,,,,, 302 | R10.13,,,,, 303 | R13.19,,,,, 304 | R19.7,,,,, 305 | R26.89,,,,, 306 | R29.705,,,,, 307 | R29.710,,,,, 308 | R29.720,,,,, 309 | R31.0,,,,, 310 | R33.8,,,,, 311 | R33.9,,,,, 312 | R40.4,,,,, 313 | R42,,,,, 314 | R43.2,,,,, 315 | R47.1,,,,, 316 | R50.81,,,,, 317 | R55,,,,, 318 | R60.1,,,,, 319 | R65.21,,,,, 320 | R74.0,,,,, 321 | R78.81,,,,, 322 | R79.1,,,,, 323 | R82.71,,,,, 324 | R82.99,,,,, 325 | R91.8,,,,, 326 | S20.212A,,,,, 327 | S30.0XXA,,,,, 328 | S32.431A,,,,, 329 | S32.601A,,,,, 330 | S32.89XD,,,,, 331 | S83.122A,,,,, 332 | T36.1X5A,,,,, 333 | T40.2X5A,,,,, 334 | T42.4X5A,,,,, 335 | T45.1X5A,,,,, 336 | T46.2X5A,,,,, 337 | T81.4XXA,,,,, 338 | T82.867A,,,,, 339 | T82.868A,,,,, 340 | T82.897A,,,,, 341 | T85.611A,,,,, 342 | T86.11,,,,, 343 | T86.19,,,,, 344 | T86.41,,,,, 345 | T86.891,,,,, 346 | T87.89,,,,, 347 | W18.30XA,,,,, 348 | W18.39XD,,,,, 349 | Y83.0,,,,, 350 | Y83.1,,,,, 351 | Y83.5,,,,, 352 | Y83.8,,,,, 353 | Y84.1,,,,, 354 | Y84.8,,,,, 355 | Y95,,,,, 356 | Z00.00,,,,, 357 | Z15.09,,,,, 358 | Z16.12,,,,, 359 | Z16.35,,,,, 360 | Z21,,,,, 361 | Z22.1,,,,, 362 | Z22.39,,,,, 363 | Z45.010,,,,, 364 | Z51.6,,,,, 365 | Z53.09,,,,, 366 | Z53.32,,,,, 367 | Z53.8,,,,, 368 | Z59.3,,,,, 369 | Z60.2,,,,, 370 | Z63.8,,,,, 371 | Z68.29,,,,, 372 | Z74.3,,,,, 373 | Z77.22,,,,, 374 | Z79.01,,,,, 375 | Z79.02,,,,, 376 | Z79.4,,,,, 377 | Z79.52,,,,, 378 | Z79.82,,,,, 379 | Z79.84,,,,, 380 | Z80.0,,,,, 381 | Z81.8,,,,, 382 | Z85.038,,,,, 383 | Z85.048,,,,, 384 | Z85.05,,,,, 385 | Z85.118,,,,, 386 | Z85.21,,,,, 387 | Z85.3,,,,, 388 | Z85.46,,,,, 389 | Z85.51,,,,, 390 | Z85.528,,,,, 391 | Z85.820,,,,, 392 | Z85.89,,,,, 393 | Z86.010,,,,, 394 | Z86.11,,,,, 395 | Z86.61,,,,, 396 | Z86.711,,,,, 397 | Z86.718,,,,, 398 | Z86.73,,,,, 399 | Z87.11,,,,, 400 | Z87.440,,,,, 401 | Z87.81,,,,, 402 | Z87.820,,,,, 403 | Z87.891,,,,, 404 | Z88.0,,,,, 405 | Z88.1,,,,, 406 | Z88.2,,,,, 407 | Z88.6,,,,, 408 | Z88.8,,,,, 409 | Z89.029,,,,, 410 | Z89.411,,,,, 411 | Z89.412,,,,, 412 | Z89.421,,,,, 413 | Z89.422,,,,, 414 | Z89.511,,,,, 415 | Z89.512,,,,, 416 | Z90.10,,,,, 417 | Z90.12,,,,, 418 | Z90.2,,,,, 419 | Z90.3,,,,, 420 | Z90.49,,,,, 421 | Z90.5,,,,, 422 | Z90.79,,,,, 423 | Z91.041,,,,, 424 | Z91.09,,,,, 425 | Z91.19,,,,, 426 | Z91.81,,,,, 427 | Z92.21,,,,, 428 | Z92.25,,,,, 429 | Z92.3,,,,, 430 | Z93.2,,,,, 431 | Z93.3,,,,, 432 | Z94.0,,,,, 433 | Z94.4,,,,, 434 | Z94.7,,,,, 435 | Z94.83,,,,, 436 | Z94.84,,,,, 437 | Z95.0,,,,, 438 | Z95.1,,,,, 439 | Z95.2,,,,, 440 | Z95.3,,,,, 441 | Z95.5,,,,, 442 | Z95.810,,,,, 443 | Z95.820,,,,, 444 | Z95.828,,,,, 445 | Z96.0,,,,, 446 | Z96.642,,,,, 447 | Z98.0,,,,, 448 | Z98.84,,,,, 449 | Z99.2,,,,, 450 | Z99.3,,,,, 451 | Z99.89,,,,, 452 | -------------------------------------------------------------------------------- /tests/data/expected/icd10_to_snomed.csv: -------------------------------------------------------------------------------- 1 | ICD10CM,ICD10CM_label,ICD10CM_omop_id,SNOMED,SNOMED_label,SNOMED_omop_id 2 | A04.4,Other intestinal Escherichia coli infections,35205417,111839008,Intestinal infection due to E. coli,192815 3 | A04.7,,,,, 4 | A04.72,,,,, 5 | A07.1,,,,, 6 | A08.11,,,,, 7 | A31.8,,,,, 8 | A41.51,,,,, 9 | A41.81,,,,, 10 | A41.89,,,,, 11 | A41.9,,,,, 12 | A87.2,,,,, 13 | B02.9,,,,, 14 | B18.2,,,,, 15 | B20,,,,, 16 | B37.1,,,,, 17 | B44.1,,,,, 18 | B57.2,,,,, 19 | B95.2,,,,, 20 | B95.7,,,,, 21 | B96.1,,,,, 22 | B96.20,,,,, 23 | B96.5,,,,, 24 | B96.89,,,,, 25 | C16.0,,,,, 26 | C18.1,,,,, 27 | C18.2,,,,, 28 | C18.8,,,,, 29 | C34.31,,,,, 30 | C34.90,,,,, 31 | C44.311,,,,, 32 | C44.319,,,,, 33 | C78.00,,,,, 34 | C78.02,,,,, 35 | C78.7,Secondary malignant neoplasm of liver and intrahepatic bile duct,,,, 36 | C79.51,,,,, 37 | C79.70,,,,, 38 | C79.89,,,,, 39 | C82.90,,,,, 40 | C83.00,,,,, 41 | C83.39,,,,, 42 | C88.4,,,,, 43 | C90.10,,,,, 44 | C92.02,,,,, 45 | D18.03,,,,, 46 | D22.39,,,,, 47 | D46.9,,,,, 48 | D47.2,,,,, 49 | D47.Z1,,,,, 50 | D50.0,,,,, 51 | D50.8,,,,, 52 | D50.9,,,,, 53 | D52.0,,,,, 54 | D53.8,,,,, 55 | D59.1,,,,, 56 | D59.9,,,,, 57 | D63.1,,,,, 58 | D63.8,,,,, 59 | D64.9,,,,, 60 | D68.51,,,,, 61 | D69.49,,,,, 62 | D69.6,,,,, 63 | D70.1,,,,, 64 | D70.3,,,,, 65 | D72.820,,,,, 66 | D89.811,,,,, 67 | E03.8,,,,, 68 | E03.9,,,,, 69 | E04.2,,,,, 70 | E05.90,,,,, 71 | E09.9,,,,, 72 | E10.21,,,,, 73 | E10.22,,,,, 74 | E10.319,,,,, 75 | E10.3559,,,,, 76 | E10.40,,,,, 77 | E10.43,,,,, 78 | E10.51,,,,, 79 | E10.610,,,,, 80 | E10.65,,,,, 81 | E11.21,,,,, 82 | E11.22,,,,, 83 | E11.319,,,,, 84 | E11.51,,,,, 85 | E11.649,,,,, 86 | E11.65,,,,, 87 | E11.9,,,,, 88 | E21.1,,,,, 89 | E21.3,,,,, 90 | E22.1,,,,, 91 | E22.2,,,,, 92 | E53.8,,,,, 93 | E55.9,,,,, 94 | E66.3,,,,, 95 | E66.9,,,,, 96 | E78.00,,,,, 97 | E78.1,,,,, 98 | E78.5,,,,, 99 | E79.0,,,,, 100 | E80.4,,,,, 101 | E83.42,,,,, 102 | E83.51,,,,, 103 | E86.0,,,,, 104 | E87.1,,,,, 105 | E87.5,,,,, 106 | E87.6,,,,, 107 | E89.0,,,,, 108 | F01.50,,,,, 109 | F05,,,,, 110 | F10.10,,,,, 111 | F10.21,,,,, 112 | F14.10,,,,, 113 | F17.210,,,,, 114 | F17.290,,,,, 115 | F20.0,,,,, 116 | F25.1,,,,, 117 | F32.9,,,,, 118 | F41.1,,,,, 119 | F41.8,,,,, 120 | F41.9,,,,, 121 | F91.8,,,,, 122 | G20,,,,, 123 | G31.84,,,,, 124 | G31.89,,,,, 125 | G47.33,,,,, 126 | G50.0,,,,, 127 | G81.91,,,,, 128 | G81.94,,,,, 129 | G89.21,,,,, 130 | G89.3,,,,, 131 | G93.49,,,,, 132 | H11.30,,,,, 133 | H26.9,,,,, 134 | H35.3290,,,,, 135 | H35.52,,,,, 136 | H40.9,,,,, 137 | H44.522,,,,, 138 | H49.21,,,,, 139 | H52.202,,,,, 140 | H53.2,,,,, 141 | H54.0,,,,, 142 | H54.51,,,,, 143 | H54.7,,,,, 144 | H91.10,,,,, 145 | H91.93,,,,, 146 | I08.0,,,,, 147 | I10,,,,, 148 | I11.0,,,,, 149 | I12.0,,,,, 150 | I12.9,,,,, 151 | I13.0,,,,, 152 | I21.29,,,,, 153 | I21.4,,,,, 154 | I25.10,,,,, 155 | I25.2,,,,, 156 | I25.82,,,,, 157 | I26.99,,,,, 158 | I27.2,,,,, 159 | I28.0,,,,, 160 | I30.0,,,,, 161 | I31.1,,,,, 162 | I31.3,,,,, 163 | I31.4,,,,, 164 | I42.0,,,,, 165 | I42.2,,,,, 166 | I44.2,,,,, 167 | I46.9,,,,, 168 | I47.2,,,,, 169 | I48.0,,,,, 170 | I48.91,,,,, 171 | I49.01,,,,, 172 | I50.1,,,,, 173 | I50.33,,,,, 174 | I50.9,,,,, 175 | I51.89,,,,, 176 | I51.9,,,,, 177 | I61.8,,,,, 178 | I63.231,,,,, 179 | I63.411,,,,, 180 | I65.29,,,,, 181 | I67.82,,,,, 182 | I70.213,,,,, 183 | I70.293,,,,, 184 | I70.90,,,,, 185 | I72.2,,,,, 186 | I73.9,,,,, 187 | I74.3,,,,, 188 | I77.6,,,,, 189 | I81,,,,, 190 | I82.611,,,,, 191 | I87.2,,,,, 192 | I97.131,,,,, 193 | I97.191,,,,, 194 | J15.0,,,,, 195 | J18.9,,,,, 196 | J22,,,,, 197 | J33.9,,,,, 198 | J38.02,,,,, 199 | J38.4,,,,, 200 | J43.9,,,,, 201 | J44.0,,,,, 202 | J44.1,,,,, 203 | J44.9,,,,, 204 | J45.909,,,,, 205 | J47.0,,,,, 206 | J47.1,,,,, 207 | J47.9,,,,, 208 | J69.0,,,,, 209 | J84.116,,,,, 210 | J90,,,,, 211 | J91.8,,,,, 212 | J93.12,,,,, 213 | J96.00,,,,, 214 | J96.01,,,,, 215 | J98.11,,,,, 216 | J98.4,,,,, 217 | K22.2,,,,, 218 | K29.80,,,,, 219 | K31.7,,,,, 220 | K31.84,,,,, 221 | K31.89,,,,, 222 | K35.3,,,,, 223 | K40.90,,,,, 224 | K42.9,,,,, 225 | K43.2,,,,, 226 | K44.9,,,,, 227 | K52.3,,,,, 228 | K52.89,,,,, 229 | K55.21,,,,, 230 | K56.0,,,,, 231 | K57.10,,,,, 232 | K57.30,,,,, 233 | K57.31,,,,, 234 | K58.9,,,,, 235 | K59.00,,,,, 236 | K62.6,,,,, 237 | K63.5,,,,, 238 | K64.0,,,,, 239 | K64.8,,,,, 240 | K65.1,,,,, 241 | K65.9,,,,, 242 | K66.1,,,,, 243 | K68.11,,,,, 244 | K68.12,,,,, 245 | K70.30,,,,, 246 | K75.4,,,,, 247 | K76.6,,,,, 248 | K76.89,,,,, 249 | K81.0,,,,, 250 | K82.8,,,,, 251 | K90.0,,,,, 252 | K91.840,,,,, 253 | K92.1,,,,, 254 | L03.113,,,,, 255 | L03.818,,,,, 256 | L27.0,,,,, 257 | L80,,,,, 258 | L97.919,,,,, 259 | M08.29,,,,, 260 | M10.9,,,,, 261 | M12.9,,,,, 262 | M15.9,,,,, 263 | M19.011,,,,, 264 | M19.91,,,,, 265 | M1A.0221,,,,, 266 | M20.12,,,,, 267 | M23.321,,,,, 268 | M23.8X2,,,,, 269 | M32.9,,,,, 270 | M35.2,,,,, 271 | M41.20,,,,, 272 | M47.12,,,,, 273 | M51.26,,,,, 274 | M54.5,,,,, 275 | M81.0,,,,, 276 | M84.48XA,,,,, 277 | M84.58XA,,,,, 278 | M85.9,,,,, 279 | M87.052,,,,, 280 | N04.9,,,,, 281 | N10,,,,, 282 | N17.0,,,,, 283 | N17.9,,,,, 284 | N18.3,,,,, 285 | N18.4,,,,, 286 | N18.5,,,,, 287 | N18.6,,,,, 288 | N18.9,,,,, 289 | N20.0,,,,, 290 | N28.1,,,,, 291 | N39.0,,,,, 292 | N39.498,,,,, 293 | N40.0,,,,, 294 | N41.0,,,,, 295 | N81.3,,,,, 296 | N84.1,,,,, 297 | Q24.8,,,,, 298 | Q25.0,,,,, 299 | Q44.6,,,,, 300 | Q61.3,,,,, 301 | Q89.09,,,,, 302 | R04.2,,,,, 303 | R10.13,,,,, 304 | R13.19,,,,, 305 | R19.7,,,,, 306 | R26.89,,,,, 307 | R29.705,,,,, 308 | R29.710,,,,, 309 | R29.720,,,,, 310 | R31.0,,,,, 311 | R33.8,,,,, 312 | R33.9,,,,, 313 | R40.4,,,,, 314 | R42,,,,, 315 | R43.2,,,,, 316 | R47.1,,,,, 317 | R50.81,,,,, 318 | R55,,,,, 319 | R60.1,,,,, 320 | R65.21,,,,, 321 | R74.0,,,,, 322 | R78.81,,,,, 323 | R79.1,,,,, 324 | R82.71,,,,, 325 | R82.99,,,,, 326 | R91.8,,,,, 327 | S20.212A,,,,, 328 | S30.0XXA,,,,, 329 | S32.431A,,,,, 330 | S32.601A,,,,, 331 | S32.89XD,,,,, 332 | S83.122A,,,,, 333 | T36.1X5A,,,,, 334 | T40.2X5A,,,,, 335 | T42.4X5A,,,,, 336 | T45.1X5A,,,,, 337 | T46.2X5A,,,,, 338 | T81.4XXA,,,,, 339 | T82.867A,,,,, 340 | T82.868A,,,,, 341 | T82.897A,,,,, 342 | T85.611A,,,,, 343 | T86.11,,,,, 344 | T86.19,,,,, 345 | T86.41,,,,, 346 | T86.891,,,,, 347 | T87.89,,,,, 348 | W18.30XA,,,,, 349 | W18.39XD,,,,, 350 | Y83.0,,,,, 351 | Y83.1,,,,, 352 | Y83.5,,,,, 353 | Y83.8,,,,, 354 | Y84.1,,,,, 355 | Y84.8,,,,, 356 | Y95,,,,, 357 | Z00.00,,,,, 358 | Z15.09,,,,, 359 | Z16.12,,,,, 360 | Z16.35,,,,, 361 | Z21,,,,, 362 | Z22.1,,,,, 363 | Z22.39,,,,, 364 | Z45.010,,,,, 365 | Z51.6,,,,, 366 | Z53.09,,,,, 367 | Z53.32,,,,, 368 | Z53.8,,,,, 369 | Z59.3,,,,, 370 | Z60.2,,,,, 371 | Z63.8,,,,, 372 | Z68.29,,,,, 373 | Z74.3,,,,, 374 | Z77.22,,,,, 375 | Z79.01,,,,, 376 | Z79.02,,,,, 377 | Z79.4,,,,, 378 | Z79.52,,,,, 379 | Z79.82,,,,, 380 | Z79.84,,,,, 381 | Z80.0,,,,, 382 | Z81.8,,,,, 383 | Z85.038,,,,, 384 | Z85.048,,,,, 385 | Z85.05,,,,, 386 | Z85.118,,,,, 387 | Z85.21,,,,, 388 | Z85.3,,,,, 389 | Z85.46,,,,, 390 | Z85.51,,,,, 391 | Z85.528,,,,, 392 | Z85.820,,,,, 393 | Z85.89,,,,, 394 | Z86.010,,,,, 395 | Z86.11,,,,, 396 | Z86.61,,,,, 397 | Z86.711,,,,, 398 | Z86.718,,,,, 399 | Z86.73,,,,, 400 | Z87.11,,,,, 401 | Z87.440,,,,, 402 | Z87.81,,,,, 403 | Z87.820,,,,, 404 | Z87.891,,,,, 405 | Z88.0,,,,, 406 | Z88.1,,,,, 407 | Z88.2,,,,, 408 | Z88.6,,,,, 409 | Z88.8,,,,, 410 | Z89.029,,,,, 411 | Z89.411,,,,, 412 | Z89.412,,,,, 413 | Z89.421,,,,, 414 | Z89.422,,,,, 415 | Z89.511,,,,, 416 | Z89.512,,,,, 417 | Z90.10,,,,, 418 | Z90.12,,,,, 419 | Z90.2,,,,, 420 | Z90.3,,,,, 421 | Z90.49,,,,, 422 | Z90.5,,,,, 423 | Z90.79,,,,, 424 | Z91.041,,,,, 425 | Z91.09,,,,, 426 | Z91.19,,,,, 427 | Z91.81,,,,, 428 | Z92.21,,,,, 429 | Z92.25,,,,, 430 | Z92.3,,,,, 431 | Z93.2,,,,, 432 | Z93.3,,,,, 433 | Z94.0,,,,, 434 | Z94.4,,,,, 435 | Z94.7,,,,, 436 | Z94.83,,,,, 437 | Z94.84,,,,, 438 | Z95.0,,,,, 439 | Z95.1,,,,, 440 | Z95.2,,,,, 441 | Z95.3,,,,, 442 | Z95.5,,,,, 443 | Z95.810,,,,, 444 | Z95.820,,,,, 445 | Z95.828,,,,, 446 | Z96.0,,,,, 447 | Z96.642,,,,, 448 | Z98.0,,,,, 449 | Z98.84,,,,, 450 | Z99.2,,,,, 451 | Z99.3,,,,, 452 | Z99.89,,,,, 453 | -------------------------------------------------------------------------------- /demo.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "#### Demo Scripts for the crosswalk package\n" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "import pandas as pd\n", 17 | "\n", 18 | "import cwmed as cw" 19 | ] 20 | }, 21 | { 22 | "cell_type": "markdown", 23 | "metadata": {}, 24 | "source": [ 25 | "Step1: Download the source and target concepts from OHDSI Athena, https://athena.ohdsi.org/auth/login\n", 26 | "\n", 27 | "1a) Login (if don't have an account you could register with your email), and click the DOWNLOAD from the header, and select the source and target vocabualries. \n", 28 | "In this example, ICD10CM is the source and SNOMED is the target (different source and targets could be selected.)\n", 29 | "\n", 30 | "| ID | CODE | NAME |\n", 31 | "|----|---------|-------------------------------------------------------------------------|\n", 32 | "| 1 | SNOMED | Systematic Nomenclature of Medicine - Clinical Terms (IHTSDO) |\n", 33 | "| 70 | ICD10CM | International Classification of Diseases, Tenth Revision, Clinical Modification (NCHS) |\n" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": {}, 39 | "source": [ 40 | "1b) Click on DOWNLOAD VOCABULARIES. Add text to name bundle: ICD10CM-to-SNOMED and click DOWNLOAD.\n" 41 | ] 42 | }, 43 | { 44 | "cell_type": "markdown", 45 | "metadata": {}, 46 | "source": [ 47 | "1c) An email will be sent to your registered email (see example below).\n", 48 | "\n", 49 | "**Link for downloading the Standardized Vocabularies**\n", 50 | "Vocabularies release version: **v5.0 31-MAY-23**\n", 51 | "\n", 52 | "**ICD10CM-to-SNOMED Vocabularies**:\\\n", 53 | "ICD10CM\t-\tInternational Classification of Diseases, Tenth Revision, Clinical Modification (NCHS)\\\n", 54 | "SNOMED\t-\tSystematic Nomenclature of Medicine - Clinical Terms (IHTSDO)\n", 55 | "\n", 56 | "Please download and load the Standardized Vocabularies as following:\n", 57 | "1) Click on this [link](https://athena.ohdsi.org/api/v1/vocabularies/zip/084c2629-f1e0-4e00-bd76-1b5ebea2d266) to download the zip file. Typical file sizes, depending on the number of vocabularies selected, are between 30 and 250 MB.\n" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": null, 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [ 66 | "# i) Copy the url path from the link and add it below as input to the download data function, using right click inspect element. \n", 67 | "# Note the link is time limited and may result in a forbidden data API access observed in the reponse.content due to third party permissions, \n", 68 | "# however you will still be able to click the link or copy and paste the url in your browser as in ii) (cell below) and unzip the files.\n", 69 | "url = 'https://athena.ohdsi.org/api/v1/vocabularies/zip/084c2629-f1e0-4e00-bd76-1b5ebea2d266'\n", 70 | "path = 'sample-data/input'\n", 71 | "cw.download_data(url,path)" 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": 3, 77 | "metadata": {}, 78 | "outputs": [ 79 | { 80 | "name": "stdout", 81 | "output_type": "stream", 82 | "text": [ 83 | "Both the CONCEPT.csv and CONCEPT_RELATIONSHIP.csv files are present.\n" 84 | ] 85 | } 86 | ], 87 | "source": [ 88 | "# ii) Alternatively, click on the link or copy and paste the url and unzip the files. \n", 89 | "# Add the CONCEPT.csv and CONCEPT_RELATIONSHIP.csv to your input data path, \"sample-data/input\".\n", 90 | "# Verify that both files are present.\n", 91 | "import os\n", 92 | "\n", 93 | "if os.path.isfile(os.path.join('sample-data/input', 'CONCEPT.csv')) and os.path.isfile(os.path.join('sample-data/input', 'CONCEPT_RELATIONSHIP.csv')):\n", 94 | " print(\"Both the CONCEPT.csv and CONCEPT_RELATIONSHIP.csv files are present.\")" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": 4, 100 | "metadata": {}, 101 | "outputs": [ 102 | { 103 | "name": "stdout", 104 | "output_type": "stream", 105 | "text": [ 106 | "The source value 'ICD10CM' and target value 'SNOMED' are present.\n" 107 | ] 108 | }, 109 | { 110 | "name": "stderr", 111 | "output_type": "stream", 112 | "text": [ 113 | "/Users/dana/projects/medical-standard-voc-translator/crosswalk.py:52: DtypeWarning: Columns (6,9) have mixed types. Specify dtype option on import or set low_memory=False.\n", 114 | " concepts = pd.read_csv(file_path, sep='\\t')\n" 115 | ] 116 | } 117 | ], 118 | "source": [ 119 | "import numpy as np\n", 120 | "# 2. Get the unique vocabs from the concept.csv which are useful in step 3. to denote the source and target values.\n", 121 | "unique_vocabs = cw.get_unique_vocab('sample-data/input/CONCEPT.csv')\n", 122 | "# Check if the unique vocab list contains the source and target values.\n", 123 | "np.any(np.isin(unique_vocabs, ['ICD10CM', 'SNOMED']))\n", 124 | "source_value = 'ICD10CM'\n", 125 | "target_value = 'SNOMED'\n", 126 | "\n", 127 | "if np.any(np.isin(unique_vocabs, [source_value, target_value])):\n", 128 | " print(f\"The source value '{source_value}' and target value '{target_value}' are present.\")\n", 129 | "else:\n", 130 | " print(f\"The source value '{source_value}' and target value '{target_value}' are not present.\")" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": 5, 136 | "metadata": {}, 137 | "outputs": [ 138 | { 139 | "name": "stderr", 140 | "output_type": "stream", 141 | "text": [ 142 | "/Users/dana/projects/medical-standard-voc-translator/crosswalk.py:152: DtypeWarning: Columns (9) have mixed types. Specify dtype option on import or set low_memory=False.\n", 143 | " df = pd.read_csv(self.concept_filepath, sep='\\t',\n" 144 | ] 145 | }, 146 | { 147 | "data": { 148 | "text/plain": [ 149 | "" 150 | ] 151 | }, 152 | "execution_count": 5, 153 | "metadata": {}, 154 | "output_type": "execute_result" 155 | } 156 | ], 157 | "source": [ 158 | "# 3. Read the source to vocab crosswalk as a Vocab Translator object. \n", 159 | "# Add the path to the source data, icd10.csv, including source column, 'icd10'.\n", 160 | "# Add the path to the concept.csv, along with the source and target column as observed from step 2. \n", 161 | "# Add the path to the concept_relationship.csv\n", 162 | "vocab = cw.VocabTranslator(source_filepath = 'sample-data/input/icd10.csv',\n", 163 | " source_code_col = 'icd10',\n", 164 | " concept_filepath = 'sample-data/input/CONCEPT.csv',\n", 165 | " source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED',\n", 166 | " concept_relationship_filepath = 'sample-data/input/CONCEPT_RELATIONSHIP.csv')\n", 167 | "vocab" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": 6, 173 | "metadata": {}, 174 | "outputs": [ 175 | { 176 | "data": { 177 | "text/html": [ 178 | "
\n", 179 | "\n", 192 | "\n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | "
ICD10CMICD10CM_labelICD10CM_omop_idSNOMEDSNOMED_labelSNOMED_omop_id
0A04.4Other intestinal Escherichia coli infections35205417111839008Intestinal infection due to E. coli192815
1A04.7Enterocolitis due to Clostridium difficile35205420186431008Clostridioides difficile infection193688
2A04.72Enterocolitis due to Clostridium difficile, no...1326483423590009Clostridium difficile colitis4307981
\n", 234 | "
" 235 | ], 236 | "text/plain": [ 237 | " ICD10CM ICD10CM_label ICD10CM_omop_id \\\n", 238 | "0 A04.4 Other intestinal Escherichia coli infections 35205417 \n", 239 | "1 A04.7 Enterocolitis due to Clostridium difficile 35205420 \n", 240 | "2 A04.72 Enterocolitis due to Clostridium difficile, no... 1326483 \n", 241 | "\n", 242 | " SNOMED SNOMED_label SNOMED_omop_id \n", 243 | "0 111839008 Intestinal infection due to E. coli 192815 \n", 244 | "1 186431008 Clostridioides difficile infection 193688 \n", 245 | "2 423590009 Clostridium difficile colitis 4307981 " 246 | ] 247 | }, 248 | "execution_count": 6, 249 | "metadata": {}, 250 | "output_type": "execute_result" 251 | } 252 | ], 253 | "source": [ 254 | "#4. Display the source to target table.\n", 255 | "df = vocab.show_source_to_target_table()\n", 256 | "df.head(3)" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": 7, 262 | "metadata": {}, 263 | "outputs": [], 264 | "source": [ 265 | "#5. Save the source-to-target mapping table to a CSV file.\n", 266 | "vocab.save_source_to_target('sample-data/output/icd10_to_snomed.csv')" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": 8, 272 | "metadata": {}, 273 | "outputs": [ 274 | { 275 | "data": { 276 | "text/html": [ 277 | "
\n", 278 | "\n", 291 | "\n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | "
ICD10CMICD10CM_labelICD10CM_omop_idSNOMEDSNOMED_labelSNOMED_omop_id
0C78.7Secondary malignant neoplasm of liver and intr...NaNNaNNaNNaN
1Z77.22Contact with and (suspected) exposure to envir...NaNNaNNaNNaN
2Z85.038Personal history of other malignant neoplasm o...NaNNaNNaNNaN
\n", 333 | "
" 334 | ], 335 | "text/plain": [ 336 | " ICD10CM ICD10CM_label \\\n", 337 | "0 C78.7 Secondary malignant neoplasm of liver and intr... \n", 338 | "1 Z77.22 Contact with and (suspected) exposure to envir... \n", 339 | "2 Z85.038 Personal history of other malignant neoplasm o... \n", 340 | "\n", 341 | " ICD10CM_omop_id SNOMED SNOMED_label SNOMED_omop_id \n", 342 | "0 NaN NaN NaN NaN \n", 343 | "1 NaN NaN NaN NaN \n", 344 | "2 NaN NaN NaN NaN " 345 | ] 346 | }, 347 | "execution_count": 8, 348 | "metadata": {}, 349 | "output_type": "execute_result" 350 | } 351 | ], 352 | "source": [ 353 | "#6. Save the failed source to target mappings to a CSV file.\n", 354 | "vocab.save_source_to_target_failed_mappings('sample-data/output/icd10_to_snomed_failed_mappings.csv')\n", 355 | "failed_mappings= pd.read_csv('sample-data/output/icd10_to_snomed_failed_mappings.csv')\n", 356 | "failed_mappings.head(3)" 357 | ] 358 | } 359 | ], 360 | "metadata": { 361 | "kernelspec": { 362 | "display_name": "Python 3.9.6 ('env': venv)", 363 | "language": "python", 364 | "name": "python3" 365 | }, 366 | "language_info": { 367 | "codemirror_mode": { 368 | "name": "ipython", 369 | "version": 3 370 | }, 371 | "file_extension": ".py", 372 | "mimetype": "text/x-python", 373 | "name": "python", 374 | "nbconvert_exporter": "python", 375 | "pygments_lexer": "ipython3", 376 | "version": "3.9.6" 377 | }, 378 | "vscode": { 379 | "interpreter": { 380 | "hash": "e372a2dd97ce19e4aba6b7ce1cf562a905ea4c8a82fe6108946fbfb7fabedc11" 381 | } 382 | } 383 | }, 384 | "nbformat": 4, 385 | "nbformat_minor": 4 386 | } 387 | -------------------------------------------------------------------------------- /cwmed/__init__.py: -------------------------------------------------------------------------------- 1 | import io 2 | import pandas as pd 3 | import requests 4 | import zipfile 5 | 6 | 7 | def download_data(url, path): 8 | """ 9 | Download and unzip two required files 10 | (1) CONCEPT.csv and (2) CONCEPT_RELATIONSHIP.csv 11 | using the url link emailed to registered users on the Athena OHDSI website. 12 | 13 | Args: 14 | url (str): Url link to download zipfile. 15 | path (str): Output directory to save CONCEPT.csv and CONCEPT_RELATIONSHIP.csv files. 16 | 17 | Examples: 18 | >>> import cw 19 | >>> url="https://example.com/data.zip" 20 | >>> path = "/path/to/output/directory/" 21 | >>> cw.download_data(url,path) 22 | """ 23 | 24 | print("Starting download...") 25 | 26 | response = requests.get(url) 27 | z = zipfile.ZipFile(io.BytesIO(response.content)) 28 | z.extractall(path, members=[i for i in z.namelist() 29 | if i in ('CONCEPT.csv', 'CONCEPT_RELATIONSHIP.csv')]) 30 | 31 | print("Download complete!") 32 | 33 | def get_unique_vocab(file_path): 34 | """ 35 | Get a NumPy array of unique source and target vocab from vocabulary_id column from the CONCEPT.csv file downloaded from Athena. 36 | 37 | Args: 38 | filepath (str): The file path to CONCEPT.csv. 39 | 40 | Returns: 41 | numpy.ndarray: A NumPy array of unique values from the vocabulary_id column in CONCEPT.csv. 42 | 43 | Examples: 44 | 45 | >>> import cw 46 | >>> unique_vocabs = cw.get_unique_vocab('tests/data/input/icd10_to_snomed_concept.csv') 47 | >>> print(unique_vocabs) 48 | ['ICD10CM', 'SNOMED'] 49 | 50 | """ 51 | 52 | concepts = pd.read_csv(file_path, sep='\t') 53 | 54 | unique_vocab_values = concepts["vocabulary_id"].unique() 55 | 56 | return unique_vocab_values 57 | 58 | class VocabTranslator: 59 | """ 60 | Translate source vocab to target vocab. 61 | 62 | Requires concept file and concept relationship downloaded from the Athena OHDSI website 63 | (https://athena.ohdsi.org/auth/login?forceSSO=true). 64 | 65 | Call `get_unique_vocab(filepath)` to use the specific source and target values 66 | from vocabulary_id column from the concept file 67 | in the source_vocab_value and target_vocab_value fields. 68 | 69 | Attributes: 70 | source_filepath (str): Path to source vocabulary file. 71 | source_code_col (str): Column with source code in the source vocabulary file that will be mapped to the target vocabulary. 72 | concept_filepath (str): Path to CONCEPT.csv. 73 | source_vocab_value (str): Value of the source vocabulary. 74 | target_vocab_value (str): Value of target vocabulary. 75 | concept_relationship_filepath = Path to CONCEPT_RELATIONSHIP.csv. 76 | 77 | Examples: 78 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 79 | source_code_col = 'icd10', 80 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 81 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 82 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 83 | """ 84 | 85 | def __init__(self, source_filepath: str, source_code_col: str, 86 | concept_filepath: str, source_vocab_value: str, target_vocab_value: str, 87 | concept_relationship_filepath: str): 88 | 89 | self.source_filepath = source_filepath 90 | self.source_code_col = source_code_col 91 | self.concept_filepath = concept_filepath 92 | self.source_vocab_value = source_vocab_value 93 | self.target_vocab_value = target_vocab_value 94 | self.concept_relationship_filepath = concept_relationship_filepath 95 | self.concept_file = self._read_concept_file() 96 | self.target_table = self._map_source_to_target() 97 | 98 | def _read_source_file(self): 99 | """ 100 | Read the source file. 101 | 102 | Returns: pd.DataFrame with the source code. 103 | 104 | Examples: 105 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 106 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 107 | source_code_col = 'icd10', 108 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 109 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 110 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 111 | >>> # Observe the source vocab, e.g. icd10 code 'A04.4' in the source file. 112 | >>> source_df = vocab._read_source_file() 113 | >>> source_df[source_df["icd10"] == "A04.4"] 114 | icd10 115 | 0 A04.4 116 | """ 117 | df = pd.read_csv(self.source_filepath, 118 | converters={self.source_code_col: str}) 119 | return df 120 | 121 | def _read_concept_file(self): 122 | """ 123 | Read the CONCEPT.csv. 124 | 125 | Returns: pd.DataFrame with a concept_id (an omop id), 126 | vocabulary_id that specifices the source or target names, 127 | domain_id that defines the clinical domain 128 | (e.g. Drugs, conditions, Orocedures, Devices, Observations, Measurements), 129 | concept_class_id that describes the vocabulary_id, 130 | concept_code that defines the source or target codes, 131 | and concept_name that provides the label for the code, 132 | and standard_concept that defines whether a vocabulary_id code is standard vocab. 133 | 134 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 135 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 136 | source_code_col = 'icd10', 137 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 138 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 139 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 140 | >>> # Observe the rows with icd 10 source code of A04.4 and snomed standard target code of 111839008 in the CONCEPT.csv. 141 | >>> concept_df = vocab._read_concept_file() 142 | >>> concept_df = concept_df[(concept_df['concept_code'] == 'A04.4') | (concept_df['concept_code'] == '111839008')] 143 | >>> concept_df = concept_df[['concept_id','vocabulary_id','concept_class_id','domain_id','concept_code','concept_name','standard_concept']] 144 | >>> concept_df 145 | concept_id vocabulary_id concept_class_id domain_id concept_code concept_name standard_concept 146 | 0 35205417 ICD10CM 4-char billing code Condition A04.4 Other intestinal NaN 147 | Escherichia coli 148 | 149 | 1 192815 SNOMED Clinical Finding Condition 111839008 Intestinal infection S 150 | due to E. coli 151 | """ 152 | df = pd.read_csv(self.concept_filepath, sep='\t', 153 | converters={"concept_id": str, 154 | "concept_code": str}) 155 | 156 | # Select only the needed vocabulary_id's, e.g. 'ICD10CM' and 'SNOMED'. 157 | df = df[(df["vocabulary_id"] == self.source_vocab_value) | 158 | (df["vocabulary_id"] == self.target_vocab_value)] 159 | 160 | return df 161 | 162 | def _read_concept_relationship_file(self): 163 | """ 164 | Read the CONCEPT_RELATIONSHIP.csv which maps source concept-id to target concept-id and vice versa. 165 | 166 | Returns: pd.DataFrame with concept_id_1, concept_id_2 and relationship_id. 167 | 168 | Examples: 169 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 170 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 171 | source_code_col = 'icd10', 172 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 173 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 174 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 175 | >>> concept_rel_df = vocab._read_concept_relationship_file() 176 | >>> concept_rel_df = concept_rel_df[concept_rel_df['concept_id_1'] == '35205417'] 177 | >>> concept_rel_df = concept_rel_df[['concept_id_1','concept_id_2', 'relationship_id']] 178 | >>> concept_rel_df 179 | concept_id_1 concept_id_2 relationship_id 180 | 0 35205417 192815 Maps to 181 | """ 182 | df = pd.read_csv(self.concept_relationship_filepath, sep='\t', 183 | converters={"concept_id_1": str, 184 | "concept_id_2": str}) 185 | df = df[df['relationship_id'] == "Maps to"] 186 | 187 | return df 188 | 189 | def _map_source_to_source_concept_id (self): 190 | """ 191 | Map source code to source concept_id in the CONCEPT.csv. 192 | 193 | Returns: pd.DataFrame with the source code, and source concept_id. 194 | 195 | Examples: 196 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 197 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 198 | source_code_col = 'icd10', 199 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 200 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 201 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 202 | >>> source_to_concept_id_df = vocab._map_source_to_source_concept_id() 203 | >>> source_to_concept_id_df = source_to_concept_id_df[source_to_concept_id_df['icd10'] == 'A04.4'] 204 | >>> source_to_concept_id_df 205 | icd10 concept_id concept_name domain_id vocabulary_id concept_class_id standard_concept concept_code valid_start_date valid_end_date invalid_reason 206 | 0 A04.4 35205417 Other intestinal 207 | Escherichia coli 208 | infections Condition ICD10CM 4-char billing code NaN A04.4 20070101.0 20991231.0 NaN 209 | """ 210 | df = self._read_source_file().merge(self.concept_file, how='left', 211 | left_on=self.source_code_col, 212 | right_on='concept_code') 213 | 214 | return df 215 | 216 | def _map_source_concept_id_to_target_concept_id (self): 217 | """ 218 | Map source concept_id to target concept_id in the CONCEPT_RELATIONSHIP.csv. 219 | 220 | Returns: pd.DataFrame with the source code, source concept_id and target concept_id. 221 | 222 | Examples: 223 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 224 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 225 | source_code_col = 'icd10', 226 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 227 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 228 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 229 | >>> source_concept_id_to_target_concept_id_df = vocab._map_source_concept_id_to_target_concept_id() 230 | >>> source_concept_id_to_target_concept_id_df = source_concept_id_to_target_concept_id_df[source_concept_id_to_target_concept_id_df['icd10'] == 'A04.4'] 231 | >>> source_concept_id_to_target_concept_id_df 232 | icd10 concept_name concept_id_1 concept_id_2 233 | 0 A04.4 Other intestinal 35205417 192815 234 | Escherichia coli 235 | infections 236 | """ 237 | df = self._map_source_to_source_concept_id().merge(self._read_concept_relationship_file(), 238 | how='left', 239 | left_on='concept_id', 240 | right_on='concept_id_1') 241 | 242 | df = df[[self.source_code_col, 243 | 'concept_name', 244 | 'concept_id_1', 245 | 'concept_id_2']] 246 | 247 | return df 248 | 249 | def _map_source_to_target(self): 250 | """ 251 | Map source code to target code using target concept_id in the CONCEPT_RELATIONSHIP.csv. 252 | 253 | Returns: pd.DataFrame with the source code, source concept_id and target concept_id. 254 | 255 | Examples: 256 | >>> # Read the source to vocab crosswalk as a Vocab Translator object. 257 | >>> vocab = cw.VocabTranslator(source_filepath = 'tests/data/input/icd10.csv', 258 | source_code_col = 'icd10', 259 | concept_filepath = 'tests/data/input/icd10_to_snomed_concept.csv', 260 | source_vocab_value = 'ICD10CM',target_vocab_value = 'SNOMED', 261 | concept_relationship_filepath = 'tests/data/input/icd10_to_snomed_concept_relationship.csv') 262 | >>> source_to_target_df = vocab._map_source_to_target() 263 | >>> source_to_target_df = source_to_target_df[source_to_target_df['ICD10CM'] == 'A04.4'] 264 | >>> source_to_target_df 265 | ICD10CM ICD10CM_label ICD10CM_omop_id SNOMED SNOMED_label SNOMED_omop_id 266 | 0 A04.4 Other intestinal 35205417 111839008 Intestinal 192815 267 | Escherichia coli infection due 268 | infections to E. coli 269 | """ 270 | df = self._map_source_concept_id_to_target_concept_id().merge(self.concept_file, 271 | how='left', 272 | left_on="concept_id_2", 273 | right_on="concept_id") 274 | 275 | # Select relevant columns from merge tables. 276 | df = df[[self.source_code_col, 277 | 'concept_name_x', 278 | 'concept_id_1', 279 | 'concept_code', 280 | 'concept_name_y', 281 | 'concept_id_2']] 282 | 283 | df.rename(columns={self.source_code_col:self.source_vocab_value},inplace=True) 284 | df.rename(columns={'concept_name_x':f'{self.source_vocab_value}_label'}, inplace=True) 285 | df.rename(columns={'concept_id_1':f'{self.source_vocab_value}_omop_id'}, inplace=True) 286 | df.rename(columns={'concept_code':f'{self.target_vocab_value}'}, inplace=True) 287 | df.rename(columns={'concept_name_y':f'{self.target_vocab_value}_label'}, inplace=True) 288 | df.rename(columns={'concept_id_2':f'{self.target_vocab_value}_omop_id'}, inplace=True) 289 | 290 | return df 291 | 292 | def show_source_to_target_table(self): 293 | """ 294 | Display the source to target table. 295 | 296 | Returns: a pd.DataFrame that maps concepts between the source and target 297 | vocabularies. 298 | 299 | Examples: 300 | >>> df = vocab.show_source_to_target_table() 301 | >>> df = df[df['ICD10CM'] == 'A04.4'] 302 | >>> df 303 | ICD10CM ICD10CM_label ICD10CM_omop_id SNOMED SNOMED_label SNOMED_omop_id 304 | 0 A04.4 Other intestinal 35205417 111839008 192815 Intestinal 305 | Escherichia coli infection due 306 | infections to E. coli 307 | """ 308 | return self.target_table 309 | 310 | def save_source_to_target(self, filepath): 311 | """ 312 | Save the source-to-target mapping table to a CSV file. 313 | 314 | Saves the merged table that maps concepts between the source 315 | and target vocabularies, and saves it as a CSV file to the specified 316 | filepath. 317 | 318 | Args: 319 | filepath: The filepath to save the source to target CSV file to. 320 | 321 | Examples: 322 | >>> vocab.save_source_to_target('folder/subfolder/out.csv') 323 | """ 324 | self.target_table.to_csv(filepath, index = False) 325 | 326 | def save_source_to_target_failed_mappings(self, filepath): 327 | """ 328 | Save the failed source to target mappings to a CSV file. 329 | 330 | Saves a pd.DataFrame that lists concepts that could not be matched 331 | between the source and target vocabularies to the specified 332 | filepath. 333 | 334 | Args: 335 | filepath: The filepath to save the failed mappings CSV file to. 336 | 337 | Examples: 338 | >>> vocab.save_source_to_target_failed_mappings('folder/subfolder/out.csv') 339 | >>> failed_mappings= pd.read_csv('folder/subfolder/out.csv') 340 | >>> failed_mappings 341 | ICD10CM ICD10CM_label ICD10CM_omop_id SNOMED SNOMED_label SNOMED_omop_id 342 | 0 A04.7 NaN NaN NaN NaN NaN 343 | """ 344 | failed_mappings = self.target_table[self.target_table[f'{self.target_vocab_value}_omop_id'].isnull()] 345 | failed_mappings.to_csv(filepath, index = False) 346 | -------------------------------------------------------------------------------- /sample-data/output/icd10_to_snomed.csv: -------------------------------------------------------------------------------- 1 | ICD10CM,ICD10CM_label,ICD10CM_omop_id,SNOMED,SNOMED_label,SNOMED_omop_id 2 | A04.4,Other intestinal Escherichia coli infections,35205417,111839008,Intestinal infection due to E. coli,192815 3 | A04.7,Enterocolitis due to Clostridium difficile,35205420,186431008,Clostridioides difficile infection,193688 4 | A04.72,"Enterocolitis due to Clostridium difficile, not specified as recurrent",1326483,423590009,Clostridium difficile colitis,4307981 5 | A07.1,Giardiasis [lambliasis],35205440,58265007,Giardiasis,437202 6 | A08.11,Acute gastroenteropathy due to Norwalk agent,45581101,24789006,Viral gastroenteritis due to Norwalk-like agent,196895 7 | A31.8,Other mycobacterial infections,35205524,88415009,Mycobacteriosis,440631 8 | A41.51,Sepsis due to Escherichia coli [E. coli],45552179,447899008,Sepsis due to Escherichia coli,40487064 9 | A41.81,Sepsis due to Enterococcus,45552180,1092591000119105,Sepsis caused by Enterococcus,46269946 10 | A41.89,Other specified sepsis,45537723,91302008,Sepsis,132797 11 | A41.9,"Sepsis, unspecified organism",35205553,91302008,Sepsis,132797 12 | A87.2,Lymphocytic choriomeningitis,35205691,398136003,Lymphocytic choriomeningitis,434860 13 | B02.9,Zoster without complications,35205741,111859007,Herpes zoster without complication,440329 14 | B18.2,Chronic viral hepatitis C,35205771,128302006,Chronic hepatitis C,198964 15 | B20,Human immunodeficiency virus [HIV] disease,35205776,86406008,Human immunodeficiency virus infection,439727 16 | B37.1,Pulmonary candidiasis,35205821,3487004,Candidiasis of lung,260041 17 | B44.1,Other pulmonary aspergillosis,35205862,6042001,Pulmonary aspergillosis,4245409 18 | B57.2,Chagas' disease (chronic) with heart involvement,35205913,722890004,Chronic Chagas disease with heart involvement,36716727 19 | B95.2,Enterococcus as the cause of diseases classified elsewhere,35206026,406574007,Infection due to enterococcus,443535 20 | B95.7,Other staphylococcus as the cause of diseases classified elsewhere,35206031,56038003,Staphylococcal infectious disease,435459 21 | B96.1,Klebsiella pneumoniae [K. pneumoniae] as the cause of diseases classified elsewhere,35206034,186435004,Bacterial infection due to Klebsiella pneumoniae,436339 22 | B96.20,Unspecified Escherichia coli [E. coli] as the cause of diseases classified elsewhere,45571486,71057007,Infection due to Escherichia coli,440320 23 | B96.5,Pseudomonas (aeruginosa) (mallei) (pseudomallei) as the cause of diseases classified elsewhere,35206038,63398001,Bacterial infection due to Pseudomonas,438064 24 | B96.89,Other specified bacterial agents as the cause of diseases classified elsewhere,45585977,87628006,Bacterial infectious disease,432545 25 | C16.0,Malignant neoplasm of cardia,35206115,93738008,Primary malignant neoplasm of cardia of stomach,432838 26 | C18.1,Malignant neoplasm of appendix,35206131,93679002,Primary malignant neoplasm of appendix,433143 27 | C18.2,Malignant neoplasm of ascending colon,35206132,93683002,Primary malignant neoplasm of ascending colon,4247719 28 | C18.8,Malignant neoplasm of overlapping sites of colon,35206138,109838007,Overlapping malignant neoplasm of colon,79740 29 | C34.31,"Malignant neoplasm of lower lobe, right bronchus or lung",45581205,372110008,"Primary malignant neoplasm of lower lobe, bronchus or lung",4157454 30 | C34.90,Malignant neoplasm of unspecified part of unspecified bronchus or lung,45590885,93986008,Primary malignant neoplasm of respiratory tract,4311499 31 | C44.311,Basal cell carcinoma of skin of nose,45561801,402818009,Basal cell carcinoma of nose,4291454 32 | C44.319,Basal cell carcinoma of skin of other parts of face,45590897,402519009,Basal cell carcinoma of face,4299417 33 | C78.00,Secondary malignant neoplasm of unspecified lung,45586027,94391008,Secondary malignant neoplasm of lung,254591 34 | C78.02,Secondary malignant neoplasm of left lung,45552281,353741000119106,Secondary malignant neoplasm of left lung,46273652 35 | C78.7,Secondary malignant neoplasm of liver and intrahepatic bile duct,,,, 36 | C79.51,Secondary malignant neoplasm of bone,45552285,94222008,Secondary malignant neoplasm of bone,78097 37 | C79.70,Secondary malignant neoplasm of unspecified adrenal gland,45576342,94161006,Secondary malignant neoplasm of adrenal gland,193144 38 | C79.89,Secondary malignant neoplasm of other specified sites,45532939,128462008,Secondary malignant neoplastic disease,432851 39 | C82.90,"Follicular lymphoma, unspecified, unspecified site",45552300,308121000,Follicular non-Hodgkin's lymphoma,4147411 40 | C83.00,"Small cell B-cell lymphoma, unspecified site",45600547,109968002,"Diffuse non-Hodgkin's lymphoma, small cell (clinical)",4002356 41 | C83.39,"Diffuse large B-cell lymphoma, extranodal and solid organ sites",45557027,93199007,Malignant lymphoma of extranodal AND/OR solid organ site,440058 42 | C83.39,"Diffuse large B-cell lymphoma, extranodal and solid organ sites",45557027,404148006,Diffuse large B-cell lymphoma (nodal/systemic with skin involvement),4300704 43 | C88.4,Extranodal marginal zone B-cell lymphoma of mucosa-associated lymphoid tissue [MALT-lymphoma],920123,445269007,Extranodal marginal zone B-cell lymphoma of mucosa-associated lymphoid tissue (MALT-lymphoma),40482893 44 | C90.10,Plasma cell leukemia not having achieved remission,45557038,95210003,Plasma cell leukemia,133154 45 | C92.02,"Acute myeloblastic leukemia, in relapse",45532959,91861009,"Acute myeloid leukemia, disease",140352 46 | D18.03,Hemangioma of intra-abdominal structures,45605347,189197001,Hemangioma of intra-abdominal structure,197239 47 | D22.39,Melanocytic nevi of other parts of face,45576380,109269004,Melanocytic nevus of face,4031106 48 | D46.9,"Myelodysplastic syndrome, unspecified",35206675,109995007,Myelodysplastic syndrome (clinical),138994 49 | D47.2,Monoclonal gammopathy,35206678,109983007,Monoclonal gammopathy (clinical),4002359 50 | D47.Z1,Post-transplant lymphoproliferative disorder (PTLD),45542704,254290004,Lymphoproliferative disorder following transplantation,435514 51 | D50.0,Iron deficiency anemia secondary to blood loss (chronic),35206692,724556004,Iron deficiency anemia due to blood loss,37119138 52 | D50.8,Other iron deficiency anemias,35206694,87522002,Iron deficiency anemia,436659 53 | D50.9,"Iron deficiency anemia, unspecified",35206695,87522002,Iron deficiency anemia,436659 54 | D52.0,Dietary folate deficiency anemia,35206702,267518003,Folate deficiency anemia due to dietary causes,4143351 55 | D53.8,Other specified nutritional anemias,35206709,66612000,Nutritional anemia,4280354 56 | D59.1,Other autoimmune hemolytic anemias,35206732,413603009,Autoimmune hemolytic anemia,441269 57 | D59.9,"Acquired hemolytic anemia, unspecified",35206739,4854004,Acquired hemolytic anemia,440979 58 | D63.1,Anemia in chronic kidney disease,45557089,707323002,Anemia in chronic kidney disease,45768812 59 | D63.8,Anemia in other chronic diseases classified elsewhere,35206750,234347009,Anemia of chronic disease,437247 60 | D64.9,"Anemia, unspecified",35206757,271737000,Anemia,439777 61 | D68.51,Activated protein C resistance,45537927,421527008,Resistance to activated protein C due to Factor V Leiden,4225324 62 | D69.49,Other primary thrombocytopenia,45542714,267534000,Primary thrombocytopenia,441264 63 | D69.6,"Thrombocytopenia, unspecified",35206772,302215000,Thrombocytopenic disorder,432870 64 | D70.1,Agranulocytosis secondary to cancer chemotherapy,45537931,767658000,Neutropenia due to and following chemotherapy,35624757 65 | D70.3,Neutropenia due to infection,45552363,46359005,Neutropenia associated with infectious disease,432589 66 | D72.820,Lymphocytosis (symptomatic),45605380,67023009,Lymphocytosis,4281826 67 | D89.811,Chronic graft-versus-host disease,45561938,402356004,Chronic graft-versus-host disease,434314 68 | E03.8,Other specified hypothyroidism,35206858,111566002,Acquired hypothyroidism,138384 69 | E03.9,"Hypothyroidism, unspecified",35206859,40930008,Hypothyroidism,140673 70 | E04.2,Nontoxic multinodular goiter,35206862,36241006,Non-toxic multinodular goiter,136368 71 | E05.90,"Thyrotoxicosis, unspecified without thyrotoxic crisis or storm",45581340,90739004,Thyrotoxicosis,138387 72 | E09.9,Drug or chemical induced diabetes mellitus without complications,45533015,5368009,Drug-induced diabetes mellitus,4202383 73 | E10.21,Type 1 diabetes mellitus with diabetic nephropathy,45552379,421893009,Renal disorder due to type 1 diabetes mellitus,200687 74 | E10.22,Type 1 diabetes mellitus with diabetic chronic kidney disease,45547621,421893009,Renal disorder due to type 1 diabetes mellitus,200687 75 | E10.319,Type 1 diabetes mellitus with unspecified diabetic retinopathy without macular edema,45542736,420789003,Retinopathy due to type 1 diabetes mellitus,4227210 76 | E10.3559,"Type 1 diabetes mellitus with stable proliferative diabetic retinopathy, unspecified eye",37200188,60971000119101,Proliferative retinopathy due to type 1 diabetes mellitus,45763584 77 | E10.40,"Type 1 diabetes mellitus with diabetic neuropathy, unspecified",45600638,421468001,Disorder of nervous system due to type 1 diabetes mellitus,377821 78 | E10.43,Type 1 diabetes mellitus with diabetic autonomic (poly)neuropathy,45533017,712882000,Autonomic neuropathy due to type 1 diabetes mellitus,37016767 79 | E10.51,Type 1 diabetes mellitus with diabetic peripheral angiopathy without gangrene,45547622,421365002,Peripheral circulatory disorder due to type 1 diabetes mellitus,318712 80 | E10.610,Type 1 diabetes mellitus with diabetic neuropathic arthropathy,45576440,46635009,Type 1 diabetes mellitus,201254 81 | E10.610,Type 1 diabetes mellitus with diabetic neuropathic arthropathy,45576440,71771000119100,Neuropathic arthropathy due to type 1 diabetes mellitus,45769830 82 | E10.65,Type 1 diabetes mellitus with hyperglycemia,45533018,46635009,Type 1 diabetes mellitus,201254 83 | E10.65,Type 1 diabetes mellitus with hyperglycemia,45533018,367991000119101,Hyperglycemia due to type 1 diabetes mellitus,37016348 84 | E11.21,Type 2 diabetes mellitus with diabetic nephropathy,45591027,420279001,Renal disorder due to type 2 diabetes mellitus,443731 85 | E11.22,Type 2 diabetes mellitus with diabetic chronic kidney disease,45595797,44054006,Type 2 diabetes mellitus,201826 86 | E11.22,Type 2 diabetes mellitus with diabetic chronic kidney disease,45595797,771000119108,Chronic kidney disease due to type 2 diabetes mellitus,43531578 87 | E11.319,Type 2 diabetes mellitus with unspecified diabetic retinopathy without macular edema,45581353,422099009,Disorder of eye due to type 2 diabetes mellitus,443733 88 | E11.51,Type 2 diabetes mellitus with diabetic peripheral angiopathy without gangrene,45533021,422166005,Peripheral circulatory disorder due to type 2 diabetes mellitus,443729 89 | E11.649,Type 2 diabetes mellitus with hypoglycemia without coma,45591031,44054006,Type 2 diabetes mellitus,201826 90 | E11.649,Type 2 diabetes mellitus with hypoglycemia without coma,45591031,120731000119103,Hypoglycemia due to type 2 diabetes mellitus,45757363 91 | E11.65,Type 2 diabetes mellitus with hyperglycemia,45605405,44054006,Type 2 diabetes mellitus,201826 92 | E11.65,Type 2 diabetes mellitus with hyperglycemia,45605405,368051000119109,Hyperglycemia due to type 2 diabetes mellitus,37016349 93 | E11.9,Type 2 diabetes mellitus without complications,35206882,313436004,Type 2 diabetes mellitus without complication,4193704 94 | E21.1,"Secondary hyperparathyroidism, not elsewhere classified",35206899,91478007,Secondary hyperparathyroidism,138388 95 | E21.3,"Hyperparathyroidism, unspecified",35206901,66999008,Hyperparathyroidism,133729 96 | E22.1,Hyperprolactinemia,35206905,237662005,Hyperprolactinemia,4030186 97 | E22.2,Syndrome of inappropriate secretion of antidiuretic hormone,35206906,55004003,Syndrome of inappropriate vasopressin secretion,4207539 98 | E53.8,Deficiency of other specified B group vitamins,35206988,47903000,Vitamin B deficiency,437246 99 | E55.9,"Vitamin D deficiency, unspecified",35206992,34713006,Vitamin D deficiency,436070 100 | E66.3,Overweight,45586164,238131007,Overweight,437525 101 | E66.9,"Obesity, unspecified",35207024,414916001,Obesity,433736 102 | E78.00,"Pure hypercholesterolemia, unspecified",37200312,267432004,Pure hypercholesterolemia,437827 103 | E78.1,Pure hyperglyceridemia,35207061,267433009,Pure hyperglyceridemia,440360 104 | E78.5,"Hyperlipidemia, unspecified",35207065,55822004,Hyperlipidemia,432867 105 | E79.0,Hyperuricemia without signs of inflammatory arthritis and tophaceous disease,35207068,190920002,Hyperuricemia without signs of inflammatory arthritis and tophaceous disease,4098611 106 | E80.4,Gilbert syndrome,35207075,27503000,Gilbert's syndrome,4099740 107 | E83.42,Hypomagnesemia,45542778,190855004,Hypomagnesemia,4098604 108 | E83.51,Hypocalcemia,45561991,5291005,Hypocalcemia,435510 109 | E86.0,Dehydration,45557144,34095006,Dehydration,435796 110 | E87.1,Hypo-osmolality and hyponatremia,35207093,267447008,Hypo-osmolality and or hyponatremia,435515 111 | E87.5,Hyperkalemia,35207097,14140009,Hyperkalemia,434610 112 | E87.6,Hypokalemia,35207098,43339004,Hypokalemia,437833 113 | E89.0,Postprocedural hypothyroidism,35207108,27059002,Postoperative hypothyroidism,137820 114 | F01.50,"Vascular dementia, unspecified severity, without behavioral disturbance, psychotic disturbance, mood disturbance, and anxiety",45591073,16276361000119109,Vascular dementia without behavioral disturbance,37109056 115 | F05,Delirium due to known physiological condition,35207116,2776000,Delirium,373995 116 | F10.10,"Alcohol abuse, uncomplicated",45595845,15167005,Alcohol abuse,433753 117 | F10.21,"Alcohol dependence, in remission",45581405,66590003,Alcohol dependence,435243 118 | F10.21,"Alcohol dependence, in remission",45581405,191813001,Chronic alcoholism in remission,439005 119 | F14.10,"Cocaine abuse, uncomplicated",45600707,78267003,Cocaine abuse,432303 120 | F17.210,"Nicotine dependence, cigarettes, uncomplicated",45562025,56294008,Nicotine dependence,4209423 121 | F17.290,"Nicotine dependence, other tobacco product, uncomplicated",45600719,56294008,Nicotine dependence,4209423 122 | F20.0,Paranoid schizophrenia,35207126,64905009,Paranoid schizophrenia,433450 123 | F25.1,"Schizoaffective disorder, depressive type",35207137,84760002,"Schizoaffective disorder, depressive type",4224940 124 | F32.9,"Major depressive disorder, single episode, unspecified",35207155,36923009,"Major depression, single episode",4282096 125 | F41.1,Generalized anxiety disorder,35207170,21897009,Generalized anxiety disorder,434613 126 | F41.8,Other specified anxiety disorders,35207172,197480006,Anxiety disorder,442077 127 | F41.9,"Anxiety disorder, unspecified",35207173,197480006,Anxiety disorder,442077 128 | F91.8,Other conduct disorders,35207270,430909002,Conduct disorder,443617 129 | G20,Parkinson's disease,35207329,49049000,Parkinson's disease,381270 130 | G31.84,Mild cognitive impairment of uncertain or unknown etiology,45595932,110352000,Minimal cognitive impairment,439795 131 | G31.89,Other specified degenerative diseases of nervous system,45600775,52522001,Degenerative brain disorder,375239 132 | G47.33,Obstructive sleep apnea (adult) (pediatric),45552539,78275009,Obstructive sleep apnea syndrome,442588 133 | G50.0,Trigeminal neuralgia,35207411,31681005,Trigeminal neuralgia,379801 134 | G81.91,"Hemiplegia, unspecified affecting right dominant side",45538140,442155009,Hemiplegia of dominant side,40482237 135 | G81.94,"Hemiplegia, unspecified affecting left nondominant side",45571830,441717007,Hemiplegia of nondominant side,40480429 136 | G89.21,Chronic pain due to trauma,45547763,431481001,Chronic pain due to injury,4331953 137 | G89.3,Neoplasm related pain (acute) (chronic),45591201,98921000119102,Pain due to neoplastic disease,44784631 138 | G93.49,Other encephalopathy,45566910,81308009,Disorder of brain,372887 139 | H11.30,"Conjunctival hemorrhage, unspecified eye",45600855,21117005,Conjunctival hemorrhage,378756 140 | H26.9,Unspecified cataract,35207545,193570009,Cataract,375545 141 | H35.3290,"Exudative age-related macular degeneration, unspecified eye, stage unspecified",37200419,414173003,Exudative age-related macular degeneration,376966 142 | H35.52,Pigmentary retinal dystrophy,45600913,764939004,Fundus albipunctatus,35622759 143 | H40.9,Unspecified glaucoma,35207557,23986001,Glaucoma,437541 144 | H44.522,"Atrophy of globe, left eye",45538295,4229009,Phthisis bulbi,4173943 145 | H49.21,"Sixth [abducent] nerve palsy, right eye",45596120,398760006,Abducens nerve palsy,381572 146 | H52.202,"Unspecified astigmatism, left eye",45562272,82649003,Astigmatism,378424 147 | H53.2,Diplopia,35207570,24982008,Diplopia,373474 148 | H54.0,"Blindness, both eyes",35207573,193699007,Blindness - both eyes,372906 149 | H54.51,"Low vision, right eye, normal vision left eye",45543088,339911000119106,"Low vision right eye, normal vision left eye",45757708 150 | H54.7,Unspecified visual loss,35207576,105597003,Blindness AND/OR vision impairment level,4023310 151 | H91.10,"Presbycusis, unspecified ear",45605767,49526009,Presbycusis,377574 152 | H91.93,"Unspecified hearing loss, bilateral",45567154,95820000,Bilateral hearing loss,374367 153 | I08.0,Rheumatic disorders of both mitral and aortic valves,35207658,16440002,Rheumatic disease of mitral AND aortic valves,4040820 154 | I10,Essential (primary) hypertension,35207668,59621000,Essential hypertension,320128 155 | I11.0,Hypertensive heart disease with heart failure,35207669,46113002,Hypertensive heart failure,444101 156 | I12.0,Hypertensive chronic kidney disease with stage 5 chronic kidney disease or end stage renal disease,35207671,49220004,Hypertensive renal failure,443919 157 | I12.9,"Hypertensive chronic kidney disease with stage 1 through stage 4 chronic kidney disease, or unspecified chronic kidney disease",35207672,104931000119100,Chronic kidney disease due to hypertension,44782429 158 | I13.0,"Hypertensive heart and chronic kidney disease with heart failure and stage 1 through stage 4 chronic kidney disease, or unspecified chronic kidney disease",35207673,194779001,Hypertensive heart and renal disease with (congestive) heart failure,439696 159 | I21.29,ST elevation (STEMI) myocardial infarction involving other sites,45557536,401303003,Acute ST segment elevation myocardial infarction,4296653 160 | I21.4,Non-ST elevation (NSTEMI) myocardial infarction,35207685,401314000,Acute non-ST segment elevation myocardial infarction,4270024 161 | I25.10,Atherosclerotic heart disease of native coronary artery without angina pectoris,45586572,451041000124103,Atherosclerosis of coronary artery without angina pectoris,764123 162 | I25.2,Old myocardial infarction,35207702,1755008,Old myocardial infarction,314666 163 | I25.82,Chronic total occlusion of coronary artery,45596199,117051000119103,Chronic total occlusion of coronary artery,36712779 164 | I26.99,Other pulmonary embolism without acute cor pulmonale,45572084,59282003,Pulmonary embolism,440417 165 | I27.2,Other secondary pulmonary hypertension,35207709,88223008,Secondary pulmonary hypertension,4339214 166 | I28.0,Arteriovenous fistula of pulmonary vessels,35207711,111289009,Arteriovenous fistula of pulmonary vessels,441593 167 | I30.0,Acute nonspecific idiopathic pericarditis,35207715,266235007,Acute idiopathic pericarditis,315293 168 | I31.1,Chronic constrictive pericarditis,35207720,52535005,Chronic constrictive pericarditis,4203625 169 | I31.3,Pericardial effusion (noninflammatory),35207722,194970009,Pericardial effusion - noninflammatory,4108814 170 | I31.4,Cardiac tamponade,45581770,35304003,Cardiac tamponade,318450 171 | I42.0,Dilated cardiomyopathy,35207755,399020009,Dilated cardiomyopathy,4163710 172 | I42.2,Other hypertrophic cardiomyopathy,35207757,233873004,Hypertrophic cardiomyopathy,4124693 173 | I44.2,"Atrioventricular block, complete",35207768,27885002,Complete atrioventricular block,320744 174 | I46.9,"Cardiac arrest, cause unspecified",35207779,410429000,Cardiac arrest,321042 175 | I47.2,Ventricular tachycardia,35207782,25569003,Ventricular tachycardia,4103295 176 | I48.0,Paroxysmal atrial fibrillation,35207784,282825002,Paroxysmal atrial fibrillation,4154290 177 | I48.91,Unspecified atrial fibrillation,45576876,49436004,Atrial fibrillation,313217 178 | I49.01,Ventricular fibrillation,45562353,71908006,Ventricular fibrillation,437894 179 | I50.1,"Left ventricular failure, unspecified",35207792,85232009,Left heart failure,439846 180 | I50.33,Acute on chronic diastolic (congestive) heart failure,45562355,42343007,Congestive heart failure,319835 181 | I50.33,Acute on chronic diastolic (congestive) heart failure,45562355,443344007,Acute on chronic diastolic heart failure,40481043 182 | I50.9,"Heart failure, unspecified",35207793,84114007,Heart failure,316139 183 | I51.89,Other ill-defined heart diseases,45567183,56265001,Heart disease,321588 184 | I51.9,"Heart disease, unspecified",35207801,56265001,Heart disease,321588 185 | I61.8,Other nontraumatic intracerebral hemorrhage,35207815,291571000119106,Spontaneous cerebral hemorrhage,43530727 186 | I63.231,Cerebral infarction due to unspecified occlusion or stenosis of right carotid arteries,45601043,266254007,Carotid artery occlusion,313226 187 | I63.231,Cerebral infarction due to unspecified occlusion or stenosis of right carotid arteries,45601043,230692004,Infarction - precerebral,4043731 188 | I63.411,Cerebral infarction due to embolism of right middle cerebral artery,45562367,705128004,Cerebral infarction due to embolism of middle cerebral artery,45772786 189 | I65.29,Occlusion and stenosis of unspecified carotid artery,45601050,69798007,Carotid artery obstruction,4288310 190 | I67.82,Cerebral ischemia,45581787,287731003,Cerebral ischemia,374384 191 | I70.213,"Atherosclerosis of native arteries of extremities with intermittent claudication, bilateral legs",45567208,12236951000119108,Intermittent claudication of bilateral lower limbs co-occurrent and due to atherosclerosis,36717006 192 | I70.213,"Atherosclerosis of native arteries of extremities with intermittent claudication, bilateral legs",45567208,724440007,Atherosclerosis of artery of lower limb,37110250 193 | I70.293,"Other atherosclerosis of native arteries of extremities, bilateral legs",45552825,724440007,Atherosclerosis of artery of lower limb,37110250 194 | I70.90,Unspecified atherosclerosis,45581810,72092001,Arteriosclerotic vascular disease,318443 195 | I72.2,Aneurysm of renal artery,35207854,36184004,Aneurysm of renal artery,194385 196 | I73.9,"Peripheral vascular disease, unspecified",35207860,400047006,Peripheral vascular disease,321052 197 | I74.3,Embolism and thrombosis of arteries of the lower extremities,35207863,1010730002,Thromboembolus of artery of lower limb,605283 198 | I77.6,"Arteritis, unspecified",35207874,52089001,Arteritis,314659 199 | I81,Portal vein thrombosis,35207887,17920008,Portal vein thrombosis,199837 200 | I82.611,Acute embolism and thrombosis of superficial veins of right upper extremity,45601092,132591000119109,Acute thrombosis of superficial vein of upper extremity,44782760 201 | I87.2,Venous insufficiency (chronic) (peripheral),35207904,20696009,Peripheral venous insufficiency,321596 202 | I97.131,Postprocedural heart failure following other surgery,45557612,89819002,Cardiac insufficiency during AND/OR resulting from a procedure,4233224 203 | I97.191,Other postprocedural cardiac functional disturbances following other surgery,45538467,233816003,Postoperative cardiac complication,4121463 204 | J15.0,Pneumonia due to Klebsiella pneumoniae,35207940,64479007,Pneumonia due to Klebsiella pneumoniae,253790 205 | J18.9,"Pneumonia, unspecified organism",35207956,233604007,Pneumonia,255848 206 | J22,Unspecified acute lower respiratory infection,35207970,195742007,Acute lower respiratory tract infection,4307774 207 | J33.9,"Nasal polyp, unspecified",35207987,736499003,Polyp of nasal cavity and/or nasal sinus,42537251 208 | J38.02,"Paralysis of vocal cords and larynx, bilateral",45548114,195844002,Bilateral partial vocal cord paralysis,260130 209 | J38.4,Edema of larynx,35208003,51599000,Edema of larynx,22350 210 | J43.9,"Emphysema, unspecified",35208022,87433001,Pulmonary emphysema,261325 211 | J44.0,Chronic obstructive pulmonary disease with (acute) lower respiratory infection,35208023,196001008,Chronic obstructive pulmonary disease with acute lower respiratory infection,4110056 212 | J44.1,Chronic obstructive pulmonary disease with (acute) exacerbation,35208024,195951007,Acute exacerbation of chronic obstructive airways disease,257004 213 | J44.9,"Chronic obstructive pulmonary disease, unspecified",35208025,13645005,Chronic obstructive lung disease,255573 214 | J45.909,"Unspecified asthma, uncomplicated",45562457,707444001,Uncomplicated asthma,45768910 215 | J47.0,Bronchiectasis with acute lower respiratory infection,45562458,12295008,Bronchiectasis,256449 216 | J47.1,Bronchiectasis with (acute) exacerbation,45572172,445378003,Acute exacerbation of bronchiectasis,40483342 217 | J47.9,"Bronchiectasis, uncomplicated",45562459,12295008,Bronchiectasis,256449 218 | J69.0,Pneumonitis due to inhalation of food and vomit,35208059,415126001,Pneumonitis due to inhaled substance,4187218 219 | J84.116,Cryptogenic organizing pneumonia,45567274,719218000,Cryptogenic organizing pneumonia,36714118 220 | J90,"Pleural effusion, not elsewhere classified",35208081,60046008,Pleural effusion,254061 221 | J91.8,Pleural effusion in other conditions classified elsewhere,45567276,60046008,Pleural effusion,254061 222 | J93.12,Secondary spontaneous pneumothorax,45562466,328571000119101,Secondary spontaneous pneumothorax,762338 223 | J96.00,"Acute respiratory failure, unspecified whether with hypoxia or hypercapnia",45605906,409622000,Respiratory failure,4256228 224 | J96.01,Acute respiratory failure with hypoxia,45567283,709111008,Acute hypoxemic respiratory failure,46271075 225 | J98.11,Atelectasis,45591566,46621007,Atelectasis,261880 226 | J98.4,Other disorders of lung,35208105,19829001,Disorder of lung,257907 227 | K22.2,Esophageal obstruction,35208192,405247003,Obstruction of esophagus,4224926 228 | K29.80,Duodenitis without bleeding,45543300,72007001,Duodenitis,433516 229 | K31.7,Polyp of stomach and duodenum,35208245,78809005,Gastric polyp,4303233 230 | K31.84,Gastroparesis,45591585,235675006,Gastroparesis syndrome,195847 231 | K31.89,Other diseases of stomach and duodenum,45533586,119291004,Disorder of upper gastrointestinal tract,4000609 232 | K35.3,Acute appendicitis with localized peritonitis,920137,698294004,Acute appendicitis with localized peritonitis,44784251 233 | K40.90,"Unilateral inguinal hernia, without obstruction or gangrene, not specified as recurrent",45533588,396232000,Inguinal hernia,4288544 234 | K42.9,Umbilical hernia without obstruction or gangrene,35208260,396347007,Umbilical hernia,4245842 235 | K43.2,Incisional hernia without obstruction or gangrene,1569600,236037000,Incisional hernia,198464 236 | K44.9,Diaphragmatic hernia without obstruction or gangrene,35208263,39839004,Diaphragmatic hernia,201061 237 | K52.3,Indeterminate colitis,37200611,235746007,Indeterminate colitis,4341633 238 | K52.89,Other specified noninfective gastroenteritis and colitis,45581903,85919009,Disorder of intestine,201618 239 | K55.21,Angiodysplasia of colon with hemorrhage,45538537,95540002,Hemorrhage of colon,442190 240 | K55.21,Angiodysplasia of colon with hemorrhage,45538537,197244008,Angiodysplasia of colon,4055201 241 | K56.0,Paralytic ileus,35208279,55525008,Paralytic ileus,192357 242 | K57.10,Diverticulosis of small intestine without perforation or abscess without bleeding,45567315,8114009,Diverticulosis of small intestine,193252 243 | K57.30,Diverticulosis of large intestine without perforation or abscess without bleeding,45586725,45568004,Diverticulosis of large intestine without diverticulitis,4164898 244 | K57.31,Diverticulosis of large intestine without perforation or abscess with bleeding,45548163,45568004,Diverticulosis of large intestine without diverticulitis,4164898 245 | K57.31,Diverticulosis of large intestine without perforation or abscess with bleeding,45548163,1086601000119100,Intestinal hemorrhage with diverticulosis,46269907 246 | K58.9,Irritable bowel syndrome without diarrhea,35208287,10743008,Irritable bowel syndrome,75576 247 | K59.00,"Constipation, unspecified",45601182,14760008,Constipation,75860 248 | K62.6,Ulcer of anus and rectum,35208311,442405009,Ulcer of anorectal structure,40483171 249 | K63.5,Polyp of colon,35208319,68496003,Polyp of colon,4285898 250 | K64.0,First degree hemorrhoids,1569658,721703004,Internal hemorrhoids grade I,36715916 251 | K64.8,Other hemorrhoids,1569664,70153002,Hemorrhoids,195562 252 | K65.1,Peritoneal abscess,45538543,73962000,Abscess of peritoneum,200757 253 | K65.9,"Peritonitis, unspecified",35208324,48661000,Peritonitis,196152 254 | K66.1,Hemoperitoneum,35208326,45626005,Nontraumatic hemoperitoneum,194690 255 | K68.11,Postprocedural retroperitoneal abscess,45562506,1090321000119103,Postprocedural retroperitoneal abscess,45757263 256 | K68.12,Psoas muscle abscess,45591604,266463007,Iliopsoas abscess,199073 257 | K70.30,Alcoholic cirrhosis of liver without ascites,45605952,420054005,Alcoholic cirrhosis,196463 258 | K75.4,Autoimmune hepatitis,35208356,408335007,Autoimmune hepatitis,200762 259 | K76.6,Portal hypertension,35208365,34742003,Portal hypertension,192680 260 | K76.89,Other specified diseases of liver,45605957,235856003,Disease of liver,194984 261 | K81.0,Acute cholecystitis,35208370,65275009,Acute cholecystitis,198809 262 | K82.8,Other specified diseases of gallbladder,35208378,39621005,Disorder of gallbladder,192353 263 | K90.0,Celiac disease,35208401,396331005,Celiac disease,194992 264 | K91.840,Postprocedural hemorrhage of a digestive system organ or structure following a digestive system procedure,45577006,131148009,Bleeding,437312 265 | K91.840,Postprocedural hemorrhage of a digestive system organ or structure following a digestive system procedure,45577006,363132006,Gastrointestinal complication of procedure,4178810 266 | K92.1,Melena,35208413,2901004,Melena,4103703 267 | L03.113,Cellulitis of right upper limb,45557692,10633911000119107,Cellulitis of right upper limb,759859 268 | L03.818,Cellulitis of other sites,45557694,128045006,Cellulitis,435613 269 | L27.0,Generalized skin eruption due to drugs and medicaments taken internally,35208483,200892002,Generalized skin eruption caused by drug and medicament,4064036 270 | L80,Vitiligo,35208655,56727007,Vitiligo,138502 271 | L97.919,Non-pressure chronic ulcer of unspecified part of right lower leg with unspecified severity,45572302,10641391000119104,Chronic ulcer of skin of lower leg,46269757 272 | M08.29,"Juvenile rheumatoid arthritis with systemic onset, multiple sites",45601299,201796004,Systemic onset juvenile chronic arthritis,4116447 273 | M08.29,"Juvenile rheumatoid arthritis with systemic onset, multiple sites",45601299,287006005,Rheumatoid arthritis of multiple joints,4117686 274 | M10.9,"Gout, unspecified",35208756,90560007,Gout,440674 275 | M12.9,"Arthropathy, unspecified",45586884,399269003,Arthropathy,73553 276 | M15.9,"Polyosteoarthritis, unspecified",35208765,396275006,Osteoarthritis,80180 277 | M19.011,"Primary osteoarthritis, right shoulder",45591743,201831003,"Localized, primary osteoarthritis of the shoulder region",73840 278 | M19.91,"Primary osteoarthritis, unspecified site",45567474,239862000,Idiopathic osteoarthritis,4035439 279 | M1A.0221,"Idiopathic chronic gout, left elbow, with tophus (tophi)",45601357,24595009,Primary gout,4084229 280 | M1A.0221,"Idiopathic chronic gout, left elbow, with tophus (tophi)",45601357,402469004,Gouty tophus,4299408 281 | M20.12,"Hallux valgus (acquired), left foot",45582081,65358001,Acquired hallux valgus,75911 282 | M23.321,"Other meniscus derangements, posterior horn of medial meniscus, right knee",45601393,5313005,Derangement of posterior horn of medial meniscus,75051 283 | M23.8X2,Other internal derangements of left knee,45553127,63643000,Derangement of knee,76786 284 | M32.9,"Systemic lupus erythematosus, unspecified",35208827,55464009,Systemic lupus erythematosus,257628 285 | M35.2,Behcet's disease,35208833,310701003,Behcet's syndrome,436642 286 | M41.20,"Other idiopathic scoliosis, site unspecified",45572451,203639008,Idiopathic scoliosis,4069935 287 | M47.12,"Other spondylosis with myelopathy, cervical region",45562732,1156963006,Myelopathy due to cervical spondylosis,608177 288 | M51.26,"Other intervertebral disc displacement, lumbar region",45606242,202708005,Prolapsed lumbar intervertebral disc,4068482 289 | M54.5,Low back pain,35208969,279039007,Low back pain,194133 290 | M81.0,Age-related osteoporosis without current pathological fracture,35209038,64859006,Osteoporosis,80502 291 | M84.48XA,"Pathological fracture, other site, initial encounter for fracture",45562894,268029009,Pathological fracture,73571 292 | M84.58XA,"Pathological fracture in neoplastic disease, other specified site, initial encounter for fracture",45567728,203449003,Pathologic fracture of bone at site of neoplasm,4067766 293 | M85.9,"Disorder of bone density and structure, unspecified",35209099,76069003,Disorder of bone,75909 294 | M87.052,Idiopathic aseptic necrosis of left femur,45572652,445157005,Aseptic necrosis of bone of hip,40482444 295 | N04.9,Nephrotic syndrome with unspecified morphologic changes,35209214,52254009,Nephrotic syndrome,195314 296 | N10,Acute pyelonephritis,35209246,36689008,Acute pyelonephritis,4280571 297 | N17.0,Acute kidney failure with tubular necrosis,35209269,35455006,Acute tubular necrosis,444044 298 | N17.9,"Acute kidney failure, unspecified",35209273,14669001,Acute renal failure syndrome,197320 299 | N18.3,"Chronic kidney disease, stage 3 (moderate)",35209276,433144002,Chronic kidney disease stage 3,443597 300 | N18.4,"Chronic kidney disease, stage 4 (severe)",35209277,431857002,Chronic kidney disease stage 4,443612 301 | N18.5,"Chronic kidney disease, stage 5",35209278,433146000,Chronic kidney disease stage 5,443611 302 | N18.6,End stage renal disease,45548653,46177005,End-stage renal disease,193782 303 | N18.9,"Chronic kidney disease, unspecified",35209279,709044004,Chronic kidney disease,46271022 304 | N20.0,Calculus of kidney,35209281,95570007,Kidney stone,201620 305 | N28.1,"Cyst of kidney, acquired",35209298,105999006,Acquired renal cystic disease,194686 306 | N39.0,"Urinary tract infection, site not specified",35209324,68566005,Urinary tract infectious disease,81902 307 | N39.498,Other specified urinary incontinence,45592135,165232002,Urinary incontinence,197672 308 | N40.0,Benign prostatic hyperplasia without lower urinary tract symptoms,45539047,266569009,Benign prostatic hyperplasia,198803 309 | N41.0,Acute prostatitis,1571520,79411002,Acute prostatitis,193522 310 | N81.3,Complete uterovaginal prolapse,35209403,63871009,Third degree uterine prolapse,193528 311 | N84.1,Polyp of cervix uteri,35209424,65576009,Polyp of cervix,4280498 312 | Q24.8,Other specified congenital malformations of heart,35210830,13213009,Congenital heart disease,312723 313 | Q25.0,Patent ductus arteriosus,35210832,83330001,Patent ductus arteriosus,315922 314 | Q44.6,Cystic disease of liver,35210961,72925005,Congenital cystic disease of liver,197654 315 | Q61.3,"Polycystic kidney, unspecified",35211020,82525005,Multiple congenital cysts of kidney,4220238 316 | Q89.09,Congenital malformations of spleen,45582685,57497006,Congenital anomaly of spleen,193308 317 | R04.2,Hemoptysis,35211272,66857006,Hemoptysis,261687 318 | R10.13,Epigastric pain,45558454,79922009,Epigastric pain,197381 319 | R13.19,Other dysphagia,45592409,40739000,Dysphagia,31317 320 | R19.7,"Diarrhea, unspecified",45534435,62315008,Diarrhea,196523 321 | R26.89,Other abnormalities of gait and mobility,45597175,22325002,Abnormal gait,437643 322 | R29.705,NIHSS score 5,37201045,450743008,National Institutes of Health stroke scale score,42872751 323 | R29.710,NIHSS score 10,37201051,450743008,National Institutes of Health stroke scale score,42872751 324 | R29.720,NIHSS score 20,37201062,450743008,National Institutes of Health stroke scale score,42872751 325 | R31.0,Gross hematuria,45553727,197941005,Frank hematuria,75004 326 | R33.8,Other retention of urine,45548960,267064002,Retention of urine,192450 327 | R33.9,"Retention of urine, unspecified",45587508,267064002,Retention of urine,192450 328 | R40.4,Transient alteration of awareness,45587518,365933000,Mental alertness - finding,4275359 329 | R42,Dizziness and giddiness,35211350,271789005,Dizziness and giddiness,433316 330 | R43.2,Parageusia,35211353,271801002,Taste sense altered,436235 331 | R47.1,Dysarthria and anarthria,35211377,8011004,Dysarthria,4196636 332 | R50.81,Fever presenting with conditions classified elsewhere,45606818,386661006,Fever,437663 333 | R55,Syncope and collapse,35211391,419045004,Loss of consciousness,372448 334 | R60.1,Generalized edema,35211401,271808008,"Edema, generalized",4155910 335 | R65.21,Severe sepsis with septic shock,45577803,76571007,Septic shock,196236 336 | R74.0,Nonspecific elevation of levels of transaminase and lactic acid dehydrogenase [LDH],35211421,274774002,Elevated level of transaminase and lactic acid dehydrogenase,436238 337 | R78.81,Bacteremia,45587526,5758002,Bacteremia,132736 338 | R79.1,Abnormal coagulation profile,45592434,165563002,Coag./bleeding tests abnormal,4306267 339 | R82.71,Bacteriuria,37201114,61373006,Bacteriuria,4265485 340 | R82.99,Other abnormal findings in urine,45563325,102866000,Abnormal urine,4009585 341 | R91.8,Other nonspecific abnormal finding of lung field,45577823,274533004,Abnormal findings on diagnostic imaging of lung,437677 342 | S20.212A,"Contusion of left front wall of thorax, initial encounter",45607028,10050004,Contusion of chest,81175 343 | S30.0XXA,"Contusion of lower back and pelvis, initial encounter",45607117,36787001,Contusion of trunk,195977 344 | S32.431A,"Displaced fracture of anterior column [iliopubic] of right acetabulum, initial encounter for closed fracture",45534836,208148000,"Closed fracture acetabulum, anterior column",4008519 345 | S32.601A,"Unspecified fracture of right ischium, initial encounter for closed fracture",45558873,36417005,Closed fracture of ischium,80861 346 | S32.89XD,"Fracture of other parts of pelvis, subsequent encounter for fracture with routine healing",45587895,77493009,Fracture of pelvis,4300192 347 | S83.122A,"Posterior subluxation of proximal end of tibia, left knee, initial encounter",45555435,263058005,Subluxation of knee joint,4136565 348 | T36.1X5A,"Adverse effect of cephalosporins and other beta-lactam antibiotics, initial encounter",45599387,419885006,Beta lactam adverse reaction,4168834 349 | T40.2X5A,"Adverse effect of other opioids, initial encounter",45589752,292045009,Opioid analgesic adverse reaction,432789 350 | T42.4X5A,"Adverse effect of benzodiazepines, initial encounter",45599463,870677001,Adverse reaction to benzodiazepine,3661779 351 | T45.1X5A,"Adverse effect of antineoplastic and immunosuppressive drugs, initial encounter",45594673,62014003,Adverse reaction to drug,441207 352 | T46.2X5A,"Adverse effect of other antidysrhythmic drugs, initial encounter",45551238,293436009,Antiarrhythmic drug adverse reaction,443371 353 | T81.4XXA,"Infection following a procedure, initial encounter",45580391,12246311000119109,Postprocedural infection,36712821 354 | T82.867A,"Thrombosis due to cardiac prosthetic devices, implants and grafts, initial encounter",45541838,24346005,"Thrombus due to any device, implant AND/OR graft",4085586 355 | T82.868A,"Thrombosis due to vascular prosthetic devices, implants and grafts, initial encounter",45609345,24346005,"Thrombus due to any device, implant AND/OR graft",4085586 356 | T82.897A,"Other specified complication of cardiac prosthetic devices, implants and grafts, initial encounter",45565845,473023007,Complication associated with device,43021974 357 | T85.611A,"Breakdown (mechanical) of intraperitoneal dialysis catheter, initial encounter",45575617,431028002,Mechanical complication of peritoneal dialysis catheter,440302 358 | T86.11,Kidney transplant rejection,45609393,236570004,Renal transplant rejection,4128369 359 | T86.19,Other complication of kidney transplant,45537090,58797008,Disorder of transplanted kidney,199991 360 | T86.41,Liver transplant rejection,45551553,235911006,Liver transplant rejection,4341657 361 | T86.891,Other transplanted tissue failure,45551559,269295009,Transplanted organ failure,4151240 362 | T87.89,Other complications of amputation stump,45604592,240276001,Disorder of amputation stump,4345680 363 | W18.30XA,"Fall on same level, unspecified, initial encounter",45542184,33036003,Fall on same level,4140830 364 | W18.39XD,"Other fall on same level, subsequent encounter",45542185,33036003,Fall on same level,4140830 365 | Y83.0,"Surgical operation with transplant of whole organ as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224804,70209001,Late effect of complications of procedure,4322175 366 | Y83.1,"Surgical operation with implant of artificial internal device as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224805,88797001,Complication of surgical procedure,434547 367 | Y83.1,"Surgical operation with implant of artificial internal device as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224805,95869003,Adverse effect of prosthetic device,4320824 368 | Y83.5,"Amputation of limb(s) as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224809,735915008,Complication following amputation of limb,42536891 369 | Y83.8,"Other surgical procedures as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224811,88797001,Complication of surgical procedure,434547 370 | Y84.1,"Kidney dialysis as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224814,70209001,Late effect of complications of procedure,4322175 371 | Y84.8,"Other medical procedures as the cause of abnormal reaction of the patient, or of later complication, without mention of misadventure at the time of the procedure",35224821,116224001,Complication of procedure,442019 372 | Y95,Nosocomial condition,35225031,35688006,Complication of medical care,440005 373 | Z00.00,Encounter for general adult medical examination without abnormal findings,45552054,308335008,Patient encounter procedure,4203722 374 | Z15.09,Genetic susceptibility to other malignant neoplasm,45590702,47708004,Genetic predisposition,4166231 375 | Z16.12,Extended spectrum beta lactamase (ESBL) resistance,45566400,31438003,Drug resistance,4150981 376 | Z16.35,Resistance to multiple antimicrobial drugs,45605109,31438003,Drug resistance,4150981 377 | Z21,Asymptomatic human immunodeficiency virus [HIV] infection status,35225089,91947003,Asymptomatic human immunodeficiency virus infection,4241530 378 | Z22.1,Carrier of other intestinal infectious diseases,35225091,66598005,Infectious disease carrier,4280828 379 | Z22.39,Carrier of other specified bacterial diseases,45585811,56038003,Staphylococcal infectious disease,435459 380 | Z45.010,Encounter for checking and testing of cardiac pacemaker pulse generator [battery],45547315,308335008,Patient encounter procedure,4203722 381 | Z51.6,Encounter for desensitization to allergens,37202294,308335008,Patient encounter procedure,4203722 382 | Z53.09,Procedure and treatment not carried out because of other contraindication,45561635,416237000,Procedure not done,4168192 383 | Z53.32,Thoracoscopic surgical procedure converted to open procedure,37202297,711454001,Failed procedure using minimal access approach converted to open procedure,46272989 384 | Z53.8,Procedure and treatment not carried out for other reasons,35225162,416237000,Procedure not done,4168192 385 | Z59.3,Problems related to living in residential institution,35225202,15929301000119104,Problem related to living in residential institution,765265 386 | Z60.2,Problems related to living alone,35225211,105529008,Lives alone,4023168 387 | Z63.8,Other specified problems related to primary support group,35225243,248539004,Family problems,4094126 388 | Z68.29,"Body mass index [BMI] 29.0-29.9, adult",45605144,162863004,Body mass index 25-29 - overweight,4060705 389 | Z74.3,Need for continuous supervision,35225286,105507009,Patient dependence on care provider,4022076 390 | Z77.22,Contact with and (suspected) exposure to environmental tobacco smoke (acute) (chronic),,,, 391 | Z79.01,Long term (current) use of anticoagulants,45552108,711150003,Long-term current use of anticoagulant,46273937 392 | Z79.02,Long term (current) use of antithrombotics/antiplatelets,45561654,710814002,Long-term current use of drug therapy,46272450 393 | Z79.4,Long term (current) use of insulin,45576185,710815001,Long-term current use of insulin,46272451 394 | Z79.52,Long term (current) use of systemic steroids,45581074,710816000,Long-term current use of steroid,46272452 395 | Z79.82,Long term (current) use of aspirin,45537677,131531000119103,Long-term current use of aspirin,36717001 396 | Z79.84,Long term (current) use of oral hypoglycemic drugs,37202300,710814002,Long-term current use of drug therapy,46272450 397 | Z80.0,Family history of malignant neoplasm of digestive organs,35225305,430813008,Family history of malignant neoplasm of digestive organ,4334494 398 | Z81.8,Family history of other mental and behavioral disorders,35225318,160324006,Family history of mental disorder,4051568 399 | Z85.038,Personal history of other malignant neoplasm of large intestine,,,, 400 | Z85.048,"Personal history of other malignant neoplasm of rectum, rectosigmoid junction, and anus",,,, 401 | Z85.05,Personal history of malignant neoplasm of liver,,,, 402 | Z85.118,Personal history of other malignant neoplasm of bronchus and lung,,,, 403 | Z85.21,Personal history of malignant neoplasm of larynx,,,, 404 | Z85.3,Personal history of malignant neoplasm of breast,,,, 405 | Z85.46,Personal history of malignant neoplasm of prostate,,,, 406 | Z85.51,Personal history of malignant neoplasm of bladder,,,, 407 | Z85.528,Personal history of other malignant neoplasm of kidney,,,, 408 | Z85.820,Personal history of malignant melanoma of skin,,,, 409 | Z85.89,Personal history of malignant neoplasm of other organs and systems,,,, 410 | Z86.010,Personal history of colonic polyps,,,, 411 | Z86.11,Personal history of tuberculosis,,,, 412 | Z86.61,Personal history of infections of the central nervous system,,,, 413 | Z86.711,Personal history of pulmonary embolism,,,, 414 | Z86.718,Personal history of other venous thrombosis and embolism,,,, 415 | Z86.73,"Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits",,,, 416 | Z87.11,Personal history of peptic ulcer disease,,,, 417 | Z87.440,Personal history of urinary (tract) infections,,,, 418 | Z87.81,Personal history of (healed) traumatic fracture,,,, 419 | Z87.820,Personal history of traumatic brain injury,,,, 420 | Z87.891,Personal history of nicotine dependence,,,, 421 | Z88.0,Allergy status to penicillin,35225363,91936005,Allergy to penicillin,4240903 422 | Z88.1,Allergy status to other antibiotic agents,35225364,416098002,Allergy to drug,439224 423 | Z88.2,Allergy status to sulfonamides,35225365,91939003,Allergy to sulfonamide,4241527 424 | Z88.6,Allergy status to analgesic agent,35225369,416098002,Allergy to drug,439224 425 | Z88.8,"Allergy status to other drugs, medicaments and biological substances",35225371,416098002,Allergy to drug,439224 426 | Z89.029,Acquired absence of unspecified finger(s),45576205,71358006,Absent finger,4323582 427 | Z89.029,Acquired absence of unspecified finger(s),45576205,737303004,Acquired absence of organ,42537748 428 | Z89.411,Acquired absence of right great toe,45566472,249820005,Absence of toe,4093531 429 | Z89.411,Acquired absence of right great toe,45566472,737303004,Acquired absence of organ,42537748 430 | Z89.412,Acquired absence of left great toe,45600369,249820005,Absence of toe,4093531 431 | Z89.412,Acquired absence of left great toe,45600369,737303004,Acquired absence of organ,42537748 432 | Z89.421,Acquired absence of other right toe(s),45581085,249820005,Absence of toe,4093531 433 | Z89.421,Acquired absence of other right toe(s),45581085,737303004,Acquired absence of organ,42537748 434 | Z89.422,Acquired absence of other left toe(s),45605169,249820005,Absence of toe,4093531 435 | Z89.422,Acquired absence of other left toe(s),45605169,737303004,Acquired absence of organ,42537748 436 | Z89.511,Acquired absence of right leg below knee,45595557,723722000,Absence of lower limb,37109843 437 | Z89.511,Acquired absence of right leg below knee,45595557,737303004,Acquired absence of organ,42537748 438 | Z89.512,Acquired absence of left leg below knee,45537692,723722000,Absence of lower limb,37109843 439 | Z89.512,Acquired absence of left leg below knee,45537692,737303004,Acquired absence of organ,42537748 440 | Z90.10,Acquired absence of unspecified breast and nipple,,,, 441 | Z90.12,Acquired absence of left breast and nipple,,,, 442 | Z90.2,Acquired absence of lung [part of],35225375,275507003,Absence of lung,4170145 443 | Z90.2,Acquired absence of lung [part of],35225375,737303004,Acquired absence of organ,42537748 444 | Z90.3,Acquired absence of stomach [part of],35225376,29384001,Disorder of stomach,201891 445 | Z90.3,Acquired absence of stomach [part of],35225376,737303004,Acquired absence of organ,42537748 446 | Z90.49,Acquired absence of other specified parts of digestive tract,45547372,53619000,Disorder of digestive system,4201745 447 | Z90.49,Acquired absence of other specified parts of digestive tract,45547372,737303004,Acquired absence of organ,42537748 448 | Z90.5,Acquired absence of kidney,35225378,249582007,Absent kidney,4092879 449 | Z90.5,Acquired absence of kidney,35225378,737303004,Acquired absence of organ,42537748 450 | Z90.79,Acquired absence of other genital organ(s),,,, 451 | Z91.041,Radiographic dye allergy status,45561670,1104821000000102,Allergy to diagnostic dye,36685919 452 | Z91.09,"Other allergy status, other than to drugs and biological substances",45590768,609328004,Allergic disposition,43530807 453 | Z91.19,Patient's noncompliance with other medical treatment and regimen,45585879,7058009,Noncompliance with treatment,4322482 454 | Z91.81,History of falling,,,, 455 | Z92.21,Personal history of antineoplastic chemotherapy,,,, 456 | Z92.25,Personal history of immunosuppression therapy,,,, 457 | Z92.3,Personal history of irradiation,,,, 458 | Z93.2,Ileostomy status,35225398,302111002,Ileostomy present,4201717 459 | Z93.3,Colostomy status,35225399,302112009,Colostomy present,4201390 460 | Z94.0,Kidney transplant status,35225404,737295003,Transplanted kidney present,42539502 461 | Z94.4,Liver transplant status,35225408,737297006,Transplanted liver present,42537742 462 | Z94.7,Corneal transplant status,35225411,737299009,Transplanted cornea present,42537744 463 | Z94.83,Pancreas transplant status,,,, 464 | Z94.84,Stem cells transplant status,,,, 465 | Z95.0,Presence of cardiac pacemaker,35225413,703398004,Cardiac implant in situ,45766277 466 | Z95.1,Presence of aortocoronary bypass graft,35225414,737276005,Aortocoronary bypass graft present,42537729 467 | Z95.2,Presence of prosthetic heart valve,35225415,739026008,Transplanted heart valve present,42538119 468 | Z95.3,Presence of xenogenic heart valve,35225416,449843004,Biologic cardiac valve prosthesis in situ,42709971 469 | Z95.5,Presence of coronary angioplasty implant and graft,35225418,737278006,Coronary artery graft present,42537730 470 | Z95.810,Presence of automatic (implantable) cardiac defibrillator,,,, 471 | Z95.820,Peripheral vascular angioplasty status with implants and grafts,,,, 472 | Z95.828,Presence of other vascular implants and grafts,,,, 473 | Z96.0,Presence of urogenital implants,,,, 474 | Z96.642,Presence of left artificial hip joint,,,, 475 | Z98.0,Intestinal bypass and anastomosis status,,,, 476 | Z98.84,Bariatric surgery status,,,, 477 | Z99.2,Dependence on renal dialysis,35225436,105502003,Dependence on renal dialysis,4019967 478 | Z99.3,Dependence on wheelchair,35225437,105503008,Dependence on wheelchair,4022073 479 | Z99.89,Dependence on other enabling machines and devices,45595570,105501005,Dependence on enabling machine or device,437758 480 | --------------------------------------------------------------------------------