Train Cancellation: Difference between revisions

From Open Rail Data Wiki
m Update cancellation documentation
Document train cancellation messages
Line 2: Line 2:


The Train Cancellation message is used to indicate a train that has been cancelled.
The Train Cancellation message is used to indicate a train that has been cancelled.
== Example ==
<pre>
{
    "header": {
        "msg_type": "0002",
        "source_dev_id": "L0BL",
        "user_id": "#QDP1120",
        "original_data_source": "TRUST DA",
        "msg_queue_timestamp": "1359167584000",
        "source_system_id": "TRUST"
    },
    "body": {
        "train_file_address": null,
        "train_service_code": "25437000",
        "orig_loc_stanox": "",
        "toc_id": "71",
        "dep_timestamp": "1359153300000",
        "division_code": "71",
        "loc_stanox": "80419",
        "canx_timestamp": "1359167580000",
        "canx_reason_code": "X2",
        "train_id": "802E51M725",
        "orig_loc_timestamp": "",
        "canx_type": "EN ROUTE"
    }
}
</pre>


== Data structure ==
== Data structure ==
 
=== Important Header fields ===
=== Header ===


{| class='wikitable'
{| class='wikitable'
Line 12: Line 40:
|-
|-
|msg_type
|msg_type
|Set to '0001' for an activation message
|Set to '0002' for a cancellation message
|-
|source_dev_id
|Always blank for an activation message
|-
|-
|source_system_id
|source_system_id
|Set to "TRUST" for an activation message
|Set to "TRUST" for cancellation messages
|-
|-
|original_data_source
|original_data_source
|Set to "TSIA" for an activation message
|Blank (for automatic cancellations on call), "SDR" (Simplified Direct Reporting) or "TRUST DA" (TRUST Delay Attribution)
|-
|user_id
|The identity of the user who made the cancellation
|}
|}


=== Body ===
=== Body ===
It is important to note that TRUST is not able to cancel a train unless it has already reported at a location.


{| class='wikitable'
{| class='wikitable'
Line 30: Line 60:
!Description
!Description
|-
|-
|train_id
|train_file_address
|Set to the 10-character unique identity for this train, and will appear in other TRUST message types
|The TOPS train file address, if applicable
|-
|-
|creation_timestamp
|train_service_code
|The time, in milliseconds, when the train was originally created in TRUST
|Train service code as per schedule
|-
|-
|tp_origin_timestamp
|orig_loc_stanox
|The date, in YYYY-MM-DD format, the train runs. For trains activated before midnight that run after midnight, this date will be "tomorrow's" date
|Only populated in cancellation type "OUT OF PLAN", and references the identity of the location that the schedule should have been at.
|-
|-
|train_uid
|toc_id
|The UID of the schedule being activated - either a letter and five numbers, or a space and five numbers for VSTP trains
|Operating company ID as per [[TOC_Codes]]
|-
|-
|sched_origin_stanox
|dep_timestamp
|STANOX of the originating location.  May not be nil
|Timestamp representing the departure time of the train at the location that the train is cancelled from
|-
|-
|sched_start_date
|division_code
|The start date of the schedule
|As toc_id
|-
|-
|schedule_end_date
|loc_stanox
|The end date of the schedule
|The location that the schedule is being cancelled from. In "OUT OF PLAN" cancellations, this will not be in the schedule but a 0003 Train Movement message will have been sent.
|-
|-
|schedule_source
|canx_timestamp
|Set to 'C' for schedules from CIF/ITPS, or 'V' for schedules from VSTP/TOPS
|The time at which the cancellation is made in TRUST.
|-
|-
|schedule_type
|canx_reason_code
|Either C (Cancellation), N (New STP), O (STP Overlay) or P (LTP)
|Reason code for cancellation, as per the Delay Attribution Guide
|-
|-
|sched_wtt_id
|train_id
|The headcode and TSPEED of the train (either '1', '2', '3', '4', 'C', 'M', 'N' or 'O')
|Set to the 10-character unique identity for this train, as appearing in other TRUST message types
|-
|d1266_record_number
|Either '00000' for a CIF/ITPS schedule, or the TOPS unique ID of the schedule
|-
|tp_origin_stanox
|If the train is due to start from a location other than the origin (i.e. it is part-cancelled), the STANOX of the location at which the train starts, otherwise the STANOX of the scheduled origin location
|-
|origin_dep_timestamp
|The estimated WTT time of departure from the originating location
|-
|train_call_type
|Either 'AUTOMATIC' for auto-called trains, or 'MANUAL' for manual-called trains
|-
|train_call_mode
|Set to 'NORMAL' for a train called normally, or 'OVERNIGHT' if the train is called as part of an overnight batch process to activate peak period trains early
|-
|-
|toc_id
|orig_loc_timestamp
|Operating company ID as per [[TOC_Codes]]
|Only populated in cancellation type "OUT OF PLAN", and references the departure time of the location that the schedule should have been at.
|-
|-
|train_service_code
|canx_type
|Train service code as per schedule
|Populated with "ON CALL", "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN".
|-
|-
|train_file_address
|The TOPS train file address, if applicable
|}
|}

Revision as of 04:02, 26 January 2013

Overview

The Train Cancellation message is used to indicate a train that has been cancelled.

Example

{
    "header": {
        "msg_type": "0002",
        "source_dev_id": "L0BL",
        "user_id": "#QDP1120",
        "original_data_source": "TRUST DA",
        "msg_queue_timestamp": "1359167584000",
        "source_system_id": "TRUST"
    },
    "body": {
        "train_file_address": null,
        "train_service_code": "25437000",
        "orig_loc_stanox": "",
        "toc_id": "71",
        "dep_timestamp": "1359153300000",
        "division_code": "71",
        "loc_stanox": "80419",
        "canx_timestamp": "1359167580000",
        "canx_reason_code": "X2",
        "train_id": "802E51M725",
        "orig_loc_timestamp": "",
        "canx_type": "EN ROUTE"
    }
}

Data structure

Important Header fields

Field Description
msg_type Set to '0002' for a cancellation message
source_system_id Set to "TRUST" for cancellation messages
original_data_source Blank (for automatic cancellations on call), "SDR" (Simplified Direct Reporting) or "TRUST DA" (TRUST Delay Attribution)
user_id The identity of the user who made the cancellation

Body

It is important to note that TRUST is not able to cancel a train unless it has already reported at a location.

Field Description
train_file_address The TOPS train file address, if applicable
train_service_code Train service code as per schedule
orig_loc_stanox Only populated in cancellation type "OUT OF PLAN", and references the identity of the location that the schedule should have been at.
toc_id Operating company ID as per TOC_Codes
dep_timestamp Timestamp representing the departure time of the train at the location that the train is cancelled from
division_code As toc_id
loc_stanox The location that the schedule is being cancelled from. In "OUT OF PLAN" cancellations, this will not be in the schedule but a 0003 Train Movement message will have been sent.
canx_timestamp The time at which the cancellation is made in TRUST.
canx_reason_code Reason code for cancellation, as per the Delay Attribution Guide
train_id Set to the 10-character unique identity for this train, as appearing in other TRUST message types
orig_loc_timestamp Only populated in cancellation type "OUT OF PLAN", and references the departure time of the location that the schedule should have been at.
canx_type Populated with "ON CALL", "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN".