From 8fab3687227cf4bcc60126f6719c724aab06e36d Mon Sep 17 00:00:00 2001 From: Sally Grindstaff Date: Mon, 20 Nov 2023 15:49:53 -0800 Subject: [PATCH 1/2] Clinical ETL: assign encounter_status as finished for records missing encounter_status field --- lib/seattleflu/id3c/cli/command/etl/clinical_retrospectives.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/seattleflu/id3c/cli/command/etl/clinical_retrospectives.py b/lib/seattleflu/id3c/cli/command/etl/clinical_retrospectives.py index ad25b00b..158223f8 100644 --- a/lib/seattleflu/id3c/cli/command/etl/clinical_retrospectives.py +++ b/lib/seattleflu/id3c/cli/command/etl/clinical_retrospectives.py @@ -138,7 +138,7 @@ def create_encounter_status(record: dict) -> str: This attribute is required by FHIR for an Encounter resource. (https://www.hl7.org/fhir/encounter-definitions.html#Encounter.status) """ - status = record['encounter_status'] + status = record.get('encounter_status', None) if not status: return 'finished' From 7c7fc9528097f2982b14e4745f8d80a1d13e1522 Mon Sep 17 00:00:00 2001 From: Sally Grindstaff Date: Mon, 20 Nov 2023 16:11:27 -0800 Subject: [PATCH 2/2] Clinical ETL: create KP2023 immunization hash --- lib/seattleflu/id3c/cli/command/etl/clinical.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/seattleflu/id3c/cli/command/etl/clinical.py b/lib/seattleflu/id3c/cli/command/etl/clinical.py index 14eacc15..0b6c0de1 100644 --- a/lib/seattleflu/id3c/cli/command/etl/clinical.py +++ b/lib/seattleflu/id3c/cli/command/etl/clinical.py @@ -464,7 +464,8 @@ def create_immunization_kp2023(record: dict, patient_reference: dict) -> list: vaccine_code = cvx_codes[213] # covid vaccines are not specified in this study, so assign code for unspecified covid-19 vaccine if vaccine_code: - immunization_identifier_hash = generate_hash(f"{record['mrn']}{vaccine_code['code']}{immunization_date}".lower()) + # create hash from collection_id, which is hashed individual id, plus vaccine code and date administered + immunization_identifier_hash = generate_hash(f"{record['collection_id']}{vaccine_code['code']}{immunization_date}".lower()) immunization_identifier = create_identifier(f"{SFS}/immunization", immunization_identifier_hash) immunization_resource = create_immunization_resource(