Fix indexes used when generating Patient Spreadsheet#2430
Fix indexes used when generating Patient Spreadsheet#2430sebastian-j-ibanez wants to merge 2 commits into
Conversation
…n, update formatting
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts spreadsheet generation to use correct column indexes for province and postal code cells and applies minor formatting clean-up in the patient list export action. Flow diagram for corrected spreadsheet cell indexes in GeneratePatientSpreadSheetList2Actionflowchart LR
A[Loop demographics array] --> B[Create HSSFRow with sheet.createRow]
B --> C[Set cell 0 to d.getFirstName]
C --> D[Set cell 1 to d.getLastName]
D --> E[Set cell 2 to d.getAddress]
E --> F[Set cell 3 to d.getCity]
F --> G[Set cell 4 to d.getProvince]
G --> H[Set cell 5 to d.getPostal]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Review Summary by QodoFix cell indexes in patient spreadsheet generation
WalkthroughsDescription• Fix incorrect cell indexes in spreadsheet generation - Changed duplicate index 3 to correct indexes 4 and 5 - Ensures Province and Postal data written to correct columns • Clean up formatting and whitespace - Remove extra blank lines - Reformat long header line for readability Diagramflowchart LR
A["Spreadsheet Generation"] --> B["Cell Index Mapping"]
B --> C["Column 0: First Name"]
B --> D["Column 1: Last Name"]
B --> E["Column 2: Address"]
B --> F["Column 3: City"]
B --> G["Column 4: Province (Fixed)"]
B --> H["Column 5: Postal (Fixed)"]
File Changes1. src/main/java/ca/openosp/openo/report/pageUtil/GeneratePatientSpreadSheetList2Action.java
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Code Review
This pull request cleans up whitespace and fixes a bug in the patient spreadsheet generation where multiple data fields were being written to the same column index. A review comment correctly identifies a logic error in the date format string used for the filename, where minutes were used instead of months, and provides a suggestion to fix it.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider extracting the spreadsheet column indices (0–5) into named constants or an enum to make the column layout clearer and less error-prone to modify in the future.
- The workbook/response stream handling could be improved by using try-with-resources around the
HSSFWorkbookand output stream to ensure resources are closed reliably even if an exception occurs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the spreadsheet column indices (0–5) into named constants or an enum to make the column layout clearer and less error-prone to modify in the future.
- The workbook/response stream handling could be improved by using try-with-resources around the `HSSFWorkbook` and output stream to ensure resources are closed reliably even if an exception occurs.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…SpreadSheetList2Action.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Sebastian Ibanez <91081658+sebastian-j-ibanez@users.noreply.github.com>
Changes made
Summary by Sourcery
Correct patient list spreadsheet generation and tidy response header formatting.
Bug Fixes:
Enhancements:
Summary by cubic
Fix incorrect column indexes in
GeneratePatientSpreadSheetList2Actionso province and postal code populate their own columns instead of overwriting the city column in the exported patient list. Also cleans up minor download header formatting.Written for commit abe089a. Summary will update on new commits. Review in cubic