Skip to content

Commit

Permalink
Issue 22 - Update to FHIR Ethnicity System (#23)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Cragun <[email protected]>

Signed-off-by: Brian Cragun <[email protected]>
Co-authored-by: Brian Cragun <[email protected]>
  • Loading branch information
cragun47 and Brian Cragun authored Aug 22, 2022
1 parent 604d734 commit 2dc1e5e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/datacontract.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The top-level key within a FileDefinition serves as the FileDefinition name. Thi
"comment": "adds a default ethnic system code to the source data",
"params": {
"name": "ethnicitySystem",
"value": "http://terminology.hl7.org/CodeSystem/v2-0189"
"value": "http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/implementation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ the parameters/arguments `name` and `value`:
"name": "add_constant",
"params": {
"name": "ethnicitySystem",
"value": "http://terminology.hl7.org/CodeSystem/v2-0189"
"value": "http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
}
},
{ etc }
Expand Down
7 changes: 4 additions & 3 deletions src/linuxforhealth/csvtofhir/fhirutils/fhir_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SystemConstants:
# FYI: Discharge Disposition HL7 standard uses numeric values "http://terminology.hl7.org/CodeSystem/v2-0112"
DISCHARGE_DISPOSITION_SYSTEM = "http://terminology.hl7.org/CodeSystem/discharge-disposition"
ENCOUNTER_CLASS_CODING_SYSTEM = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
ETHNICITY_SYSTEM = "http://terminology.hl7.org/CodeSystem/v2-0189"
ETHNICITY_SYSTEM = "http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
INCIDENT_CODE_SYSTEM = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
LOCATION_TYPE_SYSTEM = "http://terminology.hl7.org/CodeSystem/v3-RoleCode"
MED_ADM_CATEGORY_SYSTEM = "http://terminology.hl7.org/CodeSystem/medication-admin-category"
Expand Down Expand Up @@ -299,8 +299,9 @@ class PatientResource:
"2129-5": "Arab",
"2131-1": "Other Race"
}
ethnicity_display = {
"H": "Hispanic or Latino"
ethnicity_display = { #http://terminology.hl7.org/CodeSystem/v3-Ethnicity
"2135-2": "Hispanic or Latino",
"2186-5": "Not Hispanic or Latino"
}


Expand Down
12 changes: 6 additions & 6 deletions tests/fhirrs/test_patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def format_test_patient_record() -> Dict:
"race": "UNK",
"raceSystem": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor",
"raceText": "998",
"ethnicity": "H",
"ethnicitySystem": "urn:oid:2.16.840.1.113883.6.238",
"ethnicityText": "613",
"ethnicity": "2135-2",
"ethnicitySystem": "http://terminology.hl7.org/CodeSystem/v3-Ethnicity",
"ethnicityText": "Hispanic",
"resourceType": "Patient",
"deceasedBoolean": "False",
"ageInWeeksForAgeUnder2Years": "69",
Expand Down Expand Up @@ -171,12 +171,12 @@ def format_test_patient_expected():
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.6.238",
"system": "http://terminology.hl7.org/CodeSystem/v3-Ethnicity",
"display": "Hispanic or Latino",
"code": "H"
"code": "2135-2"
}
],
"text": "613"
"text": "Hispanic"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_patient_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def test_patient_system_defaults():
}
patient: PatientCsv = PatientCsv.parse_obj(pat_dictionary)
patient.raceSystem = "http://terminology.hl7.org/CodeSystem/v3-Race"
patient.ethnicitySystem = "http://terminology.hl7.org/CodeSystem/v2-0189"
patient.ethnicitySystem = "http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
4 changes: 2 additions & 2 deletions tests/pipeline/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_add_constant(input_data_frame: DataFrame, expected_data_frame: DataFram
:param expected_data_frame: The expected data frame, used for comparisons
"""
expected_data_frame["ethnicitySystem"] = [
"http://terminology.hl7.org/CodeSystem/v2-0189"
"http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
]
expected_data_frame["raceSystem"] = [
"http://terminology.hl7.org/CodeSystem/v3-Race"
Expand All @@ -48,7 +48,7 @@ def test_add_constant(input_data_frame: DataFrame, expected_data_frame: DataFram
result: DataFrame = add_constant(
input_data_frame,
"ethnicitySystem",
"http://terminology.hl7.org/CodeSystem/v2-0189"
"http://terminology.hl7.org/CodeSystem/v3-Ethnicity"
)
result: DataFrame = add_constant(
result, "raceSystem", "http://terminology.hl7.org/CodeSystem/v3-Race"
Expand Down

0 comments on commit 2dc1e5e

Please sign in to comment.