Monday, October 19, 2015

New C-Callable API (both Windows DLL and Linux SO)

In keeping with our philosophy that working code is the most trust-worthy documentation, here is the new mhdrg1() call from our validation C program which we compile and run under either Windows 7 or Linux:


 #define DRGVER "v33"
 
// expected = "DRG: 614        MDC: 10         GRC: 00";

/* call the grouper, store results in retval */
retval = mhdrg1(
    DRGVER,                 /* which DRG version you want */
    "/drbd/mnh/src/SWIG",   /* path to masks files */
    "1",                    /* discharge status */
    "55",                   /* patient age on admission */
    "1",                    /* patient sex (1=male, 2=female) */
    /* ICD DX codes */
    "D352   YE2740  NN390   YE871   NF05    NR630   NR110   YR0602  YD649    ",
    /* ICD procedure codes */
    "0GB00ZZ0YUY47Z02HR30Z0L8S3ZZ0P5N0ZZ0RJP0ZZ",
    8,                      /* length of each ICD DX code */
    7,                      /* len of each ICD procedure code */
    "y",                    /* are there POA indicators? */
    "X"                     /* is this case exempt from HAC? */
    );


This is an actual case from the CMS test data set. This is an actual call to mhdrg1(), which replaces mhdrg() as the entry point in the DLL.

We changed the name to make it possible to have a single program call either the ICD9-based version or the new ICD10-based version.

The API is only slightly different: there are two new arguments at the end of the argument list:
  • The POA indicator: are there POA flags appended to the DX codes? This argument is always a character pointer (char *) but can be either "1" (yes there are) or "0" (no there are not), or "y" (yes there are) or "n" (no there are not).
  • The POA Logic indicator: this is also a character pointer and represents the HAC exempt status of the patient encounter:
    • NULL means there is no exempt flag or encounter is not exempt
    • "X" or "1" means that this encounter is exempt
    • "Z" means that this encounter is not exempt
    • any other value is not allowed and will result in throwing an HAC error if there is a dx code with a CC exclusion of either kind.

No comments:

Post a Comment