From ff603d1ac6f0892aa0c2ed70d458da88423d3c0c Mon Sep 17 00:00:00 2001 From: Sally Grindstaff Date: Tue, 21 Nov 2023 16:29:23 -0800 Subject: [PATCH] Clinical ETL: Fix codeable concepts for KP2023 functions --- lib/seattleflu/id3c/cli/command/etl/clinical.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/seattleflu/id3c/cli/command/etl/clinical.py b/lib/seattleflu/id3c/cli/command/etl/clinical.py index 0b6c0de1..f4d08016 100644 --- a/lib/seattleflu/id3c/cli/command/etl/clinical.py +++ b/lib/seattleflu/id3c/cli/command/etl/clinical.py @@ -492,10 +492,11 @@ def create_symptom_conditions(record: dict, patient_reference: dict, encounter_r for symptom in record['symptom']: mapped_symptom_name = map_symptom(symptom) onset_date = record['date_symptom_onset'] - symptom_code = { - "system": f"{SFS}/symptom", - "code": mapped_symptom_name - } + symptom_code = create_codeable_concept( + system = f"{SFS}/symptom", + code = mapped_symptom_name + ) + condition_resource = create_condition_resource(mapped_symptom_name, patient_reference, @@ -1047,7 +1048,10 @@ def create_icd10_conditions_kp2023(record:dict, patient_reference: dict) -> list condition_resource = create_condition_resource(icd10_code, patient_reference, None, - icd10_codes[icd10_code] + create_codeable_concept( + system = icd10_codes[icd10_code]["system"], + code = icd10_codes[icd10_code]["code"], + display = icd10_codes[icd10_code]["display"]) ) condition_entries.append(create_resource_entry(