Skip to content

Commit

Permalink
fixes structured incident metadata format
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanathan committed Nov 15, 2018
1 parent b3af1c5 commit 785575e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions epitator/incident_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ def annotate(self, doc, case_counts=None):
if CANNOT_PARSE in required_properties:
continue
metadata = dict(incident.metadata)
if metadata['species'] == CANNOT_PARSE:
metadata['species'] = {
'id': 'tsn:180092',
'label': 'Homo sapiens'
}
if metadata['resolvedDisease'] == CANNOT_PARSE:
del metadata['resolvedDisease']
if "suspected" in metadata['attributes']:
metadata['status'] = "suspected"
elif "confirmed" in metadata['attributes']:
metadata['status'] = "confirmed"
metadata['locations'] = [format_geoname(metadata['location'])]
del metadata['location']
incidents.append(SpanGroup([incident], metadata=metadata))
Expand Down

0 comments on commit 785575e

Please sign in to comment.