Created
March 30, 2016 21:08
-
-
Save masnick/abacc6864e76aa22f08e6515c70c12f8 to your computer and use it in GitHub Desktop.
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
def icd9_transform(icd9): | |
l = len(icd9) | |
if l == 3: | |
return "%s000" % icd9 | |
elif l == 4: | |
return "%s00%s" % (icd9[0:3], icd9[-1:]) | |
elif l == 5: | |
return "%s0%s" % (icd9[0:3], icd9[-2:]) | |
else: | |
return icd9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment