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>
<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>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>

<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 @@
OutputResponse response = new OutputResponse();
try {
String jwtToken = CookieUtil.getJwtTokenFromCookie(request);
logger.info("Authorization from controller="+ authorization);

Check warning on line 183 in src/main/java/com/iemr/mmu/controller/dataSyncActivity/StartSyncActivity.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Format specifiers should be used instead of string concatenation.

See more on https://sonarcloud.io/project/issues?id=PSMRI_MMU-API&issues=AZrjvL4SydFu3AQM9KET&open=AZrjvL4SydFu3AQM9KET&pullRequest=140

Check warning on line 183 in src/main/java/com/iemr/mmu/controller/dataSyncActivity/StartSyncActivity.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use the built-in formatting to construct this argument.

See more on https://sonarcloud.io/project/issues?id=PSMRI_MMU-API&issues=AZrjvL4SydFu3AQM9KES&open=AZrjvL4SydFu3AQM9KES&pullRequest=140

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")
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