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

parsing(new_zealand): fix age parsing for Unknown age #2907

Merged
merged 1 commit into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion ingestion/functions/parsing/new_zealand/new_zealand.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def convert_demographics(entry):
If age is listed as 90+, setting age range as between 90 and 120.
'''
demo = {}
if (age := entry[_AGE]) != "NA":
if (age := entry[_AGE]) not in ["NA", "Unknown"]:
if '+' in age:
start = int(age.rstrip('+'))
demo["ageRange"] = {"start": start, "end": 120}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def _c(location, gender, age_start, age_end, confirmed_date, travel=False, notes
_c(_Bay_of_Plenty, "Female", 90, 120, "05/05/2021Z", True, "Case imported from abroad."),
_c(_West_Coast, "Female", 20, 29, "05/06/2021Z", False),
_c(_West_Coast, None, None, None, "07/01/2021Z", False),
_c(_West_Coast, None, None, None, "07/01/2021Z", False),
]


Expand Down
1 change: 1 addition & 0 deletions ingestion/functions/parsing/new_zealand/sample_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Report Date,Case Status,Sex,Age group,DHB,Overseas travel,Historical
2021-05-05,Confirmed,Female,90+,Bay of Plenty,Yes,
2021-05-06,Confirmed,Female,20 to 29,West Coast,No,
2021-07-01,Confirmed,Unknown,NA,West Coast,No,
2021-07-01,Confirmed,Unknown,Unknown,West Coast,No,