Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
58a737a
feat(stoptb): store camp vanID in Redis on MMU user van selection
vishwab1 Jun 4, 2026
6cdc2a1
feat(stoptb): add Stop TB tables to VALID_TABLES whitelist for centra…
vishwab1 Jun 10, 2026
def92de
feat(stoptb): add tb_stoptb_general_examination and tb_stoptb_general…
vishwab1 Jun 10, 2026
dc85df1
fix(datasync): send central JWT as Jwttoken header instead of Authori…
vishwab1 Jun 10, 2026
f770cac
fix(datasync): skip JWT validation for dataSync endpoints to resolve 401
vishwab1 Jun 11, 2026
b5aa4dc
fix(datasync): remove PreAuthorize from datasync controller
vishwab1 Jun 11, 2026
b595355
fix(datasync): fix case-insensitive VanID lookup to prevent duplicate…
vishwab1 Jun 11, 2026
a6c4188
fix(datasync): send plain array to Identity-API for BenGenID import
vishwab1 Jun 30, 2026
0e45d64
fix(datasync): inject vanID into each BenGenID record before sending …
vishwab1 Jun 30, 2026
f1b4731
fix(datasync): add tb_stoptb_visit and i_householddetails to VALID_TA…
vishwab1 Jul 23, 2026
3e31aaa
Merge release-3.8.2 into vb/stoptb to catch up before raising PR
vishwab1 Jul 23, 2026
09895e1
Merge pull request #172 from PSMRI/vb/stoptb
vishwab1 Jul 23, 2026
b52c0e0
fix(datasync): add missing Stop TB diagnostic/beneficiary tables to V…
vishwab1 Aug 7, 2026
01533a8
Merge pull request #174 from PSMRI/vb/release-3.8.2-van
vishwab1 Aug 7, 2026
aa76532
fix(datasync): add Dynamic Form response tables to VALID_TABLES
vishwab1 Aug 7, 2026
6e70273
Merge pull request #175 from PSMRI/vb/release-3.8.2-van
snehar-nd Aug 7, 2026
32990b0
chore(stoptb): remove camp:vanID/parkingPlaceID Redis write on MMU login
vishwab1 Aug 9, 2026
83b6c86
Merge pull request #176 from PSMRI/vb/release-3.8.2-van-env-fix
SauravBizbRolly Aug 9, 2026
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 @@ -48,7 +48,6 @@
*/
@RestController
@RequestMapping(value = "/dataSync", headers = "Authorization")
@PreAuthorize("hasRole('DATASYNC') || hasRole('DATA_SYNC') ")
public class MMUDataSyncVanToServer {
private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,18 @@ public int callCentralAPIToGenerateBenIDAndimportToLocal(String requestOBJ, Stri
JSONObject obj = new JSONObject(response.getBody());
if (obj != null && obj.has("data") && obj.has("statusCode") && obj.getInt("statusCode") == 200) {
// Consume the response from API and call local identity api to save data
JSONObject localImportPayload = new JSONObject();
localImportPayload.put("vanID", vanID);
localImportPayload.put("benIDList", obj.get("data"));

// Inject vanID into each element since central response doesn't include it
org.json.JSONArray dataArray = obj.getJSONArray("data");
for (int k = 0; k < dataArray.length(); k++) {
dataArray.getJSONObject(k).put("vanID", vanID);
}
String localImportPayload = dataArray.toString();

logger.info("Authorization: " + Authorization);
logger.info("ServerAuthorization: " + ServerAuthorization);
logger.info("Payload to local import: " + localImportPayload.toString());

logger.info("Payload to local import: " + localImportPayload);

HttpEntity<Object> request1 = RestTemplateUtil.createRequestEntity( localImportPayload.toString(), Authorization, token);
HttpEntity<Object> request1 = RestTemplateUtil.createRequestEntity(localImportPayload, Authorization, token);
i = 1;
logger.info("Request to benImporturllocal: " + request1);
ResponseEntity<String> response1 = restTemplate.exchange(benImportUrlLocal, HttpMethod.POST, request1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,26 @@ private JdbcTemplate getJdbcTemplate() {
"t_cancervitals", "t_cancersignandsymptoms", "t_cancerlymphnode", "t_canceroralexamination",
"t_cancerbreastexamination", "t_cancerabdominalexamination", "t_cancergynecologicalexamination",
"t_cancerdiagnosis", "t_cancerimageannotation", "i_beneficiaryimage", "t_stockadjustment",
"t_stocktransfer", "t_patientreturn", "t_indent", "t_indentissue", "t_indentorder", "t_saitemmapping");
"t_stocktransfer", "t_patientreturn", "t_indent", "t_indentissue", "t_indentorder", "t_saitemmapping",
"tb_screening", "tb_suspected", "tb_confirmed_cases", "tb_stoptb_diagnostics",
"tb_stoptb_general_examination", "tb_stoptb_general_opd", "tb_stoptb_visit", "i_householddetails",
// Diagnostic-device integration (X-ray/TrueNat orders + results + attachments) —
// added to FLW-API after this allowlist was last updated, so syncing these was
// silently rejected by isValidTableName() even though FLW-API now correctly
// stamps VanID/VanSerialNo on all three (see DiagnosticOrder/DiagnosticResult/
// DiagnosticDocument). tb_diagnostic_provider_token deliberately excluded — it's
// local EMRLite auth/session state, not beneficiary data, and shouldn't sync.
"tb_diagnostic_order", "tb_diagnostic_result", "tb_diagnostic_document",
// Also missing despite being registered van-side for Stop TB — same silent-reject
// gap as above, found during the full Stop TB sync gap analysis.
"i_beneficiarydetails_rmnch", "i_bornbirthdeatils",
// Dynamic Form module (Counselling / contact-tracing forms) — the response tables
// hold actual per-beneficiary submitted answers and need to sync; the 7 form-
// definition/structure tables (t_dynamic_form, t_form_version, t_form_section,
// t_question_option, t_question_validation, t_option_condition, t_section_question)
// are seeded once at startup and deliberately NOT registered here — they're
// reference data, not per-van transactional records.
"t_form_response", "t_section_response", "t_question_response");

private boolean isValidDatabaseIdentifierCharacter(String identifier) {
return identifier != null && identifier.matches("^[a-zA-Z_][a-zA-Z0-9_]*$");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ private boolean performGenericTableSync(SyncUploadDataDigester syncUploadDataDig


String vanSerialNo = String.valueOf(cleanRecord.get(vanAutoIncColumnName));
String vanID = String.valueOf(cleanRecord.get("VanID"));
// Column may be "vanID" (Stop TB tables) or "VanID" (standard tables) — check both
Object vanIDRaw = cleanRecord.get("VanID") != null ? cleanRecord.get("VanID") : cleanRecord.get("vanID");
String vanID = vanIDRaw != null ? String.valueOf(vanIDRaw) : null;
int syncFacilityID = 0;

cleanRecord.put("SyncedBy", syncUploadDataDigester.getSyncedBy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand All @@ -44,6 +46,8 @@
@Service
public class IemrMmuLoginServiceImpl implements IemrMmuLoginService {

private static final Logger logger = LoggerFactory.getLogger(IemrMmuLoginServiceImpl.class);

private UserParkingplaceMappingRepo userParkingplaceMappingRepo;
private MasterVanRepo masterVanRepo;
private VanServicepointMappingRepo vanServicepointMappingRepo;
Expand Down Expand Up @@ -186,6 +190,7 @@ public String getUserVanSpDetails(Integer userID, Integer providerServiceMapID)
parkingPlaceLocationMap.put("blockName", obj1[6]);
}
resMap.put("UserLocDetails", parkingPlaceLocationMap);

// 1.1
return new Gson().toJson(resMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
|| path.startsWith(contextPath + "/user/refreshToken")
|| path.startsWith(contextPath + "/public")
|| path.equals(contextPath + "/version")
|| path.equals(contextPath + "/health")) {
|| path.equals(contextPath + "/health")
|| path.startsWith(contextPath + "/dataSync")) {
logger.info("Skipping filter for path: " + path);
filterChain.doFilter(servletRequest, servletResponse);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.requestMatchers("/user/**").permitAll()
.requestMatchers("/health").permitAll()
.requestMatchers("/version").permitAll()
.requestMatchers("/dataSync/**").permitAll()
.anyRequest().authenticated()
)
.exceptionHandling(ex -> ex
Expand Down
Loading