-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support adding coding systems later on
- Loading branch information
Showing
16 changed files
with
396 additions
and
269 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
LICENSE | ||
README.md | ||
setup.py | ||
MedCode/__init__.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
[console_scripts] | ||
MedCode = MedCode:MedCode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "a4da1d02", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# import\n", | ||
"from MedCode import CodeMapping" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "6d13de5e", | ||
"metadata": {}, | ||
"source": [ | ||
"# Usage 1: load the all mappings during initialization" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "35f979d5", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"----- preparing code mappings -----\n", | ||
"source 1 loaded from https://drive.google.com/uc?id=1I2G6fsBDXDiAK95qFWwtnl3Ib2MaLeCx\n", | ||
"source 2 loaded from https://drive.google.com/uc?id=1d2HzsByXrPadvjaKDOEaOt78OkAZOrjC\n", | ||
"source 3 loaded from https://drive.google.com/uc?id=199i8mP2gMQNhwUe-2ZNmIr5fhiBbzVlK\n", | ||
"source 4 loaded from https://drive.google.com/uc?id=1Z11J4st1sI44jPborls9jIxzcpF-GpGt\n", | ||
"mapping finished: NDC -> RXCUI\n", | ||
"mapping finished: RXCUI -> NDC\n", | ||
"mapping finished: NDC -> Name\n", | ||
"mapping finished: Name -> NDC\n", | ||
"mapping finished: NDC -> SMILES\n", | ||
"mapping finished: RXCUI -> Name\n", | ||
"mapping finished: Name -> RXCUI\n", | ||
"mapping finished: RXCUI -> SMILES\n", | ||
"mapping finished: Name -> SMILES\n", | ||
"load time: 8.500431776046753s\n", | ||
"-----------------------------------------\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# initialize with a list of supported coding systems\n", | ||
"tool = CodeMapping('NDC', 'RXCUI', 'Name', 'SMILES')\n", | ||
"tool.load_mapping()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "39a94b85", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['C[C@H]1OC(OC2CC(O)C(C(O)CC(=O)CC(O)C(O)CCC(O)CC(O)CC(O)CC(=O)OC(C)C(C)C(O)C(C)\\\\C=C\\\\C=C\\\\CC\\\\C=C\\\\C=C\\\\C=C\\\\C=C\\\\2)C(O)=O)[C@@H](O)[C@@H](N)[C@@H]1O',\n", | ||
" 'CNC(C)C1CCC(N)C(OC2C(N)CC(N)C(OC3OCC(C)(O)C(NC)C3O)C2O)O1']" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"# usage 1\n", | ||
"tool.RXCUI_to_SMILES['312055']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "94141162", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['Azithromycin']" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"# usage 2\n", | ||
"tool.NDC_to_Name['76413-153-06']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ad333a1c", | ||
"metadata": {}, | ||
"source": [ | ||
"# Usage 2: load additional mappings later on" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "ef4f013b", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"mapping finished: RxNorm -> NDC\n", | ||
"mapping finished: NDC -> RxNorm\n", | ||
"mapping finished: RxNorm -> RXCUI\n", | ||
"mapping finished: RXCUI -> RxNorm\n", | ||
"mapping finished: RxNorm -> Name\n", | ||
"mapping finished: Name -> RxNorm\n", | ||
"mapping finished: RxNorm -> SMILES\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"tool.add_code(\"RxNorm\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "9fb8b3e2", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['68084027801', '59762306003']" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"tool.NDC_to_RxNorm['76413-153-06']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3166f96e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.