Repository navigation
Conversation
Each secondary practice location (pl_pfile) used to become a nameless NPI-LOCATIONS record. No name key, name+place key or category key can be built for a nameless record, so providers were invisible at those 1.2M addresses (810,348 NPIs). Now map_npi adds each location's address to the provider as an extra ADDR_TYPE SECONDARY address (deduplicated against the provider's own addresses, after them in FEATURES) and its telephone and fax numbers as PHONE features (add_phone drops a repeat; a fax keeps PHONE_TYPE FAX). The NPI-LOCATIONS records are written only with --locationRecords. Checked against the previous output (9,443,429 providers): 735,071 changed, every one by additions only (1,111,747 secondary addresses, 852,163 phones, 308,029 faxes); officials and affiliations identical; the 4,594 deactivated NPIs that had locations carry them on their NPI_DEACTIVE record. Tests: tests/test_secondary_locations.py (address and phone carried, deduped, location records only with the flag).
🤖 Claude Code ReviewPR Code Review: secondary practice locations carried on the providerI read the diff and checked Code Quality
Testing
Documentation
Security
SummaryThe change is sound and well tested for the main path. Before merging, I'd address these:
Automated code review analyzing defects and coding standards |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The CMS practice-location file (
pl_pfile) lists additional locations per NPI. The mapper wrote each as a separate, namelessNPI-LOCATIONSrecord. A nameless record cannot get a name key, a name+place key or a category key, so the providers were invisible at those 1.2M addresses (810,348 NPIs).Now each location's address is carried on the provider as an extra
ADDR_TYPE: SECONDARYaddress (deduplicated against the provider's own, placed after them) and its telephone and fax numbers are carried asPHONE_NUMBERfeatures (a fax keepsPHONE_TYPE: FAX). The namelessNPI-LOCATIONSrecords are written only with--locationRecords.Behaviour change
Default output changes: no
NPI-LOCATIONSrecords (the output file is created and empty). Anyone relying on those records, or on theirSecondary Locationrelationship, needs--locationRecords.Verified on the 2026-09 dissemination
Output compared record by record with the previous run: 9,443,429 providers in both; 735,071 changed, all by additions only (1,111,747 secondary addresses, 852,163 phones, 308,029 faxes); officials (1,972,058) and affiliations (49,670) identical; the 4,594 deactivated NPIs that had locations now carry them on their
NPI_DEACTIVErecord.Prototype on a VA + NV subset (325K providers): category search by primary taxonomy code + a secondary-location ZIP finds the provider 245 of 246 times (0 before); a secondary-location phone number alone finds the provider 113 of 150 times (the misses are numbers shared by 13 to 3,348 records).
Tests
tests/test_secondary_locations.py(3 tests): address and phones carried, deduplicated, location records only with the flag.pylint10/10.