Wednesday, May 2, 2012

Calling mhicd()

There is some confusion, partly caused by bad documentation on our part, about calling mhicd(), the function which gives you the short description of the specified ICD9cm code.


ORIGINAL EMAIL

I get the following error message when I try to compile the examples in DRGMAN.pdf.
        'mhicd' : function does not take 4 arguments...
Can it be that the version differs?



ANSWER


You are right, the example is wrong, it is missing the final argument. We will fix that as soon as we can.

The mhicd() function takes 5 arguments:

(1) which kind of code: D=diagnosis, P or S=procedure
(2) the file name to use as the ICD9 look up table
(3) the ICD9 code to be looked up
(4) the buffer into which to put the name
(5) the length of the buffer
 
So the examples should look like this:


Visual BASIC

Private Sub dx_Change(index As Integer)
    Dim retval As String * 24
   
    Call mhicd("d", _
        Command & "/icd9.tab", Me.dx(index).Text, retval, 23)
    Me.ddesc(index).Caption = retval
End Sub


C VERSION


    if ((i=mhicd("d","icd9.tab","56409",retval,23))) {
        printf("Error from mhicd(): %d\n",i);
    } else {
        printf("%s\n",retval);
    }

No comments:

Post a Comment