Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. TraineeProfile: add linkedProgrammeMembership[]: {uuid, when, how, metrics} to placement subdocument. The actual details of the PM are already held in the programmeMembership[] subdocuments.

  2. tis-trainee-sync: add placementProgrammeMembership collection to be synced from TIS, and triggering re-enrichment of related placements. For the first phase, the only sync will be the Placement-ProgrammeMembership-Link table from TIS. When an INSERT/UPDATE/DELETE record arrives in tis-trainee-sync for that table we would need to update the sync collection, re-enrich the related placement and update the trainee profile accordingly.
    In addition, send this new trainee profile content to the NDW.
    In phase 1, the new linkedProgrammeMembership data should not affect TSS credentials, forms, notifications or actions,

...

Notes:

  1. Post linkage (not reliable):
    Sometimes placements ‘borrow’ post from another programme because otherwise post management becomes laborious, e.g. Emergency Medicine Higher → EM run-through; GP using Obstetrics etc. in hospital placement.

...

  1. When the notifications pilot was run, we had a slightly different rule to identify placements that belonged to pilot programme memberships. This rule had a similar rate of ambiguous / missing matches (and in the context we didn't mind, since it was intended purely to identify if there was at least one programme membership that the placement might belong to that was in the pilot, rather than identify that PM unambiguously).

    New rule:
    - placement start date between PM start and end dates OR
    - placement start date no more than 13 days before the PM start date AND placement end date no later than PM end date

    The rule we used for the pilot logic:
    - placement start date not before 1st of month of PM start date AND placement start date on no later than PM end date
    Comparison:
    SQL new rule (example for no matches, 2023):
    SELECT
    count(*)
    -- pl.id, pl.dateFrom, pl.dateTo, matches, minpmuuid, pmmin.programmeStartDate, pmmin.programmeEndDate, maxpmuuid, pmmax.programmeStartDate, pmmax.programmeEndDate
    FROM tcs.Placement pl JOIN
    (
    SELECT id, sum(ismatch) as matches, min(uuid) as minpmuuid, max(uuid) as maxpmuuid FROM
    (
    SELECT pl.id, pm.uuid, if((pl.dateFrom >= pm.programmeStartDate AND pl.dateFrom <= pm.programmeEndDate)
    OR (date_add(pl.dateFrom, interval 13 day) >= pm.programmeStartDate AND pl.dateTo <= pm.programmeEndDate), 1, 0) AS isMatch FROM
    tcs.Placement pl
    JOIN tcs.ProgrammeMembership pm ON pm.personId = pl.traineeId
    WHERE (pl.dateFrom >= "2022-01-01" AND pl.dateFrom < "2023-01-01")
    ) plpm_match
    GROUP BY id
    ) plsummary ON pl.id = plsummary.id
    JOIN tcs.ProgrammeMembership pmmin ON pmmin.uuid = plsummary.minpmuuid
    JOIN tcs.ProgrammeMembership pmmax ON pmmax.uuid = plsummary.maxpmuuid
    WHERE matches = 0
    Pilot rule (example for no matches, 2023):
    SELECT
    count(*)
    -- pl.id, pl.dateFrom, pl.dateTo, matches, minpmuuid, pmmin.programmeStartDate, pmmin.programmeEndDate, maxpmuuid, pmmax.programmeStartDate, pmmax.programmeEndDate
    FROM tcs.Placement pl JOIN
    (
    SELECT id, sum(ismatch) as matches, min(uuid) as minpmuuid, max(uuid) as maxpmuuid FROM
    (
    SELECT pl.id, pm.uuid, if((pl.dateFrom >= CAST(DATE_FORMAT(pm.programmeStartDate ,'%Y-%m-01') as DATE) AND pl.dateFrom <= pm.programmeEndDate), 1, 0) AS isMatch FROM
    tcs.Placement pl
    JOIN tcs.ProgrammeMembership pm ON pm.personId = pl.traineeId
    WHERE (pl.dateFrom >= "2022-01-01" AND pl.dateFrom < "2023-01-01")
    ) plpm_match
    GROUP BY id
    ) plsummary ON pl.id = plsummary.id
    JOIN tcs.ProgrammeMembership pmmin ON pmmin.uuid = plsummary.minpmuuid
    JOIN tcs.ProgrammeMembership pmmax ON pmmax.uuid = plsummary.maxpmuuid
    WHERE matches = 0

...

Note that the table above excludes placements for the 2-3% of trainees who have no programme memberships set up. Revised estimates for recent years including different linking methods are summarised below:

linked method:

placement year start

total placements

unlinked

unlinkable trainee

unique PM

PM end date matches

f1f2_foundation specialty

%linked

%unlinkable

%to link

2024

158149

808

4153

153111

63

14

96.9%

2.6%

0.51%

2023

153490

716

4104

148618

52

0

96.9%

2.7%

0.47%

2022

144648

729

3612

140250

54

3

97.0%

2.5%

0.50%

2021

139423

821

3061

135460

72

9

97.2%

2.2%

0.59%

2020

117308

780

2896

113551

50

31

96.9%

2.5%

0.66%

2019

124209

791

2615

120681

70

52

97.3%

2.1%

0.64%

2018

119838

961

2664

116156

51

6

97.0%

2.2%

0.80%