Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

fix: enhance medical analysis instructions and enforce metadata integrity

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

@adamrefaey adamrefaey requested a review from Copilot April 29, 2025 13:46
@adamrefaey adamrefaey self-assigned this Apr 29, 2025
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 PR enhances medical analysis instructions and enforces metadata integrity across services.

  • Refactors the reviewMedicalAnalysis function to use a strongly typed MedicalDocumentAnalysis parameter and updates the system prompt with strict metadata handling instructions.
  • Updates AWS Bedrock service instructions to enforce the inclusion of "reference-ranges-missing" for lab values without explicit ranges.

Reviewed Changes

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

File Description
backend/src/services/perplexity.service.ts Updated function parameter type and added explicit metadata prompts
backend/src/document-processor/services/aws-bedrock.service.ts Added and refined instructions regarding lab value metadata handling
Comments suppressed due to low confidence (2)

backend/src/services/perplexity.service.ts:296

  • [nitpick] The prompt now includes duplicated critical instructions about preserving metadata integrity (also present in line 286). Consider consolidating these instructions for clarity.
CRITICAL INSTRUCTION: Do NOT modify the metadata object. The metadata.missingInformation array must remain exactly as provided without any additions, removals, or changes.

backend/src/document-processor/services/aws-bedrock.service.ts:91

  • [nitpick] There are multiple similar instructions (lines 75-76 and 91) regarding the handling of lab value missing ranges. Consider merging these into a single clear instruction to avoid potential confusion.
IMPORTANT: Failing to add "reference-ranges-missing" to missingInformation when ANY lab value lacks explicit ranges

@GuidoBR GuidoBR merged commit 7b0724b into main Apr 29, 2025
1 check passed
@adamrefaey adamrefaey deleted the ADE-66 branch April 29, 2025 13:49
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