Skip to content

Hotfix: Configurable bill number serial digit count for Ruhunu#19639

Merged
buddhika75 merged 2 commits intoruhunu-prodfrom
19635-configurable-bill-serial-digits-hotfix
Apr 3, 2026
Merged

Hotfix: Configurable bill number serial digit count for Ruhunu#19639
buddhika75 merged 2 commits intoruhunu-prodfrom
19635-configurable-bill-serial-digits-hotfix

Conversation

@buddhika75
Copy link
Copy Markdown
Member

Summary

  • Hotfix for Ruhunu Hospital — bill number serial digits are too long for QuickBooks upload
  • Replace hardcoded 6-digit serial format (%06d) with configurable "Bill Number Serial Digit Count" option (default: 6)
  • Add setInteger REST API endpoint to allow changing integer configs via API
  • Clamp max digits to 12 for safety

Problem

Current: GRN/RHD/LBK/26/000001 (6-digit serial — too many characters for QB)
Required: GRN/RHD/LBK/26/00001 (5-digit serial)

Post-Deployment Steps

After deploying this hotfix, set the digit count to 5 via API:

curl -X POST "https://rh.carecode.org/rh/api/config/setInteger/Bill%20Number%20Serial%20Digit%20Count/5" \
  -H "Config: <API_KEY>"

Important Notes

  • Only new bill numbers will be affected — past bill numbers will NOT be changed as they are already committed, printed records reference them, and searching them would be difficult
  • Default remains 6 digits — no change until the API call is made
  • Cherry-picked from development PR Add configurable bill number serial digit count #19636

Closes #19635

Test plan

  • Verify default behavior (6 digits) unchanged when config not set
  • Set config to 5 via API and verify new GRN bill numbers use 5-digit serial
  • Verify existing bill numbers are unaffected

🤖 Generated with Claude Code

buddhika75 and others added 2 commits April 1, 2026 18:00
Replace hardcoded 6-digit serial format (%06d) with configurable
"Bill Number Serial Digit Count" option (default: 6). This allows
institutions to reduce leading zeros for QuickBooks compatibility
(e.g., GRN/RHD/LBK/26/000001 → GRN/RHD/LBK/26/00001).

- Add formatSerialNumber() helper in BillNumberGenerator
- Register config option in ConfigOptionApplicationController
- Add setInteger API endpoint in ConfigResource

Closes #19635

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onventions

- Add MAX_SERIAL_DIGITS=12 upper bound in formatSerialNumber() to prevent
  excessive allocations from misconfigured values
- Document hotfix branch naming convention (must end with -hotfix) and
  feature branch naming patterns in commit-conventions.md

Closes #19635

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

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

Run ID: e4d9659f-beff-4077-9658-a2188f1f341d

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 19635-configurable-bill-serial-digits-hotfix

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.

@buddhika75 buddhika75 requested a review from Lakmedipro April 3, 2026 18:36
@buddhika75 buddhika75 merged commit c21d8cd into ruhunu-prod Apr 3, 2026
4 checks passed
@buddhika75 buddhika75 deleted the 19635-configurable-bill-serial-digits-hotfix branch April 3, 2026 18:43
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.

2 participants