Skip to content
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
104547d
Reverted Changes
ravishanigarapu Dec 24, 2024
85ca627
removed Unused imports
ravishanigarapu Dec 24, 2024
efe5412
Merge branch 'PSMRI:develop' into develop
ravishanigarapu Jan 9, 2025
f30feda
Merge branch 'PSMRI:develop' into develop
ravishanigarapu Feb 24, 2025
25d6cbe
Merge branch 'PSMRI:develop' into develop
ravishanigarapu Feb 28, 2025
1e675d9
Merge branch 'PSMRI:develop' into develop
ravishanigarapu Apr 7, 2025
6f93e13
Update application.properties
ravishanigarapu Apr 7, 2025
9ea499d
Merge branch 'PSMRI:develop' into develop
ravishanigarapu Apr 17, 2025
fe1908c
Swagger changes
ravishanigarapu Apr 17, 2025
3602722
Merge branch 'PSMRI:develop' into develop
ravishanigarapu May 14, 2025
e37d6ba
Null Condition Added
ravishanigarapu May 14, 2025
2e2d733
Merge branch 'PSMRI:develop' into develop
ravishanigarapu May 20, 2025
35237c1
AMM-1456
ravishanigarapu May 20, 2025
36dbe68
Indent format
ravishanigarapu May 20, 2025
3498d85
User-Agent validation
ravishanigarapu May 22, 2025
681977d
wrapper class added
ravishanigarapu May 22, 2025
f29182e
RestTemplateUtil class created for Headers
ravishanigarapu May 22, 2025
44a9c0e
code rabbit issues fixed
ravishanigarapu May 22, 2025
4d24d28
if condition added
ravishanigarapu May 22, 2025
97659e7
null check
ravishanigarapu May 22, 2025
0987627
Merge branch 'develop' into develop
ravishanigarapu May 22, 2025
72e5839
loggers Added
ravishanigarapu May 23, 2025
b6c2e1d
Merge branch 'PSMRI:develop' into develop
ravishanigarapu May 23, 2025
3375310
Merge branch 'develop' of https://github.com/ravishanigarapu/TM-API i…
ravishanigarapu May 23, 2025
8f00997
null check
ravishanigarapu May 23, 2025
338b0ae
Merge branch 'PSMRI:develop' into develop
ravishanigarapu May 23, 2025
81c0e8b
Added BenRegID in response
ravishanigarapu May 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,15 @@ public String registerBeneficiary(String comingRequest, String Authorization) th

BeneficiaryFlowStatus obj = InputMapper.gson().fromJson(comingRequest, BeneficiaryFlowStatus.class);
if (obj != null && obj.getIsMobile() != null && obj.getIsMobile()) {
response1.setResponse("Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID);
response1.setResponse("Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Consolidate and clean up response message construction
The same concatenation logic is duplicated and missing spaces around "and". Consider building the message once (e.g., via String.format) and reusing it to avoid duplication and improve readability.

Proposed diff:

-    response1.setResponse("Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
+    String msg = String.format(
+        "Beneficiary successfully registered. Beneficiary ID is: %d and BenRegID is: %d",
+        beneficiaryID, beneficiaryRegID);
+    response1.setResponse(msg);
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
response1.setResponse("Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
// Consolidated and cleaned up response message
String msg = String.format(
"Beneficiary successfully registered. Beneficiary ID is: %d and BenRegID is: %d",
beneficiaryID, beneficiaryRegID);
response1.setResponse(msg);
πŸ€– Prompt for AI Agents
In src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java at line
675, the response message concatenation is duplicated and lacks spaces around
"and". Refactor by constructing the full response message once using
String.format or similar, ensuring proper spacing, and then set this message on
the response object to improve readability and avoid duplication.

} else {
int i = commonBenStatusFlowServiceImpl.createBenFlowRecord(comingRequest, beneficiaryRegID,
beneficiaryID);

if (i > 0) {
if (i == 1)
response1.setResponse(
"Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID);
"Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Avoid duplicating identical logic in both branches
This second branch uses the same literal string as above. Extract the response construction into a variable or helper method to DRY up the code.

-    response1.setResponse(
-        "Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
+    response1.setResponse(msg);  // reuse the previously constructed msg
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Beneficiary successfully registered. Beneficiary ID is : " + beneficiaryID +"and BenRegID is : "+beneficiaryRegID);
// instead of inlining the literal twice, build it once as `msg` and reuse it:
response1.setResponse(msg); // reuse the previously constructed msg
πŸ€– Prompt for AI Agents
In src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java at line
683, the same response string literal is duplicated in two branches. To fix
this, extract the response message construction into a single variable or a
helper method before the conditional branches, then reuse that variable or
method call in both places to avoid code duplication and improve
maintainability.

} else {
response1.setError(5000, "Error in registration; please contact administrator");
// log error that beneficiaryID generated but flow part is not
Expand Down
Loading