Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
25f0908
Update version in pom.xml to 3.4.0
5Amogh Jul 21, 2025
01b10ca
Update pom.xml
5Amogh Jul 21, 2025
3051876
FLW mobile app API changes and flw high risk chanhes in worklist (#147)
ravishanigarapu Jul 25, 2025
4a07458
fix: fixed the doctor master data institue name (#148)
vishwab1 Jul 30, 2025
26a4efd
Merge remote-tracking branch 'origin/main' into release-3.4.0-temp
vishwab1 Aug 14, 2025
be97639
Merge pull request #154 from PSMRI/release-3.4.0-temp
drtechie Aug 18, 2025
bc3076d
api for getcbac data list
SauravBizbRolly Sep 22, 2025
5fdfe73
AMM-1844
ravishanigarapu Sep 22, 2025
1d33564
version change
ravishanigarapu Sep 22, 2025
5b0c5b4
externalInvestigation added
ravishanigarapu Sep 22, 2025
965c0b7
Merge pull request #158 from PSMRI/feature/api_cbac_details
SauravBizbRolly Sep 23, 2025
721c0a5
coderabbit comments addressed
ravishanigarapu Sep 23, 2025
26f64c7
Merge pull request #157 from PSMRI/feature/amm-1844
SauravBizbRolly Sep 23, 2025
6b9990f
api for getcbac data list
SauravBizbRolly Sep 23, 2025
cdc68f9
api for getcbac data list
SauravBizbRolly Sep 23, 2025
9a61653
Merge pull request #159 from PSMRI/bug/fix_issue_cbac_details
SauravBizbRolly Sep 23, 2025
b5a4fd0
add column in cbac getails
SauravBizbRolly Sep 26, 2025
ffd1896
Merge pull request #160 from PSMRI/feature_add_column_cbac_details
SauravBizbRolly Sep 26, 2025
6224913
add column in cbac getails
SauravBizbRolly Sep 26, 2025
32b47a0
Merge pull request #161 from PSMRI/feature_add_column_cbac_details_fix
SauravBizbRolly Sep 26, 2025
727dc59
add column in cbac getails
SauravBizbRolly Sep 26, 2025
dfcd0cf
Merge pull request #162 from PSMRI/feature/add_column_score
SauravBizbRolly Sep 26, 2025
7caf8cb
add column in cbac getails
SauravBizbRolly Sep 26, 2025
f96cb30
Merge pull request #163 from PSMRI/feature/remove_duplicate_column
SauravBizbRolly Sep 26, 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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.iemr.hwc</groupId>
<artifactId>hwc-api</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<packaging>war</packaging>

<name>HWC-API</name>
Expand Down Expand Up @@ -490,4 +490,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

import io.swagger.v3.oas.annotations.Operation;

import java.util.Map;

/**
*
* @Objective Saving NCD Screening nurse data.
Expand Down Expand Up @@ -386,6 +388,33 @@ public String getCbacDetails(
return response.toStringWithSerializeNulls();
}

@Operation(summary = "Get NCD screening beneficiary CBAC details")
@PostMapping(value = { "/getByUserCbacDetails" })
public String getByUserCbacDetails(
@RequestBody Map<String, String> requestBody) {



OutputResponse response = new OutputResponse();
try {
String createdBy = requestBody.get("createdBy");

if (createdBy == null || createdBy.isEmpty()) {
response.setError(400, "createdBy' is required in request body");

}
if (createdBy==null)
throw new IEMRException("invalid user");
String screeningDetails = ncdScreeningService.getCbacData(createdBy);
response.setResponse(screeningDetails);
} catch (Exception e) {
response.setError(500, "Error while getting captured CBAC data ");
logger.error("Error while getting captured CBAC data :" + e);
}
return response.toStringWithSerializeNulls();
}
Comment on lines +391 to +415
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve validation and error handling logic.

The current implementation has several issues:

  1. Redundant validation: Lines 402-405 set an error but don't return, allowing execution to continue
  2. Ineffective null check: Line 406-407 will never execute because createdBy was already validated above
  3. Inconsistent error codes: Using both 400 and 500 for similar validation scenarios

Apply this diff to fix the validation logic:

 		try {
 			String createdBy = requestBody.get("createdBy");
 
-			if (createdBy == null || createdBy.isEmpty()) {
-				response.setError(400, "createdBy' is required in request body");
-
-			}
-			if (createdBy==null)
-				throw new IEMRException("invalid user");
+			if (createdBy == null || createdBy.isEmpty()) {
+				throw new IEMRException("'createdBy' is required in request body");
+			}
+			
 			String screeningDetails = ncdScreeningService.getCbacData(createdBy);
 			response.setResponse(screeningDetails);
 		} catch (Exception e) {
-			response.setError(500, "Error while getting captured CBAC data ");
+			response.setError(5000, "Error while getting captured CBAC data ");
 			logger.error("Error while getting captured CBAC data :" + e);
 		}
πŸ“ 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
@Operation(summary = "Get NCD screening beneficiary CBAC details")
@PostMapping(value = { "/getByUserCbacDetails" })
public String getByUserCbacDetails(
@RequestBody Map<String, String> requestBody) {
OutputResponse response = new OutputResponse();
try {
String createdBy = requestBody.get("createdBy");
if (createdBy == null || createdBy.isEmpty()) {
response.setError(400, "createdBy' is required in request body");
}
if (createdBy==null)
throw new IEMRException("invalid user");
String screeningDetails = ncdScreeningService.getCbacData(createdBy);
response.setResponse(screeningDetails);
} catch (Exception e) {
response.setError(500, "Error while getting captured CBAC data ");
logger.error("Error while getting captured CBAC data :" + e);
}
return response.toStringWithSerializeNulls();
}
@Operation(summary = "Get NCD screening beneficiary CBAC details")
@PostMapping(value = { "/getByUserCbacDetails" })
public String getByUserCbacDetails(
@RequestBody Map<String, String> requestBody) {
OutputResponse response = new OutputResponse();
try {
String createdBy = requestBody.get("createdBy");
if (createdBy == null || createdBy.isEmpty()) {
throw new IEMRException("'createdBy' is required in request body");
}
String screeningDetails = ncdScreeningService.getCbacData(createdBy);
response.setResponse(screeningDetails);
} catch (Exception e) {
response.setError(5000, "Error while getting captured CBAC data ");
logger.error("Error while getting captured CBAC data :" + e);
}
return response.toStringWithSerializeNulls();
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/hwc/controller/ncdscreening/NCDScreeningController.java
around lines 391 to 415, the request validation and error handling for createdBy
is flawed: remove the redundant/ineffective null check and ensure you return
immediately with a 400 response when createdBy is missing or empty (do not
continue execution), only call ncdScreeningService.getCbacData(createdBy) when
createdBy is valid, and use consistent error codes (400 for client validation
errors); in the catch block keep a 500 response but include the exception
details in the logger message for diagnostics.



/**
*
* @param requestObj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,19 @@ public String updateGeolocationVillage(@RequestBody String requestObj) {
public ResponseEntity<String> getOutreachMasterForState(@PathVariable("stateID") Integer stateID) {
logger.info("get Outreach programs for state with Id ..." + stateID);

OutputResponse outputResponse = new OutputResponse();
OutputResponse response = new OutputResponse();
HttpStatus statusCode = HttpStatus.OK;
MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
headers.add("Content-Type", "application/json");

try {
String resList = locationServiceImpl.getOutreachProgramsList(stateID);
outputResponse.setResponse(resList);
response.setResponse(resList);
} catch (Exception e) {
logger.error("Error while fetching outreach list for stateId" + stateID);
response.setError(500, "Unable to fetch outreach list for stateId" + stateID + "Exception - " + e);
statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
}
return new ResponseEntity<>(outputResponse.toStringWithSerializeNulls(), headers, statusCode);
return new ResponseEntity<>(response.toStringWithSerializeNulls(), headers, statusCode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ public class WrapperBenInvestigationANC {
private Integer parkingPlaceID;

private ArrayList<LabTestOrderDetail> laboratoryList;

private String[] counsellingProvidedList;

public String[] getCounsellingProvidedList() {
return counsellingProvidedList;
}

public void setCounsellingProvidedList(String[] counsellingProvidedList) {
this.counsellingProvidedList = counsellingProvidedList;
}

public WrapperBenInvestigationANC() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.Expose;
import com.iemr.hwc.annotation.sqlInjectionSafe.SQLInjectionSafe;
import com.iemr.hwc.data.login.MasterVan;
import com.iemr.hwc.data.masterdata.registrar.GenderMaster;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -36,11 +41,6 @@
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

import com.google.gson.annotations.Expose;
import com.iemr.hwc.annotation.sqlInjectionSafe.SQLInjectionSafe;
import com.iemr.hwc.data.login.MasterVan;
import com.iemr.hwc.data.masterdata.registrar.GenderMaster;

/***
*
* @author NE298657
Expand Down Expand Up @@ -296,6 +296,19 @@ public class BeneficiaryFlowStatus {
@Column(name = "referred_visit_id")
private Long referred_visit_id;


@Transient
Boolean is_high_risk;


public Boolean isIs_high_risk() {
return is_high_risk;
}

public void setIs_high_risk(boolean is_high_risk) {
this.is_high_risk = is_high_risk;
}
Comment on lines +304 to +310
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix naming convention and method signature issues.

The getter method name isIs_high_risk() is unconventional and confusing. Additionally, the setter method parameter is a primitive boolean while the field is Boolean (nullable), which could lead to auto-boxing issues and prevents setting the field to null.

Apply this diff to fix the naming and type consistency:

-public Boolean isIs_high_risk() {
+public Boolean getIs_high_risk() {
    return is_high_risk;
}

-public void setIs_high_risk(boolean is_high_risk) {
+public void setIs_high_risk(Boolean is_high_risk) {
    this.is_high_risk = is_high_risk;
}
πŸ“ 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
public Boolean isIs_high_risk() {
return is_high_risk;
}
public void setIs_high_risk(boolean is_high_risk) {
this.is_high_risk = is_high_risk;
}
public Boolean getIs_high_risk() {
return is_high_risk;
}
public void setIs_high_risk(Boolean is_high_risk) {
this.is_high_risk = is_high_risk;
}
πŸ€– Prompt for AI Agents
In src/main/java/com/iemr/hwc/data/benFlowStatus/BeneficiaryFlowStatus.java
around lines 304-310, the getter name isIs_high_risk() is unconventional and the
setter uses a primitive boolean while the field is a nullable Boolean; rename
the getter to getIs_high_risk() (or a camelCase equivalent like
isHighRisk/getHighRisk consistently across the class) and change the setter
signature to accept a java.lang.Boolean parameter so the field can be set to
null without boxing issues.


@Transient
private I_bendemographics i_bendemographics;
@Transient
Expand Down
Loading