Skip to content

Commit 18e89ea

Browse files
vanitha18225Amoghvishwab1
authored
Fix the DataSync with SyncFailureReason (#121)
* Fix the issue in retrieving the Casesheet Print Data for Cancer Screening (#96) * fix: change the return type to object to get the details * fix: remove commented lines * fix: add the column for NumberperWeek to store and fetch the data (#94) * Update version in pom.xml to 3.4.0 * chore: add Lombok @DaTa to BenClinicalObservations (#97) * fix: add file path in cancer gynecological examination (#98) * Fix the data sync issue (#93) * fix: Data Sync batch processing for large data * fix: use parameterized query * fix: revert the updated query * fix: add token if it is missing while calling restTemplate * fix: update the properties * fix: sync group wise * fix: enable logger in pom.xml * fix: coderabbit comments * fix: remove logger and replace the license * fix: remove the logs * fix: resolve code scanning alert * fix: resolve code scanning alert * fix: resolve code scanning alert * fix: resolve code scanning alert * fix: add comment for code violation * fix: use syncuploaddataDigester class to load the deatils * fix: add syncuploaddigestor in implementation file too * fix: sonarcube comments * fix: add functionality to save the file ID's uploaded from doctor screen (#99) * story: amm-1668 task - 1754 * story: amm-1754 updated response including father name and phone no of the beneficiary (#102) * fix: amm-1754 changing the query to get the expected response similar to hwc * fix: amm-1754 compilation error fix * fix: amm-1754 argument issue fix * fix: amm-1754 argument issue fix * fix: amm-1754 argument issue fix * Save the files uploaded from Doctor Screen (#100) * fix: add file path in cancer gynecological examination * fix: save the files uploaded from the doctor portal * fix: get file names in the response of gynecological examination * fix: cherry-pick the commits from develop * fix: cherry-pick commits from develop * Fix the Download Masters issue (#103) * fix: resolve the conflicts * fix: fix the issue in download masters table * fix: remove the validation (#105) * fix: replace the old working code (#106) * Fix the datasync upload issue (#107) * fix: add the schemas * fix: remove logger * fix: revert the old code for repository * Fixing the datasync from local to central (#110) * fix: datasync from local to central * fix: fix the token * fix: remove the token for server authorization (#111) * Fix the datasync Demographics Issue (#112) * fix: remove condition for i_beneficiarydetails * fix: add logs * fix: add logs * fix: remove db_iemr * fix: add log for show column names too * fix: add date-format condition * fix: change valid column name * fix: change valid column name * fix: change valid column name * fix: change valid column name * fix: update insert query * fix: update cleaned column list * fix: date conversion * fix: conversion date-time * fix: add date conversion * fix: logs added * fix: new logger * fix: revert the date condition * fix: revert insert code * fix: revert insert code * fix: date format issue * fix: logs add * fix: log for group and group lsit * fix: clean the code --------- Co-authored-by: vishwab1 <vishwanath@navadhiti.com> * Fix the token issue for Ben-gen id generation (#114) * fix: update server authorization for bengen * fix: update server authorization for bengen * fix: replace authorization for local api call (#116) * fix: add logs (#117) * Fix the BenGen ID Issue (#118) * fix: add logs to check the identity-api * fix: add logs * fix: add logs * fix: add logs * fix: add logs for checking * fix: update the prepare statement * fix: add log * fix: add log * fix: add logs * fix: add Sync Result * fix: add logs * fix: add syncResults * fix: add syncResults * fix: update processed flag * fix: update the response * fix: update the exception block * fix: upload fix * fix: address duplication issue * fix: datasync issue * fix: remove reason and add dataaccess exception * fix: revert the server exception * fix: remove unwanted code * fix: exception message * fix: fix the error message * fix: update the version --------- Co-authored-by: Amoghavarsh <93114621+5Amogh@users.noreply.github.com> Co-authored-by: 5Amogh <amoghavarsh@navadhiti.com> Co-authored-by: vishwab1 <vishwanath@navadhiti.com>
1 parent c35ab71 commit 18e89ea

6 files changed

Lines changed: 775 additions & 390 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.iemr.mmu</groupId>
77
<artifactId>mmu-api</artifactId>
8-
<version>3.4.0</version>
8+
<version>3.4.1</version>
99
<packaging>war</packaging>
1010

1111
<name>MMU-API</name>

src/main/java/com/iemr/mmu/data/doctor/CancerGynecologicalExamination.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import com.google.gson.annotations.Expose;
4040
import lombok.Data;
4141

42-
import lombok.Data;
4342

4443
@Entity
4544
@Data

src/main/java/com/iemr/mmu/service/dataSyncActivity/DataSyncRepository.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,25 @@ public List<Map<String, Object>> getDataForGivenSchemaAndTable(String schema, St
9898
return resultSetList;
9999
}
100100

101-
public int updateProcessedFlagInVan(String schemaName, String tableName, StringBuilder vanSerialNos,
102-
String autoIncreamentColumn, String user) throws Exception {
101+
public int updateProcessedFlagInVan(String schemaName, String tableName, List<String> vanSerialNos,
102+
String autoIncreamentColumn, String user, String status, String reason) throws Exception {
103103
jdbcTemplate = getJdbcTemplate();
104104
String query = "";
105105

106106
logger.info("Updating processed flag in table: " + tableName + " for vanSerialNos: " + vanSerialNos);
107107

108108
if (tableName != null && tableName.toLowerCase().equals("i_ben_flow_outreach")) {
109109
query = "UPDATE " + schemaName + "." + tableName
110-
+ " SET created_date = ? , processed = 'P', SyncedDate = ?, Syncedby = ? "
111-
+ "WHERE " + autoIncreamentColumn + " IN (" + vanSerialNos + ")";
110+
+ " SET created_date = ? , processed = ?, SyncedDate = ?, Syncedby = ? , SyncFailureReason = ? "
111+
+ "WHERE " + autoIncreamentColumn + " IN (" + String.join(",", vanSerialNos) + ")";
112112
} else {
113113
query = "UPDATE " + schemaName + "." + tableName
114-
+ " SET CreatedDate = ? , processed = 'P', SyncedDate = ?, Syncedby = ? "
115-
+ "WHERE " + autoIncreamentColumn + " IN (" + vanSerialNos + ")";
114+
+ " SET CreatedDate = ? , processed = ?, SyncedDate = ?, Syncedby = ? , SyncFailureReason = ? "
115+
+ "WHERE " + autoIncreamentColumn + " IN (" + String.join(",", vanSerialNos) + ")";
116116
}
117117

118118
Timestamp syncedDate = new Timestamp(System.currentTimeMillis());
119-
int updatedRows = jdbcTemplate.update(query, syncedDate, syncedDate, user);
119+
int updatedRows = jdbcTemplate.update(query, syncedDate, status, syncedDate, user, reason);
120120
return updatedRows;
121121

122122
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* AMRIT – Accessible Medical Records via Integrated Technology
3+
* Integrated EHR (Electronic Health Records) Solution
4+
*
5+
* Copyright (C) "Piramal Swasthya Management and Research Institute"
6+
*
7+
* This file is part of AMRIT.
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see https://www.gnu.org/licenses/.
21+
*/
22+
package com.iemr.mmu.service.dataSyncActivity;
23+
24+
import lombok.Data;
25+
26+
@Data
27+
public class SyncResult {
28+
private String schemaName;
29+
private String tableName;
30+
private String vanSerialNo;
31+
private String syncedBy;
32+
private boolean success;
33+
private String reason; // Failure reason if any
34+
35+
// Constructor
36+
public SyncResult(String schemaName, String tableName, String vanSerialNo, String syncedBy, boolean success, String reason) {
37+
this.schemaName = schemaName;
38+
this.tableName = tableName;
39+
this.vanSerialNo = vanSerialNo;
40+
this.syncedBy = syncedBy;
41+
this.success = success;
42+
this.reason = reason;
43+
}
44+
45+
// Getters & setters omitted for brevity
46+
}

0 commit comments

Comments
 (0)