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 Public puser As Object '' '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 'eclaims Public clsMDR As New classMDR 'eclaims 'khing 6.24.14 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 clsObstetrician As New clsObstetrician Public clsPediatrician As New clsPediatrician 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 region 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 PubBenefitsImplementationDate As Date Public blnAllowSeparatePart45 As Boolean Public blnAllowEditPatientDays As Boolean Public blnAllowPart23Signatory As Boolean Public blnPart34onEntry 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 'Transmittal Per User Public blnTransmittalPerUser As Boolean '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 '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 strDx21 As String Public strDx22 As String Public strDx23 As String Public strDx24 As String Public strDx25 As String Public strDx26 As String Public strDx27 As String Public strDx28 As String Public strDx29 As String Public strDx30 As String Public strDx31 As String Public strDx32 As String Public strDx33 As String Public strDx34 As String Public strDx35 As String Public strDx36 As String Public strDx37 As String Public strDx38 As String Public strDx39 As String Public strDx40 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 strICD21 As String Public strICD22 As String Public strICD23 As String Public strICD24 As String Public strICD25 As String Public strICD26 As String Public strICD27 As String Public strICD28 As String Public strICD29 As String Public strICD30 As String Public strICD31 As String Public strICD32 As String Public strICD33 As String Public strICD34 As String Public strICD35 As String Public strICD36 As String Public strICD37 As String Public strICD38 As String Public strICD39 As String Public strICD40 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 Public strRVSCode21 As String Public strRVSCode22 As String Public strRVSCode23 As String Public strRVSCode24 As String Public strRVSCode25 As String Public strRVSCode26 As String Public strRVSCode27 As String Public strRVSCode28 As String Public strRVSCode29 As String Public strRVSCode30 As String Public strRVSCode31 As String Public strRVSCode32 As String Public strRVSCode33 As String Public strRVSCode34 As String Public strRVSCode35 As String Public strRVSCode36 As String Public strRVSCode37 As String Public strRVSCode38 As String Public strRVSCode39 As String Public strRVSCode40 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 strLaterality11 As String Public strLaterality12 As String Public strLaterality13 As String Public strLaterality14 As String Public strLaterality15 As String Public strLaterality16 As String Public strLaterality17 As String Public strLaterality18 As String Public strLaterality19 As String Public strLaterality20 As String Public strLaterality21 As String Public strLaterality22 As String Public strLaterality23 As String Public strLaterality24 As String Public strLaterality25 As String Public strLaterality26 As String Public strLaterality27 As String Public strLaterality28 As String Public strLaterality29 As String Public strLaterality30 As String Public strLaterality31 As String Public strLaterality32 As String Public strLaterality33 As String Public strLaterality34 As String Public strLaterality35 As String Public strLaterality36 As String Public strLaterality37 As String Public strLaterality38 As String Public strLaterality39 As String Public strLaterality40 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 strRelatedProcedure11 As String Public strRelatedProcedure12 As String Public strRelatedProcedure13 As String Public strRelatedProcedure14 As String Public strRelatedProcedure15 As String Public strRelatedProcedure16 As String Public strRelatedProcedure17 As String Public strRelatedProcedure18 As String Public strRelatedProcedure19 As String Public strRelatedProcedure20 As String Public strRelatedProcedure21 As String Public strRelatedProcedure22 As String Public strRelatedProcedure23 As String Public strRelatedProcedure24 As String Public strRelatedProcedure25 As String Public strRelatedProcedure26 As String Public strRelatedProcedure27 As String Public strRelatedProcedure28 As String Public strRelatedProcedure29 As String Public strRelatedProcedure30 As String Public strRelatedProcedure31 As String Public strRelatedProcedure32 As String Public strRelatedProcedure33 As String Public strRelatedProcedure34 As String Public strRelatedProcedure35 As String Public strRelatedProcedure36 As String Public strRelatedProcedure37 As String Public strRelatedProcedure38 As String Public strRelatedProcedure39 As String Public strRelatedProcedure40 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 strICDRVS11 As String Public strICDRVS12 As String Public strICDRVS13 As String Public strICDRVS14 As String Public strICDRVS15 As String Public strICDRVS16 As String Public strICDRVS17 As String Public strICDRVS18 As String Public strICDRVS19 As String Public strICDRVS20 As String Public strICDRVS21 As String Public strICDRVS22 As String Public strICDRVS23 As String Public strICDRVS24 As String Public strICDRVS25 As String Public strICDRVS26 As String Public strICDRVS27 As String Public strICDRVS28 As String Public strICDRVS29 As String Public strICDRVS30 As String Public strICDRVS31 As String Public strICDRVS32 As String Public strICDRVS33 As String Public strICDRVS34 As String Public strICDRVS35 As String Public strICDRVS36 As String Public strICDRVS37 As String Public strICDRVS38 As String Public strICDRVS39 As String Public strICDRVS40 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 Public strDateOfOperation11 As String Public strDateOfOperation12 As String Public strDateOfOperation13 As String Public strDateOfOperation14 As String Public strDateOfOperation15 As String Public strDateOfOperation16 As String Public strDateOfOperation17 As String Public strDateOfOperation18 As String Public strDateOfOperation19 As String Public strDateOfOperation20 As String Public strDateOfOperation21 As String Public strDateOfOperation22 As String Public strDateOfOperation23 As String Public strDateOfOperation24 As String Public strDateOfOperation25 As String Public strDateOfOperation26 As String Public strDateOfOperation27 As String Public strDateOfOperation28 As String Public strDateOfOperation29 As String Public strDateOfOperation30 As String Public strDateOfOperation31 As String Public strDateOfOperation32 As String Public strDateOfOperation33 As String Public strDateOfOperation34 As String Public strDateOfOperation35 As String Public strDateOfOperation36 As String Public strDateOfOperation37 As String Public strDateOfOperation38 As String Public strDateOfOperation39 As String Public strDateOfOperation40 As String 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 '**** 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 dblCountDoctor As Double Public blnCheckDocExpiry As Boolean Public blnEnable24HoursConfinementRule As Boolean Public lngConfinementHours As Long Public blnCF4ExemptCode As Boolean Public Report As CRAXDRT.Report Public Enum DOCTOR_PF ACTUAL_PF = 1 MEDICARE_PF = 2 FirstCase_PF = 3 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") user.PasswordDeptCode = "8" user.ShowMain DoEvents blnOnLine = False If user.Connected Then ' ' With user.MEDSYSClasses ' .exepath = App.Path ' .OpenMainReport "Report1.rpt", "", "" ' End With ' ' Exit Sub ' ' '' '' ' With user.MEDSYSClasses ' .exepath = App.Path ' .AutoParameter = True ' .AutoParameterVer = 1 ' .ParamClear ' .ParamAdd "@IDNUm", "97" ' .ParamAdd "@UserID", "8" ' .OpenMainReport "ClaimForm4Page1.rpt", "", "" ' End With ' ' Exit Sub ' pclsCodeSearch.SearchMode = True pclsCodeSearch.Initialize_Classes pclsCodeSearch.Connection = user.SQLConnection user.MEDSYSClasses.UseClasses = True user.MEDSYSClasses.InitWithDB MEDSYSClass.MedsysUser = user ' MEDSYSClass.EXEPath = App.Path ' PCLSUser.SetExePath = App.Path user.MEDSYSClasses.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 GetRegion 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" 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 = "" strICD6 = "" strICD7 = "" strICD8 = "" strICD9 = "" strICD10 = "" strICD11 = "" strICD12 = "" strICD13 = "" strICD14 = "" strICD15 = "" strICD16 = "" strICD17 = "" strICD18 = "" strICD19 = "" strICD20 = "" strICD21 = "" strICD22 = "" strICD23 = "" strICD24 = "" strICD25 = "" strICD26 = "" strICD27 = "" strICD28 = "" strICD29 = "" strICD30 = "" strICD31 = "" strICD32 = "" strICD33 = "" strICD34 = "" strICD35 = "" strICD36 = "" strICD37 = "" strICD38 = "" strICD39 = "" strICD40 = "" 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 strDx10 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD10 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 11 strDx11 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD11 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 12 strDx12 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD12 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 13 strDx13 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD13 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 14 strDx14 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD14 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 15 strDx15 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD15 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 16 strDx16 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD16 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 17 strDx17 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD17 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 18 strDx18 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD18 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 19 strDx19 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD19 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 20 strDx20 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD20 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 21 strDx21 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD21 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 22 strDx22 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD22 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 23 strDx23 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD23 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 24 strDx24 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD24 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 25 strDx25 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD25 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 26 strDx26 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD26 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 27 strDx27 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD27 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 28 strDx28 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD28 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 29 strDx29 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD29 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 30 strDx30 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD30 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 31 strDx31 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD31 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 32 strDx32 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD32 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 33 strDx33 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD33 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 34 strDx34 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD34 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 35 strDx33 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD35 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 36 strDx36 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD36 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 37 strDx37 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD37 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 38 strDx38 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD38 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 39 strDx39 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD39 = .Diagnosis.FinalDiagnosis(intctr).ICDCode Case 40 strDx40 = .Diagnosis.FinalDiagnosis(intctr).DiagText strICD40 = .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, 255) 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_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_DX15).AddCurrentValue Left$(strDx15, 255) Form2Report.ParameterFields(F_DX16).AddCurrentValue Left$(strDx16, 255) Form2Report.ParameterFields(F_DX17).AddCurrentValue Left$(strDx17, 255) Form2Report.ParameterFields(F_DX18).AddCurrentValue Left$(strDx18, 255) Form2Report.ParameterFields(F_DX19).AddCurrentValue Left$(strDx19, 255) Form2Report.ParameterFields(F_DX20).AddCurrentValue Left$(strDx20, 255) Form2Report.ParameterFields(F_DX21).AddCurrentValue Left$(strDx21, 255) Form2Report.ParameterFields(F_DX22).AddCurrentValue Left$(strDx22, 255) Form2Report.ParameterFields(F_DX23).AddCurrentValue Left$(strDx23, 255) Form2Report.ParameterFields(F_DX24).AddCurrentValue Left$(strDx24, 255) Form2Report.ParameterFields(F_DX25).AddCurrentValue Left$(strDx25, 255) Form2Report.ParameterFields(F_DX26).AddCurrentValue Left$(strDx26, 255) Form2Report.ParameterFields(F_DX27).AddCurrentValue Left$(strDx27, 255) Form2Report.ParameterFields(F_DX28).AddCurrentValue Left$(strDx28, 255) Form2Report.ParameterFields(F_DX29).AddCurrentValue Left$(strDx29, 255) Form2Report.ParameterFields(F_DX30).AddCurrentValue Left$(strDx30, 255) Form2Report.ParameterFields(F_DX31).AddCurrentValue Left$(strDx31, 255) Form2Report.ParameterFields(F_DX32).AddCurrentValue Left$(strDx32, 255) Form2Report.ParameterFields(F_DX33).AddCurrentValue Left$(strDx33, 255) Form2Report.ParameterFields(F_DX34).AddCurrentValue Left$(strDx34, 255) Form2Report.ParameterFields(F_DX35).AddCurrentValue Left$(strDx35, 255) Form2Report.ParameterFields(F_DX36).AddCurrentValue Left$(strDx36, 255) Form2Report.ParameterFields(F_DX37).AddCurrentValue Left$(strDx37, 255) Form2Report.ParameterFields(F_DX38).AddCurrentValue Left$(strDx38, 255) Form2Report.ParameterFields(F_DX39).AddCurrentValue Left$(strDx39, 255) Form2Report.ParameterFields(F_DX40).AddCurrentValue Left$(strDx40, 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) Form2Report.ParameterFields(F_ICD15).AddCurrentValue Left$(strICD15, 255) Form2Report.ParameterFields(F_ICD16).AddCurrentValue Left$(strICD16, 255) Form2Report.ParameterFields(F_ICD17).AddCurrentValue Left$(strICD17, 255) Form2Report.ParameterFields(F_ICD18).AddCurrentValue Left$(strICD18, 255) Form2Report.ParameterFields(F_ICD19).AddCurrentValue Left$(strICD19, 255) Form2Report.ParameterFields(F_ICD20).AddCurrentValue Left$(strICD20, 255) Form2Report.ParameterFields(F_ICD21).AddCurrentValue Left$(strICD21, 255) Form2Report.ParameterFields(F_ICD22).AddCurrentValue Left$(strICD22, 255) Form2Report.ParameterFields(F_ICD23).AddCurrentValue Left$(strICD23, 255) Form2Report.ParameterFields(F_ICD24).AddCurrentValue Left$(strICD24, 255) Form2Report.ParameterFields(F_ICD25).AddCurrentValue Left$(strICD25, 255) Form2Report.ParameterFields(F_ICD26).AddCurrentValue Left$(strICD26, 255) Form2Report.ParameterFields(F_ICD27).AddCurrentValue Left$(strICD27, 255) Form2Report.ParameterFields(F_ICD28).AddCurrentValue Left$(strICD28, 255) Form2Report.ParameterFields(F_ICD29).AddCurrentValue Left$(strICD29, 255) Form2Report.ParameterFields(F_ICD30).AddCurrentValue Left$(strICD30, 255) Form2Report.ParameterFields(F_ICD31).AddCurrentValue Left$(strICD31, 255) Form2Report.ParameterFields(F_ICD32).AddCurrentValue Left$(strICD32, 255) Form2Report.ParameterFields(F_ICD33).AddCurrentValue Left$(strICD33, 255) Form2Report.ParameterFields(F_ICD34).AddCurrentValue Left$(strICD34, 255) Form2Report.ParameterFields(F_ICD35).AddCurrentValue Left$(strICD35, 255) Form2Report.ParameterFields(F_ICD36).AddCurrentValue Left$(strICD36, 255) Form2Report.ParameterFields(F_ICD37).AddCurrentValue Left$(strICD37, 255) Form2Report.ParameterFields(F_ICD38).AddCurrentValue Left$(strICD38, 255) Form2Report.ParameterFields(F_ICD39).AddCurrentValue Left$(strICD39, 255) Form2Report.ParameterFields(F_ICD40).AddCurrentValue Left$(strICD40, 255) Form2Report.ParameterFields(F_Laterality10).AddCurrentValue strLaterality10 Form2Report.ParameterFields(F_Laterality11).AddCurrentValue strLaterality11 Form2Report.ParameterFields(F_Laterality12).AddCurrentValue strLaterality12 Form2Report.ParameterFields(F_Laterality13).AddCurrentValue strLaterality13 Form2Report.ParameterFields(F_Laterality14).AddCurrentValue strLaterality14 Form2Report.ParameterFields(F_Laterality15).AddCurrentValue strLaterality15 Form2Report.ParameterFields(F_Laterality16).AddCurrentValue strLaterality16 Form2Report.ParameterFields(F_Laterality17).AddCurrentValue strLaterality17 Form2Report.ParameterFields(F_Laterality18).AddCurrentValue strLaterality18 Form2Report.ParameterFields(F_Laterality19).AddCurrentValue strLaterality19 Form2Report.ParameterFields(F_Laterality20).AddCurrentValue strLaterality20 Form2Report.ParameterFields(F_Laterality21).AddCurrentValue strLaterality21 Form2Report.ParameterFields(F_Laterality22).AddCurrentValue strLaterality22 Form2Report.ParameterFields(F_Laterality23).AddCurrentValue strLaterality23 Form2Report.ParameterFields(F_Laterality24).AddCurrentValue strLaterality24 Form2Report.ParameterFields(F_Laterality25).AddCurrentValue strLaterality25 Form2Report.ParameterFields(F_Laterality26).AddCurrentValue strLaterality26 Form2Report.ParameterFields(F_Laterality27).AddCurrentValue strLaterality27 Form2Report.ParameterFields(F_Laterality28).AddCurrentValue strLaterality28 Form2Report.ParameterFields(F_Laterality29).AddCurrentValue strLaterality29 Form2Report.ParameterFields(F_Laterality30).AddCurrentValue strLaterality30 Form2Report.ParameterFields(F_Laterality31).AddCurrentValue strLaterality31 Form2Report.ParameterFields(F_Laterality32).AddCurrentValue strLaterality32 Form2Report.ParameterFields(F_Laterality33).AddCurrentValue strLaterality33 Form2Report.ParameterFields(F_Laterality34).AddCurrentValue strLaterality34 Form2Report.ParameterFields(F_Laterality35).AddCurrentValue strLaterality35 Form2Report.ParameterFields(F_Laterality36).AddCurrentValue strLaterality36 Form2Report.ParameterFields(F_Laterality37).AddCurrentValue strLaterality37 Form2Report.ParameterFields(F_Laterality38).AddCurrentValue strLaterality38 Form2Report.ParameterFields(F_Laterality39).AddCurrentValue strLaterality39 Form2Report.ParameterFields(F_Laterality40).AddCurrentValue strLaterality40 Form2Report.ParameterFields(F_RelatedProcedure10).AddCurrentValue Left$(strRelatedProcedure10, 255) Form2Report.ParameterFields(F_RelatedProcedure11).AddCurrentValue Left$(strRelatedProcedure11, 255) Form2Report.ParameterFields(F_RelatedProcedure12).AddCurrentValue Left$(strRelatedProcedure12, 255) Form2Report.ParameterFields(F_RelatedProcedure13).AddCurrentValue Left$(strRelatedProcedure13, 255) Form2Report.ParameterFields(F_RelatedProcedure14).AddCurrentValue Left$(strRelatedProcedure14, 255) Form2Report.ParameterFields(F_RelatedProcedure15).AddCurrentValue Left$(strRelatedProcedure15, 255) Form2Report.ParameterFields(F_RelatedProcedure16).AddCurrentValue Left$(strRelatedProcedure16, 255) Form2Report.ParameterFields(F_RelatedProcedure17).AddCurrentValue Left$(strRelatedProcedure17, 255) Form2Report.ParameterFields(F_RelatedProcedure18).AddCurrentValue Left$(strRelatedProcedure18, 255) Form2Report.ParameterFields(F_RelatedProcedure19).AddCurrentValue Left$(strRelatedProcedure19, 255) Form2Report.ParameterFields(F_RelatedProcedure20).AddCurrentValue Left$(strRelatedProcedure20, 255) Form2Report.ParameterFields(F_RelatedProcedure21).AddCurrentValue Left$(strRelatedProcedure21, 255) Form2Report.ParameterFields(F_RelatedProcedure22).AddCurrentValue Left$(strRelatedProcedure22, 255) Form2Report.ParameterFields(F_RelatedProcedure23).AddCurrentValue Left$(strRelatedProcedure23, 255) Form2Report.ParameterFields(F_RelatedProcedure24).AddCurrentValue Left$(strRelatedProcedure24, 255) Form2Report.ParameterFields(F_RelatedProcedure25).AddCurrentValue Left$(strRelatedProcedure25, 255) Form2Report.ParameterFields(F_RelatedProcedure26).AddCurrentValue Left$(strRelatedProcedure26, 255) Form2Report.ParameterFields(F_RelatedProcedure27).AddCurrentValue Left$(strRelatedProcedure27, 255) Form2Report.ParameterFields(F_RelatedProcedure28).AddCurrentValue Left$(strRelatedProcedure28, 255) Form2Report.ParameterFields(F_RelatedProcedure29).AddCurrentValue Left$(strRelatedProcedure29, 255) Form2Report.ParameterFields(F_RelatedProcedure30).AddCurrentValue Left$(strRelatedProcedure30, 255) Form2Report.ParameterFields(F_RelatedProcedure31).AddCurrentValue Left$(strRelatedProcedure31, 255) Form2Report.ParameterFields(F_RelatedProcedure32).AddCurrentValue Left$(strRelatedProcedure32, 255) Form2Report.ParameterFields(F_RelatedProcedure33).AddCurrentValue Left$(strRelatedProcedure33, 255) Form2Report.ParameterFields(F_RelatedProcedure34).AddCurrentValue Left$(strRelatedProcedure34, 255) Form2Report.ParameterFields(F_RelatedProcedure35).AddCurrentValue Left$(strRelatedProcedure35, 255) Form2Report.ParameterFields(F_RelatedProcedure36).AddCurrentValue Left$(strRelatedProcedure36, 255) Form2Report.ParameterFields(F_RelatedProcedure37).AddCurrentValue Left$(strRelatedProcedure37, 255) Form2Report.ParameterFields(F_RelatedProcedure38).AddCurrentValue Left$(strRelatedProcedure38, 255) Form2Report.ParameterFields(F_RelatedProcedure39).AddCurrentValue Left$(strRelatedProcedure39, 255) Form2Report.ParameterFields(F_RelatedProcedure40).AddCurrentValue Left$(strRelatedProcedure40, 255) Form2Report.ParameterFields(F_DateOfOperation10).AddCurrentValue Left$(strDateOfOperation10, 255) Form2Report.ParameterFields(F_DateOfOperation11).AddCurrentValue Left$(strDateOfOperation11, 255) Form2Report.ParameterFields(F_DateOfOperation12).AddCurrentValue Left$(strDateOfOperation12, 255) Form2Report.ParameterFields(F_DateOfOperation13).AddCurrentValue Left$(strDateOfOperation13, 255) Form2Report.ParameterFields(F_DateOfOperation14).AddCurrentValue Left$(strDateOfOperation14, 255) Form2Report.ParameterFields(F_DateOfOperation15).AddCurrentValue Left$(strDateOfOperation15, 255) Form2Report.ParameterFields(F_DateOfOperation16).AddCurrentValue Left$(strDateOfOperation16, 255) Form2Report.ParameterFields(F_DateOfOperation17).AddCurrentValue Left$(strDateOfOperation17, 255) Form2Report.ParameterFields(F_DateOfOperation18).AddCurrentValue Left$(strDateOfOperation18, 255) Form2Report.ParameterFields(F_DateOfOperation19).AddCurrentValue Left$(strDateOfOperation19, 255) Form2Report.ParameterFields(F_DateOfOperation20).AddCurrentValue Left$(strDateOfOperation20, 255) Form2Report.ParameterFields(F_DateOfOperation21).AddCurrentValue Left$(strDateOfOperation21, 255) Form2Report.ParameterFields(F_DateOfOperation22).AddCurrentValue Left$(strDateOfOperation22, 255) Form2Report.ParameterFields(F_DateOfOperation23).AddCurrentValue Left$(strDateOfOperation23, 255) Form2Report.ParameterFields(F_DateOfOperation24).AddCurrentValue Left$(strDateOfOperation24, 255) Form2Report.ParameterFields(F_DateOfOperation25).AddCurrentValue Left$(strDateOfOperation25, 255) Form2Report.ParameterFields(F_DateOfOperation26).AddCurrentValue Left$(strDateOfOperation26, 255) Form2Report.ParameterFields(F_DateOfOperation27).AddCurrentValue Left$(strDateOfOperation27, 255) Form2Report.ParameterFields(F_DateOfOperation28).AddCurrentValue Left$(strDateOfOperation28, 255) Form2Report.ParameterFields(F_DateOfOperation29).AddCurrentValue Left$(strDateOfOperation29, 255) Form2Report.ParameterFields(F_DateOfOperation30).AddCurrentValue Left$(strDateOfOperation30, 255) Form2Report.ParameterFields(F_DateOfOperation31).AddCurrentValue Left$(strDateOfOperation31, 255) Form2Report.ParameterFields(F_DateOfOperation32).AddCurrentValue Left$(strDateOfOperation32, 255) Form2Report.ParameterFields(F_DateOfOperation33).AddCurrentValue Left$(strDateOfOperation33, 255) Form2Report.ParameterFields(F_DateOfOperation34).AddCurrentValue Left$(strDateOfOperation34, 255) Form2Report.ParameterFields(F_DateOfOperation35).AddCurrentValue Left$(strDateOfOperation35, 255) Form2Report.ParameterFields(F_DateOfOperation36).AddCurrentValue Left$(strDateOfOperation36, 255) Form2Report.ParameterFields(F_DateOfOperation37).AddCurrentValue Left$(strDateOfOperation37, 255) Form2Report.ParameterFields(F_DateOfOperation38).AddCurrentValue Left$(strDateOfOperation38, 255) Form2Report.ParameterFields(F_DateOfOperation39).AddCurrentValue Left$(strDateOfOperation39, 255) Form2Report.ParameterFields(F_DateOfOperation40).AddCurrentValue Left$(strDateOfOperation40, 255) Form2Report.ParameterFields(F_RVSCode10).AddCurrentValue Left$(strICDRVS10, 255) Form2Report.ParameterFields(F_RVSCode11).AddCurrentValue Left$(strICDRVS11, 255) Form2Report.ParameterFields(F_RVSCode12).AddCurrentValue Left$(strICDRVS12, 255) Form2Report.ParameterFields(F_RVSCode13).AddCurrentValue Left$(strICDRVS13, 255) Form2Report.ParameterFields(F_RVSCode14).AddCurrentValue Left$(strICDRVS14, 255) Form2Report.ParameterFields(F_RVSCode15).AddCurrentValue Left$(strICDRVS15, 255) Form2Report.ParameterFields(F_RVSCode16).AddCurrentValue Left$(strICDRVS16, 255) Form2Report.ParameterFields(F_RVSCode17).AddCurrentValue Left$(strICDRVS17, 255) Form2Report.ParameterFields(F_RVSCode18).AddCurrentValue Left$(strICDRVS18, 255) Form2Report.ParameterFields(F_RVSCode19).AddCurrentValue Left$(strICDRVS19, 255) Form2Report.ParameterFields(F_RVSCode20).AddCurrentValue Left$(strICDRVS20, 255) Form2Report.ParameterFields(F_RVSCode21).AddCurrentValue Left$(strICDRVS21, 255) Form2Report.ParameterFields(F_RVSCode22).AddCurrentValue Left$(strICDRVS22, 255) Form2Report.ParameterFields(F_RVSCode23).AddCurrentValue Left$(strICDRVS23, 255) Form2Report.ParameterFields(F_RVSCode24).AddCurrentValue Left$(strICDRVS24, 255) Form2Report.ParameterFields(F_RVSCode25).AddCurrentValue Left$(strICDRVS25, 255) Form2Report.ParameterFields(F_RVSCode26).AddCurrentValue Left$(strICDRVS26, 255) Form2Report.ParameterFields(F_RVSCode27).AddCurrentValue Left$(strICDRVS27, 255) Form2Report.ParameterFields(F_RVSCode28).AddCurrentValue Left$(strICDRVS28, 255) Form2Report.ParameterFields(F_RVSCode29).AddCurrentValue Left$(strICDRVS29, 255) Form2Report.ParameterFields(F_RVSCode30).AddCurrentValue Left$(strICDRVS30, 255) Form2Report.ParameterFields(F_RVSCode31).AddCurrentValue Left$(strICDRVS31, 255) Form2Report.ParameterFields(F_RVSCode32).AddCurrentValue Left$(strICDRVS32, 255) Form2Report.ParameterFields(F_RVSCode33).AddCurrentValue Left$(strICDRVS33, 255) Form2Report.ParameterFields(F_RVSCode34).AddCurrentValue Left$(strICDRVS34, 255) Form2Report.ParameterFields(F_RVSCode35).AddCurrentValue Left$(strICDRVS35, 255) Form2Report.ParameterFields(F_RVSCode36).AddCurrentValue Left$(strICDRVS36, 255) Form2Report.ParameterFields(F_RVSCode37).AddCurrentValue Left$(strICDRVS37, 255) Form2Report.ParameterFields(F_RVSCode38).AddCurrentValue Left$(strICDRVS38, 255) Form2Report.ParameterFields(F_RVSCode39).AddCurrentValue Left$(strICDRVS39, 255) Form2Report.ParameterFields(F_RVSCode40).AddCurrentValue Left$(strICDRVS40, 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") And strAdmDate < PubACRFormsImplementationDate 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 And strAdmDate < PubACRFormsImplementationDate 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) Case 11 strLaterality11 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure11 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS11 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation11 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 12 strLaterality12 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure12 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS12 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation12 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 13 strLaterality13 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure13 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS13 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation13 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 14 strLaterality14 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure14 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS14 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation14 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 15 strLaterality15 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure15 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS15 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation15 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 16 strLaterality16 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure16 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS16 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation16 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 17 strLaterality17 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure17 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS17 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation17 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 18 strLaterality18 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure18 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS18 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation18 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 19 strLaterality19 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure19 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS19 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation19 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 20 strLaterality20 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure20 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS20 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation20 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 21 strLaterality21 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure21 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS21 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation21 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 22 strLaterality22 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure22 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS22 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation22 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 23 strLaterality23 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure23 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS23 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation23 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 24 strLaterality24 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure24 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS24 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation24 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 25 strLaterality25 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure25 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS25 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation25 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 26 strLaterality26 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure26 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS26 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation26 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 27 strLaterality27 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure27 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS27 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation27 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 28 strLaterality28 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure28 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS28 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation28 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 29 strLaterality29 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure29 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS29 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation29 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 30 strLaterality30 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure30 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS30 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation30 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 31 strLaterality31 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure31 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS31 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation31 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 32 strLaterality32 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure32 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS32 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation32 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 33 strLaterality33 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure33 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS33 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation33 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 34 strLaterality34 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure34 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS34 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation34 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 35 strLaterality35 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure35 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS35 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation35 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 36 strLaterality36 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure36 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS36 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation36 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 37 strLaterality37 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure37 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS37 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation37 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 38 strLaterality38 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure38 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS38 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation38 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 39 strLaterality39 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure39 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS39 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation39 = IIf(IsNull(!DateOfOperation), "", !DateOfOperation) Case 40 strLaterality40 = IIf(IsNull(!Laterality), "", !Laterality) strRelatedProcedure40 = IIf(IsNull(!RelatedOperation), "", !RelatedOperation) strICDRVS40 = IIf(IsNull(!RVSCode), "", !RVSCode) strDateOfOperation40 = 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 MEDICARE..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" 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 If ClientName = "WCI" Then Set Form2Report = Form2crxApplication.OpenReport(pubSubReports + "\NewClaimForm2ACR.rpt") Else Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2ACR.rpt") End If 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 'ange 'Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2_Preprinted.rpt") Set Form2Report = Form2crxApplication.OpenReport(App.Path + "\Reports\NewClaimForm2ACR_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") End Select If intOption = 3 Or intOption = 4 Or intOption = 5 Or intOption = 6 Or intOption = 7 Or intOption = 8 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 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 Select Case intOption Case 3 frmMedicare.mnuACRFormat_Click Case 4 frmMedicare.mnuACR4and5Preprint_Click End Select 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) ' commented by ange 06.15.2021 ' 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 medicare..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 & "" pstrHospitalTIN = recX!TinNo & "" pstrHospitalTelNo = recX!ContactNo & "" End If If recX.State > 0 Then recX.Close Set recX = Nothing End Sub Public Function LoadSwitchValue(strIDKey As String) As Boolean Dim recX As New ADODB.Recordset LoadSwitchValue = False If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Select isnull(KeyValue,0) KeyValue from Medicare..tbMedSwitch Where IDKey = '" + strIDKey + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then LoadSwitchValue = recX!KeyValue Else LoadSwitchValue = False End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Sub UserLogs(strUserID As String, strRemarks As String, strIdNum As String) 'user.SQLConnection.Execute "Insert into Medicare..tbMedLogs values('" & strUserID & "', '" & strRemarks & "', getDate())" user.SQLConnection.Execute "Insert into Medicare..tbMedLogs(userid, remarks,loginperiod, IDNum, Mod_Version) values('" & strUserID & "', '" & strRemarks & "', getDate(), '" & strIdNum & "', '" & App.Major & "." & App.Minor & "." & App.Revision & "')" 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 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 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 Public Function GetActual(strIdNum As String) 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 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 BirthDate 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 'DoctorPaymentAmount Public Function GetDoctorPaymentAmount(strIdNum As String) As Double Dim Rec As New ADODB.Recordset Dim SQL As String SQL = "Select isnull(Sum(IsNull(Payment,0)),0) [Amount] from Medicare..tbMedDoctors where IDNum = '" & _ Trim$(strIdNum) & "'" GetDoctorPaymentAmount = 0 With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then GetDoctorPaymentAmount = !Amount End If .Close End With Set Rec = Nothing End Function Public Function GetPaymentAmount(strIdNum 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 ClientName = "MGH" Then SQL = "(Select(Select isnull(Sum(IsNull(Amount,0)),0) [Amount] from Medicare..tbMedPayment where IDNum = '" & _ Trim$(strIdNum) & "') as [Amount])" Else If ClientName = "PSH" Then SQL = "(Select(Select isnull(Sum(IsNull(Amount,0)) + Sum(IsNull(Tax,0)),0) [Amount] from Medicare..tbMedPayment where IDNum = '" & _ Trim$(strIdNum) & "') as [Amount])" Else SQL = "(Select(Select isnull(Sum(IsNull(Amount,0)) + Sum(IsNull(Tax,0)),0)[Amount] from Medicare..tbMedPayment where IDNum = '" & _ Trim$(strIdNum) & "') as [Amount])" End If 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 LMPPackage As String Dim DeathOfDateTime As String Dim IMRTProcedureDates As String Dim NBSFilterCardNo 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 LMPPackage = !LMPPackage DeathOfDateTime = !DeathOfDate IMRTProcedureDates = !IMRTProcedureDates NBSFilterCardNo = !NCPFilterCardNo 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_LMPPackage).AddCurrentValue Replace(LMPPackage, "/", "-") If PatientDisposition = "E" Then Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue Format(DeathOfDateTime, "hh:mm AMPM") Else Form2Report.ParameterFields(F_DATE_OF_DEATH).AddCurrentValue "n/a" End If Form2Report.ParameterFields(F_IMRTProcedureDates).AddCurrentValue Left$(Replace(IMRTProcedureDates, "/", "-"), 255) Form2Report.ParameterFields(F_NBSFilterCardNo).AddCurrentValue NBSFilterCardNo 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 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" ElseIf !Total > 12 And !Total < 17 Then countDiag = "4" ElseIf !Total > 16 And !Total < 21 Then countDiag = "5" ElseIf !Total > 20 And !Total < 25 Then countDiag = "6" ElseIf !Total > 24 And !Total < 29 Then countDiag = "7" ElseIf !Total > 28 And !Total < 33 Then countDiag = "8" ElseIf !Total > 32 And !Total < 37 Then countDiag = "9" ElseIf !Total > 36 And !Total < 41 Then countDiag = "10" 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 Function ChckDiagnosis(strIdNum As String, DiagID As String) As Boolean Dim recX As New ADODB.Recordset Dim SQL As String SQL = "SELECT DiagID from Medicare..tbMedDiagnosis Where IDNum = '" & strIdNum & "' and DiagID = '" & DiagID & "'" ChckDiagnosis = False With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then ChckDiagnosis = True End If .Close End With Set recX = Nothing 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 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 GetPF_Package(strIdNum As String, strDocID As String, Optional intOption As DOCTOR_PF = FirstCase_PF) As Currency Dim recX As New ADODB.Recordset GetPF_Package = 0 If recX.State > 0 Then recX.Close recX.CursorLocation = adUseClient recX.Open "Medic_GetMedicarePF_Package '" + strIdNum + "','" + strDocID + "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then If intOption = FirstCase_PF Then GetPF_Package = recX![FirstMedicarePF] Else GetPF_Package = recX![SecondMedicarePF] End If End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function MemberTypeNonPhicExists() As Boolean Dim recX As New ADODB.Recordset Dim SQL As String MemberTypeNonPhicExists = False SQL = "SELECT * from Medicare..tbmedtype where code = 0" With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then MemberTypeNonPhicExists = True End If .Close End With Set recX = Nothing End Function Public Function IsAutoComputeVATDoctor() As Boolean Dim SQL As String IsAutoComputeVATDoctor = False SQL = "Select top 1 isnull(isAutoComputeVatPF,0) as isAutoComputeVatPF from Medicare..tbmedhospital" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then ' If .EOF = False Then IsAutoComputeVATDoctor = !isAutoComputeVatPF End If .Close End With End Function Public Function IsAutoComputeTax() As Boolean Dim SQL As String IsAutoComputeTax = False SQL = "Select top 1 isnull(isAutoComputeTaxPF,0) as isAutoComputeTaxPF from Medicare..tbmedhospital" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then ' If .EOF = False Then IsAutoComputeTax = !isAutoComputeTaxPF End If .Close End With End Function Public Function countDoctorWActualPF(strIdNum As String) As Double Dim recX As New ADODB.Recordset Dim SQL As String dblCountDoctor = 0 SQL = "SELECT isnull(COUNT(idnum),1) [Total] from Medicare..tbMedDoctors Where IDNum = '" & strIdNum & "' and isnull(actualPF, 0) <> 0 " With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then countDoctorWActualPF = !Total / 3 End If .Close End With Set recX = Nothing dblCountDoctor = countDoctorWActualPF End Function Public Function countAllDoctor(strIdNum As String) As String Dim recX As New ADODB.Recordset Dim SQL As String SQL = "SELECT count(doccode) [Total] from Medicare..tbMedDoctors Where IDNum = '" & strIdNum & "'" With recX If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then countAllDoctor = !Total End If .Close End With Set recX = Nothing End Function 'added by ange 08142020 Public Function IsSinglePeriodCon(ICDRVS As String) As Boolean Dim SQL As String IsSinglePeriodCon = False SQL = "Select isnull(IsSinglePeriodCon,0) IsSinglePeriodCon from medicare..vwICDRVS where CaseCode = '" & ICDRVS & "'" With Rec If .State > 0 Then .Close .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .EOF = False Then IsSinglePeriodCon = !IsSinglePeriodCon End If .Close End With Set Rec = Nothing End Function Public Function Is45DaysAnnualBenefit(ICDRVS As String) As Boolean Dim SQL As String Is45DaysAnnualBenefit = False SQL = "Select isnull(Is45DaysAnnualBenefit,0) Is45DaysAnnualBenefit from medicare..vwICDRVS where CaseCode = '" & ICDRVS & "'" With Rec If .State > 0 Then .Close .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .EOF = False Then Is45DaysAnnualBenefit = !Is45DaysAnnualBenefit End If .Close End With Set Rec = Nothing End Function Public Function Load_ModSettings_Value(intModSet_ID As Integer) 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, IsNull(ModSet_ID, 0) ModSet_ID from Medicare..tbMed_ModuleSettings Where ModSet_ID = '" & intModSet_ID & "'", user.SQLConnection, adOpenDynamic, adLockReadOnly If recX.RecordCount > 0 Then Load_ModSettings_Value = recX!ModSet_Status ' intModSet_ID = recX!ModSet_ID End If If recX.State > 0 Then recX.Close Set recX = Nothing End Function Public Function isCF4Verified(strIdNum As String) As Boolean Dim SQL As String isCF4Verified = False blnCF4ExemptCode = 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 Case 1 isCF4Verified = True Case 2 blnCF4ExemptCode = True End Select End If .Close End With Set Rec = Nothing End Function Public Sub TransmittalLogs(strUserID As String, strRemarks As String, strIdNum As String) user.SQLConnection.Execute "Insert into Medicare..tbMedTransmittalLogs(userid, remarks,transdate, IDNum, Mod_Version) values('" & strUserID & "', '" & strRemarks & "', getDate(), '" & strIdNum & "', '" & App.Major & "." & App.Minor & "." & App.Revision & "')" End Sub Public Function get_PhicTypeCode(strtype As String, intItem As Integer) As String Dim SQL As String get_PhicTypeCode = "" SQL = "Select Medicare.dbo.get_PhicTypeCode('" & strtype & "', '" & intItem & "') as PhicTypeCode" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .RecordCount > 0 Then get_PhicTypeCode = !PhicTypeCode End If .Close End With Set Rec = Nothing End Function 'AAC09222022 Public Function isNotForm2Printed(strIdNum As String) As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String isNotForm2Printed = True SQL = "Select * from Medicare..tbmedpatient where IDNum = '" & strIdNum & "' and isForm2Printed = 1" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockReadOnly .Open SQL, user.SQLConnection If .RecordCount > 0 Then isNotForm2Printed = False End If .Close End With Set Rec = Nothing End Function 'added by ange 6.1.2016 Public Function GetCountConfinementHours(strIdNum As String) As Long 'Integer Dim SQL As String SQL = "Medicare..Medic_GetConfinementHours '" & strIdNum & "'" GetCountConfinementHours = 0 With recMember If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .EOF = False Then GetCountConfinementHours = !hours End If .Close End With Set recMember = Nothing lngConfinementHours = GetCountConfinementHours 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 'AAC10212022 Public Sub PatientLogs(strHospNum As String, strIdNum As String, strUserID As String, strRemarks As String) user.SQLConnection.Execute "INSERT INTO Patient_Data..tbAdmPatientInfoUpdate " & _ " (Hospnum, IDNum, TransDate , UserID, Remarks, Module, Version) " & _ " Values('" & strHospNum & "', '" & strIdNum & "', GETDATE(), '" & strUserID & "' , '" & strRemarks & "', 'PhilHealth', '" & App.Major & "." & App.Minor & "." & App.Revision & "' )" End Sub Public Function FetchHospnum(strIdNum As String) As String Dim SQL As String Dim Rec As New ADODB.Recordset FetchHospnum = "" If IsNumeric(strIdNum) Then SQL = "Select hospnum from Patient_data..tbpatient where idnum = '" & strIdNum & "'" Else SQL = "Select hospnum from Patient_Data..tboutpatient where idnum = '" & strIdNum & "'" End If With Rec If .State > 0 Then .Close .CursorLocation = adUseClient ' .CursorType = adOpenDynamic ' .LockType = adLockOptimistic ' .Open SQL, user.sqlconnection ' ' If .RecordCount > 0 Then .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If .EOF = False Then FetchHospnum = !HospNum End If .Close End With Set Rec = Nothing End Function Public Function CheckSameDayConfinemenDay(strHospNum As String, strIdNum As String) As Boolean Dim Rec As New ADODB.Recordset Dim SQL As String CheckSameDayConfinemenDay = False SQL = "Medicare..Medic_CheckSameDayConfinement '" & strHospNum & "','" & strIdNum & "'" With Rec If .State > 0 Then .Close .CursorLocation = adUseClient .Open SQL, user.SQLConnection, adOpenDynamic, adLockReadOnly If Not .EOF Then CheckSameDayConfinemenDay = !Rec End If .Close End With Set Rec = Nothing End Function