Skip to content

Commit 0fe5c82

Browse files
authored
Merge pull request #127 from ModusCreateOrg/ADE-66
[ADE-66] refactor: remove missing reference ranges notice and related checks from AiAnalysisTab
2 parents 7b0724b + 34ad55b commit 0fe5c82

File tree

4 files changed

+2
-40
lines changed

4 files changed

+2
-40
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ For lab values:
7272
- Set "isCritical" to true for urgent medical situations
7373
- Provide brief "conclusion" about what the value means for health
7474
- Add brief "suggestions" based on the value
75-
- IMPORTANT: For ANY lab value where reference/normal ranges are not explicitly stated in the document, you MUST add "reference-ranges-missing" to the missingInformation array and use standard medical ranges
7675
- If you use standard ranges because the document lacks them, clearly mark this in your response
7776
7877
CRITICAL FORMATTING RULES:
@@ -88,7 +87,6 @@ Common errors to avoid:
8887
- Starting with "This appears to be a medical report..."
8988
- Creating nested JSON structures
9089
- Placing data inside definition fields
91-
- IMPORTANT: Failing to add "reference-ranges-missing" to missingInformation when ANY lab value lacks explicit ranges
9290
9391
Document text:
9492
`;

backend/src/services/perplexity.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export class PerplexityService {
283283
this.logger.log('Reviewing medical document analysis with Perplexity');
284284

285285
const systemPrompt =
286-
'Medical information verification specialist. Verify analysis against trusted sources (Mayo Clinic, Cleveland Clinic, CDC, NIH, WHO, medical journals). Ensure accuracy of lab ranges, interpretations, and recommendations. Return only corrected JSON. IMPORTANT: Do not modify the metadata object, especially preserve the metadata.missingInformation array exactly as provided.';
286+
'Medical information verification specialist. Verify analysis against trusted sources (Mayo Clinic, Cleveland Clinic, CDC, NIH, WHO, medical journals). Ensure accuracy of lab ranges, interpretations, and recommendations. Return only corrected JSON. IMPORTANT: Do not modify the metadata object.';
287287

288288
const analysisJson = JSON.stringify(analysis, null, 2);
289289

@@ -293,7 +293,7 @@ export class PerplexityService {
293293
`2. Interpretations of abnormal values\n` +
294294
`3. Medical conclusions and recommendations\n` +
295295
`4. Lab value categorizations\n\n` +
296-
`CRITICAL INSTRUCTION: Do NOT modify the metadata object. The metadata.missingInformation array must remain exactly as provided without any additions, removals, or changes.\n\n` +
296+
`CRITICAL INSTRUCTION: Do NOT modify the metadata object.\n\n` +
297297
`Analysis JSON:\n${analysisJson}\n\n` +
298298
`Original Text:\n${originalText}\n\n` +
299299
`Return ONLY corrected JSON with identical structure. No preamble, explanation, or text before/after JSON.`;

frontend/src/pages/Reports/components/AiAnalysisTab.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import EmergencyAlert from './EmergencyAlert';
44
import FlaggedValuesSection from './FlaggedValuesSection';
55
import NormalValuesSection from './NormalValuesSection';
66
import LowConfidenceNotice from './LowConfidenceNotice';
7-
import MissingReferenceRangesNotice from './MissingReferenceRangesNotice';
87

98
interface AiAnalysisTabProps {
109
reportData: MedicalReport;
@@ -37,11 +36,6 @@ const AiAnalysisTab: React.FC<AiAnalysisTabProps> = ({
3736

3837
const isLowConfidence = confidenceScore < 0.75;
3938

40-
// Check if reference ranges are missing
41-
const hasReferenceRangesMissing = !!reportData.missingInformation?.includes(
42-
'reference-ranges-missing',
43-
);
44-
4539
return (
4640
<div className="ai-analysis-tab">
4741
{/* Emergency alert if needed */}
@@ -50,9 +44,6 @@ const AiAnalysisTab: React.FC<AiAnalysisTabProps> = ({
5044
{/* Low confidence notice */}
5145
{isLowConfidence && <LowConfidenceNotice />}
5246

53-
{/* Missing reference ranges notice */}
54-
{hasReferenceRangesMissing && <MissingReferenceRangesNotice />}
55-
5647
{/* Flagged values section */}
5748
{flaggedValues.length > 0 && (
5849
<FlaggedValuesSection

frontend/src/pages/Reports/components/MissingReferenceRangesNotice.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)