Attribute VB_Name = "modTemp" Option Explicit Public Const YELLOW = &H80000018 Public Const YELLOW_1 = &H80FFFF Public Const WHITE = &H80000005 Public Const RED = &HC0C0FF Public Const BLACK = &H80000008 Public Const VIOLET = &HFFC0C0 Public Const CONST_RUV_PSH = True Public Const KC_PASSWORD_KEY = "ROBERTFKAISER" 'NKTI Private mvarDocChief As String Private mvarPayService As String Private mvarPurchaseDate As String 'Private mvarSession As String Public user As Object 'Public user As New Medsys_User.clsCurrentUser Public Medicare As New clsMedicare Public DoctorList As New clsDoctorList Public Doctor As New Doctor Public ZipCode As New ZipCode Public ListZipCode As New clsZipCodeList Public MedicareType As New MedType Public MemberList As New ListMembers Public EmployerList As New ListEmployers '' Global fs As Object 'exporting khing 6.19.14 'eclaims Public clsMDR As New classMDR 'eclaims 'Split Caserate Public blnisallowSplitCaserate As Boolean 'Distribute Whole Caserate Public blnisDistributeWholeCaserate As Boolean 'To validate verfied cf4 upon transmittal Public blnisValidateVerifiedCF4_Transmittal As Boolean Public pubReports As String Public pubSubReports As String 'Public MedsysClasses As New clsMEDSYS Public pclsCodeSearch As Object Public PatientList As New ListPatients Public clsPatient As Object 'Public clsPatient As New clsPatient 'Public clsPatient As New clsPatient Public BuildFiles As New MedBuildFiles Public LateSubmission As New LateSubmission Public RVS As New RVS Public clsICD10 As Object Public MEDSYSClass As Object Public clsSummary As New clsSummary Public clsUserSetting As New UserSetting Public AdditionalClass As New AdditionalClass Public clsCardiologist As New clsCardiologist Public clsAnesthesiologist As New clsAnesthesiologist Public clsPhysician As New clsPhysician Public recPostedList As New ADODB.Recordset Public recSubReceivableList As New ADODB.Recordset Public Recnew As New ADODB.Recordset Public Form2Report As CRAXDRT.Report Public Form5Report As CRAXDRT.Report Public Form2crxApplication As CRAXDRT.Application Public strpubHospnum As String Public strpubIDNum As String Public PublicPCF As Double Public pstrHospitalName As String Public pstrHospitalAddress As String Public pstrHospitalCode As String Public pstrAdministrator As String Public pstrAdminTitle As String Public pstrHospitalTIN As String Public pstrHospitalTelNo As String Public pstrPHICAccountNum As String Public dblPackagePF As Double Public dblAmountPackage As Double 'Public dblTotalActualCharges As Double Public PublicORAmount As String Public PublicPackage As String Public isPublicPackage As Boolean Public isPackage As String Public PublicRB As Double Public PublicDrugs As Double Public PublicOthers As Double Public PublicOR As Double Public DoctorPF As Double Public PhysicianPF As Double Public SurgeonPF As Double Public AnesPF As Double Public ServerDate As Date Public dblCashMed As Double Public blnCashMeds As Boolean Public blnWithOperationDate As Boolean Public blnAllowUpdateSlashingCharges As Boolean Public blnAllowDistributeSlashing As Boolean Public blnAllowPrintOutDiagnosis As Boolean Public intAllowedPrintOutDiagnosis As Integer Public blnAllowTentativeTransmittal As Boolean Public blnAllowShowElapsedClaims As Boolean Public blnAllowShowRTHClaims As Boolean Public blnAllowMaximize As Boolean Public blnAllowPrintPartV As Boolean Public blnAllowUpdateDoctorPF As Boolean Public blnAllowLateSubmission As Boolean Public blnAllowTransmittalRefiled As Boolean Public blnHMOAccount As Boolean Public PubSlashingForm As String Public blnAllowSlashing As Boolean Public blnAllowSignatoryUserAccount As Boolean Public blnAllowPatientAutomaticCompute As Boolean Public blnAllowEntryAutomaticCompute As Boolean Public blnAllowBuildFileNew As Boolean Public blnAllowIndexNumber As Boolean Public blnAllowDirectAutomaticCompute As Boolean Public blnAllowDeleteTransmittal As Boolean Public blnAllowShowPerformedDate As Boolean Public blnAllowLockedFormsPrinting As Boolean Public PubFormsImplementationDate As Date Public PubACRFormsImplementationDate As Date Public PubPartIIIandIVACR As Date Public PubBenefitsImplementationDate As Date Public blnAllowSeparatePart45 As Boolean Public blnAllowEditPatientDays As Boolean Public blnAllowPart23Signatory As Boolean Public blnPart34onEntry As Boolean 'Caserate Terms Public blnisAllowCaseRateTerms As Boolean Public PubAllowCaseRateTermsImplementationDate As Date 'restrict fields on CF2 Entry Public blnisAllowFieldsCF2 As Boolean 'allow all doctors on CF2 Entry Public blnEnablePFPHICValidCF1 As Boolean 'validate 90 days Same caserate Public blnisValidate90daysCaserate As Boolean 'check PHIC admitted patients Public blnAllowShowAdmittedPHICPx As Boolean Public blnAllowShowAdmittedPHICPxImplementationDate As Date 'ECLAIMS Public blnAllowUserVerification As Boolean Public ActivatePhase1 As Boolean Public ActivatePhase1_2 As Boolean Public ActivatePhase2 As Boolean Public blnShowReport As Boolean 'ECLAIMS Public pubMemberRelationship As String Public ClientName As String Public strOptionType As String Public stridnum As String Public ActualUserID As String Private strBirthDate As String Private strAge As String Public isMaternityPackage As Boolean Public pubDcrDate As String Public pubAdmDate As Date Public pubRequireCF4StartDate As Date Public pubBenefitPackageAmt As Double Public pubNewPFPaymentEntryCutOffDate As Date Public pubIsAllowInstallmentPayment As Boolean 'Grid Table Global Const coCapitalize = 1 Global Const coNumericOnly = 2 Global strReportPath As String Global blnProceed As Boolean Public strDx1 As String Public strDx2 As String Public strDx3 As String Public strDx4 As String Public strDx5 As String Public strDx6 As String Public strDx7 As String Public strDx8 As String Public strDx9 As String Public strDx10 As String Public strDx11 As String Public strDx12 As String Public strDx13 As String Public strDx14 As String Public strDx15 As String Public strDx16 As String Public strDx17 As String Public strDx18 As String Public strDx19 As String Public strDx20 As String Public strICD1 As String Public strICD2 As String Public strICD3 As String Public strICD4 As String Public strICD5 As String Public strICD6 As String Public strICD7 As String Public strICD8 As String Public strICD9 As String Public strICD10 As String Public strICD11 As String Public strICD12 As String Public strICD13 As String Public strICD14 As String Public strICD15 As String Public strICD16 As String Public strICD17 As String Public strICD18 As String Public strICD19 As String Public strICD20 As String Public strRVSCode1 As String Public strRVSCode2 As String Public strRVSCode3 As String Public strRVSCode4 As String Public strRVSCode5 As String Public strRVSCode6 As String Public strRVSCode7 As String Public strRVSCode8 As String Public strRVSCode9 As String Public strRVSCode10 As String Public strRVSCode11 As String Public strRVSCode12 As String Public strRVSCode13 As String Public strRVSCode14 As String Public strRVSCode15 As String Public strRVSCode16 As String Public strRVSCode17 As String Public strRVSCode18 As String Public strRVSCode19 As String Public strRVSCode20 As String 'added by khing november 29, 2013 Public strLaterality1 As String Public strLaterality2 As String Public strLaterality3 As String Public strLaterality4 As String Public strLaterality5 As String Public strLaterality6 As String Public strLaterality7 As String Public strLaterality8 As String Public strLaterality9 As String Public strLaterality10 As String Public strRelatedProcedure1 As String Public strRelatedProcedure2 As String Public strRelatedProcedure3 As String Public strRelatedProcedure4 As String Public strRelatedProcedure5 As String Public strRelatedProcedure6 As String Public strRelatedProcedure7 As String Public strRelatedProcedure8 As String Public strRelatedProcedure9 As String Public strRelatedProcedure10 As String Public strICDRVS1 As String Public strICDRVS2 As String Public strICDRVS3 As String Public strICDRVS4 As String Public strICDRVS5 As String Public strICDRVS6 As String Public strICDRVS7 As String Public strICDRVS8 As String Public strICDRVS9 As String Public strICDRVS10 As String Public strDateOfOperation1 As String Public strDateOfOperation2 As String Public strDateOfOperation3 As String Public strDateOfOperation4 As String Public strDateOfOperation5 As String Public strDateOfOperation6 As String Public strDateOfOperation7 As String Public strDateOfOperation8 As String Public strDateOfOperation9 As String Public strDateOfOperation10 As String 'ISPBEF Public PubisPBEFimplementationDate As Date Public strFirstICDRVS As String Public strSecondICDRVS As String Public intDiagCount As Integer Public blnPreprinted As Boolean Private strDocID As String Public blnServicePerformed As Boolean Public strForm2RVS As String Public strForm2IllnessCOde As String '**** User Setting ****' Public blnDataEntry As Boolean Public blnAutoComputation As Boolean Public blnFeeAdjustment As Boolean Public blnPaymentEntry As Boolean Public blnStatementOfAccount As Boolean Public blnForm3 As Boolean Public blnMedicareClaim As Boolean Public blnReason As Boolean Public blnPHICReceived As Boolean Public blnForm1 As Boolean Public blnTransmittalReport As Boolean Public blnTBDotsTotalMedReceivable As Boolean Public blnTBDotsDocARIN As Boolean Public blnTBDotsDocAROut As Boolean Public blnTBDotsDocARINPerDoc As Boolean Public blnTBDotsDocAROutPerDoc As Boolean '**** Payment ****' Public blnAddPayment As Boolean Public blnEditPayment As Boolean Public blnDelPayment As Boolean Public blnDeniedPayment As Boolean Public blnActivateRefund As Boolean Public blnCreateSaveRefund As Boolean '****Medicare Recievable New format **** Public FormatType As Integer '**** PHIC Main Form ****' Public blnHemoTag As Boolean Public blnRadioTag As Boolean Public blnChemoTag As Boolean '**** END ****' '*** Declaration of New Rates ***' Public clsNewRates As New clsNewRates Public PubMaxDailyPF As Double Public PubDailyPF As Double Public PubSurgeonPFBelow500 As Double Public PubSurgeonPFUp500 As Double Public PubAnesPFBelow500 As Double Public PubAnesPFUp500 As Double '*** END ***' '*** Declaration of Employee ***' Public strEmployeeName As String Public strEmployeeCode As String '*** END ***' '*** Private Declaration ***' Dim dblHMORB As Double Dim dblHMOMeds As Double Dim dblHMOOthers As Double Dim dblHMOOR As Double Dim dblDiscountRB As Double Dim dblDiscountMeds As Double Dim dblDiscountOthers As Double Dim dblDiscountOR As Double Dim dblHMOPhysician As Double Dim dblHMOSurgeon As Double Dim dblHMOAnes As Double Dim dblDiscountPhysician As Double Dim dblDiscountSurgeon As Double Dim dblDiscountAnes As Double Dim dblTotalHMO As Double Dim dblTotalDiscount As Double '*** END ***' Global blnRecomputed As Boolean Public strCase As Integer Public Report As CRAXDRT.Report Public Enum DOCTOR_PF ACTUAL_PF = 1 MEDICARE_PF = 2 End Enum Public Sub Main() Dim blnOnLine As Boolean Dim recX As New ADODB.Recordset Set user = CreateObject("MEDSYS_User.clsCurrentUser") Set clsPatient = CreateObject("Patient.clsPatient") Set clsICD10 = CreateObject("ICD10.ICDCodeSearch") Set pclsCodeSearch = CreateObject("CodeSearchForm.clsCodeSearch") Set MEDSYSClass = CreateObject("MEDSYSClasses.clsMEDSYS") 'Set fs = CreateObject("Scripting.FileSystemObject") user.PasswordDeptCode = "8" user.ShowMain DoEvents blnOnLine = False If user.Connected Then pclsCodeSearch.SearchMode = True pclsCodeSearch.Initialize_Classes pclsCodeSearch.Connection = user.SQLConnection user.MEDSYSClasses.UseClasses = True user.MEDSYSClasses.InitWithDB MEDSYSClass.MedsysUser = user MEDSYSClass.EXEPath = App.Path frmSplash.Show frmSplash.Refresh user.SQLConnection.DefaultDatabase = "Medicare" user.SQLConnection.CommandTimeout = 120 If ConnectAll Then ' blnOnLine = True If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Select IsNull(PCF,0) [PCF] from Medicare..tbMedHospital", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then PublicPCF = Format(recX![PCF], "#########0.00") End If GetHospitalCode GetAdministrator GetServerDate HospitalInfo GetUserVerSettings ActivatePhase clsUserSetting.Initialize_MenuVisibility clsUserSetting.Load_MenuSetting clsUserSetting.Initialize_Menu clsUserSetting.Load_UserSetting frmMedicare.EnableDisableOptions 0 Load frmMedicare Unload frmSplash frmMedicare.Show Else frmSplash.cmdExit.Visible = True End If Else Exit Sub End If pubReports = App.Path + "\REPORTS" pubSubReports = App.Path + "\REPORTS\" + ClientName ' If blnOnLine Then ' ' Else ' End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Function ConnectAll() Dim blnConnected As Boolean Dim errDLL() As Variant errDLL = Array("CurrentUser", "ClassMedicare", "PRJDOCTORDLL", "PRJDOCTORLISTDLL", "ZipCodes", "ZipCodeList", "MedicareType", "PatientClass", "PRJLISTMEMBERS", "PRJLISTEMPLOYERS", "PRJMEDBUILDFILES", "RVSMedSys") On Error GoTo errtrap blnConnected = False If user.Connected Then frmSplash.pb.value = frmSplash.pb.value + 1 If Medicare.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If Doctor.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If DoctorList.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If ZipCode.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If ListZipCode.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If MedicareType.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 clsPatient.OpenConnection user.SQLConnection.ConnectionString If Not clsPatient.ActiveConnection Is Nothing Then frmSplash.pb.value = frmSplash.pb.value + 1 If MemberList.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If EmployerList.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 If BuildFiles.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 'user.sqlconnection.ConnectionString If RVS.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.value = frmSplash.pb.value + 1 'If PatientList.InitConnection(user.SQLConnection.ConnectionString) Then 'frmSplash.pb.Value = frmSpldash.pb.Value + 1 blnConnected = True 'End If End If End If End If End If End If End If End If End If End If End If End If End If ConnectAll = blnConnected Exit Function errtrap: frmSplash.pb.Visible = False frmSplash.lblLoad.Caption = errDLL(frmSplash.pb.value) & ".dll was not able to connect to server." End Function Public Sub Emphasize(msflexVar As MSHFlexGrid, lHigh As Boolean, Optional lngColor As Long = YELLOW) If msflexVar.Rows > 0 Then If lHigh Then ' msflexVar.CellBackColor = lngColor msflexVar.CellForeColor = BLACK Else ' msflexVar.CellBackColor = WHITE msflexVar.CellForeColor = BLACK End If End If End Sub Public Sub PrintGeneralInfo(Optional blnWithICD As Boolean = False, Optional HideDoctor As Boolean) Dim intctr As Integer Dim strDx As String Dim strDiag As String Dim strMembership As String Dim blnIsCashMeds As Boolean Dim strAdmDate As String Dim intPatientDays As Integer 'for direct filing NKTI Dim dblClaimRB As Double Dim dblClaimDrugs As Double Dim dblClaimOthers As Double Dim dblClaimOR As Double Dim dblClaimOutside As Double With Medicare strMembership = GetMembership(IIf(.Member.MemberType = "", 1, .Member.MemberType)) Form2Report.ParameterFields(F_ACCREDITNUM).AddCurrentValue .Hospital.AccrNumber Form2Report.ParameterFields(F_CATEGORY).AddCurrentValue .Hospital.Category Form2Report.ParameterFields(F_HOSPITAL_NAME).AddCurrentValue .Hospital.HospitalName Form2Report.ParameterFields(F_HOSPITAL_STREET).AddCurrentValue .Hospital.Street Form2Report.ParameterFields(F_HOSPITAL_BARANGAY).AddCurrentValue .Hospital.Barangay Form2Report.ParameterFields(F_HOSPITAL_MUNICIPALITY).AddCurrentValue .Hospital.Municipality Form2Report.ParameterFields(F_HOSPITAL_PROVINCE).AddCurrentValue .Hospital.Province Form2Report.ParameterFields(F_HOSPITAL_ZIPCODE).AddCurrentValue .Hospital.ZipCode Form2Report.ParameterFields(F_PATIENT_LASTNAME).AddCurrentValue Trim$(.LastName) ' + " (" + .IDNum + ")" Form2Report.ParameterFields(F_PATIENT_FIRSTNAME).AddCurrentValue .FirstName Form2Report.ParameterFields(F_PATIENT_MIDDLENAME).AddCurrentValue .MiddleName Form2Report.ParameterFields(F_SEX).AddCurrentValue .Sex stridnum = .IdNum strAdmDate = GetPatientAdmDate(stridnum) If ClientName = "MJSH" And (ServerDate < PubFormsImplementationDate Or ServerDate < PubACRFormsImplementationDate) Then blnHMOAccount = IsHMOAccount(stridnum) End If If ClientName <> "RLMC" Then Form2Report.ParameterFields(F_AGE).AddCurrentValue IIf(IIf(IsNumeric(.Age), .Age, 0) = 0, CalculateBirthday(BirthDate(.HospNum), .AdmissionDate), .Age) Else BirthDate .HospNum Form2Report.ParameterFields(F_AGE).AddCurrentValue IIf(InStr(1, .Age, "D") > 0 Or InStr(1, .Age, "M") > 0, 0, (IIf(IsNumeric(.Age), .Age, 0))) End If Form2Report.ParameterFields(F_MEMBER_LASTNAME).AddCurrentValue .Member.LastName '& " (" & strMembership & ")" Form2Report.ParameterFields(F_MEMBER_FIRSTNAME).AddCurrentValue .Member.FirstName Form2Report.ParameterFields(F_MEMBER_MIDDLENAME).AddCurrentValue .Member.MiddleName Form2Report.ParameterFields(F_MEMBER_IDNUM).AddCurrentValue .Member.MemberNumber Form2Report.ParameterFields(F_MEMBER_STREET).AddCurrentValue .Member.HouseStreet Form2Report.ParameterFields(F_MEMBER_BARANGAY).AddCurrentValue .Member.Barangay Form2Report.ParameterFields(F_MEMBER_MUNICIPALITY).AddCurrentValue .Member.Municipality Form2Report.ParameterFields(F_MEMBER_PROVINCE).AddCurrentValue .Member.Province Form2Report.ParameterFields(F_MEMBER_ZIPCODE).AddCurrentValue .Member.ZipCode If Len(.Diagnosis.AdmissionDiagnosis) > 254 Then Form2Report.ParameterFields(F_ADMISSIONDX).AddCurrentValue Left(.Diagnosis.AdmissionDiagnosis, 254) Else Form2Report.ParameterFields(F_ADMISSIONDX).AddCurrentValue .Diagnosis.AdmissionDiagnosis End If Form2Report.ParameterFields(F_DATE_ADMITTED).AddCurrentValue Format(.AdmissionDate, "mm/dd/yyyy") Form2Report.ParameterFields(F_DATE_DISCHARGED).AddCurrentValue Format(.DischargedDate, "mm/dd/yyyy") Form2Report.ParameterFields(F_TIME_ADMITTED).AddCurrentValue Format(.AdmissionDate, "hh:mm AMPM") '.AdmissionTime Form2Report.ParameterFields(F_TIME_DISCHARGED).AddCurrentValue Format(.DischargedDate, "hh:mm AMPM") '.DischargeTime If .Condition = "E" Then Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue Format(.DischargedDate, "mm/dd/yyyy") Else Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue "n/a" End If If blnCashMeds Then blnIsCashMeds = IsCashMeds(stridnum) End If If ClientName = "LMC" Or ClientName = "MEDSYS" Then If IsNumeric(Right(stridnum, 1)) Then If blnAllowEditPatientDays Then intPatientDays = GetPatientDays(stridnum) If intPatientDays > 0 Then Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Trim$(STR(intPatientDays)) Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, .DischargedDate), "#####") End If Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, .DischargedDate), "#####") End If Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue "0" End If Else If blnAllowEditPatientDays Then intPatientDays = GetPatientDays(stridnum) If intPatientDays > 0 Then Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Trim$(STR(intPatientDays)) Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, .DischargedDate), "#####") End If Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, .DischargedDate), "#####") End If End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open "Select isnull(ActualRoomBoard,0)ActualRoomBoard, isnull(ActualDrug,0) ActualDrug,isnull(ActualOthers,0) ActualOthers,isnull(ActualOR,0) ActualOR, isnull(ActualOutside,0) ActualOutside From medicare..tbmedclaim Where Idnum = '" & Trim$(stridnum) & "'", user.SQLConnection If .RecordCount > 0 Then dblClaimRB = !ActualRoomBoard dblClaimDrugs = !ActualDrug dblClaimOthers = !ActualOthers dblClaimOR = !ActualOR dblClaimOutside = !ActualOutside End If End With Set Rec = Nothing ' If ClientName <> "NKTI" Then Form2Report.ParameterFields(F_ACTUAL_RB).AddCurrentValue Format(.Charges.Claim.ActualRoomAndBoard, "###,###,##0.00") Form2Report.ParameterFields(F_ACTUAL_MEDS).AddCurrentValue Format(.Charges.Claim.ActualDrugs, "###,###,##0.00") Form2Report.ParameterFields(F_ACTUAL_OTHERS).AddCurrentValue Format(.Charges.Claim.ActualOthers, "###,###,##0.00") Form2Report.ParameterFields(F_ACTUAL_OR).AddCurrentValue Format(.Charges.Claim.ActualOR, "###,###,##0.00") Form2Report.ParameterFields(F_ACTUAL_ETC).AddCurrentValue Format(.Charges.Claim.ActualOutsideCharges, "###,###,##0.00") If isMaternityPackage And ClientName = "BOLMSH" Then Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges) - GetActualMeds(stridnum, "5"), "##,###,##0.00") Else If blnIsCashMeds And ClientName = "DDH" And strAdmDate >= PubFormsImplementationDate Then Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR), "##,###,##0.00") Else 'jeremy If ClientName = "MJSH" Or ClientName = "BIHMI" Then If GetIsBenefits(stridnum) = True Then Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges) + _ GetTotalActualPF(stridnum), "##,###,##0.00") Else Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges), "##,###,##0.00") End If ElseIf ClientName = "MGH" Then If GetIsBenefits(stridnum) = True Then Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges) + _ GetTotalActualPFNew(stridnum), "##,###,##0.00") Else Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges), "##,###,##0.00") End If Else Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ .Charges.Claim.ActualDrugs + _ .Charges.Claim.ActualOthers + _ .Charges.Claim.ActualOR + _ .Charges.Claim.ActualOutsideCharges), "##,###,##0.00") End If End If End If ' End If ' ' If ClientName = "NKTI" And (.Charges.Claim.ActualRoomAndBoard + _ ' .Charges.Claim.ActualDrugs + _ ' .Charges.Claim.ActualOthers + _ ' .Charges.Claim.ActualOR + _ ' .Charges.Claim.ActualOutsideCharges) = 0 Then ' ' Form2Report.ParameterFields(F_ACTUAL_RB).AddCurrentValue Format(dblClaimRB, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_MEDS).AddCurrentValue Format(dblClaimDrugs, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_OTHERS).AddCurrentValue Format(dblClaimOthers, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_OR).AddCurrentValue Format(dblClaimOR, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_ETC).AddCurrentValue Format(dblClaimOutside, "###,###,##0.00") ' Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((dblClaimRB + dblClaimDrugs + dblClaimOthers + dblClaimOR + dblClaimOutside), "##,###,##0.00") ' Else ' Form2Report.ParameterFields(F_ACTUAL_RB).AddCurrentValue Format(.Charges.Claim.ActualRoomAndBoard, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_MEDS).AddCurrentValue Format(.Charges.Claim.ActualDrugs, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_OTHERS).AddCurrentValue Format(.Charges.Claim.ActualOthers, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_OR).AddCurrentValue Format(.Charges.Claim.ActualOR, "###,###,##0.00") ' Form2Report.ParameterFields(F_ACTUAL_ETC).AddCurrentValue Format(.Charges.Claim.ActualOutsideCharges, "###,###,##0.00") ' Form2Report.ParameterFields(F_TOTALACTUAL).AddCurrentValue Format((.Charges.Claim.ActualRoomAndBoard + _ ' .Charges.Claim.ActualDrugs + _ ' .Charges.Claim.ActualOthers + _ ' .Charges.Claim.ActualOR + _ ' .Charges.Claim.ActualOutsideCharges), "##,###,##0.00") ' End If ' Form2Report.ParameterFields(F_MED_RB).AddCurrentValue Format(.Charges.Claim.MedicareRoomAndBoard, "##,###,##0.00") Form2Report.ParameterFields(F_MED_MEDS).AddCurrentValue Format(.Charges.Claim.MedicareDrugs, "##,###,##0.00") Form2Report.ParameterFields(F_MED_OTHERS).AddCurrentValue Format(.Charges.Claim.MedicareOthers, "##,###,##0.00") Form2Report.ParameterFields(F_MED_OR).AddCurrentValue Format(.Charges.Claim.MedicareOR, "##,###,##0.00") Form2Report.ParameterFields(F_MED_ETC).AddCurrentValue Format(.Charges.Claim.MedicareOutsideCharges, "##,###,##0.00") ' If ClientName = "MGH" Or ClientName = "VRPMC" Or ClientName = "LMC" Or ClientName = "BIHMI" Or ClientName = "SHMC" Or _ ' ClientName = "WCI" Or ClientName = "NKTI" Then If GetIsBenefits(stridnum) = True Then SearchPackageID GetPackageType(stridnum) Form2Report.ParameterFields(F_TOTALMED).AddCurrentValue Format(dblAmountPackage, "##,###,##0.00") Else Form2Report.ParameterFields(F_TOTALMED).AddCurrentValue Format((.Charges.Claim.MedicareRoomAndBoard + _ .Charges.Claim.MedicareDrugs + _ .Charges.Claim.MedicareOthers + _ .Charges.Claim.MedicareOR + _ .Charges.Claim.MedicareOutsideCharges), "##,###,##0.00") End If ' Else ' Form2Report.ParameterFields(F_TOTALMED).AddCurrentValue Format((.Charges.Claim.MedicareRoomAndBoard + _ ' .Charges.Claim.MedicareDrugs + _ ' .Charges.Claim.MedicareOthers + _ ' .Charges.Claim.MedicareOR + _ ' .Charges.Claim.MedicareOutsideCharges), "##,###,##0.00") ' End If If ClientName <> "MJSH" Then Form2Report.ParameterFields(F_PAT_RB).AddCurrentValue Format(.Charges.Claim.PatientRoomAndBoard, "##,###,##0.00") Form2Report.ParameterFields(F_PAT_MEDS).AddCurrentValue Format(.Charges.Claim.PatientDrugs, "##,###,##0.00") Form2Report.ParameterFields(F_PAT_OTHERS).AddCurrentValue Format(.Charges.Claim.PatientOthers, "##,###,##0.00") Form2Report.ParameterFields(F_PAT_OR).AddCurrentValue Format(.Charges.Claim.PatientOR, "##,###,##0.00") Form2Report.ParameterFields(F_PAT_ETC).AddCurrentValue Format(.Charges.Claim.PatientOutsideCharges, "##,###,##0.00") Form2Report.ParameterFields(F_TOTALPATIENT).AddCurrentValue Format((.Charges.Claim.PatientRoomAndBoard + _ .Charges.Claim.PatientDrugs + _ .Charges.Claim.PatientOthers + _ .Charges.Claim.PatientOR + _ .Charges.Claim.PatientOutsideCharges), "##,###,##0.00") End If dblCashMed = Format((.Charges.Claim.PatientRoomAndBoard + _ .Charges.Claim.PatientDrugs + _ .Charges.Claim.PatientOthers + _ .Charges.Claim.PatientOR + _ .Charges.Claim.PatientOutsideCharges), "##,###,##0.00") If blnAllowSignatoryUserAccount Then Form2Report.ParameterFields(F_REPRESENTATIVE).AddCurrentValue user.EmployeeName Else Form2Report.ParameterFields(F_REPRESENTATIVE).AddCurrentValue .Signatory.SignatoryName End If Form2Report.ParameterFields(F_DATE_SIGNED).AddCurrentValue Format(Date, "mm/dd/yyyy") Form2Report.ParameterFields(F_OFFICIAL_CAPACITY).AddCurrentValue .Signatory.OfficialCapacity intDiagCount = .Diagnosis.FinalDiagnosis.count strDx = "" strDx1 = "" strDx2 = "" strDx3 = "" strDx4 = "" strDx5 = "" strICD1 = "" strICD2 = "" strICD3 = "" strICD4 = "" strICD5 = "" If intDiagCount > 0 Then For intctr = 1 To .Diagnosis.FinalDiagnosis.count strDiag = .Diagnosis.FinalDiagnosis(intctr).DiagText If Len(strDiag) > 0 Then If intctr < .Diagnosis.FinalDiagnosis.count Then strDx = strDx + strDiag Else strDx = strDx + strDiag End If End If Select Case intctr Case 1 strDx1 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD1 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 2 strDx2 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD2 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 3 strDx3 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD3 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 4 strDx4 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD4 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 5 strDx5 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD5 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 6 strDx6 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD6 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 7 strDx7 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD7 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 8 strDx8 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD8 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 9 strDx9 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD9 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 10 strDx8 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD10 = .Diagnosis.FinalDiagnosis(intctr).ICDCode End Select If strAdmDate >= PubACRFormsImplementationDate Then GetDiagnosisLaterality stridnum, .Diagnosis.FinalDiagnosis(intctr).Key, intctr End If Next intctr End If 'by khing 1-2-14 If strAdmDate >= PubACRFormsImplementationDate Then GetICDRVS stridnum End If Form2Report.ParameterFields(F_FINAL_DX).AddCurrentValue Left(strDx, 250) If blnWithICD Then Form2Report.ParameterFields(F_DX1).AddCurrentValue Left$(strDx1, 255) Form2Report.ParameterFields(F_DX2).AddCurrentValue Left$(strDx2, 255) Form2Report.ParameterFields(F_DX3).AddCurrentValue Left$(strDx3, 255) Form2Report.ParameterFields(F_DX4).AddCurrentValue Left$(strDx4, 255) Form2Report.ParameterFields(F_DX5).AddCurrentValue Left$(strDx5, 255) Form2Report.ParameterFields(F_ICD1).AddCurrentValue Left$(strICD1, 255) Form2Report.ParameterFields(F_ICD2).AddCurrentValue Left$(strICD2, 255) Form2Report.ParameterFields(F_ICD3).AddCurrentValue Left$(strICD3, 255) Form2Report.ParameterFields(F_ICD4).AddCurrentValue Left$(strICD4, 255) Form2Report.ParameterFields(F_ICD5).AddCurrentValue Left$(strICD5, 255) Form2Report.ParameterFields(F_ICD6).AddCurrentValue Left$(strICD6, 255) Form2Report.ParameterFields(F_ICD7).AddCurrentValue Left$(strICD7, 255) Form2Report.ParameterFields(F_DX6).AddCurrentValue Left$(strDx6, 255) Form2Report.ParameterFields(F_DX7).AddCurrentValue Left$(strDx7, 255) Form2Report.ParameterFields(F_CASETYPE).AddCurrentValue IIf(Len(.CaseType) = 0, "O", .CaseType) If strAdmDate >= PubACRFormsImplementationDate Then Form2Report.ParameterFields(F_DX8).AddCurrentValue Left$(strDx8, 255) Form2Report.ParameterFields(F_DX9).AddCurrentValue Left$(strDx9, 255) Form2Report.ParameterFields(F_ICD8).AddCurrentValue Left$(strICD8, 255) Form2Report.ParameterFields(F_ICD9).AddCurrentValue Left$(strICD9, 255) Form2Report.ParameterFields(F_Laterality1).AddCurrentValue strLaterality1 Form2Report.ParameterFields(F_Laterality2).AddCurrentValue strLaterality2 Form2Report.ParameterFields(F_Laterality3).AddCurrentValue strLaterality3 Form2Report.ParameterFields(F_Laterality4).AddCurrentValue strLaterality4 Form2Report.ParameterFields(F_Laterality5).AddCurrentValue strLaterality5 Form2Report.ParameterFields(F_Laterality6).AddCurrentValue strLaterality6 Form2Report.ParameterFields(F_Laterality7).AddCurrentValue strLaterality7 Form2Report.ParameterFields(F_Laterality8).AddCurrentValue strLaterality8 Form2Report.ParameterFields(F_Laterality9).AddCurrentValue strLaterality9 Form2Report.ParameterFields(F_RelatedProcedure1).AddCurrentValue Left$(strRelatedProcedure1, 255) Form2Report.ParameterFields(F_RelatedProcedure2).AddCurrentValue Left$(strRelatedProcedure2, 255) Form2Report.ParameterFields(F_RelatedProcedure3).AddCurrentValue Left$(strRelatedProcedure3, 255) Form2Report.ParameterFields(F_RelatedProcedure4).AddCurrentValue Left$(strRelatedProcedure4, 255) Form2Report.ParameterFields(F_RelatedProcedure5).AddCurrentValue Left$(strRelatedProcedure5, 255) Form2Report.ParameterFields(F_RelatedProcedure6).AddCurrentValue Left$(strRelatedProcedure6, 255) Form2Report.ParameterFields(F_RelatedProcedure7).AddCurrentValue Left$(strRelatedProcedure7, 255) Form2Report.ParameterFields(F_RelatedProcedure8).AddCurrentValue Left$(strRelatedProcedure8, 255) Form2Report.ParameterFields(F_RelatedProcedure9).AddCurrentValue Left$(strRelatedProcedure9, 255) Form2Report.ParameterFields(F_RVSCode1).AddCurrentValue Left$(strICDRVS1, 255) Form2Report.ParameterFields(F_RVSCode2).AddCurrentValue Left$(strICDRVS2, 255) Form2Report.ParameterFields(F_RVSCode3).AddCurrentValue Left$(strICDRVS3, 255) Form2Report.ParameterFields(F_RVSCode4).AddCurrentValue Left$(strICDRVS4, 255) Form2Report.ParameterFields(F_RVSCode5).AddCurrentValue Left$(strICDRVS5, 255) Form2Report.ParameterFields(F_RVSCode6).AddCurrentValue Left$(strICDRVS6, 255) Form2Report.ParameterFields(F_RVSCode7).AddCurrentValue Left$(strICDRVS7, 255) Form2Report.ParameterFields(F_RVSCode8).AddCurrentValue Left$(strICDRVS8, 255) Form2Report.ParameterFields(F_RVSCode9).AddCurrentValue Left$(strICDRVS9, 255) Form2Report.ParameterFields(F_DateOfOperation1).AddCurrentValue Left$(strDateOfOperation1, 255) Form2Report.ParameterFields(F_DateOfOperation2).AddCurrentValue Left$(strDateOfOperation2, 255) Form2Report.ParameterFields(F_DateOfOperation3).AddCurrentValue Left$(strDateOfOperation3, 255) Form2Report.ParameterFields(F_DateOfOperation4).AddCurrentValue Left$(strDateOfOperation4, 255) Form2Report.ParameterFields(F_DateOfOperation5).AddCurrentValue Left$(strDateOfOperation5, 255) Form2Report.ParameterFields(F_DateOfOperation6).AddCurrentValue Left$(strDateOfOperation6, 255) Form2Report.ParameterFields(F_DateOfOperation7).AddCurrentValue Left$(strDateOfOperation7, 255) Form2Report.ParameterFields(F_DateOfOperation8).AddCurrentValue Left$(strDateOfOperation8, 255) Form2Report.ParameterFields(F_DateOfOperation9).AddCurrentValue Left$(strDateOfOperation9, 255) Form2Report.ParameterFields(F_FirstICDRVS).AddCurrentValue strFirstICDRVS Form2Report.ParameterFields(F_SecondICDRVS).AddCurrentValue strSecondICDRVS End If 'added 10.16.2007 ************** Form2Report.ParameterFields(F_AdmNumber).AddCurrentValue stridnum Form2Report.ParameterFields(F_DxCount).AddCurrentValue .Diagnosis.FinalDiagnosis.count If strAdmDate >= PubFormsImplementationDate Then Form2Report.ParameterFields(F_MedType).AddCurrentValue strMembership Else If ClientName <> "BIHMI" Then Form2Report.ParameterFields(F_MedType).AddCurrentValue strMembership End If End If 'added 03.13.2008 If blnCashMeds Then Form2Report.ParameterFields(F_CashMeds).AddCurrentValue blnIsCashMeds End If ' ****************************** GetRVSInfo (stridnum) If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_DX8).AddCurrentValue Left$(strDx8, 255) Form2Report.ParameterFields(F_DX9).AddCurrentValue Left$(strDx9, 255) Form2Report.ParameterFields(F_DX10).AddCurrentValue Left$(strDx10, 255) Form2Report.ParameterFields(F_DX11).AddCurrentValue Left$(strDx11, 255) Form2Report.ParameterFields(F_DX12).AddCurrentValue Left$(strDx12, 255) Form2Report.ParameterFields(F_DX13).AddCurrentValue Left$(strDx13, 255) Form2Report.ParameterFields(F_DX14).AddCurrentValue Left$(strDx14, 255) Form2Report.ParameterFields(F_ICD8).AddCurrentValue Left$(strICD8, 255) Form2Report.ParameterFields(F_ICD9).AddCurrentValue Left$(strICD9, 255) Form2Report.ParameterFields(F_ICD10).AddCurrentValue Left$(strICD10, 255) Form2Report.ParameterFields(F_ICD11).AddCurrentValue Left$(strICD11, 255) Form2Report.ParameterFields(F_ICD12).AddCurrentValue Left$(strICD12, 255) Form2Report.ParameterFields(F_ICD13).AddCurrentValue Left$(strICD13, 255) Form2Report.ParameterFields(F_ICD14).AddCurrentValue Left$(strICD14, 255) dblHMORB = HMOAmount(stridnum, "1") Form2Report.ParameterFields(F_HMORB).AddCurrentValue Format(dblHMORB, "##,###,##0.00") dblHMOMeds = HMOAmount(stridnum, "2") Form2Report.ParameterFields(F_HMOMeds).AddCurrentValue Format(dblHMOMeds, "##,###,##0.00") dblHMOOthers = HMOAmount(stridnum, "3") Form2Report.ParameterFields(F_HMOOthers).AddCurrentValue Format(dblHMOOthers, "##,###,##0.00") dblHMOOR = HMOAmount(stridnum, "4") Form2Report.ParameterFields(F_HMOOR).AddCurrentValue Format(dblHMOOR, "##,###,##0.00") dblTotalHMO = dblHMORB + dblHMOMeds + dblHMOOthers + dblHMOOR Form2Report.ParameterFields(F_TotalHMO).AddCurrentValue Format(dblTotalHMO, "##,###,##0.00") dblDiscountRB = DiscountAmount(stridnum, "1") Form2Report.ParameterFields(F_DisRB).AddCurrentValue Format(dblDiscountRB, "##,###,##0.00") dblDiscountMeds = DiscountAmount(stridnum, "2") Form2Report.ParameterFields(F_DisMeds).AddCurrentValue Format(dblDiscountMeds, "##,###,##0.00") dblDiscountOthers = DiscountAmount(stridnum, "3") Form2Report.ParameterFields(F_DisOthers).AddCurrentValue Format(dblDiscountOthers, "##,###,##0.00") dblDiscountOR = DiscountAmount(stridnum, "4") Form2Report.ParameterFields(F_DisOR).AddCurrentValue Format(dblDiscountOR, "##,###,##0.00") dblTotalDiscount = dblDiscountRB + dblDiscountMeds + dblDiscountOthers + dblDiscountOR Form2Report.ParameterFields(F_TotalDiscount).AddCurrentValue Format(dblTotalDiscount, "##,###,##0.00") Form2Report.ParameterFields(F_PAT_RB).AddCurrentValue Format(.Charges.Claim.PatientRoomAndBoard - (dblHMORB + dblDiscountRB), "##,###,##0.00") Form2Report.ParameterFields(F_PAT_MEDS).AddCurrentValue Format(.Charges.Claim.PatientDrugs - (dblHMOMeds + dblDiscountMeds), "##,###,##0.00") Form2Report.ParameterFields(F_PAT_OTHERS).AddCurrentValue Format(.Charges.Claim.PatientOthers - (dblHMOOthers + dblDiscountOthers), "##,###,##0.00") Form2Report.ParameterFields(F_PAT_OR).AddCurrentValue Format(.Charges.Claim.PatientOR - (dblHMOOR + dblDiscountOR), "##,###,##0.00") Form2Report.ParameterFields(F_PAT_ETC).AddCurrentValue Format(.Charges.Claim.PatientOutsideCharges, "##,###,##0.00") Form2Report.ParameterFields(F_TOTALPATIENT).AddCurrentValue Format((.Charges.Claim.PatientRoomAndBoard + _ .Charges.Claim.PatientDrugs + _ .Charges.Claim.PatientOthers + _ .Charges.Claim.PatientOR + _ .Charges.Claim.PatientOutsideCharges) - (dblTotalHMO + dblTotalDiscount), "##,###,##0.00") Else Form2Report.ParameterFields(F_RVS).AddCurrentValue strForm2RVS Form2Report.ParameterFields(F_IllnessCode).AddCurrentValue strForm2IllnessCOde Form2Report.ParameterFields(F_Initial).AddCurrentValue Trim$(EmployeeInitial) 'F_BirthDate Form2Report.ParameterFields(F_BirthDate).AddCurrentValue Trim$(strBirthDate) If ClientName = "MJSH" Or ClientName = "NDCH" Then If strAdmDate >= PubFormsImplementationDate Then Form2Report.ParameterFields(F_IsBenefits).AddCurrentValue GetIsBenefits(stridnum) SearchPackageID GetPackageType(stridnum) If GetIsBenefits(stridnum) = True Then Form2Report.ParameterFields(F_PF).AddCurrentValue Format(dblPackagePF, "##,###,##0.00") Else Form2Report.ParameterFields(F_PF).AddCurrentValue Format(0, "##,###,##0.00") End If Form2Report.ParameterFields(F_Initial).AddCurrentValue Trim$(GetRoomClass(stridnum)) End If Else If strAdmDate >= PubFormsImplementationDate Then If ClientName = "NKTI" Then Form2Report.ParameterFields(F_PayService).AddCurrentValue PayService Form2Report.ParameterFields(F_DocChief).AddCurrentValue DocChief Form2Report.ParameterFields(F_IsHemoPatient).AddCurrentValue isHemo(Medicare.IdNum) Form2Report.ParameterFields(F_BloodComponent).AddCurrentValue HasBC(Medicare.IdNum) Form2Report.ParameterFields(F_ER).AddCurrentValue isER(Medicare.IdNum) Form2Report.ParameterFields(F_PACKAGENAME).AddCurrentValue GetPackageName(Medicare.IdNum) Form2Report.ParameterFields(F_ENDOSCOPY).AddCurrentValue isEndoscopy(Medicare.IdNum) Form2Report.ParameterFields(F_PURCHASEDATE).AddCurrentValue PurchaseDate '(Medicare.IdNum) Form2Report.ParameterFields(F_HDOCTOR).AddCurrentValue HideDoctor '(Medicare.IdNum) Form2Report.ParameterFields(F_SESSION).AddCurrentValue GetSession(Medicare.IdNum) Form2Report.ParameterFields(F_BAG).AddCurrentValue GetBagCount(Medicare.IdNum) End If Form2Report.ParameterFields(F_IsBenefits).AddCurrentValue GetIsBenefits(stridnum) Form2Report.ParameterFields(F_Initial).AddCurrentValue Trim$(GetRoomClass(stridnum)) End If End If End If End If End With End Sub 'added by khing november 28, 2013 Public Function GetDiagnosisLaterality(stridnum As String, DiagID As String, intctr As Integer) As String Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select isnull(Laterality,'') Laterality, isnull(RelatedOperation,'') RelatedOperation, " _ & " isnull(DateOfOperation,'') DateOfOperation, isnull(RVSCode,'') RVSCode from Medicare..tbMedDiagnosis " _ & " where IDNum = '" & Trim$(stridnum) & "' and DiagID = '" & DiagID & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If Not .EOF Then Select Case intctr Case 1 strLaterality1 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure1 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS1 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation1 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 2 strLaterality2 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure2 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS2 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation2 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 3 strLaterality3 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure3 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS3 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation3 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 4 strLaterality4 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure4 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS4 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation4 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 5 strLaterality5 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure5 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS5 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation5 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 6 strLaterality6 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure6 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS6 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation6 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 7 strLaterality7 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure7 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS7 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation7 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 8 strLaterality8 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure8 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS8 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation8 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 9 strLaterality9 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure9 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS9 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation9 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 10 strLaterality10 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure10 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS10 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation10 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) End Select End If .Close End With Set Rec = Nothing End Function 'added by khing january 2, 2014 Public Function GetICDRVS(stridnum As String) As String Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select isnull(FirstICDRVS,'') FirstICDRVS, isnull(SecondICDRVS,'') SecondICDRVS " _ & " from Medicare..tbMedPatient where IDNum = '" & Trim$(stridnum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If Not .EOF Then strFirstICDRVS = IIf(IsNull(!FirstICDRVS), "", !FirstICDRVS) strSecondICDRVS = IIf(IsNull(!SecondICDRVS), "", !SecondICDRVS) End If .Close End With Set Rec = Nothing End Function Private Sub SearchPackageID(strPackageID As String) Dim SQL As String SQL = "Select Amount, PF From medicare..tbMedPackage Where Status = 1 And PackageID = '" & Trim$(strPackageID) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then dblPackagePF = !PF dblAmountPackage = !Amount & "" End If End With Set Rec = Nothing End Sub Public Function dblSeniorDiscount(stridnum As String) As Double Dim strQ As String Dim Rec As New ADODB.Recordset dblSeniorDiscount = 0 If IsNumeric(Right(stridnum, 1)) = True Then strQ = "select abs(isnull(amount,0)) Amount from billing..tbbilldailybill where idnum = '" & stridnum & "' and revenueid = 'CF'" Else strQ = "select abs(isnull(amount,0)) Amount from billing..tbbillopdailyout where idnum = '" & stridnum & "' and revenueid = 'CF'" End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open strQ, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then dblSeniorDiscount = !Amount End If End With Set Rec = Nothing End Function ' 'Public Function GetTotalPaymentPF(strIdNum As String) As Currency ' Dim SQL As String ' ' GetTotalPaymentPF = 0 ' SQL = "Select Cast(Sum(IsNull(Payment,0)) as money) [Payment] From tbMedDoctors Where Idnum = '" & Trim$(strIdNum) & "'" ' ' With Rec ' If .State > 0 Then .Close ' .CursorLocation = adUseClient ' .CursorType = adOpenDynamic ' .LockType = adLockOptimistic ' .Open SQL, user.sqlconnection ' ' If .RecordCount > 0 Then ' GetTotalPaymentPF = !Payment ' End If ' End With ' Set Rec = Nothing ' 'End Function 'Public Function GetTotalMedPF(strIdNum As String) As Currency ' Dim SQL As String ' ' GetTotalMedPF = 0 ' SQL = "Select Cast(Sum(IsNull(MedicarePF,0)) as money) [PF] From tbMedDoctors Where Idnum = '" & Trim$(strIdNum) & "'" ' ' With Rec ' If .State > 0 Then .Close ' .CursorLocation = adUseClient ' .CursorType = adOpenDynamic ' .LockType = adLockOptimistic ' .Open SQL, user.sqlconnection ' ' If .RecordCount > 0 Then ' GetTotalMedPF = !PF ' End If ' End With ' Set Rec = Nothing ' 'End Function Public Function GetTotalActualPF(stridnum As String) As Double Dim SQL As String GetTotalActualPF = 0 SQL = "Select Cast(Sum(IsNull(ActualPF,0)) as money) [PF] From tbMedDoctors Where Idnum = '" & Trim$(stridnum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetTotalActualPF = !PF End If End With Set Rec = Nothing End Function Private Function GetTotalActualPFNew(stridnum As String) As Double Dim SQL As String GetTotalActualPFNew = 0 If IsNumeric(Right(stridnum, 1)) Then SQL = "Select (Select Sum(A.ActualPF)[Amount] from Medicare..tbMedDoctors A Where A.idnum = '" & _ Trim$(stridnum) & "') + (Select Sum(Amount) [Amount] from Billing..tbBillDailyBill Where RevenueID = 'MD' and IdNum = '" & Trim$(stridnum) & "')as PF" Else SQL = "Select (Select Sum(A.ActualPF)[Amount] from Medicare..tbMedDoctors A Where A.idnum = '" & _ Trim$(stridnum) & "') + (Select Sum(Amount) [Amount] from Billing..tbBillOPDailyOut Where RevenueID = 'MD' and IdNum = '" & Trim$(stridnum) & "')as PF" End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetTotalActualPFNew = !PF End If End With Set Rec = Nothing End Function 'Private Sub SearchPackagePF(strPackageID As String) ' Dim SQL As String ' ' SQL = "Select Amount, PF From tbMedPackage Where Status = 1 And PackageID = '" & Trim$(strPackageID) & "'" ' ' With Rec ' If .State > 0 Then .Close ' .CursorLocation = adUseClient ' .CursorType = adOpenDynamic ' .LockType = adLockOptimistic ' .Open SQL, user.sqlconnection ' ' If .RecordCount > 0 Then ' dblAmountPackage = !Amount ' dblPackagePF = !PF ' End If ' End With ' Set Rec = Nothing 'End Sub Public Sub PrintPhysician(intcount As Integer) Dim dblPatient As Double Dim strAdmDate As String Dim strPerformedDate As String blnServicePerformed = False With Medicare strAdmDate = GetPatientAdmDate(Trim$(.IdNum)) If intcount <= .Doctors.Physician.count Then If Len(.Doctors.Physician(intcount).DocCode) > 0 And .Doctors.Physician(intcount).DocCode <> "36M" And .Doctors.Physician(intcount).DocCode <> "37M" Then DoctorPF = 0 AnesPF = 0 SurgeonPF = 0 PhysicianPF = 0 GetDoctorPF .Doctors.Physician(intcount).DocCode, "P" Form2Report.ParameterFields(F_PHYS_NAME).AddCurrentValue .Doctors.Physician(intcount).DocName Form2Report.ParameterFields(F_PHYS_PHIC).AddCurrentValue .Doctors.Physician(intcount).PHICNumber Form2Report.ParameterFields(F_PHYS_TIN).AddCurrentValue .Doctors.Physician(intcount).TinNumber If ClientName = "DDH" Then If Len(Trim$(.Doctors.Physician(intcount).ServicePerformed)) > 137 Or _ (Len(Trim$(.Doctors.Physician(intcount).ServicePerformed)) > 110 And strAdmDate >= PubFormsImplementationDate) Then blnServicePerformed = True Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "SEE ATTACHED" Else Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue .Doctors.Physician(intcount).ServicePerformed End If Else Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue .Doctors.Physician(intcount).ServicePerformed End If Form2Report.ParameterFields(F_PHYS_ACTUAL).AddCurrentValue Format(.Doctors.Physician(intcount).ActualPF, "##,###,##0.00") Form2Report.ParameterFields(F_PHYS_MED).AddCurrentValue Format(.Doctors.Physician(intcount).MedicarePF, "##,###,##0.00") If (strAdmDate >= PubFormsImplementationDate Or strAdmDate >= PubACRFormsImplementationDate) And ClientName = "DDH" Then clsPhysician.IdNum = stridnum If clsPhysician.LoadPhysicianInfo Then strPerformedDate = Format(clsPhysician.DatePeformed(intcount), "MM/dd/yyyy") If strPerformedDate <> "01/01/1900" And CDate(strPerformedDate) > CDate("01/01/1900") Then Form2Report.ParameterFields(F_PHYS_PERFORMEDDATE).AddCurrentValue Format(clsPhysician.DatePeformed(intcount), "MM/dd/yyyy") Else Form2Report.ParameterFields(F_PHYS_PERFORMEDDATE).AddCurrentValue "n/a" End If Else Form2Report.ParameterFields(F_PHYS_PERFORMEDDATE).AddCurrentValue "n/a" End If End If If ClientName = "MJSH" And (strAdmDate < PubFormsImplementationDate Or strAdmDate < PubACRFormsImplementationDate) Then dblHMOPhysician = HMOPFAmount(stridnum, .Doctors.Physician(intcount).DocCode) dblDiscountPhysician = DiscountPFAmount(stridnum, .Doctors.Physician(intcount).DocCode) dblPatient = .Doctors.Physician(intcount).ActualPF - (dblHMOPhysician + dblDiscountPhysician + .Doctors.Physician(intcount).MedicarePF) If dblPatient = 0 Then Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") Else If blnHMOAccount Then Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(HMO)" Else Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(Promisory Note)" End If End If Form2Report.ParameterFields(F_PHYS_HMO).AddCurrentValue Format(dblHMOPhysician, "##,###,##0.00") Form2Report.ParameterFields(F_PHYS_Discount).AddCurrentValue Format(dblDiscountPhysician, "##,###,##0.00") Else Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue Format(.Doctors.Physician(intcount).PatientPF, "##,###,##0.00") End If If ClientName = "LMC" Or ClientName = "MEDSYS" Then If intcount > 2 Then Form2Report.ParameterFields(F_PhysicianService).AddCurrentValue "Referral Date" Else Form2Report.ParameterFields(F_PhysicianService).AddCurrentValue "Medical Fee" End If End If Else Form2Report.ParameterFields(F_PHYS_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue "n/a" If strAdmDate >= PubFormsImplementationDate And ClientName = "DDH" Then Form2Report.ParameterFields(F_PHYS_PERFORMEDDATE).AddCurrentValue "n/a" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_PHYS_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_PHYS_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If Else DoctorPF = 0 AnesPF = IIf(intcount <= .Doctors.Anesthesiologist.count, AnesPF, 0) SurgeonPF = IIf(intcount <= .Doctors.Surgeon.count, SurgeonPF, 0) PhysicianPF = IIf(intcount <= .Doctors.Physician.count, PhysicianPF, 0) Form2Report.ParameterFields(F_PHYS_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue "n/a" If strAdmDate >= PubFormsImplementationDate And ClientName = "DDH" Then Form2Report.ParameterFields(F_PHYS_PERFORMEDDATE).AddCurrentValue "n/a" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_PHYS_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_PHYS_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If End With End Sub Public Sub PrintSurgeon(intcount As Integer) Dim dblPatient As Double Dim strAdmDate As String Dim strPerformedDate As String With Medicare strAdmDate = GetPatientAdmDate(Trim$(.IdNum)) If intcount <= .Doctors.Surgeon.count Then If Len(.Doctors.Surgeon(intcount).DocCode) > 0 And .Doctors.Surgeon(intcount).DocCode <> "36M" And .Doctors.Surgeon(intcount).DocCode <> "37M" Then SurgeonPF = 0 GetDoctorPF .Doctors.Surgeon(intcount).DocCode, "S" Form2Report.ParameterFields(F_SURG_NAME).AddCurrentValue .Doctors.Surgeon(intcount).DocName Form2Report.ParameterFields(F_SURG_PHIC).AddCurrentValue .Doctors.Surgeon(intcount).PHICNumber Form2Report.ParameterFields(F_SURG_TIN).AddCurrentValue .Doctors.Surgeon(intcount).TinNumber If ClientName = "DDH" Then If Len(Trim$(.Doctors.Surgeon(intcount).ServicePerformed)) > 137 Or _ (Len(Trim$(.Doctors.Surgeon(intcount).ServicePerformed)) > 110 And strAdmDate >= PubFormsImplementationDate) Then blnServicePerformed = True Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue "SEE ATTACHED" Else Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue .Doctors.Surgeon(intcount).ServicePerformed End If Else Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue .Doctors.Surgeon(intcount).ServicePerformed End If Form2Report.ParameterFields(F_SURG_ACTUAL).AddCurrentValue Format(.Doctors.Surgeon(intcount).ActualPF, "##,###,##0.00") Form2Report.ParameterFields(F_SURG_MED).AddCurrentValue Format(.Doctors.Surgeon(intcount).MedicarePF, "##,###,##0.00") 'Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue Format(.Doctors.Surgeon(intCount).PatientPF, "##,###,##0.00") strPerformedDate = Format(.Doctors.Surgeon(intcount).DatePeformed, "MM/dd/yyyy") If strPerformedDate <> "01/01/1900" And CDate(strPerformedDate) > CDate("01/01/1900") Then Form2Report.ParameterFields(F_SURG_PERFORMEDDATE).AddCurrentValue Format(.Doctors.Surgeon(intcount).DatePeformed, "MM/dd/yyyy") Else Form2Report.ParameterFields(F_SURG_PERFORMEDDATE).AddCurrentValue "n/a" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then dblHMOSurgeon = HMOPFAmount(stridnum, .Doctors.Surgeon(intcount).DocCode) dblDiscountSurgeon = DiscountPFAmount(stridnum, .Doctors.Surgeon(intcount).DocCode) dblPatient = .Doctors.Surgeon(intcount).ActualPF - (.Doctors.Surgeon(intcount).MedicarePF + dblHMOSurgeon + dblDiscountSurgeon) If dblPatient = 0 Then Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") Else If blnHMOAccount Then Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(HMO)" Else Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(Promisory Note)" End If End If Form2Report.ParameterFields(F_SURG_HMO).AddCurrentValue Format(dblHMOSurgeon, "##,###,##0.00") Form2Report.ParameterFields(F_SURG_Discount).AddCurrentValue Format(dblDiscountSurgeon, "##,###,##0.00") Else Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue Format(.Doctors.Surgeon(intcount).PatientPF, "##,###,##0.00") End If If ClientName <> "DDH" Then Form2Report.ParameterFields(F_ProcedureDate).AddCurrentValue IIf(blnAllowShowPerformedDate, Format(.Doctors.Surgeon(intcount).DatePerformed, "mm/dd/yyyy"), _ GetOperationDate(.IdNum, .Doctors.Surgeon(intcount).DocCode)) End If Else Form2Report.ParameterFields(F_SURG_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PERFORMEDDATE).AddCurrentValue "n/a" If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_SURG_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_SURG_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If Else AnesPF = IIf(intcount <= .Doctors.Anesthesiologist.count, AnesPF, 0) SurgeonPF = IIf(intcount <= .Doctors.Surgeon.count, SurgeonPF, 0) PhysicianPF = IIf(intcount <= .Doctors.Physician.count, PhysicianPF, 0) Form2Report.ParameterFields(F_SURG_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_SURG_PERFORMEDDATE).AddCurrentValue "n/a" If blnWithOperationDate Then Form2Report.ParameterFields(F_ProcedureDate).AddCurrentValue "" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_SURG_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_SURG_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If End With End Sub Public Sub PrintAnesthesiologist(intcount As Integer) Dim dblPatient As Double Dim strAdmDate As String Dim strPerformedDate As String With Medicare strAdmDate = GetPatientAdmDate(Trim$(.IdNum)) If intcount <= .Doctors.Anesthesiologist.count Then If Len(.Doctors.Anesthesiologist(intcount).DocCode) > 0 And .Doctors.Anesthesiologist(intcount).DocCode <> "36M" And .Doctors.Anesthesiologist(intcount).DocCode <> "37M" Then AnesPF = 0 GetDoctorPF .Doctors.Anesthesiologist(intcount).DocCode, "A" Form2Report.ParameterFields(F_ANES_NAME).AddCurrentValue .Doctors.Anesthesiologist(intcount).DocName Form2Report.ParameterFields(F_ANES_PHIC).AddCurrentValue .Doctors.Anesthesiologist(intcount).PHICNumber Form2Report.ParameterFields(F_ANES_TIN).AddCurrentValue .Doctors.Anesthesiologist(intcount).TinNumber If ClientName = "DDH" Then If Len(Trim$(.Doctors.Anesthesiologist(intcount).ServicePerformed)) > 137 Or _ (Len(Trim$(.Doctors.Anesthesiologist(intcount).ServicePerformed)) > 110 And strAdmDate >= PubFormsImplementationDate) Then blnServicePerformed = True Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue "SEE ATTACHED" Else Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue .Doctors.Anesthesiologist(intcount).ServicePerformed End If Else Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue .Doctors.Anesthesiologist(intcount).ServicePerformed End If Form2Report.ParameterFields(F_ANES_ACTUAL).AddCurrentValue Format(.Doctors.Anesthesiologist(intcount).ActualPF, "##,###,##0.00") Form2Report.ParameterFields(F_ANES_MED).AddCurrentValue Format(.Doctors.Anesthesiologist(intcount).MedicarePF, "##,###,##0.00") 'Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue Format(.Doctors.Anesthesiologist(intCount).PatientPF, "##,###,##0.00") clsAnesthesiologist.IdNum = stridnum If clsAnesthesiologist.LoadAnesInfo Then strPerformedDate = Format(clsAnesthesiologist.DatePeformed(intcount), "MM/dd/yyyy") Else strPerformedDate = Format(.Doctors.Surgeon(intcount).DatePeformed, "MM/dd/yyyy") End If If strPerformedDate <> "01/01/1900" And CDate(strPerformedDate) > CDate("01/01/1900") Then Form2Report.ParameterFields(F_ANES_PERFORMEDDATE).AddCurrentValue strPerformedDate Else Form2Report.ParameterFields(F_ANES_PERFORMEDDATE).AddCurrentValue "n/a" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then dblHMOAnes = HMOPFAmount(stridnum, .Doctors.Anesthesiologist(intcount).DocCode) dblDiscountAnes = DiscountPFAmount(stridnum, .Doctors.Anesthesiologist(intcount).DocCode) dblPatient = .Doctors.Anesthesiologist(intcount).ActualPF - (.Doctors.Anesthesiologist(intcount).MedicarePF + dblHMOAnes + dblDiscountAnes) If dblPatient = 0 Then Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") Else If blnHMOAccount Then Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(HMO)" Else Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue Format(dblPatient, "##,###,##0.00") '& "(Promisory Note)" End If End If Form2Report.ParameterFields(F_ANES_HMO).AddCurrentValue Format(dblHMOAnes, "##,###,##0.00") Form2Report.ParameterFields(F_ANES_Discount).AddCurrentValue Format(dblDiscountAnes, "##,###,##0.00") Else Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue Format(.Doctors.Anesthesiologist(intcount).PatientPF, "##,###,##0.00") End If Else Form2Report.ParameterFields(F_ANES_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PERFORMEDDATE).AddCurrentValue "n/a" If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_ANES_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_ANES_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If Else AnesPF = IIf(intcount <= .Doctors.Anesthesiologist.count, AnesPF, 0) SurgeonPF = IIf(intcount <= .Doctors.Surgeon.count, SurgeonPF, 0) PhysicianPF = IIf(intcount <= .Doctors.Physician.count, PhysicianPF, 0) Form2Report.ParameterFields(F_ANES_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_TIN).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_ANES_PERFORMEDDATE).AddCurrentValue "n/a" If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_ANES_HMO).AddCurrentValue Format(0, "##,###,##0.00") Form2Report.ParameterFields(F_ANES_Discount).AddCurrentValue Format(0, "##,###,##0.00") End If End If End With End Sub Public Function Exist(strReportName As String) As Boolean Set Form2crxApplication = New CRAXDRT.Application On Error GoTo FileExists_Error Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\custom\" + strReportName) Exist = True Exit Function FileExists_Error: Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\" + strReportName) Exist = False End Function Public Sub PrintForm2(stridnum As String, Optional intOption As Integer = 1, Optional HideDoctor As Boolean = False) Dim intFormCount As Integer Dim blnWithICD As Boolean Dim strActualUserID As String Dim strAdmDate As String Dim strTrackingNum As String Dim PrintTracking As Boolean Dim intcount As Integer Dim intFormNumber As Integer intFormCount = 0 intFormNumber = 1 If Medicare.Search(stridnum) Then strAdmDate = GetPatientAdmDate(stridnum) If strAdmDate < PubACRFormsImplementationDate Then With Medicare If intFormCount < .Doctors.Physician.count Then intFormCount = .Doctors.Physician.count strDocID = .Doctors.Physician(1).DocCode End If If intFormCount < .Doctors.Surgeon.count Then intFormCount = .Doctors.Surgeon.count End If If intFormCount < .Doctors.Anesthesiologist.count Then intFormCount = .Doctors.Anesthesiologist.count End If End With End If 'count for new page If strAdmDate >= PubACRFormsImplementationDate Then intFormNumber = countDiag(stridnum) End If If intFormCount <= 1 Then For intcount = 1 To intFormNumber Set Form2crxApplication = New CRAXDRT.Application Select Case intOption Case 1 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaim.rpt") Case 2 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaim_Old.rpt") Case 3 If ServerDate >= PubFormsImplementationDate Then If strAdmDate >= PubACRFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2ACR.rpt") ElseIf strAdmDate >= PubFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICD.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICD.rpt") End If Case 4 If ServerDate >= PubFormsImplementationDate Then If strAdmDate >= PubFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_Preprinted.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICD_PrePrinted.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICD_PrePrinted.rpt") End If Case 5 If ServerDate >= PubFormsImplementationDate Then If strAdmDate >= PubACRFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2ACR.rpt") ElseIf strAdmDate >= PubFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimMaternity.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimMaternity.rpt") End If Case 6 If ServerDate >= PubFormsImplementationDate Then If strAdmDate >= PubFormsImplementationDate Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_Preprinted.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimMaternity_Preprinted.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimMaternity_Preprinted.rpt") End If Case 7 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimTBDots.rpt") Case 8 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimTBDotsPreprinted.rpt") Case 9 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_Preprinted_2.rpt") Case 10 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_2.rpt") Case 11 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_Preprinted_3.rpt") Case 12 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_3.rpt") Case 13 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2ACR_2018Rev.rpt") End Select If intOption = 3 Or intOption = 4 Or intOption = 5 Or intOption = 6 Or intOption = 7 Or intOption = 8 Or intOption = 13 Then blnWithICD = True Else blnWithICD = False End If PrintPhysician 1 PrintSurgeon 1 PrintAnesthesiologist 1 If strAdmDate >= PubACRFormsImplementationDate Then 'khing 11.27.13 CF2_ACR Printing PrintConfinementInfo stridnum ElseIf strAdmDate >= PubFormsImplementationDate Then PrintCardiologist 1, stridnum If intOption = 5 Or intOption = 6 Then Form2Report.ParameterFields(F_IsBenefits).AddCurrentValue True End If ' If ClientName = "NKTI" Then ' Form2Report.ParameterFields(F_PayService).AddCurrentValue PayService ' Form2Report.ParameterFields(F_DocChief).AddCurrentValue DocChief ' Form2Report.ParameterFields(F_IsHemoPatient).AddCurrentValue IsHemo(Medicare.IdNum) ' End If 'If ClientName = "LMC" Or ClientName = "NDCH" Or ClientName = "SHMC" Then ' Form2Report.ParameterFields(F_TrackingNumber).AddCurrentValue GetTrackingNumber(strIdNum) strTrackingNum = GetTrackingNumber(stridnum) Form2Report.ParameterFields(F_TrackingNumber).AddCurrentValue "š" + strTrackingNum & getCheckDigit(strTrackingNum) & "œ" PrintTracking = Val(GetSetting("MEDSYS", "MEDICARE", "printTrackingNumberForm2")) ' If PrintTracking = True Then ' Assign Options Dim iX As Integer For iX = 1 To Form2Report.FormulaFields.count If Form2Report.FormulaFields.Item(iX).Name = "{@Options}" Then Form2Report.FormulaFields.Item(iX).Text = "BooleanVar ShowTrackingNumber:= " & PrintTracking & " as boolean" Exit For End If Next ' Assign Record Selection Formula ' End If If blnPreprinted = False Then If PrintTracking = True Then Form2Report.FormulaFields.Item(iX).Text = "BooleanVar ShowTrackingNumber:=true" Else Form2Report.FormulaFields.Item(iX).Text = "BooleanVar ShowTrackingNumber:=false" End If End If 'End If End If PrintGeneralInfo blnWithICD, HideDoctor If intOption = 5 Or intOption = 6 Then Form2Report.ParameterFields(F_IndexNumber).AddCurrentValue "" End If If intOption = 4 Or intOption = 3 Or intOption = 13 Then If isPaidtoBill(stridnum) Then If MsgBox("Is it Hospital Claim?", vbYesNo) = vbYes Then Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "Y" strOptionType = "Y" Else Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "N" strOptionType = "N" End If Else If strOptionType = "Y" Then Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "Y" Else Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "N" End If End If End If If Not ClientName Like "[DDH, MJSH, LMC]" Then Form2Report.ParameterFields(F_DocBatchNew).AddCurrentValue "1" End If If ClientName = "MJSH" And strAdmDate < PubFormsImplementationDate Then Form2Report.ParameterFields(F_DocBatch).AddCurrentValue "1" Form2Report.ParameterFields(F_DiagBatch).AddCurrentValue "1" End If If strAdmDate >= PubACRFormsImplementationDate Then Form2Report.ParameterFields(F_PageCount).SetCurrentValue CStr(intcount) End If frmViewForm2.WhatReport = 1 frmViewForm2.IdNum = stridnum frmViewForm2.Index = intcount frmViewForm2.Show vbModal Next intcount If blnPart34onEntry Then If strAdmDate >= PubACRFormsImplementationDate Then frmEntryACR.cmdCancel_Click frmMedicare.mnuACRFormat_Click End If End If 'Start If strAdmDate < PubACRFormsImplementationDate Then If blnAllowSeparatePart45 Then PrintBlankForm2 5 End If End If If blnAllowPrintPartV And strAdmDate < PubFormsImplementationDate Then If ClientName <> "BIHMI" Then If blnPreprinted = True Then frmView.MedicType = "1" Else If IsNumeric(Right(stridnum, 1)) Then frmView.MedicType = "2" Else If MsgBox("Do you want Preprinted Part 5?", vbYesNo) = vbYes Then frmView.MedicType = "4" Else frmView.MedicType = "2" End If End If End If frmView.Title = strOptionType frmView.IdNum = stridnum frmView.TotalPF = DoctorPF frmView.TotalDeduction = dblCashMed frmView.WhatReport = 37 frmView.Show vbModal End If End If Screen.MousePointer = vbDefault If strAdmDate < PubACRFormsImplementationDate Then If blnAllowPrintOutDiagnosis Then If intDiagCount > intAllowedPrintOutDiagnosis Then frmView.IdNum = stridnum frmView.WhatReport = 45 frmView.Show vbModal End If End If End If If CheckHemoChemoDischarges(stridnum) Then frmView.IdNum = stridnum frmView.StartDate = GetAdmDate(stridnum) frmView.EndDate = GetDcrDate(stridnum) frmView.WhatReport = 48 frmView.Show vbModal End If If blnServicePerformed And ClientName = "DDH" Then frmView.IdNum = stridnum frmView.WhatReport = 56 frmView.Show vbModal End If If ClientName = "MJSH" Then If intDiagCount > intAllowedPrintOutDiagnosis And strAdmDate < PubFormsImplementationDate Then Set Form2Report = Nothing Set Form2crxApplication = Nothing Set Form2crxApplication = New CRAXDRT.Application Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICD.rpt") PrintPhysician 1 PrintSurgeon 1 PrintAnesthesiologist 1 PrintGeneralInfo True, HideDoctor Form2Report.ParameterFields(F_IndexNumber).AddCurrentValue "" If isPaidtoBill(stridnum) Then If MsgBox("Is it Hospital Claim?", vbYesNo) = vbYes Then Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "Y" strOptionType = "Y" Else Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "N" strOptionType = "N" End If Else If strOptionType = "Y" Then Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "Y" Else Form2Report.ParameterFields(F_ConstHospPatient).AddCurrentValue "N" End If End If Form2Report.ParameterFields(F_DocBatch).AddCurrentValue "1" Form2Report.ParameterFields(F_DiagBatch).AddCurrentValue "2" frmViewForm2.WhatReport = 1 frmViewForm2.Show vbModal End If strActualUserID = GetActualUserID(stridnum) user.SQLConnection.Execute "Medicare..Medic_CreateTempTable '" & Trim$(stridnum) & "','" & Trim$(strActualUserID) & "'" If IsNumeric(Right(stridnum, 1)) Then user.SQLConnection.Execute "Medicare..Medic_AutoComputeCharges '" & Trim$(stridnum) & "','" & Trim$(strActualUserID) & "'" Else user.SQLConnection.Execute "Medicare..Medic_AutoComputeChargesOP '" & Trim$(stridnum) & "','" & Trim$(strActualUserID) & "'" End If user.SQLConnection.Execute "Update Medicare..tbMedActual set CountPrinting = IsNull(CountPrinting,0) + 1 where IDNum = '" & Trim$(stridnum) & "'" frmView.PatientName = GetPatientName(stridnum) frmView.TotalDeduction = "" frmView.TotalPF = "" frmView.UserID = Trim$(strActualUserID) frmView.IdNum = stridnum If GetPackageType(stridnum) = "4" Then frmView.WhatReport = 2 frmView.ReportType = 1 Else frmView.WhatReport = 61 End If 'jeremy' 'blnPrint = True frmView.Show vbModal End If 'End Else Screen.MousePointer = vbDefault If intOption = 6 Then frmForm2.Preprinted = True Else frmForm2.Preprinted = False End If If HideDoctor = True Then frmForm2.HideDoctor = True Else frmForm2.HideDoctor = False End If frmForm2.FormCount = intFormCount frmForm2.Show vbModal End If End If End Sub Public Sub PrintBlankForm2(Optional intOptiona As Integer = 1) Set Form2crxApplication = New CRAXDRT.Application Select Case intOptiona Case 1 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\BlankForm2.rpt") Case 2 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimWithICDBlank.rpt") Case 3 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\BlankForm4.rpt") Case 4 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\Part4And5.rpt") Case 5 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\ClaimNewPart4.rpt") End Select If intOptiona = 4 Or intOptiona = 5 Then PrintSignatoryForBlank Else PrintGenInfoForBlank End If frmViewForm2.WhatReport = 2 frmViewForm2.Form2Type = 2 frmViewForm2.Show vbModal End Sub Public Sub PrintGenInfoForBlank() With Medicare Form2Report.ParameterFields(F_ACCREDITNUM).AddCurrentValue .Hospital.AccrNumber Form2Report.ParameterFields(F_CATEGORY).AddCurrentValue .Hospital.Category Form2Report.ParameterFields(F_HOSPITAL_NAME).AddCurrentValue .Hospital.HospitalName Form2Report.ParameterFields(F_HOSPITAL_STREET).AddCurrentValue .Hospital.Street Form2Report.ParameterFields(F_HOSPITAL_BARANGAY).AddCurrentValue .Hospital.Barangay Form2Report.ParameterFields(F_HOSPITAL_MUNICIPALITY).AddCurrentValue .Hospital.Municipality Form2Report.ParameterFields(F_HOSPITAL_PROVINCE).AddCurrentValue .Hospital.Province Form2Report.ParameterFields(F_HOSPITAL_ZIPCODE).AddCurrentValue .Hospital.ZipCode End With End Sub Public Sub PrintSignatoryForBlank() Form2Report.ParameterFields(1).AddCurrentValue Medicare.Signatory.SignatoryName Form2Report.ParameterFields(2).AddCurrentValue Medicare.Signatory.OfficialCapacity End Sub Public Function BillingMedicareDeduction(stridnum As String) As Currency Dim recX As New ADODB.Recordset Dim strSQL As String If IsNumeric(Trim$(stridnum)) Then strSQL = "Select IsNull( (Select Cast(Sum(IsNull(Amount,0)) as money)" + _ "From Billing..tbBillDailyBill " + _ "Where IdNum = '" + stridnum + "' and RevenueID = 'SS'),0) [Amount]" Else If Right(Trim$(stridnum), 1) = "D" Then strSQL = "Select IsNull( (Select Cast(IsNull(ActualRoomBoard,0) + IsNull(ActualDrug,0) +" + _ "IsNull(ActualOthers,0) + IsNull(ActualOR,0) + isnull(ActualOutside,0) as money)" + _ "From Medicare..tbMedClaim " + _ "Where IdNum = '" + stridnum + "'),0) [Amount]" Else strSQL = "Select IsNull( (Select Cast(Sum(IsNull(Amount,0)) as money)" + _ "From Billing..tbBillOPDailyOut " + _ "Where IdNum = '" + stridnum + "' and RevenueID = 'SS'),0) [Amount]" End If End If BillingMedicareDeduction = 0 If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then BillingMedicareDeduction = recX![Amount] End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function GetPF(stridnum As String, strDocID As String, Optional intOption As DOCTOR_PF = ACTUAL_PF) As Currency Dim recX As New ADODB.Recordset GetPF = 0 If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient If intOption = ACTUAL_PF Then recX.Open "Medic_GetPF '" + stridnum + "','" + strDocID + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly Else recX.Open "Medic_GetMedicarePF '" + stridnum + "','" + strDocID + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly End If If recX.RecordCount > 0 Then GetPF = recX![Amount] End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function GetUserName(UserID As String) As String Dim recX As New ADODB.Recordset If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Medic_GetUserName '" + UserID + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then GetUserName = recX![UserName] Else GetUserName = "" End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function CountConfinement(strHospNum As String, Optional strStartDate As String, Optional blnOwwa = False) As Integer Dim strSQL As String Dim recSQL As New ADODB.Recordset If blnOwwa = True Then strSQL = "Medicare..Medic_PatientCountConfinementNoticeOWWA '" & strHospNum & "', '" & strStartDate & "'" Else strSQL = "Medicare..Medic_PatientCountConfinementNotice '" & strHospNum & "', '" & strStartDate & "'" End If CountConfinement = 0 With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then CountConfinement = !CountPeriod End If If .State > 0 Then .Close End With End Function Public Function CountMemberAvailment(strMemberNumber As String, strStartDate As String) As Integer Dim strSQL As String Dim recSQL As New ADODB.Recordset strSQL = "Medicare..Medic_MemberCountConfinementNotice '" & strMemberNumber & "','" & strStartDate & "'" CountMemberAvailment = 0 With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then CountMemberAvailment = !CountPeriod End If If .State > 0 Then .Close End With End Function Public Function GetMembership(Optional intType As Integer = 1) As String Dim recSQL As New ADODB.Recordset Dim strSQL As String With recSQL GetMembership = "" strSQL = "select [Name] as Membership from tbmedtype where code = " & intType If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then GetMembership = !Membership & "" End If If .State > 0 Then .Close End With End Function Public Sub HospitalInfo() Dim recX As New ADODB.Recordset Dim strSQL As String strSQL = "Select Top 1 * From Patient_Data..tbHospitalInfo" If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then pstrHospitalName = recX!Company & "" pstrHospitalAddress = recX!Address1 & "" ClientName = recX!ClientName & "" End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Sub GetUserVerSettings() Dim recX As New ADODB.Recordset Dim strSQL As String blnProceed = True strSQL = "Select Top 1 * From build_file..tbcoBuildFileSetting" If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then blnAllowUserVerification = recX!isAllowUserVerification & "" End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub 'added by ange 8.18.2016 Public Function isallowUserValidation(strValidID As String) As Boolean Dim recX As New ADODB.Recordset Dim strSQL As String blnProceed = True isallowUserValidation = False strSQL = "Select * from medicare..tbmed_uservalidation where validid = '" & strValidID & "' and isnull(status,0) = 1" If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then isallowUserValidation = True Else isallowUserValidation = False End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Sub ActivatePhase() Dim recX As New ADODB.Recordset Dim strSQL As String strSQL = "Select isAllowShowReportDescription,ActivatePhase1, ActivatePhase2,ActivatePhase1_2 From Medicare..tbMedHospital" If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then ActivatePhase1 = IIf(IsNull(recX!ActivatePhase1), 0, recX!ActivatePhase1) ActivatePhase1_2 = IIf(IsNull(recX!ActivatePhase1_2), 0, recX!ActivatePhase1_2) ActivatePhase2 = IIf(IsNull(recX!ActivatePhase2), 0, recX!ActivatePhase2) blnShowReport = IIf(IsNull(recX!isAllowShowReportDescription), 0, recX!isAllowShowReportDescription) End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Function isPatientAlreadyFiled(strIDnumber As String) As Boolean Dim strSQL As String Dim recSQL As New ADODB.Recordset On Error GoTo ErrHandle strSQL = "Select isnull(isFiled,0) as isFiled From Medicare..tbMedPatient Where IDNum = '" & strIDnumber & "'" With recSQL isPatientAlreadyFiled = False If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then If !isFiled = True Then isPatientAlreadyFiled = True End If End If If .State > 0 Then .Close End With Exit Function ErrHandle: MsgBox "ERROR : " & Err.Description, vbInformation + vbCritical, "Message" End Function Public Function isPatientTaggedForTransmittal(stridnum As String) As String Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Medic_PatientTagForTransmittal '" & stridnum & "'" isPatientTaggedForTransmittal = "" With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isPatientTaggedForTransmittal = IIf(IsNull(!TransDate), "", Format(!TransDate, "MM/dd/yyyy")) End If If .State > 0 Then .Close End With End Function Public Function isPatientTaggedForRTH(stridnum As String) As Boolean Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Select isnull(isTagRTH,0) [isTagRTH] from Medicare..tbMedPatient where IdNum = '" & stridnum & "'" isPatientTaggedForRTH = False With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isPatientTaggedForRTH = !istagrth End If If .State > 0 Then .Close End With End Function 'added by ange 8.12.2016 allow caserate as first and Second Public Function isAllowSecondCase(strPackageID As String) As Boolean Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Select isnull(isAllowSecondCR, '') [isAllowSecondCR] from Medicare..tbMedPackage where packageid = '" & strPackageID & "'" isAllowSecondCase = False With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isAllowSecondCase = !isAllowSecondCR End If If .State > 0 Then .Close End With End Function Public Function isClaimsReceived(stridnum As String) As String Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Select * from Medicare..tbMedPatient where IDNum ='" & stridnum & "'" isClaimsReceived = "" With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isClaimsReceived = IIf(IsNull(!PHICReceived), "Not Yet", Format(!PHICReceived, "MM/dd/yyyy")) End If If .State > 0 Then .Close End With End Function Public Sub GetHBActual(IdNum As String) Dim recX As New ADODB.Recordset PublicRB = 0 PublicDrugs = 0 PublicOthers = 0 PublicOR = 0 If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Billing..sp_PARS_RepSOASummarized_New '" + Trim$(IdNum) + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then recX.MoveFirst While Not recX.EOF If recX!ReportOrder = 1 Then PublicRB = recX!Charges - recX!Credit If recX!ReportOrder = 2 Then PublicDrugs = recX!Charges - recX!Credit If recX!ReportOrder = 4 Then PublicOthers = recX!Charges - recX!Credit If recX!ReportOrder = 3 Then PublicOR = recX!Charges - recX!Credit ' If recX!RevenueID = "PC" Or recX!RevenueID = "CC" Then ' PublicDrugs = PublicDrugs - recX!Credit ' End If recX.MoveNext Wend End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Function isAlreadyInvoice(stridnum As String) As Boolean Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Medicare..Medic_CheckIfAlreadyInvoiced '" & stridnum & "'" isAlreadyInvoice = False With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then If Len(Trim$(!InvoiceNumber)) > 0 Then isAlreadyInvoice = True End If End If If .State > 0 Then .Close End With End Function Public Function isLateChargesBilling(stridnum As String) As Boolean Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Medicare..Medic_CheckIFLateCharges '" & stridnum & "'" isLateChargesBilling = False With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then If Trim$(!LateCharges) = "0" Then isLateChargesBilling = True End If End If If .State > 0 Then .Close End With End Function Public Function UpdateMedicarePayments(strID As String, strORNumber As String, dblRoomBoard As Double, dblDrugs As Double, _ dblOthers As Double, dblOR As Double, dblTax As Double, strDatePaid As String, strUserID As String, strPaymentOrder As String, _ strAPVNum As String) As Boolean Dim strSQL As String On Error GoTo ErrHandle UpdateMedicarePayments = True strSQL = "Medicare..Medic_UpdatePaymentRoomDrugOthers '" & strID & "', '" & strORNumber & "', " & CStr(dblRoomBoard) & ", " & CStr(dblDrugs) & ", " _ + " " & CStr(dblOthers) & ", " & CStr(dblOR) & ", " & CStr(dblTax) & ", '" & strDatePaid & "', '" & strUserID & "', '" & strPaymentOrder & "', '" & strAPVNum & "'" user.SQLConnection.Execute strSQL Exit Function ErrHandle: UpdateMedicarePayments = False MsgBox Err.Description, vbCritical + vbOKOnly, "Error" End Function Public Function CheckifAlreadySaveCompensable(stridnum As String) As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String CheckifAlreadySaveCompensable = False SQL = "Select * from Medicare..Medic_DumpCompensable where IDNum = '" & stridnum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then CheckifAlreadySaveCompensable = True End If .Close End With Set Rec = Nothing End Function Public Function CheckifAlreadySaveActual(stridnum As String) As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String CheckifAlreadySaveActual = False SQL = "Select * from Medicare..tbMedActual where IDNum = '" & stridnum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then CheckifAlreadySaveActual = True End If .Close End With Set Rec = Nothing End Function 'added by ange 6.8.2016 Public Function GetActualICDRVS(stridnum As String) Dim Rec As New ADODB.Recordset Dim SQL As String ' CheckifAlreadySaveActual = False SQL = "Select firstICDRVS from Medicare..tbMedActual where IDNum = '" & stridnum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetActualICDRVS = !FirstICDRVS End If .Close End With Set Rec = Nothing End Function Public Function CalculateBirthday(strBirthday As String, strAdmDate As String) As String Dim dDOB As Date, iAgeInYears As Integer, iAgeInMonth As Integer, iDayDiff As Integer Dim Date1 As Date, Date2 As Date, iHlpDay As Integer, iHlpMonth As Integer Dim iHlpYear As Integer, dHlpDate As String strBirthday = IIf(strBirthday = "", " / / ", strBirthday) Date1 = CDate(IIf(strBirthday = " / / ", Now, strBirthday)) 'If pubstrAdmDate = "" Then Date2 = CDate(strAdmDate) 'Else ' Date2 = Format(CDate(pubstrAdmDate), "dd/mm/yyyy") 'End If iDayDiff = Day(Date2) - Day(Date1) If iDayDiff < 0 Then ' e.g we have date1 18.2.62 and date2 7.5.65 'we will use a helpdate 7.3.62 and then calculate from 7.3.62 - 7.5.66 iHlpDay = Day(Date2) iHlpMonth = Month(Date1) + 1 'next month iHlpYear = Year(Date1) If iHlpMonth > 12 Then iHlpMonth = 1 iHlpYear = iHlpYear + 1 End If If iHlpMonth = 2 Then If (iHlpYear Mod 4) = 0 Then iHlpDay = IIf(iHlpDay >= 30, 29, iHlpDay) Else iHlpDay = IIf(iHlpDay >= 29, 28, iHlpDay) End If End If dHlpDate = Format(IIf(Len(CStr(iHlpMonth)) = 1, "0" + CStr(iHlpMonth), CStr(iHlpMonth)) & _ "/" & IIf(Len(CStr(iHlpDay)) = 1, "0" + CStr(iHlpDay), CStr(iHlpDay)) & "/" & CStr(iHlpYear), "mm/dd/yyyy") iDayDiff = DateDiff("d", Date1, dHlpDate) ' Thats the days Date1 = dHlpDate End If iAgeInMonth = DateDiff("m", Date1, Date2) iAgeInYears = DateDiff("yyyy", Date1, Date2) If Month(Date1) > Month(Date2) Then iAgeInYears = iAgeInYears - 1 End If iAgeInMonth = iAgeInMonth - 12 * iAgeInYears 'CalculateBirthday = CStr(iDayDiff) + "D " + CStr(iAgeInMonth) + "M" CalculateBirthday = CStr(iAgeInMonth) + "M" End Function Public Function BirthDate(strHospNum As String) As String Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select * from Patient_Data..tbMaster where Hospnum = '" & strHospNum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then BirthDate = Format(!BirthDate, "mm/dd/yyyy") End If .Close End With Set Rec = Nothing strBirthDate = BirthDate End Function Public Function GetActualMeds(stridnum As String, strPosition As String) Dim Rec As New ADODB.Recordset Dim SQL As String If strPosition = "5" Then GetActualUserID stridnum ' SQL = "Medicare..Medic_GetTempActualAmounts '" & strPosition & "','" & stridnum & "','" & ActualUserID & "'" Else SQL = "Medicare..Medic_GetTempActualMedAmounts '" & strPosition & "','" & stridnum & "','" & user.EmployeeCode & "'" End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetActualMeds = Format(!Total, "###,##0.00") End If .Close End With Set Rec = Nothing End Function Public Function GetBatchNum(strTransDate As String, strMedType As String) Dim Rec As New ADODB.Recordset Dim SQL As String ' CheckifAlreadySaveActual = False SQL = "Select max(isnull(BatchNum,1)) BatchNum from Medicare..tbMedPatient where TransDate between '" & strTransDate & "' and '" + strTransDate + " 23:59:59.99' and " + _ "MemberType = '" & strMedType & "' group by BatchNum" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then ' CheckifAlreadySaveActual = True End If .Close End With Set Rec = Nothing End Function Public Sub OpenMainReport(ByVal strReportFileName As String, ParamArray strParameters()) Dim crxParameterField As CRAXDRT.ParameterFieldDefinition Dim intctr As Integer Dim intTotalParam As Integer Dim crxtable As CRAXDRT.DatabaseTable Dim crxApplication As New CRAXDRT.Application intTotalParam = UBound(strParameters) If Not Report Is Nothing Then Set Report = Nothing Set Report = crxApplication.OpenReport(strReportFileName, 1) Report.ReportTitle = pstrHospitalName Report.ReportComments = pstrHospitalAddress For Each crxtable In Report.Database.Tables crxtable.Location = "Billing" + Mid(crxtable.Location, InStr(1, crxtable.Location, ".")) crxtable.SetLogOnInfo user.ServerName, "Billing", user.UserID, user.ServerPassword Next If intTotalParam >= 0 Then For Each crxParameterField In Report.ParameterFields If intTotalParam >= intctr Then crxParameterField.AddCurrentValue strParameters(intctr) Else Exit For End If intctr = intctr + 1 Next End If Set crxParameterField = Nothing Set crxtable = Nothing Set crxApplication = Nothing End Sub Public Sub OpenSubReport(ByVal strSubReport As String, ParamArray strParameters()) Dim crxParameterField As CRAXDRT.ParameterFieldDefinition Dim intctr As Integer Dim intTotalParam As Integer Dim crxtable As CRAXDRT.DatabaseTable Dim crxSubreport As CRAXDRT.Report intTotalParam = UBound(strParameters) Set crxSubreport = Report.OpenSubReport(strSubReport) For Each crxtable In crxSubreport.Database.Tables crxtable.Location = "Billing" + Mid(crxtable.Location, InStr(1, crxtable.Location, ".")) crxtable.SetLogOnInfo user.ServerName, "Billing", user.UserID, user.ServerPassword Next If intTotalParam >= 0 Then For Each crxParameterField In crxSubreport.ParameterFields If intTotalParam >= intctr Then crxParameterField.AddCurrentValue strParameters(intctr) Else Exit For End If intctr = intctr + 1 Next End If Set crxParameterField = Nothing Set crxtable = Nothing Set crxSubreport = Nothing End Sub Public Sub ShowReportViewer(Optional blnShowGroupTree As Boolean = False, Optional strCaption As String = "", Optional blnDirectToPrinter As Boolean = False, Optional blnvbModal As Boolean = False) If blnDirectToPrinter Then Report.DisplayProgressDialog = False Report.PrintOut False Set Report = Nothing Else If Not blnvbModal Then Dim frmRView As New frmReportViewer With frmRView .ShowGroupTree = blnShowGroupTree .Caption = strCaption .DirectPrint = blnDirectToPrinter .Show End With Else Dim frmRViewvbmodal As New frmReportViewervbModal With frmRViewvbmodal .ShowGroupTree = blnShowGroupTree .Caption = strCaption .DirectPrint = blnDirectToPrinter .Show vbModal End With End If End If End Sub Public Function GetAccNumber(stridnum As String) As String Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "select top 1 isnull(AccountNum,'') [AccNum] from Patient_Data..tbpatient where IdNum = '" + stridnum + "'" GetAccNumber = 0 With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetAccNumber = ![AccNum] End If .Close End With Set Rec = Nothing End Function Public Function GetPaymentAmount(stridnum As String, strPaymentType As String) As Double Dim Rec As New ADODB.Recordset Dim SQL As String ' If GetIsBenefits(strIdNum) = True Then ' ' SQL = "(Select(Select IsNull(Sum(IsNull(Amount,0)) + Sum(IsNull(Tax,0)),0)[Amount] from Medicare..tbMedPayment where IDNum = '" & _ ' Trim$(strIdNum) & "') + (Select IsNull(Sum(isnull((Payment),0)),0)[Amount] from Medicare..tbMedDoctors where IDNum = '" & _ ' Trim$(strIdNum) & "') as [Amount])" ' ' Else If strPaymentType = "HCI" Then SQL = "Select Cast(IsNull(Sum(IsNull(Amount,0)) + Sum(IsNull(Tax,0)),0)as money)[Amount] " SQL = SQL + "from Medicare..tbMedPayment where IDNum = '" & Trim$(stridnum) & "' " ElseIf strPaymentType = "PF" Then SQL = "If Exists(Select * from tbmedDoctorPayment where idnum = '" & Trim$(stridnum) & "') " SQL = SQL + "Begin Select Cast(IsNull(Sum(IsNull(Amount,0)),0) as money) [Amount] " SQL = SQL + "from Medicare..tbMedDoctorPayment where IDNum = '" & Trim$(stridnum) & "' End " SQL = SQL + "Else " SQL = SQL + "Begin Select Cast(IsNull(Sum(IsNull(Payment,0)),0) as money) [Amount] " SQL = SQL + "from Medicare..tbMedDoctors where IDNum = '" & Trim$(stridnum) & "' End " End If ' End If GetPaymentAmount = 0 With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetPaymentAmount = !Amount End If .Close End With Set Rec = Nothing End Function Public Function IsHMOAccount(stridnum As String) As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String IsHMOAccount = False SQL = "Medicare..Medic_CheckIfHMOAccount '" & Trim$(stridnum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then IsHMOAccount = True End If .Close End With Set Rec = Nothing End Function Public Sub GetRVSInfo(strtmpIDNum As String) Dim SQL As String Dim Rec As New ADODB.Recordset SQL = "Select isnull(RVS,'') RVS, isnull(IllnessCode,'') IllnessCode from Medicare..tbMedPatient where IDNum = '" & Trim$(strtmpIDNum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then strForm2RVS = !RVS & "" strForm2IllnessCOde = !IllnessCode & "" End If .Close End With Set Rec = Nothing End Sub Public Sub PrintConfinementInfo(strtmpIDNum As String) Dim SQL As String Dim Rec As New ADODB.Recordset Dim PatientDisposition As String Dim isPatientReferred As Boolean Dim NameOfReferringHCI As String Dim ReferringAddress As String Dim ReferralReason As String Dim AccomodationType As String Dim isHemoProcedure As Boolean Dim isPDProcedure As Boolean Dim isRLINACProcedure As Boolean Dim isRCOBALTProcedure As Boolean Dim isBTProcedure As Boolean Dim isBrachyProcedure As Boolean Dim isChemoProcedure As Boolean Dim isSDProcedure As Boolean Dim HemoProcedureDates As String Dim PDProcedureDates As String Dim RLINACProcedureDates As String Dim RCOBALTProcedureDates As String Dim BTProcedureDates As String Dim BrachyProcedureDates As String Dim ChemoProcedureDates As String Dim SDProcedureDates As String Dim ZBPCode As String Dim ABPackageDayZero As String Dim ABPackageDayThree As String Dim ABPackageDaySeven As String Dim ABPackageRIG As String Dim ABPackageOthers As String Dim MCPPackageFirst As String Dim MCPPackageSecond As String Dim MCPPackageThird As String Dim MCPPackageFourth As String Dim ENewbornCareIDON As String Dim ENewbornCareEStSC As String Dim ENewbornCareTCC As String Dim ENewbornCareEP As String Dim ENewbornCareWotN As String Dim ENewbornCareVkA As String Dim ENewbornCareBCGV As String Dim ENewbornCareNsoMBfEBFI As String Dim ENewbornCareHepaB As String Dim TBDotsPackge As String Dim NewbornCarePackge As String Dim LaboratoryNumber As String Dim ReferredByHCIName As String SQL = "Medicare..Medic_GetConfinementInfo '" & Trim$(strtmpIDNum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then PatientDisposition = !PatientDisposition isPatientReferred = !isPatientReferred NameOfReferringHCI = !NameOfReferralHCI ReferringAddress = !ReferralAddress ReferralReason = !ReferralReason AccomodationType = !AccomodationType isHemoProcedure = !isHemoProcedure isPDProcedure = !isPDProcedure isRLINACProcedure = !isRLINACProcedure isRCOBALTProcedure = !isRCOBALTProcedure isBTProcedure = !isBTProcedure isBrachyProcedure = !isBrachyProcedure isChemoProcedure = !isChemoProcedure isSDProcedure = !isSDProcedure HemoProcedureDates = !HemoProcedureDates PDProcedureDates = !PDProcedureDates RLINACProcedureDates = !RLINACProcedureDates RCOBALTProcedureDates = !RCOBALTProcedureDates BTProcedureDates = !BTProcedureDates BrachyProcedureDates = !BrachyProcedureDates ChemoProcedureDates = !ChemoProcedureDates SDProcedureDates = !SDProcedureDates ZBPCode = !ZBPCode ABPackageDayZero = !ABPackageDayZero ABPackageDayThree = !ABPackageDayThree ABPackageDaySeven = !ABPackageDaySeven ABPackageRIG = !ABPackageRIG ABPackageOthers = !ABPackageOthers MCPPackageFirst = !MCPPackageFirst MCPPackageSecond = !MCPPackageSecond MCPPackageThird = !MCPPackageThird MCPPackageFourth = !MCPPackageFourth ENewbornCareIDON = !ENewbornCareIDON ENewbornCareEStSC = !ENewbornCareEStSC ENewbornCareTCC = !ENewbornCareTCC ENewbornCareEP = !ENewbornCareEP ENewbornCareWotN = !ENewbornCareWotN ENewbornCareVkA = !ENewbornCareVkA ENewbornCareBCGV = !ENewbornCareBCGV ENewbornCareNsoMBfEBFI = !ENewbornCareNsoMBfEBFI ENewbornCareHepaB = !ENewbornCareHepaB TBDotsPackge = !TBDotsPackge NewbornCarePackge = !NewbornCarePackge LaboratoryNumber = !LaboratoryNumber ReferredByHCIName = !ReferredByHCIName Form2Report.ParameterFields(F_PatientDisposition).AddCurrentValue PatientDisposition Form2Report.ParameterFields(F_isPatientReferred).AddCurrentValue isPatientReferred Form2Report.ParameterFields(F_NameOfReferringHCI).AddCurrentValue Left$(NameOfReferringHCI, 255) Form2Report.ParameterFields(F_ReferringAddress).AddCurrentValue Left$(ReferringAddress, 255) Form2Report.ParameterFields(F_ReferralReason).AddCurrentValue Left$(ReferralReason, 255) Form2Report.ParameterFields(F_AccomodationType).AddCurrentValue AccomodationType Form2Report.ParameterFields(F_isHemoProcedure).AddCurrentValue isHemoProcedure Form2Report.ParameterFields(F_isPDProcedure).AddCurrentValue isPDProcedure Form2Report.ParameterFields(F_isRLINACProcedure).AddCurrentValue isRLINACProcedure Form2Report.ParameterFields(F_isRCOBALTProcedure).AddCurrentValue isRCOBALTProcedure Form2Report.ParameterFields(F_isBTProcedure).AddCurrentValue isBTProcedure Form2Report.ParameterFields(F_isBrachyProcedure).AddCurrentValue isBrachyProcedure Form2Report.ParameterFields(F_isChemoProcedure).AddCurrentValue isChemoProcedure Form2Report.ParameterFields(F_isSDProcedure).AddCurrentValue isSDProcedure Form2Report.ParameterFields(F_HemoProcedureDates).AddCurrentValue Left$(HemoProcedureDates, 255) Form2Report.ParameterFields(F_PDProcedureDates).AddCurrentValue Left$(PDProcedureDates, 255) Form2Report.ParameterFields(F_RLINACProcedureDates).AddCurrentValue Left$(RLINACProcedureDates, 255) Form2Report.ParameterFields(F_RCOBALTProcedureDates).AddCurrentValue Left$(RCOBALTProcedureDates, 255) Form2Report.ParameterFields(F_BTProcedureDates).AddCurrentValue Left$(BTProcedureDates, 255) Form2Report.ParameterFields(F_BrachyProcedureDates).AddCurrentValue Left$(BrachyProcedureDates, 255) Form2Report.ParameterFields(F_ChemoProcedureDates).AddCurrentValue Left$(ChemoProcedureDates, 255) Form2Report.ParameterFields(F_SDProcedureDates).AddCurrentValue Left$(SDProcedureDates, 255) Form2Report.ParameterFields(F_ZBPCode).AddCurrentValue ZBPCode Form2Report.ParameterFields(F_ABPackageDayZero).AddCurrentValue Replace(ABPackageDayZero, "/", "-") Form2Report.ParameterFields(F_ABPackageDayThree).AddCurrentValue Replace(ABPackageDayThree, "/", "-") Form2Report.ParameterFields(F_ABPackageDaySeven).AddCurrentValue Replace(ABPackageDaySeven, "/", "-") Form2Report.ParameterFields(F_ABPackageRIG).AddCurrentValue Replace(ABPackageRIG, "/", "-") Form2Report.ParameterFields(F_ABPackageOthers).AddCurrentValue Replace(ABPackageOthers, "/", "-") Form2Report.ParameterFields(F_MCPPackageFirst).AddCurrentValue Replace(MCPPackageFirst, "/", "-") Form2Report.ParameterFields(F_MCPPackageSecond).AddCurrentValue Replace(MCPPackageSecond, "/", "-") Form2Report.ParameterFields(F_MCPPackageThird).AddCurrentValue Replace(MCPPackageThird, "/", "-") Form2Report.ParameterFields(F_MCPPackageFourth).AddCurrentValue Replace(MCPPackageFourth, "/", "-") Form2Report.ParameterFields(F_ENewbornCareIDON).AddCurrentValue ENewbornCareIDON Form2Report.ParameterFields(F_ENewbornCareEStSC).AddCurrentValue ENewbornCareEStSC Form2Report.ParameterFields(F_ENewbornCareTCC).AddCurrentValue ENewbornCareTCC Form2Report.ParameterFields(F_ENewbornCareEP).AddCurrentValue ENewbornCareEP Form2Report.ParameterFields(F_ENewbornCareWotN).AddCurrentValue ENewbornCareWotN Form2Report.ParameterFields(F_ENewbornCareVkA).AddCurrentValue ENewbornCareVkA Form2Report.ParameterFields(F_ENewbornCareBCGV).AddCurrentValue ENewbornCareBCGV Form2Report.ParameterFields(F_ENewbornCareNsoMBfEBFI).AddCurrentValue ENewbornCareNsoMBfEBFI Form2Report.ParameterFields(F_ENewbornCareHepaB).AddCurrentValue ENewbornCareHepaB Form2Report.ParameterFields(F_TBDotsPackge).AddCurrentValue TBDotsPackge Form2Report.ParameterFields(F_NewbornCarePackge).AddCurrentValue NewbornCarePackge Form2Report.ParameterFields(F_LaboratoryNumber).AddCurrentValue LaboratoryNumber Form2Report.ParameterFields(F_ReferredByHCIName).AddCurrentValue Left$(ReferredByHCIName, 255) End If .Close End With Set Rec = Nothing End Sub Public Sub PrintCardiologist(intcount As Integer, stridnum As String) Dim strPerformedDate As String With clsCardiologist .IdNum = stridnum If .LoadCardioInfo Then If Len(.DocCode(intcount)) > 0 And .DocCode(intcount) <> "36M" And .DocCode(intcount) <> "37M" Then Form2Report.ParameterFields(F_CARDIO_NAME).AddCurrentValue .DocName(intcount) Form2Report.ParameterFields(F_CARDIO_PHIC).AddCurrentValue .PHICNumber(intcount) If Len(Trim$(.ServicePerformed(intcount))) > 110 And ClientName = "DDH" Then blnServicePerformed = True Form2Report.ParameterFields(F_CARDIO_SERVICES).AddCurrentValue "SEE ATTACHED" Else Form2Report.ParameterFields(F_CARDIO_SERVICES).AddCurrentValue .ServicePerformed(intcount) End If Form2Report.ParameterFields(F_CARDIO_ACTUAL).AddCurrentValue Format(.ActualPF(intcount), "##,###,##0.00") Form2Report.ParameterFields(F_CARDIO_MED).AddCurrentValue Format(.MedicarePF(intcount), "##,###,##0.00") Form2Report.ParameterFields(F_CARDIO_PATIENT).AddCurrentValue Format(.PatientPF(intcount), "##,###,##0.00") strPerformedDate = Format(.DatePeformed(intcount), "MM/dd/yyyy") If strPerformedDate <> "01/01/1900" And CDate(strPerformedDate) > CDate("01/01/1900") Then Form2Report.ParameterFields(F_CARDIO_PERFORMEDDATE).AddCurrentValue Format(.DatePeformed(intcount), "MM/dd/yyyy") Else Form2Report.ParameterFields(F_CARDIO_PERFORMEDDATE).AddCurrentValue "n/a" End If Else Form2Report.ParameterFields(F_CARDIO_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PERFORMEDDATE).AddCurrentValue "n/a" End If Else Form2Report.ParameterFields(F_CARDIO_NAME).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PHIC).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_SERVICES).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_ACTUAL).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_MED).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PATIENT).AddCurrentValue "n/a" Form2Report.ParameterFields(F_CARDIO_PERFORMEDDATE).AddCurrentValue "n/a" End If End With End Sub Public Function GetRoomClass(stridnum As String) As String Dim SQL As String SQL = "Select dbo.Fn_GetRoomClass('" & stridnum & "') As RoomClass" GetRoomClass = "" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetRoomClass = !RoomClass End If .Close End With Set Rec = Nothing End Function Public Function getAge(strBirthDate As String) As String Dim SQL As String SQL = "Select isnull(Patient_data.dbo.Fn_GetAge('" & strBirthDate & "','" & Format(Now, "mm/dd/yyyy") & "'),'') As Age" getAge = "" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then getAge = !Age End If .Close End With Set Rec = Nothing End Function 'added by ange 5.24.2016 Public Function CheckCaseRateTermsExist(strCRCode As String) As Boolean Dim recX As New ADODB.Recordset CheckCaseRateTermsExist = False If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Select isnull(CRCode,0) CRCode from Medicare..tbmed_CaseRateTerms Where CRCode = '" + strCRCode + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then CheckCaseRateTermsExist = True Else CheckCaseRateTermsExist = False End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function GetActualOutside(stridnum As String) As String Dim SQL As String SQL = "Select IsNull(ActualOutside,0) ActualOutside From Medicare..tbMedClaim Where IDNum = '" & stridnum & "'" GetActualOutside = "0" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetActualOutside = Format(!ActualOutside, "#######.00") End If .Close End With Set Rec = Nothing End Function Public Function GetReportDescription(strReportID As String) As String Dim SQL As String SQL = "Select IsNull(Name,0) Name, IsNull(Description,0) Description From Medicare..tbReportsDescription Where ReportID = isnull('" & strReportID & "',0)" GetReportDescription = "0" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetReportDescription = !Description & "-" & !Name End If .Close End With Set Rec = Nothing End Function Private Function GetPatientDays(stridnum As String) As Integer Dim SQL As String GetPatientDays = 0 SQL = "Select IsNull(PatientDays,0) PatientDays From Medicare..tbMedPatient Where IDNum = '" & Trim$(stridnum) & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetPatientDays = !patientdays End If End With Set Rec = Nothing End Function Public Function GetButtonStatus(btnID As String) As Boolean Dim SQL As String GetButtonStatus = 0 SQL = "Select * from Medicare..tbMedUserSetting where EmployeeID = '" & Trim$(user.EmployeeCode) & "' and menuid = '" & btnID & "' and status = 1 " With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then GetButtonStatus = 1 End If End With Set Rec = Nothing End Function Public Function isHemo(stridnum As String) As Boolean Dim SQL As String SQL = "Select * From Patient_data..tboutpatient Where IDNum = '" & stridnum & "' and isnull(HemoNum,'') <> ''" With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isHemo = True Else isHemo = False End If .Close End With Set recMember = Nothing End Function Public Function isER(stridnum As String) As String Dim SQL As String SQL = "Select * From Patient_data..tboutpatient Where IDNum = '" & stridnum & "' and isnull(ERNum,'') <> ''" With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isER = "W/ ER" Else isER = "" End If .Close End With Set recMember = Nothing End Function Public Function GetSession(stridnum As String) As String Dim SQL As String SQL = " SELECT sum(tbinvstockcard.quantity) Quantity FROM Inventory..TBINVSTOCKCARD tbinvstockcard LEFT OUTER JOIN BUILD_FILE..tbcoRevenueCode tbcoRevenueCode" & _ " on tbInvStockCard.LocationID = tbcoRevenueCode.LocationID WHERE TBINVSTOCKCARD.IDNUM= '" & stridnum & _ "' and tbinvstockcard.packageid is null and isnull(tbInvStockCard.Status,'') = '' and left(tbInvStockCard.RefNum, 2) not in ('OR', 'AS', 'CC', 'AC')" & _ " and (case when isnull(TBINVSTOCKCARD.LocationID, '') = '' then TBINVSTOCKCARD.RevenueID else TBcoRevenueCode.RevenueID end) = 'KS'" With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetSession = "(" & !Quantity & " session/s)" Else GetSession = 0 End If .Close End With Set recMember = Nothing End Function Public Function GetBagCount(stridnum As String) As String Dim SQL As String If IsNumeric(Right(stridnum, 1)) = True Then SQL = "select sum(isnull(a.Quantity,0)) Quantity from Billing..tbbilldailybill a left outer join Build_File..tbCoLabExam b on a.ItemID = b.LabExamID where a.RevenueID = 'LB' and idnum = '" & stridnum & "' and b.MedicareType = '2'" Else SQL = "select sum(isnull(a.Quantity,0)) Quantity from Billing..tbbillopdailyout a left outer join Build_File..tbCoLabExam b on a.ItemID = b.LabExamID where a.RevenueID = 'LB' and idnum = '" & stridnum & "' and b.MedicareType = '2'" End If With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetBagCount = "(" & !Quantity & " bag/s)" Else GetBagCount = 0 End If .Close End With Set recMember = Nothing End Function Public Function isEndoscopy(stridnum As String) As Boolean Dim SQL As String isEndoscopy = False If IsNumeric(Right(stridnum, 1)) Then SQL = "select * from Billing..tbbilldailybill where RevenueID in ('EA', 'EC') and IDNum = '" & stridnum & "'" Else SQL = "select * from Billing..tbBillOPDailyOut where RevenueID in ('EA', 'EC') and IDNum = '" & stridnum & "'" End If With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isEndoscopy = True End If .Close End With Set recMember = Nothing End Function 'Public Function PurchaseDate(strIdNum As String) As String ' With Rec ' If .State > 0 Then .Close ' .CursorLocation = adUseClient ' .Open "Medicare..MedicRep_Waiver '" + Trim$(strIdNum) + "','CA'", user.SQLConnection, adOpenDynamic, adLockReadOnly ' If .RecordCount > 0 Then ' PurchaseDate = Format(!Confinement, "mm/dd/yyyy") ' End If ' ' If .State > 0 Then .Close ' Set Rec = Nothing ' End With 'End Function Public Function GetMedicareCategory(stridnum As String) As String Dim recSQL As New ADODB.Recordset Dim strSQL As String GetMedicareCategory = "" strSQL = "Medicare.dbo.Medic_GetMedicareCategory '" & stridnum & "'" With recSQL If .State > 0 Then .Close .CursorLocation = adUseClient .Open strSQL, user.SQLConnection, adOpenDynamic, adLockOptimistic If .RecordCount > 0 Then GetMedicareCategory = !Category & "" End If If .State > 0 Then .Close End With End Function Public Function HasBC(stridnum As String) As String Dim SQL As String SQL = "Select idnum From Billing..tbbilldailybill Where IDNum = '" & stridnum & "' and itemid IN ('1938', '1939', '1937', '1936', '1935', '228','229','230', '234','235') and revenueid = 'LB'" & _ "UNION ALL Select idnum From Billing..tbbillopdailyout Where IDNum = '" & stridnum & "' and itemid IN ('1938', '1939', '1937', '1936', '1935', '228','229','230', '234','235') and revenueid = 'LB'" With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then HasBC = "BLOOD COMPONENT" Else HasBC = "" End If .Close End With Set recMember = Nothing End Function Public Function DeletePreviousComputations(stridnum As String, strtype As String) If strtype = "2" Then MsgBox "Previous computation is greater than the amount of this package. It will be automatically deleted. ", vbInformation, "MESSAGE" End If user.SQLConnection.Execute "delete from medicare..tbmedsoa where idnum = '" & _ stridnum & "'" End Function Public Function countDiag(stridnum As String) As String Dim recX As New ADODB.Recordset Dim SQL As String SQL = "SELECT COUNT(DiagID) [Total] from Medicare..tbMedDiagnosis Where IDNum = '" & stridnum & "'" With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly countDiag = "1" If .RecordCount > 0 Then If !Total > 4 And !Total < 9 Then countDiag = "2" ElseIf !Total > 8 And !Total < 13 Then countDiag = "3" End If End If .Close End With Set recX = Nothing End Function Public Function countDoctor(stridnum As String) As String Dim recX As New ADODB.Recordset Dim SQL As String SQL = "SELECT isnull(COUNT(DocType),1) [Total] from Medicare..tbMedDoctors Where IDNum = '" & stridnum & "' and doctype = 'P'" With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then countDoctor = !Total End If .Close End With Set recX = Nothing End Function Public Function countDiagSave(stridnum As String) As String Dim recX As New ADODB.Recordset Dim SQL As String SQL = "SELECT COUNT(DiagID) [Total] from Medicare..tbMedDiagnosis Where IDNum = '" & stridnum & "'" With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly countDiagSave = "0" If .RecordCount > 0 Then countDiagSave = !Total End If .Close End With Set recX = Nothing End Function Public Property Get PurchaseDate() As String PurchaseDate = mvarPurchaseDate End Property Public Property Let PurchaseDate(ByVal vNewValue As String) mvarPurchaseDate = vNewValue End Property Public Property Get PayService() As String PayService = mvarPayService End Property Public Property Let PayService(ByVal vNewValue As String) mvarPayService = vNewValue End Property Public Property Get DocChief() As String DocChief = mvarDocChief End Property Public Property Let DocChief(ByVal vNewValue As String) mvarDocChief = vNewValue End Property Public Function getAge_Upon_Confinement(IdNum As String) As Integer Dim SQL As String SQL = "Select isnull(Age,0) Age from medicare..tbmedpatient where idnum = '" & IdNum & "'" getAge_Upon_Confinement = 0 With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .RecordCount > 0 Then getAge_Upon_Confinement = !Age End If .Close End With Set Rec = Nothing End Function Public Function isAllowInstallmentPayment() As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String isAllowInstallmentPayment = False SQL = "Select isnull(ModSet_Status, 0) ModSet_Status from Medicare..tbMed_ModuleSettings Where ModSet_ID = 21 " With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then pubIsAllowInstallmentPayment = !ModSet_Status End If .Close End With Set Rec = Nothing End Function Public Function isCF4Verified(stridnum As String) As Boolean Dim SQL As String isCF4Verified = False SQL = "Select Medicare.dbo.fn_isCF4Verified('" & stridnum & "') as CF4Verified" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then ' If !CF4Verified = 1 Then ' isCF4Verified = True ' End If Select Case !CF4Verified Case 1, 2 isCF4Verified = True End Select End If .Close End With Set Rec = Nothing End Function Public Sub UserLogs(strUserID As String, strRemarks As String, stridnum) user.SQLConnection.Execute "Insert into Medicare..tbMedLogs(userid, remarks,loginperiod, IDNum ) values('" & strUserID & "', '" & strRemarks & "', getDate(), '" & stridnum & "')" End Sub Public Function GetAllocatedMeds(stridnum As String, strPosition As String) Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Medicare..Medic_GetAllocatedMedAmounts '" & strPosition & "','" & stridnum & "','" & user.EmployeeCode & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetAllocatedMeds = Format(!Total, "###,##0.00") End If .Close End With Set Rec = Nothing End Function Public Function Load_ModSettings_Value(strModSet_ID As String) As Boolean Dim recX As New ADODB.Recordset Load_ModSettings_Value = False If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Select isnull(ModSet_Status,0) ModSet_Status from Medicare..tbMed_ModuleSettings Where ModSet_ID = '" & strModSet_ID & "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then Load_ModSettings_Value = recX!ModSet_Status Else Load_ModSettings_Value = False End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function isFinalCall(stridnum As String) As Boolean Dim SQL As String isFinalCall = False SQL = "Select Medicare.dbo.fn_isFinalCall('" & stridnum & "') as isFinalCall" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isFinalCall = !isFinalCall End If .Close End With Set Rec = Nothing End Function Public Function isPatient_PNFCirc20210012(stridnum As String) As Boolean Dim SQL As String isPatient_PNFCirc20210012 = False SQL = "Select Medicare.dbo.fn_isPxPNFCirc20210012('" & stridnum & "') as isPatient_PNFCirc20210012" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isPatient_PNFCirc20210012 = !isPatient_PNFCirc20210012 End If .Close End With Set Rec = Nothing End Function Public Function isPatient_ACRIncCirc20240001(stridnum As String) As Boolean Dim SQL As String isPatient_ACRIncCirc20240001 = False SQL = "Select Medicare.dbo.fn_isPxACRIncCirc20240001('" & stridnum & "') as isPatient_ACRIncCirc20240001" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isPatient_ACRIncCirc20240001 = !isPatient_ACRIncCirc20240001 End If .Close End With Set Rec = Nothing End Function Public Function isPatient_ESOACirc20230021(stridnum As String) As Boolean Dim SQL As String isPatient_ESOACirc20230021 = False SQL = "Select Medicare.dbo.fn_isPxESOACirc20230021('" & stridnum & "') as isPatient_ESOACirc20230021" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then isPatient_ESOACirc20230021 = !isPatient_ESOACirc20230021 End If .Close End With Set Rec = Nothing End Function Public Function isTransmitted(stridnum As String) As Boolean Dim SQL As String isTransmitted = False SQL = "Select isnull(TransDate,'') TransDate from medicare..tbmedpatient where IDnum = '" & stridnum & "' and isnull(TransDate,'') <> ''" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockReadOnly .Open SQL, user.SQLConnection If .RecordCount > 0 Then isTransmitted = True End If End With Set Rec = Nothing End Function