-
Notifications
You must be signed in to change notification settings - Fork 41
AMM-1217 #86
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
AMM-1217 #86
Conversation
WalkthroughThis pull request updates the project's dependency versions in the Changes
Suggested reviewers
Poem
π Recent review detailsConfiguration used: CodeRabbit UI π Files selected for processing (1)
β Files skipped from review due to trivial changes (1)
β° Context from checks skipped due to timeout of 90000ms (2)
πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
π Outside diff range comments (1)
src/main/java/com/iemr/common/identity/service/IdentityService.java (1)
575-622: π οΈ Refactor suggestion
β οΈ Potential issueRisk of overwriting newly-set fields in
getBeneficiariesDTONew.
Within this method, lines 578β580 set key attributes (BenMapId,CreatedBy,CreatedDate) on a newmappinginstance, but line 581 reassignsmappingto the result ofmappingRepo.getWithVanSerialNoVanID(...), discarding those newly-set fields. This can cause inconsistent data initialization. Consider restructuring the logic so the finalmappingobject retains all intended values. For example, fetch the existing entity first, then set any additional fields:private MBeneficiarymapping getBeneficiariesDTONew(Object[] benMapArr) { MBeneficiarymapping mapping = mappingRepo.getWithVanSerialNoVanID( - getBigIntegerValueFromObject(benMapArr[9]), - (Integer) benMapArr[8] - ); + getBigIntegerValueFromObject(benMapArr[9]), + (Integer) benMapArr[8] + ); + // If no DB record is found, create a new one. + if (mapping == null) { + mapping = new MBeneficiarymapping(); + } if (benMapArr != null && benMapArr.length == 12 && benMapArr[8] != null && benMapArr[9] != null) { - mapping.setBenMapId(getBigIntegerValueFromObject(benMapArr[0])); - mapping.setCreatedBy(String.valueOf(benMapArr[10])); - mapping.setCreatedDate((Timestamp) benMapArr[11]); - mapping = mappingRepo.getWithVanSerialNoVanID( - getBigIntegerValueFromObject(benMapArr[9]), - (Integer) benMapArr[8] - ); + // Now safely set fields after retrieving or creating the entity + mapping.setBenMapId(getBigIntegerValueFromObject(benMapArr[0])); + mapping.setCreatedBy(String.valueOf(benMapArr[10])); + mapping.setCreatedDate((Timestamp) benMapArr[11]); // ...rest of the logic } return mapping; }
π§Ή Nitpick comments (1)
src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java (1)
142-144: Addition of simplified query methodThis new method provides a streamlined way to fetch a
MBeneficiarymappingentity without all the complex joins present in the existinggetMappingmethod (lines 127-140). It's a good performance optimization for cases where only the basic entity is needed.Consider documenting the difference between this simpler method and the existing
getMappingmethod to help other developers choose the appropriate one based on their data needs.Add a comment above the method explaining when to use this method versus the full
getMappingmethod that includes all joins:+/** + * Retrieves a basic MBeneficiarymapping entity without additional joins. + * Use this method when only the core mapping data is needed for better performance. + * For a complete entity with all related data, use getMapping() instead. + */ @Query("SELECT a FROM MBeneficiarymapping a WHERE a.vanSerialNo =:vanSerialNo AND a.vanID =:vanID ") MBeneficiarymapping getWithVanSerialNoVanID(@Param("vanSerialNo") BigInteger vanSerialNo, @Param("vanID") Integer vanID);
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (6)
pom.xml(2 hunks)src/main/java/com/iemr/common/identity/repo/BenFamilyMappingRepo.java(2 hunks)src/main/java/com/iemr/common/identity/repo/BenIdentityRepo.java(2 hunks)src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java(2 hunks)src/main/java/com/iemr/common/identity/repo/BenServiceMappingRepo.java(1 hunks)src/main/java/com/iemr/common/identity/service/IdentityService.java(2 hunks)
π§° Additional context used
π§ Learnings (4)
src/main/java/com/iemr/common/identity/repo/BenIdentityRepo.java (1)
Learnt from: ravishanigarapu
PR: PSMRI/Identity-API#85
File: src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java:125-138
Timestamp: 2025-03-21T08:17:59.398Z
Learning: In the Identity-API project, tables involved in beneficiary mapping queries (MBeneficiaryregidmapping, MBeneficiarycontact, MBeneficiarydetail, MBeneficiaryaddress, MBeneficiaryconsent, MBeneficiaryImage, MBeneficiaryAccount, MBeneficiaryidentity, MBeneficiaryfamilymapping, MBeneficiaryservicemapping) have indexes created on join columns (vanID, vanSerialNo) to optimize query performance.
src/main/java/com/iemr/common/identity/repo/BenFamilyMappingRepo.java (1)
Learnt from: ravishanigarapu
PR: PSMRI/Identity-API#85
File: src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java:125-138
Timestamp: 2025-03-21T08:17:59.398Z
Learning: In the Identity-API project, tables involved in beneficiary mapping queries (MBeneficiaryregidmapping, MBeneficiarycontact, MBeneficiarydetail, MBeneficiaryaddress, MBeneficiaryconsent, MBeneficiaryImage, MBeneficiaryAccount, MBeneficiaryidentity, MBeneficiaryfamilymapping, MBeneficiaryservicemapping) have indexes created on join columns (vanID, vanSerialNo) to optimize query performance.
src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java (1)
Learnt from: ravishanigarapu
PR: PSMRI/Identity-API#85
File: src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java:125-138
Timestamp: 2025-03-21T08:17:59.398Z
Learning: In the Identity-API project, tables involved in beneficiary mapping queries (MBeneficiaryregidmapping, MBeneficiarycontact, MBeneficiarydetail, MBeneficiaryaddress, MBeneficiaryconsent, MBeneficiaryImage, MBeneficiaryAccount, MBeneficiaryidentity, MBeneficiaryfamilymapping, MBeneficiaryservicemapping) have indexes created on join columns (vanID, vanSerialNo) to optimize query performance.
src/main/java/com/iemr/common/identity/service/IdentityService.java (1)
Learnt from: ravishanigarapu
PR: PSMRI/Identity-API#85
File: src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java:125-138
Timestamp: 2025-03-21T08:17:59.398Z
Learning: In the Identity-API project, tables involved in beneficiary mapping queries (MBeneficiaryregidmapping, MBeneficiarycontact, MBeneficiarydetail, MBeneficiaryaddress, MBeneficiaryconsent, MBeneficiaryImage, MBeneficiaryAccount, MBeneficiaryidentity, MBeneficiaryfamilymapping, MBeneficiaryservicemapping) have indexes created on join columns (vanID, vanSerialNo) to optimize query performance.
β° Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (java)
- GitHub Check: Build_and_analyse
π Additional comments (5)
src/main/java/com/iemr/common/identity/repo/BenServiceMappingRepo.java (1)
86-88: New query method added for simplified beneficiary service lookupThe new method provides a direct way to look up beneficiary service mappings by benMapId and vanID. This is a good addition for more focused queries.
Based on the retrieved learnings, ensure that appropriate indexes exist on the vanID and benMapId columns to optimize query performance.
src/main/java/com/iemr/common/identity/repo/BenMappingRepo.java (1)
36-36: New import added for MBeneficiaryservicemappingThis import supports the broader beneficiary mapping changes across the codebase.
pom.xml (3)
29-29: Bump Lombok version.
Upgrading to version 1.18.36 ensures the project benefits from the latest Lombok fixes and features.
295-295: Update Maven Compiler Plugin.
Switching from 3.12.1 to 3.14.0 is a reasonable move to keep up with the latest compiler improvements. Please confirm compilation runs smoothly.
303-303: Use consistent Lombok property.
Aligning the annotation processorβs version with${org.projectlombok.version}ensures a single property reference across the POM.
src/main/java/com/iemr/common/identity/repo/BenIdentityRepo.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iemr/common/identity/repo/BenFamilyMappingRepo.java
Outdated
Show resolved
Hide resolved
|



π Description
JIRA ID: AMM-1217
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
β Type of Change
βΉοΈ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit
Chores
New Features