Skip to content

Commit

Permalink
#316 ICD10 and ICD9 work
Browse files Browse the repository at this point in the history
  • Loading branch information
ecwood committed Aug 19, 2023
1 parent ae432ac commit 18c7366
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kg2_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
CURIE_PREFIX_HMDB = 'HMDB'
CURIE_PREFIX_HP = 'HP'
CURIE_PREFIX_IAO = 'IAO'
CURIE_PREFIX_ICD10PCS = 'ICD10PCS'
CURIE_PREFIX_ICD9 = 'ICD9'
CURIE_PREFIX_IDENTIFIERS_ORG_REGISTRY = 'identifiers_org_registry'
CURIE_PREFIX_ISBN = 'ISBN'
CURIE_PREFIX_KEGG = 'KEGG'
Expand Down
16 changes: 15 additions & 1 deletion umls_list_jsonl_to_kg_jsonl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
HGNC_PREFIX = kg2_util.CURIE_PREFIX_HGNC
HL7_PREFIX = kg2_util.CURIE_PREFIX_UMLS
HPO_PREFIX = kg2_util.CURIE_PREFIX_HP
ICD10PCS_PREFIX = kg2_util.CURIE_PREFIX_ICD10PCS
ICD9CM = kg2_util.CURIE_PREFIX_ICD9

UMLS_SOURCE_PREFIX = kg2_util.CURIE_PREFIX_UMLS_SOURCE

Expand Down Expand Up @@ -310,7 +312,7 @@ def process_hl7_item(node_id, info, nodes_output, edges_output):

def process_hpo_item(node_id, info, nodes_output, edges_output):
accession_heirarchy = ['PT', 'SY', 'ET', 'OP', 'IS', 'OET'] # https://www.nlm.nih.gov/research/umls/knowledge_sources/metathesaurus/release/precedence_suppressibility.html
node_curie, iri, name, provided_by, category, synonyms, cuis, tuis = get_basic_info(HPO_PREFIX, node_id, info, accession_heirarchy)
node_curie, iri, name, provided_by, category, synonyms, cuis, tuis = get_basic_info(HPO_PREFIX, node_id.replace('HP:', ''), info, accession_heirarchy)

# Currently not used, but extracting them in case we want them in the future
attributes = info.get(INFO_KEY, dict())
Expand All @@ -323,6 +325,18 @@ def process_hpo_item(node_id, info, nodes_output, edges_output):
make_umls_node(node_curie, iri, name, category, "2023", provided_by, synonyms, create_description("", tuis), nodes_output)


def process_icd10_item(node_id, info, nodes_output, edges_output):
accession_heirarchy = ['PT', 'PX', 'HX', 'MTH_HX', 'HT', 'HS', 'AB'] # https://www.nlm.nih.gov/research/umls/knowledge_sources/metathesaurus/release/precedence_suppressibility.html
node_curie, iri, name, provided_by, category, synonyms, cuis, tuis = get_basic_info(ICD10PCS_PREFIX, node_id, info, accession_heirarchy)
provided_by = make_node_id(UMLS_SOURCE_PREFIX, 'ICD10PCS')

# Currently not used, but extracting them in case we want them in the future
attributes = info.get(INFO_KEY, dict())
added_meaning = attributes.get('ADDED_MEANING', list())
order_no = attributes.get('ORDER_NO', list())

make_umls_node(node_curie, iri, name, category, "2023", provided_by, synonyms, create_description("", tuis), nodes_output)

if __name__ == '__main__':
print("Starting umls_list_jsonl_to_kg_jsonl.py at", kg2_util.date())
args = get_args()
Expand Down

0 comments on commit 18c7366

Please sign in to comment.