Skip to content

Commit

Permalink
Fix age parsing for New Zealand (#2759)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbevansp committed Jul 21, 2022
1 parent 49495ac commit f9ad0b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ingestion/functions/parsing/new_zealand/new_zealand.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ def convert_demographics(entry):
'''
demo = {}
if (age := entry[_AGE]) != "NA":
if '90+' in age:
demo["ageRange"] = {"start": 90, "end": 120}
if '+' in age:
start = int(age.rstrip('+'))
demo["ageRange"] = {"start": start, "end": 120}
else:
start, end = list(map(int, age.split(' to ')))
demo["ageRange"] = {"start": start, "end": end}
Expand Down

0 comments on commit f9ad0b8

Please sign in to comment.