Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix age parsing for New Zealand #2759

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ingestion/functions/parsing/new_zealand/new_zealand.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def convert_demographics(entry):
if (age := entry[_AGE]) != "NA":
if '90+' in age:
demo["ageRange"] = {"start": 90, "end": 120}
elif '70+' in age:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upper age limit should be 120 unless it is mentioned in the data dictionary that this refers to 70-79.
Since there is already an entry for 90+, best to make this generic so that any N+ will give an age range of N to 120

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhidg the latest commit on [2756_nz_issue_fixup] branch has the requested change

demo["ageRange"] = {"start": 70, "end": 79}
else:
start, end = list(map(int, age.split(' to ')))
demo["ageRange"] = {"start": start, "end": end}
Expand Down