     date_of_birth         date COMMENT 'from PersonBirthDate',
     consultant_code       varchar(20) NOT NULL COMMENT 'GMC number of consultant, from AEStaffMemberCode',
 
+    patient_pathway_identifier      varchar(20)  COMMENT 'links to the EpisodeId from the tail file if present',
     attendance_number               varchar(12),
     arrival_mode_code               char(1)      COMMENT 'LKP_CDS_AEA_ARRIVAL_MODE',
     attendance_category_code        char(1)      COMMENT 'LKP_AEA_ATTEND_CAT',

    dt_received                    datetime     NOT NULL COMMENT 'date time this record was received into Discovery',
    record_checksum                bigint       NOT NULL COMMENT 'checksum of the columns below to easily spot duplicates',
    cds_activity_date              datetime     NOT NULL COMMENT 'Date common to all sus files',
    -- sus_record_type                varchar(10)  NOT NULL COMMENT 'one of inpatient, outpatient, emergency',
    cds_unique_identifier          varchar(50)  NOT NULL COMMENT 'from CDSUniqueIdentifier',
    cds_update_type                int          NOT NULL COMMENT 'from CDSUpdateType',
    mrn                            varchar(10)  NOT NULL COMMENT 'patient MRN from LocalPatientID field',

    dt_received                     datetime    NOT NULL COMMENT 'date time this record was received into Discovery',
    record_checksum                 bigint      NOT NULL COMMENT 'checksum of the columns below to easily spot duplicates',
    cds_activity_date               datetime    NOT NULL COMMENT 'Date common to all sus files',
    cds_unique_identifier           varchar(50) NOT NULL COMMENT 'from CDSUniqueIdentifier',
    cds_update_type                 int         NOT NULL COMMENT 'from CDSUpdateType',
    mrn                             varchar(10) NOT NULL COMMENT 'patient MRN from LocalPatientID field',
