Skip to content

fix incentive issue for production - #243

Merged
vishwab1 merged 4 commits into
release-3.8.1from
bug/incentive_fixes
May 25, 2026
Merged

fix incentive issue for production#243
vishwab1 merged 4 commits into
release-3.8.1from
bug/incentive_fixes

Conversation

@SauravBizbRolly

Copy link
Copy Markdown
Collaborator

📋 Description

JIRA ID:

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

@coderabbitai

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3b216a1-5c10-42ab-b7e7-107e193375e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/incentive_fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vishwab1
vishwab1 merged commit 2dd669e into release-3.8.1May 25, 2026
1 check passed
vishwab1 added a commit that referenced this pull request Jul 14, 2026
* fix DiseaseControl userId issue
* fix DiseaseControl userId issue
* fix DiseaseControl userId issue
* fix eye checkup get list issue
* fix ncd followup incentive issue
* fix ncd followup incentive issue
* fix ncd followup incentive issue
* fix follow up date issue
* fix follow up date issue
* fix merge issue
* fix merge issue
* remove is_default_activity
* remove is_default_activity
* fix index of bound exception
* fix approval status issue
* fix approval status issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix count issue
* fix eye checkup request issue
* fix eye checkup request issue
* fix eye checkup request issue
* fix eye side issue
* fix monthly incentive check issue
* fix monthly incentive check issue
* fix monthly incentive check issue
* fix monthly incentive check issue
* fix incentive issue
* fix incentive issue
* fix asha claimed incentive query
* fix asha claimed incentive query
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix calculation of incentive
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix supervisor name
* Client ID and Client Secret Disclosure (#239)
* fix: client id and client secert key handle in backend
* fix: client id and client secert key handle in backend
* fix: remove hardcoded ABHA credentials and prevent local properties from being committed
- Remove common_local.properties from git tracking (had hardcoded SBX_001542 client id/secret)
- Add common_local.properties to .gitignore to prevent future commits
- Add ABHA token config sample entries to common_example.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add facilityData to getUserDetail response based on user role (#240)
Add FacilityDataService to build facilityData block (location, facilities,
ashaList, totalAshaCount) based on userId and roleName — same logic as
login response. ASHA Supervisor gets mapped ashaList, ASHA gets facility
+ supervisor + peers, CHO/ANM get facilities + ashaList at same facility.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(security): replace extractUsername(token) with DB lookup across FLW-API (#241)
All usages of jwtUtil.extractUsername (which reads PII from JWT sub claim)
replaced with userRepo.getUserNamedByUserId(jwtUtil.extractUserId(token)).
Username is now fetched from DB using userId — token PII not used anywhere
in FLW-API. Affects BeneficiaryService, MaternalHealth, DiseaseControl,
Campaign, IRSRound, SupervisorDashboard.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add mobile and employeeId to peersAtFacility, ashaList and supervisor in facilityData (#242)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* fix incentive issue for production (#243)
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive issue and api response issue
* fix incentive issue and api response issue
* add unclaimed incentive count on dashboard
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix TB suspected incentive
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* fix ifa incentive
* fix For motivating Female sterilization
* fix For motivating Female sterilization
* fix incentive for NCD follow up
* fix pnc related incentive
* fix pnc related incentive
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fixed malaria followup incentive
* fixed malaria followup incentive
* fixed malaria followup incentive
* get ben details using abha ID
* get ben details using abha ID
* fix isDeactivate issue
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* Fix: Handled isDeactivate null values for old data records by defaulting to false. (#246)
* fix motivating couples to maintain at least a two-year gap after marriage before first child
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* fix incentive for Is Paiucd
* add abha govt username and password
* add abha govt username and password
* add abha govt username and password
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* Fix/query issue in userservicerole (#249)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* fix query issue in userService role
* handel duplicate ben record
* Fix/status code in ors ifa (#251)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* change status code
* change status code
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* fix sync issue
* fix sync issue
* fix sync issue
* feature of abha check in our system
* feature of abha check in our system
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix sam get api issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix hbnc incentive
* fix hbnc incentive
* fix hbnc incentive
* Fix/asha profile image issue (#265)
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix pnc incentive
* fix pnc incentive
* fix pnc incentive
* fix vhnd incentive incentive
* fix vhnd incentive incentive
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix cluster meeting incentive error
* fix cluster meeting incentive error
* fix tb incentive
* fix slide test incentive
* Fix/pb mb incentive issue 3.8.2 (#271)
* fix duplicate incentive issue
* fix duplicate incentive issue
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix hbyc incentive logic
* fix hbyc incentive logic
* fix hbyc incentive logic
* optmiz query for incentive logic for hbnc
* optmiz query for incentive logic for hbnc
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
vishwab1 added a commit that referenced this pull request Jul 28, 2026
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix duplicate incentive for mdsr
* fix supervisor name
* Client ID and Client Secret Disclosure (#239)
* fix: client id and client secert key handle in backend
* fix: client id and client secert key handle in backend
* fix: remove hardcoded ABHA credentials and prevent local properties from being committed
- Remove common_local.properties from git tracking (had hardcoded SBX_001542 client id/secret)
- Add common_local.properties to .gitignore to prevent future commits
- Add ABHA token config sample entries to common_example.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add facilityData to getUserDetail response based on user role (#240)
Add FacilityDataService to build facilityData block (location, facilities,
ashaList, totalAshaCount) based on userId and roleName — same logic as
login response. ASHA Supervisor gets mapped ashaList, ASHA gets facility
+ supervisor + peers, CHO/ANM get facilities + ashaList at same facility.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(security): replace extractUsername(token) with DB lookup across FLW-API (#241)
All usages of jwtUtil.extractUsername (which reads PII from JWT sub claim)
replaced with userRepo.getUserNamedByUserId(jwtUtil.extractUserId(token)).
Username is now fetched from DB using userId — token PII not used anywhere
in FLW-API. Affects BeneficiaryService, MaternalHealth, DiseaseControl,
Campaign, IRSRound, SupervisorDashboard.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add mobile and employeeId to peersAtFacility, ashaList and supervisor in facilityData (#242)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* fix incentive issue for production (#243)
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive issue and api response issue
* fix incentive issue and api response issue
* add unclaimed incentive count on dashboard
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix TB suspected incentive
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* fix ifa incentive
* fix For motivating Female sterilization
* fix For motivating Female sterilization
* fix incentive for NCD follow up
* fix pnc related incentive
* fix pnc related incentive
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fixed malaria followup incentive
* fixed malaria followup incentive
* fixed malaria followup incentive
* get ben details using abha ID
* get ben details using abha ID
* fix isDeactivate issue
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* Fix: Handled isDeactivate null values for old data records by defaulting to false. (#246)
* fix motivating couples to maintain at least a two-year gap after marriage before first child
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* fix incentive for Is Paiucd
* add abha govt username and password
* add abha govt username and password
* add abha govt username and password
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* Fix/query issue in userservicerole (#249)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* fix query issue in userService role
* handel duplicate ben record
* Fix/status code in ors ifa (#251)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* change status code
* change status code
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* fix sync issue
* fix sync issue
* fix sync issue
* feature of abha check in our system
* feature of abha check in our system
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix sam get api issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix hbnc incentive
* fix hbnc incentive
* fix hbnc incentive
* Fix/asha profile image issue (#265)
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix pnc incentive
* fix pnc incentive
* fix pnc incentive
* fix vhnd incentive incentive
* fix vhnd incentive incentive
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix cluster meeting incentive error
* fix cluster meeting incentive error
* fix tb incentive
* fix slide test incentive
* Fix/pb mb incentive issue 3.8.2 (#271)
* fix duplicate incentive issue
* fix duplicate incentive issue
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix hbyc incentive logic
* fix hbyc incentive logic
* fix hbyc incentive logic
* optmiz query for incentive logic for hbnc
* optmiz query for incentive logic for hbnc
* Implemetation of in app notification
* fixed hbnc and leprosy incentive (#290)
* fixed hbnc and leprosy incentive (#291)
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* feature of incentive approval and notification
* change base url of notification
* change base url of notification
* change base url of notification
* change base url of notification
* change base url of notification
* change base url of notification
* implement get supervisor id by asha
* implement get supervisor id by asha
* implement get supervisor id by asha
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix supervisor incentive approval status
* fix role issue for supervisor
* fix role issue for supervisor
* fix role issue for supervisor
* fix role issue for supervisor
* fix role issue for supervisor
* fix role issue for supervisor
* fix role issue for supervisor
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* handel approval of incentive for ANM
* fix incentive new logic changes
* fix incentive new logic changes
* fix anc incentive logic
* fix anc incentive logic
* fix anc incentive logic
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
vishwab1 added a commit that referenced this pull request Aug 5, 2026
* Client ID and Client Secret Disclosure (#239)
* fix: client id and client secert key handle in backend
* fix: client id and client secert key handle in backend
* fix: remove hardcoded ABHA credentials and prevent local properties from being committed
- Remove common_local.properties from git tracking (had hardcoded SBX_001542 client id/secret)
- Add common_local.properties to .gitignore to prevent future commits
- Add ABHA token config sample entries to common_example.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add facilityData to getUserDetail response based on user role (#240)
Add FacilityDataService to build facilityData block (location, facilities,
ashaList, totalAshaCount) based on userId and roleName — same logic as
login response. ASHA Supervisor gets mapped ashaList, ASHA gets facility
+ supervisor + peers, CHO/ANM get facilities + ashaList at same facility.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(security): replace extractUsername(token) with DB lookup across FLW-API (#241)
All usages of jwtUtil.extractUsername (which reads PII from JWT sub claim)
replaced with userRepo.getUserNamedByUserId(jwtUtil.extractUserId(token)).
Username is now fetched from DB using userId — token PII not used anywhere
in FLW-API. Affects BeneficiaryService, MaternalHealth, DiseaseControl,
Campaign, IRSRound, SupervisorDashboard.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add mobile and employeeId to peersAtFacility, ashaList and supervisor in facilityData (#242)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* fix incentive issue for production (#243)
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive issue and api response issue
* fix incentive issue and api response issue
* add unclaimed incentive count on dashboard
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix TB suspected incentive
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* fix ifa incentive
* fix For motivating Female sterilization
* fix For motivating Female sterilization
* fix incentive for NCD follow up
* fix pnc related incentive
* fix pnc related incentive
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fixed malaria followup incentive
* fixed malaria followup incentive
* fixed malaria followup incentive
* get ben details using abha ID
* get ben details using abha ID
* fix isDeactivate issue
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* Fix: Handled isDeactivate null values for old data records by defaulting to false. (#246)
* fix motivating couples to maintain at least a two-year gap after marriage before first child
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* fix incentive for Is Paiucd
* add abha govt username and password
* add abha govt username and password
* add abha govt username and password
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* Fix/query issue in userservicerole (#249)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* fix query issue in userService role
* handel duplicate ben record
* Fix/status code in ors ifa (#251)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* change status code
* change status code
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* fix sync issue
* fix sync issue
* fix sync issue
* feature of abha check in our system
* feature of abha check in our system
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix sam get api issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix hbnc incentive
* fix hbnc incentive
* fix hbnc incentive
* Fix/asha profile image issue (#265)
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix pnc incentive
* fix pnc incentive
* fix pnc incentive
* fix vhnd incentive incentive
* fix vhnd incentive incentive
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix cluster meeting incentive error
* fix cluster meeting incentive error
* fix tb incentive
* fix slide test incentive
* Fix/pb mb incentive issue 3.8.2 (#271)
* fix duplicate incentive issue
* fix duplicate incentive issue
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix hbyc incentive logic
* fix hbyc incentive logic
* fix hbyc incentive logic
* optmiz query for incentive logic for hbnc
* optmiz query for incentive logic for hbnc
* fixed hbnc and leprosy incentive (#290)
* fixed hbnc and leprosy incentive (#291)
* Merging 3.8.2 Branch (#294)
* feat(linting): commitlint ,Commitzen, Husky configuration
* feat: added new register api for stoptb
* feat: added new register api for stoptb
* feat: added new api for nurse
* fix: populate workingDistrictId from blockId in getUserDetail when district is null
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: align Stop TB APIs with BRD — village scoping + correct field names
- StopTBGeneralExamination: rewrite with BRD-correct fields (pallorId+pallor
string pairs, pulseRate, randomBloodSugar, oedema, beneficiaryRegID,
keyPopulationRiskFactorIds, hivStatusId — no more boolean clinical signs)
- StopTBRegistration: add villageId + villageName from i_bendemographics.districtBranchID
- StopTBRegistrationDto: add villageId + villageName for worklist requests
- StopTBRegistrationRepo: scope registrar worklist by psmId + villageId
- BenFlowStatusRepo: scope nurse worklist by psmId + villageId
- StopTBGeneralExaminationRepo: rename findByBeneficiaryRegID
- StopTBServiceImpl: extract village from demographics on registration,
set on both tb_stoptb_registration and i_ben_flow_outreach flow record,
fix all BRD field names throughout, add toJsonString for array fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: replace tb_stoptb_registration with BenFlowStatus for registrar worklist and add beneficiary details endpoint
- getRegistrarWorklist now queries i_ben_flow_outreach by villageID + visitCategory instead of tb_stoptb_registration
- add getRegistrarWorklist query to BenFlowStatusRepo
- add getBeneficiaryDetails endpoint that proxies TM-API quickSearchNew and merges otherFields into flat response object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: worklist chnges
* fix: use JwtToken header for getBeneficiaryDetails TM-API call
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use okhttp User-Agent pattern for TM-API call in getBeneficiaryDetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: look up 12-digit beneficiaryID from BenFlowStatus for TM-API quickSearchNew
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: redesign Stop TB worklist to return full beneficiary data in getBeneficiaryData style
- saveRegistration: forward full payload to TM-API without stripping Stop TB/anthropometry
fields — they land in ExtraFields via checkExtraFields; enrich BenFlowStatus with benName,
dob, gender, phone, district extracted from registration payload
- getRegistrarWorklist: returns getBeneficiaryData-style response — BenFlowStatus fields +
db_identity detail (community, education, fatherName, motherName) + otherFields parsed for
anthropometry and Stop TB details (personFrom, caseFindingType, tuId, weight, height, bmi, temp)
- getNurseWorklist: same rich response + generalExamination, tbScreening, generalOpd attached
if already saved (null if not yet captured)
- Remove getRegistration and getBeneficiaryDetails endpoints — worklist covers both
- Add otherFields (ExtraFields column) mapping to RMNCHMBeneficiarydetail entity
- BenFlowStatusRepo worklist queries scoped to psmId + villageId only (visitCategory column
not guaranteed to exist in i_ben_flow_outreach table)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use mapping table two-step lookup to fetch beneficiary details in Stop TB worklist
getDetailByBenRegID queries i_beneficiarydetails.beneficiaryRegID which is unpopulated;
correct path is i_beneficiarymapping → BenDetailsId → i_beneficiarydetails.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: use OutputResponse for all StopTBController endpoints to match AMRIT standard format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Stop TB worklist path and anthropometry to getBeneficiaryData
- Add providerServiceMapID to GetBenRequestHandler for Stop TB filtering
- Add getAddressesByBenRegIds repo query to fetch addresses by benRegId list
- Add Stop TB path in getBenData: filter by providerServiceMapID+villageID via BenFlowStatus
- Parse i_beneficiarydetails.ExtraFields to include anthropometry (weight/height/bmi/temperatureValue) in response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use JOIN query for getAddressesByBenRegIds and accept villageId alias
- Replace subquery with JOIN to fix Hibernate 6 multi-valued binding error
- Add setVillageId setter as alias for villageID in GetBenRequestHandler
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: switch getAddressesByBenRegIds to native SQL to avoid Hibernate 6 IN binding issue
JPQL IN with collection param throws multi-valued binding error in Hibernate 6 — native query bypasses this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use per-row mapping lookup for Stop TB worklist to avoid Hibernate IN binding issue
Replace bulk native query with per-row findByBenRegIdFromMapping + getAddressById calls
— same pattern as existing FLW code, avoids Object[] mapping error from native SELECT *.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add stopTBDetails block (personFrom, caseFindingType, isMobileAvailable, tuId, tuName) to getBeneficiaryData response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add occupation, economicStatus, residentialArea to stopTBDetails in worklist response
- occupation read from i_beneficiarydetails (already stored by Identity-API)
- economicStatus and residentialArea promoted to top-level in registration payload so Identity-API saves them in ExtraFields; read back in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response"
This reverts commit 3695522d5139363e8eba335d6142cb5526af7ec0.
* feat: use tb-prefixed keys for economicStatus and residentialArea to ensure ExtraFields storage
Identity-API ignores unknown processing of economicStatus/residentialArea to DB columns silently;
using tbEconomicStatus/tbResidentialArea as keys ensures they land in ExtraFields and are returned in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: move occupation, economicStatus, residentialArea into beneficiaryDetails object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: read economicStatus and residentialArea directly from ExtraFields (not tb-prefixed keys)
Mobile sends these as top-level fields to TM-API; Identity-API saves them in ExtraFields as-is
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Diagnostics module and Yes/No ID fields across Stop TB nurse flow
- Add StopTBDiagnostics entity, repo, service, and controller (save/get/getAll)
- Add village-scoped getAll (villageID optional) to GeneralExamination, TBScreening, GeneralOpd, Diagnostics via BenFlowStatus subquery
- Fix TBScreening visitDate to accept user-provided date; preserve on update (not editable once submitted)
- Fix referralToHWCNeeded to trust mobile-computed value instead of server recalculating
- Fix chiefComplaint to support multi-select (JSON array)
- Add Yes/No boolean ID counterpart fields to TBScreening (14 fields), GeneralExamination (referralToHWCNeededId), Registration (isMobileAvailableId), and Diagnostics (6 fields)
- Add getTimestamp helper to StopTBServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: accept array of objects in all 4 Stop TB nurse save APIs
generalExamination, tbScreening, generalOpd, and diagnostics save
endpoints now take List<Map> instead of a single Map, allowing bulk
save in one request. Each item is processed within the same transaction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix supervisor name
* fix supervisor name
* fix supervisor name
* add update date on get ben api
* add update date on get ben api
* feat: return updateDate and updatedBy in all Stop TB getAll APIs
- Add lastModDate + modifiedBy fields to TBScreening, TBSuspected,
TBConfirmedCase, MalariaFollowUp entities (columns already exist in DB)
- Set modifiedBy in all save methods across StopTB, TBSuspected,
TBConfirmed, MalariaFollowUp services
- Return updateDate/updatedBy in all 8 getAll API responses so mobile
app can detect and refresh stale local records
- Fix TBConfirmedCase save duplicate bug — now looks up existing record
by benId before inserting new entity
- Add updateDate to getBeneficiaryData response from i_beneficiarydetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: resolve compile errors — move resultMap.put after initialization, add Map import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add chest xray, sputum, NAAT reason fields to StopTB diagnostics
Added isReferredForDigitalChestXray, reasonForDenialChestXray,
reasonNotConductedChestXray, isReferredForSputumCollection,
reasonForDenialSputum, sputumSubmittedAt, reasonNotConductedNaat
and their *Other variants to domain, save, and get map.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add local-to-central sync fields for Stop TB mobile flow
- Add vanID, parkingPlaceID, visitCode, processed, vanSerialNo to all
Stop TB entities (TBScreening, GeneralExamination, GeneralOpd,
Diagnostics, TBSuspected, TBConfirmedCase)
- Add updateVanSerialNo() to all 6 repos for MMU DataSync pattern
- Add CampConfigService to read camp:vanID from Redis (set by MMU login)
- Stamp vanID + processed='N' on every save in StopTBServiceImpl,
TBSuspectedServiceImpl, TBConfirmedCaseServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: make vanID stamping conditional — skip gracefully when camp not configured
When FLW-API is used without a Stop TB camp setup (no MMU login, no
camp:vanID in Redis), getVanID() now returns null instead of throwing.
All save methods guard with vanID != null before stamping, so regular
FLW/ASHA usage is completely unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add stoptb.enforce.vanid flag to fail loudly when camp not configured
CampConfigService.getVanID() previously returned null silently whenever
camp:vanID was missing from Redis, letting Stop TB records save with
vanID=NULL — these then never sync to central since the fetch query
filters on vanID IS NOT NULL. When stoptb.enforce.vanid=true, the save
now throws immediately so the error surfaces to the user instead of
being discovered later as an un-synced record.
* fix(stoptb): correct symptomatic/asymptomatic save and retrieve mapping
Frontend sends a single "symptomatic" Yes/No value, but the DB has two
separate columns (symptomatic, asymptomatic) with swapped semantics.
Yes now stores asymptomatic=Yes (symptomatic=null), No stores
symptomatic=Yes (asymptomatic=null). Retrieval derives the response
"symptomatic" value back from whichever column is Yes, so it always
echoes the original input.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix sync issue
* feat(counselling): implement dynamic form management for TB counselling
Introduces dynamic form definition management with versioning and
response lifecycle support (draft, submit, complete, and bulk sync)
for the TB counselling module.
Includes:
- Dynamic form and response APIs
- QuestionType and ValidationType enums
- TbCounsellingFormSeeder for initial form setup
- JWT-based audit stamping (createdBy/updatedBy)
- SecurityWhitelistConfig for endpoint-level authentication control
* feat(stoptb): add per-visit history to General Examination, TB Screening, OPD, Suspected, Confirmed
Every Stop TB clinical save previously upserted by beneficiaryRegID/benId
alone, so a beneficiary's second camp visit silently overwrote their first
- no history was ever kept. Adds a new tb_stoptb_visit table (mirrors MMU's
t_benvisitdetail visitNo pattern, scoped entirely to Stop TB's own schema)
and a getOrCreateVisitForToday() helper that infers "new visit" purely from
the save date, with no mobile change required.
- New TBStopVisit entity/repo/service: visitNo counting, role-handoff flags
reserved for future Doctor/Counsellor screens, full sync field set
(processed/vanSerialNo/SyncedDate/Syncedby/SyncFailureReason) matching the
existing AMRIT-wide DataSyncRepository convention.
- StopTBGeneralExamination/TBScreening/StopTBGeneralOpd/TBSuspected/
TBConfirmedCase now upsert keyed by (beneficiaryRegID, visitCode) instead
of beneficiaryRegID alone. Reused the existing dormant visitCode column on
4 of 6 tables rather than adding a new one.
- Fixed 4 read methods (getNurseWorklist, getGeneralExamination,
getNurseTBScreening, getGeneralOpd) that would have thrown
NonUniqueResultException once a beneficiary had more than one visit row -
switched to findLatestBy... + PageRequest.of(0,1).
- StopTBDiagnostics deliberately excluded: liquid culture results arrive
40-45 days after the original encounter and must update the same row,
which visit-keying would have broken.
Requires DB migration (not included): CREATE TABLE tb_stoptb_visit, plus
ALTER TABLE tb_suspected/tb_confirmed_cases ADD COLUMN visitCode BIGINT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Merge remote-tracking branch 'origin/vb/stoptb' into vb/stoptb
* chore(local-env): update local datasource/redis/jwt config and add dynamic form schema SQL
Adds manual DDL/seed script for the dynamic form tables since ddl-auto
wasn't creating them in local runs, and syncs local properties with
the values needed to run submitBulk locally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(local-env): keep backup copy of common_local.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* token chnges
* Vb/counselling (#254)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* Vb/counselling (#255)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Vb/counselling (#256)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* fix(user-service): handle empty result from getDistrictByBlockId fallback
Native query result must be mapped to List<Object[]>, not a bare Object[];
the previous signature caused getUserDetail() to silently skip the
workingDistrictId fallback for block-only users.
* Vb/counselling (#257)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
* fix(dynamic-form): default processed to N via @Builder.Default
Lombok @Builder ignores field initializers, so FormResponse,
QuestionResponse, and SectionResponse were inserting NULL into the
processed column instead of the intended "N" default, causing
"Column 'processed' cannot be null" on submitBulk.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#258)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#259)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#261)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): dual-write clinical data to AMRIT standard tables via t_benvisitdetail
- Replace tb_stoptb_visit with t_benvisitdetail (MMU-compatible visitCode formula)
- Dual-write exam data to t_phy_anthropometry, t_phy_vitals, t_Phy_GeneralExam, t_benreferdetails
- Dual-write OPD data to t_benchiefcomplaint, t_prescription, t_prescribeddrug
- Add 6 new JPA entities and repos for standard tables (db_iemr schema)
- Update TBSuspectedServiceImpl and TBConfirmedCaseServiceImpl to use BenVisitDetail
- Fix vanID/parkingPlaceID not being stored in t_form_response, t_section_response, t_question_response
- Delete orphaned TBStopVisit entity and TBStopVisitRepo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#262)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#263)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#264)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* field missing
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query on beneficiaryID, not beneficiaryRegID
TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.beneficiaryID, which
is the correct corresponding column.
* Add debug logging, RMNCH pinCode field, and GPS fallback pinCode mapping
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Vb/counselling (#269)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
* Add a CHECKBOX question type and a TB_COUNSELLING_V2 seeder with a GENERAL_INFO consent gate ahead of the counselling sections.
* Seed single-checkbox questions for Sections A-D and point the Counselled lookup at TB_COUNSELLING_V2 instead of the retired V1 form
* Mark form/section status REFUSED when TB2_GI_Q1=NO on /complete, split getCompletedBeneficiaries into completed/refused lists, and extract FormResponseStatus enum
* Resolved conflicts
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query on beneficiaryID, not beneficiaryRegID
TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.be…
sehjotsinghunthinkable added a commit to sehjotsinghunthinkable/FLW-API that referenced this pull request Aug 5, 2026
* Client ID and Client Secret Disclosure (#239)
* fix: client id and client secert key handle in backend
* fix: client id and client secert key handle in backend
* fix: remove hardcoded ABHA credentials and prevent local properties from being committed
- Remove common_local.properties from git tracking (had hardcoded SBX_001542 client id/secret)
- Add common_local.properties to .gitignore to prevent future commits
- Add ABHA token config sample entries to common_example.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add facilityData to getUserDetail response based on user role (#240)
Add FacilityDataService to build facilityData block (location, facilities,
ashaList, totalAshaCount) based on userId and roleName — same logic as
login response. ASHA Supervisor gets mapped ashaList, ASHA gets facility
+ supervisor + peers, CHO/ANM get facilities + ashaList at same facility.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(security): replace extractUsername(token) with DB lookup across FLW-API (#241)
All usages of jwtUtil.extractUsername (which reads PII from JWT sub claim)
replaced with userRepo.getUserNamedByUserId(jwtUtil.extractUserId(token)).
Username is now fetched from DB using userId — token PII not used anywhere
in FLW-API. Affects BeneficiaryService, MaternalHealth, DiseaseControl,
Campaign, IRSRound, SupervisorDashboard.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add mobile and employeeId to peersAtFacility, ashaList and supervisor in facilityData (#242)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* fix incentive issue for production (#243)
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive issue and api response issue
* fix incentive issue and api response issue
* add unclaimed incentive count on dashboard
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix TB suspected incentive
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* fix ifa incentive
* fix For motivating Female sterilization
* fix For motivating Female sterilization
* fix incentive for NCD follow up
* fix pnc related incentive
* fix pnc related incentive
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fixed malaria followup incentive
* fixed malaria followup incentive
* fixed malaria followup incentive
* get ben details using abha ID
* get ben details using abha ID
* fix isDeactivate issue
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* Fix: Handled isDeactivate null values for old data records by defaulting to false. (#246)
* fix motivating couples to maintain at least a two-year gap after marriage before first child
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* fix incentive for Is Paiucd
* add abha govt username and password
* add abha govt username and password
* add abha govt username and password
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* Fix/query issue in userservicerole (#249)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* fix query issue in userService role
* handel duplicate ben record
* Fix/status code in ors ifa (#251)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* change status code
* change status code
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* fix sync issue
* fix sync issue
* fix sync issue
* feature of abha check in our system
* feature of abha check in our system
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix sam get api issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix hbnc incentive
* fix hbnc incentive
* fix hbnc incentive
* Fix/asha profile image issue (#265)
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix pnc incentive
* fix pnc incentive
* fix pnc incentive
* fix vhnd incentive incentive
* fix vhnd incentive incentive
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix cluster meeting incentive error
* fix cluster meeting incentive error
* fix tb incentive
* fix slide test incentive
* Fix/pb mb incentive issue 3.8.2 (#271)
* fix duplicate incentive issue
* fix duplicate incentive issue
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix hbyc incentive logic
* fix hbyc incentive logic
* fix hbyc incentive logic
* optmiz query for incentive logic for hbnc
* optmiz query for incentive logic for hbnc
* fixed hbnc and leprosy incentive (#290)
* fixed hbnc and leprosy incentive (#291)
* Merging 3.8.2 Branch (#294)
* feat(linting): commitlint ,Commitzen, Husky configuration
* feat: added new register api for stoptb
* feat: added new register api for stoptb
* feat: added new api for nurse
* fix: populate workingDistrictId from blockId in getUserDetail when district is null
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: align Stop TB APIs with BRD — village scoping + correct field names
- StopTBGeneralExamination: rewrite with BRD-correct fields (pallorId+pallor
string pairs, pulseRate, randomBloodSugar, oedema, beneficiaryRegID,
keyPopulationRiskFactorIds, hivStatusId — no more boolean clinical signs)
- StopTBRegistration: add villageId + villageName from i_bendemographics.districtBranchID
- StopTBRegistrationDto: add villageId + villageName for worklist requests
- StopTBRegistrationRepo: scope registrar worklist by psmId + villageId
- BenFlowStatusRepo: scope nurse worklist by psmId + villageId
- StopTBGeneralExaminationRepo: rename findByBeneficiaryRegID
- StopTBServiceImpl: extract village from demographics on registration,
set on both tb_stoptb_registration and i_ben_flow_outreach flow record,
fix all BRD field names throughout, add toJsonString for array fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: replace tb_stoptb_registration with BenFlowStatus for registrar worklist and add beneficiary details endpoint
- getRegistrarWorklist now queries i_ben_flow_outreach by villageID + visitCategory instead of tb_stoptb_registration
- add getRegistrarWorklist query to BenFlowStatusRepo
- add getBeneficiaryDetails endpoint that proxies TM-API quickSearchNew and merges otherFields into flat response object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: worklist chnges
* fix: use JwtToken header for getBeneficiaryDetails TM-API call
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use okhttp User-Agent pattern for TM-API call in getBeneficiaryDetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: look up 12-digit beneficiaryID from BenFlowStatus for TM-API quickSearchNew
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: redesign Stop TB worklist to return full beneficiary data in getBeneficiaryData style
- saveRegistration: forward full payload to TM-API without stripping Stop TB/anthropometry
fields — they land in ExtraFields via checkExtraFields; enrich BenFlowStatus with benName,
dob, gender, phone, district extracted from registration payload
- getRegistrarWorklist: returns getBeneficiaryData-style response — BenFlowStatus fields +
db_identity detail (community, education, fatherName, motherName) + otherFields parsed for
anthropometry and Stop TB details (personFrom, caseFindingType, tuId, weight, height, bmi, temp)
- getNurseWorklist: same rich response + generalExamination, tbScreening, generalOpd attached
if already saved (null if not yet captured)
- Remove getRegistration and getBeneficiaryDetails endpoints — worklist covers both
- Add otherFields (ExtraFields column) mapping to RMNCHMBeneficiarydetail entity
- BenFlowStatusRepo worklist queries scoped to psmId + villageId only (visitCategory column
not guaranteed to exist in i_ben_flow_outreach table)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use mapping table two-step lookup to fetch beneficiary details in Stop TB worklist
getDetailByBenRegID queries i_beneficiarydetails.beneficiaryRegID which is unpopulated;
correct path is i_beneficiarymapping → BenDetailsId → i_beneficiarydetails.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: use OutputResponse for all StopTBController endpoints to match AMRIT standard format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Stop TB worklist path and anthropometry to getBeneficiaryData
- Add providerServiceMapID to GetBenRequestHandler for Stop TB filtering
- Add getAddressesByBenRegIds repo query to fetch addresses by benRegId list
- Add Stop TB path in getBenData: filter by providerServiceMapID+villageID via BenFlowStatus
- Parse i_beneficiarydetails.ExtraFields to include anthropometry (weight/height/bmi/temperatureValue) in response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use JOIN query for getAddressesByBenRegIds and accept villageId alias
- Replace subquery with JOIN to fix Hibernate 6 multi-valued binding error
- Add setVillageId setter as alias for villageID in GetBenRequestHandler
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: switch getAddressesByBenRegIds to native SQL to avoid Hibernate 6 IN binding issue
JPQL IN with collection param throws multi-valued binding error in Hibernate 6 — native query bypasses this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use per-row mapping lookup for Stop TB worklist to avoid Hibernate IN binding issue
Replace bulk native query with per-row findByBenRegIdFromMapping + getAddressById calls
— same pattern as existing FLW code, avoids Object[] mapping error from native SELECT *.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add stopTBDetails block (personFrom, caseFindingType, isMobileAvailable, tuId, tuName) to getBeneficiaryData response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add occupation, economicStatus, residentialArea to stopTBDetails in worklist response
- occupation read from i_beneficiarydetails (already stored by Identity-API)
- economicStatus and residentialArea promoted to top-level in registration payload so Identity-API saves them in ExtraFields; read back in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response"
This reverts commit 3695522d5139363e8eba335d6142cb5526af7ec0.
* feat: use tb-prefixed keys for economicStatus and residentialArea to ensure ExtraFields storage
Identity-API ignores unknown processing of economicStatus/residentialArea to DB columns silently;
using tbEconomicStatus/tbResidentialArea as keys ensures they land in ExtraFields and are returned in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: move occupation, economicStatus, residentialArea into beneficiaryDetails object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: read economicStatus and residentialArea directly from ExtraFields (not tb-prefixed keys)
Mobile sends these as top-level fields to TM-API; Identity-API saves them in ExtraFields as-is
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Diagnostics module and Yes/No ID fields across Stop TB nurse flow
- Add StopTBDiagnostics entity, repo, service, and controller (save/get/getAll)
- Add village-scoped getAll (villageID optional) to GeneralExamination, TBScreening, GeneralOpd, Diagnostics via BenFlowStatus subquery
- Fix TBScreening visitDate to accept user-provided date; preserve on update (not editable once submitted)
- Fix referralToHWCNeeded to trust mobile-computed value instead of server recalculating
- Fix chiefComplaint to support multi-select (JSON array)
- Add Yes/No boolean ID counterpart fields to TBScreening (14 fields), GeneralExamination (referralToHWCNeededId), Registration (isMobileAvailableId), and Diagnostics (6 fields)
- Add getTimestamp helper to StopTBServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: accept array of objects in all 4 Stop TB nurse save APIs
generalExamination, tbScreening, generalOpd, and diagnostics save
endpoints now take List<Map> instead of a single Map, allowing bulk
save in one request. Each item is processed within the same transaction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix supervisor name
* fix supervisor name
* fix supervisor name
* add update date on get ben api
* add update date on get ben api
* feat: return updateDate and updatedBy in all Stop TB getAll APIs
- Add lastModDate + modifiedBy fields to TBScreening, TBSuspected,
TBConfirmedCase, MalariaFollowUp entities (columns already exist in DB)
- Set modifiedBy in all save methods across StopTB, TBSuspected,
TBConfirmed, MalariaFollowUp services
- Return updateDate/updatedBy in all 8 getAll API responses so mobile
app can detect and refresh stale local records
- Fix TBConfirmedCase save duplicate bug — now looks up existing record
by benId before inserting new entity
- Add updateDate to getBeneficiaryData response from i_beneficiarydetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: resolve compile errors — move resultMap.put after initialization, add Map import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add chest xray, sputum, NAAT reason fields to StopTB diagnostics
Added isReferredForDigitalChestXray, reasonForDenialChestXray,
reasonNotConductedChestXray, isReferredForSputumCollection,
reasonForDenialSputum, sputumSubmittedAt, reasonNotConductedNaat
and their *Other variants to domain, save, and get map.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add local-to-central sync fields for Stop TB mobile flow
- Add vanID, parkingPlaceID, visitCode, processed, vanSerialNo to all
Stop TB entities (TBScreening, GeneralExamination, GeneralOpd,
Diagnostics, TBSuspected, TBConfirmedCase)
- Add updateVanSerialNo() to all 6 repos for MMU DataSync pattern
- Add CampConfigService to read camp:vanID from Redis (set by MMU login)
- Stamp vanID + processed='N' on every save in StopTBServiceImpl,
TBSuspectedServiceImpl, TBConfirmedCaseServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: make vanID stamping conditional — skip gracefully when camp not configured
When FLW-API is used without a Stop TB camp setup (no MMU login, no
camp:vanID in Redis), getVanID() now returns null instead of throwing.
All save methods guard with vanID != null before stamping, so regular
FLW/ASHA usage is completely unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add stoptb.enforce.vanid flag to fail loudly when camp not configured
CampConfigService.getVanID() previously returned null silently whenever
camp:vanID was missing from Redis, letting Stop TB records save with
vanID=NULL — these then never sync to central since the fetch query
filters on vanID IS NOT NULL. When stoptb.enforce.vanid=true, the save
now throws immediately so the error surfaces to the user instead of
being discovered later as an un-synced record.
* fix(stoptb): correct symptomatic/asymptomatic save and retrieve mapping
Frontend sends a single "symptomatic" Yes/No value, but the DB has two
separate columns (symptomatic, asymptomatic) with swapped semantics.
Yes now stores asymptomatic=Yes (symptomatic=null), No stores
symptomatic=Yes (asymptomatic=null). Retrieval derives the response
"symptomatic" value back from whichever column is Yes, so it always
echoes the original input.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix sync issue
* feat(counselling): implement dynamic form management for TB counselling
Introduces dynamic form definition management with versioning and
response lifecycle support (draft, submit, complete, and bulk sync)
for the TB counselling module.
Includes:
- Dynamic form and response APIs
- QuestionType and ValidationType enums
- TbCounsellingFormSeeder for initial form setup
- JWT-based audit stamping (createdBy/updatedBy)
- SecurityWhitelistConfig for endpoint-level authentication control
* feat(stoptb): add per-visit history to General Examination, TB Screening, OPD, Suspected, Confirmed
Every Stop TB clinical save previously upserted by beneficiaryRegID/benId
alone, so a beneficiary's second camp visit silently overwrote their first
- no history was ever kept. Adds a new tb_stoptb_visit table (mirrors MMU's
t_benvisitdetail visitNo pattern, scoped entirely to Stop TB's own schema)
and a getOrCreateVisitForToday() helper that infers "new visit" purely from
the save date, with no mobile change required.
- New TBStopVisit entity/repo/service: visitNo counting, role-handoff flags
reserved for future Doctor/Counsellor screens, full sync field set
(processed/vanSerialNo/SyncedDate/Syncedby/SyncFailureReason) matching the
existing AMRIT-wide DataSyncRepository convention.
- StopTBGeneralExamination/TBScreening/StopTBGeneralOpd/TBSuspected/
TBConfirmedCase now upsert keyed by (beneficiaryRegID, visitCode) instead
of beneficiaryRegID alone. Reused the existing dormant visitCode column on
4 of 6 tables rather than adding a new one.
- Fixed 4 read methods (getNurseWorklist, getGeneralExamination,
getNurseTBScreening, getGeneralOpd) that would have thrown
NonUniqueResultException once a beneficiary had more than one visit row -
switched to findLatestBy... + PageRequest.of(0,1).
- StopTBDiagnostics deliberately excluded: liquid culture results arrive
40-45 days after the original encounter and must update the same row,
which visit-keying would have broken.
Requires DB migration (not included): CREATE TABLE tb_stoptb_visit, plus
ALTER TABLE tb_suspected/tb_confirmed_cases ADD COLUMN visitCode BIGINT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Merge remote-tracking branch 'origin/vb/stoptb' into vb/stoptb
* chore(local-env): update local datasource/redis/jwt config and add dynamic form schema SQL
Adds manual DDL/seed script for the dynamic form tables since ddl-auto
wasn't creating them in local runs, and syncs local properties with
the values needed to run submitBulk locally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(local-env): keep backup copy of common_local.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* token chnges
* Vb/counselling (#254)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* Vb/counselling (#255)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Vb/counselling (#256)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* fix(user-service): handle empty result from getDistrictByBlockId fallback
Native query result must be mapped to List<Object[]>, not a bare Object[];
the previous signature caused getUserDetail() to silently skip the
workingDistrictId fallback for block-only users.
* Vb/counselling (#257)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
* fix(dynamic-form): default processed to N via @Builder.Default
Lombok @Builder ignores field initializers, so FormResponse,
QuestionResponse, and SectionResponse were inserting NULL into the
processed column instead of the intended "N" default, causing
"Column 'processed' cannot be null" on submitBulk.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#258)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#259)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#261)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): dual-write clinical data to AMRIT standard tables via t_benvisitdetail
- Replace tb_stoptb_visit with t_benvisitdetail (MMU-compatible visitCode formula)
- Dual-write exam data to t_phy_anthropometry, t_phy_vitals, t_Phy_GeneralExam, t_benreferdetails
- Dual-write OPD data to t_benchiefcomplaint, t_prescription, t_prescribeddrug
- Add 6 new JPA entities and repos for standard tables (db_iemr schema)
- Update TBSuspectedServiceImpl and TBConfirmedCaseServiceImpl to use BenVisitDetail
- Fix vanID/parkingPlaceID not being stored in t_form_response, t_section_response, t_question_response
- Delete orphaned TBStopVisit entity and TBStopVisitRepo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#262)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#263)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#264)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* field missing
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query on beneficiaryID, not beneficiaryRegID
TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.beneficiaryID, which
is the correct corresponding column.
* Add debug logging, RMNCH pinCode field, and GPS fallback pinCode mapping
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Vb/counselling (#269)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
* Add a CHECKBOX question type and a TB_COUNSELLING_V2 seeder with a GENERAL_INFO consent gate ahead of the counselling sections.
* Seed single-checkbox questions for Sections A-D and point the Counselled lookup at TB_COUNSELLING_V2 instead of the retired V1 form
* Mark form/section status REFUSED when TB2_GI_Q1=NO on /complete, split getCompletedBeneficiaries into completed/refused lists, and extract FormResponseStatus enum
* Resolved conflicts
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query on beneficiaryID, not beneficiaryRegID
TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.be…
vishwab1 added a commit that referenced this pull request Aug 5, 2026
* Updating seeders such that if forms are inactive, this will make them active with updated form
* Making changes as required in updated diagnostic order flow
* Update in seeder methods for removing the delete method to making it active
* Changes according to updated flow
* Changes according to updated flow
* To update the logic for saving raw json response without any asset
* Vb/release 3.8.3 fix merge (#312)
* Client ID and Client Secret Disclosure (#239)
* fix: client id and client secert key handle in backend
* fix: client id and client secert key handle in backend
* fix: remove hardcoded ABHA credentials and prevent local properties from being committed
- Remove common_local.properties from git tracking (had hardcoded SBX_001542 client id/secret)
- Add common_local.properties to .gitignore to prevent future commits
- Add ABHA token config sample entries to common_example.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add facilityData to getUserDetail response based on user role (#240)
Add FacilityDataService to build facilityData block (location, facilities,
ashaList, totalAshaCount) based on userId and roleName — same logic as
login response. ASHA Supervisor gets mapped ashaList, ASHA gets facility
+ supervisor + peers, CHO/ANM get facilities + ashaList at same facility.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(security): replace extractUsername(token) with DB lookup across FLW-API (#241)
All usages of jwtUtil.extractUsername (which reads PII from JWT sub claim)
replaced with userRepo.getUserNamedByUserId(jwtUtil.extractUserId(token)).
Username is now fetched from DB using userId — token PII not used anywhere
in FLW-API. Affects BeneficiaryService, MaternalHealth, DiseaseControl,
Campaign, IRSRound, SupervisorDashboard.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add mobile and employeeId to peersAtFacility, ashaList and supervisor in facilityData (#242)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* incentive chnages for release 3.8.2
* fix incentive issue for production (#243)
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue for production
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive issue on cg
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive
* fix incentive issue and api response issue
* fix incentive issue and api response issue
* add unclaimed incentive count on dashboard
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix incentive issue in 3.8.2
* fix TB suspected incentive
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* Fix incentive for ANC
* fix ifa incentive
* fix For motivating Female sterilization
* fix For motivating Female sterilization
* fix incentive for NCD follow up
* fix pnc related incentive
* fix pnc related incentive
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fix IFA incentive logic issue
* fixed malaria followup incentive
* fixed malaria followup incentive
* fixed malaria followup incentive
* get ben details using abha ID
* get ben details using abha ID
* fix isDeactivate issue
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* Fix: Handled isDeactivate null values for old data records by defaulting to false. (#246)
* fix motivating couples to maintain at least a two-year gap after marriage before first child
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* Motivating 70% women to take iron tablets
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* fix hbnc related incentive issue
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* add get bene deatils using nic api
* fix incentive for Is Paiucd
* add abha govt username and password
* add abha govt username and password
* add abha govt username and password
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* fix query issue in userService role
* Fix/query issue in userservicerole (#249)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* fix query issue in userService role
* handel duplicate ben record
* Fix/status code in ors ifa (#251)
* Fix: Handled isDeactivate null values for old data records by defaulting to false.
* change status code
* change status code
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* handel duplicate record
* fix sync issue
* fix sync issue
* fix sync issue
* feature of abha check in our system
* feature of abha check in our system
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* hbyc issue fixed
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix internal server error on abha id
* fix sam get api issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix date of referral issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* fix hwc referral incentive issue
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* Incentive logic for first-year child Immunization
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix child year gap
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix duplicate record in child gap incentive
* fix hbnc incentive
* fix hbnc incentive
* fix hbnc incentive
* Fix/asha profile image issue (#265)
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix asha profile image issue
* fix pnc incentive
* fix pnc incentive
* fix pnc incentive
* fix vhnd incentive incentive
* fix vhnd incentive incentive
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix vhnd incentive error
* fix cluster meeting incentive error
* fix cluster meeting incentive error
* fix tb incentive
* fix slide test incentive
* Fix/pb mb incentive issue 3.8.2 (#271)
* fix duplicate incentive issue
* fix duplicate incentive issue
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix child after 2 year gap after marriage
* fix hbyc incentive logic
* fix hbyc incentive logic
* fix hbyc incentive logic
* optmiz query for incentive logic for hbnc
* optmiz query for incentive logic for hbnc
* fixed hbnc and leprosy incentive (#290)
* fixed hbnc and leprosy incentive (#291)
* Merging 3.8.2 Branch (#294)
* feat(linting): commitlint ,Commitzen, Husky configuration
* feat: added new register api for stoptb
* feat: added new register api for stoptb
* feat: added new api for nurse
* fix: populate workingDistrictId from blockId in getUserDetail when district is null
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: align Stop TB APIs with BRD — village scoping + correct field names
- StopTBGeneralExamination: rewrite with BRD-correct fields (pallorId+pallor
string pairs, pulseRate, randomBloodSugar, oedema, beneficiaryRegID,
keyPopulationRiskFactorIds, hivStatusId — no more boolean clinical signs)
- StopTBRegistration: add villageId + villageName from i_bendemographics.districtBranchID
- StopTBRegistrationDto: add villageId + villageName for worklist requests
- StopTBRegistrationRepo: scope registrar worklist by psmId + villageId
- BenFlowStatusRepo: scope nurse worklist by psmId + villageId
- StopTBGeneralExaminationRepo: rename findByBeneficiaryRegID
- StopTBServiceImpl: extract village from demographics on registration,
set on both tb_stoptb_registration and i_ben_flow_outreach flow record,
fix all BRD field names throughout, add toJsonString for array fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: replace tb_stoptb_registration with BenFlowStatus for registrar worklist and add beneficiary details endpoint
- getRegistrarWorklist now queries i_ben_flow_outreach by villageID + visitCategory instead of tb_stoptb_registration
- add getRegistrarWorklist query to BenFlowStatusRepo
- add getBeneficiaryDetails endpoint that proxies TM-API quickSearchNew and merges otherFields into flat response object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: worklist chnges
* fix: use JwtToken header for getBeneficiaryDetails TM-API call
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use okhttp User-Agent pattern for TM-API call in getBeneficiaryDetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: look up 12-digit beneficiaryID from BenFlowStatus for TM-API quickSearchNew
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: redesign Stop TB worklist to return full beneficiary data in getBeneficiaryData style
- saveRegistration: forward full payload to TM-API without stripping Stop TB/anthropometry
fields — they land in ExtraFields via checkExtraFields; enrich BenFlowStatus with benName,
dob, gender, phone, district extracted from registration payload
- getRegistrarWorklist: returns getBeneficiaryData-style response — BenFlowStatus fields +
db_identity detail (community, education, fatherName, motherName) + otherFields parsed for
anthropometry and Stop TB details (personFrom, caseFindingType, tuId, weight, height, bmi, temp)
- getNurseWorklist: same rich response + generalExamination, tbScreening, generalOpd attached
if already saved (null if not yet captured)
- Remove getRegistration and getBeneficiaryDetails endpoints — worklist covers both
- Add otherFields (ExtraFields column) mapping to RMNCHMBeneficiarydetail entity
- BenFlowStatusRepo worklist queries scoped to psmId + villageId only (visitCategory column
not guaranteed to exist in i_ben_flow_outreach table)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use mapping table two-step lookup to fetch beneficiary details in Stop TB worklist
getDetailByBenRegID queries i_beneficiarydetails.beneficiaryRegID which is unpopulated;
correct path is i_beneficiarymapping → BenDetailsId → i_beneficiarydetails.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: use OutputResponse for all StopTBController endpoints to match AMRIT standard format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Stop TB worklist path and anthropometry to getBeneficiaryData
- Add providerServiceMapID to GetBenRequestHandler for Stop TB filtering
- Add getAddressesByBenRegIds repo query to fetch addresses by benRegId list
- Add Stop TB path in getBenData: filter by providerServiceMapID+villageID via BenFlowStatus
- Parse i_beneficiarydetails.ExtraFields to include anthropometry (weight/height/bmi/temperatureValue) in response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use JOIN query for getAddressesByBenRegIds and accept villageId alias
- Replace subquery with JOIN to fix Hibernate 6 multi-valued binding error
- Add setVillageId setter as alias for villageID in GetBenRequestHandler
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: switch getAddressesByBenRegIds to native SQL to avoid Hibernate 6 IN binding issue
JPQL IN with collection param throws multi-valued binding error in Hibernate 6 — native query bypasses this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use per-row mapping lookup for Stop TB worklist to avoid Hibernate IN binding issue
Replace bulk native query with per-row findByBenRegIdFromMapping + getAddressById calls
— same pattern as existing FLW code, avoids Object[] mapping error from native SELECT *.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add stopTBDetails block (personFrom, caseFindingType, isMobileAvailable, tuId, tuName) to getBeneficiaryData response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add occupation, economicStatus, residentialArea to stopTBDetails in worklist response
- occupation read from i_beneficiarydetails (already stored by Identity-API)
- economicStatus and residentialArea promoted to top-level in registration payload so Identity-API saves them in ExtraFields; read back in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "feat: add demographics block with address, occupation, economicStatus, residentialArea to worklist response"
This reverts commit 3695522d5139363e8eba335d6142cb5526af7ec0.
* feat: use tb-prefixed keys for economicStatus and residentialArea to ensure ExtraFields storage
Identity-API ignores unknown processing of economicStatus/residentialArea to DB columns silently;
using tbEconomicStatus/tbResidentialArea as keys ensures they land in ExtraFields and are returned in worklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: move occupation, economicStatus, residentialArea into beneficiaryDetails object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: read economicStatus and residentialArea directly from ExtraFields (not tb-prefixed keys)
Mobile sends these as top-level fields to TM-API; Identity-API saves them in ExtraFields as-is
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Diagnostics module and Yes/No ID fields across Stop TB nurse flow
- Add StopTBDiagnostics entity, repo, service, and controller (save/get/getAll)
- Add village-scoped getAll (villageID optional) to GeneralExamination, TBScreening, GeneralOpd, Diagnostics via BenFlowStatus subquery
- Fix TBScreening visitDate to accept user-provided date; preserve on update (not editable once submitted)
- Fix referralToHWCNeeded to trust mobile-computed value instead of server recalculating
- Fix chiefComplaint to support multi-select (JSON array)
- Add Yes/No boolean ID counterpart fields to TBScreening (14 fields), GeneralExamination (referralToHWCNeededId), Registration (isMobileAvailableId), and Diagnostics (6 fields)
- Add getTimestamp helper to StopTBServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: accept array of objects in all 4 Stop TB nurse save APIs
generalExamination, tbScreening, generalOpd, and diagnostics save
endpoints now take List<Map> instead of a single Map, allowing bulk
save in one request. Each item is processed within the same transaction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix supervisor name
* fix supervisor name
* fix supervisor name
* add update date on get ben api
* add update date on get ben api
* feat: return updateDate and updatedBy in all Stop TB getAll APIs
- Add lastModDate + modifiedBy fields to TBScreening, TBSuspected,
TBConfirmedCase, MalariaFollowUp entities (columns already exist in DB)
- Set modifiedBy in all save methods across StopTB, TBSuspected,
TBConfirmed, MalariaFollowUp services
- Return updateDate/updatedBy in all 8 getAll API responses so mobile
app can detect and refresh stale local records
- Fix TBConfirmedCase save duplicate bug — now looks up existing record
by benId before inserting new entity
- Add updateDate to getBeneficiaryData response from i_beneficiarydetails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: resolve compile errors — move resultMap.put after initialization, add Map import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add chest xray, sputum, NAAT reason fields to StopTB diagnostics
Added isReferredForDigitalChestXray, reasonForDenialChestXray,
reasonNotConductedChestXray, isReferredForSputumCollection,
reasonForDenialSputum, sputumSubmittedAt, reasonNotConductedNaat
and their *Other variants to domain, save, and get map.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add local-to-central sync fields for Stop TB mobile flow
- Add vanID, parkingPlaceID, visitCode, processed, vanSerialNo to all
Stop TB entities (TBScreening, GeneralExamination, GeneralOpd,
Diagnostics, TBSuspected, TBConfirmedCase)
- Add updateVanSerialNo() to all 6 repos for MMU DataSync pattern
- Add CampConfigService to read camp:vanID from Redis (set by MMU login)
- Stamp vanID + processed='N' on every save in StopTBServiceImpl,
TBSuspectedServiceImpl, TBConfirmedCaseServiceImpl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: make vanID stamping conditional — skip gracefully when camp not configured
When FLW-API is used without a Stop TB camp setup (no MMU login, no
camp:vanID in Redis), getVanID() now returns null instead of throwing.
All save methods guard with vanID != null before stamping, so regular
FLW/ASHA usage is completely unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add stoptb.enforce.vanid flag to fail loudly when camp not configured
CampConfigService.getVanID() previously returned null silently whenever
camp:vanID was missing from Redis, letting Stop TB records save with
vanID=NULL — these then never sync to central since the fetch query
filters on vanID IS NOT NULL. When stoptb.enforce.vanid=true, the save
now throws immediately so the error surfaces to the user instead of
being discovered later as an un-synced record.
* fix(stoptb): correct symptomatic/asymptomatic save and retrieve mapping
Frontend sends a single "symptomatic" Yes/No value, but the DB has two
separate columns (symptomatic, asymptomatic) with swapped semantics.
Yes now stores asymptomatic=Yes (symptomatic=null), No stores
symptomatic=Yes (asymptomatic=null). Retrieval derives the response
"symptomatic" value back from whichever column is Yes, so it always
echoes the original input.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix sync issue
* feat(counselling): implement dynamic form management for TB counselling
Introduces dynamic form definition management with versioning and
response lifecycle support (draft, submit, complete, and bulk sync)
for the TB counselling module.
Includes:
- Dynamic form and response APIs
- QuestionType and ValidationType enums
- TbCounsellingFormSeeder for initial form setup
- JWT-based audit stamping (createdBy/updatedBy)
- SecurityWhitelistConfig for endpoint-level authentication control
* feat(stoptb): add per-visit history to General Examination, TB Screening, OPD, Suspected, Confirmed
Every Stop TB clinical save previously upserted by beneficiaryRegID/benId
alone, so a beneficiary's second camp visit silently overwrote their first
- no history was ever kept. Adds a new tb_stoptb_visit table (mirrors MMU's
t_benvisitdetail visitNo pattern, scoped entirely to Stop TB's own schema)
and a getOrCreateVisitForToday() helper that infers "new visit" purely from
the save date, with no mobile change required.
- New TBStopVisit entity/repo/service: visitNo counting, role-handoff flags
reserved for future Doctor/Counsellor screens, full sync field set
(processed/vanSerialNo/SyncedDate/Syncedby/SyncFailureReason) matching the
existing AMRIT-wide DataSyncRepository convention.
- StopTBGeneralExamination/TBScreening/StopTBGeneralOpd/TBSuspected/
TBConfirmedCase now upsert keyed by (beneficiaryRegID, visitCode) instead
of beneficiaryRegID alone. Reused the existing dormant visitCode column on
4 of 6 tables rather than adding a new one.
- Fixed 4 read methods (getNurseWorklist, getGeneralExamination,
getNurseTBScreening, getGeneralOpd) that would have thrown
NonUniqueResultException once a beneficiary had more than one visit row -
switched to findLatestBy... + PageRequest.of(0,1).
- StopTBDiagnostics deliberately excluded: liquid culture results arrive
40-45 days after the original encounter and must update the same row,
which visit-keying would have broken.
Requires DB migration (not included): CREATE TABLE tb_stoptb_visit, plus
ALTER TABLE tb_suspected/tb_confirmed_cases ADD COLUMN visitCode BIGINT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Merge remote-tracking branch 'origin/vb/stoptb' into vb/stoptb
* chore(local-env): update local datasource/redis/jwt config and add dynamic form schema SQL
Adds manual DDL/seed script for the dynamic form tables since ddl-auto
wasn't creating them in local runs, and syncs local properties with
the values needed to run submitBulk locally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(local-env): keep backup copy of common_local.properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* token chnges
* Vb/counselling (#254)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* Vb/counselling (#255)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Vb/counselling (#256)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
---------
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* fix(user-service): handle empty result from getDistrictByBlockId fallback
Native query result must be mapped to List<Object[]>, not a bare Object[];
the previous signature caused getUserDetail() to silently skip the
workingDistrictId fallback for block-only users.
* Vb/counselling (#257)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
* fix(dynamic-form): default processed to N via @Builder.Default
Lombok @Builder ignores field initializers, so FormResponse,
QuestionResponse, and SectionResponse were inserting NULL into the
processed column instead of the intended "N" default, causing
"Column 'processed' cannot be null" on submitBulk.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#258)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#259)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#261)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): dual-write clinical data to AMRIT standard tables via t_benvisitdetail
- Replace tb_stoptb_visit with t_benvisitdetail (MMU-compatible visitCode formula)
- Dual-write exam data to t_phy_anthropometry, t_phy_vitals, t_Phy_GeneralExam, t_benreferdetails
- Dual-write OPD data to t_benchiefcomplaint, t_prescription, t_prescribeddrug
- Add 6 new JPA entities and repos for standard tables (db_iemr schema)
- Update TBSuspectedServiceImpl and TBConfirmedCaseServiceImpl to use BenVisitDetail
- Fix vanID/parkingPlaceID not being stored in t_form_response, t_section_response, t_question_response
- Delete orphaned TBStopVisit entity and TBStopVisitRepo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#262)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#263)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Vb/counselling (#264)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
---------
Co-authored-by: Vishwanath Balkur <118195001+vishwab1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* field missing
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query on beneficiaryID, not beneficiaryRegID
TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.beneficiaryID, which
is the correct corresponding column.
* Add debug logging, RMNCH pinCode field, and GPS fallback pinCode mapping
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Vb/counselling (#269)
* Enforced mandatory validation for "Reason for Refusal in section e in file TbCounsellingFormSeeder
* Added counselled flag to confirmed cases response, indicating whether a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Align `/complete` and `/submitBulk` form response editing behavior
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
* Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, processed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(dynamic-form): add Hindi localization fields and completed beneficiaries endpoint
- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
* feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.
Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Revert "Committed 82b00ccf with only the three files:"
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Committed 82b00ccf with only the three files:
- BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
- RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
- RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
* Updated isMandatory field in Section C, so changed in TbCounsellingFormSeeder
* Add optional villageId and providerServiceMapId filters to getCompletedBeneficiaries
* Removing section f from seeder
* Removing already existing check in /complete api
* Add a CHECKBOX question type and a TB_COUNSELLING_V2 seeder with a GENERAL_INFO consent gate ahead of the counselling sections.
* Seed single-checkbox questions for Sections A-D and point the Counselled lookup at TB_COUNSELLING_V2 instead of the retired V1 form
* Mark form/section status REFUSED when TB2_GI_Q1=NO on /complete, split getCompletedBeneficiaries into completed/refused lists, and extract FormResponseStatus enum
* Resolved conflicts
* fix(stoptb): getBeneficiaryData reads anthropometry/vitals from standard tables
- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(compile): rename variable 'a' to 'anthro' to avoid conflict with outer loop variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NOT NULL constraint violation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and PNC flows
If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary age display
Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficiarydetails.dob is null
Identity-API mapper (@Mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benDetailsOBJ.dob
benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd2 added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(stoptb): scope Suspected/Confirmed getAll by facility+village instead of userId
Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.
Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
* fix(stoptb): drop date filter from facility-scoped Suspected query
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
* fix(stoptb): join facility-scoped query …
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SauravBizbRolly@vishwab1