Commit 46db3109 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

ENH: Utility function for converting a numeric ICD10 code back to its original

parent 177ccf08
......@@ -59,6 +59,13 @@ def codeToNumeric(code):
return np.nan
def numericToCode(code):
"""Converts a numeric ICD10 code into its original version. """
code = str(int(code))
prefix = int(code[:2]) + ord('a') - 11
return chr(prefix) + code[2:]
def storeCodes(codes):
"""Stores the given sequence of ICD10 codes, so they can be exported to
file at a later stage.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment