Attribute VB_Name = "modTemp" Option Explicit Public Const YELLOW = &H80000018 Public Const WHITE = &H8000000E Public Const BLACK = &H80000008 Public Const VIOLET = &HFFC0C0 Public user As Object 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 Public PatientList As New ListPatients Public clsPatient As Object 'Public clsPatient As New clsPatient Public BuildFiles As New MedBuildFiles Public LateSubmission As New LateSubmission Public RVS As New RVS Public BuildFiles_NM As New NM_MedBuildFiles Public pstrHospitalName As String Public pstrHospitalAddress As String Public pstrClient As String Public strpubHospnum As String Public strpubIDNum As String Public strOptionType As String Public strIdNum As String Public PhysicianPF As Double Public SurgeonPF As Double Public AnesPF As Double Public DoctorPF As Double Public ActualUserID As String Public pubDcrDate As String Public pstrAdministrator As String Public pstrAdminTitle As String Public blnCashMeds As Boolean Public blnWithOperationDate As Boolean Public blnFirstSlashing As Boolean Public pstrMemberType As String Public pstrMemberName As String 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 blnAllowEditPatientDays As Boolean Public blnAllowSeparatePart45 As Boolean Public blnAllowPart23Signatory As Boolean Public PublicPackage As String Public isPublicPackage As Boolean Public pstrPHICAccountNum As String Public PublicORAmount As String Public PubMaxDailyPF As Double Public PubDailyPF As Double Public PubSurgeonPFBelow500 As Double Public PubSurgeonPFUp500 As Double Public PubAnesPFBelow500 As Double Public PubAnesPFUp500 As Double Public recPostedList As New ADODB.Recordset Public recSubReceivableList As New ADODB.Recordset Public Form2Report As CRAXDRT.Report Public Form2crxApplication As CRAXDRT.Application Public pubMemberRelationship As String Public PublicPCF As Double Public ClientName As String Public PublicRB As Double Public PublicDrugs As Double Public PublicOthers As Double Public PublicOR As Double Public pstrHospitalTIN As String Public pstrHospitalTelNo As String Public blnMultipleDoctor As Boolean Public strSignatory As String 'Grid table Global Const coCapitalize = 1 Global Const coNumericOnly = 2 Global blnProceed As Boolean Global fs As Object Public Enum DOCTOR_PF ACTUAL_PF = 1 MEDICARE_PF = 2 End Enum 'For implementation of Forms 09.10.2010 'Public PubFormsImplementationDate As Date Public PubNewCF2Implementation As Date Public ServerDate As Date Public clsCardiologist As New clsCardiologist Public blnServicePerformed As Boolean Private strBirthDate As String Public strRemarks As String Public strDeathDate As String Public blnIsallowedmedAdjust As Boolean Public blnisCaseRatePatient As Boolean Public blnIsTransfer As Boolean Public strOtherHospName As String Public strOtherHospAddress As String Public strDisposition As String Public strTotalPatientDiscount As Double Public strTotalPatientDiscount_Doctor As Double Public strPurchaseOutsideAmount As Double Public strTotalPatientActual_Doctor As Double Public strOptLaterality As String Public OperationDate As Date Public strRVSCodeCase As String Public strCase1Amount As Double Public strCase2Amount As Double Public strisHMO As Boolean Public strIcdCodeCase1 As String Public strICDCODeCase2 As String Public strSignatoryOC As String Public strSignatoryPart As String Public strIcdCodeCaseEntry1 As String Public strIcdCodeCaseEntry2 As String 'Caserate Terms Public blnisAllowCaseRateTerms As Boolean Public PubAllowCaseRateTermsImplementationDate As Date 'restrict fields on CF2 Entry Public blnisAllowFieldsCF2 As Boolean 'allow all doctors on CF1 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 'activate PBEF Transmittal Public blnPBEFTransmittal As Boolean Public blnPBEFTransmittalImplementationDate As Date 'activate Automatic PF Sharing Public blnAutoPFSharing As Boolean 'enable CF2 Pre-print Public blnCF2Preprint As Boolean 'enable Prompt Px w/ 90 days confinement @CF1 Public bln90daysConfinement As Boolean 'isPBEF Public PubisPBEFImplementationDate As Date Public blnEnablePBEF As Boolean 'Transmittal Public blnisTransmittalCaseType As Boolean 'Split Caserate Public blnisallowSplitCaserate As Boolean 'Distribute Whole Caserate Public blnisDistributeWholeCaserate As Boolean Public blnPart34onEntry As Boolean 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 fs = CreateObject("Scripting.FileSystemObject") user.PasswordDeptCode = "8" user.ShowMain DoEvents frmSplash.Show frmSplash.Refresh blnOnLine = False If user.Connected Then user.SQLConnection.CommandTimeout = 120 If ConnectAll Then blnOnLine = True Else MsgBox "Important component was unable to connect to server.;" + _ "Please contact EDP personell for assistance.", vbInformation End If Else MsgBox "Unable to connect to server. Please contance EDP personell for assistance.", vbInformation End If If blnOnLine Then 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 HospitalInfo GetHospitalInfo 'ange oct.10.2017 GetAdministrator GetSignatory Load frmMedicare Unload frmSplash frmMedicare.Show Else Unload frmSplash End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Function ConnectAll() Dim blnConnected As Boolean 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 If PatientList.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.Value = frmSplash.pb.Value + 1 If RVS.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.Value = frmSplash.pb.Value + 1 If BuildFiles_NM.InitConnection(user.SQLConnection.ConnectionString) Then frmSplash.pb.Value = frmSplash.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 End If ConnectAll = blnConnected 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) Dim intctr As Integer Dim intDiagCount As Integer Dim strDx As String Dim strDiag As String Dim strDx1 As String Dim strDx2 As String Dim strDx3 As String Dim strDx4 As String Dim strDx5 As String Dim strICD1 As String Dim strICD2 As String Dim strICD3 As String Dim strICD4 As String Dim strICD5 As String Dim strIdNum As String Dim strPatientDays As String 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 Form2Report.ParameterFields(F_PATIENT_LASTNAME).AddCurrentValue Trim$(.LastName) Form2Report.ParameterFields(F_PATIENT_FIRSTNAME).AddCurrentValue .FirstName Form2Report.ParameterFields(F_PATIENT_MIDDLENAME).AddCurrentValue .MiddleName Form2Report.ParameterFields(F_SEX).AddCurrentValue .Sex Form2Report.ParameterFields(F_AGE).AddCurrentValue .Age Form2Report.ParameterFields(F_MEMBER_LASTNAME).AddCurrentValue .Member.LastName 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 Form2Report.ParameterFields(F_ADMISSIONDX).AddCurrentValue .Diagnosis.AdmissionDiagnosis 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(.AdmissionTime, "hh:mm:ss AMPM") Form2Report.ParameterFields(F_TIME_DISCHARGED).AddCurrentValue Format(.DischargeTime, "hh:mm:ss AMPM") If .Condition = "E" Then Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue Format(.DischargedDate, "mm/dd/yyyy") Else Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue "" End If If Right$(.IdNum, 1) = "B" Then Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue "OPD" Else If Format(.DischargedDate, "mm/dd/yyyy") = "01/01/1900" Then Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, Date), "#####") Else strPatientDays = GetPatientDays(.IdNum) If strPatientDays = "0" Then Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(DateDiff("d", .AdmissionDate, .DischargedDate), "#####") Else Form2Report.ParameterFields(F_CLAIMED_DAYS).AddCurrentValue Format(strPatientDays, "#####") End If End If End If 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") 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") Form2Report.ParameterFields(F_TOTALMED).AddCurrentValue Format((.Charges.Claim.MedicareRoomAndBoard + _ .Charges.Claim.MedicareDrugs + _ .Charges.Claim.MedicareOthers + _ .Charges.Claim.MedicareOR + _ .Charges.Claim.MedicareOutsideCharges), "##,###,##0.00") 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") Form2Report.ParameterFields(F_REPRESENTATIVE).AddCurrentValue .Signatory.SignatoryName Form2Report.ParameterFields(F_DATE_SIGNED).AddCurrentValue Format(Date, "mm/dd/yyyy") Form2Report.ParameterFields(F_OFFICIAL_CAPACITY).AddCurrentValue .Signatory.OfficialCapacity intDiagCount = .Diagnosis.FinalDiagnosis.Count ' strDx = "" ' If intDiagCount > 0 Then ' For intCtr = 1 To .Diagnosis.FinalDiagnosis.Count ' strDiag = Trim$(.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 ' Next intCtr ' End If 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 End Select Next intctr End If Form2Report.ParameterFields(F_FINAL_DX).AddCurrentValue Left(strDx, 254) If blnWithICD Then Form2Report.ParameterFields(F_DX1).AddCurrentValue strDx1 Form2Report.ParameterFields(F_DX2).AddCurrentValue strDx2 Form2Report.ParameterFields(F_DX3).AddCurrentValue strDx3 Form2Report.ParameterFields(F_DX4).AddCurrentValue strDx4 Form2Report.ParameterFields(F_DX5).AddCurrentValue strDx5 Form2Report.ParameterFields(F_ICD1).AddCurrentValue strICD1 Form2Report.ParameterFields(F_ICD2).AddCurrentValue strICD2 Form2Report.ParameterFields(F_ICD3).AddCurrentValue strICD3 Form2Report.ParameterFields(F_ICD4).AddCurrentValue strICD4 Form2Report.ParameterFields(F_ICD5).AddCurrentValue strICD5 End If Form2Report.ParameterFields(F_CASETYPE).AddCurrentValue IIf(Len(.CaseType) = 0, "O", .CaseType) If ServerDate >= PubFormsImplementationDate Then If Right(Trim$(.IdNum), 1) = "D" Then BirthDate .IdNum, True Else BirthDate .HospNum, False End If Form2Report.ParameterFields(F_BirthDate).AddCurrentValue Trim$(strBirthDate) Trim$ (GetRemarks(.IdNum)) Form2Report.ParameterFields(F_REMARKS).AddCurrentValue Trim$(strRemarks) Trim$ (GetDateOFDeath(.HospNum)) Form2Report.ParameterFields(F_DeathDate).AddCurrentValue Format(strDeathDate, "mm/dd/yyyy") If Format(.AdmissionDate, "mm/dd/yyyy") >= PubNewCF2Implementation Then Form2Report.ParameterFields(F_isTransfer).AddCurrentValue (blnIsTransfer) Form2Report.ParameterFields(F_OtherHosp).AddCurrentValue Trim$(strOtherHospName) Form2Report.ParameterFields(F_OtherAddress).AddCurrentValue Trim$(strOtherHospAddress) Form2Report.ParameterFields(F_Disposition).AddCurrentValue Trim$(strDisposition) Form2Report.ParameterFields(F_TotalDiscount).AddCurrentValue (strTotalPatientDiscount) Form2Report.ParameterFields(F_TotalDiscount_Doctor).AddCurrentValue (strTotalPatientDiscount_Doctor) Form2Report.ParameterFields(F_PurchaseOutsideAmount).AddCurrentValue (strPurchaseOutsideAmount) Form2Report.ParameterFields(F_OptLaterality).AddCurrentValue (strOptLaterality) Form2Report.ParameterFields(F_OperationDate).AddCurrentValue (OperationDate) Form2Report.ParameterFields(F_strRVSCodeCase).AddCurrentValue (strRVSCodeCase) Form2Report.ParameterFields(F_Case1Amount).AddCurrentValue (strCase1Amount) Form2Report.ParameterFields(F_Case2Amount).AddCurrentValue (strCase2Amount) Form2Report.ParameterFields(F_IcdCodeCase1).AddCurrentValue (strIcdCodeCase1) Form2Report.ParameterFields(F_IcdCodeCase2).AddCurrentValue (strICDCODeCase2) Form2Report.ParameterFields(F_TotalPatientActual_Doctor).AddCurrentValue (strTotalPatientActual_Doctor) End If End If End With End Sub Private Function GetRemarks(strID As String) As String Dim Rec As New ADODB.Recordset Dim stra As String Dim SQL As String stra = "SElect Remarks from medicare..tbMedActual where idnum = '" & strID & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open stra, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetRemarks = Rec![Remarks] End If .Close End With Set Rec = Nothing strRemarks = GetRemarks End Function Private Function GetDateOFDeath(strHospID As String) As String Dim Rec As New ADODB.Recordset Dim stra As String Dim SQL As String stra = "Select DeathTime from Patient_data..tbMasterDeathCertificate where Hospnum = '" & strHospID & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open stra, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetDateOFDeath = Rec![DeathTime] End If .Close End With Set Rec = Nothing strDeathDate = GetDateOFDeath End Function Public Sub PrintPhysician(intCount As Integer) With Medicare If intCount <= .Doctors.Physician.Count Then If Len(.Doctors.Physician(intCount).DocCode) > 0 Then 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 Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue .Doctors.Physician(intCount).ServicePerformed 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") Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue Format(.Doctors.Physician(intCount).PatientPF, "##,###,##0.00") Form2Report.ParameterFields(F_PHYS_DATEPERFORMED).AddCurrentValue Format(.Doctors.Physician(intCount).DatePeformed, "MM/dd/yyyy") ' If intCount = 2 Then ' Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "Referral Date" ' Else ' Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "Medical Visit" ' End If Else Form2Report.ParameterFields(F_PHYS_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_MED).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_DATEPERFORMED).AddCurrentValue "" End If Else Form2Report.ParameterFields(F_PHYS_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_MED).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_PHYS_DATEPERFORMED).AddCurrentValue "" End If End With End Sub Public Sub PrintSurgeon(intCount As Integer) With Medicare If intCount <= .Doctors.Surgeon.Count Then If Len(.Doctors.Surgeon(intCount).DocCode) > 0 Then 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 Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue .Doctors.Surgeon(intCount).ServicePerformed 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") Form2Report.ParameterFields(F_SURG_DATEPERFORMED).AddCurrentValue Format(.Doctors.Surgeon(intCount).DatePerformed, "mm/dd/yyyy") Else Form2Report.ParameterFields(F_SURG_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_MED).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_DATEPERFORMED).AddCurrentValue "" End If Else Form2Report.ParameterFields(F_SURG_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_MED).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_SURG_DATEPERFORMED).AddCurrentValue "" End If End With End Sub Public Sub PrintAnesthesiologist(intCount As Integer) With Medicare If intCount <= .Doctors.Anesthesiologist.Count Then If Len(.Doctors.Anesthesiologist(intCount).DocCode) > 0 Then 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 Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue IIf(Len(.Doctors.Anesthesiologist(intCount).ServicePerformed) = 0, "Anesthetist", .Doctors.Anesthesiologist(intCount).ServicePerformed) 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") Form2Report.ParameterFields(F_ANES_DATEPERFORMED).AddCurrentValue Format(.Doctors.Anesthesiologist(intCount).DatePerformed, "mm/dd/yyyy") Else Form2Report.ParameterFields(F_ANES_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_MED).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_DATEPERFORMED).AddCurrentValue "" End If Else Form2Report.ParameterFields(F_ANES_NAME).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_PHIC).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_TIN).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_SERVICES).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_ACTUAL).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_MED).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_PATIENT).AddCurrentValue "" Form2Report.ParameterFields(F_ANES_DATEPERFORMED).AddCurrentValue "" End If End With End Sub Public Sub PrintForm2(strIdNum As String, Optional intOption As Integer = 1) Dim intFormCount As Integer Dim recX As New ADODB.Recordset Dim blnMaternity As Boolean Dim strAdmDate As String intFormCount = 0 If Medicare.Search(strIdNum) Then With Medicare If intFormCount < .Doctors.Physician.Count Then intFormCount = .Doctors.Physician.Count 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 If Right(strIdNum, 1) = "D" Then strAdmDate = GetDirectAdmDate(strIdNum) Else strAdmDate = GetPatientAdmDate(strIdNum) End If If intFormCount = 1 Then Set Form2crxApplication = New CRAXDRT.Application Select Case intOption Case 1 If strAdmDate >= PubFormsImplementationDate Then If Right(strIdNum, 1) = "D" Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2_Direct.rpt") ElseIf strAdmDate >= PubNewCF2Implementation Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2Front.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimWithICD_Maternity.rpt") End If Case 2 Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimWithICD_Preprinted.rpt") Case 3 If strAdmDate >= PubFormsImplementationDate Then If Right(strIdNum, 1) = "D" Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2_Direct.rpt") ElseIf strAdmDate >= PubNewCF2Implementation Then Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2Front.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimForm2.rpt") End If Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\NewClaimWithICD.rpt") End If Case 4 End Select If intOption = 1 Or intOption = 2 Or intOption = 3 Then PrintGeneralInfo True PrintPhysician 1 PrintSurgeon 1 PrintAnesthesiologist 1 If strAdmDate >= PubFormsImplementationDate Then PrintCardiologist 1, strIdNum Form2Report.ParameterFields(F_IsBenefits).AddCurrentValue IIf(intOption = 1, True, False) Form2Report.ParameterFields(F_RoomClass).AddCurrentValue Trim$(GetRoomClass(strIdNum)) Form2Report.ParameterFields(F_IDNum).AddCurrentValue Trim$(strIdNum) End If End If frmViewForm2.Show vbModal Else Screen.MousePointer = vbDefault frmForm2.Form2Type = intOption frmForm2.FormCount = intFormCount frmForm2.Show vbModal End If End If End Sub Public Sub PrintBlankForm2() Set Form2crxApplication = New CRAXDRT.Application Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports_" + pstrClient + "\BlankForm2.rpt") PrintGenInfoForBlank 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 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 "Medicare..Medic_GetPF '" + strIdNum + "','" + strDocID + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly Else recX.Open "Medicare..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 "Medicare..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 FormatIndexNumber(strIndexNum As String) As String MsgBox "hi" 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 CountConfinement(strHospNum 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 & "'" Else strSQL = "Medicare..Medic_PatientCountConfinementNotice '" & strHospNum & "'" 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 UpdateMedicarePayments(strID As String, strORNumber As String, dblRoomBoard As Double, dblDrugs As Double, _ dblOthers As Double, dblOR As Double, strDatePaid As String, strUserID 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) & ", '" & strDatePaid & "', '" & strUserID & "'" user.SQLConnection.Execute strSQL Exit Function errHandle: UpdateMedicarePayments = False MsgBox Err.Description, vbCritical + vbOKOnly, "Error" 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 & "" pstrClient = recX!ClientName & "" End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub 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 Public Function GetActualMeds(strIdNum As String, strPosition As String) Dim Rec As New ADODB.Recordset Dim SQL As String GetActualMeds = 0 SQL = "Medicare..Medic_GetTempActualMedAmounts '" & strPosition & "','" & strIdNum & "','" & user.EmployeeCode & "'" 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 Get_DcrDate(strIdNum As String) As String Dim SQL As String Dim recMember As New ADODB.Recordset SQL = "Select AdmDate, isnull(DcrDate,'') DcrDate from Patient_Data..tbPatient where IDNum = '" & strIdNum & "'" With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then Get_DcrDate = IIf(ValidateDate(!DCRDate, !AdmDate), !DCRDate & "", "") End If .Close End With Set recMember = Nothing End Function Public Function ValidateDate(ByVal strValue As Date, ByVal strAdmDate As Date) As Boolean ValidateDate = False If IsDate(strValue) Then If strValue > strAdmDate Then ValidateDate = True Else ValidateDate = False End If Else ValidateDate = False End If End Function Public Sub GetHospitalInfo() Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select GetDate() As ServerDate, FormsImplementationDate,IsallowedmedAdjust,NewCF2Implementation From Medicare..tbMedHospital" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .EOF = False Then PubFormsImplementationDate = !FormsImplementationDate ServerDate = !ServerDate blnIsallowedmedAdjust = !IsallowedmedAdjust PubNewCF2Implementation = !NewCF2Implementation End If .Close End With Set Rec = Nothing End Sub Public Sub GetSignatory() Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select Signatory [Signatory]from Medicare..tbMedSignatory where Active = 1" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open SQL, user.SQLConnection If .EOF = False Then strSignatory = !Signatory & "" End If .Close End With Set Rec = Nothing End Sub Public Sub PrintCardiologist(intCount As Integer, strIdNum As String) blnServicePerformed = False With clsCardiologist .IdNum = strIdNum If .LoadCardioInfo Then If Len(.DocCode(intCount)) > 0 Then Form2Report.ParameterFields(F_CARDIO_NAME).AddCurrentValue .DocName(intCount) Form2Report.ParameterFields(F_CARDIO_PHIC).AddCurrentValue .PHICNumber(intCount) Form2Report.ParameterFields(F_CARDIO_SERVICES).AddCurrentValue .ServicePerformed(intCount) 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") Form2Report.ParameterFields(F_CARDIO_PERFORMEDDATE).AddCurrentValue Format(.DatePeformed(intCount), "MM/dd/yyyy") 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 BirthDate(strHospNum As String, Optional blnDirect As Boolean = False) As String Dim Rec As New ADODB.Recordset Dim SQL As String If blnDirect Then SQL = "Select BirthDate from Medicare..tbMedPatient where IDNum = '" & strHospNum & "'" Else SQL = "Select * from Patient_Data..tbMaster where Hospnum = '" & strHospNum & "'" End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then BirthDate = IIf(IsNull(!BirthDate), "", Format(!BirthDate, "MM/dd/yyyy")) End If .Close End With Set Rec = Nothing strBirthDate = BirthDate End Function Public Function GetRoomClass(strIdNum As String) As String Dim SQL As String Dim Rec As New ADODB.Recordset SQL = "Select Medicare.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 GetDirectAdmDate(strIdNum As String) As String Dim SQL As String Dim Rec As New ADODB.Recordset SQL = "Select Convert(Varchar(10), AdmDate, 101) AdmDate from Medicare..tbMedPatient where IDNum = '" & strIdNum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetDirectAdmDate = !AdmDate End If .Close End With Set Rec = Nothing End Function Public Function GetPatientDays(strIdNum As String) As String Dim SQL As String Dim Rec As New ADODB.Recordset SQL = "Select IsNull(PatientDays,'0') PatientDays from Medicare..tbMedActual where IDNum = '" & strIdNum & "'" GetPatientDays = "0" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetPatientDays = !PatientDays End If .Close End With Set Rec = Nothing End Function Public Function isPatientTaggedForTransmittal(strIdNum As String) As String Dim recSQL As New ADODB.Recordset Dim strSQL As String strSQL = "Medicare..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 GetPatientAdmDate(strIdNum As String) As String Dim SQL As String Dim Rec As New ADODB.Recordset SQL = "Select Convert(Varchar(10), AdmDate, 101) AdmDate from Patient_Data..tbPatient where IDNum = '" & strIdNum & "' " & _ "UNION ALL " & _ "Select Convert(Varchar(10), AdmDate, 101) AdmDate from Patient_Data..tbOutPatient where IDNum = '" & strIdNum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetPatientAdmDate = !AdmDate End If .Close End With Set Rec = Nothing End Function Public Sub TextboxNumeric(KeyAscii As Integer) Select Case KeyAscii Case 46, 48 To 57, 8 ' Case vbKeyReturn: SendKeys "{Tab}" Case Else: KeyAscii = 0 End Select End Sub Public Sub InsertPettycash(strIdNum As String, strORNumber As String, strDatePaid As String, strPaymentfor As String, strEntry As String, strRefundAmount As Double, strPayment As Double, strPatientName As String, strUserID As String) user.SQLConnection.Execute "Medicare.dbo.Medic_InsertPettyCash " _ + " '" & Trim$(strIdNum) & "', " _ + " '" & Trim$(strORNumber) & "', " _ + " '" & Trim$(strDatePaid) & "', " _ + " '" & Trim$(strPaymentfor) & "', " _ + " '" & Trim$(strEntry) & "', " _ + " '" & Trim$(strRefundAmount) & "'," _ + " '" & Trim$(strPayment) & "'," _ + " '" & Trim$(strPatientName) & "'," _ + " '" & Trim$(strUserID) & "'" End Sub