Skip to end of metadata
Go to start of metadata
You are viewing an old version of this content. View the current version.
Compare with Current
View Version History
« Previous
Version 9
Next »
- This subgroup opens when XREF is one of the following: 2, 3, 4, 5, 6, 7, 14, or 50
- Their are currently a max of 1 subgroups available.

Smart Logic Senerios
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)

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

No Log
- 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)
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 [Vehicle.vehicleType(any )] In ("BU", "LM", "MC", "SB") Then
r@Psgr := True
EndIf
//PROPERTY
//Vehicle is a multi instance
If [Vehicle.vehicleType(any )] In ("CL", "DC", "FT", "IC", "OT", "PT", "ST", "TR", "TT", "VN") Then
r@Prop := True
EndIf
If r@Prop = True Then
If UCase (Left (Federal Code, 6 ) ) = "395.5A" Then
//ErrLog("You cannot cite this violation to a driver of a Property Carrying Vehicle.",[Vehicle.vehicleType()],[Violation.violationTraCSFederalKey()])
r@Level4Description := False
EndIf
EndIf
If r@Psgr = True Then
If UCase (Left (Federal Code, 6 ) ) = "395.3A" Then
//ErrLog("You cannot cite this violation to a driver of a Passenger Carrying Vehicle.",[Vehicle.vehicleType()],[Violation.violationTraCSFederalKey()])
r@Level4Description := False
EndIf
EndIf
If r@Level4Description = True Then
Enable (Smart Logic Date)
If Smart Logic Date = "" Then
DisableWithClear ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
ExitRule
EndIf
EndIf
If DateDiff (Smart Logic Date, [Summary.summaryDateInspectionStarted()], "d") > 7 Then
//ErrLog("The selected smartlogicDateViolation must be the summaryDateInspectionStarted, or one of the previous 7 days.",[Summary.summaryDateInspectionStarted()],[SmartLogic.smartlogicDateViolation()] )
r@Level4Description := False
EndIf
If r@Prop = True Or r@Psgr = True Then
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
If r@3953ACited > 2 Or r@3955ACited > 2 Then
r@Level4Description := False
EndIf
//Added 6-16-2016
If r@Level4Description = True Then
//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 <> "" Then
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
DisableWithClear (Out of Service)
Else
Out of Service := [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)]
Disable (Out of Service)
r@ShowLevel4Description := True
EndIf
Else
DisableWithClear ([SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)])
Disable (Out of Service)
Out of Service := "N"
r@ShowLevel4Description := True
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
//
All Other Hours of Service
- If XREF Code = "7"
Enable (Smart Logic Date)
EndIf
All Other Hours of Service
- If XREF Code = "7" Then
r@Level7Description := True
Out of Service := "N"
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.13D" Or UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
Disable (Out of Service)
If Format ([Summary.summaryDateInspectionStarted()], "MM/dd/yyyy") <> Format (Smart Logic Date, "MM/dd/yyyy") Then
//ErrLog("smartlogicDateViolation must be the Current Date.",[Summary.summaryDateInspectionStarted()],[SmartLogic.smartlogicDateViolation()])
r@Level7Description := False
Else
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.13D" Then
Enable ([SmartLogic.smartlogicDateOOS(r@subgroupinstance)], [SmartLogic.smartlogicTimeOOS(r@subgroupinstance)], [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)], [SmartLogic.smartlogicInspectionNumber(r@subgroupinstance)])
//If [SmartLogic.smartlogicDateOOS()] = "" or [SmartLogic.smartlogicTimeOOS()] = "" Then
//r@Level7Description := False
//[SmartLogic.smartlogicDateOOS().focus] := True
//Else
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] = "" Then
r@Level7Description := False
//[SmartLogic.smartlogicOOSSatisfiedFlag().focus] := True
EndIf
//Do not set the description until both OOS fields are filled in
//If [SmartLogic.smartlogicOOSSatisfiedFlag()] <> "" and [SmartLogic.smartlogicDateOOS()] <> "" and [SmartLogic.smartlogicTimeOOS()] <> "" Then
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] <> "" Then
If [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)] = "Y" Then
Out of Service := "N"
Else
Out of Service := "Y"
EndIf
Disable (Out of Service)
r@Level7Description := True
EndIf
//EndIf
EndIf
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15B" Then
r@Vio3958e := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 8 ) ) = "395.8E" Then
r@Vio3958e := r@Vio3958e + 1
EndIf
Next
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 9 ) ) = "395.3A3II" Then
r@Vio3A3II := 0
r@Vio8A := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 9 ) ) = "395.3A3II" Then
r@Vio3A3II := r@Vio3A3II + 1
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 6 ) ) = "395.8A" And Smart Logic Date = [SmartLogic.smartlogicDateViolation(r@VioCount)] Then
r@Vio8A := r@Vio8A + 1
EndIf
Next
If r@Vio3A3II > 1 Then
r@Level7Description := False
EndIf
If r@Vio3A3II >= 1 And r@Vio8A >= 1 Then
r@Level7Description := False
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15F" Then
If [SmartLogic.smartlogicAOBRDFlag(r@VioCount)] = "" Then
Enable ([SmartLogic.smartlogicAOBRDFlag(r@VioCount)])
//[SmartLogic.smartlogicAOBRDFlag(r@VioCount).focus] := True
EndIf
If [SmartLogic.smartlogicAOBRDFlag(r@VioCount)] <> "Y" Then
r@Level7Description := False
EndIf
EndIf
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
r@Vio15G := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 7 ) ) = "395.15G" Then
r@Vio15G := r@Vio15G + 1
EndIf
Next
If r@Vio15G > 1 Then
r@Level7Description := False
EndIf
EndIf
If r@Level7Description = True Then
Supplemental Description := "On " & Smart Logic Date& " " & [Violation.violationFederalDescription(r@parentGroupInstance)]
EndIf
EndIf
//All Other smartlogicDriverViolationFlags
If XREF Code = "14" Then
r@Vio383Count := 0
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase (Left ([Violation.violationFederalCode(r@VioCount)], 8 ) ) = "383.23A2" Then
r@Vio383Count := r@Vio383Count + 1
EndIf
Next
Supplemental Description := Federal Violation Description
If r@Vio383Count <= 1 Then
Out of Service := "Y"
Disable (Out of Service)
Supplemental Description := "Driver Operating without " & "- " & Federal Violation Description
EndIf
EndIf
//Log Book Form and Manner Violations
If XREF Code = "50" Then
Out of Service := "N"
r@Level50Description := False
f@SmartLogic := ""
r@violationdescriptiontext := ""
r@addviotext := ""
r@notestext := ""
Enable (Smart Logic Date)
If [Violation.violationFederalCode(any )] = "395.8" Then
//Figure out which violations need filtered
r@Level50Description := True
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase ([Violation.violationFederalCode(r@VioCount)]) = "395.8" Then
r@filter3958 := r@VioCount
ExitFor
EndIf
Next
EndIf
If [Violation.violationFederalCode(any )] = "395.15I5" Then
//Figure out which violations need filtered
r@Level50Description := True
For r@VioCount = 1 to GroupCountAll ("Violation")
If UCase ([Violation.violationFederalCode(r@VioCount)]) = "395.15I5" Then
r@filter39515 := r@VioCount
ExitFor
EndIf
Next
EndIf
//Build notes
For r@VioCount = 1 to GroupCountAll ("Violation")
r@OtherSmartLogicInstance := GetSubGroupInstanceByParent ("Violation", r@VioCount, "SmartLogic", 1 )
If (r@Viocount > r@filter3958 And r@filter3958 <> "" And r@filter3958 <> 0 ) Or (r@Viocount > r@filter39515 And r@filter39515 <> "" And r@filter39515 <> 0 ) Then
If [Violation.violationFederalCode(r@VioCount)] <> "" Then
If r@addviotxt = "" Then
r@addviotxt := "Violation(s) of: " & [Violation.violationFederalCode(r@VioCount)]
Else
r@addviotxt := r@addviotxt & ", " & [Violation.violationFederalCode(r@VioCount)]
EndIf
If r@notestxt = "" Then
r@notestxt := "Record of Duty Status, Form and Manner Violations on " & [SmartLogic.smartlogicDateViolation(r@OtherSmartLogicInstance)]& ":" & newline & [Violation.violationFederalCode(r@VioCount)]& "-" & [SmartLogic.smartlogicItemRemark(r@OtherSmartLogicInstance)]& newline
Else
r@notestxt := r@notestxt & [Violation.violationFederalCode(r@VioCount)]& "-" & [SmartLogic.smartlogicItemRemark(r@OtherSmartLogicInstance)]& newline
EndIf
EndIf
EndIf
Next
//Apply Notes
If r@addviotxt <> "" Or r@notestxt <> "" Then
//Place in tbd field
[Description.descriptionNotes(0 )] := r@addviotxt & Newline & "***********************" & newline & r@notestxt
EndIf
EndIf
If XREF Code = "" And [Violation.violationTraCSFederalKey(r@parentGroupInstance)] = "" Then
DisableWithClear (Smart Logic Date, Evidence, [SmartLogic.smartlogicDriverViolationFlag(r@subgroupinstance)], [SmartLogic.smartlogicDateOOS(r@subgroupinstance)], [SmartLogic.smartlogicTimeOOS(r@subgroupinstance)], [SmartLogic.smartlogicOOSSatisfiedFlag(r@subgroupinstance)], [SmartLogic.smartlogicInspectionNumber(r@subgroupinstance)], [SmartLogic.smartlogicAOBRDFlag(r@subgroupinstance)], Supplemental Description)
Clear ([Violation.violationCitationFlag(r@parentGroupInstance)])
EndIf
EndIf -
-
-
Other Occurrences
- Yes or No fields
- Enable for XRef codes of 4 or 6
- These are the last 7 calendar dates where the violation could have occurred based on the Federal Code violated. Check the dates not in compliance.
- The once one or more dates have been checked the Supplemental Description will enter the Dates in Violation along with the Federal codes description of the violation.

Supplemental Violations
- Enabled by violations in federal Section
- list are populated ViolationID in V3ViolationMasterSafetyNet equals the above values
- This will adjust the Supplemental description field and narrative.
Supplemental Description
- Added to the Federal Description form the Other Occurrences fields.
- if not added by the other occurrences or Supplemental Violations it will be entered into the Narrative.
Add Comment