Skip to content

Commit 2273b3d

Browse files
committed
Refactor ReportItem and ReportDetailPage components for improved styling 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.
1 parent 28d8cd8 commit 2273b3d

File tree

7 files changed

+831
-432
lines changed

7 files changed

+831
-432
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
@@ -202,10 +202,7 @@ export class DocumentProcessorController {
202202
report.labValues = result.analysis.labValues || [];
203203

204204
// Create summary from simplified explanation or diagnoses
205-
report.summary =
206-
result.simplifiedExplanation ||
207-
result.analysis.diagnoses.map(d => d.condition).join(', ') ||
208-
'No summary available';
205+
report.summary = result.simplifiedExplanation!;
209206

210207
report.updatedAt = new Date().toISOString();
211208

frontend/src/common/components/Icon/Icon.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import {
2626
faArrowUpFromBracket,
2727
faHome,
2828
faFileLines as faSolidFileLines,
29+
faFileAlt as faFileText,
30+
faFilePdf,
2931
faUpload,
3032
faComment,
3133
faUserCircle,
@@ -36,12 +38,14 @@ import {
3638
faChevronUp,
3739
faChevronDown,
3840
faVial,
41+
faLightbulb as faSolidLightbulb,
3942
} from '@fortawesome/free-solid-svg-icons';
4043
import {
4144
faFileLines as faRegularFileLines,
4245
faComment as faRegularComment,
4346
faUser as faRegularUser,
4447
faBookmark as faRegularBookmark,
48+
faLightbulb as faRegularLightbulb,
4549
} from '@fortawesome/free-regular-svg-icons';
4650
import classNames from 'classnames';
4751

@@ -63,6 +67,8 @@ export type IconName =
6367
| 'comment'
6468
| 'envelope'
6569
| 'fileLines'
70+
| 'fileText'
71+
| 'filePdf'
6672
| 'home'
6773
| 'house'
6874
| 'link'
@@ -86,7 +92,8 @@ export type IconName =
8692
| 'flask'
8793
| 'chevronUp'
8894
| 'chevronDown'
89-
| 'vial';
95+
| 'vial'
96+
| 'lightbulb';
9097

9198
/**
9299
* Properties for the `Icon` component.
@@ -114,6 +121,8 @@ const solidIcons: Record<IconName, IconProp> = {
114121
comment: faComment,
115122
envelope: faEnvelope,
116123
fileLines: faSolidFileLines,
124+
fileText: faFileText,
125+
filePdf: faFilePdf,
117126
home: faHome,
118127
house: faHouse,
119128
link: faLink,
@@ -138,6 +147,7 @@ const solidIcons: Record<IconName, IconProp> = {
138147
chevronUp: faChevronUp,
139148
chevronDown: faChevronDown,
140149
vial: faVial,
150+
lightbulb: faSolidLightbulb,
141151
};
142152

143153
/**
@@ -150,6 +160,7 @@ const regularIcons: Partial<Record<IconName, IconProp>> = {
150160
user: faRegularUser,
151161
bookmark: faRegularBookmark,
152162
circleXmark: faCircleXmark,
163+
lightbulb: faRegularLightbulb,
153164
};
154165

155166
/**
Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
{
2-
"detail": {
3-
"title": "Report Detail",
4-
"loading": "Loading report...",
5-
"errorLoading": "Error loading report. Please try again later.",
6-
"aiInsights": "AI Insights",
7-
"testResults": "Test Results",
8-
"test": "Test",
9-
"results": "Results",
10-
"refRange": "Ref. Range",
11-
"reportDate": "Report Date",
12-
"medicalComments": "Medical Comments",
13-
"hemoglobin": "Hemoglobin",
14-
"ldl": "LDL Cholesterol",
15-
"glucose": "Fasting Blood Glucose",
16-
"alt": "ALT (Liver Enzyme)",
17-
"wbc": "WBC (White Blood Cells)",
18-
"vitaminD": "Vitamin D (25-OH)",
19-
"cholesterol": "Total Cholesterol",
20-
"bookmarkAdded": "Report added to bookmarks",
21-
"bookmarkRemoved": "Report removed from bookmarks",
22-
"aiInsightsContent": "Based on the blood test results, our AI has identified several points of interest that may require attention or further discussion with your healthcare provider.",
23-
"insight1Title": "Hemoglobin Level",
24-
"insight1Content": "Your hemoglobin level is slightly below the reference range. This could indicate mild anemia, which may cause fatigue and weakness.",
25-
"insight2Title": "Cholesterol Levels",
26-
"insight2Content": "Both your LDL cholesterol and total cholesterol are elevated, which may increase your risk for cardiovascular disease.",
27-
"insight3Title": "Blood Glucose",
28-
"insight3Content": "Your fasting blood glucose is elevated, potentially indicating prediabetes. Lifestyle modifications may help improve this value.",
29-
"hemoglobinComment": "The patient's hemoglobin level is 12.5 g/dL, which falls within the lower end of the normal reference range for most adults. While this value may still be considered acceptable, it is important to assess it in the context of the patient's age, sex, clinical symptoms, and medical history.",
30-
"emergencyWarning": "Please contact your doctor or seek emergency care immediately.",
31-
"flaggedValues": "Flagged values",
32-
"highLdl": "High LDL Cholesterol",
33-
"lowHemoglobin": "Low Hemoglobin (10.1 g/dL)",
34-
"conclusion": "Conclusion:",
35-
"suggestions": "Suggestions:",
36-
"ldlConclusion": "Elevated LDL (bad cholesterol) increases your risk of cardiovascular disease",
37-
"ldlSuggestion1": "Consider a heart-healthy diet (e.g., Mediterranean).",
38-
"ldlSuggestion2": "Increase physical activity.",
39-
"ldlSuggestion3": "Discuss statin therapy with your doctor if not already on one.",
40-
"hemoglobinConclusion": "This level suggests anemia, which may cause fatigue and weakness.",
41-
"hemoglobinSuggestion1": "Test for iron, B12, and folate deficiency.",
42-
"hemoglobinSuggestion2": "Consider iron-rich foods or supplements after medical consultation already on one."
43-
},
44-
"list": {
45-
"title": "Reports",
46-
"emptyState": "No reports found",
47-
"uploadPrompt": "Upload a medical report to get started",
48-
"filterAll": "All",
49-
"filterBookmarked": "Bookmarked",
50-
"noBookmarksTitle": "No Bookmarked Reports",
51-
"noBookmarksMessage": "Bookmark reports to find them quickly here",
52-
"sortButton": "Sort reports",
53-
"filterButton": "Filter reports",
54-
"categoryGeneral": "General",
55-
"categoryBrain": "Brain",
56-
"categoryHeart": "Heart"
57-
}
58-
}
2+
"detail": {
3+
"title": "Report Detail",
4+
"loading": "Loading report...",
5+
"errorLoading": "Error loading report. Please try again later.",
6+
"aiInsights": "AI Insights",
7+
"testResults": "Test Results",
8+
"test": "Test",
9+
"results": "Results",
10+
"refRange": "Ref. Range",
11+
"reportDate": "Report Date",
12+
"medicalComments": "Medical Comments",
13+
"hemoglobin": "Hemoglobin",
14+
"ldl": "LDL Cholesterol",
15+
"glucose": "Fasting Blood Glucose",
16+
"alt": "ALT (Liver Enzyme)",
17+
"wbc": "WBC (White Blood Cells)",
18+
"vitaminD": "Vitamin D (25-OH)",
19+
"cholesterol": "Total Cholesterol",
20+
"bookmarkAdded": "Report added to bookmarks",
21+
"bookmarkRemoved": "Report removed from bookmarks",
22+
"aiInsightsContent": "Based on the blood test results, our AI has identified several points of interest that may require attention or further discussion with your healthcare provider.",
23+
"insight1Title": "Hemoglobin Level",
24+
"insight1Content": "Your hemoglobin level is slightly below the reference range. This could indicate mild anemia, which may cause fatigue and weakness.",
25+
"insight2Title": "Cholesterol Levels",
26+
"insight2Content": "Both your LDL cholesterol and total cholesterol are elevated, which may increase your risk for cardiovascular disease.",
27+
"insight3Title": "Blood Glucose",
28+
"insight3Content": "Your fasting blood glucose is elevated, potentially indicating prediabetes. Lifestyle modifications may help improve this value.",
29+
"hemoglobinComment": "The patient's hemoglobin level is 12.5 g/dL, which falls within the lower end of the normal reference range for most adults. While this value may still be considered acceptable, it is important to assess it in the context of the patient's age, sex, clinical symptoms, and medical history.",
30+
"emergencyWarning": "Please contact your doctor or seek emergency care immediately.",
31+
"flaggedValues": "Flagged values",
32+
"highLdl": "High LDL Cholesterol",
33+
"lowHemoglobin": "Low Hemoglobin (10.1 g/dL)",
34+
"conclusion": "Conclusion:",
35+
"suggestions": "Suggestions:",
36+
"ldlConclusion": "Elevated LDL (bad cholesterol) increases your risk of cardiovascular disease",
37+
"ldlSuggestion1": "Consider a heart-healthy diet (e.g., Mediterranean).",
38+
"ldlSuggestion2": "Increase physical activity.",
39+
"ldlSuggestion3": "Discuss statin therapy with your doctor if not already on one.",
40+
"hemoglobinConclusion": "This level suggests anemia, which may cause fatigue and weakness.",
41+
"hemoglobinSuggestion1": "Test for iron, B12, and folate deficiency.",
42+
"hemoglobinSuggestion2": "Consider iron-rich foods or supplements after medical consultation already on one."
43+
},
44+
"list": {
45+
"title": "Reports",
46+
"emptyState": "No reports found",
47+
"uploadPrompt": "Upload a medical report to get started",
48+
"filterAll": "All",
49+
"filterBookmarked": "Bookmarked",
50+
"noBookmarksTitle": "No Bookmarked Reports",
51+
"noBookmarksMessage": "Bookmark reports to find them quickly here",
52+
"sortButton": "Sort reports",
53+
"filterButton": "Filter reports",
54+
"generalCategory": "General",
55+
"brainCategory": "Brain",
56+
"heartCategory": "Heart"
57+
}
58+
}
Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
{
2-
"detail": {
3-
"title": "Report Detail",
4-
"loading": "Loading report...",
5-
"errorLoading": "Error loading report. Please try again later.",
6-
"aiInsights": "AI Insights",
7-
"testResults": "Test Results",
8-
"test": "Test",
9-
"results": "Results",
10-
"refRange": "Ref. Range",
11-
"reportDate": "Report Date",
12-
"medicalComments": "Medical Comments",
13-
"hemoglobin": "Hemoglobin",
14-
"ldl": "LDL Cholesterol",
15-
"glucose": "Fasting Blood Glucose",
16-
"alt": "ALT (Liver Enzyme)",
17-
"wbc": "WBC (White Blood Cells)",
18-
"vitaminD": "Vitamin D (25-OH)",
19-
"cholesterol": "Total Cholesterol",
20-
"bookmarkAdded": "Report added to bookmarks",
21-
"bookmarkRemoved": "Report removed from bookmarks",
22-
"aiInsightsContent": "Based on the blood test results, our AI has identified several points of interest that may require attention or further discussion with your healthcare provider.",
23-
"insight1Title": "Hemoglobin Level",
24-
"insight1Content": "Your hemoglobin level is slightly below the reference range. This could indicate mild anemia, which may cause fatigue and weakness.",
25-
"insight2Title": "Cholesterol Levels",
26-
"insight2Content": "Both your LDL cholesterol and total cholesterol are elevated, which may increase your risk for cardiovascular disease.",
27-
"insight3Title": "Blood Glucose",
28-
"insight3Content": "Your fasting blood glucose is elevated, potentially indicating prediabetes. Lifestyle modifications may help improve this value.",
29-
"hemoglobinComment": "The patient's hemoglobin level is 12.5 g/dL, which falls within the lower end of the normal reference range for most adults. While this value may still be considered acceptable, it is important to assess it in the context of the patient's age, sex, clinical symptoms, and medical history.",
30-
"emergencyWarning": "Please contact your doctor or seek emergency care immediately.",
31-
"flaggedValues": "Flagged values",
32-
"highLdl": "High LDL Cholesterol",
33-
"lowHemoglobin": "Low Hemoglobin (10.1 g/dL)",
34-
"conclusion": "Conclusion:",
35-
"suggestions": "Suggestions:",
36-
"ldlConclusion": "Elevated LDL (bad cholesterol) increases your risk of cardiovascular disease",
37-
"ldlSuggestion1": "Consider a heart-healthy diet (e.g., Mediterranean).",
38-
"ldlSuggestion2": "Increase physical activity.",
39-
"ldlSuggestion3": "Discuss statin therapy with your doctor if not already on one.",
40-
"hemoglobinConclusion": "This level suggests anemia, which may cause fatigue and weakness.",
41-
"hemoglobinSuggestion1": "Test for iron, B12, and folate deficiency.",
42-
"hemoglobinSuggestion2": "Consider iron-rich foods or supplements after medical consultation already on one."
43-
},
44-
"list": {
45-
"title": "Reports",
46-
"emptyState": "No reports found",
47-
"uploadPrompt": "Upload a medical report to get started",
48-
"filterAll": "All",
49-
"filterBookmarked": "Bookmarked",
50-
"noBookmarksTitle": "No Bookmarked Reports",
51-
"noBookmarksMessage": "Bookmark reports to find them quickly here",
52-
"sortButton": "Sort reports",
53-
"filterButton": "Filter reports",
54-
"categoryGeneral": "General",
55-
"categoryBrain": "Brain",
56-
"categoryHeart": "Heart"
57-
},
58-
"report": {
59-
"analysis": {
60-
"title": "Results Analysis"
2+
"detail": {
3+
"title": "Report Detail",
4+
"loading": "Loading report...",
5+
"errorLoading": "Error loading report. Please try again later.",
6+
"aiInsights": "AI Insights",
7+
"testResults": "Test Results",
8+
"test": "Test",
9+
"results": "Results",
10+
"refRange": "Ref. Range",
11+
"reportDate": "Report Date",
12+
"medicalComments": "Medical Comments",
13+
"hemoglobin": "Hemoglobin",
14+
"ldl": "LDL Cholesterol",
15+
"glucose": "Fasting Blood Glucose",
16+
"alt": "ALT (Liver Enzyme)",
17+
"wbc": "WBC (White Blood Cells)",
18+
"vitaminD": "Vitamin D (25-OH)",
19+
"cholesterol": "Total Cholesterol",
20+
"bookmarkAdded": "Report added to bookmarks",
21+
"bookmarkRemoved": "Report removed from bookmarks",
22+
"aiInsightsContent": "Based on the blood test results, our AI has identified several points of interest that may require attention or further discussion with your healthcare provider.",
23+
"insight1Title": "Hemoglobin Level",
24+
"insight1Content": "Your hemoglobin level is slightly below the reference range. This could indicate mild anemia, which may cause fatigue and weakness.",
25+
"insight2Title": "Cholesterol Levels",
26+
"insight2Content": "Both your LDL cholesterol and total cholesterol are elevated, which may increase your risk for cardiovascular disease.",
27+
"insight3Title": "Blood Glucose",
28+
"insight3Content": "Your fasting blood glucose is elevated, potentially indicating prediabetes. Lifestyle modifications may help improve this value.",
29+
"hemoglobinComment": "The patient's hemoglobin level is 12.5 g/dL, which falls within the lower end of the normal reference range for most adults. While this value may still be considered acceptable, it is important to assess it in the context of the patient's age, sex, clinical symptoms, and medical history.",
30+
"emergencyWarning": "Please contact your doctor or seek emergency care immediately.",
31+
"flaggedValues": "Flagged values",
32+
"highLdl": "High LDL Cholesterol",
33+
"lowHemoglobin": "Low Hemoglobin (10.1 g/dL)",
34+
"conclusion": "Conclusion:",
35+
"suggestions": "Suggestions:",
36+
"ldlConclusion": "Elevated LDL (bad cholesterol) increases your risk of cardiovascular disease",
37+
"ldlSuggestion1": "Consider a heart-healthy diet (e.g., Mediterranean).",
38+
"ldlSuggestion2": "Increase physical activity.",
39+
"ldlSuggestion3": "Discuss statin therapy with your doctor if not already on one.",
40+
"hemoglobinConclusion": "This level suggests anemia, which may cause fatigue and weakness.",
41+
"hemoglobinSuggestion1": "Test for iron, B12, and folate deficiency.",
42+
"hemoglobinSuggestion2": "Consider iron-rich foods or supplements after medical consultation already on one."
6143
},
62-
"emergency": {
63-
"message": "Please contact your doctor or seek emergency care immediately."
44+
"list": {
45+
"title": "Reports",
46+
"emptyState": "No reports found",
47+
"uploadPrompt": "Upload a medical report to get started",
48+
"filterAll": "All",
49+
"filterBookmarked": "Bookmarked",
50+
"noBookmarksTitle": "No Bookmarked Reports",
51+
"noBookmarksMessage": "Bookmark reports to find them quickly here",
52+
"sortButton": "Sort reports",
53+
"filterButton": "Filter reports",
54+
"generalCategory": "General",
55+
"brainCategory": "Brain",
56+
"heartCategory": "Heart"
6457
},
65-
"flagged-values": {
66-
"title": "Flagged values"
67-
},
68-
"normal-values": {
69-
"title": "Normal values"
70-
},
71-
"conclusion": {
72-
"title": "Conclusion"
73-
},
74-
"suggestions": {
75-
"title": "Suggestions"
76-
},
77-
"doctor-note": "With all interpretations, these results should be discussed with your doctor.",
78-
"ai-help": {
79-
"title": "Still need further clarifications?",
80-
"action": "Ask our AI Assistant"
81-
},
82-
"action": {
83-
"discard": "Discard",
84-
"new-upload": "New Upload"
85-
},
86-
"tabs": {
87-
"ai-insights": "AI Insights",
88-
"original-report": "Original Report"
58+
"report": {
59+
"analysis": {
60+
"title": "Results Analysis"
61+
},
62+
"emergency": {
63+
"message": "Please contact your doctor or seek emergency care immediately."
64+
},
65+
"flagged-values": {
66+
"title": "Flagged values"
67+
},
68+
"normal-values": {
69+
"title": "Normal values"
70+
},
71+
"conclusion": {
72+
"title": "Conclusion"
73+
},
74+
"suggestions": {
75+
"title": "Suggestions"
76+
},
77+
"doctor-note": "With all interpretations, these results should be discussed with your doctor.",
78+
"ai-help": {
79+
"title": "Still need further clarifications?",
80+
"action": "Ask our AI Assistant"
81+
},
82+
"action": {
83+
"discard": "Discard",
84+
"new-upload": "New Upload"
85+
},
86+
"tabs": {
87+
"ai-insights": "AI Insights",
88+
"original-report": "Original Report"
89+
}
8990
}
90-
}
9191
}

0 commit comments

Comments
 (0)