...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Smart Logic Senerios
Level 2
False Log
- if XREF Code = 2
- If the Federal Code starts with "395.8E"
- Enable (Smart Logic Date)
- Enable (Evidence)
- Out of Service := Evidence
- If Smart Logic Date is not blank And Supplemental Description is not blank
- Supplemental Description :=
- "Driver False Log on " & Smart Logic Date& " - " & Federal Violation Description
- Disable (Out of Service)
...
Level 3
Log Not Current
- If XREF Code = "3"
- (Federal Code, starts with "395.8K2" Or "395.8F1"
- Count Federal Code starts with "395.8A" and if none
- Enable (Smart Logic Date)
- If Federal Code begins with "395.8K2"
- set Out of Service to Yes
- If XREF Code not equal "6" And Smart Logic Date is not equal to blank, today or yesterday E
- Enable Federal Description
- r@currenterrortext := "Failed to retain"
- r@lognotcurrenterror := True
- Disable (Out of Service)
- If Federal Code begins with "395.8F1"
- set Out of Service to No
- Smart Logic Date, is equal to today or yesterday
- Enable Federal Description
- r@currenterrortext := "Log not Current"
- r@lognotcurrenterror := True
- Disable (Out of Service)
- If r@lognotcurrenterror = True
- set Supplemental Description equal to r@currenterrortext & " on " & Smart Logic Date& " " & Federal Violation Description
- Else
- set Supplemental Description equal to Federal Violation Description
...
- If XREF Code = "3"
- if Federal Code, begins with "395.8A"
- Enable (Smart Logic Date)
- count other violations with Federal Code beginning with "395.8"
- If Federal Code, begins with "395.3A3II" And the smart logic date is equual to this violation smart logic date
- set Supplemental Description equal to Federal Description
- Else
- set Out of Service equal to "Yes"
- set Supplemental Description := "Driver <NO LOG> on " & Smart Logic Date& " - " & Federal Violation Description
- Disable (Out of Service)
...
Level 4
10/11 and 14/15 hours
-
//Added 6-16-2016 - not finished.
If XREF Code = "4" Then - r@Level4Description := True
- r@Prop := False
- r@Psgr := False
- Check to see if Vehicle Type is Passenger or Property
- PASSENGER
- If
- any vehicle Type is ("BU", "LM", "MC", "SB")
- r@Psgr := True
- PROPERTY
- If any vehicle Type is ("CL", "DC", "FT", "IC", "OT", "PT", "ST", "TR", "TT", "VN")
- r@Prop := True
- If r@Prop = True
- if Federal Code begins with "395.5A"
- ErrLog("You cannot cite this violation to a driver of a Property Carrying Vehicle.",
- r@Level4Description := False
- If r@Psgr = True
- if Federal Code begins with "395.3A"
- ErrLog("You cannot cite this violation to a driver of a Passenger Carrying Vehicle."
- r@Level4Description := False
- If r@Level4Description = True
- Enable (Smart Logic Date)
- If Smart Logic Date
- is blank
- Disable(Driver Violation Flag)
- ExitRule
- If (Smart Logic Date,
- is over 7 days prior than Date Inspection Started
- ErrLog("The selected
- Smart Logic Date must be the
- Date Inspection Started, or one of the previous 7 days."
- r@Level4Description := False
- If r@Prop = True Or r@Psgr = True Then
- Count all violations where
- Federal Code begins with 395.3A and the smart logic dates equal
- Set r@3953ACited to that number
- Federal Code begins with 395.5A and the smart logic dates equal
- Set r@3955ACited to that number
- If r@3953ACited > 2 Or r@3955ACited > 2
- r@Level4Description := False
- If r@Level4Description = True
- /Needed 2 levels of control to determine if description shows, prevents us from having to manage the description in 2 or 3 places
- r@ShowLevel4Description := False
- If Smart Logic Date
- is not blank and Smart Logic date equals Date Inspection Started
- Enable (Driver Violation)
- If Driver Violation is blank Then
- DisableWithClear (Out of Service)
- else if Driver Violation is not blank
- set Out of Service :=
- Driver Violation
- Disable (Out of Service)
- r@ShowLevel4Description := True
- Else
- DisableWithClear (
- Driver Violation)
- Disable (Out of Service)
- set Out of Service := "N"
- r@ShowLevel4Description := True
//
//
EndIf
//PROPERTY
//Vehicle is a multi instance
If [Vehicle.vehicleType(any )] In
EndIf
If UCase (Left (Federal Code, 6 ) ) =
//
EndIf
EndIf
If UCase (Left (Federal Code, 6 ) ) =
//
EndIf
EndIf
DisableWithClear ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
ExitRule
EndIf
EndIf
If DateDiff
//
r@Level4Description := False
EndIf
If r@Prop
r@3953ACited := 0
r@3955ACited := 0
For r@ViolCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.3A" And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format (Smart Logic Date, "MM/dd/yyyy") Then
r@3953ACited := r@3953ACited + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.5A" And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format (Smart Logic Date, "MM/dd/yyyy") Then
r@3955ACited := r@3955ACited + 1
EndIf
Next
EndIf
//Added 6-16-2016
/
If Format (Smart Logic Date, "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted(r@subgroupinstance)], "MM/dd/yyyy") Then
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
If [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)] = "" Then
//[SmartLogic.smartlogicDriverViolationFlag().focus] := True
Else
EndIf
EndIf
EndIf
EndIf
//End Level 4
EndIf
If r@Psgr = True Then
r@DoNothing := 0
EndIf
EndIf
Alaska Only violations
-
If XREF Code = "5" Then
Enable (Smart Logic Date)
If UCase (Left (Federal Code, 7 ) ) = "395.1H1" Or UCase (Left (Federal Code, 7 ) ) = "395.1H2" Then
Enable (Smart Logic Date)
EndIf
EndIf
//Added 6-16-2016
//Alaska Only
If XREF Code = "5" Then
r@Level5Description := False
r@InAlaska := False
//If TimeZones are Alaskan, then CMV inspection is in Alaska
If UCase ([Summary.summaryTimeZone()]) = "ALASKA" Then
r@Level5Description := True
r@InAlaska := True
EndIf
If r@InAlaska = False Then
If Format (Smart Logic Date, "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") Then
r@Level5Description := False
// ExitRule
Else
r@Level5Description := True
EndIf
EndIf
r@3951H1Count := 0
r@3951H2Count := 0
r@3953Count := 0
r@3955Count := 0
For r@ViolCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.1H1" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] Then
r@3951H1Count := r@3951H1Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.1H2" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] Then
r@3951H2Count := r@3951H2Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.3" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") Then
r@3953Count := r@3953Count + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.5" And r@ViolCount <> [Violation.violationFederalCode(r@parentGroupInstance).Instance] And Format ([SmartLogic.smartlogicDateViolation(r@ViolCount)], "MM/dd/yyyy") = Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") Then
r@3955Count := r@3955Count + 1
EndIf
Next
If UCase (Left (Federal Code, 7 ) ) = "395.1H1" Then
If r@3951H2Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
EndIf
If UCase (Left (Federal Code, 7 ) ) = "395.1H2" Then
If r@3951H1Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
EndIf
If r@3953Count > 0 Or r@3955Count > 0 Then
r@Level5Description := False
//ExitRule
EndIf
If XREF Code = "5" And UCase (Left (Federal Code, 7 ) ) <> "395.1H2" And UCase (Left (Federal Code, 7 ) ) <> "395.1H1" Then
r@Level5Description := True
r@OtherLevel5 := True
EndIf
//Is Driver Currently In Violation
If r@Level5Description = True Then
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
If [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)] <> "" Then
Out of Service := [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)]
Supplemental Description := "On " & Smart Logic Date& " " & Federal Violation Description
Else
If Smart Logic Date = "" Then
//[SmartLogic.smartlogicDateViolation().focus] := True
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
Else
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
//[SmartLogic.smartlogicDriverViolationFlag().focus] := True
EndIf
EndIf
Else
Supplemental Description := Federal Violation Description
EndIf
EndIf
If XREF Code = "6" Then
Enable (Smart Logic Date)
EndIf
//60/70 Hours
If XREF Code = "6" Then
r@Level6Description := True
r@MultiCode6 := 0
r@3953b1 := 0
r@3953b2 := 0
r@3955b1 := 0
r@3955b2 := 0
r@3953 := 0
r@3955 := 0
r@3958a := 0
r@3958e := 0
For r@ViolCount = 1 to GroupCountAll ("Violation")
If [Violation.violationFederalCode(r@ViolCount)] = Federal Code Then
r@MultiCode6 := r@MultiCode6 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.3B1" Then
r@3953b1 := r@3953b1 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.3B2" Then
r@3953b2 := r@3953b2 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.5B1" Then
r@3955b1 := r@3955b1 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 7 ) ) = "395.5B2" Then
r@3955b2 := r@3955b2 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.3" Then
r@3953 := r@3953 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 5 ) ) = "395.5" Then
r@3955 := r@3955 + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.8A" Then
r@3958a := r@3958a + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@ViolCount)], 6 ) ) = "395.8E" Then
r@3958e := r@3958e + 1
EndIf
Next
//Count to see if multiple violationXREFCode = 6
If r@MultiCode6 > 1 Then
r@Level6Description := False
EndIf
//Check to see if both 395.3B1 and 395.3B2 are cited
If r@3953b1 > 0 And r@3953b2 > 0 Then
r@Level6Description := False
EndIf
//Check to see if both 395.5B1 and 395.5B2 are cited
If r@3955b1 > 0 And r@3955b2 > 0 Then
r@Level6Description := False
EndIf
//Check to see if a 395.3% and a 395.5% are cited
If r@3953 > 0 And r@3955 > 0 Then
r@Level6Description := False
EndIf
//Check to see if 395.8A is cited
If r@3958a > 0 Then
r@Level6Description := False
EndIf
If DateDiff (Smart Logic Date, [Summary.summaryDateInspectionStarted()], "d") > 7 Then
r@Level6Description := False
EndIf
//Is Driver Currently In Violation
If r@Level6Description = True Then
If Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") <> Format (Smart Logic Date, "MM/dd/yyyy") And Smart Logic Date <> "" Then
Out of Service := "N"
DisableWithClear ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
Disable (Out of Service)
Else
DisableWithClear (Out of Service)
Enable ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
//[SmartLogic.smartlogicDriverViolationFlag().focus] := True
EndIf
If [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)] <> "" Then
Out of Service := [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)]
EndIf
EndIf
EndIf
//
...