Skip to content

Commit

Permalink
self.corrected_decimal_age
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourpeas committed Jan 17, 2025
1 parent 2babab2 commit e2af9a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rcpchgrowth/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def __calculate_ages(
chronological_decimal_age_error = f"{err}"

# if reference is CDC or WHO, we must treat >37 week infants as term and we also stop correcting for prematurity at 2 years of age
if self.reference == CDC or self.reference == WHO:
if self.reference == CDC or self.reference == WHO and self.corrected_decimal_age is not None:
if (self.corrected_decimal_age >= 2 and gestation_weeks < 37) or (gestation_weeks >= 37 and gestation_weeks <= 42):
self.corrected_decimal_age = self.chronological_decimal_age

Expand Down

0 comments on commit e2af9a6

Please sign in to comment.