Skip to content

Commit

Permalink
Add pathogenStatus to the day zero schema #2714
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jul 27, 2022
1 parent aa4a32a commit d0bb66a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
"omit_error"
]
},
{
"key": "pathogenStatus",
"type": "string",
"data_dictionary_text": "Whether the infection occured in an endemic, or non-endemic region.",
"required": "true",
"values": [
"endemic",
"emerging",
"unknown"
]
},
{
"key": "confirmationDate",
"type": "date",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"date": "2022-06-01T01:23:45.678Z",
"note": "Excluded upon this day, for reasons"
},
"caseStatus": "omit_error"
"caseStatus": "omit_error",
"pathogenStatus": "endemic"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"caseReference": {
"sourceId": "fedc09876543210987654321"
},
"caseStatus": "probable"
"caseStatus": "probable",
"pathogenStatus": "emerging"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"country": "IND"
}
},
"caseStatus": "probable"
"caseStatus": "probable",
"pathogenStatus": "unknown"
}
8 changes: 5 additions & 3 deletions data-serving/reusable-data-service/tests/test_case_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_csv_header():
header_line = Case.csv_header()
assert (
header_line
== "_id,caseStatus,confirmationDate,caseReference.sourceId,location.country,location.latitude,location.longitude,location.admin1,location.admin2,location.admin3\r\n"
== "_id,caseStatus,pathogenStatus,confirmationDate,caseReference.sourceId,location.country,location.latitude,location.longitude,location.admin1,location.admin2,location.admin3\r\n"
)


Expand All @@ -44,8 +44,9 @@ def test_csv_row_with_no_id():
case.confirmationDate = date(2022, 6, 13)
case.caseReference = ref
case.caseStatus = "probable"
case.pathogenStatus = "emerging"
csv = case.to_csv()
assert csv == ",probable,2022-06-13,abcd12903478565647382910,,,,,,\r\n"
assert csv == ",probable,emerging,2022-06-13,abcd12903478565647382910,,,,,,\r\n"


def test_csv_row_with_id():
Expand All @@ -59,8 +60,9 @@ def test_csv_row_with_id():
case.confirmationDate = date(2022, 6, 13)
case.caseReference = ref
case.caseStatus = "probable"
case.pathogenStatus = "unknown"
csv = case.to_csv()
assert csv == f"{id1},probable,2022-06-13,{id2},,,,,,\r\n"
assert csv == f"{id1},probable,unknown,2022-06-13,{id2},,,,,,\r\n"


def test_apply_update_to_case():
Expand Down

0 comments on commit d0bb66a

Please sign in to comment.