Skip to content

Commit

Permalink
Replaced the "categorical_measurement" filter with the constant
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoPang committed Oct 2, 2024
1 parent 8ff9e41 commit a675cca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cehrbert_data/decorators/clinical_event_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _decorate(self, patient_events: DataFrame):

# Split the categorical measurement standard_concept_id into the question/answer pairs
categorical_measurement_events = (
patient_events.where("domain = 'categorical_measurement'")
patient_events.where(F.col("domain") == CATEGORICAL_MEASUREMENT)
.withColumn("measurement_components", F.split("standard_concept_id", "-"))
)

Expand All @@ -156,7 +156,7 @@ def _decorate(self, patient_events: DataFrame):
F.concat(F.lit(MEASUREMENT_ANSWER_PREFIX), F.col("measurement_components").getItem(1))
).drop("measurement_components")

other_events = patient_events.where("domain != 'categorical_measurement'")
other_events = patient_events.where(F.col("domain") != CATEGORICAL_MEASUREMENT)

# (cohort_member_id, person_id, standard_concept_id, date, datetime, visit_occurrence_id, domain,
# concept_value, visit_rank_order, visit_segment, priority, date_in_week,
Expand Down

0 comments on commit a675cca

Please sign in to comment.