Skip to content

feat(provider_finder): Add 'prefer_one' provider finding strategy #1567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

andrequina
Copy link
Member

Introduces a new provider finding strategy, ProviderFinderPreferOne, which allows configuring Synthea to prioritize a specific provider based on their NPI.

Key changes include:

  • Added ProviderFinderPreferOne.java implementing the new logic.
  • Integrated ProviderFinderPreferOne into Generator.java to:
    • Set the initial simulation state based on the preferred provider's location.
    • Allow overriding patient demographics based on the preferred provider.
  • Added the prefer_one option to the provider finding mechanism in Provider.java.
  • Refactored provider file path handling in Provider.java for clarity and to support locating the preferred provider.

Introduces a new provider finding strategy, `ProviderFinderPreferOne`, which allows configuring Synthea to prioritize a specific provider based on their NPI.

Key changes include:
- Added `ProviderFinderPreferOne.java` implementing the new logic.
- Integrated `ProviderFinderPreferOne` into `Generator.java` to:
    - Set the initial simulation state based on the preferred provider's location.
    - Allow overriding patient demographics based on the preferred provider.
- Added the `prefer_one` option to the provider finding mechanism in `Provider.java`.
- Refactored provider file path handling in `Provider.java` for clarity and to support locating the preferred provider.
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/main/resources/synthea.properties: Language not supported

Copy link
Member

@jawalonoski jawalonoski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk about the expected behavior of this finder.

1. Implement caching in the getPreferredProvider method to avoid repeated lookups of the same provider. This optimization improves performance by storing the provider once found and returning the cached instance on subsequent calls with the same NPI.

2. Throw ExceptionInInitializerError in overrideDemographicsIfPreferredProvider when the provider is not found by NPI.
…der is not set.

Update getPreferredNPI to check if preferred provider selection behavior is enabled before retrieving the NPI from configuration.
@andrequina andrequina requested a review from jawalonoski May 2, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants