' Run Through Parent Claims on worksheet
Do Until Len(Trim(Range("C" & SheetRow).Value)) = 0
Fraud = False
NonFraud = False
RunThrough = False
OpID = ""
ParentClaim = ""
ChildClaim = ""
Point = ""
CurrARD = ""
CurrPAN = ""
FraudClaim = ""
FraudChild = ""
v = 1
Range("C" & SheetRow) = Replace(Range("C" & SheetRow), "-", "")
Range("K" & SheetRow) = Abs(DateDiff("d", Now(), Range("E" & SheetRow)))
PAN = Trim(Range("C" & SheetRow))
ARD = Trim(Range("D" & SheetRow))
'Page Up and wait for screen to update
ExternalApp.SendKeys ("<pa1>")
Do Until ExternalApp.GetString(17, 40, 6) = "System"
Sleep (1)
Loop
'Page Down and wait for screen to update
ExternalApp.SendKeys ("<pa2>")
Do Until ExternalApp.GetString(23, 58, 2) = "p3"
Sleep (1)
Loop
ExternalApp.PutString "IFND", 23, 9
ExternalApp.SendKeys ("<Enter>")
'Wait for IFND Screen show show
Do Until ExternalApp.GetString(18, 2, 4) = "Find"
Sleep (1)
Loop
'Paste ARD and wait for screen to update
Do Until ExternalApp.GetString(15, 16, 20) = Left(ARD, 20)
ExternalApp.PutString Left(ARD, 20), 15, 16
Sleep (1)
Loop
'Press enter and wait for screen to update
ExternalApp.SendKeys ("<Enter>")
Do Until ExternalApp.GetString(3, 42, 20) = Left(ARD, 20)
Sleep (1)
Loop
Claims = ExternalApp.Area(7, 2, 20, 13).Value
IFNDArea2 = ExternalApp.Area(8, 53, 21, 58).Value
ChildLoop:
' This one will check each child case, this Do case should never happen as all IF's should exit do prior to this hapenning
Do Until Len(Trim(ChildClaim)) = 0 And RunThrough = True
ChildClaim = Split(WorksheetFunction.Trim(Claims), " ")(v)
'Check if ChildClaim is blank and all child cases have been check for non fraud match
If Len(Trim(ChildClaim)) = 0 And RunThrough = True Then
CurrRC = ""
Range("H" & SheetRow) = "Unable to Locate."
Exit Do
'Else If is if all claims have been checked and no non fraud match has been found, now check for fraud matches
ElseIf Len(Trim(ChildClaim)) = 0 And RunThrough = False And Fraud = False Then
RunThrough = True
v = 1
GoTo ChildLoop
End If
'Enter command and childclaim and wait for screen to update
Do Until ExternalApp.GetString(23, 9, 4) = "IDIS"
ExternalApp.PutString "IDIS", 23, 9
Sleep (1)
Loop
Do Until ExternalApp.GetString(23, 17, Len(ChildClaim)) = ChildClaim
ExternalApp.PutString ChildClaim, 23, 17
Sleep (1)
Loop
ExternalApp.SendKeys ("<Enter>")
Do Until ExternalApp.GetString(2, 51, 4) = "oper"
Sleep (1)
Loop
'Once inside childclaim, pull the below values
ChildStatus = Trim(ExternalApp.GetString(3, 9, 6))
CurrARD = ExternalApp.GetString(5, 36, 23)
OpID = Trim(ExternalApp.GetString(2, 56, 6))
CurrPAN = ExternalApp.GetString(8, 33, 16)
Point = Trim(ExternalApp.GetString(2, 41, 6))
' ARD Check for Child Claim to check for match
If CurrARD = ARD Then
If Point = "DBCC01" Then NonFraud = True ' If ARD Matches, Check Point for Fraud or NonFraud
If Point = "FRDC01" Then
Fraud = True
FraudARD = CurrARD
FraudPAN = CurrPAN
FraudChild = ChildClaim
FraudClaim = ParentClaim
End If
If NonFraud = False And RunThrough = False Then
v = v + 1
GoTo ChildLoop
If Fraud = True Then ' If fraud is true and has run through will update as fraud claim.
If InStr(1, IFNDArea2, "DBCC01", vbTextCompare) = 0 Or RunThrough = True Then
Range("H" & SheetRow) = FraudClaim
Range("I" & SheetRow) = FraudChild
Range("J" & SheetRow) = "zFraud"
Exit Do
ElseIf RunThrough = True Then
Range("H" & SheetRow) = FraudClaim
Range("I" & SheetRow) = FraudChild
Range("J" & SheetRow) = "zFraud"
Exit Do
End If
End If
If NonFraud = True Then ' If ChildClaim is non fraud then enter data on worksheet
Range("H" & SheetRow) = ParentClaim
Range("I" & SheetRow) = ChildClaim
Range("J" & SheetRow) = OpID
If Left(Trim(ClaimStatus), 4) <> "PREP" Then ' Start PREP Check
Range("N" & SheetRow) = "Warning: Claim is not in CB Status, Claim is " & ClaimStatus
End If ' End PREP Check
If CurrRC <> ReportRC And Len(CurrRC) <> 0 Then ' Start RC Check
If Left(Trim(CurrRC), 2) = "48" Then ' Start if MC RC
Range("N" & SheetRow) = "Warning: ExternalApp RC of " & CurrRC & " does not match report RC of " & ReportRC
End If ' End Check if MC
End If ' End RC Check
If Not PAN = CurrPAN Then Range("N" & SheetRow) = "ARD Matches. However " & PAN & " doesn't match " & CurrPAN
Exit Do
End If
End If
' ChildClaim Loop
Loop
SheetRow = SheetRow + 1
'Sheetloop for next claim
Loop
MsgBox ("Complete")
Bookmarks