From b40792725544c228665abd58ec7b0226468fb5dc Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Thu, 6 Aug 2026 15:17:08 +0530 Subject: [PATCH 1/6] fix(stoptb): stamp VanSerialNo on i_ben_flow_outreach, require explicit enforce.vanid config - CommonBenStatusFlowServiceImpl.createBenFlowRecord: VanSerialNo was never set anywhere for i_ben_flow_outreach - now set to the row's own BenFlowID after save, matching the convention used elsewhere (e.g. IdentityService.regMap.setVanSerialNo(regMap.getBenRegId())) - RegistrarServiceImpl: remove inline :false default from stoptb.enforce.vanid @Value - every properties file must set this explicitly now, so a forgotten config fails loudly at startup instead of running fail-open Co-Authored-By: Claude Sonnet 5 --- .../CommonBenStatusFlowServiceImpl.java | 15 +++++++++++---- .../service/registrar/RegistrarServiceImpl.java | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java index d905a7a7..144866b2 100644 --- a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java @@ -67,9 +67,14 @@ public int createBenFlowRecord(String requestOBJ, Long beneficiaryRegID, Long be if (beneficiaryRegID != null && beneficiaryID != null && beneficiaryRegID > 0 && beneficiaryID > 0) { objRS = beneficiaryFlowStatusRepo.save(obj); - if (objRS != null) + if (objRS != null) { + // VanSerialNo was never populated for i_ben_flow_outreach — following the + // same convention used elsewhere (VanSerialNo = record's own local PK, e.g. + // IdentityService.regMap.setVanSerialNo(regMap.getBenRegId())). + objRS.setVanSerialNo(objRS.getBenFlowID()); + objRS = beneficiaryFlowStatusRepo.save(objRS); returnOBJ = 1; - else + } else returnOBJ = 0; } else { Calendar cal = Calendar.getInstance(); @@ -85,9 +90,11 @@ public int createBenFlowRecord(String requestOBJ, Long beneficiaryRegID, Long be returnOBJ = 3; } else { objRS = beneficiaryFlowStatusRepo.save(obj); - if (objRS != null) + if (objRS != null) { + objRS.setVanSerialNo(objRS.getBenFlowID()); + objRS = beneficiaryFlowStatusRepo.save(objRS); returnOBJ = 1; - else + } else returnOBJ = 0; } diff --git a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java index 688f3765..7dc4203e 100644 --- a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java @@ -118,8 +118,10 @@ public class RegistrarServiceImpl implements RegistrarService { private LettuceConnectionFactory redisConnectionFactory; // When true, beneficiary registration fails loudly if camp is not configured - // instead of silently registering with vanID unset - @Value("${stoptb.enforce.vanid:false}") + // instead of silently registering with vanID unset. No inline default — every + // properties file must set this explicitly, so a forgotten config fails loudly + // at startup instead of running fail-open. + @Value("${stoptb.enforce.vanid}") private boolean enforceVanID; @Autowired From b1ce2d3bcc5815dc7d882d16885b972f9d0a0ebe Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Thu, 6 Aug 2026 20:55:43 +0530 Subject: [PATCH 2/6] fix(stoptb): resolve district/village names from Nikshay tables, not client text Stop TB's district/village IDs are Nikshay-scoped (m_nikshay_district, m_nikshay_village), not AMRIT's general m_district/m_village numbering. The two ID spaces overlap - e.g. ID 1 means 'Nicobars' in m_district but 'Alluri Sitharama Raju' in m_nikshay_district - and i_ben_flow_outreach previously just stored whatever district/village name text the client sent verbatim, with no server-side validation. Observed live: two beneficiaries in the same actual village had different district/village text stored for the same numeric IDs. Gated on countNikshayMappedUsersForPSM() so only PSMs actually mapped to a Nikshay TU go through this resolution - every other program (ANC/NCD/ cancer-screening/teleconsultation/etc.) sharing this same BenFlowStatus code path is unaffected and keeps using client-sent text exactly as before, since their IDs are already correctly AMRIT-scoped. Co-Authored-By: Claude Sonnet 5 --- .../BeneficiaryFlowStatusRepo.java | 26 ++++++++++++++ .../CommonBenStatusFlowServiceImpl.java | 35 +++++++++++++++++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java b/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java index 579f7631..58b50dc6 100644 --- a/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java +++ b/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java @@ -44,6 +44,32 @@ public interface BeneficiaryFlowStatusRepo extends CrudRepository { + // Targeted update — touches ONLY vanSerialNo. A full-entity save() here would also + // rewrite every other updatable column (e.g. `deleted`, which is insertable=false but + // NOT updatable=false) with whatever stale value the in-memory Java object happens to + // hold, silently clobbering the DB's own DEFAULT for columns never explicitly set. + @Transactional + @Modifying + @Query("UPDATE BeneficiaryFlowStatus t SET t.vanSerialNo = :vanSerialNo WHERE t.benFlowID = :id") + void updateVanSerialNo(@Param("id") Long id, @Param("vanSerialNo") Long vanSerialNo); + + // Stop TB's district/village IDs are Nikshay-scoped, not AMRIT's general m_district/ + // m_village numbering - the two ID spaces overlap (e.g. ID 1 means "Nicobars" in + // m_district but "Alluri Sitharama Raju" in m_nikshay_district), so client-sent text + // for these IDs can silently land on the wrong scheme's name. Gate any Nikshay-table + // resolution on this check first - a PSM with no Nikshay TU mapping is a non-Stop-TB + // program (ANC/NCD/cancer-screening/etc.) and must NOT go through the Nikshay tables. + @Query(value = "SELECT COUNT(*) FROM m_userservicerolemapping " + + "WHERE ProviderServiceMapID = :psmId AND NikshayTUID IS NOT NULL AND Deleted = false LIMIT 1", + nativeQuery = true) + int countNikshayMappedUsersForPSM(@Param("psmId") Integer psmId); + + @Query(value = "SELECT DistrictName FROM m_nikshay_district WHERE NikshayDistrictID = :id", nativeQuery = true) + String getNikshayDistrictName(@Param("id") Integer id); + + @Query(value = "SELECT VillageName FROM m_nikshay_village WHERE NikshayVillageID = :id", nativeQuery = true) + String getNikshayVillageName(@Param("id") Integer id); + // nurse worklist // @Query("SELECT t from BeneficiaryFlowStatus t WHERE (t.nurseFlag = 1 OR t.nurseFlag = 100) AND (t.specialist_flag <> 100 OR t.specialist_flag is null) AND t.deleted = false " // + " AND Date(t.visitDate) = curdate() AND t.providerServiceMapId = :providerServiceMapId " diff --git a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java index 144866b2..a6f9f88c 100644 --- a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java @@ -71,8 +71,11 @@ public int createBenFlowRecord(String requestOBJ, Long beneficiaryRegID, Long be // VanSerialNo was never populated for i_ben_flow_outreach — following the // same convention used elsewhere (VanSerialNo = record's own local PK, e.g. // IdentityService.regMap.setVanSerialNo(regMap.getBenRegId())). - objRS.setVanSerialNo(objRS.getBenFlowID()); - objRS = beneficiaryFlowStatusRepo.save(objRS); + // A full-entity save() here (as this used to do) would also rewrite `deleted` + // (insertable=false but NOT updatable=false) with the in-memory object's never-set + // null, clobbering the DB's own DEFAULT b'0' and making the row invisible to every + // worklist query filtering `deleted = false` — use a targeted UPDATE instead. + beneficiaryFlowStatusRepo.updateVanSerialNo(objRS.getBenFlowID(), objRS.getBenFlowID()); returnOBJ = 1; } else returnOBJ = 0; @@ -161,6 +164,34 @@ private BeneficiaryFlowStatus getBenFlowRecordObj(String requestOBJ, Long benefi if (obj.getI_bendemographics().getDistrictBranchName() != null) obj.setVillageName(obj.getI_bendemographics().getDistrictBranchName()); + // Stop TB's district/village IDs are Nikshay-scoped, not AMRIT's general m_district/ + // m_village numbering - the same numeric ID can mean two different real places + // depending on the scheme, so the client-sent name text can silently be wrong. + // Only override for PSMs actually mapped to a Nikshay TU (i.e. genuinely Stop TB) - + // every other program (ANC/NCD/cancer-screening/etc.) keeps using client-sent text + // as before, since their IDs are correctly AMRIT-scoped already. + try { + if (obj.getProviderServiceMapID() != null + && beneficiaryFlowStatusRepo.countNikshayMappedUsersForPSM(obj.getProviderServiceMapID()) > 0) { + if (obj.getDistrictID() != null) { + String correctDistrictName = beneficiaryFlowStatusRepo.getNikshayDistrictName(obj.getDistrictID()); + if (correctDistrictName != null) { + obj.setDistrictName(correctDistrictName); + } + } + if (obj.getVillageID() != null) { + String correctVillageName = beneficiaryFlowStatusRepo.getNikshayVillageName(obj.getVillageID()); + if (correctVillageName != null) { + obj.setVillageName(correctVillageName); + } + } + } + } catch (Exception e) { + // Never let a Nikshay-name lookup failure block registration - worst case the + // display text stays whatever the client sent, same as before this fix existed. + logger.warn("Nikshay district/village name resolution failed, keeping client-sent text: " + e.getMessage()); + } + if (obj.getI_bendemographics().getServicePointID() != null) obj.setServicePointID(obj.getI_bendemographics().getServicePointID()); if (obj.getI_bendemographics().getServicePointName() != null) From 02dcd01f7d4049881cc51792aea6f4c8075fd996 Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Sun, 9 Aug 2026 11:22:58 +0530 Subject: [PATCH 3/6] fix(stoptb): read vanID from stoptb.van.id property instead of Redis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Redis (camp:vanID) was written once at MMU login and deleted globally, unscoped, on ANY user's logout — a Redis outage or an unrelated user's logout would silently break registration on this camp. Each camp/van already runs its own dedicated backend instance, so which van this is never actually changes at runtime. registerBeneficiary() now injects vanID from the new stoptb.van.id property (no inline default, every properties file must set it explicitly, same convention as stoptb.enforce.vanid) instead of an inline Redis lookup. Removed the now-unused RedisConnection/ LettuceConnectionFactory dependency from this class. Scope: vanID only, parkingPlaceID is not part of this change. Co-Authored-By: Claude Sonnet 5 --- src/main/environment/common_ci.properties | 2 ++ src/main/environment/common_docker.properties | 2 ++ .../environment/common_example.properties | 2 ++ .../registrar/RegistrarServiceImpl.java | 35 ++++++++----------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 8965154b..4d28e591 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -70,6 +70,8 @@ spring.redis.host=@env.REDIS_HOST@ # Stop TB: when true, beneficiary registration fails with an error if camp (vanID) is not configured stoptb.enforce.vanid=@env.STOPTB_ENFORCE_VANID@ +# Stop TB: this deployment's van/camp ID, replacing the old Redis camp:vanID lookup +stoptb.van.id=@env.STOPTB_VAN_ID@ jwt.secret=@env.JWT_SECRET_KEY@ diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index c7f85e37..62c6e890 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -70,6 +70,8 @@ spring.redis.host=${REDIS_HOST} # Stop TB: when true, beneficiary registration fails with an error if camp (vanID) is not configured stoptb.enforce.vanid=${STOPTB_ENFORCE_VANID} +# Stop TB: this deployment's van/camp ID, replacing the old Redis camp:vanID lookup +stoptb.van.id=${STOPTB_VAN_ID} jwt.secret=${JWT_SECRET_KEY} #ELK logging file name diff --git a/src/main/environment/common_example.properties b/src/main/environment/common_example.properties index 5f986124..c7e439a1 100644 --- a/src/main/environment/common_example.properties +++ b/src/main/environment/common_example.properties @@ -72,6 +72,8 @@ spring.redis.host=localhost # Stop TB: when true, beneficiary registration fails with an error if camp (vanID) # is not configured instead of silently registering without it stoptb.enforce.vanid=false +# Stop TB: this deployment's van/camp ID, replacing the old Redis camp:vanID lookup +stoptb.van.id=0 jwt.secret=my-32-character-ultra-secure-and-ultra-long-secret logging.path=logs/ diff --git a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java index 7dc4203e..cb1162d2 100644 --- a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java @@ -40,8 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; -import org.springframework.data.redis.connection.RedisConnection; -import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; @@ -114,8 +112,15 @@ public class RegistrarServiceImpl implements RegistrarService { @Autowired private CookieUtil cookieUtil; - @Autowired - private LettuceConnectionFactory redisConnectionFactory; + // This deployment's van/camp ID. Previously looked up from Redis ("camp:vanID"), + // written at MMU login and deleted (globally, unscoped) on ANY user's logout — a Redis + // outage or an unrelated user's logout would silently break registration on this camp. + // Each camp/van already runs its own dedicated backend instance, so which van this is + // never actually changes at runtime; reading it from properties removes the Redis + // dependency entirely. No inline default — every properties file must set this + // explicitly. Scope: vanID only, parkingPlaceID is not part of this change. + @Value("${stoptb.van.id}") + private int vanID; // When true, beneficiary registration fails loudly if camp is not configured // instead of silently registering with vanID unset. No inline default — every @@ -671,26 +676,16 @@ public String registerBeneficiary(String comingRequest, String Authorization) th Long beneficiaryID = null; Map responseMap = new HashMap<>(); - // Inject correct vanID from Redis (mobile sends vanID=0 as placeholder) - byte[] vanIDBytes = null; - byte[] ppIDBytes = null; - try { - RedisConnection conn = redisConnectionFactory.getConnection(); - vanIDBytes = conn.get("camp:vanID".getBytes()); - ppIDBytes = conn.get("camp:parkingPlaceID".getBytes()); - conn.close(); - } catch (Exception e) { - logger.warn("Camp vanID lookup failed: " + e.getMessage()); - } - if (vanIDBytes != null) { + // Inject configured vanID (mobile sends vanID=0 as placeholder). Previously looked + // up from Redis at request time; now a fixed property of this deployment (see + // vanID field javadoc above). + if (vanID > 0) { JSONObject reqJson = new JSONObject(comingRequest); - reqJson.put("vanID", Integer.parseInt(new String(vanIDBytes))); - if (ppIDBytes != null) - reqJson.put("parkingPlaceID", Integer.parseInt(new String(ppIDBytes))); + reqJson.put("vanID", vanID); comingRequest = reqJson.toString(); } else if (enforceVanID) { throw new Exception( - "Camp not configured: vanID missing. Please select van/service point in MMU before registering beneficiary."); + "Camp not configured: stoptb.van.id is 0. Set stoptb.van.id in this deployment's properties file."); } RestTemplate restTemplate = new RestTemplate(); From fcc80a36ab60b769ef7e1e571b72ace9a82ec6b3 Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Mon, 10 Aug 2026 19:32:09 +0530 Subject: [PATCH 4/6] feat(registrar): allow COUNSELLOR role for beneficiary registration - Add hasRole('COUNSELLOR') to registrarBeneficaryRegistrationNew authorization; also fixes a dangling trailing '||' left in the existing @PreAuthorize expression. - Add TRACE diagnostics around benRegID/providerServiceMapID/villageID/ vanID in registerBeneficiary and createBenFlowRecord to verify van ID propagation. Co-Authored-By: Claude Sonnet 5 --- .../tm/controller/registrar/main/RegistrarController.java | 2 +- .../benFlowStatus/CommonBenStatusFlowServiceImpl.java | 4 ++++ .../com/iemr/tm/service/registrar/RegistrarServiceImpl.java | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/iemr/tm/controller/registrar/main/RegistrarController.java b/src/main/java/com/iemr/tm/controller/registrar/main/RegistrarController.java index fe16cb0f..832ef393 100644 --- a/src/main/java/com/iemr/tm/controller/registrar/main/RegistrarController.java +++ b/src/main/java/com/iemr/tm/controller/registrar/main/RegistrarController.java @@ -399,7 +399,7 @@ public String createBeneficiary( // beneficiary registration with common and identity new @Operation(summary = "Register a new beneficiary new API") @PostMapping(value = { "/registrarBeneficaryRegistrationNew" }) - @PreAuthorize("hasRole('NURSE') || hasRole('REGISTRAR') || hasRole('ASHA') || hasRole('VOLUNTEER') || hasRole('REGISTRATION_OFFICER')") + @PreAuthorize("hasRole('NURSE') || hasRole('REGISTRAR') || hasRole('ASHA') || hasRole('VOLUNTEER') || hasRole('REGISTRATION_OFFICER') || hasRole('COUNSELLOR')") public String registrarBeneficaryRegistrationNew(@RequestBody String comingReq, @RequestHeader(value = "Authorization") String Authorization) { String s; diff --git a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java index a6f9f88c..fd923f70 100644 --- a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java @@ -64,6 +64,10 @@ public int createBenFlowRecord(String requestOBJ, Long beneficiaryRegID, Long be int returnOBJ = 0; try { BeneficiaryFlowStatus obj = getBenFlowRecordObj(requestOBJ, beneficiaryRegID, beneficiaryID); + System.out.println("TRACE createBenFlowRecord: benRegID=" + obj.getBeneficiaryRegID() + + " providerServiceMapID=" + obj.getProviderServiceMapID() + + " villageID=" + obj.getVillageID() + + " vanID=" + obj.getVanID()); if (beneficiaryRegID != null && beneficiaryID != null && beneficiaryRegID > 0 && beneficiaryID > 0) { objRS = beneficiaryFlowStatusRepo.save(obj); diff --git a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java index cb1162d2..14d735b9 100644 --- a/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java @@ -707,13 +707,19 @@ public String registerBeneficiary(String comingRequest, String Authorization) th responseMap.put("benRegId", beneficiaryRegID); BeneficiaryFlowStatus obj = InputMapper.gson().fromJson(comingRequest, BeneficiaryFlowStatus.class); + System.out.println("TRACE registerBeneficiary: benRegID=" + beneficiaryRegID + " isMobile=" + + (obj != null ? obj.getIsMobile() : "obj=null") + " providerServiceMapID=" + + (obj != null ? obj.getProviderServiceMapID() : null) + " villageID=" + + (obj != null ? obj.getVillageID() : null)); if (obj != null && obj.getIsMobile() != null && obj.getIsMobile()) { + System.out.println("TRACE registerBeneficiary: isMobile=true branch — createBenFlowRecord SKIPPED, benRegID=" + beneficiaryRegID); responseMap.put("response", "Beneficiary successfully registered. Beneficiary ID is : "+ beneficiaryID+" , BenRegID is : "+beneficiaryRegID); response1.setResponse(new Gson().toJson(responseMap)); } else { int i = commonBenStatusFlowServiceImpl.createBenFlowRecord(comingRequest, beneficiaryRegID, beneficiaryID); + System.out.println("TRACE registerBeneficiary: createBenFlowRecord returned=" + i + " benRegID=" + beneficiaryRegID); if (i > 0) { responseMap.put("response", "Beneficiary successfully registered. Beneficiary ID is : "+ beneficiaryID+" , BenRegID is : "+beneficiaryRegID); From 56c45d568d48fbb2d198691cde7f0fa984717b29 Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Thu, 8 Oct 2026 09:33:46 +0530 Subject: [PATCH 5/6] fix(stoptb): drug list uses the camp van from stoptb.van.id On a Stop TB camp server (stoptb.van.id > 0) the doctor master drug list (itemMaster) is read from the store of the configured van, whatever vanID/facilityID the app sends. Servers with stoptb.van.id=0 keep the current behaviour. Co-Authored-By: Claude Opus 5.5 --- .../common/master/ANCMasterDataServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/iemr/tm/service/common/master/ANCMasterDataServiceImpl.java b/src/main/java/com/iemr/tm/service/common/master/ANCMasterDataServiceImpl.java index 8f5e7136..6312b712 100644 --- a/src/main/java/com/iemr/tm/service/common/master/ANCMasterDataServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/common/master/ANCMasterDataServiceImpl.java @@ -26,6 +26,7 @@ import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.google.gson.Gson; @@ -163,6 +164,10 @@ public class ANCMasterDataServiceImpl { private RouteOfAdminRepo routeOfAdminRepo; private V_DrugPrescriptionRepo v_DrugPrescriptionRepo; + // This deployment's camp van; same property RegistrarServiceImpl uses. 0 = not a camp server. + @Value("${stoptb.van.id}") + private int campVanID; + @Autowired private CovidSymptomsMasterRepo covidSymptomsMasterRepo; @Autowired @@ -560,6 +565,12 @@ public String getCommonDoctorMasterDataForGenopdAncNcdcarePnc(Integer visitCateg NonedlList.get(i).setUnitOfMeasurement(NonedlList.get(i).getUom().getuOMName()); } ArrayList itemList = new ArrayList<>(); + // Stop TB camp: the deployment's van (stoptb.van.id) decides the store, whatever van/facility the + // app sends. Servers without a camp van (stoptb.van.id=0) keep using the request values. + if (campVanID > 0) { + vanID = campVanID; + facilityID = null; + } if (facilityID == null || facilityID <= 0) { Integer fID = masterVanRepo.getFacilityID(vanID); if (fID != null && fID > 0) From dac29b07c1b271175eff3916ccac8187c71cbe51 Mon Sep 17 00:00:00 2001 From: vishwab1 Date: Tue, 20 Oct 2026 10:27:06 +0530 Subject: [PATCH 6/6] chore: set version to 3.12.0 Co-Authored-By: Claude Opus 5.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7075ac9b..8bb278fd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.iemr.tm tm-api - 3.8.3 + 3.12.0 war TM-API