Skip to content

feat(stoptb): Nikshay ID Generator CSV export and results import - #177

Closed
snehar-nd wants to merge 3 commits into
release-3.8.2from
sn/nikshaya
Closed

feat(stoptb): Nikshay ID Generator CSV export and results import#177
snehar-nd wants to merge 3 commits into
release-3.8.2from
sn/nikshaya

Conversation

@snehar-nd

@snehar-nd snehar-nd commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Nikshay ID Generator CSV round-trip support for Stop TB camp beneficiaries:

  • ExportGET /stopTb/nikshay/exportBeneficiariesCsv streams pending Stop TB camp beneficiaries (filtered by van / service point / date range, excluding those that already have a Nikshay ID) as a CSV formatted for the Nikshay ID Generator desktop app.
  • ImportPOST /stopTb/nikshay/importResultsCsv reads the results file back from that app and writes nikshay_id back for success and single-ID-skip rows, flagging ambiguous/failed rows for manual review rather than guessing.
  • Row identity — the CSV carries a benRegId passthrough column that the Nikshay ID Generator app leaves untouched (companion change in that app), so each results row is self-identifying. Import resolves/creates the right tb_stoptb_diagnostics row live via findLatestDiagnosticsId, keyed off benRegId. This replaced an earlier export-batch/row-order tracking approach, which is why no batch tables or batch header/param remain.

Changes

File
NikshayExportController.java export + import endpoints
NikshayExportService.java CSV generation
NikshayImportService.java results parsing and nikshay_id write-back
NikshayExportRepository.java beneficiary queries, findLatestDiagnosticsId
pom.xml CSV dependency

771 insertions, no deletions — all new files apart from pom.xml.

Notes

Testing

Not yet exercised end-to-end against the Nikshay ID Generator app — please confirm the CSV column contract matches on that side before merge.

🤖 Generated with Claude Code

Sneha and others added 3 commits August 13, 2026 12:07
Streams pending Stop TB camp beneficiaries (filtered by van/service
point/date range, excluding those with an existing Nikshay ID) as a
CSV formatted for the Nikshay ID Generator desktop app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds an export-batch tracking mechanism (row order + beneficiary/
diagnostics identity per CSV row) so the Nikshay ID Generator app's
results file can be re-uploaded and matched back to the right
beneficiary, since that app's own template strips any AMRIT
identifier on read. Export now also returns a batch ID header;
new POST /stopTb/nikshay/importResultsCsv writes nikshay_id back
for success/single-ID-skip rows and flags ambiguous/failed rows
for manual review instead of guessing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…hrough column

Adds benRegId as a CSV column the Nikshay ID Generator app carries
through untouched (a companion change in that app), so each results
row is self-identifying instead of needing AMRIT-side row-order
tracking. Import now resolves/creates the right tb_stoptb_diagnostics
row live via findLatestDiagnosticsId, keyed off benRegId directly.
Drops the export-batch header/param from both endpoints.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e1a6a3ba-08ad-40e2-a9e8-9ede9093058e

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

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.

@sonarqubecloud

Copy link
Copy Markdown

@snehar-nd

Copy link
Copy Markdown
Contributor Author

This is not needed, it already done

Sign up for free to 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.

1 participant