-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with zero-only numerical part of ICD codes like A00 #1
Comments
same problem, and it's works for me def in_chapter(block: str, icd10: str) -> bool:
temp=icd10[1:3].lstrip('0')
if temp=='':
temp='0'
alpha, numeric = ord(icd10[0]), int(temp)
sblock, eblock = block.split('-') # A00-B99
salpha, snumeric = ord(sblock[0]), int(sblock[1:].lstrip('0') or 0)
ealpha, enumeric = ord(eblock[0]), int(eblock[1:].lstrip('0') or 0)
return salpha <= alpha <= ealpha and snumeric <= numeric <= enumeric |
Thank you guys alpha, numeric = ord(icd10[0]), int(icd10[1:3].lstrip('0').strip('ABCDEFGHIJKLMNOPQRSTUVWXYZ') or 0) Thanks |
I tried to edit line 126 to solve this issue with "9A" but also got an invalid literal for int() with base 10 error. |
Could you please show us the ICD10 code which caused the error? |
Here are some code prefixes causing errors for me. |
I wanted to map chapters from the Then
Then the chapter definitions still weren't broad enough so I modified a few. After this, I have a data frame! Full code:
|
Hey Bryan,
really appreciate this neat package! When working with ICD codes like A00, A000, or B00 that have zero-only numerical parts, I get ValueErrors due to the lstripping of all zeros in Line 126 of the init.py:
As far as I can tell, it should work fine when changing
to
as in the following lines.
Cheers,
Julius
The text was updated successfully, but these errors were encountered: