Skip to content

Commit

Permalink
Merge pull request #374 from seattleflu/kp2023-etl
Browse files Browse the repository at this point in the history
Clinical ETL: assign encounter_status as finished for records missing encounter_status field, and use hashed individual ID to create immunization hash.
  • Loading branch information
sallybg authored Nov 21, 2023
2 parents d9e1b5e + 7c7fc95 commit d8dd52b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/seattleflu/id3c/cli/command/etl/clinical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit d8dd52b

Please sign in to comment.