Skip to content

Commit

Permalink
fixed a bug where the unit column is missing when include_visit_type …
Browse files Browse the repository at this point in the history
…is set to True for generating prediction cohorts
  • Loading branch information
ChaoPang committed Oct 2, 2024
1 parent ea0f727 commit 199f295
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cehrbert_data/utils/spark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,17 @@ def extract_ehr_records(
)
if include_visit_type:
visit_occurrence = preprocess_domain_table(spark, input_folder, VISIT_OCCURRENCE)
patient_ehr_records = patient_ehr_records.join(visit_occurrence, "visit_occurrence_id").select(
patient_ehr_records = patient_ehr_records.join(
visit_occurrence,
"visit_occurrence_id"
).select(
patient_ehr_records["person_id"],
patient_ehr_records["standard_concept_id"],
patient_ehr_records["date"],
patient_ehr_records["datetime"],
patient_ehr_records["visit_occurrence_id"],
patient_ehr_records["domain"],
patient_ehr_records["unit"],
visit_occurrence["visit_concept_id"],
patient_ehr_records["age"],
)
Expand Down

0 comments on commit 199f295

Please sign in to comment.