diff --git a/OmopTransformer/SUS/OP/ConditionOccurrence/SusOPConditionOccurrence.xml b/OmopTransformer/SUS/OP/ConditionOccurrence/SusOPConditionOccurrence.xml index 709d9ef..bfb198b 100644 --- a/OmopTransformer/SUS/OP/ConditionOccurrence/SusOPConditionOccurrence.xml +++ b/OmopTransformer/SUS/OP/ConditionOccurrence/SusOPConditionOccurrence.xml @@ -7,7 +7,7 @@ op.NHSNumber, op.CDSActivityDate from omop_staging.sus_OP_ICDDiagnosis d - inner join [OMOP_SUS].[omop_staging].[sus_OP] op + inner join [omop_staging].[sus_OP] op on d.MessageId = op.MessageId where op.NHSNumber is not null diff --git a/OmopTransformer/SUS/OP/Death/SusOPDeath.xml b/OmopTransformer/SUS/OP/Death/SusOPDeath.xml index c1d2801..93e1d04 100644 --- a/OmopTransformer/SUS/OP/Death/SusOPDeath.xml +++ b/OmopTransformer/SUS/OP/Death/SusOPDeath.xml @@ -3,7 +3,7 @@ select NHSNumber as nhs_number, max(ReferralToTreatmentPeriodEndDate) as death_date - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where ReferralToTreatmentPeriodStatus = 36 and ReferralToTreatmentPeriodEndDate is not null and NHSNumber is not null diff --git a/OmopTransformer/SUS/OP/Location/SusOPLocation.xml b/OmopTransformer/SUS/OP/Location/SusOPLocation.xml index 4356e7f..15bab36 100644 --- a/OmopTransformer/SUS/OP/Location/SusOPLocation.xml +++ b/OmopTransformer/SUS/OP/Location/SusOPLocation.xml @@ -5,7 +5,7 @@ Postcode, Country, NHSNumber - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null and Postcode is not null diff --git a/OmopTransformer/SUS/OP/Person/SusOPPerson.xml b/OmopTransformer/SUS/OP/Person/SusOPPerson.xml index c26dcb4..5195ecc 100644 --- a/OmopTransformer/SUS/OP/Person/SusOPPerson.xml +++ b/OmopTransformer/SUS/OP/Person/SusOPPerson.xml @@ -5,7 +5,7 @@ max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/CdsPerson.json b/docs/transformation-documentation/CdsPerson.json index 24378bc..022de0c 100644 --- a/docs/transformation-documentation/CdsPerson.json +++ b/docs/transformation-documentation/CdsPerson.json @@ -36,7 +36,7 @@ } ], "query": "\nselect\n\tNHSNumber,\n\tmax(DateofBirth) as DateOfBirth,\n\tmax(EthnicCategory) as EthnicCategory,\n\tmax(PersonCurrentGenderCode) as PersonCurrentGenderCode\nfrom omop_staging.cds_line01\nwhere NHSNumber is not null\ngroup by NHSNumber\n\t", - "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|8551|Indeterminate (unable to be classified as either male or female)|\r\n|X|8551|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" + "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|0|Indeterminate (unable to be classified as either male or female)|\r\n|X|0|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" }, { "name": "year_of_birth", diff --git a/docs/transformation-documentation/ConditionOccurrence_condition_source_concept_id.md b/docs/transformation-documentation/ConditionOccurrence_condition_source_concept_id.md index 6ed8776..3327d2d 100644 --- a/docs/transformation-documentation/ConditionOccurrence_condition_source_concept_id.md +++ b/docs/transformation-documentation/ConditionOccurrence_condition_source_concept_id.md @@ -20,7 +20,7 @@ Resolve ICD10 codes to OMOP concepts. If code cannot be mapped, map using the pa op.NHSNumber, op.CDSActivityDate from omop_staging.sus_OP_ICDDiagnosis d - inner join [OMOP_SUS].[omop_staging].[sus_OP] op + inner join [omop_staging].[sus_OP] op on d.MessageId = op.MessageId where op.NHSNumber is not null diff --git a/docs/transformation-documentation/ConditionOccurrence_condition_source_value.md b/docs/transformation-documentation/ConditionOccurrence_condition_source_value.md index bcef5ef..f859231 100644 --- a/docs/transformation-documentation/ConditionOccurrence_condition_source_value.md +++ b/docs/transformation-documentation/ConditionOccurrence_condition_source_value.md @@ -19,7 +19,7 @@ has_toc: false op.NHSNumber, op.CDSActivityDate from omop_staging.sus_OP_ICDDiagnosis d - inner join [OMOP_SUS].[omop_staging].[sus_OP] op + inner join [omop_staging].[sus_OP] op on d.MessageId = op.MessageId where op.NHSNumber is not null diff --git a/docs/transformation-documentation/ConditionOccurrence_condition_start_date.md b/docs/transformation-documentation/ConditionOccurrence_condition_start_date.md index a9f377b..acade5d 100644 --- a/docs/transformation-documentation/ConditionOccurrence_condition_start_date.md +++ b/docs/transformation-documentation/ConditionOccurrence_condition_start_date.md @@ -20,7 +20,7 @@ Converts text to dates. op.NHSNumber, op.CDSActivityDate from omop_staging.sus_OP_ICDDiagnosis d - inner join [OMOP_SUS].[omop_staging].[sus_OP] op + inner join [omop_staging].[sus_OP] op on d.MessageId = op.MessageId where op.NHSNumber is not null diff --git a/docs/transformation-documentation/ConditionOccurrence_nhs_number.md b/docs/transformation-documentation/ConditionOccurrence_nhs_number.md index 407aa60..64dcdc6 100644 --- a/docs/transformation-documentation/ConditionOccurrence_nhs_number.md +++ b/docs/transformation-documentation/ConditionOccurrence_nhs_number.md @@ -19,7 +19,7 @@ has_toc: false op.NHSNumber, op.CDSActivityDate from omop_staging.sus_OP_ICDDiagnosis d - inner join [OMOP_SUS].[omop_staging].[sus_OP] op + inner join [omop_staging].[sus_OP] op on d.MessageId = op.MessageId where op.NHSNumber is not null diff --git a/docs/transformation-documentation/Death_NhsNumber.md b/docs/transformation-documentation/Death_NhsNumber.md index 436589d..fb618b2 100644 --- a/docs/transformation-documentation/Death_NhsNumber.md +++ b/docs/transformation-documentation/Death_NhsNumber.md @@ -15,7 +15,7 @@ has_toc: false select NHSNumber as nhs_number, max(ReferralToTreatmentPeriodEndDate) as death_date - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where ReferralToTreatmentPeriodStatus = 36 and ReferralToTreatmentPeriodEndDate is not null and NHSNumber is not null diff --git a/docs/transformation-documentation/Death_death_date.md b/docs/transformation-documentation/Death_death_date.md index 348dbe6..dbbad6f 100644 --- a/docs/transformation-documentation/Death_death_date.md +++ b/docs/transformation-documentation/Death_death_date.md @@ -16,7 +16,7 @@ Converts text to dates. select NHSNumber as nhs_number, max(ReferralToTreatmentPeriodEndDate) as death_date - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where ReferralToTreatmentPeriodStatus = 36 and ReferralToTreatmentPeriodEndDate is not null and NHSNumber is not null diff --git a/docs/transformation-documentation/Location_location_source_value.md b/docs/transformation-documentation/Location_location_source_value.md index 5f167fd..45eb764 100644 --- a/docs/transformation-documentation/Location_location_source_value.md +++ b/docs/transformation-documentation/Location_location_source_value.md @@ -17,7 +17,7 @@ has_toc: false Postcode, Country, NHSNumber - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null and Postcode is not null diff --git a/docs/transformation-documentation/Location_nhs_number.md b/docs/transformation-documentation/Location_nhs_number.md index f1d52e0..0662e66 100644 --- a/docs/transformation-documentation/Location_nhs_number.md +++ b/docs/transformation-documentation/Location_nhs_number.md @@ -17,7 +17,7 @@ has_toc: false Postcode, Country, NHSNumber - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null and Postcode is not null diff --git a/docs/transformation-documentation/Location_zip.md b/docs/transformation-documentation/Location_zip.md index 94cb40c..67f1887 100644 --- a/docs/transformation-documentation/Location_zip.md +++ b/docs/transformation-documentation/Location_zip.md @@ -18,7 +18,7 @@ Uppercase the postcode then insert the space in the correct location, if needed. Postcode, Country, NHSNumber - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null and Postcode is not null diff --git a/docs/transformation-documentation/Observation_RecordConnectionIdentifier.md b/docs/transformation-documentation/Observation_RecordConnectionIdentifier.md index 005832e..b415d76 100644 --- a/docs/transformation-documentation/Observation_RecordConnectionIdentifier.md +++ b/docs/transformation-documentation/Observation_RecordConnectionIdentifier.md @@ -39,12 +39,14 @@ group by * `GeneratedRecordIdentifier` CDS specific identifier that binds multiple CDS messages together. [CDS RECORD IDENTIFIER](https://www.datadictionary.nhs.uk/data_elements/cds_record_identifier.html) ```sql -select NHSNumber, - GeneratedRecordIdentifier, - StartDateHospitalProviderSpell, - StartTimeHospitalProviderSpell, - ReferrerCode -- Referrer code is the code of the person making the referral request -FROM [OMOP_SUS].[omop_staging].[sus_APC] +select + NHSNumber, + GeneratedRecordIdentifier, + StartDateHospitalProviderSpell, + StartTimeHospitalProviderSpell, + ReferrerCode -- Referrer code is the code of the person making the referral request +FROM [omop_staging].[sus_APC] +where NHSNumber is not null ``` diff --git a/docs/transformation-documentation/Observation_nhs_number.md b/docs/transformation-documentation/Observation_nhs_number.md index 16a769c..0b07208 100644 --- a/docs/transformation-documentation/Observation_nhs_number.md +++ b/docs/transformation-documentation/Observation_nhs_number.md @@ -39,12 +39,14 @@ group by * `NHSNumber` Patient NHS Number [NHS NUMBER](https://www.datadictionary.nhs.uk/data_elements/nhs_number.html) ```sql -select NHSNumber, - GeneratedRecordIdentifier, - StartDateHospitalProviderSpell, - StartTimeHospitalProviderSpell, - ReferrerCode -- Referrer code is the code of the person making the referral request -FROM [OMOP_SUS].[omop_staging].[sus_APC] +select + NHSNumber, + GeneratedRecordIdentifier, + StartDateHospitalProviderSpell, + StartTimeHospitalProviderSpell, + ReferrerCode -- Referrer code is the code of the person making the referral request +FROM [omop_staging].[sus_APC] +where NHSNumber is not null ``` diff --git a/docs/transformation-documentation/Observation_observation_date.md b/docs/transformation-documentation/Observation_observation_date.md index bf5a169..d00e5c9 100644 --- a/docs/transformation-documentation/Observation_observation_date.md +++ b/docs/transformation-documentation/Observation_observation_date.md @@ -41,12 +41,14 @@ Converts text to dates. * `StartDateHospitalProviderSpell` Event date [START DATE (HOSPITAL PROVIDER SPELL)](https://www.datadictionary.nhs.uk/data_elements/start_date__hospital_provider_spell_.html) ```sql -select NHSNumber, - GeneratedRecordIdentifier, - StartDateHospitalProviderSpell, - StartTimeHospitalProviderSpell, - ReferrerCode -- Referrer code is the code of the person making the referral request -FROM [OMOP_SUS].[omop_staging].[sus_APC] +select + NHSNumber, + GeneratedRecordIdentifier, + StartDateHospitalProviderSpell, + StartTimeHospitalProviderSpell, + ReferrerCode -- Referrer code is the code of the person making the referral request +FROM [omop_staging].[sus_APC] +where NHSNumber is not null ``` diff --git a/docs/transformation-documentation/Observation_observation_datetime.md b/docs/transformation-documentation/Observation_observation_datetime.md index 95892cd..71c6166 100644 --- a/docs/transformation-documentation/Observation_observation_datetime.md +++ b/docs/transformation-documentation/Observation_observation_datetime.md @@ -41,12 +41,14 @@ Converts text to dates. * `StartTimeHospitalProviderSpell` Records whether anaesthetic was given during Labour/ Delivery, and the type used. [START TIME (HOSPITAL PROVIDER SPELL)](https://www.datadictionary.nhs.uk/data_elements/start_time__hospital_provider_spell_.html) ```sql -select NHSNumber, - GeneratedRecordIdentifier, - StartDateHospitalProviderSpell, - StartTimeHospitalProviderSpell, - ReferrerCode -- Referrer code is the code of the person making the referral request -FROM [OMOP_SUS].[omop_staging].[sus_APC] +select + NHSNumber, + GeneratedRecordIdentifier, + StartDateHospitalProviderSpell, + StartTimeHospitalProviderSpell, + ReferrerCode -- Referrer code is the code of the person making the referral request +FROM [omop_staging].[sus_APC] +where NHSNumber is not null ``` diff --git a/docs/transformation-documentation/Observation_value_as_string.md b/docs/transformation-documentation/Observation_value_as_string.md index c1488d3..997aa26 100644 --- a/docs/transformation-documentation/Observation_value_as_string.md +++ b/docs/transformation-documentation/Observation_value_as_string.md @@ -39,12 +39,14 @@ group by * `ReferrerCode` Referrer code is the code of the person making the referral request. [REFERRER CODE](https://www.datadictionary.nhs.uk/data_elements/referrer_code.html) ```sql -select NHSNumber, - GeneratedRecordIdentifier, - StartDateHospitalProviderSpell, - StartTimeHospitalProviderSpell, - ReferrerCode -- Referrer code is the code of the person making the referral request -FROM [OMOP_SUS].[omop_staging].[sus_APC] +select + NHSNumber, + GeneratedRecordIdentifier, + StartDateHospitalProviderSpell, + StartTimeHospitalProviderSpell, + ReferrerCode -- Referrer code is the code of the person making the referral request +FROM [omop_staging].[sus_APC] +where NHSNumber is not null ``` diff --git a/docs/transformation-documentation/Person_birth_datetime.md b/docs/transformation-documentation/Person_birth_datetime.md index 74d4c16..f1060e6 100644 --- a/docs/transformation-documentation/Person_birth_datetime.md +++ b/docs/transformation-documentation/Person_birth_datetime.md @@ -18,7 +18,7 @@ Converts text to dates. max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_day_of_birth.md b/docs/transformation-documentation/Person_day_of_birth.md index df130c7..27d82dd 100644 --- a/docs/transformation-documentation/Person_day_of_birth.md +++ b/docs/transformation-documentation/Person_day_of_birth.md @@ -18,7 +18,7 @@ Selects the day of the month or null if the date is null. max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_gender_concept_id.md b/docs/transformation-documentation/Person_gender_concept_id.md index 1f0d57a..cbfa803 100644 --- a/docs/transformation-documentation/Person_gender_concept_id.md +++ b/docs/transformation-documentation/Person_gender_concept_id.md @@ -15,8 +15,8 @@ Lookup gender concept. |------|-----|-----| |1|8507|Male| |2|8532|Female| -|9|8551|Indeterminate (unable to be classified as either male or female)| -|X|8551|Not known| +|9|0|Indeterminate (unable to be classified as either male or female)| +|X|0|Not known| Notes * [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html) @@ -30,7 +30,7 @@ Notes max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber @@ -47,8 +47,8 @@ Lookup gender concept. |------|-----|-----| |1|8507|Male| |2|8532|Female| -|9|8551|Indeterminate (unable to be classified as either male or female)| -|X|8551|Not known| +|9|0|Indeterminate (unable to be classified as either male or female)| +|X|0|Not known| Notes * [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html) @@ -79,8 +79,8 @@ Lookup gender concept. |------|-----|-----| |1|8507|Male| |2|8532|Female| -|9|8551|Indeterminate (unable to be classified as either male or female)| -|X|8551|Not known| +|9|0|Indeterminate (unable to be classified as either male or female)| +|X|0|Not known| Notes * [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html) @@ -140,8 +140,8 @@ Lookup gender concept. |------|-----|-----| |1|8507|Male| |2|8532|Female| -|9|8551|Indeterminate (unable to be classified as either male or female)| -|X|8551|Not known| +|9|0|Indeterminate (unable to be classified as either male or female)| +|X|0|Not known| Notes * [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html) diff --git a/docs/transformation-documentation/Person_gender_source_value.md b/docs/transformation-documentation/Person_gender_source_value.md index e7f5248..93b0571 100644 --- a/docs/transformation-documentation/Person_gender_source_value.md +++ b/docs/transformation-documentation/Person_gender_source_value.md @@ -17,7 +17,7 @@ has_toc: false max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_month_of_birth.md b/docs/transformation-documentation/Person_month_of_birth.md index 09cabf2..11a758a 100644 --- a/docs/transformation-documentation/Person_month_of_birth.md +++ b/docs/transformation-documentation/Person_month_of_birth.md @@ -18,7 +18,7 @@ Selects the month of the year or null if the date is null. max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_person_source_value.md b/docs/transformation-documentation/Person_person_source_value.md index 6fdec74..90fd806 100644 --- a/docs/transformation-documentation/Person_person_source_value.md +++ b/docs/transformation-documentation/Person_person_source_value.md @@ -17,7 +17,7 @@ has_toc: false max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_race_concept_id.md b/docs/transformation-documentation/Person_race_concept_id.md index b4c01d5..15aa96f 100644 --- a/docs/transformation-documentation/Person_race_concept_id.md +++ b/docs/transformation-documentation/Person_race_concept_id.md @@ -45,7 +45,7 @@ Notes max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_race_source_concept_id.md b/docs/transformation-documentation/Person_race_source_concept_id.md index c1c8e71..94b54b1 100644 --- a/docs/transformation-documentation/Person_race_source_concept_id.md +++ b/docs/transformation-documentation/Person_race_source_concept_id.md @@ -44,7 +44,7 @@ Notes max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_race_source_value.md b/docs/transformation-documentation/Person_race_source_value.md index 89142eb..cdc0c2f 100644 --- a/docs/transformation-documentation/Person_race_source_value.md +++ b/docs/transformation-documentation/Person_race_source_value.md @@ -17,7 +17,7 @@ has_toc: false max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/Person_year_of_birth.md b/docs/transformation-documentation/Person_year_of_birth.md index 7d4c8d4..b1c675c 100644 --- a/docs/transformation-documentation/Person_year_of_birth.md +++ b/docs/transformation-documentation/Person_year_of_birth.md @@ -18,7 +18,7 @@ Selects the year from a date or null of the date is null. max(DateofBirth) as DateOfBirth, max(EthnicCategory) as EthnicCategory, max(Sex) as PersonCurrentGenderCode - from [OMOP_SUS].[omop_staging].[sus_OP] + from [omop_staging].[sus_OP] where NHSNumber is not null group by NHSNumber diff --git a/docs/transformation-documentation/SactPerson.json b/docs/transformation-documentation/SactPerson.json index b7669f5..10a9ca5 100644 --- a/docs/transformation-documentation/SactPerson.json +++ b/docs/transformation-documentation/SactPerson.json @@ -36,7 +36,7 @@ } ], "query": "\nselect\n\tNHS_Number,\n\tmax (Patient_Postcode) as Patient_Postcode,\n\tmax (Date_Of_Birth) as Date_Of_Birth,\n\tmax (Person_Stated_Gender_Code) as Person_Stated_Gender_Code\nfrom omop_staging.sact_staging\ngroup by NHS_Number\n\t", - "lookup_table_markdown": "\r\n\r\n|Person_Stated_Gender_Code|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|8551|Indeterminate (unable to be classified as either male or female)|\r\n|X|8551|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" + "lookup_table_markdown": "\r\n\r\n|Person_Stated_Gender_Code|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|0|Indeterminate (unable to be classified as either male or female)|\r\n|X|0|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" }, { "name": "year_of_birth", diff --git a/docs/transformation-documentation/SusAPCPerson.json b/docs/transformation-documentation/SusAPCPerson.json index 49a070b..fbb8fc3 100644 --- a/docs/transformation-documentation/SusAPCPerson.json +++ b/docs/transformation-documentation/SusAPCPerson.json @@ -36,7 +36,7 @@ } ], "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicGroup) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom omop_staging.sus_APC\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", - "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|8551|Indeterminate (unable to be classified as either male or female)|\r\n|X|8551|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" + "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|0|Indeterminate (unable to be classified as either male or female)|\r\n|X|0|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" }, { "name": "year_of_birth", diff --git a/docs/transformation-documentation/SusAPCSourceOfReferralForOutpatients.json b/docs/transformation-documentation/SusAPCSourceOfReferralForOutpatients.json index 01dd2b8..cced99e 100644 --- a/docs/transformation-documentation/SusAPCSourceOfReferralForOutpatients.json +++ b/docs/transformation-documentation/SusAPCSourceOfReferralForOutpatients.json @@ -17,7 +17,7 @@ ] } ], - "query": "\nselect\tNHSNumber,\n\t\tGeneratedRecordIdentifier,\n\t\tStartDateHospitalProviderSpell,\n\t\tStartTimeHospitalProviderSpell,\n\t\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [OMOP_SUS].[omop_staging].[sus_APC]\n\t", + "query": "\nselect\t\n\tNHSNumber,\n\tGeneratedRecordIdentifier,\n\tStartDateHospitalProviderSpell,\n\tStartTimeHospitalProviderSpell,\n\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [omop_staging].[sus_APC]\nwhere NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -35,7 +35,7 @@ ] } ], - "query": "\nselect\tNHSNumber,\n\t\tGeneratedRecordIdentifier,\n\t\tStartDateHospitalProviderSpell,\n\t\tStartTimeHospitalProviderSpell,\n\t\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [OMOP_SUS].[omop_staging].[sus_APC]\n\t", + "query": "\nselect\t\n\tNHSNumber,\n\tGeneratedRecordIdentifier,\n\tStartDateHospitalProviderSpell,\n\tStartTimeHospitalProviderSpell,\n\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [omop_staging].[sus_APC]\nwhere NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -60,7 +60,7 @@ ] } ], - "query": "\nselect\tNHSNumber,\n\t\tGeneratedRecordIdentifier,\n\t\tStartDateHospitalProviderSpell,\n\t\tStartTimeHospitalProviderSpell,\n\t\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [OMOP_SUS].[omop_staging].[sus_APC]\n\t", + "query": "\nselect\t\n\tNHSNumber,\n\tGeneratedRecordIdentifier,\n\tStartDateHospitalProviderSpell,\n\tStartTimeHospitalProviderSpell,\n\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [omop_staging].[sus_APC]\nwhere NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -78,7 +78,7 @@ ] } ], - "query": "\nselect\tNHSNumber,\n\t\tGeneratedRecordIdentifier,\n\t\tStartDateHospitalProviderSpell,\n\t\tStartTimeHospitalProviderSpell,\n\t\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [OMOP_SUS].[omop_staging].[sus_APC]\n\t", + "query": "\nselect\t\n\tNHSNumber,\n\tGeneratedRecordIdentifier,\n\tStartDateHospitalProviderSpell,\n\tStartTimeHospitalProviderSpell,\n\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [omop_staging].[sus_APC]\nwhere NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -103,7 +103,7 @@ ] } ], - "query": "\nselect\tNHSNumber,\n\t\tGeneratedRecordIdentifier,\n\t\tStartDateHospitalProviderSpell,\n\t\tStartTimeHospitalProviderSpell,\n\t\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [OMOP_SUS].[omop_staging].[sus_APC]\n\t", + "query": "\nselect\t\n\tNHSNumber,\n\tGeneratedRecordIdentifier,\n\tStartDateHospitalProviderSpell,\n\tStartTimeHospitalProviderSpell,\n\tReferrerCode -- Referrer code is the code of the person making the referral request\nFROM [omop_staging].[sus_APC]\nwhere NHSNumber is not null\n\t", "lookup_table_markdown": null } ] diff --git a/docs/transformation-documentation/SusOPConditionOccurrence.json b/docs/transformation-documentation/SusOPConditionOccurrence.json index 4346aa3..fd6f8fe 100644 --- a/docs/transformation-documentation/SusOPConditionOccurrence.json +++ b/docs/transformation-documentation/SusOPConditionOccurrence.json @@ -17,7 +17,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [OMOP_SUS].[omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -35,7 +35,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [OMOP_SUS].[omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -60,7 +60,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [OMOP_SUS].[omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", "lookup_table_markdown": null }, { @@ -78,7 +78,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [OMOP_SUS].[omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\td.DiagnosisICD,\n\t\t\top.GeneratedRecordIdentifier,\n\t\t\top.NHSNumber,\n\t\t\top.CDSActivityDate\n\tfrom omop_staging.sus_OP_ICDDiagnosis d\n\t\tinner join [omop_staging].[sus_OP] op\n\t\t\ton d.MessageId = op.MessageId\n\twhere op.NHSNumber is not null\n\t", "lookup_table_markdown": null }, { diff --git a/docs/transformation-documentation/SusOPDeath.json b/docs/transformation-documentation/SusOPDeath.json index 4300e6c..4246bc0 100644 --- a/docs/transformation-documentation/SusOPDeath.json +++ b/docs/transformation-documentation/SusOPDeath.json @@ -17,7 +17,7 @@ ] } ], - "query": "\n\tselect\n\t NHSNumber as nhs_number,\n\t max(ReferralToTreatmentPeriodEndDate) as death_date\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere ReferralToTreatmentPeriodStatus = 36\n\t and ReferralToTreatmentPeriodEndDate is not null\n\t and NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t NHSNumber as nhs_number,\n\t max(ReferralToTreatmentPeriodEndDate) as death_date\n\tfrom [omop_staging].[sus_OP]\n\twhere ReferralToTreatmentPeriodStatus = 36\n\t and ReferralToTreatmentPeriodEndDate is not null\n\t and NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -35,7 +35,7 @@ ] } ], - "query": "\n\tselect\n\t NHSNumber as nhs_number,\n\t max(ReferralToTreatmentPeriodEndDate) as death_date\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere ReferralToTreatmentPeriodStatus = 36\n\t and ReferralToTreatmentPeriodEndDate is not null\n\t and NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t NHSNumber as nhs_number,\n\t max(ReferralToTreatmentPeriodEndDate) as death_date\n\tfrom [omop_staging].[sus_OP]\n\twhere ReferralToTreatmentPeriodStatus = 36\n\t and ReferralToTreatmentPeriodEndDate is not null\n\t and NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null } ] diff --git a/docs/transformation-documentation/SusOPLocation.json b/docs/transformation-documentation/SusOPLocation.json index 89acd3c..6fa0cb7 100644 --- a/docs/transformation-documentation/SusOPLocation.json +++ b/docs/transformation-documentation/SusOPLocation.json @@ -17,7 +17,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", "lookup_table_markdown": null }, { @@ -35,7 +35,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", "lookup_table_markdown": null }, { @@ -53,7 +53,7 @@ ] } ], - "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", + "query": "\n\tselect\n\t\tdistinct\n\t\t\tPostcode,\n\t\t\tCountry,\n\t\t\tNHSNumber\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tand Postcode is not null\n\t", "lookup_table_markdown": null } ] diff --git a/docs/transformation-documentation/SusOPPerson.json b/docs/transformation-documentation/SusOPPerson.json index d2438de..5fb8ac6 100644 --- a/docs/transformation-documentation/SusOPPerson.json +++ b/docs/transformation-documentation/SusOPPerson.json @@ -17,7 +17,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -35,8 +35,8 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", - "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|8551|Indeterminate (unable to be classified as either male or female)|\r\n|X|8551|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "lookup_table_markdown": "\r\n\r\n|PersonCurrentGenderCode|gender_concept_id|notes|\r\n|------|-----|-----|\r\n|1|8507|Male|\r\n|2|8532|Female|\r\n|9|0|Indeterminate (unable to be classified as either male or female)|\r\n|X|0|Not known|\r\n\r\nNotes\r\n* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)\r\n* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)\r\n" }, { "name": "year_of_birth", @@ -53,7 +53,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -71,7 +71,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -89,7 +89,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -107,7 +107,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -125,7 +125,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": "\r\n\r\n|EthnicCategory|race_concept_id|notes|\r\n|------|-----|-----|\r\n|A|8527|White - British|\r\n|B|8527|White - Irish|\r\n|C|8527|White - Any other White background|\r\n|D|8527|Mixed - White and Black Caribbean [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700388)|\r\n|E|8527|Mixed - White and Black African [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700389)|\r\n|F|8527|Mixed - White and Asian [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700390)|\r\n|G|8527|Mixed - Any other mixed background [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700391)|\r\n|H|38003574|Asian or Asian British - Indian|\r\n|J|38003589|Asian or Asian British - Pakistani|\r\n|K|38003575|Asian or Asian British - Bangladeshi|\r\n|L|8515|Asian or Asian British - Any other Asian background|\r\n|M|38003598|Black or Black British - Caribbean|\r\n|N|38003600|Black or Black British - African|\r\n|P|38003598|Black or Black British - Any other Black background|\r\n|R|38003579|Other Ethnic Groups - Chinese|\r\n|S|0|Other Ethnic Groups - Any other ethnic group|\r\n|Z|0|Not stated|\r\n|99|0|Not known|\r\n\r\nNotes\r\n* [NHS Race (i.e.Ethnicity)](https://www.datadictionary.nhs.uk/data_elements/ethnic_category.html)\r\n* [OMOP Race](https://athena.ohdsi.org/search-terms/terms?conceptClass=Race&invalidReason=Valid&vocabulary=Race&page=1&pageSize=50&query=)\r\n* [D, E, F, G Race mapping](https://forums.ohdsi.org/t/mapping-nhs-ethnic-category-to-omop-race/20883/2)\r\n" }, { @@ -143,7 +143,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -161,7 +161,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": null }, { @@ -179,7 +179,7 @@ ] } ], - "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [OMOP_SUS].[omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", + "query": "\n\tselect\n\t\tNHSNumber,\n\t\tmax(DateofBirth) as DateOfBirth,\n\t\tmax(EthnicCategory) as EthnicCategory,\n\t\tmax(Sex) as PersonCurrentGenderCode\n\tfrom [omop_staging].[sus_OP]\n\twhere NHSNumber is not null\n\tgroup by NHSNumber\n\t", "lookup_table_markdown": "\r\n\r\n|EthnicCategory|race_source_concept_id|notes|\r\n|------|-----|-----|\r\n|A|700385|White - British|\r\n|B|700386|White - Irish|\r\n|C|700387|White - Any other White background|\r\n|D|700388|Mixed - White and Black Caribbean|\r\n|E|700389|Mixed - White and Black African|\r\n|F|700390|Mixed - White and Asian|\r\n|G|700391|Mixed - Any other mixed background|\r\n|H|700362|Asian or Asian British - Indian|\r\n|J|700363|Asian or Asian British - Pakistani|\r\n|K|700364|Asian or Asian British - Bangladeshi|\r\n|L|700365|Asian or Asian British - Any other Asian background|\r\n|M|700366|Black or Black British - Caribbean|\r\n|N|700367|Black or Black British - African|\r\n|P|700368|Black or Black British - Any other Black background|\r\n|R|700369|Other Ethnic Groups - Chinese|\r\n|S||Other Ethnic Groups - Any other ethnic group|\r\n|Z||Not stated|\r\n|99||Not known|\r\n\r\nNotes\r\n* [NHS Race (i.e.Ethnicity)](https://www.datadictionary.nhs.uk/data_elements/ethnic_category.html)\r\n* [OMOP Race](https://athena.ohdsi.org/search-terms/terms?conceptClass=Race&invalidReason=Valid&vocabulary=Race&page=1&pageSize=50&query=)\r\n" }, {