ignore additional location entries
@@ -460,10 +460,14 @@ def adjust_caps(s):
def check_additional_location(info, strain_list, location_pattern, ordering, metadata, annotations_append, variants):
place = find_longest_pattern(info, location_pattern)
+ if place != None:
+ return annotations_append, True
+ else:
+ return annotations_append, False
+
if info.endswith(" (interpreted as patient residence)"):
place = info.split(" (interpreted as patient residence)")[0]
-
if place == None:
# No pattern found - try whether found as location anyway
pattern_found = False
@@ -575,6 +579,8 @@ def check_travel_history(info, strain_list, travel_pattern, ordering, metadata,
results = {"region_exposure": [], "country_exposure": [], "division_exposure": []}
# In case several travels are listed, check all of them and find overlaps
for place in places:
+ if " / " in place:
+ place = place.split(" / ")[-1]
ordering_result = find_place_in_ordering(place, ordering, variants)
while ordering_result == None:
s = "Could not identify " + bold(place) + ". You have the following options:"
@@ -663,6 +669,10 @@ def check_additional_info(additional_info, path_to_config_files):
strain_list = sorted_info[key]
info_found = False
+ if info.startswith("Other: "):
+ info = info[7:]
+ print("Treating \"Other: " + info + "\" as \"" + info + "\"")
+
print("Processing " + bold(info) + ":")
while True:
@@ -728,6 +738,7 @@ def check_additional_info(additional_info, path_to_config_files):
annotations_append, info_found = check_additional_location(info, strain_list, location_pattern, ordering, metadata, annotations_append, variants)
if info_found:
+ print("Location pattern found. Skipping entry...")
break
s = bold(info) + " did not contain known pattern or could not be interpreted. You have the following options:"
