-
Notifications
You must be signed in to change notification settings - Fork 31
merging small error #130
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
merging small error #130
Conversation
Removed unnecessary 'order by 1 desc' clause from queries.
π WalkthroughWalkthroughFixed conditional logic for string validation in CareContextLinkingServiceImpl by correcting three empty/non-empty checks. The changes ensure AbhaNumber and AbdmFacilityId values are only processed when they contain non-empty strings, preventing incorrect handling of empty values in token generation and care context linking workflows. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~8 minutes Poem
Pre-merge checks and finishing touchesβ Failed checks (1 warning, 1 inconclusive)
β Passed checks (1 passed)
β¨ Finishing touches
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. Comment |
|
@coderabbitai review |
β Actions performedReview triggered.
|
|
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/service/v3/careContext/CareContextLinkingServiceImpl.java (1)
114-119: Consider updating for consistency.Line 115 still uses the old-style comparison
"" !=while line 122 now uses the more idiomatic!isEmpty(). For consistency, consider refactoring line 115 similarly:π Suggested refactor for consistency
if (null != careContextLinkRequest.getAbdmFacilityId() - && "" != careContextLinkRequest.getAbdmFacilityId()) { + && !careContextLinkRequest.getAbdmFacilityId().isEmpty()) { headers.add("X-HIP-ID", careContextLinkRequest.getAbdmFacilityId()); } else { headers.add("X-HIP-ID", abdmFacilityId); }
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
src/main/java/com/wipro/fhir/service/v3/careContext/CareContextLinkingServiceImpl.java
π§° Additional context used
π§ Learnings (3)
π Common learnings
Learnt from: helenKaryamsetty
Repo: PSMRI/FHIR-API PR: 57
File: src/main/java/com/wipro/fhir/service/facility/FacilityServiceImpl.java:89-92
Timestamp: 2025-01-07T11:20:36.850Z
Learning: In the FHIR-API project, visitCode validation (null checks) is handled at the UI layer, and therefore doesn't need to be duplicated in the service layer methods like `saveAbdmFacilityId`.
Learnt from: helenKaryamsetty
Repo: PSMRI/FHIR-API PR: 52
File: src/main/java/com/wipro/fhir/service/v3/abha/LoginAbhaV3ServiceImpl.java:84-91
Timestamp: 2024-12-09T16:01:39.809Z
Learning: In the `requestOtpForAbhaLogin` and `verifyAbhaLogin` methods of `LoginAbhaV3ServiceImpl.java`, `loginId` is mandatory, but even if it is null, the process can proceed without input validation.
Learnt from: helenKaryamsetty
Repo: PSMRI/FHIR-API PR: 46
File: src/main/java/com/wipro/fhir/service/common/CommonServiceImpl.java:331-331
Timestamp: 2024-11-20T07:48:22.000Z
Learning: When `getAbdmFacilityAndlinkedDate` returns null or an empty list, do not throw an exception; instead, proceed with the execution.
π Learning: 2024-11-20T07:45:51.578Z
Learnt from: helenKaryamsetty
Repo: PSMRI/FHIR-API PR: 46
File: src/main/java/com/wipro/fhir/service/common/CommonServiceImpl.java:365-381
Timestamp: 2024-11-20T07:45:51.578Z
Learning: In `CommonServiceImpl.java`, within the `addCareContextToMongo` method, prefer using direct switch-case statements for gender mapping instead of introducing separate enums.
Applied to files:
src/main/java/com/wipro/fhir/service/v3/careContext/CareContextLinkingServiceImpl.java
π Learning: 2025-01-07T11:20:36.850Z
Learnt from: helenKaryamsetty
Repo: PSMRI/FHIR-API PR: 57
File: src/main/java/com/wipro/fhir/service/facility/FacilityServiceImpl.java:89-92
Timestamp: 2025-01-07T11:20:36.850Z
Learning: In the FHIR-API project, visitCode validation (null checks) is handled at the UI layer, and therefore doesn't need to be duplicated in the service layer methods like `saveAbdmFacilityId`.
Applied to files:
src/main/java/com/wipro/fhir/service/v3/careContext/CareContextLinkingServiceImpl.java
π Additional comments (3)
src/main/java/com/wipro/fhir/service/v3/careContext/CareContextLinkingServiceImpl.java (3)
122-122: Excellent fix - more idiomatic empty check.The change from
"" !=to!isEmpty()is correct and more idiomatic Java. This ensures AbhaNumber is only processed when it contains a non-empty value.
247-252: Critical bug fix - corrected inverted logic.This is an important fix! The previous condition
"" == addCareContextRequest.getAbdmFacilityId()would have selected the AbdmFacilityId header value only when it was empty (backwards!), otherwise falling back to the configured facility ID. The corrected logic!isEmpty()now properly uses the AbdmFacilityId when it contains a non-empty value, which is the intended behavior for header selection.
278-282: Excellent fix - more idiomatic empty check.Similar to line 122, this change from
"" !=to!isEmpty()is correct and more idiomatic. It ensures AbhaNumber is only processed when non-empty.
* Abdm v3 (#112) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Update pom.xml * mongo query change fetch to linktoken (#113) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Abdm v3 (#114) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * ABDM Abdm HiTypes addition in linktoken (#115) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: corrected spelling mistake Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: modified repo queries Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Minor fixes (#116) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * response correction (#117) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * generate token logic change (#120) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * hiType correction and modification in error message format (#121) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * Fix display setting for patient care context --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Modified error message display (#122) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * M2 FHIR bundles creation (#123) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * added missed variable change (#124) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Modified the constructor for better handling (#125) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * medication statement correction (#126) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel * fix: corrected type error --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Bundle model fixes (#127) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel * fix: corrected type error * fix: correct medication histoory model class --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Update jboss-web.xml * Update common_docker.properties * Delete src/main/environment/common_test.properties * Delete src/main/environment/common_dev.properties * taken coderabbit comments (#129) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel * fix: corrected type error * fix: correct medication histoory model class * fix: taken coderabbitai comments --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> * Update CareContextRepo.java * merging small error (#130) * Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel * fix: corrected type error * fix: correct medication histoory model class * fix: taken coderabbitai comments * fix: modified small mistake --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>




π Description
JIRA ID:
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
βοΈ Tip: You can customize this high-level summary in your review settings.