Skip to content

Conversation

@helenKaryamsetty
Copy link
Member

@helenKaryamsetty helenKaryamsetty commented Oct 31, 2025

πŸ“‹ Description

JIRA ID: AMM-1307

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


βœ… Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • πŸ”₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • πŸ›  Refactor (change that is neither a fix nor a new feature)
  • βš™οΈ Config change (configuration file or build script updates)
  • πŸ“š Documentation (updates to docs or readme)
  • πŸ§ͺ Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • πŸš€ Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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.

Pull Request Overview

This PR updates the ABDM (Ayushman Bharat Digital Mission) integration to support multiple health information types when linking care contexts. The key changes include determining applicable HI types dynamically based on visit data and updating the context root for deployment.

  • Dynamically determines applicable health information (HI) types based on visit code and category
  • Refactors care context generation to create separate contexts for each HI type
  • Adds repository methods to query for presence of different medical record types

Reviewed Changes

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

File Description
src/main/webapp/WEB-INF/jboss-web.xml Updates the application context root from /fhir-api to /fhir-api-abdm
src/main/java/com/wipro/fhir/service/v3/careContext/CareContextLinkingServiceImpl.java Refactors care context linking to support multiple HI types, adds findHiTypes method, and fixes variable scope issue in checkRecordExisits
src/main/java/com/wipro/fhir/repo/v3/careContext/CareContextRepo.java New repository interface with native queries to check for presence of vitals, prescriptions, lab tests, and vaccine details

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 245 to +261
CareContexts careContexts = new CareContexts();
PatientCareContext patient = new PatientCareContext();
ArrayList<PatientCareContext> pcc = new ArrayList<PatientCareContext>();

ArrayList<CareContexts> cc = new ArrayList<CareContexts>();
careContexts.setReferenceNumber(addCareContextRequest.getVisitCode());
careContexts.setDisplay(addCareContextRequest.getDisplay());
cc.add(careContexts);
for (String hiType : hiTypes) {
PatientCareContext patient = new PatientCareContext();

ArrayList<PatientCareContext> pcc = new ArrayList<PatientCareContext>();
patient.setReferenceNumber(addCareContextRequest.getVisitCode());
patient.setDisplay(addCareContextRequest.getDisplay());
patient.setDisplay(addCareContextRequest.getDisplay());
patient.setCount(1);
patient.setCareContexts(cc);
pcc.add(patient);
ArrayList<CareContexts> cc = new ArrayList<CareContexts>();
careContexts.setReferenceNumber(addCareContextRequest.getVisitCode());
careContexts.setDisplay(addCareContextRequest.getVisitCategory());
cc.add(careContexts);
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The careContexts object is instantiated outside the loop but modified and reused inside the loop. This will cause all PatientCareContext objects to share the same CareContexts instance, resulting in incorrect data. Each iteration should create a new CareContexts object. Move the new CareContexts() instantiation inside the loop at line 258.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

helenKaryamsetty and others added 2 commits October 31, 2025 16:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@helenKaryamsetty helenKaryamsetty merged commit f55c90e into PSMRI:abdmV3 Oct 31, 2025
2 of 3 checks passed
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.

1 participant