Skip to content

Commit

Permalink
Regenerate documentation. Split gender lookups between code systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-cockayne-ad committed Feb 12, 2024
1 parent 587c5fb commit cd58dc7
Show file tree
Hide file tree
Showing 20 changed files with 143 additions and 146 deletions.
18 changes: 0 additions & 18 deletions Documentation/CdsLocation.json

This file was deleted.

33 changes: 0 additions & 33 deletions Documentation/CdsLocation.svg

This file was deleted.

20 changes: 20 additions & 0 deletions Documentation/Location_location_source_value.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
* Value copied from `Patient_Postcode`

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Location%20table%20location_source_value%20field%20SACT%20mapping)
### Rtds PAS Location
* Value copied from `FirstOfNHSNUMBER`
* `FirstOfNHSNUMBER` The patient's NHSNumber.
<details>
<summary>SQL</summary>

```sql
select
distinct
p.FirstOfNHSNUMBER,
p.FirstOfPOSTCODE
from omop_staging.RTDS_PASDATA p
where p.FirstOfPOSTCODE is not null
and p.FirstOfNHSNUMBER is not null;

```
</details>


[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Location%20table%20location_source_value%20field%20Rtds%20PAS%20Location%20mapping)
### COSD Demographics
Source columns `StreetAddressLine1`, `StreetAddressLine2`, `StreetAddressLine3`, `StreetAddressLine4`, `Postcode`.
Separates text with newlines. Trim whitespace.
Expand Down
8 changes: 4 additions & 4 deletions Documentation/Location_nhs_number.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Location%20table%20nhs_number%20field%20SACT%20mapping)
### Rtds PAS Location
* Value copied from `NhsNumber`
* `NhsNumber` The patient's NHSNumber.
* Value copied from `FirstOfNHSNUMBER`
* `FirstOfNHSNUMBER` The patient's NHSNumber.
<details>
<summary>SQL</summary>

```sql
select
distinct
p.FirstOfNHSNUMBER as NhsNumber,
p.FirstOfPOSTCODE as Postcode
p.FirstOfNHSNUMBER,
p.FirstOfPOSTCODE
from omop_staging.RTDS_PASDATA p
where p.FirstOfPOSTCODE is not null
and p.FirstOfNHSNUMBER is not null;
Expand Down
8 changes: 4 additions & 4 deletions Documentation/Location_zip.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Uppercase the postcode then insert the space in the correct location, if needed.

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Location%20table%20zip%20field%20SACT%20mapping)
### Rtds PAS Location
Source column `Postcode`.
Source column `FirstOfPOSTCODE`.
Uppercase the postcode then insert the space in the correct location, if needed.
* `Postcode` The patient's Postcode.
* `FirstOfPOSTCODE` The patient's Postcode.
<details>
<summary>SQL</summary>

```sql
select
distinct
p.FirstOfNHSNUMBER as NhsNumber,
p.FirstOfPOSTCODE as Postcode
p.FirstOfNHSNUMBER,
p.FirstOfPOSTCODE
from omop_staging.RTDS_PASDATA p
where p.FirstOfPOSTCODE is not null
and p.FirstOfNHSNUMBER is not null;
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Person_ethnicity_concept_id.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# `Person` `ethnicity_concept_id`
### SACT
Note: This is specific to US-based data mappings and is in regards to being “Hispanic “ and “Not Hispanic”. All our data is UK-based.
* Constant value set to `0`. Unknown concept

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Person%20table%20ethnicity_concept_id%20field%20SACT%20mapping)
### Rtds Demographics
Note: This is specific to US-based data mappings and is in regards to being “Hispanic “ and “Not Hispanic”. All our data is UK-based.
* Constant value set to `0`. Unknown concept

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Person%20table%20ethnicity_concept_id%20field%20Rtds%20Demographics%20mapping)
### COSD Demographics
Note: This is specific to US-based data mappings and is in regards to being “Hispanic “ and “Not Hispanic”. All our data is UK-based.
* Constant value set to `0`. Unknown concept

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Person%20table%20ethnicity_concept_id%20field%20COSD%20Demographics%20mapping)
### CDS Person
Note: This is specific to US-based data mappings and is in regards to being “Hispanic “ and “Not Hispanic”. All our data is UK-based.
* Constant value set to `0`. Unknown concept

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20Person%20table%20ethnicity_concept_id%20field%20CDS%20Person%20mapping)
21 changes: 6 additions & 15 deletions Documentation/Person_gender_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ Source column `Sex`.
Lookup gender concept.


|before|after|notes|
|Sex|gender_concept_id|notes|
|------|-----|-----|
|Male|8507||
|1|8507||
|Female|8532||
|2|8532||
|9|8551||
|X|8551||
|Unknown|8551||
|Not Stated|8551||

Notes
* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)
* [OMOP Gender](https://athena.ohdsi.org/search-terms/terms?conceptClass=Gender&invalidReason=Valid&vocabulary=Gender&page=1&pageSize=50&query=)
* `Sex` The patient's Sex.
<details>
Expand All @@ -42,16 +37,12 @@ Source column `PersonCurrentGenderCode`.
Lookup gender concept.


|before|after|notes|
|PersonCurrentGenderCode|gender_concept_id|notes|
|------|-----|-----|
|Male|8507||
|1|8507||
|Female|8532||
|2|8532||
|9|8551||
|X|8551||
|Unknown|8551||
|Not Stated|8551||
|1|8507|Male|
|2|8532|Female|
|9|8551|Indeterminate (unable to be classified as either male or female)|
|X|8551|Not known|

Notes
* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)
Expand Down
14 changes: 5 additions & 9 deletions Documentation/Person_gender_source_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ Source column `Person_Stated_Gender_Code`.
Lookup gender concept.


|before|after|notes|
|Person_Stated_Gender_Code|gender_source_concept_id|notes|
|------|-----|-----|
|Male|8507||
|1|8507||
|Female|8532||
|2|8532||
|9|8551||
|X|8551||
|Unknown|8551||
|Not Stated|8551||
|1|8507|Male|
|2|8532|Female|
|9|8551|Indeterminate (unable to be classified as either male or female)|
|X|8551|Not known|

Notes
* [NHS Gender](https://www.datadictionary.nhs.uk/data_elements/person_stated_gender_code.html)
Expand Down
20 changes: 10 additions & 10 deletions Documentation/Person_race_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Source column `EthnicCategory`.
Lookup race concept.


|before|after|notes|
|EthnicCategory|race_concept_id|notes|
|------|-----|-----|
|A|8527|White - British|
|B|8527|White - Irish|
|C|8527|White - Any other White background|
|D|700388|Mixed - White and Black Caribbean [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700388)|
|E|700389|Mixed - White and Black African [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700389)|
|F|700390|Mixed - White and Asian [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700390)|
|G|700391|Mixed - Any other mixed background [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700391)|
|D|8527|Mixed - White and Black Caribbean [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700388)|
|E|8527|Mixed - White and Black African [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700389)|
|F|8527|Mixed - White and Asian [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700390)|
|G|8527|Mixed - Any other mixed background [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700391)|
|H|38003574|Asian or Asian British - Indian|
|J|38003589|Asian or Asian British - Pakistani|
|K|38003575|Asian or Asian British - Bangladeshi|
Expand Down Expand Up @@ -106,15 +106,15 @@ Source column `EthnicCategory`.
Lookup race concept.


|before|after|notes|
|EthnicCategory|race_concept_id|notes|
|------|-----|-----|
|A|8527|White - British|
|B|8527|White - Irish|
|C|8527|White - Any other White background|
|D|700388|Mixed - White and Black Caribbean [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700388)|
|E|700389|Mixed - White and Black African [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700389)|
|F|700390|Mixed - White and Asian [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700390)|
|G|700391|Mixed - Any other mixed background [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700391)|
|D|8527|Mixed - White and Black Caribbean [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700388)|
|E|8527|Mixed - White and Black African [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700389)|
|F|8527|Mixed - White and Asian [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700390)|
|G|8527|Mixed - Any other mixed background [Athena mapping](https://athena.ohdsi.org/search-terms/terms/700391)|
|H|38003574|Asian or Asian British - Indian|
|J|38003589|Asian or Asian British - Pakistani|
|K|38003575|Asian or Asian British - Bangladeshi|
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Person_race_source_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Source column `EthnicCategory`.
Lookup race source concept.


|before|after|notes|
|EthnicCategory|race_source_concept_id|notes|
|------|-----|-----|
|A|700385|White - British|
|B|700386|White - Irish|
Expand Down Expand Up @@ -105,7 +105,7 @@ Source column `EthnicCategory`.
Lookup race source concept.


|before|after|notes|
|EthnicCategory|race_source_concept_id|notes|
|------|-----|-----|
|A|700385|White - British|
|B|700386|White - Irish|
Expand Down
10 changes: 8 additions & 2 deletions Documentation/RtdsLocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
{
"name": "zip",
"sourceColumns": [
"Postcode"
"FirstOfPOSTCODE"
]
},
{
"name": "nhs_number",
"sourceColumns": [
"NhsNumber"
"FirstOfNHSNUMBER"
]
},
{
"name": "location_source_value",
"sourceColumns": [
"FirstOfNHSNUMBER"
]
}
]
Expand Down
20 changes: 17 additions & 3 deletions Documentation/RtdsLocation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Documentation/VisitOccurrence_visit_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Value copied from `VisitOccurenceConceptId`
* `VisitOccurenceConceptId`

| Visit Occurrence Type (Info only) | Location Class Condition | Patient Classification Condition | Admission Method Code Condition |
| Visit Occurrence Type | Location Class Condition | Patient Classification Condition | Admission Method Code Condition |
|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|---------------------------------|
| Emergency Room and Inpatient Visit | Is either 21 (Emergency Admission : Emergency Care Department or dental casualty department of the Health Care Provider) or 24 (Consultant Clinic of this or another Health Care Provider) | Is 1 (Ordinary admission) | Is not 02 (Home Visit) |
| Emergency Room Visit | Is either 21 (Emergency Admission : Emergency Care Department or dental casualty department of the Health Care Provider) or 24 (Consultant Clinic of this or another Health Care Provider) | Is not 1 (Ordinary admission) | Is not 02 (Home Visit) |
Expand Down Expand Up @@ -66,6 +66,6 @@ group by

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20VisitOccurrence%20table%20visit_concept_id%20field%20CDS%20VisitOccurrenceWithSpell%20mapping)
### CDS VisitOccurrenceWithoutSpell
* Constant value set to `9202`. `Inpatient Visit`
* Constant value set to `9202`. `Outpatient Visit`

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20VisitOccurrence%20table%20visit_concept_id%20field%20CDS%20VisitOccurrenceWithoutSpell%20mapping)
2 changes: 1 addition & 1 deletion Documentation/VisitOccurrence_visit_type_concept_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ group by

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20VisitOccurrence%20table%20visit_type_concept_id%20field%20CDS%20VisitOccurrenceWithSpell%20mapping)
### CDS VisitOccurrenceWithoutSpell
* Constant value set to `32220`. `Still Patient`
* Constant value set to `32818`. `EHR Administration Record`

[Comment or raise an issue for this mapping.](https://github.com/answerdigital/oxford-omop-data-mapper/issues/new?title=OMOP%20VisitOccurrence%20table%20visit_type_concept_id%20field%20CDS%20VisitOccurrenceWithoutSpell%20mapping)
Loading

0 comments on commit cd58dc7

Please sign in to comment.