system.kanoa.quality.event.getChkShtEvents(paramsDict)
Returns scheduled check sheet events, newest scheduled first. Every paramsDict key is optional, and a key passed as None is ignored.
When a date range (startDate and endDate), states (chkShtStateIds or chkShtStateNames) and activeState are all given, it returns the events in the range and states, plus every event in that activeState.
Parameters
paramsDict Dictionary
| - activeState | Boolean | True for the checks in an active state (Coming Due, Due, In Progress, Overdue), False for the others: the finished ones, and those In Delay. |
| - assetGroupName | String | The asset's group. |
| - assetId | Integer | |
| - assetPath | String | The asset path, matched with LIKE (add % yourself). |
| - auto | Boolean | True for Auto check sheets only, False for the others. |
| - chkItemId | Integer | With chkItemValue: the events whose value for this check item contains chkItemValue. |
| - chkItemValue | String | See chkItemId. |
| - chkShtEventId | Integer | |
| - chkShtId | Integer | |
| - chkShtStateIds | List of Integers | |
| - chkShtStateNames | List of Strings | Used when chkShtStateIds isn't given. |
| - chkShtTypeId | Integer | |
| - endDate | DateTime | The end of the date range; see searchDate. |
| - includeManualAuto | Boolean | With auto False, also returns the Auto check sheets' events someone added by hand (with a Manual trigger, as Add Check does). Ignored otherwise. |
| - itemClassPath | String | Matched with LIKE. |
| - itemId | Integer | |
| - path | String | The check sheet's path, matched with LIKE. |
| - searchDate | String | The date column startDate and endDate apply to: takenDate, scheduledDate (the default), submittedDate or approvedDate. |
| - shiftNameId | Integer | |
| - startDate | DateTime | The start of the date range; see searchDate. |
| - toolingAssetId | Integer | The events taken with this tool. |
Returns
chkShtEventData pyDataset
One row per check event, with its check sheet (chkShtId, chkShtName, path, auto, ...), asset (assetId, assetPath, assetGroupName), shift, item, trigger (chkShtTriggerId, triggerTypeName, delayMins, comingDueMins, overDueMins, graceMins, ...) and state (chkShtStateId, chkShtStateName, chkShtStateColor, activeState).
It also has:
- minutesRemaining: how long until the check should be taken. Until its scheduledDate while it's In Delay or Coming Due, then until the end of its overDueMins (negative once it's Overdue). None for a finished check.
- failedChecks: how many of its checks failed, once it's submitted.
- takenDate, scheduledDate, submittedDate, approvedDate, and the users who scheduled, submitted and approved it.
- toolingAssetId, toolingName: the tool it was taken with.
Example
# The checks scheduled in the last 5 days for check sheet 18
paramsDict = {
'startDate': system.date.addDays(system.date.now(), -5),
'endDate': system.date.now(),
'chkShtId': 18
}
chkShtEventData = system.kanoa.quality.event.getChkShtEvents(paramsDict)
# The manual checks still to be done, plus the Auto checks someone added by hand
paramsDict = {'activeState': True, 'auto': False, 'includeManualAuto': True}
chkShtEventData = system.kanoa.quality.event.getChkShtEvents(paramsDict)