Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Friday, October 30, 2015

Support for 32-bit Linux in V33

In the Windows world we ship 32-bit DLLs because we count on "thunking" to allow this code to run in either 64-bit or 32-bit environments. But we do plan on upgrading our Windows development environment to 64-bit in the next four years.

In the Linux world we planned to drop 32-bit support with v33 (Oct-2015) but found that too many people still run 32-bit Linux, so we added 32-bit versions to all of our programmer tools:

  • our PHP module (phpdrgv33_32bit.so)
  • our Perl module (perldrgv33_32bit.so)
  • our C-callable object (libdrgv33_32bit.so)
  • DRGFilt (drgfiltv33_32bit)
We named the 32-bit versions by adding "_32bit" to the end of the file name and therefore before the extension. If you buy any of these modules, you get both the 32-bit and 64-bit versions. If you are in a 32-bit environment, you can either rename the object or call the 32-bit version explicitly.

Tuesday, April 3, 2012

C-Callable Shared Object Version?

QUESTION

How do I figure out which version of the C-Callable Shared Object I am using?


ANSWER

There is no good way because as of this writing, April-2012, the C-Callable Shared Object's API is missing the usual method for retrieving this information.

Instead, to see if your shared object will support a given version, you have to use the errdesc() function, like so:

-------------------------sample code starts

/* declare the functions inside the shared object: */
char * mhdrg();
extern char * errdesc();

int main() {
    char * retval;
    char * p;
    char * a[RETURNED];
    char * expected;
    int i;

    /* call the grouper, store results in reval */
    retval = mhdrg(
        "f29",                  /* which DRG version you want */
        "/drbd/mnh/src/SWIG",   /* path to masks files */
        "1",                    /* discharge status */
        "49",                   /* patient age on admission */
        "2",                    /* patient sex (1=male, 2=female) */
        /* ICD DX codes */
        //"99679   25041   5859    2767    25051   36904   25061   3371    40290   2859                    ",
        "71500  Y",
        /* ICD procedure codes */
//       0123456012345601234560123456
//      "3942   3993   3995                                                                  ",
        "8134   8135   ",
        8,                      /* length of each ICD DX code */
        7                       /* length of each ICD procedure code */
    );

    /* if there was an error, alert the user */
    if (retval == NULL) {
        printf("M+H grouper argument or environment error: %s\n", errdesc());
        exit(-1);
    }

    /* show the raw return value */
    printf("Raw return value from mhdrg:\n%s\n\n",retval);

    /* deconstruct return from mhdrg() */
    p = strtok(retval,DELIM);
    for (i = 0; i < RETURNED && p != NULL; i++) {
        a[i] = p;
        p = strtok(NULL,DELIM);
    }

    puts("Deconstructed return value from mhdrg:");
    printf("rc=%s, mdc=%s, drg=%s, ovn=%s, weight=",a[0],a[1],a[2],a[3]);
    printf("%s, mean=%s, porm=%s\ndesc=%s\ndx flags:%s, px flags: %s\n",a[4],a[5],a[6],a[7],a[8],a[9]);

    /* last two return values are bit-strings of which ICD codes were
     * used in the grouping
     */

    puts("\nSignificant ICD codes:");
    p = a[8];
    for (i = 0; i < 32 && p[i] != '\000'; i++) {
        if (p[i] == '1') {
            printf(" * DX code %2d was used\n",(i+1));
        }
    }
    p = a[9];
    for (i = 0; i < 32 && p[i] != '\000'; i++) {
        if (p[i] == '1') {
            printf(" * Proc code %2d was used\n",(i+1));
        }
    }

    exit(0);
}

Wednesday, October 12, 2011

F29 Release: Windows Validation

Win32 DRGFilt...Passed
Win32 C-callable DLL...Passed
Win32 VB-callable DLL...Passed
Win32 VB-DRG / VB-callable DLL compatibility...Passed
Win32 CGI-DRG...Passed
Win32 F29 ICD9 table...Passed
Win32 ICD labeling DLL...Passed

Win32 F29 masks installer...Passed
Win32 C-callable DLL installer...Passed
Win32 VB-callable DLL installer...Passed

Our windows product line is validated and ready for shipping.

Tuesday, October 11, 2011

F29 Release: Linux Validation

F29 Linux Product Validation Log

Masks for F29...Passed
DAE Regression Test...Passed
Linux DRGFilt for F29...Passed
Demo Linux version of DRGFilt...Passed
Linux C Shared Object for F29...Passed
Linux Perl Shared Object for F29...Passed
Linux PHP Shared Object for F29...Passed
Linux CGI-DRG for F29...Passed

Details

Masks for F29...Passed
Validated the masks file against official list, which we found here. Not that some MS-DRGs are not defined, such as 9, 18, 19, etc.

DAE Regression Test...Passed
Ran the latest DAE through our regression testing suite.

[Tue Oct 11 16:33:41 2011]     | --------SUMMARY-----------
[Tue Oct 11 16:33:41 2011]     |   v29: Ok
[Tue Oct 11 16:33:41 2011]     |   v28: Ok
[Tue Oct 11 16:33:41 2011]     |   v27(poa): Ok
[Tue Oct 11 16:33:41 2011]     |   v27: Ok
[Tue Oct 11 16:33:41 2011]     |   v26(poa): Ok
[Tue Oct 11 16:33:41 2011]     |   v26: Ok
[Tue Oct 11 16:33:41 2011]     |   v25: Ok
[Tue Oct 11 16:33:41 2011]     |   v24: Ok
[Tue Oct 11 16:33:41 2011]     |   v23: Ok
[Tue Oct 11 16:33:41 2011]     |   v22: Ok
[Tue Oct 11 16:33:41 2011]     |   v21: Ok
[Tue Oct 11 16:33:41 2011]     |   v20: Ok
[Tue Oct 11 16:33:41 2011]     |   v19: Ok
[Tue Oct 11 16:33:41 2011]     |   v18: Ok
[Tue Oct 11 16:33:41 2011]     |   v17: Ok
[Tue Oct 11 16:33:41 2011]     |   v16: Ok
[Tue Oct 11 16:33:41 2011]     |   v15: Ok
[Tue Oct 11 16:33:41 2011]     |   v14: Ok
[Tue Oct 11 16:33:41 2011]     |   v13: Ok
[Tue Oct 11 16:33:41 2011]     |   v12: Ok




Linux DRGFilt for F29...Passed
Validated the DAE with DRGFilt against the test data set with this control file:

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
dflg 614 15
sflg 629 15

Using our validation script, we compare the incoming DRG at offset 603 to our DRG at offset 607, the incoming MDC at 600 with ours at 610, the incoming RC at offset 598 with ours at 612.

Demo Linux version of DRGFilt...Passed
This free version only does F10. Validated it against our internal F10 dataset of 35,451 records.

Interactive Test Cases
We don't run the entire test dataset through our interactive UIs because it would be too much work for too little gain. Once we validate the core DAE, we validate the UIs with a sample of the official test dataset. This year that sample looks like this:

-------------------------------------------
   Age: 049
   Sex: F
  Disp: 01
   MDC: 21
   DRG: 908
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 99679 : :
  DX02: 25041 : :
  DX03: 5859  : :
  DX04: 2767  : :
  DX05: 25051 : :
  DX06: 36904 : :
  DX07: 25061 : :
  DX08: 3371  : :
  DX09: 40290 : :
  DX10: 2859::

Proc's:  Code
  SG01: 3942  
  SG02: 3993  
  SG03: 3995
-------------------------------------------
   Age: 059
   Sex: M
  Disp: 01
   MDC: 01
   DRG: 074
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 3564  : :
  DX02: 2639  : :
  DX03: 311   : :
  DX04: 2761  : :
  DX05: 5601  : :
  DX06: 5180::

Proc's:  Code
  SG01: 9383  
  SG02: 9339

-------------------------------------------
   Age: 050
   Sex: M
  Disp: 01
   MDC: 04
   DRG: 182
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 1628::

Proc's:  Code
  SG01: 324   
  SG02: 3409  
  SG03: 8965  
  SG04: 9396

-------------------------------------------
   Age: 077
   Sex: F
  Disp: 03
   MDC: 08
   DRG: 563
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 81611 : :
  DX02: 25081 : :
  DX03: 2512  : :
  DX04: E8849 : :
  DX05: 3319  : :
  DX06: 04110 : :
  DX07: 8831::

Proc's:  Code
  SG01: 7904  
  SG02: 9659  
  SG03: 8659

-------------------------------------------
   Age: 081
   Sex: F
  Disp: 01
   MDC: 02
   DRG: 117
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 3659::

Proc's:  Code
  SG01: 1279




Linux C Shared Object for F29...Passed
Validated the Linux C shared object with this test case, to also confirm that the used codes bit flag handling is now correct:

-------------------------------------------
   Age: 055
   Sex: F
  Disp: 01
   MDC: 08
   DRG: 455
  DX's:  Code :E:P where E=exempt flag P=present on admission flag
  DX01: 71500 : :Y

Proc's:  Code
  SG01: 8134  
  SG02: 8135



Raw return value from mhdrg:
0^8^455^29^5.6449^0.00^ ^COMBINED ANTERIOR/POSTERIOR SPINAL FUSION W/O CC/MCC                  ^1^11

Deconstructed return value from mhdrg:
rc=0, mdc=8, drg=455, ovn=29, weight=5.6449, mean=0.00, porm=
desc=COMBINED ANTERIOR/POSTERIOR SPINAL FUSION W/O CC/MCC                 
dx flags:1, px flags: 11

Expected result: RC: 0 MDC: 08 DRG: 455

Significant ICD codes:
 * DX code  1 was used
 * Proc code  1 was used
 * Proc code  2 was used


Linux Perl Shared Object for F29...Passed

Validated the Perl shared object against the same test case as C shared object.

THIS YEAR, WE WILL HAVE TO CHANGE OUR PROCESS TO HANDLE THE 5.8 VS POST-5.8 DIVIDE, AS WELL AS MULT-THREADED VS NOT-MULTI-THREADED.


Linux PHP Shared Object for F29...Passed
Validated the Perl shared object against the same test case as C shared object.

Linux CGI-DRG for F29...Passed
Validated the Linux CGI-DRG against same test case as C shared object.


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.

Thursday, September 26, 2002

We Love SWIG

As we look to make our DAE more easily integrated with other people's software, we came across SWIG and it is our new best friend: easy to use, effect and Open Source. We use it for all of our Linux-based embeddable products and we love it.

Now we can provide DAE access for Perl scripts, PHP pages and C programs such as SAS.