Attribute VB_Name = "modBillingOPD" Option Explicit 'from OPD REG Global isAllowNewOPStatRate As Boolean 'Global isAllowHolidayRate As Boolean 'Global intXX As Integer 'Global blnHolidayRate As Boolean 'Global blnIsStat As Boolean 'Global isAllowAfterFivePMRate As Boolean ' duplicate 'Global isAllowAfterFiveLabChemOnly As Boolean 'Global isAllowAfterFiveAllRevenues As Boolean 'Global isAllowWeekendRate As Boolean 'Global strLabSectionID As String 'Global dtWeekendStartMarkup As String 'Global dtWeekendEndMarkup As String 'Global FirstRate As Double Global isAllowAssessmentDiscount As Boolean 'Global blnIsAssessment As Boolean Global blnCanGiveDiscountAssessment As Boolean 'Global isLabAutoMarkUpExam As Boolean Global isAssessmentMarkUp As Boolean 'Global isPostChargeMarkUp As Boolean Global VerifyRev As String 'Global isAllowZeroOnHand As Boolean 'Global isAllowChargeChangeAmount As Boolean Global isAllowRegisterInpatient As Boolean Global IsAllowOPDCheckLabSection As Boolean Global IsAllowOPDAssessmentRateG As Boolean Global IsAllowJonelta As Boolean Global isAllowOPDSearchBarangay As Boolean Global IsAllowOPDSearchCardNumber As Boolean Global IsAllowOPDMABRate As Boolean Global isWalkinValidate As Boolean Global IsAllowOPDUpdateHMOLOA As Boolean Global IsAllowOPDExportReport As Boolean Global IsAllowOPDSearchDocBySched As Boolean Global IsAllowOPDPatientClass As Boolean Global IsAllowOPDShowDiscount As Boolean Global isAllowOPDPayCode As Boolean 'Global isAllowSocializeHMORate As Boolean Global isOPDStatRate As Boolean Global isAllowMultipleRequest As Boolean '-----Avoid double registration----' Global isAllowCreateNewIDnum As Boolean 'Global blnIsAutoSearch As Boolean 'Global strMasterLastName As String ''-----For specialized rate -----' 'Global isAllowSpecializedCompanyRate As Boolean 'Global strOtherRevenueID As String ' ''----For HomeService Tagging ----' Global isAllowHomeService As Boolean ''--added 5/21/2012 'Global conBFile As New ADODB.Connection 'Global blnSeaFarer As Boolean ' 'Global blnPrintQueueNo As Boolean 'Global WshShell As Object ' 'Public strFileName As String 'Public blnisAllowRequestChargeOnCashPatient As Boolean 'Public blnisAllowPromptApprovalNumEntry As Boolean 'Public blnAllowCodeIncVitalSigns As Boolean 'Public blnAllowDischargeWithPending As Boolean 'Public blnAllowDoubleClickPxList As Boolean ''Public blnisRequirePhysician As Boolean Private GotOPDSettings As Boolean Private GotOPDStatInfo As Boolean Public Sub ComputeRateOP() ' ComputeStatRateNew End Sub Public Function GetOPDSettings() As String If GotOPDSettings = False Then GotOPDSettings = True Else Exit Function End If On Error GoTo ErrTrap Dim SQL As String Dim RecS As New ADODB.Recordset SQL = "Select top 1 isnull(ClientName,'') as ClientName, isnull(IsHMORate,0) isHMORate, isnull(IsOPDstatRate,0) IsOPDstatRate, " & _ "isnull(IsAllowOPDShowLabSpecimen,0) IsAllowOPDShowLabSpecimen, isnull(IsAllowOPDChargeChangePrice,0) IsAllowOPDChargeChangePrice, " & _ "isnull(isAllowOPDRegisterInpatient,0) isAllowOPDRegisterInpatient, isnull(IsAllowOPDCheckLabSection,0) IsAllowOPDCheckLabSection, " & _ "isnull(IsAllowOPDAssessmentRateG,0) IsAllowOPDAssessmentRateG, isnull(isAllowJonelta,0) isAllowJonelta, " & _ "isnull(isAllowOPDSearchBarangay,0) isAllowOPDSearchBarangay, Isnull(isAllowOPDSearchCardNumber,0) isAllowOPDSearchCardNumber, " & _ "isnull(IsAllowOPDMABRate,0) IsAllowOPDMABRate, isnull(IsAllowOPDUpdateHMOLOA,0) IsAllowOPDUpdateHMOLOA, " & _ "IsNull(IsAllowOPDExportReport,0) IsAllowOPDExportReport, IsNull(IsAllowOPDSearchDocBySched,0) IsAllowOPDSearchDocBySched, " & _ "IsNull(IsAllowOPDPatientClass,0) IsAllowOPDPatientClass, IsNull(IsAllowOPDShowDiscount,0) IsAllowOPDShowDiscount, isnull(isAllowOPDPayCode,0) isAllowOPDPayCode, " & _ "isnull(isAllowMultipleRequest,0) isAllowMultipleRequest, isnull(allowEndConsultation,0) allowEndConsultation, " & _ "isnull(isAllowOPFileNumbering,0) isAllowOPFileNumbering, isnull(isAllowCreateNewIDnum,0)isAllowCreateNewIDnum, isnull(isAllowSpecializedCompanyRate,0)isAllowSpecializedCompanyRate," & _ "isnull(isAllowAssessmentDiscount, 0)isAllowAssessmentDiscount,isnull(AllowZeroOnHand,0)AllowZeroOnHand from Patient_Data..tbHospitalInfo" With RecS If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, pclsUser.sqlconnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetOPDSettings = !ClientName & "" isHmoRate = IIf(!isHmoRate = 0, False, True) isOPDStatRate = IIf(!isOPDStatRate = 0, False, True) IsShowLabSpecimen = IIf(!IsAllowOPDShowLabSpecimen = 0, False, True) isAllowChargeChangeAmount = IIf(!IsAllowOPDChargeChangePrice = 0, False, True) 'isAllowRegisterInpatient = IIf(!isAllowOPDRegisterInpatient = 0, False, True) IsAllowOPDCheckLabSection = IIf(!IsAllowOPDCheckLabSection = 0, False, True) IsAllowOPDAssessmentRateG = IIf(!IsAllowOPDAssessmentRateG = 0, False, True) IsAllowJonelta = IIf(!IsAllowJonelta = 0, False, True) isAllowOPDSearchBarangay = IIf(!isAllowOPDSearchBarangay = 0, False, True) IsAllowOPDSearchCardNumber = IIf(!IsAllowOPDSearchCardNumber = 0, False, True) IsAllowOPDMABRate = IIf(!IsAllowOPDMABRate = 0, False, True) isAllowEndConsultation = IIf(!allowEndConsultation = 0, False, True) isAllowOPFileNumbering = IIf(!isAllowOPFileNumbering = 0, False, True) IsAllowOPDUpdateHMOLOA = IIf(!IsAllowOPDUpdateHMOLOA = 0, False, True) IsAllowOPDExportReport = IIf(!IsAllowOPDExportReport = 0, False, True) IsAllowOPDSearchDocBySched = IIf(!IsAllowOPDSearchDocBySched = 0, False, True) IsAllowOPDPatientClass = IIf(!IsAllowOPDPatientClass = 0, False, True) IsAllowOPDShowDiscount = IIf(!IsAllowOPDShowDiscount = 0, False, True) isAllowOPDPayCode = IIf(!isAllowOPDPayCode = 0, False, True) isAllowMultipleRequest = IIf(!isAllowMultipleRequest = 0, False, True) isAllowCreateNewIDnum = IIf(!isAllowCreateNewIDnum = 0, False, True) isAllowSpecializedCompanyRate = IIf(!isAllowSpecializedCompanyRate = 0, False, True) isAllowAssessmentDiscount = IIf(!isAllowAssessmentDiscount = 0, False, True) isAllowZeroOnHand = IIf(!AllowZeroOnHand = 0, False, True) ''08.24.16 VBB If True Check,According to Cost Center Programmers. End If .Close End With 'pstrClientName = GetOPDSettings Exit Function ErrTrap: MsgBox "GetOPDSettings " & Err.Description Resume Next End Function Public Function Get_MarkUpSettingsOP() Dim recx As New ADODB.Recordset Dim search As String Dim intQ As Integer search = "Select isnull(isAllowAfterFivePMRate, 0)isAllowAfterFivePMRate, isnull(isAllowHolidayRate,0)isAllowHolidayRate, " & _ "isnull(isAllowNewOPStatRate,0) isAllowNewOPStatRate, isnull(isAllowWeekendRate,0) isAllowWeekendRate, isnull(isAllowAfterFiveLabChemOnly,0) isAllowAfterFiveLabChemOnly, " & _ "isnull(isAllowAfterFiveAllRevenues, 0) isAllowAfterFiveAllRevenues, dtWeekendStartMarkup, dtWeekendEndMarkup, isAssesmentMarkUp, isPostChargeMarkUp, " & _ "isnull(isAllowHomeService,0) isAllowHomeService,isnull(isAllowSocializeHMORate,0)isAllowSocializeHMORate from Patient_data..tbOPD_settings" With recx If .State > 0 Then .Close .CursorLocation = adUseClient .Open search, pclsUser.sqlconnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isAllowAfterFivePMRate = IIf(!isAllowAfterFivePMRate = 0, False, True) isAllowHolidayRate = IIf(!isAllowHolidayRate = 0, False, True) isAllowNewOPStatRate = IIf(!isAllowNewOPStatRate = 0, False, True) isAllowWeekendRate = IIf(!isAllowWeekendRate = 0, False, True) isAllowAfterFiveLabChemOnly = IIf(!isAllowAfterFiveLabChemOnly = 0, False, True) isAllowAfterFiveAllRevenues = IIf(!isAllowAfterFiveAllRevenues = 0, False, True) dtWeekendStartMarkup = IIf(!dtWeekendStartMarkup = Null, "12:01:00", "12:01:00") dtWeekendEndMarkup = IIf(!dtWeekendEndMarkup = Null, "11:59:59", "11:59:59") isAssessmentMarkUp = IIf(!isAssesmentMarkUp = 0, False, True) isPostChargeMarkUp = IIf(!isPostChargeMarkUp = 0, False, True) isAllowHomeService = IIf(!isAllowHomeService = 0, False, True) isAllowSocializeHMORate = IIf(!isAllowSocializeHMORate = 0, False, True) ' isSocializedHMORate = True ''01.31.18 VBB for Carmona only End If End With Set recx = Nothing End Function Public Sub GetOPDStatInfo() If GotOPDStatInfo = True Then Exit Sub Else GotOPDStatInfo = True End If On Error GoTo ErrTrap Dim SQL As String Dim RecO As New ADODB.Recordset SQL = "Select top 1 OPDWeekendStatTimeStart, OPDWeekendStatTimeEnd, OPDHolidayStatTimeStart, OPDHolidayStatTimeEnd from Patient_Data..tbHospitalInfo " With RecO If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, pclsUser.sqlconnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then dtWeekendStatStart = !OPDWeekendStatTimeStart dtWeekendStatEnd = !OPDWeekendStatTimeEnd dtHolidayStatStart = !OPDHolidayStatTimeStart dtHolidayStatEnd = !OPDHolidayStatTimeEnd End If .Close End With Exit Sub ErrTrap: MsgBox "GetOPDStatInfo " & Err.Description 'Resume Next End Sub Public Sub ComputeStatRateNew() Dim dblRate As Double Dim dblGrandRate As Double Dim dblGrandTotalRate As Double Dim intA As Integer Dim strSQL As String Dim recClass As New ADODB.Recordset Dim dblStatRate As Double Dim myType As String Dim dblAmount As Double strSQL = "Select * from patient_data..tbopd_settings" With recClass If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, pclsUser.sqlconnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then dblStatRate = !OPDStatRAte MaxMarkupRate = !MaxMarkupRate StatAndWeekendRate = !StatAndWeekendRate StatAndAfterFivePmRate = !StatAndAfterFivePmRate End If .Close End With Set recClass = Nothing ' With frmPostCharges.grdTable With frmPostChargeOP.mshflexEntry If frmPostChargeOP.chkstat.Value = 1 Then ''''if stat For intA = 1 To .Rows - 1 If .TextMatrix(intA, 1) <> "" Then If .TextMatrix(intA, 1) <> "MD" Then If .TextMatrix(intA, 1) = "LB" Then strLabSectionID = GetLabSectionID(.TextMatrix(intA, 2)) blnLabAutomarkUpItem (.TextMatrix(intA, 2)) Else strLabSectionID = "" isLabAutoMarkUpExam = False End If FirstRate = .TextMatrix(intA, 5) myType = Get_strType If myType = "X" Then ''no added mark up rate dblAmount = Val(.TextMatrix(intA, 4)) * Val(FirstRate) + (Val(.TextMatrix(intA, 4)) * Val(FirstRate) * Val(dblStatRate) / 100) .TextMatrix(intA, 6) = Format(dblAmount, "######0.00") .TextMatrix(intA, 5) = FirstRate ElseIf myType = "2" Then ''stat and after five pm rate dblAmount = Val(.TextMatrix(intA, 4)) * Val(FirstRate) + (Val(.TextMatrix(intA, 4)) * Val(FirstRate) * Val(StatAndAfterFivePmRate) / 100) .TextMatrix(intA, 6) = Format(dblAmount, "######0.00") .TextMatrix(intA, 5) = FirstRate ElseIf myType = "3" Then ''stat and weekend rate dblAmount = Val(.TextMatrix(intA, 4)) * Val(FirstRate) + (Val(.TextMatrix(intA, 4)) * Val(FirstRate) * Val(StatAndWeekendRate) / 100) .TextMatrix(intA, 6) = Format(dblAmount, "######0.00") .TextMatrix(intA, 5) = FirstRate Else '' stat rate and any combined markup rates = maxrate dblAmount = Val(.TextMatrix(intA, 4)) * Val(FirstRate) + ((Val(.TextMatrix(intA, 4)) * Val(FirstRate) * Val(MaxMarkupRate) / 100)) .TextMatrix(intA, 6) = Format(dblAmount, "######0.00") .TextMatrix(intA, 5) = FirstRate End If Else .TextMatrix(intA, 6) = Format(.TextMatrix(intA, 6), "######0.00") .TextMatrix(intA, 5) = FirstRate End If End If Next Else ''' if not stat - unchecked stat button For intA = 1 To .Rows - 1 If .TextMatrix(intA, 1) <> "" Then If .TextMatrix(intA, 1) <> "MD" Then If .TextMatrix(intA, 1) = "LB" Then strLabSectionID = GetLabSectionID(.TextMatrix(intA, 2)) blnLabAutomarkUpItem (.TextMatrix(intA, 2)) Else strLabSectionID = "" isLabAutoMarkUpExam = False End If FirstRate = .TextMatrix(intA, 5) '---Validate Markup Rates and Get the New Rate dblAmount = Val(.TextMatrix(intA, 4)) * Val(get_MarkUpRate) .TextMatrix(intA, 6) = Format(dblAmount, "######0.00") Else .TextMatrix(intA, 6) = Format(.TextMatrix(intA, 6), "0.00") End If End If Next End If End With Set recClass = Nothing End Sub Public Sub CancelCharge() ' Dim recUpdateArCode As New ADODB.Recordset ' Dim strUpdaterecArcode As String ' Dim strAmt As String ' Dim recCancel As New ADODB.Recordset ' Dim intZero As Double ' Dim tmpRevenueID As String ' Dim dblSeqNo As Double ' ' cmdOption(0).Visible = True ' cmdOption(1).Visible = True ' ' 'Verify if can cancel the charge ' intZero = 0# ' recCancel.Open "STATION..sp_OPDRegistration_Charges '" & txtId.Text & "','" & mshflexList.TextMatrix(mshflexList.Row, 2) & "','" & mshflexList.TextMatrix(mshflexList.Row, 6) & "','" & mshflexList.TextMatrix(mshflexList.Row, 1) & "'", pclsUser.sqlconnection, adOpenForwardOnly, adLockOptimistic ' If Not recCancel.EOF Then ' If recCancel!Amount <= intZero Then ' MsgBox "Can't Cancel this Charges. The Total Amount is already Zero!", vbCritical + vbOKOnly, "Message" ' recCancel.Close ' Set recCancel = Nothing ' Exit Sub ' End If ' recCancel.Close ' Set recCancel = Nothing ' End If ' If MsgBox("Are you sure you want to Cancel this Charge?", vbQuestion + vbYesNo) = vbYes Then ' Else ' 'Me.tmrTimer.Enabled = True ' Exit Sub ' End If ' ' With frmPostCharges.grdTable ' strAmt = mshflexList.TextMatrix(mshflexList.Row, 5) ' ' recUpdateArCode.Open "station..sp_OPD_ArCode'" & .TextMatrix(.Row, 1) & "'", pclsUser.sqlconnection, adOpenDynamic, adLockOptimistic ' If Not recUpdateArCode.EOF Then ' strUpdaterecArcode = IIf(IsNull(recUpdateArCode!cmcode), "", recUpdateArCode!cmcode) ' End If ' ' If Trim$(.TextMatrix(.Row, 9)) <> "" Then ' tmpRevenueID = Get_StockCardRevenueID(Trim$(.TextMatrix(.Row, 1))) ' End If ' ' ''08.18.16 VBB Fix Quantity on cancelation for InvStockCard. with JP ' If .TextMatrix(.Row, 9) <> "" Then ' pclsuser.medsysclasses.clsDrug.Drug.AppendStockCard txtPno.Text, _ ' txtId.Text, _ ' .TextMatrix(.Row, 2), _ ' Format(Now, "mm/dd/yyyy hh:mm:ss AM/PM"), _ ' mshflexList.TextMatrix(mshflexList.Row, 6), _ ' Val(.TextMatrix(.Row, 4)) * (-1), _ ' 0, _ ' Val(.TextMatrix(.Row, 5) * (-1)), _ ' pclsUser.EmployeeCode, _ ' "", _ ' "", _ ' .TextMatrix(.Row, 9), _ ' "", _ ' txtRoom.Text, _ ' 1, _ ' tmpRevenueID, tmpRevenueID, , , , , "O", , , , 0 ' 'IIf(.TextMatrix(.Row, 1) = "CS" Or .TextMatrix(.Row, 1) = "OS" Or .TextMatrix(.Row, 1) = "DZ" Or .TextMatrix(.Row, 1) = "FF", "CS", "PH"), _ ' 'IIf(.TextMatrix(.Row, 1) = "CS" Or .TextMatrix(.Row, 1) = "OM" Or .TextMatrix(.Row, 1) = "DA" Or .TextMatrix(.Row, 1) = "FF", "PH", "CS"), , , , , "O", , , , 0 ' ' If .Cols > 10 Then ' If Trim$(.TextMatrix(.Row, 10)) <> "" Then ' 'Get Sequence Number from Stock Card ' If recSNum.State > 0 Then recSNum.Close ' recSNum.Open "Select SequenceNumber From INVENTORY..tbInvStockcard Where IDNum = '" & _ ' Trim$(txtId.Text) & "' and ItemId ='" & _ ' Trim$(.TextMatrix(.Row, 2)) & "' and RefNum ='" & _ ' Trim$(.TextMatrix(.Row, 6)) & "' and Isnull(PackageID,'') = ''", pclsUser.sqlconnection, adOpenForwardOnly, adLockReadOnly ' ' If Not recSNum.EOF Then ' dblSeqNo = recSNum!SequenceNumber ' End If ' ' If recSNum.State > 0 Then recSNum.Close ' Set recSNum = Nothing ' ' 'Update PackageID ' If Not dblSeqNo = 0 Then ' pclsUser.sqlconnection.Execute ("Update INVENTORY..tbInvStockcard Set PackageID ='" & _ ' mshflexList.TextMatrix(mshflexList.Row, 15) & "' Where SequenceNumber =" & dblSeqNo) ' End If ' End If ' End If ' ' ' Else ' If Check_WithDiscount(Trim$(mshflexList.TextMatrix(mshflexList.Row, 6)), Trim$(txtId.Text)) Then ' pclsUser.sqlconnection.Execute "Patient_data..opd_autorecompute_discount '" & mshflexList.TextMatrix(mshflexList.Row, 6) & _ ' "','" & txtId.Text & "','" & strAmt & "'" ' End If ' '' MsgBox " " & mshflexList.TextMatrix(mshflexList.Row, 8) & " " ' ' pclsUser.sqlconnection.Execute "STATION..OPDRegistration_UpdateCharging '" & txtPno.Text & _ ' "','" & txtId.Text & "','" & mshflexList.TextMatrix(mshflexList.Row, 2) & _ ' "','" & strAmt & "','" & mshflexList.TextMatrix(mshflexList.Row, 4) & _ ' "','" & Format$(Now, "MM/DD/YYYY hh:mm:ss AM/PM") & "','" & mshflexList.TextMatrix(mshflexList.Row, 1) & _ ' "','" & pclsUser.EmployeeCode & "','" & "O" & _ ' "','" & "C" & "','" & pclsuser.medsysclasses.clsPatientSearch.Admission.Room & _ ' "','" & mshflexList.TextMatrix(mshflexList.Row, 6) & "','" & strUpdaterecArcode & "','" & mshflexList.TextMatrix(mshflexList.Row, 15) & "'" ' ' pclsUser.sqlconnection.Execute "Patient_Data..sp_AOPD_Insert_CancelCardTransaction '" & _ ' "" & mshflexList.TextMatrix(mshflexList.Row, 6) & "','" & mshflexList.TextMatrix(mshflexList.Row, 1) & "','" & _ ' "" & mshflexList.TextMatrix(mshflexList.Row, 2) & "', '" & pclsUser.EmployeeCode & "'" ' End If ' End With ' mshflexList.Refresh ' Get_Charges ' Exit Sub End Sub