Wednesday, November 3, 2010

CGI Demo Version

QUESTION

I am interested in your product CGI-DRG (f24) for Windows, but your demo does not work. Can I get a trial version before buying?
Thanks.

ANSWER

We find that keeping a CGI script working on an ISP's host is a constant struggle. We should probably give up. We are happy to send you an F10 CGI-DRG for you to try; just remember to tell us whether you are running under Windows or Unix.

Friday, October 8, 2010

F28 Released

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

Monday, September 13, 2010

How Does Access-DRG Work?

QUESTION

How does the Access front-end work? (ie. Can I link into a SQL Server dataset (as an input) and have the Access-DRG spit out the results into a SQL Server dataset?

ANSWER

Access-DRG is not really a front end, it is a self-contained app. You load data into it, you call its DRG Assignment function (which, in turn, calls our VB-callable DLL) and it does in-place DRG assignment.

If you want to read data from a database server, assign a DRG and put the results back onto the database server, you probably want to get our VB-callable DLL and write your own simple program to read, call and write. Or you can use DRGFilt and the import/assign a DRG/write method described in a DRGFilt posting.

Friday, July 9, 2010

Version NN Invalid

QUESTION

We executed an  unix command from PL/SQL stored procedure and got the 'Version 27 Invalid' message from DRGFilt, but executed the same command directly from unix box in putty, everything was fine. The following is the command:

'/u01/app/oracle/product/11.2.0/dbhome_1/bin/drgfilt_lnx_64 -0 f27 drgmasks.f27 /home/mhuang/DRGFilt_control.txt </home/mhuang/DRGFilt_input.txt >/home/mhuang/output.txt'
 
What does the 'version 27 Invalid' mean to DRGFilt?  Also can we add our custom keyword in the control file? We plan add more fields into the control file.

ANSWER

re: "Version 27 Invalid"
This means that version 27 could not be initialized. Usually, this means that the drg masks file could not be found or could not be read.

re: custom keywords
No, DRGFilt does not allow custom keywords; however, you can put line comments into the file so long as those comments are preceded by a sharp sign, like this:

sex 156 1
# this is a line comment
#mykey=5

Sunday, April 4, 2010

Length of Stay ALOS vs GLOS

QUESTION

I have your v27 DRG grouper software and it appears that it returns the
Geometric mean Length of Stay (GLOS) for each DRG. Is there any way to get
the Arithmetic mean Length of Stay (ALOS)?

I am using DLL calls from your software's "mhinfo" function to get the
GLOS. Please let me know. Thank you.

ANSWER

I have done some digging and discovered that, as you confirmed, the ALOS is not exposed through this API. You would have to match up the DRG with its ALOS explicitly in your code.

In order to help you with that, please find attached the spreadsheet published by CMS with this information in it. [Note: file was attached to support email, but is not reachable from this blog posting.]

Monday, January 4, 2010

VB.Net?

QUESTION

We have a use primarily Microsoft architecture and program in VB.net and C# (preferably VB.net).  Your VB callable DLL seems like a good fit for our needs, however I would like to know if you could provide a .Net framework code example that calls your DLLs.

ANSWER

We have an uneasy relationship with VB.Net because we never took the step of making our DLLs registered. However, some of our customers do call our VB-callable DLL as unmanaged code in the VB.Net environment. The sample code we give out is this:

-----------------------------------

REM-----------------------------------------------------------------
REM VB .NET programmers: (Jan-2004)
REM-----------------------------------------------------------------
REM You will want to implicitly allocate storage for the strings you
REM pass to our DLL functions, like this: VerStr = Space(80)
REM You will also probably want to use DllImport and specify the
REM character coding as ANSI
REM-----------------------------------------------------------------
REM
Option Explicit

Private Declare Function mhicd Lib "mhicdvb.dll" (ByVal which As String, _
ByVal file As String, ByVal code As String, ByVal retval As String, _
ByVal length As Integer) As Integer
Private Declare Function mhdllver Lib "mhdrgvb.dll" (ByVal Buf As String, _
ByVal BufLen As Integer) As Integer
Private Declare Function mhdrg Lib "mhdrgvb.dll" (drg As Integer, _
ByVal DRGVersion As String, ByVal MasksPath As String, ByVal DischStat As String, _
ByVal PtAge As String, ByVal PtGender As String, ByVal DXList As String, _
ByVal ProcList As String) As Integer
Private Declare Sub mherrdesc Lib "mhdrgvb.dll" (ByVal Buffer As String, _
ByVal length As Integer)
Private Declare Sub mhinfo Lib "mhdrgvb.dll" (drg As Integer, _
ByVal DRGVersion As String, ByVal MasksPath As String, mdc As Integer, _
weight As Double, los As Double, ByVal Desc As String, ByVal DescLen As Integer)
Private Declare Function mhcodeused Lib "mhdrgvb.dll" (ByVal which _
As String, ByVal codeindex As Integer) As Integer
Private Declare Function mhdrgver Lib "mhdrgvb.dll" (ByVal MPath As String, _
ByVal Buf As String, ByVal BufLen As Integer) As Integer

Private Sub AssignDRG()
Dim ErrMsg As String * 256
Dim ReturnCode As Integer
Dim drg As Integer, mdc As Integer
Dim Desc As String * 80
Dim weight As Double, los As Double
Dim masksdir As String
Dim myver As String, mydstat As String, myage As String, mysex As String
Dim mydxbuf As String * 80
Dim mypxbuf As String * 80
Dim tempStr As String
Dim N As Integer, needcomma As Integer

'Loop through controls, getting their current values
masksdir = Command
myver = Me!ver
mydstat = Left$(Me!dstat, 1)
myage = Me!age
mysex = Left$(Me!sex, 1)

'make string out of the diagnoses codes
tempStr = ""
needcomma = 0
For N = 0 To 9
If Len(Me!dx(N)) > 0 Then
If needcomma <> 0 Then
tempStr = tempStr & ","
End If
needcomma = 1
tempStr = tempStr & Me!dx(N)
End If
Next N
mydxbuf = tempStr

'make string out of the procedure codes
tempStr = ""
needcomma = 0
For N = 0 To 14
If Len(Me!proc(N)) > 0 Then
If needcomma <> 0 Then
tempStr = tempStr & ","
End If
needcomma = 1
tempStr = tempStr & Me!proc(N)
End If
Next N
mypxbuf = tempStr

'call the M+H grouper with what you got
Me!results = ""
ReturnCode = mhdrg(drg, myver, masksdir, mydstat, myage, mysex, mydxbuf, mypxbuf)
If ReturnCode <> 0 Then 'drg assignment failed, alas!
Call mherrdesc(ErrMsg, 70) 'tell user about failure
Me!results = "DRG Assignment FAILED: " & ErrMsg
Else 'drg assignment worked, hurray!
'get the particulars of this DRG from M+H dll
Call mhinfo(drg, myver, masksdir, mdc, weight, los, Desc, 80)
Me!results = "DRG: " & drg & " " & Desc
Me!info = "MDC: " & mdc & " Weight: " & weight & " Mean LOS: " & los & " Version: " & myver
'which dxes were used?
For N = 0 To 9
If mhcodeused("d", N) Then
Me.dx(N).FontBold = True
Else
Me.dx(N).FontBold = False
End If
Next N
'which procs were used?
For N = 0 To 14
If mhcodeused("p", N) Then
Me.proc(N).FontBold = True
Else
Me.proc(N).FontBold = False
End If
Next N
End If

End Sub

Private Sub Form_Load()
Dim VerStr As String * 80, MaxVer As Integer, MPath As String
Dim DRGVers As String * 81, N As Integer, I As Integer

'expect the masks directory as a command line argument
If Command = "" Then
MsgBox (Me.Caption & " " & Chr(10) & Chr(10) & _
"Required command line argument 'Masks Directory' is missing" & Chr(10) & _
"(This is the path to the directory with DRG Masks files and the ICD9 file")
End
End If
MPath = Command

'get the DLL version
MaxVer = mhdllver(VerStr, 79)
Me.Caption = Me.Caption & " " & VerStr

'get the supported DRG versions
N = mhdrgver(MPath, DRGVers, 81) ' deal with error, if any
I = 1
Do While N <> 0
Me.ver.AddItem (Mid$(DRGVers, I, 2))
If I = 1 Then
Me.ver.Text = Mid$(DRGVers, I, 2)
End If
N = N - 1
I = I + 2
Loop
'initialize sex list
Me.sex.AddItem "1 Male"
Me.sex.AddItem "2 Female"

'initialize discharge status list
Me.dstat.AddItem "0 Unknown"
Me.dstat.AddItem "1 Home"
Me.dstat.AddItem "2 Other Hosp"
Me.dstat.AddItem "3 SNF"
Me.dstat.AddItem "4 ICF"
Me.dstat.AddItem "5 Other Inst"
Me.dstat.AddItem "6 Home Care"
Me.dstat.AddItem "7 AMA"
Me.dstat.AddItem "8 Expired"
End Sub

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

Private Sub proc_Change(index As Integer)
Dim retval As String * 24

Call mhicd("p", Command & "/icd9.tab", Me.proc(index).Text, retval, 23)
Me.pdesc(index).Caption = retval
End Sub

-----------------------------------