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

add CPT codes #81

Closed
rpietro opened this issue Feb 9, 2016 · 8 comments
Closed

add CPT codes #81

rpietro opened this issue Feb 9, 2016 · 8 comments

Comments

@rpietro
Copy link

rpietro commented Feb 9, 2016

congrats, this is an amazing package, incredibly useful. question: once the icd-10 port is on its way, is there any plan on expanding toward cpt codes, either here or with a separate package? this would be very useful for datasets such as Medicare where we often have to create validation rules regarding conflicting diagnostic & procedure codes.

thanks

@jackwasey
Copy link
Owner

Thanks very much. Always glad to hear it is being used. CPT codes would have a particular problem in their licensing arrangements. I am in favor of enabling use of any clinical codes, and will happily accept license friendly pull requests. This is a tricky area. Most likely I could never distribute CPT code lists themselves, but perhaps you would consider using an API available to licensed users. This would be hopeless for chewing through millions of rows, if we had to use an online API lookup every time. A work-around might be for licensed users to somehow add their credentials, then the CPT data could be downloaded all at once, or as-needed with caching. An alternative is to use existing CPT data files, and distribute code to parse it just for that licensed user, yet this may still be problematic for the license.

Please do consider contributing. I'm unlikely to do this myself, as I have no need for it, but will support any work in this area.

Meanwhile, ICD-10 is nearly finished. You made me reconsider whether I should call the new package 'icd' or something more general...

@rpietro
Copy link
Author

rpietro commented Feb 10, 2016

Jack, great point. Based on what I saw from their license, an architecture
where a package would take an external file doesn't seem to conflict with
their requirements, but I'm not a lawyer.

As for the name, I haven't checked google in relation to your repo, but my
guess would be that most people get to you using "r icd."

Last, as far as contributing, my group is about to start a number of
research projects where your package will play an important role, and so we
will definitely be contributing as we run more and more tests

Thanks very much. Always glad to hear it is being used. CPT codes would
have a particular problem in their licensing arrangements. I am in favor of
enabling use of any clinical codes, and will happily accept license
friendly pull requests. This is a tricky area. Most likely I could never
distribute CPT code lists themselves, but perhaps you would consider using
an API available to licensed users. This would be hopeless for chewing
through millions of rows, if we had to use an online API lookup every time.
A work-around might be for licensed users to somehow add their credentials,
then the CPT data could be downloaded all at once, or as-needed with
caching. An alternative is to use existing CPT data files, and distribute
code to parse it just for that licensed user, yet this may still be
problematic for the license.

Please do consider contributing. I'm unlikely to do this myself, as I have
no need for it, but will support any work in this area.

Meanwhile, ICD-10 is nearly finished. You made me reconsider whether I
should call the new package 'icd' or something more general...


Reply to this email directly or view it on GitHub
https://github.com/jackwasey/icd9/issues/81#issuecomment-182010294.

@jackwasey
Copy link
Owner

That's great. I'd be very happy to work with you to accept pull requests.

@jackwasey jackwasey modified the milestones: someday maybe, v2.0 Feb 29, 2016
@jackwasey jackwasey changed the title question re development roadmap add CPT codes Feb 29, 2016
@jackwasey jackwasey modified the milestones: someday maybe, v2.0 Feb 29, 2016
@anobel
Copy link
Collaborator

anobel commented May 4, 2016

Intro

Was just looking into this a bit and I think it would be possible to incorporate working with CPT codes in the icd package, but not to distribute the CPTs. There are the CPT codes themselves (5 digit numeric), a short description, and a long description. Both short and long descriptions are copyright by the AMA.

Example

Code 55801 resolves to:

  • short description: "Removal of Prostate"
  • long description: "Prostatectomy, perineal, subtotal (including control of postoperative bleeding, vasectomy, meatotomy, urethral calibration and/or dilation, and internal urethrotomy)"

AMA Rules

The codes and SHORT descriptions are distributed by CMS, but their data documents say any use has to be in accordance with the CMS/AMA agreement, which states:

End User Point and Click Agreement:

CPT codes, descriptions and other data only are copyright 2015 American Medical Association. All rights reserved. CPT is a registered trademark of the American Medical Association (AMA).

You, your employees and agents are authorized to use CPT only as contained in the following authorized materials of Centers for Medicare and Medicaid Services (CMS) internally within your organization within the United States for the sole use by yourself, employees and agents. Use is limited to use in Medicare, Medicaid or other programs administered by CMS. You agree to take all necessary steps to insure that your employees and agents abide by the terms of this agreement.

Any use not authorized herein is prohibited, including by way of illustration and not by way of limitation, making copies of CPT for resale and/or license, transferring copies of CPT to any party not bound by this agreement, creating any modified or derivative work of CPT, or making any commercial use of CPT. License to use CPT for any use not authorized herein must be obtained through the AMA, CPT Intellectual Property Services, 515 N. State Street, Chicago, IL 60654. Applications are available at the AMA Web site, http://www.ama-assn.org/go/cpt.

Data

The listings for CPT codes and SHORT descriptions are available from CMS:
(https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/PhysicianFeeSched/PFS-Relative-Value-Files.html). In the RVU16A file, they can be found in the first column of the PPRRVU16_V0122 file. The column is titled HCPCS. HCPCS codes come in two categories:

  • Level 1 codes are 5 digit numeric, and are CPT codes
  • Level 2 codes are 5 digit alphanumeric, developed by CMS to cover items not represented in CPT

You do need a license to purchase/distribute CPT codes (but NOT Level 2 HCPCS codes), and it wouldn't be feasible to distribute the CPTs with icd. License costs $15.50 per user.

Possible Solution

We could write code to parse the HCPCS (Levels I and II) from the CMS files, which are available. We would not include the data with the icd distribution, but instead have the end user download the files and run the function to create their own datasets, with the caveat that they must be licensed to use the codes. It seems there are no restrictions to code use if obtained from the CMS site, they just cannot be distributed.

AMA FAQ Notes

(https://www.ama-assn.org/ama/pub/physician-resources/solutions-managing-your-practice/coding-billing-insurance/cpt/frequently-asked-questions.page?)

*I am developing a product that will contain CPT codes. Do I need permission from the AMA?
*

Yes. The AMA holds copyright in CPT and use or reprinting of CPT in any product or publication requires a license. To use CPT codes in a product that will be sold or distributed to others, please obtain a distribution license.

What is the fee for a distribution license?
The royalty for the use for CPT material in an electronic or Internet product is $15.50 per user per product. Depending on the terms of the License Agreement, royalties are due either quarterly or semi-annually in arrears. Print publication royalty is $15.50 per distributed copy. No minimums or upfront fees are required. You will, however, need to purchase the CPT data file separately.

@jackwasey
Copy link
Owner

Thanks for this great background research.

So we could include the Level 2 legitimately (this is public domain work from the government)?

For the copyright material, one approach might be to use the R.cache package. It gives a fairly transparent way of asking for data, and if it is not available, to pull it from the net. Unlike memoise it persists across R sessions. If you know of any other options, I'm open to suggestions, but personally don't have time to work on this right now.

Thanks again.

@anobel
Copy link
Collaborator

anobel commented May 5, 2016

We can include Level 2 codes no problem (public domain), but the codes are far less useful; they basically cover durable medical devices and equipment that isn't covered in the core CPT codes. I think if we're adding CPT, we add both Level 1/2, but level 2 alone is unlikely to be useful to anyone.

I'll look into R.cache package and work on a branch in my fork. Did you like the general approach I used in the HCC functions? I would likely set up the data and functions in a similar fashion (with changes by year)

@jackwasey
Copy link
Owner

@anobel hi - just looked back at this work you had done, and wondered if you had made any progress. I do see that the AMA copyright is re-asserted in the CMS web site files. I like your approach of having the user initiate a download of the files, via 'icd', e.g. with one-time prompt: "Download codes from CMS?" You'll see I already wrote code to download and unzip files to the source tree e.g. icd:::unzip_to_data_raw . We'd have to actually install to a location like ~/.local/R-icd/ or similar location based on the user's environment. Most users I guess won't be working with the source package, so no use in putting it in data-raw.

@jackwasey
Copy link
Owner

My thought on this now is to leave 'icd' focussed on ICD-9, ICD-10 and (nearly released by WHO) ICD-11 codes. The comorbidity calculations are now incredibly fast using some matrix algebra tricks, and the guts can be applied to CPT codes which could be provided by another package. I doubt I'll have time to do this.

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

No branches or pull requests

3 participants