# Mapped on top-level of 2001 NHS Data Dictionary; https://datadictionary.nhs.uk/data_elements/ethnic_category.html 
ethnicity_map = {'Algerian': 'Black',
 'Any Other Group': 'Other',
 'Asian and Chinese': 'Asian',
 'Bangladeshi': 'Asian',
 'Black African': 'Black',
 'Black British': 'Black',
 'British': 'White',
 'Caribbean': 'Black',
 'Chinese': 'Asian',
 'Cypriot (Part nt st)': 'White',
 'Ecuadorian': 'Other',
 'English': 'White',
 'Ethiopian': 'Black',
 'Filipino': 'Asian',
 'Ghanaian': 'Black',
 'Greek Cypriot': 'White',
 'Indian/British India': 'Asian',
 'Iranian': 'Other',
 'Italian': 'White',
 'Mixed Black': 'Black',
 'Mixed Caribbean': 'Black',
 'Nigerian': 'Black',
 'Not Given': 'Unknown',
 'Not Specified': 'Unknown',
 'Not Stated': 'Unknown',
 'OTHER ASIAN BACKGROU': 'Asian',
 'Other Asian Unspecif': 'Asian',
 'OTHER BLACK BACKGROU': 'Black',
 'Other Black Unspecif': 'Black',
 'Other Ethnic Group': 'Other',
 'Other Latin American': 'Other',
 'OTHER WHITE BACK GRO': 'White',
 'Other White Unspecif': 'White',
 'Other White/Mixed Eu': 'White',
 'Pakistani/British Pa': 'Asian',
 'Portuguese': 'White',
 'Somali': 'Black',
 'Spanish': 'White',
 'Sri Lankan': 'Asian',
 'Sudanese': 'Black',
 'Turkish': 'Other',
 'Ugandan': 'Black',
 'Vietnamese': 'Asian',
 'White Irish': 'White',
 'Former USSR Rep': 'White',
 'POLISH': 'White',
 'Iraqi': 'Other',
 'Albanian': 'Other',
 'Columbian': 'Other',
 'Scottish': 'White',
 'Not stated': 'Unknown',
 'OTHER MIXED BACKGROU': 'Mixed',
 'Welsh': 'White',
 'British Asian': 'Asian',
 'Caribbean Asian': 'Asian',
 'Eritrean': 'Black',
 'Turkish Cypriot': 'Other',
 'Sinhalese': 'Asian',
 'White and Asian': 'Asian',
 'Other Mixed': 'Mixed',
 'Mixed Asian': 'Asian',
 'Greek': 'White',
 'Arab': 'Other',
 'MULTIPLE CODES': 'MULTIPLE CODES',
 'Irish': 'White',
 'Japanese': 'Asian',
 'Middle East': 'Other',
 'Croatian': 'White',
 'Black and Asian': 'Mixed',
 'Black and White': 'Mixed'}

# Mapped on bottom-level of 2001 NHS Data Dictionary; https://datadictionary.nhs.uk/data_elements/ethnic_category.html 
ethnicity_map_detail = {'Algerian': 'Black or Black British - African',
 'Any Other Group': 'Other Ethnic Groups - Any other ethnic group',
 'Asian and Chinese': 'Other Ethnic Groups - Chinese',
 'Bangladeshi': 'Asian or Asian British - Pakistani',
 'Black African': 'Black or Black British - African',
 'Black British': 'Black or Black British - Any Other Black background',
 'British': 'White - British',
 'Caribbean': 'Black or Black British - Caribbean',
 'Chinese': 'Other Ethnic Groups - Chinese',
 'Cypriot (Part nt st)': 'White - Any other White background',
 'Ecuadorian': 'Other Ethnic Groups - Any other ethnic group',
 'English': 'White - British',
 'Ethiopian': 'Black or Black British - African',
 'Filipino': 'Asian or Asian British - Any other Asian background',
 'Ghanaian': 'Black or Black British - African',
 'Greek Cypriot': 'White - Any other White background',
 'Indian/British India': 'Asian or Asian British - Indian',
 'Iranian': 'Other Ethnic Groups - Any other ethnic group',
 'Italian': 'White - Any other White background',
 'Mixed Black': 'Black or Black British - Any other Black background',
 'Mixed Caribbean': 'Black or Black British - Caribbean',
 'Nigerian': 'Black or Black British - African',
 'Not Given': 'Not stated',
 'Not Specified': 'Not stated',
 'Not Stated': 'Not stated',
 'OTHER ASIAN BACKGROU': 'Asian or Asian British - Any other Asian background',
 'Other Asian Unspecif': 'Asian or Asian British - Any other Asian background',
 'OTHER BLACK BACKGROU': 'Black or Black British - Any Other Black background',
 'Other Black Unspecif': 'Black or Black British - Any Other Black background',
 'Other Ethnic Group': 'Other Ethnic Groups - Any other ethnic group',
 'Other Latin American': 'Other Ethnic Groups - Any other ethnic group',
 'OTHER WHITE BACK GRO': 'White - Any other White background',
 'Other White Unspecif': 'White - Any other White background',
 'Other White/Mixed Eu': 'White - Any other White background',
 'Pakistani/British Pa': 'Asian or Asian British - Pakistani',
 'Portuguese': 'White - Any other White background',
 'Somali': 'Black or Black British - African',
 'Spanish': 'White - Any other White background',
 'Sri Lankan': 'Asian or Asian British - Any other Asian background',
 'Sudanese': 'Black or Black British - African',
 'Turkish': 'Other Ethnic Groups - Any other ethnic group',
 'Ugandan': 'Black or Black British - African',
 'Vietnamese': 'Other Ethnic Groups - Any other ethnic group',
 'White Irish': 'White - Irish',
 'Former USSR Rep': 'White - Any other White background',
 'POLISH': 'White - Any other White background',
 'Iraqi': 'Other Ethnic Groups - Any other ethnic group',
 'Albanian': 'White - Any other White background',
 'Columbian': 'Other Ethnic Groups - Any other ethnic group',
 'Scottish': 'White - British',
 'Not stated': 'Not stated',
 'OTHER MIXED BACKGROU': 'Mixed - Any other mixed background',
 'Welsh': 'White - British',
 'British Asian': 'Asian or Asian British - Any other Asian background',
 'Caribbean Asian': 'Mixed - Any other mixed background',
 'Eritrean': 'Black or Black British - African',
 'Turkish Cypriot': 'Other Ethnic Groups - Any other ethnic group',
 'Sinhalese': 'Asian or Asian British - Any other Asian background',
 'White and Asian': 'Mixed - White and Asian',
 'Other Mixed': 'Mixed - Any other mixed background',
 'Mixed Asian': 'Mixed - Any other mixed background',
 'Greek': 'White - Any other White background',
 'Arab': 'Other Ethnic Groups - Any other ethnic group',
 'MULTIPLE CODES': 'MULTIPLE CODES',
 'Irish': 'White - Irish',
 'Japanese': 'Other Ethnic Groups - Any other ethnic group',
 'Middle East': 'Other Ethnic Groups - Any other ethnic group',
 'Croatian': 'White - Any other White background',
 'Black and Asian': 'Mixed - White and Asian',
 'Black and White': 'Mixed - Any other mixed background'}
