-
Notifications
You must be signed in to change notification settings - Fork 0
[ADE-66] refactor and improve uploading a report & processing it #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…new ProcessingPage styles
…i18n support with new translation keys
…ing and functionality - Updated ReportItem component to use new category translation keys and improved bookmark icon styling. - Modified ReportDetailPage styles for better layout and responsiveness, including adjustments to padding, margins, and colors. - Enhanced ReportDetailPage structure by replacing IonButton with a custom button for closing the report. - Implemented new sections for displaying flagged and normal lab values with improved UI elements. - Added functionality to display uploaded file details with formatted date. - Removed unnecessary AI Assistant help section from ReportDetailPage.
…readability and maintainability
…nd file size, update frontend components for improved file metadata display
…ysis and original report, improving code organization and readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the report upload and processing functionalities, adding support for new metadata fields and refining both backend handling and frontend presentation.
- Adds new metadata fields (originalFilename and fileSize) to the Report model and corresponding API endpoints.
- Improves UI consistency by updating the router configuration and extending the Icon component with new icons.
- Simplifies the logic in report summary generation by removing fallback conditions.
Reviewed Changes
Copilot reviewed 28 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/common/utils/i18n/resources/es/index.ts | Added reportDetail translations entry |
| frontend/src/common/utils/i18n/resources/en/index.ts | Added reportDetail translations entry |
| frontend/src/common/models/medicalReport.ts | Extended MedicalReport interface with new metadata fields |
| frontend/src/common/components/Router/TabNavigation.tsx | Renamed Processing to ProcessingPage for consistency |
| frontend/src/common/components/Icon/Icon.tsx | Added new icons (fileText, filePdf, lightbulb) and updated mappings |
| frontend/src/common/api/reportService.ts | Updated uploadReport to include new metadata fields |
| backend/src/reports/reports.service.ts | Updated saveReport to accept new metadata parameters |
| backend/src/reports/reports.controller.ts | Updated createReport endpoint to pass new metadata fields |
| backend/src/reports/models/report.model.ts | Updated Report model to include new metadata properties |
| backend/src/document-processor/controllers/document-processor.controller.ts | Simplified summary generation logic for reports |
Files not reviewed (10)
- frontend/src/common/utils/i18n/resources/en/common.json: Language not supported
- frontend/src/common/utils/i18n/resources/en/errors.json: Language not supported
- frontend/src/common/utils/i18n/resources/en/report.json: Language not supported
- frontend/src/common/utils/i18n/resources/en/reportDetail.json: Language not supported
- frontend/src/common/utils/i18n/resources/es/common.json: Language not supported
- frontend/src/common/utils/i18n/resources/es/errors.json: Language not supported
- frontend/src/common/utils/i18n/resources/es/errors.json.new: Language not supported
- frontend/src/common/utils/i18n/resources/es/reportDetail.json: Language not supported
- frontend/src/common/utils/i18n/resources/fr/common.json: Language not supported
- frontend/src/common/utils/i18n/resources/fr/errors.json: Language not supported
Comments suppressed due to low confidence (1)
backend/src/document-processor/controllers/document-processor.controller.ts:205
- The use of the non-null assertion operator (!) on result.simplifiedExplanation removes the fallback logic previously used. Ensure that simplifiedExplanation is always defined at runtime or consider restoring a safe default to prevent potential runtime errors.
report.summary = result.simplifiedExplanation!;
…e in AI analysis tab
Change
This pull request introduces several updates across the backend and frontend to enhance functionality, improve user experience, and add support for new metadata in reports. Key changes include adding metadata fields for reports, updating APIs to handle these fields, improving localization, and refining UI components.
Backend Changes
Report Metadata Enhancements:
originalFilenameandfileSizeproperties to theReportmodel and updated the corresponding API endpoints and service methods to handle these fields. (backend/src/reports/models/report.model.ts,backend/src/reports/reports.controller.ts,backend/src/reports/reports.service.ts) [1] [2] [3] [4]Simplified Summary Logic:
summaryfield inDocumentProcessorControllerby removing fallback conditions and directly usingsimplifiedExplanation. (backend/src/document-processor/controllers/document-processor.controller.ts)Frontend Changes
Report Metadata Support:
uploadReportfunction to includeoriginalFilenameandfileSizewhen sending data to the backend. (frontend/src/common/api/reportService.ts)MedicalReportinterface to includeoriginalFilenameandfileSizeproperties. (frontend/src/common/models/medicalReport.ts)UI and Icon Improvements:
fileText,filePdf,lightbulb) to theIconcomponent for enhanced visual representation. (frontend/src/common/components/Icon/Icon.tsx) [1] [2] [3] [4] [5] [6] [7]ProcessingwithProcessingPagein the router configuration. (frontend/src/common/components/Router/TabNavigation.tsx) [1] [2]Localization Enhancements:
frontend/src/common/utils/i18n/resources/en,frontend/src/common/utils/i18n/resources/es,frontend/src/common/utils/i18n/resources/fr) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Status Enum Update:
FAILEDstatus to theProcessingStatusenum to handle failed report processing scenarios. (frontend/src/common/models/medicalReport.ts)Does this PR introduce a breaking change?
{...}
What needs to be documented once your changes are merged?
{...}
Additional Comments
{...}