Posts - Managing Deanery LETB to TIS Post Owner

Actions

key summary type updated assignee status
Loading...
Refresh


For Discussion 



#
Comment
Owner
1How should the NULL MainSiteID post rows be associated with a LocalOfifce, using ManagingDeanery, Site, Trust or NationlaPostNumber prefixJoanne Watson (Unlicensed)
2Of the 19,303 Current Posts with a NULL ManagingDeanery, 436 have a IsTrainingPost = Unknown, 8,907 have a IsTrainingPost  = Yes and the remaining 9,960 have a IsTrainingPost = No, can these Posts be ignored in TIS as they are Trust and not trainee posts.Joanne Watson (Unlicensed)

TIS is using the [vwPost].ManagingDeanery field to determine the Post Owner value in TIS, and will NOT be using the Hicom [vwLocalOffice] data derived via the 

vwLocalOffice table using ItemType = 'Site' and UniqueID = MainSiteID


The data reported below has been taken from the Consolidated DR v1 on  


Posts to ManagingDeanery by Status


There are 19,303 Current Post rows where the ManagingDeaneryLETB field is NOT populated

Posts to ManagingDeanery by Status


Posts to ManagingDeanery and LocalOffice by Status

Of these 19,303 Posts, the NULL ManagingDeanery are assigned to the following LocalOffices;

LocalOfficeNameStatusmanagingdeaneryletbrc
HELASECurrentNULL11700
HESWCurrentNULL5874
HENECurrentNULL4961
HEEMCurrentNULL4228
HEWTVCurrentNULL3482
HEYHCurrentNULL2297
HEEOECurrentNULL382
HENWCurrentNULL300
HEWMCurrentNULL273
NULLCurrentNULL8

Posts to ManagingDeanery and LocalOffice by Status

Posts to ManagingDeanery and Mapped LocalOffice by Status

Using the same ManagingDeanery mapping logic as for Programmes

case when p.managingdeaneryletb = 'Health Education England North West' THEN 'HENW'
 	 when p.managingdeaneryletb = 'Health Education England West Midlands' THEN 'HEWM'
	 when p.managingdeaneryletb IN ('Health Education England Yorkshire and the Humber',
									'Yorkshire & Humber Deanery (North East)' THEN 'HEYH'
	 when p.managingdeaneryletb = 'Health Education England North East' THEN 'HENE'
	 when p.managingdeaneryletb = 'Health Education England East of England' THEN 'HEEOE'
	 when p.managingdeaneryletb IN ('Health Education England South West',
	 						        'Peninsula Local Office - HESW',
							        'Severn Local Office - HESW') THEN 'HESW'
	 when p.managingdeaneryletb = 'Health Education England East Midlands' THEN 'HEEM'
	 when p.managingdeaneryletb IN ('Health Education England Kent, Surrey and Sussex',
							        'London LETBs',
							        'Health Education England North West London',
							        'Health Education England North Central and East London',
							        'Health Education England South London') THEN 'HELASE'
	 when p.managingdeaneryletb IN ('Health Education England Wessex', 
                                    'Health Education England Thames Valley') THEN 'HEWTV'
	 else 'UNKNOWN'
end as mapped_lo

The above case statement doesn't cater for the following 9 Managing Deaneries that are assigned to 5,292 Current Posts, or the19,303 with a NULL Managing Deaneries;

Statusmanagingdeaneryletbmapped_lorc
CurrentNULLUNKNOWN19303
CurrentHealth Education England North?Central and East LondonUNKNOWN5179
CurrentDefence Postgraduate Medical DeaneryUNKNOWN47
CurrentSouth West Peninsula DeaneryUNKNOWN33
CurrentWales DeaneryUNKNOWN14
CurrentYorkshire & Humber Deanery (West)UNKNOWN9
CurrentEast Midlands HWD (North)UNKNOWN5
CurrentNon NHS AuthorityUNKNOWN2
CurrentYorkshire & Humber Deanery (South)UNKNOWN2
CurrentLondon DeaneryUNKNOWN1

Of the above 19,303 Current Posts with a NULL Managing Deanery, they have the following IsTrainingPost values;

select Status, p.IsTrainingPost, count(*) as rc
from [HEELIVE].[vwPost] as p
where status = 'Current'
and managingdeaneryletb IS NULL
group by Status, p.IsTrainingPost
StatusIsTrainingPostrc
CurrentUnknown436
CurrentYes8907
CurrentNo9960

Current Posts with a NULL Managing Deanery by IsTrainingPost

Current Non Training Posts will NULL ManagingDeanery

Current Non Training Posts will NULL ManagingDeanery by ApprovedGradeName

Current Posts with NULL managingdeaneryletb and IsTrainingPost in ('No','Unknown') group by nationalPostNumber, MainSiteName and LocalOfficeName

Current Posts and IsTrainingPost = 'No' and SUBSTRING(nationalPostNumber, 1,3) = 'RK9' and MainSiteName = 'Derriford Hospital'

Current Posts managingdeaneryletb IS NULL and IsTrainingPost = 'No' and SUBSTRING(nationalPostNumber, 1,3) = 'NTH' and MainSiteName = 'Freeman Hospital'

Current Posts managingdeaneryletb IS NULL and IsTrainingPost = 'No' and SUBSTRING(nationalPostNumber, 1,3) = 'NTH' and MainSiteName = 'The Royal Victoria Infirmary'

Current Posts managingdeaneryletb IS NULL and IsTrainingPost = 'No' and SUBSTRING(nationalPostNumber, 1,3) = 'NTH' order by AddedDate

The above case statement doesn't cater for the following 17 Managing Deaneries that are assigned to 9,256 Inactive Posts;

Statusmanagingdeaneryletbmapped_lorc
InactiveNULLUNKNOWN59557
InactiveLondon DeaneryUNKNOWN6559
InactiveHealth Education England North?Central and East LondonUNKNOWN1753
InactiveNorth Thames DeaneryUNKNOWN552
InactiveSouth Thames DeaneryUNKNOWN161
InactiveNon NHS AuthorityUNKNOWN83
InactiveDefence Postgraduate Medical DeaneryUNKNOWN49
InactiveNon London LETBUNKNOWN33
InactiveOxford DeaneryUNKNOWN21
InactiveYorkshire & Humber Deanery (West)UNKNOWN10
InactiveNorth West Thames DeaneryUNKNOWN9
InactiveYorkshire & Humber Deanery (South)UNKNOWN8
InactiveWales DeaneryUNKNOWN6
InactiveOverseasUNKNOWN5
InactiveEast Midlands HWD (South)UNKNOWN3
InactiveSouth West Peninsula DeaneryUNKNOWN2
InactiveNorthern DeaneryUNKNOWN1
InactiveWest Midlands DeaneryUNKNOWN1

Posts to ManagingDeanery and Mapped LocalOffice by Status

Posts to ManagingDeanery, LocalOffice and Mapped LocalOffice by Status

Breaking down the Current mapped UNKOWN LocalOffice values further using the LocalOffice;

LocalOfficeNameStatusmanagingdeaneryletbmapped_lorc
HEEMCurrentNULLUNKNOWN4228
HEEMCurrentHealth Education England North?Central and East LondonUNKNOWN259
HEEMCurrentSouth West Peninsula DeaneryUNKNOWN5
HEEMCurrentEast Midlands HWD (North)UNKNOWN5
HEEMCurrentYorkshire & Humber Deanery (South)UNKNOWN1
HEEOECurrentHealth Education England North?Central and East LondonUNKNOWN1517
HEEOECurrentNULLUNKNOWN382
HEEOECurrentEast Midlands HWD (North)UNKNOWN5
HEEOECurrentDefence Postgraduate Medical DeaneryUNKNOWN4
HEEOECurrentSouth West Peninsula DeaneryUNKNOWN1
HELASECurrentNULLUNKNOWN11700
HELASECurrentHealth Education England North?Central and East LondonUNKNOWN5167
HELASECurrentDefence Postgraduate Medical DeaneryUNKNOWN46
HELASECurrentSouth West Peninsula DeaneryUNKNOWN21
HELASECurrentWales DeaneryUNKNOWN14
HELASECurrentEast Midlands HWD (North)UNKNOWN5
HELASECurrentNon NHS AuthorityUNKNOWN2
HELASECurrentYorkshire & Humber Deanery (West)UNKNOWN1
HELASECurrentLondon DeaneryUNKNOWN1
HENECurrentNULLUNKNOWN4961
HENWCurrentNULLUNKNOWN300
HENWCurrentWales DeaneryUNKNOWN12
HENWCurrentDefence Postgraduate Medical DeaneryUNKNOWN1
HENWCurrentHealth Education England North?Central and East LondonUNKNOWN1
HESWCurrentNULLUNKNOWN5874
HESWCurrentHealth Education England North?Central and East LondonUNKNOWN111
HESWCurrentSouth West Peninsula DeaneryUNKNOWN33
HESWCurrentEast Midlands HWD (North)UNKNOWN5
HESWCurrentWales DeaneryUNKNOWN2
HESWCurrentDefence Postgraduate Medical DeaneryUNKNOWN1
HEWMCurrentNULLUNKNOWN273
HEWMCurrentHealth Education England North?Central and East LondonUNKNOWN112
HEWMCurrentEast Midlands HWD (North)UNKNOWN5
HEWMCurrentDefence Postgraduate Medical DeaneryUNKNOWN2
HEWMCurrentSouth West Peninsula DeaneryUNKNOWN1
HEWTVCurrentNULLUNKNOWN3482
HEWTVCurrentSouth West Peninsula DeaneryUNKNOWN22
HEWTVCurrentHealth Education England North?Central and East LondonUNKNOWN5
HEYHCurrentNULLUNKNOWN2297
HEYHCurrentYorkshire & Humber Deanery (West)UNKNOWN9
HEYHCurrentYorkshire & Humber Deanery (South)UNKNOWN2
NULLCurrentNULLUNKNOWN8

And of the Inactive ones;

LocalOfficeNameStatusmanagingdeaneryletbmapped_lorc
HEEMInactiveNULLUNKNOWN15956
HEEMInactiveLondon DeaneryUNKNOWN59
HEEMInactiveHealth Education England North?Central and East LondonUNKNOWN30
HEEMInactiveYorkshire & Humber Deanery (South)UNKNOWN7
HEEMInactiveNorth Thames DeaneryUNKNOWN7
HEEMInactiveNorth West Thames DeaneryUNKNOWN5
HEEMInactiveEast Midlands HWD (South)UNKNOWN3
HEEMInactiveSouth West Peninsula DeaneryUNKNOWN1
HEEMInactiveDefence Postgraduate Medical DeaneryUNKNOWN1
HEEMInactiveNon London LETBUNKNOWN1
HEEOEInactiveNULLUNKNOWN4352
HEEOEInactiveHealth Education England North?Central and East LondonUNKNOWN217
HEEOEInactiveLondon DeaneryUNKNOWN175
HEEOEInactiveNorth Thames DeaneryUNKNOWN80
HEEOEInactiveNorth West Thames DeaneryUNKNOWN5
HEEOEInactiveDefence Postgraduate Medical DeaneryUNKNOWN2
HELASEInactiveNULLUNKNOWN25177
HELASEInactiveLondon DeaneryUNKNOWN6206
HELASEInactiveHealth Education England North?Central and East LondonUNKNOWN1747
HELASEInactiveNorth Thames DeaneryUNKNOWN538
HELASEInactiveSouth Thames DeaneryUNKNOWN160
HELASEInactiveNon NHS AuthorityUNKNOWN83
HELASEInactiveDefence Postgraduate Medical DeaneryUNKNOWN49
HELASEInactiveNon London LETBUNKNOWN33
HELASEInactiveOxford DeaneryUNKNOWN17
HELASEInactiveNorth West Thames DeaneryUNKNOWN9
HELASEInactiveWales DeaneryUNKNOWN6
HELASEInactiveOverseasUNKNOWN5
HELASEInactiveNorthern DeaneryUNKNOWN1
HELASEInactiveSouth West Peninsula DeaneryUNKNOWN1
HELASEInactiveYorkshire & Humber Deanery (West)UNKNOWN1
HELASEInactiveWest Midlands DeaneryUNKNOWN1
HENEInactiveNULLUNKNOWN7829
HENEInactiveNorthern DeaneryUNKNOWN1
HENWInactiveNULLUNKNOWN592
HENWInactiveWales DeaneryUNKNOWN6
HENWInactiveDefence Postgraduate Medical DeaneryUNKNOWN1
HESWInactiveNULLUNKNOWN12670
HESWInactiveHealth Education England North?Central and East LondonUNKNOWN8
HESWInactiveNorth West Thames DeaneryUNKNOWN5
HESWInactiveSouth Thames DeaneryUNKNOWN4
HESWInactiveSouth West Peninsula DeaneryUNKNOWN2
HEWMInactiveNULLUNKNOWN669
HEWMInactiveHealth Education England North?Central and East LondonUNKNOWN7
HEWMInactiveNorth West Thames DeaneryUNKNOWN5
HEWMInactiveDefence Postgraduate Medical DeaneryUNKNOWN2
HEWTVInactiveNULLUNKNOWN14619
HEWTVInactiveLondon DeaneryUNKNOWN125
HEWTVInactiveOxford DeaneryUNKNOWN3
HEWTVInactiveSouth Thames DeaneryUNKNOWN2
HEWTVInactiveSouth West Peninsula DeaneryUNKNOWN1
HEWTVInactiveHealth Education England North?Central and East LondonUNKNOWN1
HEYHInactiveNULLUNKNOWN15061
HEYHInactiveYorkshire & Humber Deanery (West)UNKNOWN10
HEYHInactiveYorkshire & Humber Deanery (South)UNKNOWN8
HEYHInactiveNon NHS AuthorityUNKNOWN5
HEYHInactiveEast Midlands HWD (South)UNKNOWN3
HEYHInactiveHealth Education England North?Central and East LondonUNKNOWN1
NULLInactiveNULLUNKNOWN3631
NULLInactiveLondon DeaneryUNKNOWN353
NULLInactiveNorth Thames DeaneryUNKNOWN14
NULLInactiveHealth Education England North?Central and East LondonUNKNOWN6
NULLInactiveOxford DeaneryUNKNOWN4
NULLInactiveSouth Thames DeaneryUNKNOWN1

Posts to ManagingDeanery, LocalOffice and Mapped LocalOffice by Status

Posts with a NULL vwPost.MainSiteID value


How to identify the LocalOffice for Posts with a NULL MainSiteID field;

select ISNULL(lo.LocalOfficeName, 'NULL') LocalOfficeName_MS, Status, p.managingdeaneryletb, 
		case when p.managingdeaneryletb = 'Health Education England North West' THEN 'HENW'
            when p.managingdeaneryletb = 'Health Education England West Midlands' THEN 'HEWM'
            when p.managingdeaneryletb = 'Health Education England Yorkshire and the Humber' THEN 'HEYH'
            when p.managingdeaneryletb = 'Health Education England North East' THEN 'HENE'
            when p.managingdeaneryletb = 'Health Education England East of England' THEN 'HEEOE'
            when p.managingdeaneryletb IN ('Health Education England South West',
                                       'Peninsula Local Office - HESW',
                                       'Severn Local Office - HESW') THEN 'HESW'
            when p.managingdeaneryletb IN ('Health Education England East Midlands',
                                       'Yorkshire & Humber Deanery (North East)') THEN 'HEEM'
            when p.managingdeaneryletb IN ('Health Education England Kent, Surrey and Sussex',
                                       'London LETBs',
                                       'Health Education England North West London',
                                       'Health Education England North Central and East London',
                                       'Health Education England South London') THEN 'HELASE'
            when p.managingdeaneryletb IN ('Health Education England Wessex', 'Health Education England Thames Valley') THEN 'HEWTV'
            else 'UNKNOWN'
        end as mapped_lo,  FundingBodyTrustID, ISNULL(lot.LocalOfficeName, 'NULL') LocalOfficeName_Trust, substring(NationalPostNumber,1,3) as ntn_lo, count(*) as rc
from [HEELIVE].[vwPost] as p
left join [HEELIVE].[vwLocalOffice] as lo on (lo.ItemType = 'Site' and lo.UniqueID = p.MainSiteID)
left join [HEELIVE].[vwLocalOffice] as lot on (lot.ItemType = 'Trust' and lot.UniqueID = p.FundingBodyTrustID)
where lo.LocalOfficeName is null
group by lo.LocalOfficeName, Status, p.managingdeaneryletb, MainSiteID, FundingBodyTrustID, lot.LocalOfficeName, substring(NationalPostNumber,1,3)
order by 2, 4 desc, 5, 8 desc,1;

The current sites with a NULL MainSiteID;

LocalOfficeName_MSStatusmanagingdeaneryletbmapped_loFundingBodyTrustIDLocalOfficeName_Trustntn_lorc
NULLCurrentNULLUNKNOWNNULLNULLNULL5
NULLCurrentNULLUNKNOWNNULLNULLNA1
NULLCurrentNULLUNKNOWN129200612HELASEKSS2
NULLCurrentHealth Education England West MidlandsHEWM8140607HENWWMD1
NULLCurrentHealth Education England West MidlandsHEWM8140607HEEMWMD1
NULLCurrentHealth Education England West MidlandsHEWM8140607HEEOEWMD1
NULLCurrentHealth Education England West MidlandsHEWM8140607HELASEWMD1
NULLCurrentHealth Education England West MidlandsHEWM8140607HEWMWMD1
NULLCurrentSevern Local Office - HESWHESWNULLNULLNULL1
NULLCurrentHealth Education England North WestHENW6500118HELASENWN2
NULLCurrentHealth Education England North WestHENW6500118HENWNWN2
NULLCurrentHealth Education England North WestHENW8139427HENWNWN3
NULLCurrentHealth Education England North WestHENW8139859HENWNWN3
NULLCurrentHealth Education England North WestHENW8140080HENWNWN8
NULLCurrentHealth Education England North WestHENW8140588HENWNWN3
NULLCurrentHealth Education England North EastHENENULLNULLNTH1

Posts with a NULL vwPost.MainSiteID value

Trusts with multiple LocalOffices assigned at the Trust Level;

select * from [HEELIVE].[vwTrust] where TrustID in (8140607,6500118)
RecordOriginSTATUSTrustNameTrustKnownAsTrustNumberDeaneryLETBTrustID
HEELIVECurrentCentral Manchester University Hospitals NHS Foundation TrustCentral Manchester University Hospitals NHS Foundation TrustRW3North Western6500118
HEELIVECurrentSt Helens and Knowsley Hospital Services NHS TrustSt Helens and Knowsley Hospital Services NHS TrustRBNMersey8140607