Skip to content

Commit e40f73c

Browse files
committed
BN-50 | Refactor. Rename Order Terminology To Investigation
1 parent 4fc286c commit e40f73c

File tree

6 files changed

+44
-30
lines changed

6 files changed

+44
-30
lines changed

public/locales/locale_en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"ERROR_FETCHING_DIAGNOSES": "Error fetching diagnoses. Please try again later.",
8484
"ERROR_FETCHING_ENCOUNTER_DETAILS": "Error fetching encounter details",
8585
"ERROR_FETCHING_LOCATIONS_DETAILS": "Error fetching locations details",
86-
"ERROR_FETCHING_RADIOLOGY_ORDERS": "Error fetching radiology orders",
86+
"ERROR_FETCHING_RADIOLOGY_INVESTIGATIONS": "Error fetching radiology investigations",
8787
"ERROR_FETCHING_PRACTITIONERS_DETAILS": "Error fetching practitioners details",
8888
"ERROR_FETCHING_USER_DETAILS": "Error fetching user details",
8989
"ERROR_INVALID_PATIENT_UUID": "Invalid patient UUID",
@@ -128,7 +128,7 @@
128128
"NO_DIAGNOSES": "No diagnoses recorded",
129129
"NO_MATCHING_ALLERGEN_FOUND": "No matching allergen found",
130130
"NO_MATCHING_DIAGNOSIS_FOUND": "No matching diagnosis found.",
131-
"NO_RADIOLOGY_ORDERS": "No radiology orders found",
131+
"NO_RADIOLOGY_INVESTIGATIONS": "No radiology investigations found",
132132
"PARTICIPANT": "Participant(s)",
133133
"PATIENT_HEADER_ACTION_AREA_IN_PROGRESS": "Consultation in progress",
134134
"PATIENT_HEADER_LABEL": "Patient Header",

public/locales/locale_es.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"ERROR_FETCHING_DIAGNOSES": "Error al obtener datos de diagnósticos. Por favor, inténtelo de nuevo más tarde.",
8484
"ERROR_FETCHING_ENCOUNTER_DETAILS": "Error al obtener los detalles del encuentro",
8585
"ERROR_FETCHING_LOCATIONS_DETAILS": "Error al obtener detalles de ubicaciones",
86-
"ERROR_FETCHING_RADIOLOGY_ORDERS": "Error al obtener órdenes de radiología",
86+
"ERROR_FETCHING_RADIOLOGY_INVESTIGATIONS": "Error al obtener investigaciones de radiología",
8787
"ERROR_FETCHING_PRACTITIONERS_DETAILS": "Error al obtener detalles de profesionales médicos",
8888
"ERROR_FETCHING_USER_DETAILS": "Error al obtener detalles del usuario",
8989
"ERROR_INVALID_PATIENT_UUID": "UUID de paciente inválido",
@@ -128,7 +128,7 @@
128128
"NO_DIAGNOSES": "No hay diagnósticos registrados",
129129
"NO_MATCHING_ALLERGEN_FOUND": "No se encontró ningún alérgeno coincidente",
130130
"NO_MATCHING_DIAGNOSIS_FOUND": "No se encontraron diagnósticos coincidentes",
131-
"NO_RADIOLOGY_ORDERS": "No se encontraron órdenes de radiología",
131+
"NO_RADIOLOGY_INVESTIGATIONS": "No se encontraron investigaciones de radiología",
132132
"PARTICIPANT": "Partícipe(es)",
133133
"PATIENT_HEADER_ACTION_AREA_IN_PROGRESS": "Consulta en progreso",
134134
"PATIENT_HEADER_LABEL": "Cabecera del Paciente",

src/components/clinical/dashboardSection/__tests__/DashboardSection.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jest.mock(
5353
() => ({
5454
__esModule: true,
5555
default: () => (
56-
<div data-testid="radiology-orders-table">Radiology Orders Table</div>
56+
<div data-testid="radiology-investigations-table">
57+
Radiology Orders Table
58+
</div>
5759
),
5860
}),
5961
);
@@ -176,7 +178,9 @@ describe('DashboardSection Component', () => {
176178

177179
render(<DashboardSection section={radiologySection} ref={mockRef} />);
178180

179-
expect(screen.getByTestId('radiology-orders-table')).toBeInTheDocument();
181+
expect(
182+
screen.getByTestId('radiology-investigations-table'),
183+
).toBeInTheDocument();
180184
});
181185

182186
it('renders no content for unknown section types', () => {

src/displayControls/radiologyInvestigation/RadiologyInvestigationTable.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,32 @@ const RadiologyInvestigationTable: React.FC = () => {
4545
radiologyInvestigations,
4646
);
4747

48-
const grouped = groupByDate(filteredInvestigations, (order) => {
49-
const result = formatDate(order.orderedDate, ISO_DATE_FORMAT);
48+
const grouped = groupByDate(filteredInvestigations, (investigation) => {
49+
const result = formatDate(investigation.orderedDate, ISO_DATE_FORMAT);
5050
return result.formattedResult;
5151
});
5252

5353
const groupedData = grouped.map((group) => ({
5454
date: group.date,
55-
orders: group.items,
55+
investigations: group.items,
5656
}));
5757

5858
return groupedData.map((investigationsByDate) => ({
5959
...investigationsByDate,
60-
orders: sortRadiologyInvestigationsByPriority(
61-
investigationsByDate.orders,
60+
investigations: sortRadiologyInvestigationsByPriority(
61+
investigationsByDate.investigations,
6262
),
6363
}));
6464
}, [radiologyInvestigations]);
6565

6666
const renderCell = useCallback(
67-
(order: RadiologyInvestigation, cellId: string) => {
67+
(investigation: RadiologyInvestigation, cellId: string) => {
6868
switch (cellId) {
6969
case 'testName':
7070
return (
7171
<>
72-
{order.testName + ' '}
73-
{order.priority === 'stat' && (
72+
{investigation.testName + ' '}
73+
{investigation.priority === 'stat' && (
7474
<Tag className={styles.urgentCell}>
7575
{t('RADIOLOGY_PRIORITY_URGENT')}
7676
</Tag>
@@ -80,7 +80,7 @@ const RadiologyInvestigationTable: React.FC = () => {
8080
case 'results':
8181
return '--';
8282
case 'orderedBy':
83-
return order.orderedBy;
83+
return investigation.orderedBy;
8484
}
8585
},
8686
[],
@@ -89,7 +89,7 @@ const RadiologyInvestigationTable: React.FC = () => {
8989
return (
9090
<Tile
9191
title={t('RADIOLOGY_INVESTIGATION_HEADING')}
92-
data-testid="radiology-orders-table"
92+
data-testid="radiology-investigations-table"
9393
className={styles.radiologyInvestigationTable}
9494
>
9595
<div className={styles.radiologyInvestigationTableTitle}>
@@ -107,16 +107,16 @@ const RadiologyInvestigationTable: React.FC = () => {
107107
)}
108108
{error && (
109109
<p className={styles.radiologyInvestigationTableBodyError}>
110-
{t('ERROR_FETCHING_RADIOLOGY_ORDERS')}
110+
{t('ERROR_FETCHING_RADIOLOGY_INVESTIGATIONS')}
111111
</p>
112112
)}
113113
{!loading && !error && radiologyInvestigations.length === 0 && (
114114
<p className={styles.radiologyInvestigationTableBodyError}>
115-
{t('NO_RADIOLOGY_ORDERS')}
115+
{t('NO_RADIOLOGY_INVESTIGATIONS')}
116116
</p>
117117
)}
118-
{processedInvestigations.map((ordersByDate, index) => {
119-
const { date, orders } = ordersByDate;
118+
{processedInvestigations.map((investigationsByDate, index) => {
119+
const { date, investigations } = investigationsByDate;
120120

121121
const formattedDate = formatDate(
122122
date,
@@ -127,13 +127,13 @@ const RadiologyInvestigationTable: React.FC = () => {
127127
<ExpandableDataTable
128128
key={date}
129129
tableTitle={formattedDate}
130-
rows={orders}
130+
rows={investigations}
131131
headers={headers}
132132
sortable={sortable}
133133
renderCell={renderCell}
134134
loading={false}
135135
error={null}
136-
emptyStateMessage={t('NO_RADIOLOGY_ORDERS')}
136+
emptyStateMessage={t('NO_RADIOLOGY_INVESTIGATIONS')}
137137
className={styles.radiologyInvestigationTableBody}
138138
isOpen={index === 0}
139139
/>

src/displayControls/radiologyInvestigation/__tests__/RadiologyInvestigationTable.integration.test.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ describe('RadiologyInvestigationTable Integration Tests', () => {
214214
});
215215

216216
// Assert - Empty state message should be displayed
217-
expect(screen.getByText('No radiology orders found')).toBeInTheDocument();
217+
expect(
218+
screen.getByText('No radiology investigations found'),
219+
).toBeInTheDocument();
218220

219221
// Assert - No accordion tables should be rendered
220222
expect(
@@ -249,7 +251,7 @@ describe('RadiologyInvestigationTable Integration Tests', () => {
249251

250252
await waitFor(() => {
251253
expect(
252-
screen.getByText('Error fetching radiology orders'),
254+
screen.getByText('Error fetching radiology investigations'),
253255
).toBeInTheDocument();
254256
});
255257

@@ -276,7 +278,7 @@ describe('RadiologyInvestigationTable Integration Tests', () => {
276278

277279
// Assert - Error message should be displayed
278280
expect(
279-
screen.getByText('Error fetching radiology orders'),
281+
screen.getByText('Error fetching radiology investigations'),
280282
).toBeInTheDocument();
281283

282284
// Assert - Component title should still be present
@@ -334,9 +336,13 @@ describe('RadiologyInvestigationTable Integration Tests', () => {
334336
});
335337

336338
// Assert - Basic component structure should be present
337-
expect(screen.getByTestId('radiology-orders-table')).toBeInTheDocument();
339+
expect(
340+
screen.getByTestId('radiology-investigations-table'),
341+
).toBeInTheDocument();
338342
expect(screen.getByText('Radiology Investigations')).toBeInTheDocument();
339-
expect(screen.getByText('No radiology orders found')).toBeInTheDocument();
343+
expect(
344+
screen.getByText('No radiology investigations found'),
345+
).toBeInTheDocument();
340346
});
341347
});
342348

src/displayControls/radiologyInvestigation/__tests__/RadiologyInvestigationTable.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ describe('RadiologyInvestigationTable', () => {
202202
render(<RadiologyInvestigationTable />);
203203

204204
// Assert
205-
expect(screen.getByText('No radiology orders found')).toBeInTheDocument();
205+
expect(
206+
screen.getByText('No radiology investigations found'),
207+
).toBeInTheDocument();
206208
});
207209

208210
it('should display loading and error states', () => {
@@ -233,7 +235,7 @@ describe('RadiologyInvestigationTable', () => {
233235

234236
// Assert - Error
235237
expect(
236-
screen.getByText('Error fetching radiology orders'),
238+
screen.getByText('Error fetching radiology investigations'),
237239
).toBeInTheDocument();
238240
});
239241

@@ -419,7 +421,9 @@ describe('RadiologyInvestigationTable', () => {
419421
render(<RadiologyInvestigationTable />);
420422

421423
// Assert
422-
expect(screen.getByTestId('radiology-orders-table')).toBeInTheDocument();
424+
expect(
425+
screen.getByTestId('radiology-investigations-table'),
426+
).toBeInTheDocument();
423427
});
424428

425429
it('should handle multiple priority types correctly', async () => {

0 commit comments

Comments
 (0)