Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

@adamrefaey adamrefaey commented Apr 25, 2025

Change

This pull request introduces enhancements to the report processing system, focusing on improved error handling, better differentiation of medical reports, and frontend updates to display more detailed error states. The changes span both the backend and frontend codebases.

Backend Changes:

  • Added a new isMedicalReport property to the Report model to indicate whether a report is a medical report.
  • Replaced the debugMessage property with errorMessage in the Report model to better reflect its purpose.

Frontend Changes:

Model Updates:

  • Updated the MedicalReport interface to include the new isMedicalReport and errorMessage properties, while removing the deprecated debugMessage property.

Error Handling Improvements:

  • Introduced a new setError function in the ProcessingPage component to manage error states, including an errorHeading for more descriptive error messages.
  • Enhanced the checkReportStatus function to handle specific error cases, such as non-medical reports and failed processing, with tailored error messages.

UI Enhancements:

  • Modified the ProcessingError component to display both an errorHeading and errorMessage, providing clearer context for errors. [1] [2]
  • Updated the ProcessingPage component to conditionally render the ProcessingError component only when both errorHeading and processingError are present.

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

…nd update report model to use errorMessage instead of debugMessage. Enhance report processing logic to ensure accurate status updates and error handling.
…gic to include isMedicalReport flag. Update ProcessingPage and ProcessingError components for improved error handling and user feedback. Introduce new ProcessingMedicalReport component for non-medical report scenarios. Ensure all user-facing text is internationalized.
@adamrefaey adamrefaey requested a review from Copilot April 25, 2025 10:59
@adamrefaey adamrefaey self-assigned this Apr 25, 2025

This comment was marked as outdated.

…nsure all user-facing text was previously internationalized.
@adamrefaey adamrefaey requested review from GuidoBR and Copilot April 25, 2025 11:01

This comment was marked as outdated.

…management using setError function. Ensure all user-facing text is internationalized.
@adamrefaey adamrefaey requested a review from Copilot April 25, 2025 11:10

This comment was marked as outdated.

…m thrown Error. Simplify error state management by using a default failed message in setError. Ensure all user-facing text is internationalized.
@adamrefaey adamrefaey requested a review from Copilot April 25, 2025 11:16
Copy link
Contributor

Copilot AI left a 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 pull request improves the file processing flow by enhancing error handling, updating the report model, and introducing support for distinguishing non-medical reports. Key changes include replacement of the debugMessage with an errorMessage, addition of the isMedicalReport flag in the backend and frontend models, and UI updates in the ProcessingPage component along with a new ProcessingMedicalReport component.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
frontend/src/pages/Processing/components/ProcessingError.tsx Added a dynamic errorHeading prop to provide contextual error messages.
frontend/src/pages/Processing/ProcessingPage.tsx Updated state management and error handling to distinguish errors for medical vs non-medical reports.
frontend/src/common/models/medicalReport.ts Updated the model to include errorMessage and isMedicalReport while deprecating debugMessage.
backend/src/reports/models/report.model.ts Replaced debugMessage with errorMessage and added the isMedicalReport flag.

@adamrefaey adamrefaey merged commit 96e678a into main Apr 25, 2025
@adamrefaey adamrefaey deleted the ADE-66 branch April 25, 2025 11:36
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.

3 participants