Skip to content

Commit 418db7c

Browse files
committed
feat: Update labValues structure in Report model and handle potential null values in DocumentProcessorController
1 parent ca1f9c9 commit 418db7c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

backend/src/document-processor/controllers/document-processor.controller.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ export class DocumentProcessorController {
143143
report.isProcessed = true;
144144

145145
// Extract lab values
146-
report.labValues = result.analysis.labValues.map(
147-
lab =>
148-
`${lab.name} ${lab.value} ${lab.unit} ${lab.isNormal === 'normal' ? 'NORMAL' : lab.isNormal.toUpperCase()}`,
149-
);
146+
report.labValues = result.analysis.labValues || [];
150147

151148
// Create summary from simplified explanation or diagnoses
152149
report.summary =

backend/src/reports/models/report.model.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ export class Report {
2525
isProcessed: boolean;
2626

2727
@ApiProperty({ description: 'List of lab values' })
28-
labValues: string[];
28+
labValues: Array<{
29+
name: string;
30+
value: string;
31+
unit: string;
32+
normalRange: string;
33+
isNormal: 'normal' | 'high' | 'low';
34+
conclusion: string;
35+
suggestions: string;
36+
}>;
2937

3038
@ApiProperty({ description: 'Summary of the report' })
3139
summary: string;

0 commit comments

Comments
 (0)