-
Notifications
You must be signed in to change notification settings - Fork 62
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
Calculate Medicare Hierarchical Condition Categories HCC #87
Conversation
minor edit, update to new function names
Thanks for your significant contribution. I'll certainly add you as an author. We'll have to fix up a few things: firstly it will need some tests before I merge it. Also, I've been very strict with myself regarding code formatting, hence the automated lintr comments, and I think being brutally consistent has helped keep the code clear: this is why the Wercker build fails. In Rstudio, select all, then ctrl-shift-A will probably get you most of the way there. ctrl-alt-shift-D will give formatting diagnostics which are similar to the lintr output. The raw data text files should go in The travis build fails with an error in the examples: I haven't yet dug into your code in detail, but I did notice that you had combined the ICD-9 and ICD-10 data using an additional column containing Thanks for your great work. |
will start working through these issues |
split icd_comorbid_hcc() into icd9/10 versions
formatting formatting formatting
@jackwasey passed Wercker but I can't figure out why it failed travisCI.... |
I see this error buried in the logs from running the examples: Error in icd_comorbid_hcc(pt, date) : Assertion on 'x' failed: Must be of type 'data.frame', not 'closure'. Calls: icd_comorbid_hcc ... icd_guess_version.data.frame -> This probably means it thought pt was a code block, not a data frame. On Monday, May 2, 2016, anobel odisho notifications@github.com wrote:
|
ah, simple fix. the name i used for the sample dataframe in the example ( |
rename variables to match style update example
can't seem to see where travis is failing... |
will take a look On Mon, May 2, 2016 at 8:54 PM, anobel odisho notifications@github.com
|
I think it's just failing on warnings, but I don't immediately see why there are new warnings about undocumented objects, unless this is a co-incidental change in the R CMD check, |
The wercker error means you need
|
hopefully that should do it! |
The travis automated build script was updated, and now includes a bug which affects us: it tried to install all dependencies and fails if it can't despite me setting |
I don't know the best way to do this, but I made some relatively minor changes to your excellent pull request. I did this by starting a new branch in I do not know enough about HCC to really know whether it produces what is intended. I started an empty test script with the hope that you would write some basic tests. I also re-based on master, so updates to travis should work. In the example you add to Now there is a date column, it is unclear whether we should check that the date (presumably the admission date) is the same for each identical visit ID. It looks really good, and I think with some tests to catch basic simple use, and tricky cases, it can be merged. E.g. what happens if you give it a list of completely invalid ICD codes? What if there is only a single visit? What if there are valid ICD codes given but ones which are not used by the HCC. Mix of valid and invalid codes? |
Because I'm not assigned as a contributor, I can't push changes to any forks on your repo. So to make these changes, I cloned your fork, made changes, replaced my local files, and pushed back to my own repo (which updates the pull request). I had a mistake in the icd_comorbid example, which is why it showed so many codes for each date/visit combo. That should be fixed (but I count do proper testing because of the weird forking situation). Its OK for there to be different dates for each visit_id, this allows flexibility for the visit_id to actually refer to a patient ID. We only use the visit_date to extract the year and use the correct year ICD9/10. No need to check date for uniqueness. I put in some basic tests. One feature of CC/HCCs is that they are only defined for a select number of ICDs, not all ICDs. therefore, if the ICD does not exist in the ICD-CC crosswalk, it just doesn't get assigned a CC/HCC, which is the expected functionality. If there are invalid ICDs, they just get ignored. I hope that makes sense. |
Makes sense, and it looks great. I don't have any time until at least PS, if you didn't already, try and pull in the few updates I made to the On Mon, May 16, 2016 at 9:34 PM, anobel odisho notifications@github.com
|
although it may not be reflected in the build history, I copied the anobel-master branch you had made and built upon that (as of yesterday morning), so should be up to date |
just wanted to check in and see if you'd had a chance to review? |
Absolutely haven't forgotten your work. Should have time to devote to it in On Wednesday, June 15, 2016, anobel odisho notifications@github.com wrote:
|
no prob! |
I fixed a minor documentation error you made, which prevented some other documentation compiling: this led to all the warnings which caused the travis failure. However, there still seems to be some data which is not documented, and thus causes warnings which will fail travis (and of course CRAN).
I changed the name you used in the documentation from some other data, called Nearly there! |
The only thing stopping this passing now is documenting. The wercker build is actually passing, not sure why it doesn't appear so in the section below. checking for missing documentation entries ... WARNING |
add aliases for icd_map_cc_hcc and icd_names_cc
Sorry for the extended absence. this was a simple fix, had just left these out as aliases. have fixed this (hopefully). would love to get this PR completed! |
Excellent, thanks. I'm just about to drop a CRAN version so that's perfect On Tue, Aug 30, 2016 at 9:31 PM, anobel odisho notifications@github.com
|
One small thing to fix: I removed all stringr code from the package due its big dependency tree, and it is often slower than base R. I fixed the str_extract reference you had. The str_split_fixed still needs to be done. As I don't know the data format you are processing, it'll be much easier if you can replace this with some kind of vapply and strsplit using base R. I've checked in everything up to this point in the icd master branch. Would you be able to submit a pull request just to fix this issue? Once it is in, the package should compile and be ready for CRAN. Thanks! |
Anobel, I meant to credit you in the last CRAN release with your great HCC work. I'm sorry I didn't. If you want me to do this, please let me know your email address here or via my name at jackwasey .com Best wishes, |
addresses issue #31
New Function
icd_comorbid_cc
: assigns CCs and then applies hierarchy to generate HCCs. Slightly different than the current icd_comorbid functions in a few ways.New Data
Because we can't directly download the CMS data (stored in nested zip files, would be a headache to navigate through from within the function), saved the relevant files (crosswalks and SAS code) as plain text and parse it into data frames for use. The raw data, code for parsing 'parse-hcc.R', and final .RData objects all there. This is a also a bit different than the approach used for the other mappings, so I kept it separate from the
parse-comorbid.R
file.To Do
mappingNames.R
file, but have not been assigned to any HCCs yet. Also need to manually create abbreviations (there are 189 HCCs!)