Skip to content
Snippets Groups Projects
Commit cb24de86 authored by mjbonifa's avatar mjbonifa
Browse files

the _code suffix makes a difference to a lot of thigns, need to work that out

parent 3a6da0b8
Branches
Tags
No related merge requests found
...@@ -97,7 +97,7 @@ def main(): ...@@ -97,7 +97,7 @@ def main():
map_process_parser = map_subparsers.add_parser("process", help="Process map configuration file") map_process_parser = map_subparsers.add_parser("process", help="Process map configuration file")
map_process_parser.add_argument("-c", "--config-file", required=True, help="Phenotype configuration file") map_process_parser.add_argument("-c", "--config-file", required=True, help="Phenotype configuration file")
map_process_parser.add_argument("-s", "--source-codes-dir", required=True, help="Source codes root directory") map_process_parser.add_argument("-s", "--source-codes-dir", required=True, help="Source codes root directory")
map_process_parser.add_argument("-t", "--target-coding", required=True, choices=['read2', 'read3', 'icd10', 'snomed', 'opcs4'], help="Specify the target coding (read2, read3, icd10, snomed, opcs4)") map_process_parser.add_argument("-t", "--target-coding", required=True, choices=['read2_code', 'read3_code', 'icd10_code', 'snomed_code', 'opcs4_code'], help="Specify the target coding (read2, read3, icd10, snomed, opcs4)")
map_process_parser.add_argument("-o", "--output-file", type=str, default=str(map.OUTPUT_PATH.resolve()), help="Output directory for CSV or OMOP database") map_process_parser.add_argument("-o", "--output-file", type=str, default=str(map.OUTPUT_PATH.resolve()), help="Output directory for CSV or OMOP database")
# Flags # Flags
......
...@@ -22,24 +22,6 @@ ...@@ -22,24 +22,6 @@
"CODING LIST": "https://git.soton.ac.uk/meld/meldb-external/phenotype/-/tree/main/codes/ClinicalCodes.org%20from%20the%20University%20of%20Manchester/Symptom%20code%20lists/Abdominal%20pain/res176-abdominal-pain.csv ", "CODING LIST": "https://git.soton.ac.uk/meld/meldb-external/phenotype/-/tree/main/codes/ClinicalCodes.org%20from%20the%20University%20of%20Manchester/Symptom%20code%20lists/Abdominal%20pain/res176-abdominal-pain.csv ",
"NOTES": "2023-09-08: Clinical SF confirmed that the clinical view would be that this would need to be recurrent or persistent." "NOTES": "2023-09-08: Clinical SF confirmed that the clinical view would be that this would need to be recurrent or persistent."
} }
},
{
"concept_set_name": "CVD_EVENTS",
"concept_set_status": "AGREED",
"metadata": {
"#": "9",
"CONCEPT DESCRIPTION": "Cardiovascular events",
"CONCEPT TYPE": "Outcome event",
"CONCEPT ONTOLOGY CLASS": "nan",
"DATE ADDED ": "2023-08-25",
"REQUEST REASON ": "SF - requested by email - to explore an examplar 'outcome measure'",
"SOURCE INFO": "YES",
"FUNCTION": "QUERY BY CODING LIST",
"FUNCTION.1": "https://clinicalcodes.rss.mhs.man.ac.uk/",
"CODING LIST": "https://git.soton.ac.uk/meld/meldb-external/phenotype/-/tree/main/codes/ClinicalCodes.org%20from%20the%20University%20of%20Manchester/Cardiovascular%20events%20(ICD10)/res52-cardiovascular-events-icd10.csv",
"NOTES": "2023-11-17 - Code cannot currently be PROCESSED = COMPLETE as no mappings from ICD10 to Read v2 exist, pending confirmation from clinical team on next steps.",
"Relation to Ontology": "YES WITH ISSUES"
}
} }
] ]
}, },
...@@ -51,7 +33,7 @@ ...@@ -51,7 +33,7 @@
{ {
"file": "Symptom code lists/Abdominal pain/res176-abdominal-pain.csv", "file": "Symptom code lists/Abdominal pain/res176-abdominal-pain.csv",
"columns": { "columns": {
"read2": "code", "read2_code": "code",
"metadata": [ "metadata": [
"description" "description"
] ]
...@@ -59,20 +41,7 @@ ...@@ -59,20 +41,7 @@
"concept_set": [ "concept_set": [
"ABDO_PAIN" "ABDO_PAIN"
] ]
},
{
"file": "Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv",
"columns": {
"icd10_code": "code",
"metadata": [
"description"
]
},
"concept_set": [
"CVD_EVENTS"
]
} }
] ]
} }
] ]
......
...@@ -203,6 +203,7 @@ def process(config_file, source_codes_dir, target_code_type, translate=True, ver ...@@ -203,6 +203,7 @@ def process(config_file, source_codes_dir, target_code_type, translate=True, ver
# Perform Structural Changes to file before preprocessing # Perform Structural Changes to file before preprocessing
# split column with multiple code types # split column with multiple code types
print("Processing actions")
if ("actions" in file and "split_col" in file["actions"] and "codes_col" in file["actions"]): if ("actions" in file and "split_col" in file["actions"] and "codes_col" in file["actions"]):
split_col = file["actions"]["split_col"] split_col = file["actions"]["split_col"]
codes_col = file["actions"]["codes_col"] codes_col = file["actions"]["codes_col"]
......
...@@ -344,14 +344,14 @@ class Cprd_code(Proto_code): ...@@ -344,14 +344,14 @@ class Cprd_code(Proto_code):
] ]
code_types = { code_types = {
"read2": Read2_code, "read2_code": Read2_code,
"read3": Read3_code, "read3_code": Read3_code,
"icd10": Icd10_code, "icd10_code": Icd10_code,
"snomed": Snomed_code, "snomed_code": Snomed_code,
"opcs4": Opcs4_code, "opcs4_code": Opcs4_code,
"atc": Atc_code, "atc_code": Atc_code,
"med": Med_code, "med_code": Med_code,
"cprd": Cprd_code, "cprd_code": Cprd_code,
} }
vocab_types = { vocab_types = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment