From 34f681949e4fb5235997c3a66fc0c02ca56ac623 Mon Sep 17 00:00:00 2001 From: rbevansp <87035404+rbevansp@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:39:33 +0100 Subject: [PATCH] Fix age parsing for New Zealand (#2759) --- ingestion/functions/parsing/new_zealand/new_zealand.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ingestion/functions/parsing/new_zealand/new_zealand.py b/ingestion/functions/parsing/new_zealand/new_zealand.py index 88230a02b..b5b000417 100644 --- a/ingestion/functions/parsing/new_zealand/new_zealand.py +++ b/ingestion/functions/parsing/new_zealand/new_zealand.py @@ -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}