-
Notifications
You must be signed in to change notification settings - Fork 25
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
GetBenHealthIdDetails API changes #64
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes refactor the handling of health ID mappings by introducing Lombok's Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Service as HealthIDServiceImpl
participant Repo as BenHealthIDMappingRepo
Client->>Service: Request health ID details
Service->>Repo: Call getIsNewAbha(healthIdNumber)
Repo-->>Service: Return isNewAbha status
Service->>Service: Enrich health details with isNewAbha flag
Service->>Client: Return enriched health details
Possibly related PRs
Suggested reviewers
Poem
β¨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ 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: 0
π§Ή Nitpick comments (1)
src/main/java/com/wipro/fhir/repo/healthID/BenHealthIDMappingRepo.java (1)
79-80
: New method for retrieving ABHA status looks goodThis method will help determine if a specific health ID number is new by querying the
isNewAbha
column from thet_healthid
table.However, I noticed the order by clause uses
order by 1
without specifying a column name. Consider using an explicit column name to avoid potential issues if the table structure changes in the future.- @Query(value = "select isNewAbha from t_healthid where HealthIdNumber=:healthIdNumber order by 1 desc limit 1", nativeQuery = true) + @Query(value = "select isNewAbha from t_healthid where HealthIdNumber=:healthIdNumber order by CreatedDate desc limit 1", nativeQuery = true)
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (3)
src/main/java/com/wipro/fhir/data/healthID/BenHealthIDMapping.java
(2 hunks)src/main/java/com/wipro/fhir/repo/healthID/BenHealthIDMappingRepo.java
(1 hunks)src/main/java/com/wipro/fhir/service/healthID/HealthIDServiceImpl.java
(3 hunks)
β° Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (java)
π Additional comments (5)
src/main/java/com/wipro/fhir/data/healthID/BenHealthIDMapping.java (2)
33-33
: Good use of Lombok to reduce boilerplate codeThe
@Data
annotation is a convenient shortcut that bundles several Lombok annotations (@Getter, @Setter, @tostring, @EqualsAndHashCode, and @requiredargsconstructor), which will generate all the getters and setters automatically.Also applies to: 38-38
78-79
: New transient field for tracking new ABHA statusThe
isNewAbha
field is correctly marked as@Transient
since it doesn't need to be persisted to the database and is populated from another table.src/main/java/com/wipro/fhir/service/healthID/HealthIDServiceImpl.java (3)
65-65
: Variable naming consistency improvementsGood changes to maintain consistency in variable naming by changing
getBeneficiaryRegId/setBeneficiaryRegId
togetBeneficiaryRegID/setBeneficiaryRegID
to match the field name in the class.Also applies to: 67-67, 72-72
120-131
: Good implementation for enriching health details with ABHA statusThe new code properly enriches each health detail with the ABHA status information before returning the results, which enhances the API's functionality.
120-131
:β οΈ Potential issueMethod name inconsistency in enriching health details
The code is using
setNewAbha()
in line 126, but the field in theBenHealthIDMapping
class is namedisNewAbha
. This naming inconsistency might cause issues.Lombok generates getters and setters with specific naming conventions. For boolean fields, getters are prefixed with "is" and setters with "set". Please update the code to use the correct method name:
- healthDetails.setNewAbha(isNewAbha); + healthDetails.setIsNewAbha(isNewAbha);Additionally, consider adding error handling for potential exceptions when calling
getIsNewAbha()
, especially for cases where the health ID number might not exist in the database.Likely an incorrect or invalid review comment.
π Description
JIRA ID: AMM-1273
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
New Features
Refactor