Skip to content

Commit

Permalink
parsing(new_zealand): fix age parsing for Unknown age
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed Oct 15, 2022
1 parent 965f4d9 commit 22429aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
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,

0 comments on commit 22429aa

Please sign in to comment.