Coder Social home page Coder Social logo

Comments (2)

jackwasey avatar jackwasey commented on June 6, 2024

Thinking about this again in terms of diagnostic and procedure codes, and for ICD-10, annual and regional variations.

There may be conflict between an ideal structure of the data, and maintaining backward compatibility and simplicity. It might be possible simply to add attributes to data.frames and matrices.

ICD codes: version (9-CM), region (USA), year (2014), short codes (true)

  • possibly whether codes are diagnostic, procedure, or any other designation. At present, I don't see a conflict between any ICD-9, 10 procedure or diagnostic codes, so I won't include this right now.

Comorbidity map:

  • same characteristics available in a list of ICD codes (since this is just a list of vectors of these). All should share the same attributes.

ICD data frame: a data frame with additional attributes identifying the structure of the ICD data within

  • wide or long format
  • if wide, number of diagnosis fields
  • if wide, number of procedure code fields
  • name of visitId field
  • name of ICD diag code field(s), prefix if plural. will assume zero-padded number e.g. ICD_05, and not code for anything else unless use case arises
  • name of ICD proc code field(s)
  • maybe for long format, could include the max number of diagnosis and/or procedure codes per case (this would allow optimization downstream, as we wouldn't need to keep count, and could pre-allocate the result matrix)

From a user's perspective, I would accept a regular data.frame for any function as I do now, but if the attributes were present, these could be used instead of specifying function arguments every time. some options might also be set as defaults by the user for these things. Order of preference would then be:
function arg < attribute < option/default/guess?

Whenever we reply with a data.frame or matrix, we can add attributes we already know about, either via option, a function argument, or pre-existing attributes in input data. Also, a function icd9SetAttrib could modify a data.frame to include specific attributes, then subsequent function calls wouldn't need to specify the field names, etc, each time, and the correct long or wide version.

The only benefit of using S3 classes over attributes might be that we could create things like print.icd9frame or summary.icd9ComorbidMatrix to display our data better, but this can be accomplished with any old function name, but not quite so simply as print(myIcd9thing).

It think the attributes approach can be done quite simply, and with 100% backward compatibility. The guess functions would need to guess less. We can message when a guess was made (which would become an attribute)

from icd.

jackwasey avatar jackwasey commented on June 6, 2024

completed in icd10 dev branch

from icd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.