Attribute VB_Name = "modBillingOP" 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 myClsBilling.isAllowZeroOnHand As Boolean 'Global myClsBilling.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 myclsbilling.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 myclsbilling.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 Public Check As ADODB.Recordset Public objTabularFormat As New clsLaboratoryTabular Global gbMasterFileRegistrationOnly As Boolean Global blnAllowOPDAssessmentCompanyRate As Boolean Global isAllowBIRChargeslipSetting As Boolean Global blnAllowSelectionOnItems As Boolean Global blnAllowCompanyRateAsRateH As Boolean Global isAllowSpecializedCompanyRate As Boolean 'Global gbAutoDoctorAssignment As Boolean 'Public gstrPatientPicturePath As String ' 'Public pclsMasterSearch As Object 'Public strAutoSearch As String ' 'Public ChildCount As Integer 'Public pstrEmployeeID As String 'Public pstrDate As String 'Public pstrRemarks As String 'Public pstrLogOutDate As String 'Public pstrHospitalID As String 'Public pstrEmployeePassword As String 'Public blnValidation As Boolean 'Public clsUserMenu As New clsUserSetting 'Public blnLogOut As Boolean '' For SmartCard *************************** ' 'Private Declare Function StartDevice Lib "MifareLink.dll" (ByVal port As Integer, ByVal baud As Integer) As Long 'Private Declare Function StopDevice Lib "MifareLink.dll" () As Integer 'Private Declare Function CardNumber Lib "MifareLink.dll" (ByRef CardNo As String) As Integer 'Private Declare Function CheckVersion Lib "MifareLink.dll" (ByRef DLLVersion As String) As Integer 'Private Declare Function CardRead Lib "MifareLink.dll" (ByVal BlkNo As Integer, ByRef Read As String) As Integer 'Private Declare Function CardFill Lib "MifareLink.dll" (ByVal StrBlk As Integer, ByVal fill As String) As Integer ''-----BIHMI----' 'Global strPackageID As String 'Global blnIsPackage As Boolean 'Global myClsBilling.isAllowEndConsultation As Boolean 'Global myClsBilling.isAllowOPFileNumbering As Boolean 'Global fltDiscountRate As Double ' ''-----LIMSO and CHDC-------' 'Global isAllowNewOPStatRate As Boolean 'Global isAllowHolidayRate As Boolean 'Global intXX As Integer 'Global blnHolidayRate As Boolean 'Global blnIsStat As Boolean 'Global isAllowAfterFivePMRate As Boolean '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 myClsBilling.isAllowZeroOnHand As Boolean ' ''--rates--' 'Global OPDStatRAte As Double 'Global AfterFivePmRate As Double 'Global HolidayRate As Double 'Global WeekendRate As Double 'Global WeekendAfterFive As Double 'Global HolidayAndWeekend As Double 'Global HolidayAndAfterFivePmRate As Double 'Global maxmarkUpRate As Double 'Global StatAndAfterFivePmRate As Double 'Global StatAndWeekendRate As Double ' ''------FOR HOLIDAY RATE--------' 'Global myHolidayGreeting As String 'Global myHolidayName As String 'Global isHolidayToday As Boolean ' ''-----Avoid double registration----' 'Global isAllowCreateNewIDnum As Boolean 'Global blnIsAutoSearch As Boolean 'Global strMasterLastName As String ''-----For specialized rate -----' 'Global myclsbilling.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 ' ''Public blnAllowCF4Entries As Boolean ' ''Global blnAllowSameExamRequest As Boolean ' 'Dim IX As Integer 'Public ProcessPerformed As String Public Sub ComputeRateOP() ' ComputeStatRateNew 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 .Open strSQL, pclsUser.sqlconnection, adOpenStatic, adLockReadOnly If .EOF = False Then dblStatRate = !OPDStatRAte MaxMarkupRate = !MaxMarkupRate StatAndWeekendRate = !StatAndWeekendRate StatAndAfterFivePmRate = !StatAndAfterFivePmRate End If .Close End With Set recClass = Nothing ' With frmPostCharges.grdTable With frmPostCharge.mshflexEntry If frmPostCharge.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 = myclsbilling.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 '" & myClsBilling.MyclsPatient.idnum & "','" & 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, adopenstatic, 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 myClsBilling.MyclsPatient.clsPatientMaster.hospitalnumber, _ ' myClsBilling.MyclsPatient.idnum, _ ' .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), _ ' "", _ ' myClsBilling.MyclsPatient.room, _ ' 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$(myClsBilling.MyclsPatient.idnum) & "' 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$(myClsBilling.MyclsPatient.idnum)) Then ' pclsUser.sqlconnection.Execute "Patient_data..opd_autorecompute_discount '" & mshflexList.TextMatrix(mshflexList.Row, 6) & _ ' "','" & myClsBilling.MyclsPatient.idnum & "','" & strAmt & "'" ' End If ' '' MsgBox " " & mshflexList.TextMatrix(mshflexList.Row, 8) & " " ' ' pclsUser.sqlconnection.Execute "STATION..OPDRegistration_UpdateCharging '" & myClsBilling.MyclsPatient.clsPatientMaster.hospitalnumber & _ ' "','" & myClsBilling.MyclsPatient.idnum & "','" & 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 ' ' 'Public Sub Remove_Profile_OrderList(ProFileList As MSHFlexGrid, OrderList As MSHFlexGrid, intCol As Integer) 'Dim intOrder As Integer 'Dim intProfile As Integer ' 'Routine: 'For intOrder = 1 To OrderList.Rows - 1 ' For intProfile = 1 To ProFileList.Rows - 1 ' If OrderList.Rows = 2 And OrderList.TextMatrix(1, 1) = "" Then ' Else ' If Trim$(ProFileList.TextMatrix(intProfile, 1)) = _ ' Trim$(OrderList.TextMatrix(intOrder, intCol)) Then ' If OrderList.Rows = 2 And OrderList.TextMatrix(1, 1) <> "" Then ' If intCol = 2 Then ' If Not OrderList.TextMatrix(intOrder, 11) = "" Then ' frmFinal.lstListLaboratory.RemoveItem OrderList.TextMatrix(intOrder, 11) ' frmFinal.lstListLaboratory.AddItem OrderList.TextMatrix(intOrder, 10) ' frmFinal.lstListLaboratory.Refresh ' End If ' End If ' OrderList.TextMatrix(1, 1) = "" ' OrderList.TextMatrix(1, 2) = "" ' OrderList.TextMatrix(1, 3) = "" ' OrderList.TextMatrix(1, 4) = "" ' OrderList.TextMatrix(1, 5) = "" ' OrderList.TextMatrix(1, 6) = "" ' OrderList.TextMatrix(1, 7) = "" ' OrderList.TextMatrix(1, 8) = "" ' OrderList.TextMatrix(1, 9) = "" ' OrderList.TextMatrix(1, 10) = "" ' OrderList.TextMatrix(1, 11) = "" ' If OrderList.Cols > 12 Then ' OrderList.TextMatrix(1, 12) = "" ' OrderList.TextMatrix(1, 13) = "" ' OrderList.TextMatrix(1, 14) = "" ' OrderList.TextMatrix(1, 15) = "" ' End If ' Else ' If intCol = 2 Then ' If Not OrderList.TextMatrix(intOrder, 11) = "" Then ' frmFinal.lstListLaboratory.RemoveItem OrderList.TextMatrix(intOrder, 11) ' frmFinal.lstListLaboratory.AddItem OrderList.TextMatrix(intOrder, 10) ' frmFinal.lstListLaboratory.Refresh ' End If ' End If ' OrderList.RemoveItem (intOrder) ' GoTo Routine ' End If ' End If ' End If ' Next 'Next ' 'End Sub