{"id":13592367,"url":"https://github.com/spiros/phemap","last_synced_at":"2025-04-08T23:32:09.677Z","repository":{"id":40982801,"uuid":"194672962","full_name":"spiros/phemap","owner":"spiros","description":"Functions to map between ICD-10 terms and PheCodes for UK Biobank hospital electronic health records","archived":false,"fork":false,"pushed_at":"2022-12-27T16:40:01.000Z","size":135,"stargazers_count":28,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-02T16:44:40.044Z","etag":null,"topics":["clinical-terminologies","electronic-health-records","icd-10","phecode","uk-biobank"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spiros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-01T12:57:23.000Z","updated_at":"2024-06-18T15:44:39.000Z","dependencies_parsed_at":"2022-09-12T03:40:34.120Z","dependency_job_id":null,"html_url":"https://github.com/spiros/phemap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiros%2Fphemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiros%2Fphemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiros%2Fphemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiros%2Fphemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spiros","download_url":"https://codeload.github.com/spiros/phemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223346688,"owners_count":17130480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clinical-terminologies","electronic-health-records","icd-10","phecode","uk-biobank"],"created_at":"2024-08-01T16:01:08.439Z","updated_at":"2024-11-06T13:30:59.941Z","avatar_url":"https://github.com/spiros.png","language":"Python","funding_links":[],"categories":["Derivation of variables"],"sub_categories":["Electronic health records"],"readme":"Phemap [![Build Status](https://travis-ci.org/spiros/phemap.svg?branch=master)](https://travis-ci.org/spiros/phemap)\n--------------\n\nThis utility provides some very basic functions\nto map between ICD-10 terms used in hospital diagnoses\nfor UK Biobank and PheCodes as outlined\nin Wu P. et al. https://www.biorxiv.org/content/10.1101/462077v5\n\nRequires the phecode definitions file and the icd10-to-phecode\nmapping file - you can grab the latest version of both\nfiles from https://phewascatalog.org/phecodes\n\nNotes\n-----\n\nUK Biobank secondary care data are coded using ICD-10 but the dot\nhas been stripped out i.e. \"I21.0 Ischaemic heart disease\" is recorded\nas 'I210' so you will need to add the dot separator prior to attempting\nto match.\n\nNot all ICD-10 terms are mapped to PheCodes and not all PheCodes\nwhich are mapped to ICD-10 terms appear to have a valid definition\nin the PheCodes definition file. Mappings are usually one-to-one but can also\nbe one-to-many: \n\u003e Of all possible ICD-10 codes, 9,165 (76.20%) mapped to at least one PheCode, and 289 (2.40%) mapped to \u003e1 PheCode.  ICD-10 code B21.1 (HIV disease resulting in Burkitt’s lymphoma) maps to two PheCodes: 071.1 (HIV infection, symptomatic) and 202.2 (Non-Hodgkin's lymphoma).\n\nExamples\n--------\n\n```\nfrom phemap import Phemap\n\nsource_file = 'data/phecode_definitions1.2.csv'\nmapping_file = 'data/phecode_map_v1_2_icd10_beta.csv'\n\nphemap = Phemap(source_file=source_file, mapping_file=mapping_file)\n\n\u003e\u003e\u003e phemap.get_icd_for_phecode('495')\n['J45.8', 'J45', 'J45.1', 'J45.0', 'J45.9']\n\n\u003e\u003e\u003e phemap.get_phecode_for_icd10('J45.1')\n'495'\n\n\u003e\u003e\u003e phemap.get_phecode_info('495')\n{'phecode': '495',\n 'phenotype': 'Asthma',\n 'phecode_exclude_range': '490-498.99',\n 'sex': nan,\n 'rollup': '1',\n 'leaf': '0',\n 'category_number': '9',\n 'category': 'respiratory',\n 'phecode_num': 495.0}\n\n\u003e\u003e\u003e phemap.get_phecode_exclusions('495')\n['495',\n '495.1',\n '495.11',\n '495.2',\n '496',\n '496.1',\n '496.2',\n '496.21',\n '496.3',\n '497',\n '498']\n\n\u003e\u003e\u003e all_phecodes = phemap.get_all_phecodes()\n\u003e\u003e\u003e all_phecodes[10]\n{'phecode': '038.1',\n 'phenotype': 'Gram negative septicemia',\n 'phecode_exclude_range': '010-041.99',\n 'sex': 'Both',\n 'rollup': '1',\n 'leaf': '1',\n 'category_number': '1',\n 'category': 'infectious diseases',\n 'phecode_num': 38.1}\n```\n\nUseful reading material\n-----------------------\n\nhttps://www.biorxiv.org/content/10.1101/462077v4\n\nhttps://www.ncbi.nlm.nih.gov/pubmed/20335276\n\nhttps://journals.plos.org/plosone/article?id=10.1371/journal.pone.0175508\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiros%2Fphemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiros%2Fphemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiros%2Fphemap/lists"}