generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand Feature Comparison Support (#88)
## Description NBS has requested that we add additional fields for feature comparisons. We won't need to block on any of these features, but we do need to have the ability to compare them in the second half of the algorithm. ## Related Issues closes #55 ## Additional Notes - [x] Add the following values to `recordlinker.models.pii.PIIRecord` - [x] SSN (should validate that its 10 digits and conform to XXX-XX-XXXX format) - [x] Race (need an Enum with the [8 races identified here](https://www.hl7.org/fhir/us/core/ValueSet-omb-race-category.html)) - [x] Gender (need an Enum with the [5 genders identified here](https://terminology.hl7.org/5.5.0/ValueSet-gender-identity.html)) - [x] Add the above 3 to `recordlinker.models.pii.Feature`, and additionally add 3 more - [x] Telephone - [x] Suffix - [x] County - [x] Rename `recordlinker.models.pii.PIIRecord.field_iter` to `recordlinker.models.pii.PIIRecord.feature_iter` - [x] Update `recordlinker.models.pii.PIIRecord.field_iter` to extract the 6 features above - [x] Update `recordlinker.linking.fhir_record_to_pii_record` to extract the 6 features from a FHIR payload - [x] Add documentation to the `docs/` directory to explain the process of adding a new Feature HL7 FHIR resources - https://build.fhir.org/patient-examples-general.json.html - https://hl7.org/fhir/R5/patient.html - https://hl7.org/fhir/R5/datatypes-examples.html#HumanName - https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-race.html - https://www.hl7.org/fhir/us/core/Patient-example.json.html
- Loading branch information
1 parent
735fe58
commit 2533adb
Showing
6 changed files
with
413 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Adding a New Feature | ||
|
||
### Add the New Feature to the `Feature` Class | ||
- In [src/recordlinker/schemas/pii.py](https://github.com/CDCgov/RecordLinker/blob/a672d2b6409cbd1a08f729d94fba5692f57f6fc6/src/recordlinker/schemas/pii.py), add the new feature to the [Feature](https://github.com/CDCgov/RecordLinker/blob/a672d2b6409cbd1a08f729d94fba5692f57f6fc6/src/recordlinker/schemas/pii.py#L12C7-L12C14) enum class. | ||
|
||
### Update the `PIIRecord` Schema | ||
- In the same file, modify the [PIIRecord](https://github.com/CDCgov/RecordLinker/blob/c85f555e5da91d54eb8c51e3bdf0789d1e204b2f/src/recordlinker/schemas/pii.py#L97) class to include the new feature as a field. | ||
- If the feature requires predefined values, create an enum to represent those values. | ||
|
||
### Modify the `PIIRecord.feature_iter` Method | ||
- Update the [PIIRecord.feature_iter](https://github.com/CDCgov/RecordLinker/blob/a672d2b6409cbd1a08f729d94fba5692f57f6fc6/src/recordlinker/schemas/pii.py#L246) method to return the value of the new feature when it's used for comparison. | ||
|
||
### Extract the FHIR Field in `fhir_record_to_pii_record` | ||
- In [src/recordlinker/linking/link.py](https://github.com/CDCgov/RecordLinker/blob/a672d2b6409cbd1a08f729d94fba5692f57f6fc6/src/recordlinker/linking/link.py), update the [fhir_record_to_pii_record](https://github.com/CDCgov/RecordLinker/blob/a672d2b6409cbd1a08f729d94fba5692f57f6fc6/src/recordlinker/linking/link.py#L26) function to map the relevant FHIR field to the new feature in [PIIRecord](https://github.com/CDCgov/RecordLinker/blob/c85f555e5da91d54eb8c51e3bdf0789d1e204b2f/src/recordlinker/schemas/pii.py#L97). | ||
|
||
### Update the Tests | ||
- Add or modify unit tests to verify that the new feature is properly extracted, mapped, and compared. |
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
Oops, something went wrong.