Skip to content

Commit

Permalink
NiFi scripts: cohort extra backup for dod fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Jul 15, 2024
1 parent f4db686 commit eb44d6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nifi/user-scripts/cogstack_cohort_generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
PATIENT_GENDER_FIELD_NAME = "gender"
PATIENT_BIRTH_DATE_FIELD_NAME = "birthdate"
PATIENT_DEATH_DATE_FIELD_NAME = "deathdate"
PATIENT_DEATH_DATE_BACKUP_FIELD_NAME = ""

OUTPUT_FOLDER_PATH = os.path.join(os.getenv("NIFI_DATA_PATH", "/opt/data/"), "cogstack-cohort")

Expand Down Expand Up @@ -62,6 +63,8 @@
PATIENT_BIRTH_DATE_FIELD_NAME = _arg[1]
if _arg[0] == "patient_death_date_field_name":
PATIENT_DEATH_DATE_FIELD_NAME = _arg[1]
if _arg[0] == "patient_death_date_backup_field_name":
PATIENT_DEATH_DATE_BACKUP_FIELD_NAME = _arg[1]
if _arg[0] == "patient_gender_field_name":
PATIENT_GENDER_FIELD_NAME = _arg[1]
if _arg[0] == "document_id_field_name":
Expand Down Expand Up @@ -106,7 +109,8 @@ def _process_patient_records(patient_records: list):
_ptt2sex[_PATIENT_ID] = _tmp_gender

dob = patient_record[PATIENT_BIRTH_DATE_FIELD_NAME] if PATIENT_BIRTH_DATE_FIELD_NAME in patient_record.keys() else 0
dod = patient_record[PATIENT_DEATH_DATE_FIELD_NAME] if PATIENT_DEATH_DATE_FIELD_NAME in patient_record.keys() else 0
dod = patient_record[PATIENT_DEATH_DATE_FIELD_NAME] if PATIENT_DEATH_DATE_FIELD_NAME in patient_record.keys() else \
patient_record[PATIENT_DEATH_DATE_BACKUP_FIELD_NAME] if PATIENT_DEATH_DATE_BACKUP_FIELD_NAME in patient_record.keys() else 0

try:
dob = int(dob)
Expand Down

0 comments on commit eb44d6a

Please sign in to comment.