Help installing new release of icd9 file

cmswest wrote on Thursday, October 03, 2013:

I know it’s days are numbered but there is a new file at https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html

however, upon attempting to upgrade it seems i need to have the checksum and add a new entry to the table in supported_external_dataloads for v31

can’t seem to figure out where to get that checksum

bradymiller wrote on Friday, October 04, 2013:

md5sum

If using linux on command line, do:
md5sum filename

If using windows:
http://portableapps.com/apps/utilities/winmd5sum_portable

If curiosu, this is where the md5sum happens within the script(OpenEMR version 4.1.2):
line 203 of interface/code_systems/list_staged.php

If you get this to work, would be nice to incorporate it into the official codebase.

-brady
OpenEMR

cmswest wrote on Saturday, October 05, 2013:

thanks Brady

not sure how I can help you incorporate this into the codebase?

github most likely, which i’d be glad to play with some more

the steps necessary are:

replace the file /var/www/openemr/contrib/icd9/cmsv30_master_descriptions.zip with
/var/www/openemr/contrib/icd9/cmsv31master_descriptions.zip
(which has to be renamed because cms uses ‘-’ instead of underscore ‘_’)
in the github repository (guessing here)

add this item to table which we may want to reindex so all of the ICD9 come first, maybe eliminate v29?

not too mention the work for the corresponding ICD10 updates found here:

http://www.cms.gov/Medicare/Coding/ICD10/2014-ICD-10-CM-and-GEMs.html

cmswest wrote on Saturday, October 05, 2013:

here’s item i added on my test system

load_id load_type load_source load_release_date load_filename load_checksum
8 ICD9 CMS 2013-10-01 cmsv31_master_descriptions.zip fe0d7f9a5338f5ff187683b4737ad2b7

cmswest wrote on Saturday, October 05, 2013:

by jove I’ve done my first commit!

thanks a million to ken chapple of misquared for the excellent tutorial on github with openemr

now it’s time to slay the icd10 dragon

cmswest wrote on Monday, October 07, 2013:

Hi Brady.

Maybe you can rebase the commits for me? I just cleaned up the ICD10 data load too. Everything is now 2014 except reimbursement mapping which hasn’t come out yet but maybe soon if the gov’t gets going again?

bradymiller wrote on Monday, October 07, 2013:

Hi Stephen,

Awesome, will look at it. Can you place a link here to the github commit or branch?

(one of the review comments will be not to change the official file name you downloaded; the reason Mac (developer of this) went with the checksums was because of our governments inability to even create standardized filenames (note the snomed and rxnorm imports actually collect metadata from the filename itself, but for the cms stuff needed to create the standardized sql table to store and manually place it)).

(another review comment will likely be to wait on the 2014 icd10 files until it’s all ready to go (ie. not sure what will happen if only some of the files get imported; I think it may break the mechanism, though). Could just go with 2013 until 2014 is done.)

thanks.
-brady
OpenEMR

cmswest wrote on Monday, October 07, 2013:

rats, I’ll have to redo the commits because I renamed the files

my workaround on the missing reimbursement 2014 file (which is due out sometime this month) was to just throw the 2013 file in there

you can prob. tell i’ve worked in the private sector all my life?

cmswest wrote on Tuesday, October 08, 2013:

link to commit:

cmswest wrote on Tuesday, October 08, 2013:

corrected it here:

bradymiller wrote on Wednesday, October 09, 2013:

Hi Stephen,
Great, will get it rebased and reviewed over the weekend (or maybe before if have some time). If have time, will also provide the rebase commands I use in the review since it’s a very useful skill to have in git.
-brady
OpenEMR

cmswest wrote on Thursday, October 10, 2013:

this is getting complicated :open_mouth:

I rebased the files on my local repository but forgot that I deleted a file on github.com

so when i pushed the rebase it has 2 parents:

oh well, i’ve always learned the most from my mistakes

bradymiller wrote on Thursday, October 10, 2013:

Hi,

Here’s what I did to rebase your code into one commit.

# Add your repo and collect it
git remote add stephenwaite https://github.com/stephenwaite/openemr.git
git fetch stephenwaite

# Create my own branch with your code in it
git checkout stephenwaite/icd9dataload
(ignore error message)
git checkout -b stephen-icddataload_1

# Look at it
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
(this is a very nice way to visualize when there are merges; as you can see your last commit is a merge)

#Now for the rebase (Note the last number after HEAD is how many commits you want to go back; it should only show 5 below, but because of the merge it's a bit messed up)
git rebase -i HEAD~5

#(now see below in text editor; note I have changed several of the 'pick' to 'squash'; when done save and exit from the text editor)
pick b053992 Bug fix: Imported document owner id was not being set correctly.
pick bdddc55 Added support for documents embedded in HL7 OBX results, and some other e-labs improvements.
pick 702c56e Direct Messaging Module updates for improved reliability, security, and useability
pick 4cef52e rebased those babies that fix icd9 and icd10 data loads
squash 2689f65 updated icd9 load file from cms
squash 5897a65 updated icd10 load file from cms
squash cdbd60a revised commit based on brady's advice from forum, don't change file names and use 2013 if 2014 isn't ready
squash 60f16fd Delete ReimbursementMapping_pr_2013.zip
# Rebase 854d664..5dee164 onto 854d664
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit's log message
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#

#Now the editor will show the commit comments, which you can modify and then save and edit.
(note that this was not simple at all here; because of the merge there were a bunch of conflicts to fix; ie. do not try it or will be stuck in rebase conflict hell)
(try above mechanism out instead on a branch with no merges; nice thing about git is easy to create "garbage" commits to toy around with; ie. within master branch can do git checkout -b garbage-testing-branch)

#Now push it to my github
git push origin stephen-icddataload_1

Which can be found here:
http://github.com/bradymiller/openemr/commit/77bbebdc2ee14a8998a5e4ed2afb46d5b69faecf
(note that because of all the merging conflicts I am not very sure if this is the final code, but it's a good starting point for a review at least)

-brady
OpenEMR

bradymiller wrote on Thursday, October 10, 2013:

Hi,

Placed a code review (on commit from above):

-brady
OpenEMR

cmswest wrote on Thursday, October 10, 2013:

thanks very much for the tutorial

i’ll start over on a new branch - somewhat sad my first is now orphaned and in custody of the state

bradymiller wrote on Friday, October 11, 2013:

Hi,

Note you can grab my branch and make it your own with the following:

git remote add brady https://github.com/bradymiller/openemr.git
git fetch brady
git checkout brady/stephen-icddataload_1
(ignore error message)
git checkout -b my-amazing-icd-upgrade_2

It is now on your own repo branch my-amazing-icd-upgrade_2

-brady
OpenEMR

cmswest wrote on Friday, October 11, 2013:

i was wondering if you’d grant me the privilege

thanks

one last thought, how do i get the sql/database.sql file back without my deletions?
is it a variation of the clone command?

yehster wrote on Friday, October 11, 2013:

you should be able to do

git checkout HEAD~1 sql/database.sql

to revert the changes in just that one file to it’s state one commit earlier.

cmswest wrote on Friday, October 11, 2013:

so easy, thanks Kevin

yehster wrote on Friday, October 11, 2013:

a useful shortcut is

git fetch brady stephen-icddataload_1:amazing-new-branch

It fetches just the one branch in question and create a new branch (amazing-new-branch) all in one step.

Then

git checkout amazing-new-branch