generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Renaming `Feature.TELEPHONE` to `Feature.TELECOM`, as that more accurately describes the matching behavior. Adding` Feature.GIVEN_NAME` and updating `Feature.FIRST_NAME` to only use the first element of a given name. ## Related Issues closes #128 closes #129 ## Additional Notes - TELEPHONE was misleading because the telecom field could collect emails, fax numbers and other contact points, that would be included in the matches. Renaming this to TELECOM better explains to the user what we're matching on. - FIRST_NAME was misleading, as it was including the middle names in its matches as well.
- Loading branch information
1 parent
8efe75c
commit 7bd7b09
Showing
5 changed files
with
47 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,7 +233,8 @@ def test_feature_iter(self): | |
], | ||
telecom=[ | ||
pii.Telecom(value="555-123-4567"), | ||
pii.Telecom(value="555-987-6543"), | ||
pii.Telecom(value="555-987-6543", system="phone"), | ||
pii.Telecom(value="[email protected]", system="email"), | ||
], | ||
drivers_license=pii.DriversLicense(value="D1234567", authority="VA"), | ||
) | ||
|
@@ -248,12 +249,17 @@ def test_feature_iter(self): | |
assert list(record.feature_iter(pii.Feature.CITY)) == ["Anytown", "Somecity"] | ||
assert list(record.feature_iter(pii.Feature.STATE)) == ["NY", "CA"] | ||
assert list(record.feature_iter(pii.Feature.ZIP)) == ["12345", "98765"] | ||
assert list(record.feature_iter(pii.Feature.FIRST_NAME)) == ["John", "L", "Jane"] | ||
assert list(record.feature_iter(pii.Feature.GIVEN_NAME)) == ["John", "L", "Jane"] | ||
assert list(record.feature_iter(pii.Feature.FIRST_NAME)) == ["John", "Jane"] | ||
assert list(record.feature_iter(pii.Feature.LAST_NAME)) == ["Doe", "Smith"] | ||
assert list(record.feature_iter(pii.Feature.SSN)) == ["123-45-6789"] | ||
assert list(record.feature_iter(pii.Feature.RACE)) == ["UNKNOWN"] | ||
assert list(record.feature_iter(pii.Feature.GENDER)) == ["UNKNOWN"] | ||
assert list(record.feature_iter(pii.Feature.TELEPHONE)) == ["555-123-4567", "555-987-6543"] | ||
assert list(record.feature_iter(pii.Feature.TELECOM)) == [ | ||
"555-123-4567", | ||
"555-987-6543", | ||
"[email protected]", | ||
] | ||
assert list(record.feature_iter(pii.Feature.SUFFIX)) == ["suffix", "suffix2"] | ||
assert list(record.feature_iter(pii.Feature.COUNTY)) == ["county"] | ||
assert list(record.feature_iter(pii.Feature.DRIVERS_LICENSE)) == ["D1234567|VA"] | ||
|
@@ -329,7 +335,7 @@ def test_blocking_keys_first_name_first_four(self): | |
rec = pii.PIIRecord(**{"name": [{"given": [""], "family": "Doe"}]}) | ||
assert rec.blocking_keys(BlockingKey.FIRST_NAME) == set() | ||
rec = pii.PIIRecord(**{"name": [{"given": ["John", "Jane"], "family": "Doe"}]}) | ||
assert rec.blocking_keys(BlockingKey.FIRST_NAME) == {"John", "Jane"} | ||
assert rec.blocking_keys(BlockingKey.FIRST_NAME) == {"John"} | ||
rec = pii.PIIRecord( | ||
**{ | ||
"name": [ | ||
|
@@ -338,7 +344,7 @@ def test_blocking_keys_first_name_first_four(self): | |
] | ||
} | ||
) | ||
assert rec.blocking_keys(BlockingKey.FIRST_NAME) == {"Jane", "John"} | ||
assert rec.blocking_keys(BlockingKey.FIRST_NAME) == {"Jane"} | ||
|
||
def test_blocking_keys_last_name_first_four(self): | ||
rec = pii.PIIRecord(**{"last_name": "Doe"}) | ||
|
@@ -375,7 +381,7 @@ def test_blocking_values(self): | |
elif key == BlockingKey.MRN: | ||
assert val == "3456" | ||
elif key == BlockingKey.FIRST_NAME: | ||
assert val in ("John", "Will") | ||
assert val == "John" | ||
elif key == BlockingKey.LAST_NAME: | ||
assert val == "Doe" | ||
else: | ||
|