Tuesday, August 4, 2009

ICD9 Look Up

QUESTION

Is there functionality to do a text search of the ICD-9 that would return the ICD-9 number?  Is there some sort of documentation of all the functions and sub procedures that come with the Drg dll and Icd-9 dll?
  
ANSWER

There is no text search support in our ICD9 handling; it is tool for labeling a given ICD9, not for choosing an ICD9.

There is scads of documentation on the procedures and how to call them. I have attached our manual here, though you should have received a copy with your order.

Tuesday, May 26, 2009

How to Use POA

QUESTION

As yoyu know, DRG versions 25 and up require the use of the Present On Admission (POA) indicator associated with ICD9 diagnosis codes for the grouping of DRGs. Your grouper software does support versions 25 and 26, but no where in your documentation do I find any reference to POAs and how they should be fed into the data file, or defined in the control file.

We need this information asap in order to ensure that the grouper is working correctly. Please email or call me at your earliest convenience.

ANSWER

Please find attached our most recent documentation, which has a healthy entry in the Index under POA.

I am not sure which of our products you are using, but POA should be supported across the product line. To quote the docs on POA support in general:

Note: as of version 26, released in 2008, the DRG version can have either
a 'p' or an 'e' or both appeneded to it. If there is a trailing 'p', it
is assumed that the last character of every diagnosis code is a POA flag.
If the there is a trailing 'e', then the source institution is presumed
to be exempt from the HAC. Thus "26p" specifies POA support, while "26"
does not. "25p" does not make sense.

To quote the glossary on POA:
In order to avoid paying for medical mistakes, diagnoses are now
flagged as having been present on admission (POA).

The values for the POA flag are not, as one might expect, simply
Y or N; rather the following options are defined:

-Y for Yes
-N for No
-U for Unspecified
-W for clinically undetermined
-1 for unreported / not used / exempt from reporting
To quote from Chapter 5, on our DRGFilt product:
The keyword "poa " specifies where, in the diagnosis code, to find the
POA flag. If the diagnosis code length (specified by dlx) is 8, it is
typical to find the POA flag at offset 7, that is to say the last character
of every code.

The keyword "exmp" specifies that the institution from which these data
come is exempt from the HAC.

Note that if neither of these keywords is present, the software assumes that
POA is irrelevant and that the source institution is to be treated as exempt
from the HAC.

Sunday, October 5, 2008

Validating a DRGFilt Control File

QUESTION

I find the DRGFilt control file format kind of hard to understand. How can I be sure that I got it right?

ANSWER

We hear you: the control file format is showing its age: it was derived from a format that originated on punch cards (!).

We use the following Perl script to validate our control files in-house:

Sample usage
In the examples below, replace "control-file" with the name of the control file you are validating, and "data-file" with the name of the data file you are running against. For extra credit, replace "pt-id" with the patient, claim or record ID you are looking for.

Unix
  • perl chkcntl.pl control-file < data-file | more
  • head -20 data-file | perl chkcntl.pl control-file | more
  • fgrep pt-id data-file | perl chkcntl.pl control-file
Windows
  • perl.exe chkcntl.pl control-file < data-file | more
  • perl.exe chkcntl.pl control-file < data-file > output.txt

Sample Perl Code

# chkcntl.pl - program to check a control file

my($sgl,$dxl,$recLen,%h) = Load(shift(@ARGV));

while (defined(my $l = <>)) {
    $l =~ s/\r|\n//g;
    # pad out input with astericks if too short
    while (length($l) < $recLen) { $l .= '*'; }

    my $output = "";
    foreach my $key (sort (keys %h)) {
    my $ref = $h{$key};
    my($name,$off,$len) = @$ref;

    my $val = substr($l,$off,$len);
    $output .= sprintf("%4.4s@%3d for %2d:",$name,$off,$len);

    if ($name =~ /^(dx|surg)$/i) {
        $output .= AddBar($val, ($name =~ /dx/i)? $dxl : $sgl);
    } else {
        $output .= $val;
    }

    $output .= "\n";
    }
    print $output,"\n";
}

exit(0);
#-----------------------------------------------------------------
sub AddBar {
    my $val = shift;
    my $len = shift;

    my $inLen = length($val);
    my @f = ();

    for (my $i = 0; $i < $inLen; $i += $len) {
    push(@f,substr($val,$i,$len));
    }

    return join('|',@f);
}

sub Load {
    my $fname = shift;

    my %h;  # keyed by offset, value is name
    my($dxl,$sgl) = (5,4);
    my $recLen = 0;
    my($poa,$exempt);

    open(FILE,$fname) || die "Could not open '$fname': $!";
    while (defined(my $l = <FILE>)) {
    next unless ($l =~ /^[a-zA-Z]/);
        #age  000 03
    my($name,$offset,$length) = unpack("a4xa3xa2",$l);

    if ($name =~ /sgl/i) {
        $sgl = $length;
        next;
    }
    if ($name =~ /dxl/i) {
        $dxl = $length;
        next;
    }
    if ($name =~ /poa/i) {
        $poa = $length;
        next;
    }
    if ($name =~ /exmp/i) {
        $exempt = $length;
        next;
    }

    my $key = sprintf("%03d",$offset);
    my $ref = [ $name, $offset, $length ];
    foreach my $el (@$ref) { $el =~ s/^\s+|\s+$//g; }
    $h{$key} = $ref;

    }
    close(FILE);

    # figure out end of record: max offset + length
    my ($max) = (reverse (sort keys %h));
    my $ref = $h{$max};
    my $recLen = $$ref[1] + $$ref[2];

    return ($sgl,$dxl,$recLen,%h);
}
# eof

Friday, October 3, 2008

F26 Released

Our support for version 26 of the US Federal DRG assignment algorithm, active as of October 1st 2008, has just been released.

F26 DRGFilt Control File

New this year: "poa", "exmp".


age  000 03
sex  003 01
ds   004 02
dxl  000 08
poa  000 07
dx   023 96
sgl  000 07
surg 223 98
exmp 006 01
# these are written out by us
drg  607 03
mdc  610 02
rc   612 02

Thursday, January 24, 2008

PHP Shared Object

QUESTION

Hello,
We recently purchased the PHP shared object from you guys and are having problems getting it running. We are using PHP 5.2.5 on Red Hat Linux 9, and are getting the following error when we try to dynamically link your mhdrg.so library:

Warning: dl(): unable to load dynamic library './mhdrg.so' - mhdrg.so:
undefined symbol: zend_list_find

Any ideas? Let me know if you need more info or if I need to be addressing this question to RTR. Also, if we can't get this to work fairly easily, would we have the option of "trading" this PHP .so for your C callable object?


ANSWER

As I understand it, things are supposed to work like this:

 - you put mhdrg.so in a place in your file system that is both
   - readable by your web server
   - not accessible by the world or the world can steal it

 - you use the dl() primative in PHP to load the extension, like so:

    if (!extension_loaded('mhdrg')) {
        if (!dl('mhdrg.so')) {  // this should be in a protected directory
            exit;
        }
    }
When I deliberately move mhdrg.so on our test system, I get the following error:

Warning: Unable to load dynamic library './mhdrg.so' - ./mhdrg.so: cannot open shared object file: No such file or directory in /home/mnh/public_html/PHP/tryit.php on line 5

So I am guessing that wherever you have put mhdrg.so is not readable by the user your web server runs as. Have you put mhdrg.so in the same document directory as your document? If not, you could trying putting tryit.php and mhdrg.so in the same document directory and confirming that tryit.php works on your systems.

That said, we would be happy to exchange your PHP shared object for a C-callable object if that works better for you.

Friday, November 16, 2007

Working with SAS

An email we received:
 
I've presented at a couple of SAS conferences about how well your
product works with SAS.  

A representative of SAS Institute suggested that you might want to
mention that your product can be called from a SAS program and put a
link to my paper on your website.  Here is one:

http://www.scsug.org/SCSUGProceedings/2007/papers/report/Report-Loren.pdf

I'm also happy to serve as a reference if anyone wants to know more
about it.

I really appreciate your help, and have been very happy with your
product.