Skip to content
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

BFD-3728: Refactor NPI Module to encompass all NPI requests #2539

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

Conversation

dondevun
Copy link
Contributor

@dondevun dondevun commented Feb 4, 2025

JIRA Ticket:
BFD-3728

What Does This PR Do?

Refactors the NPI Org module to return Practitioner NPI information, and replaces retrieveNpiCodeDisplay method in CommonTransformerUtils.java with code to use this new lookup (instead of the flat file, which was previously used).

What Should Reviewers Watch For?

If you're reviewing this PR, please check for these things in particular:

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies

  • Modifies any security controls

  • Adds new transmission or storage of data

  • Any other changes that could possibly affect security?

  • I have considered the above security implications as it relates to this PR. (If one or more of the above apply, it cannot be merged without the ISSO or team security engineer's (@sb-benohe) approval.)

Validation

Have you fully verified and tested these changes? Is the acceptance criteria met? Please provide reproducible testing instructions, code snippets, or screenshots as applicable.
Verified that Unit tests and integration tests properly use the new lookup, and additionally verified on a local server against the golden bene in the test database.

@dondevun dondevun changed the title Bfd 3728 BFD-3728: Refactor NPI Module to encompass all NPI requests Feb 4, 2025
@dondevun dondevun marked this pull request as draft February 4, 2025 15:00
@dondevun dondevun marked this pull request as ready for review February 5, 2025 17:48
* @return true if the stream is deflated
* @throws IOException on read error.
*/
public boolean isStreamDeflated(InputStream inputStream) throws IOException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is necessary because the test data isn't deflated, while the production data is; so the easiest way to determine if it is a compressed stream is to look for the zlib signature.

*
* @param orgLookup The instance of NPIOrgLookup.
*/
public static void setNpiOrgLookup(NPIOrgLookup orgLookup) {
Copy link
Contributor Author

@dondevun dondevun Feb 6, 2025

Choose a reason for hiding this comment

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

CommonTransformerUtils is not a managed bean (and isn't instantiated, anyway), so the NPIOrgLookup instance is set here from the ServerInitializer (which has access to the NPIOrgLookup managed bean).

.providerCredential(providerCredential)
.build();
String json = objectMapper.writeValueAsString(npiData);
dos.write((npi + "\t" + json).getBytes());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to do this tab-separated format when the npi value is already part of the json object that's being written?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't. Updated.

@dondevun dondevun enabled auto-merge (squash) February 6, 2025 19:46
@@ -3133,8 +3134,7 @@
},
"system" : "http://hl7.org/fhir/sid/us-npi",
"value" : "1023011079"
},
"display" : "ADVANTAGE HOME HEALTH CARE, INC."
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these display values missing now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me look into that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching that, turned out to be a bug in the new code.

String npi;

/** Entity Type. Will be 1 or 2. */
String entityTypeCode;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be cleaner to have an enum for this? Or at least a constant. Because it's not clear what entity type code 1 or 2 means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think an enum is overkill, but I think you're right about the constant.

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.

3 participants