diff --git a/docs/source/configuration.md b/docs/source/configuration.md index 38fcc99..ca83871 100644 --- a/docs/source/configuration.md +++ b/docs/source/configuration.md @@ -71,7 +71,7 @@ on its source format. 1. If the source data is in [MEDS](https://github.com/Medical-Event-Data-Standard/meds) format (recommended), then the `code` will be checked directly against MEDS' `code` field and the `value_min` - and `value_max` constraints will be compared against MEDS' `numerical_value` field. + and `value_max` constraints will be compared against MEDS' `numeric_value` field. **Note**: This syntax does not currently support defining predicates that also rely on matching other, optional fields in the MEDS syntax; if this is a desired feature for you, please let us know by filing a diff --git a/src/aces/config.py b/src/aces/config.py index 45d76d8..b2a3183 100644 --- a/src/aces/config.py +++ b/src/aces/config.py @@ -45,17 +45,17 @@ def MEDS_eval_expr(self) -> pl.Expr: Examples: >>> expr = PlainPredicateConfig("BP//systolic", 120, 140, True, False).MEDS_eval_expr() >>> print(expr) # doctest: +NORMALIZE_WHITESPACE - [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numerical_value")) >= - (dyn int: 120)], [(col("numerical_value")) < (dyn int: 140)]]) + [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numeric_value")) >= + (dyn int: 120)], [(col("numeric_value")) < (dyn int: 140)]]) >>> cfg = PlainPredicateConfig("BP//systolic", value_min=120, value_min_inclusive=False) >>> expr = cfg.MEDS_eval_expr() >>> print(expr) # doctest: +NORMALIZE_WHITESPACE - [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numerical_value")) > + [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numeric_value")) > (dyn int: 120)]]) >>> cfg = PlainPredicateConfig("BP//systolic", value_max=140, value_max_inclusive=True) >>> expr = cfg.MEDS_eval_expr() >>> print(expr) # doctest: +NORMALIZE_WHITESPACE - [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numerical_value")) <= + [(col("code")) == (String(BP//systolic))].all_horizontal([[(col("numeric_value")) <= (dyn int: 140)]]) >>> cfg = PlainPredicateConfig("BP//diastolic") >>> expr = cfg.MEDS_eval_expr() @@ -136,14 +136,14 @@ def MEDS_eval_expr(self) -> pl.Expr: if self.value_min is not None: if self.value_min_inclusive: - criteria.append(pl.col("numerical_value") >= self.value_min) + criteria.append(pl.col("numeric_value") >= self.value_min) else: - criteria.append(pl.col("numerical_value") > self.value_min) + criteria.append(pl.col("numeric_value") > self.value_min) if self.value_max is not None: if self.value_max_inclusive: - criteria.append(pl.col("numerical_value") <= self.value_max) + criteria.append(pl.col("numeric_value") <= self.value_max) else: - criteria.append(pl.col("numerical_value") < self.value_max) + criteria.append(pl.col("numeric_value") < self.value_max) if self.other_cols: criteria.extend([pl.col(col) == value for col, value in self.other_cols.items()])