Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a3a8079
Fix the issue in retrieving the Casesheet Print Data for Cancer Scree…
vanitha1822 Jul 16, 2025
458af67
fix: add the column for NumberperWeek to store and fetch the data (#94)
vanitha1822 Jul 16, 2025
cd5cffb
Update version in pom.xml to 3.4.0
5Amogh Jul 21, 2025
16c3991
chore: add Lombok @Data to BenClinicalObservations (#97)
vanitha1822 Jul 21, 2025
b66035c
fix: add file path in cancer gynecological examination (#98)
vanitha1822 Jul 25, 2025
d878d4b
Fix the data sync issue (#93)
vanitha1822 Jul 30, 2025
2b7f4c3
fix: add functionality to save the file ID's uploaded from doctor scr…
vanitha1822 Jul 30, 2025
1aadead
story: amm-1668 task - 1754
5Amogh Jul 31, 2025
e50c0e9
Merge pull request #101 from PSMRI/amo-3.4
5Amogh Jul 31, 2025
ea84964
story: amm-1754 updated response including father name and phone no o…
5Amogh Aug 1, 2025
e1d6ece
Save the files uploaded from Doctor Screen (#100)
vanitha1822 Aug 1, 2025
690e358
fix: cherry-pick the commits from develop
vanitha1822 Aug 5, 2025
b384bc5
fix: cherry-pick commits from develop
vanitha1822 Jul 1, 2025
9571a35
Fix the Download Masters issue (#103)
vanitha1822 Aug 5, 2025
3d3ce58
fix: remove the validation (#105)
vanitha1822 Aug 6, 2025
4c85e25
fix: replace the old working code (#106)
vanitha1822 Aug 6, 2025
9c97e6d
Fix the datasync upload issue (#107)
vanitha1822 Aug 8, 2025
43df9cf
Fixing the datasync from local to central (#110)
vanitha1822 Aug 10, 2025
2828fe6
fix: remove the token for server authorization (#111)
vanitha1822 Aug 11, 2025
604bd64
Fix the datasync Demographics Issue (#112)
vanitha1822 Aug 14, 2025
62a5a18
Fix the token issue for Ben-gen id generation (#114)
vanitha1822 Aug 19, 2025
d592f6a
fix: replace authorization for local api call (#116)
vanitha1822 Aug 20, 2025
26bf74c
fix: add logs (#117)
vanitha1822 Aug 20, 2025
9f7fb1c
Fix the BenGen ID Issue (#118)
vanitha1822 Aug 22, 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
33 changes: 24 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.mmu</groupId>
<artifactId>mmu-api</artifactId>
<version>3.1.0</version>
<version>3.4.0</version>
<packaging>war</packaging>

<name>MMU-API</name>
Expand Down Expand Up @@ -47,12 +47,22 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<!-- <exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</exclusions> -->
</dependency>
Comment on lines +50 to +56
Copy link

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Re-enabling Spring Boot default logging while adding slf4j-simple will cause multiple SLF4J bindings

With spring-boot-starter-logging active (Logback binding), adding slf4j-simple introduces two bindings and noisy runtime warnings. Prefer keeping Boot’s Logback (especially since logback-ecs-encoder is used) and remove slf4j-simple.

Apply the diffs below (also removes duplicate slf4j blocks later):

   <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter</artifactId>
-    <!-- <exclusions>
-      <exclusion>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-logging</artifactId>
-      </exclusion>
-    </exclusions> -->
   </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>${slf4j.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>${slf4j.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>${slf4j.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>${slf4j.version}</version>
-    </dependency>

If you truly need to override the binding, exclude spring-boot-starter-logging from all starters and add a single SLF4J binding β€” but that would break logback-ecs-encoder usage.

Search for multiple SLF4J bindings and the presence of slf4j.version property:


🏁 Script executed:

#!/bin/bash
rg -n "slf4j-simple|logback-classic|slf4j.version" -C2 pom.xml

Length of output: 689


Remove duplicate SLF4J bindings and rely on Spring Boot’s Logback

To avoid multiple SLF4J bindings (Logback + slf4j-simple) and the resulting runtime warnings, remove your explicit SLF4J dependencies and let Spring Boot’s default starter-logging (Logback + logback-ecs-encoder) handle logging. Based on the grep output, you’ve declared two identical blocks of slf4j-api + slf4j-simple (around lines 58–66 and 177–185), and you also have a commented-out <exclusions> block under spring-boot-starter (lines 50–56).

Please apply the following diffs to pom.xml:

--- a/pom.xml
+++ b/pom.xml
@@ -50,9 +50,6 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter</artifactId>
-			<!-- <exclusions>
-				<exclusion>
-					<groupId>org.springframework.boot</groupId>
-					<artifactId>spring-boot-starter-logging</artifactId>
-				</exclusion>
-			</exclusions> -->
 		</dependency>
--- a/pom.xml
+++ b/pom.xml
@@ -56,11 +56,3 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
 			<version>${slf4j.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-			<version>${slf4j.version}</version>
-		</dependency>
--- a/pom.xml
+++ b/pom.xml
@@ -177,11 +177,3 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
 			<version>${slf4j.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-			<version>${slf4j.version}</version>
-		</dependency>

After this change, only Logback (via spring-boot-starter-logging) will serve as the SLF4J binding, eliminating duplicate bindings and preserving logback-ecs-encoder functionality.

Committable suggestion skipped: line range outside the PR's diff.

πŸ€– Prompt for AI Agents
In pom.xml around lines 50–56, 58–66 and 177–185: there are two duplicate
explicit slf4j-api + slf4j-simple dependency blocks and a commented-out
exclusions block under spring-boot-starter; remove both slf4j-api/slf4j-simple
dependency sections (the ones around lines 58–66 and 177–185) so slf4j-simple is
no longer on the classpath, and ensure you do not exclude
spring-boot-starter-logging (leave the exclusion commented/removed) so Spring
Boot’s Logback (and logback-ecs-encoder) remains the sole SLF4J binding; finally
scan the POM to confirm no other slf4j-simple declarations remain.

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
Comment on lines +57 to 66
Copy link

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Undefined ${slf4j.version} property

The POM references ${slf4j.version} but no such property is defined locally. Rely on Spring Boot’s dependency management (remove explicit versions) or define the property in .

Minimal change: remove explicit versions and let Boot manage slf4j-api (if you keep it at all):

-  <version>${slf4j.version}</version>

Given Boot already brings slf4j-api transitively, the safest is to remove both slf4j-api and slf4j-simple dependencies entirely.


🏁 Script executed:

#!/bin/bash
rg -n "<slf4j.version>|slf4j.version" pom.xml

Length of output: 217


Fix undefined ${slf4j.version} references in pom.xml

The ${slf4j.version} property is not defined in this POM, resulting in unresolved references at multiple locations. You must either define this property under <properties> or remove the explicit <version> elements to leverage Spring Boot’s dependency management (or remove these dependencies entirely if you rely on Boot’s default logging).

Affected locations:

  • pom.xml line 60 (slf4j-api dependency)
  • pom.xml line 65 (slf4j-simple dependency)
  • pom.xml line 179 (slf4j-api duplicate)
  • pom.xml line 184 (slf4j-simple duplicate)

Suggested fixes:

  1. Remove explicit versions so Boot’s dependency management supplies the correct SLF4J API version (and relies on logback for binding):
--- pom.xml
@@ -58,12 +58,8 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
-            <version>${slf4j.version}</version>
         </dependency>
@@ -177,12 +173,8 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>${slf4j.version}</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
-            <version>${slf4j.version}</version>
         </dependency>
  1. Or define the property in your <properties> section if you require a specific SLF4J version:
<properties>
  <!-- add this (choose an appropriate version) -->
  <slf4j.version>1.7.36</slf4j.version>
</properties>
  1. Alternatively, since Spring Boot’s spring-boot-starter-logging already brings in SLF4J API and logback, you can remove both slf4j-api and slf4j-simple dependencies altogether unless you explicitly need the simple binding.

Please address these changes to avoid build failures and ensure consistent dependency management.

πŸ€– Prompt for AI Agents
In pom.xml around lines 57 to 66 (and duplicates at ~179-184), the pom
references ${slf4j.version} which is undefined and causes unresolved properties;
fix by either removing the explicit <version> elements for slf4j-api and
slf4j-simple so Spring Boot's dependency management supplies the correct SLF4J
version (recommended), or add a concrete slf4j.version property under
<properties> with the desired version, or remove both dependencies entirely if
you rely on spring-boot-starter-logging; apply the same change to the duplicate
entries later in the file to keep consistency.

<dependency>
<groupId>co.elastic.logging</groupId>
Expand Down Expand Up @@ -163,6 +173,17 @@
<artifactId>jackson-datatype-joda</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
Comment on lines +176 to +185
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Duplicate SLF4J dependencies β€” remove to avoid conflicts

This second slf4j-api/slf4j-simple block duplicates the earlier one. Remove both blocks as noted to avoid version skew and binding conflicts.

πŸ€– Prompt for AI Agents
In pom.xml around lines 176 to 185, there are duplicate SLF4J dependency entries
(slf4j-api and slf4j-simple) that replicate earlier declarations; remove this
duplicate block so each SLF4J artifact is declared only once to prevent version
skew and logging binding conflicts, ensuring the remaining single declarations
use the intended ${slf4j.version} property.


<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
Expand All @@ -179,12 +200,6 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.5</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand All @@ -37,8 +36,8 @@
import com.iemr.mmu.service.dataSyncActivity.DownloadDataFromServerImpl;
import com.iemr.mmu.service.dataSyncActivity.DownloadDataFromServerTransactionalImpl;
import com.iemr.mmu.service.dataSyncActivity.UploadDataToServerImpl;
import com.iemr.mmu.utils.response.OutputResponse;
import com.iemr.mmu.utils.CookieUtil;
import com.iemr.mmu.utils.response.OutputResponse;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -181,6 +180,8 @@ public String callCentralAPIToGenerateBenIDAndimportToLocal(@RequestBody String
OutputResponse response = new OutputResponse();
try {
String jwtToken = CookieUtil.getJwtTokenFromCookie(request);
logger.info("Authorization from controller="+ authorization);

Comment on lines +183 to +184
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove/mask Authorization header from logs.

Logging Authorization/JWT leaks credentials into logs. Mask or drop entirely.

- logger.info("Authorization from controller="+ authorization);
+ // Avoid logging secrets. If absolutely necessary, log only a hash or prefix.
+ if (logger.isDebugEnabled()) {
+   logger.debug("Authorization header received (masked)");
+ }
πŸ“ 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
logger.info("Authorization from controller="+ authorization);
// Avoid logging secrets. If absolutely necessary, log only a hash or prefix.
if (logger.isDebugEnabled()) {
logger.debug("Authorization header received (masked)");
}
πŸ€– Prompt for AI Agents
In src/main/java/com/iemr/mmu/controller/dataSyncActivity/StartSyncActivity.java
around lines 183-184, the code logs the full Authorization header which leaks
JWT/credentials; remove logging of the raw header or replace it with a redacted
value (e.g. log only presence or scheme and a short masked token like "Bearer
*****" or keep first N chars then "...[REDACTED]"); update the logger.info call
to never include the raw authorization string and ensure any future logs follow
the same masking pattern.

int i = downloadDataFromServerImpl.callCentralAPIToGenerateBenIDAndimportToLocal(requestOBJ, authorization,
serverAuthorization, jwtToken);
if (i == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
import com.iemr.mmu.service.dataSyncLayerCentral.FetchDownloadDataImpl;
import com.iemr.mmu.service.dataSyncLayerCentral.GetDataFromVanAndSyncToDBImpl;
import com.iemr.mmu.service.dataSyncLayerCentral.GetMasterDataFromCentralForVanImpl;
import com.iemr.mmu.utils.CookieUtil;
import com.iemr.mmu.utils.response.OutputResponse;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletRequest;

/***
* @operation Class used for data sync from van-to-server & server-to-van
Expand All @@ -58,8 +60,9 @@ public class MMUDataSyncVanToServer {
@Operation(summary = "Sync data from van-to-server")
@PostMapping(value = { "/van-to-server" }, consumes = "application/json", produces = "application/json")
public String dataSyncToServer(@RequestBody String requestOBJ,
@RequestHeader(value = "Authorization") String Authorization) {
@RequestHeader(value = "Authorization") String Authorization, HttpServletRequest request) {
OutputResponse response = new OutputResponse();

try {
String s = getDataFromVanAndSyncToDBImpl.syncDataToServer(requestOBJ, Authorization);
if (s != null)
Expand Down
35 changes: 28 additions & 7 deletions src/main/java/com/iemr/mmu/data/anc/BenPersonalHabit.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public class BenPersonalHabit {
@Column(name = "NumberperDay")
private Short numberperDay;

@Expose
@Column(name = "NumberperWeek")
private Short numberperWeek;

@Expose
@Column(name = "TobaccoUseDuration")
private Timestamp tobaccoUseDuration;
Expand Down Expand Up @@ -333,10 +337,18 @@ public Short getNumberperDay() {
return numberperDay;
}

public Short getNumberperWeek() {
return numberperWeek;
}

public void setNumberperDay(Short numberperDay) {
this.numberperDay = numberperDay;
}

public void setNumberperWeek(Short numberperWeek) {
this.numberperWeek = numberperWeek;
}

public Timestamp getTobaccoUseDuration() {
return tobaccoUseDuration;
}
Expand Down Expand Up @@ -579,6 +591,9 @@ public ArrayList<BenPersonalHabit> getPersonalHistory() {
if (null != tobaccoInfo.get("numberperDay")) {
benPersonalHabit.setNumberperDay(new Short(tobaccoInfo.get("numberperDay")));
}
if (null != tobaccoInfo.get("numberperWeek")) {
benPersonalHabit.setNumberperWeek(new Short(tobaccoInfo.get("numberperWeek")));
}
timePeriodUnit = (String) tobaccoInfo.get("durationUnit");

if (null != tobaccoInfo.get("duration")) {
Expand Down Expand Up @@ -634,7 +649,7 @@ public ArrayList<BenPersonalHabit> getPersonalHistory() {
}

public BenPersonalHabit(Date createdDate, String dietaryType, String physicalActivityType, String tobaccoUseStatus,
String tobaccoUseType, String otherTobaccoUseType, Short numberperDay, Date tobaccoUseDuration,
String tobaccoUseType, String otherTobaccoUseType, Short numberperDay, Short numberperWeek, Date tobaccoUseDuration,
Character riskySexualPracticesStatus) {
super();
this.captureDate = createdDate;
Expand All @@ -650,6 +665,8 @@ public BenPersonalHabit(Date createdDate, String dietaryType, String physicalAct
} else if(riskySexualPracticesStatus !=null && riskySexualPracticesStatus == '1') {
this.riskySexualPracticeStatus = "Yes";
}
this.numberperWeek = numberperWeek;

}

public BenPersonalHabit(Date createdDate, String dietaryType, String physicalActivityType,
Expand Down Expand Up @@ -687,7 +704,7 @@ public BenPersonalHabit(Long beneficiaryRegID, Long benVisitID, Integer provider
}

public BenPersonalHabit(String tobaccoUseTypeID, String tobaccoUseType, String otherTobaccoUseType,
Short numberperDay, Timestamp tobaccoUseDuration, String alcoholTypeID, String alcoholType,
Short numberperDay, Short numberperWeek, Timestamp tobaccoUseDuration, String alcoholTypeID, String alcoholType,
String otherAlcoholType, String alcoholIntakeFrequency, String avgAlcoholConsumption,
Timestamp alcoholDuration, Timestamp createdDate, Long visitCode) {
super();
Expand All @@ -704,6 +721,7 @@ public BenPersonalHabit(String tobaccoUseTypeID, String tobaccoUseType, String o
this.alcoholDuration = alcoholDuration;
this.createdDate = createdDate;
this.visitCode = visitCode;
this.numberperWeek = numberperWeek;
}

public static BenPersonalHabit getPersonalDetails(ArrayList<Object[]> personalHistoryDetails) {
Expand All @@ -712,15 +730,15 @@ public static BenPersonalHabit getPersonalDetails(ArrayList<Object[]> personalHi
Object[] obj1 = personalHistoryDetails.get(0);

personalDetails = new BenPersonalHabit((Long) obj1[0], (Long) obj1[1], (Integer) obj1[2], (String) obj1[3],
(String) obj1[4], (String) obj1[5], (String) obj1[11], (Character) obj1[18]);
(String) obj1[4], (String) obj1[5], (String) obj1[12], (Character) obj1[19]);

ArrayList<Map<String, String>> tobaccoList = new ArrayList<Map<String, String>>();
ArrayList<Map<String, String>> alcoholList = new ArrayList<Map<String, String>>();
for (Object[] obj : personalHistoryDetails) {
BenPersonalHabit personalHabits = new BenPersonalHabit((String) obj[6], (String) obj[7],
(String) obj[8], (Short) obj[9], (Timestamp) obj[10], (String) obj[12], (String) obj[13],
(String) obj[14], (String) obj[15], (String) obj[16], (Timestamp) obj[17], (Timestamp) obj[19],
(Long) obj[20]);
(String) obj[8], (Short) obj[9], (Short) obj[10], (Timestamp) obj[11], (String) obj[13], (String) obj[14],
(String) obj[15], (String) obj[16], (String) obj[17], (Timestamp) obj[18], (Timestamp) obj[20],
(Long) obj[21]);

Map<String, Object> timePeriod = null;
// Integer timePeriodAgo = null;
Expand All @@ -732,7 +750,10 @@ public static BenPersonalHabit getPersonalDetails(ArrayList<Object[]> personalHi
if (null != personalHabits.getNumberperDay()) {
tobaccoInfo.put("numberperDay", personalHabits.getNumberperDay().toString());
}

if (null != personalHabits.getNumberperWeek()) {
tobaccoInfo.put("numberperWeek", personalHabits.getNumberperWeek().toString());
}

timePeriod = Utility.convertTimeToWords(personalHabits.getTobaccoUseDuration(),
personalHabits.getCreatedDate());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public BeneficiaryFlowStatus() {
public BeneficiaryFlowStatus(Long benFlowID, Long benRegID, Timestamp visitDate, String benName, String age,
Integer ageVal, Short genderID, String genderName, String villageName, String districtName,
Long beneficiaryID, String servicePoint, String VisitReason, String VisitCategory, Long benVisitID,
Timestamp regDate, Timestamp benVisitDate, Long visitCode, Timestamp consultationDate) {
Timestamp regDate, Timestamp benVisitDate, Long visitCode, Timestamp consultationDate, String fatherName, String preferredPhoneNum) {
this.benFlowID = benFlowID;
this.beneficiaryRegID = benRegID;
this.serviceDate = benVisitDate;
Expand All @@ -344,6 +344,8 @@ public BeneficiaryFlowStatus(Long benFlowID, Long benRegID, Timestamp visitDate,
this.visitCode = visitCode;
this.consultationDate = consultationDate;
this.bloodGroup = null;
this.fatherName = fatherName;
this.preferredPhoneNum = preferredPhoneNum;

}

Expand All @@ -366,7 +368,8 @@ public static BeneficiaryFlowStatus getBeneficiaryFlowStatusForLeftPanel(ArrayLi
(String) objArr[3], (String) objArr[4], (Integer) objArr[5], (Short) objArr[6],
(String) objArr[7], (String) objArr[8], (String) objArr[9], (Long) objArr[10],
(String) objArr[11], (String) objArr[12], (String) objArr[13], (Long) objArr[14],
(Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18]);
(Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18],
(String) objArr[19], (String) objArr[20]);
}
}
return obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
package com.iemr.mmu.data.doctor;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -33,9 +35,14 @@
import jakarta.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.Expose;
import lombok.Data;

import lombok.Data;

@Entity
@Data
@Table(name = "t_cancergynecologicalexamination")
public class CancerGynecologicalExamination {
@Id
Expand Down Expand Up @@ -92,10 +99,19 @@ public class CancerGynecologicalExamination {
@Column(name = "RTIOrSTIDetail")
private String rTIOrSTIDetail;

@Expose
@Transient
@JsonProperty("fileIDs")
private List<String> fileIDs;

@Expose
@Column(name = "FilePath")
private String filePath;

@Expose
@Transient
private ArrayList<Map<String, String>> files;

@Expose
@Column(name = "ExperiencedPostCoitalBleeding")
private Boolean experiencedPostCoitalBleeding;
Expand Down Expand Up @@ -422,4 +438,14 @@ public void setVisitCode(Long visitCode) {
this.visitCode = visitCode;
}


public ArrayList<Map<String, String>> getFiles() {
return files;
}

public void setFiles(ArrayList<Map<String, String>> files) {
this.files = files;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

import com.google.gson.annotations.Expose;

import lombok.Data;

@Entity
@Data
@Table(name = "t_benclinicalobservation")
Comment on lines +37 to 41
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Avoid Lombok @DaTa on JPA entities; it changes equals/hashCode semantics and risks PII in toString.

  • @Data generates equals/hashCode across all fields, which is risky for entities (identity changes post-persist, subtle bugs in Sets/Maps).
  • @Data also generates toString including all fields; this class holds patient data and may leak PII in logs.

Apply this change to narrow Lombok impact:

-import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;

 @Entity
-@Data
+@Getter
+@Setter
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
+@ToString(exclude = {"clinicalObservation","otherSymptoms","otherSymptomsSCTCode","otherSymptomsSCTTerm",
+                     "significantFindings","processed","createdBy","modifiedBy","vehicalNo",
+                     "syncedBy","reservedForChange"})
 @Table(name = "t_benclinicalobservation")

Additionally, explicitly include the primary key in equality to keep entity identity stable:

// Add just above the ID field declaration
@EqualsAndHashCode.Include

I can push a follow-up patch across all entity classes where @Data was introduced to apply a consistent, safe pattern. Want me to do that?

πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/mmu/data/quickConsultation/BenClinicalObservations.java
around lines 37-41, remove the class-level Lombok @Data and replace it with
safer, explicit Lombok annotations: add @Getter, @Setter and @NoArgsConstructor,
add @EqualsAndHashCode(onlyExplicitlyIncluded = true) on the class, and mark the
primary key field with @EqualsAndHashCode.Include immediately above the ID
declaration; do not generate a default toString (omit @ToString) to avoid
logging PII.

public class BenClinicalObservations {
@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public int updateBenFlowStatusTMReferred(@Param("benFlowID") Long benFlowID, @Pa

@Query("SELECT t.benFlowID, t.beneficiaryRegID, t.visitDate, t.benName, t.age, t.ben_age_val, t.genderID, t.genderName, "
+ " t.villageName, t.districtName, t.beneficiaryID, t.servicePointName, t.VisitReason, t.VisitCategory, t.benVisitID, "
+ " t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate FROM BeneficiaryFlowStatus t "
+ " t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate, t.fatherName, t.preferredPhoneNum FROM BeneficiaryFlowStatus t "
+ " Where t.beneficiaryRegID = :benRegID AND t.benFlowID = :benFlowID ")
public ArrayList<Object[]> getBenDetailsForLeftSidePanel(@Param("benRegID") Long benRegID,
@Param("benFlowID") Long benFlowID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface DistrictBlockMasterRepo extends CrudRepository<DistrictBlock, I
@Query(" SELECT blockID, blockName FROM DistrictBlock WHERE districtID = :districtID AND deleted != true ")
public ArrayList<Object[]> getDistrictBlockMaster(@Param("districtID") Integer districtID);

@Query(value = " SELECT distinct StateID, StateName,WorkingDistrictID,WorkingDistrictName,blockid,blockname,villageid,villagename FROM db_iemr.v_userservicerolemapping WHERE UserID = :userId and UserServciceRoleDeleted is false",nativeQuery = true)
@Query(value = " SELECT distinct StateID, StateName,WorkingDistrictID,WorkingDistrictName,blockid,blockname,villageid,villagename FROM v_userservicerolemapping WHERE UserID = :userId and UserServciceRoleDeleted is false",nativeQuery = true)
public List<Object[]> getUserservicerolemapping(@Param("userId") Integer userId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Integer updateBenFlowStatus(@Param("visitFlowStatusFlag") String visitFlo
+ "bvd.reportFilePath,sp.serviceProviderName from BeneficiaryVisitDetail bvd "
+ "INNER JOIN bvd.providerServiceMapping p " + "INNER JOIN p.serviceProvider sp "
+ "WHERE bvd.beneficiaryRegID = :benRegID AND bvd.visitCode = :visitCode ")
public List<Objects[]> getBeneficiaryVisitDetails(@Param("benRegID") Long benRegID,
public List<Object[]> getBeneficiaryVisitDetails(@Param("benRegID") Long benRegID,
@Param("visitCode") Long visitCode);

@Query(" SELECT COUNT(benVisitID) FROM BeneficiaryVisitDetail WHERE beneficiaryRegID = :benRegID GROUP BY beneficiaryRegID ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public interface BenPersonalHabitRepo extends CrudRepository<BenPersonalHabit, I
@Query("select benVisitID from BenPersonalHabit a where a.beneficiaryRegID = :beneficiaryRegID order by benVisitID desc")
public ArrayList<Long> getBenLastVisitID(@Param("beneficiaryRegID") Long beneficiaryRegID);

@Query("select Date(createdDate), dietaryType, physicalActivityType, tobaccoUseStatus, tobaccoUseType, otherTobaccoUseType, numberperDay, "
@Query("select Date(createdDate), dietaryType, physicalActivityType, tobaccoUseStatus, tobaccoUseType, otherTobaccoUseType, numberperDay, numberperWeek, "
+ "Date(tobaccoUseDuration), riskySexualPracticesStatus from BenPersonalHabit a where a.beneficiaryRegID = :beneficiaryRegID "
+ "AND tobaccoUseStatus is not null AND deleted = false order by createdDate DESC")
public ArrayList<Object[]> getBenPersonalTobaccoHabitDetail(@Param("beneficiaryRegID") Long beneficiaryRegID);
Expand All @@ -51,7 +51,7 @@ public interface BenPersonalHabitRepo extends CrudRepository<BenPersonalHabit, I
public ArrayList<Object[]> getBenPersonalAlcoholHabitDetail(@Param("beneficiaryRegID") Long beneficiaryRegID);

@Query(" SELECT beneficiaryRegID, benVisitID, providerServiceMapID, dietaryType, physicalActivityType, tobaccoUseStatus, tobaccoUseTypeID, "
+ "tobaccoUseType, otherTobaccoUseType, numberperDay, tobaccoUseDuration, alcoholIntakeStatus, alcoholTypeID, "
+ "tobaccoUseType, otherTobaccoUseType, numberperDay, numberperWeek, tobaccoUseDuration, alcoholIntakeStatus, alcoholTypeID, "
+ "alcoholType, otherAlcoholType, alcoholIntakeFrequency, avgAlcoholConsumption, alcoholDuration, riskySexualPracticesStatus, createdDate, visitCode "
+ "FROM BenPersonalHabit WHERE beneficiaryRegID = :benRegID AND deleted = false AND visitCode = :visitCode")
public ArrayList<Object[]> getBenPersonalHabitDetail(@Param("benRegID") Long benRegID,
Expand Down
Loading
Loading