Skip to content
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

as.decimal_diag, as.icd_short_diag, as.short_diag functions outputing opposite results #176

Open
lai1737 opened this issue May 9, 2019 · 1 comment

Comments

@lai1737
Copy link

lai1737 commented May 9, 2019

test_data.txt

When I used the

  1. as.decimal_diag with my test data above in the decimal format, it spits out a FALSE,
  2. as.icd_short_diag with my test data above in the decimal format, it spits out a TRUE,
  3. as.short_diag with my test data above in the decimal format, it spits out a TRUE

Which is the opposite of what things should be...

@patrickmdnet
Copy link
Collaborator

The icd package does not detect which kind of ICD code (ICD-9 vs ICD-10) nor the format (decimal vs short.) Instead it allows you to get and set attributes on the icd object to mark the kind of ICD and the format. The as.* functions return the value of the "icd_short_diag" attribute.

So, as.decimal_diag sets the "icd_short_diag" attribute to FALSE, and as.short_diag sets the attribute to TRUE. In fact, the output does not depend on the ICD code that is passed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants