Declration Inherits System.Windows.Forms.Form Dim i As Integer Dim hcpcs(3) As String Dim m1(3) As String Dim m2(3) As String Dim m3(3) As String Dim allow(3) As Decimal Dim msr(3) As Integer Dim pay(3) As Decimal Dim bl As String Dim ass As String Dim a(3) As Decimal Dim b(3) As Decimal Dim c(3) As Decimal Dim final(3) As Decimal Dim cnt As Integer Dim biggest As Integer Dim P As Integer Dim q As Integer Dim k As Integer Dim m As Integer Dim z As Integer Dim bill(3) As Decimal Dim adj(3) As Decimal Dim big As Integer
Program
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer For i = 0 To 2 If hcpcs(i) = " " Then m1(i) = " " m2(i) = " " m3(i) = " " 'allow(i) = 0 'pay(i) = 0 'bill(i) = 0 'adj(i) = 0 'msr(i) = " " End If Next i hcpcs(0) = TextBox1.Text hcpcs(1) = TextBox8.Text hcpcs(2) = TextBox15.Text m1(0) = TextBox2.Text m1(1) = TextBox9.Text m1(2) = TextBox16.Text m2(0) = TextBox3.Text m2(1) = TextBox10.Text m2(2) = TextBox17.Text m3(0) = TextBox4.Text m3(1) = TextBox11.Text m3(2) = TextBox18.Text allow(0) = TextBox5.Text allow(1) = TextBox12.Text allow(2) = TextBox19.Text msr(0) = TextBox6.Text msr(1) = TextBox13.Text msr(2) = TextBox20.Text pay(0) = TextBox7.Text pay(1) = TextBox14.Text pay(2) = TextBox21.Text bill(0) = TextBox29.Text bill(1) = TextBox30.Text bill(2) = TextBox31.Text adj(0) = TextBox33.Text adj(1) = TextBox34.Text adj(2) = TextBox35.Text
'For z = 0 To 2 ' If ((hcpcs(z) > 0) And (m1(i) > 0) And (m2(i) > 0) And (m3(i) > 0)) Then ' If (m1(z) = m2(z) Or m1(z) = m3(z) Or m2(z) = m3(z)) Then ' MsgBox("repeated mod") ' End ' End If ' End If 'Next z For i = 0 To 2 If m1(i) = "50" Then a(i) = bilateral_mod(Val(hcpcs(i)), Val(Val(allow(i)))) MsgBox(" i st bl") MsgBox(a(i)) End If If m1(i) = "lt" Then a(i) = lt_mod(Val(hcpcs(i)), Val(Val(allow(i)))) MsgBox(" i st lt") ' MsgBox(a(i)) End If If m1(i) = "rt" Then a(i) = rt_mod(Val(hcpcs(i)), Val(Val(allow(i)))) MsgBox(" i st rt") ' MsgBox(a(i)) End If If m1(i) = "80" Or m1(i) = "82" Then MsgBox(" 1 st 80 mod") a(i) = eighty_mod(Val(hcpcs(i)), Val(Val(allow(i)))) ' MsgBox(a(i)) End If If m1(i) = "81" Or m1(i) = "as" Then MsgBox(" 1 st ass") a(i) = ass_mod(Val(hcpcs(i)), Val(Val(allow(i)))) ' MsgBox(a(i)) End If If m1(i) = "52" Or m1(i) = "22" Then MsgBox(" mmr") a(i) = mmr_mod(Val(hcpcs(i)), Val(Val(allow(i)))) ' MsgBox(a(i))
End If If m1(i) = "62" Then MsgBox(" 1 st 80 mod") a(i) = mmr62_mod(Val(hcpcs(i)), Val(Val(allow(i)))) ' MsgBox(a(i)) End If If m2(i) <> "0" Then If (m2(i) = "50") Then ' MsgBox(a(i)) b(i) = bilateral_mod(Val(hcpcs(i)), a(i)) MsgBox(" u have 2 bl") End If If m2(i) = "lt" Then b(i) = lt_mod(Val(hcpcs(i)), a(i)) MsgBox(" 2 nd st lt") ' MsgBox(a(i)) End If If m2(i) = "rt" Then b(i) = rt_mod(Val(hcpcs(i)), a(i)) MsgBox(" 2 nd rt") ' MsgBox(a(i)) End If If m2(i) = "80" Or m2(i) = "82" Then MsgBox(" 2 nd st 80 mod") b(i) = eighty_mod(Val(hcpcs(i)), a(i)) ' MsgBox(a(i)) End If If m2(i) = "81" Or m2(i) = "as" Then MsgBox("2 nd ass") b(i) = ass_mod(Val(hcpcs(i)), a(i)) ' MsgBox(a(i)) End If pay(i) = b(i) MsgBox(pay(i)) Else
pay(i) = a(i) MsgBox(pay(i)) End If If m2(i) <> "0" Then If m3(i) <> "0" Then If (m3(i) = "50") Then ' MsgBox(a(i)) c(i) = bilateral_mod(Val(hcpcs(i)), b(i)) MsgBox(" u have 3 bl") End If If m3(i) = "lt" Then c(i) = lt_mod(Val(hcpcs(i)), b(i)) MsgBox(" 3 rd lt")
' MsgBox(a(i)) End If If m3(i) = "rt" Then c(i) = rt_mod(Val(hcpcs(i)), b(i)) MsgBox(" 3 rd rt") ' MsgBox(a(i)) End If If m3(i) = "80" Or m3(i) = "82" Then MsgBox(" 3 rd 80 mod") c(i) = eighty_mod(Val(hcpcs(i)), b(i)) ' MsgBox(a(i)) End If If m3(i) = "81" Or m3(i) = "as" Then MsgBox("3 rd ass") c(i) = ass_mod(Val(hcpcs(i)), b(i)) ' MsgBox(a(i)) End If pay(i) = c(i) MsgBox(pay(i)) Else
pay(i) = b(i) MsgBox(pay(i)) End If End If Next i TextBox7.Text = pay(0) TextBox14.Text = pay(1) TextBox21.Text = pay(2) cnt = 0 biggest = -1 For P = 0 To 2 If Val(msr(P) = 2 Or msr(P) = 3) Then cnt = cnt + 1 End If Next P MsgBox(cnt) For q = 0 To 2 big = 0 If (Val(msr(q) = 2) Or Val(msr(q) = 3)) Then For k = 0 To 3 If Val(pay(q)) > Val(pay(k)) Then If ((msr(q) = 2) Or Val(msr(q) = 3)) Then big = big + 1 End If End If If big = (cnt - 1) And cnt <> 1 Then biggest = q End If Next k End If Next q
For m = 0 To 3 If Val(msr(m) = 0) Then final(m) = pay(m) ElseIf (Val(msr(m) = 2) Or Val(msr(m) = 3)) Then If biggest = m Or biggest = -1 Then final(m) = pay(m) Else final(m) = pay(m) / 2 End If End If Next m MsgBox(final(0)) MsgBox(final(1)) MsgBox(final(2)) Dim s As Integer 'For s = 0 To 2 ' If m1(s) = "lt" And m1(s + 1) = "rt" Then ' If hcpcs(s) = hcpcs(s + 1) Then ' ' ' '
If final(s) > final(s + 1) Then final(s) = final(s) / 2 final(s + 1) = final(s) ' final(s) = final(s)
' ' ' ' ' ' '
' final(s + 1) = 0 'Else ' final(s) = final(s + 1) / 2 ' final(s + 1) = final(s) ' final(s) = 0 ' final(s + 1) = final(s + 1) End If
' End If ' End If ' 'End If 'Next s 'MsgBox(final(0)) 'MsgBox(final(1)) 'MsgBox(final(2)) TextBox7.Text = final(0) TextBox14.Text = final(1) TextBox21.Text = final(2) For i = 0 To 2 adj(i) = bill(i) - final(i) Next i TextBox33.Text = adj(0) TextBox34.Text = adj(1) TextBox35.Text = adj(2) End Sub Public Function bilateral_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal
MsgBox(code) MsgBox("bl") rate = rate * 1.5 Return rate End Function Public Function ass_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox(code) MsgBox("ass") rate = rate * 0.136 MsgBox(rate) Return rate End Function Public Function lt_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox(code) MsgBox("lt") rate = rate * 1.5 Return rate End Function Public Function rt_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox(code) MsgBox("rt") rate = rate * 1.5 Return rate End Function Public Function eighty_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox(code) MsgBox("80 mod") rate = rate * 0.16 MsgBox(rate) Return rate End Function Public Function mmr_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox("check i comments") rate = rate * TextBox37.Text MsgBox(rate) Return rate End Function Public Function mmr62_mod(ByVal code As Integer, ByVal rate As Decimal) As Decimal MsgBox("check i comments r route to mbr") 'TextBox38.Visible = True 'rate = rate * TextBox38.Text Dim u As Decimal u = InputBox("enter ur percentage") MsgBox(u) rate = rate * u MsgBox(rate) Return rate End Function