Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbuckley committed Sep 20, 2024
1 parent 406f87b commit 7fcc028
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/unit/test_simple_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,16 @@ def test_patient_with_blocking_keys(self, session, new_patient):
new_patient.data = {"name": [{"given": ["Johnathon", "Bill",], "family": "Smith"}], "birthdate": "01/01/1980"}
keys = simple_mpi.insert_blocking_keys(session, new_patient)
assert len(keys) == 4
assert keys[0].patient_id == new_patient.id
assert keys[0].blockingkey == models.BlockingKey.BIRTHDATE.id
assert keys[0].value == "1980-01-01"
assert keys[1].patient_id == new_patient.id
assert keys[1].blockingkey == models.BlockingKey.FIRST_NAME.id
assert keys[1].value == "John"
assert keys[2].patient_id == new_patient.id
assert keys[2].blockingkey == models.BlockingKey.FIRST_NAME.id
assert keys[2].value == "Bill"
assert keys[3].patient_id == new_patient.id
assert keys[3].blockingkey == models.BlockingKey.LAST_NAME.id
assert keys[3].value == "Smit"
for key in keys:
assert keys[0].patient_id == new_patient.id
if key.blockingkey == models.BlockingKey.BIRTHDATE.id:
assert key.value == "1980-01-01"
elif key.blockingkey == models.BlockingKey.FIRST_NAME.id:
assert key.value in ["John", "Bill"]
elif key.blockingkey == models.BlockingKey.LAST_NAME.id:
assert key.value == "Smit"
else:
assert False, f"Unexpected blocking key: {key.blockingkey}"


class TestInsertMatchedPatient:
Expand Down Expand Up @@ -119,7 +117,7 @@ def prime_index(self, session):
data = [
{"name": [{"given": ["Johnathon", "Bill",], "family": "Smith"}], "birthdate": "01/01/1980"},
{"name": [{"given": ["George",], "family": "Harrison"}], "birthdate": "1943-2-25"},
{"name": [{"given": ["John",], "family": "Doe"}], "birthdate": "1980-01-01"},
{"name": [{"given": ["John",], "family": "Doe"}, {"given": ["John"], "family": "Lewis"}], "birthdate": "1980-01-01"},
{"name": [{"given": ["Bill",], "family": "Smith"}], "birthdate": "1980-01-01"},
{"name": [{"given": ["John",], "family": "Smith"}], "birthdate": "1980-01-01"},
{"name": [{"given": ["John",], "family": "Smith"}], "birthdate": "1985-11-12"},
Expand Down

0 comments on commit 7fcc028

Please sign in to comment.