@kenyaemr/esm-lab-manifest-app 5.2.1-pre.821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +39 -0
- package/LICENSE.md +401 -0
- package/README.md +5 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/397.js +1 -0
- package/dist/397.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/589.js +1 -0
- package/dist/589.js.map +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/712.js +1 -0
- package/dist/712.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/803.js +1 -0
- package/dist/803.js.map +1 -0
- package/dist/883.js +1 -0
- package/dist/883.js.map +1 -0
- package/dist/896.js +1 -0
- package/dist/896.js.map +1 -0
- package/dist/949.js +1 -0
- package/dist/949.js.map +1 -0
- package/dist/975.js +2 -0
- package/dist/975.js.LICENSE.txt +50 -0
- package/dist/975.js.map +1 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js +1 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js.buildmanifest.json +526 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +8 -0
- package/package.json +55 -0
- package/src/component/lab-manifest-detail.component.tsx +21 -0
- package/src/component/lab-manifest.component.tsx +18 -0
- package/src/component/left-panel-link.component.tsx +41 -0
- package/src/config-schema.ts +5 -0
- package/src/counties.json +1494 -0
- package/src/declarations.d.ts +6 -0
- package/src/forms/lab-manifest-form.scss +126 -0
- package/src/forms/lab-manifest-form.workspace.tsx +357 -0
- package/src/header/lab-manifest-detail-header.component.tsx +74 -0
- package/src/header/lab-manifest-header.component.tsx +36 -0
- package/src/header/lab-manifest-header.scss +105 -0
- package/src/header/lab-manifest-illustration.component.tsx +13 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useActiveRequests.ts +26 -0
- package/src/hooks/useLabManifest.tsx +17 -0
- package/src/hooks/useLabManifests.ts +17 -0
- package/src/index.ts +36 -0
- package/src/lab-manifest.mock.ts +5 -0
- package/src/lab-manifest.resources.ts +108 -0
- package/src/metrics/lab-manifest-header.scss +22 -0
- package/src/metrics/lab-manifest-metric-value.component.tsx +25 -0
- package/src/metrics/lab-manifest-metrics-header.component.tsx +34 -0
- package/src/metrics/lab-manifest-metrics.component.tsx +27 -0
- package/src/metrics/lab-manifest-metrics.scss +17 -0
- package/src/root.component.tsx +19 -0
- package/src/root.scss +15 -0
- package/src/routes.json +33 -0
- package/src/setup-tests.ts +1 -0
- package/src/tables/lab-manifest-active-requests.component.tsx +161 -0
- package/src/tables/lab-manifest-samples.component.tsx +164 -0
- package/src/tables/lab-manifest-table.component.tsx +214 -0
- package/src/tables/lab-manifest-table.scss +49 -0
- package/src/tabs/lab-manifest-tabs-component.tsx +33 -0
- package/src/tabs/lab-manifest-tabs.scss +28 -0
- package/src/types/index.ts +75 -0
- package/translations/en.json +33 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
DataTable,
|
|
4
|
+
DataTableSkeleton,
|
|
5
|
+
Pagination,
|
|
6
|
+
Table,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
TableContainer,
|
|
10
|
+
TableHead,
|
|
11
|
+
TableHeader,
|
|
12
|
+
TableRow,
|
|
13
|
+
} from '@carbon/react';
|
|
14
|
+
import { TrashCan, View } from '@carbon/react/icons';
|
|
15
|
+
import { ErrorState, formatDate, navigate, parseDate, useLayoutType, usePagination } from '@openmrs/esm-framework';
|
|
16
|
+
import { CardHeader, EmptyState, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
17
|
+
import React, { useState } from 'react';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
19
|
+
import styles from './lab-manifest-table.scss';
|
|
20
|
+
import { useLabManifest } from '../hooks';
|
|
21
|
+
import { LabManifestSample } from '../types';
|
|
22
|
+
|
|
23
|
+
interface LabManifestSamplesProps {
|
|
24
|
+
manifestUuid: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const LabManifestSamples: React.FC<LabManifestSamplesProps> = ({ manifestUuid }) => {
|
|
28
|
+
const { error, isLoading, manifest } = useLabManifest(manifestUuid);
|
|
29
|
+
const samples = manifest?.samples ?? [];
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
const [pageSize, setPageSize] = useState(10);
|
|
32
|
+
const headerTitle = t('labManifestSamples', 'Lab Manifest Samples');
|
|
33
|
+
const { results, totalPages, currentPage, goTo } = usePagination(samples, pageSize);
|
|
34
|
+
const { pageSizes } = usePaginationInfo(pageSize, totalPages, currentPage, results.length);
|
|
35
|
+
|
|
36
|
+
const headers = [
|
|
37
|
+
{
|
|
38
|
+
header: t('patient', 'Patient'),
|
|
39
|
+
key: 'cccKDODNumber',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
header: t('batchNumber', 'Batch Number'),
|
|
43
|
+
key: 'batchNumber',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
header: t('sampleType', 'Sample type'),
|
|
47
|
+
key: 'sampleType',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: t('status', 'Status'),
|
|
51
|
+
key: 'status',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: t('dateRequested', 'Date Requested'),
|
|
55
|
+
key: 'dateRequested',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
header: t('resultDate', 'Result Date'),
|
|
59
|
+
key: 'resultDate',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
header: t('result', 'Result'),
|
|
63
|
+
key: 'result',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: t('actions', 'Actions'),
|
|
67
|
+
key: 'actions',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const handleDeleteManifestSample = (manifestUuid: string) => {
|
|
72
|
+
// TODO Implement delete logic when endpoint is a ready
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const tableRows =
|
|
76
|
+
(results as LabManifestSample[])?.map((sample) => {
|
|
77
|
+
return {
|
|
78
|
+
id: `${sample.uuid}`,
|
|
79
|
+
sampleType: sample.sampleType ?? '--',
|
|
80
|
+
status: sample.status,
|
|
81
|
+
batchNumber: sample.batchNumber ?? '--',
|
|
82
|
+
cccKDODNumber: sample?.order?.patient?.identifiers[0]?.identifier ?? '--',
|
|
83
|
+
dateRequested: sample.dateSent ? formatDate(parseDate(sample.dateSent)) : '--',
|
|
84
|
+
resultDate: sample.resultDate ? formatDate(parseDate(sample.resultDate)) : '--',
|
|
85
|
+
result: sample.result ?? '--',
|
|
86
|
+
actions: (
|
|
87
|
+
<Button
|
|
88
|
+
renderIcon={TrashCan}
|
|
89
|
+
hasIconOnly
|
|
90
|
+
kind="tertiary"
|
|
91
|
+
iconDescription={t('removeFromManifest', 'Remove from Manifest')}
|
|
92
|
+
onClick={() => handleDeleteManifestSample(sample.uuid)}
|
|
93
|
+
/>
|
|
94
|
+
),
|
|
95
|
+
};
|
|
96
|
+
}) ?? [];
|
|
97
|
+
|
|
98
|
+
if (isLoading) {
|
|
99
|
+
return <DataTableSkeleton rowCount={5} />;
|
|
100
|
+
}
|
|
101
|
+
if (error) {
|
|
102
|
+
return <ErrorState headerTitle={headerTitle} error={error} />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (samples.length === 0) {
|
|
106
|
+
return (
|
|
107
|
+
<EmptyState
|
|
108
|
+
headerTitle={t('manifestSamples', 'Manifest Samples')}
|
|
109
|
+
displayText={t('notLabManifetToDisplay', 'There is no lab manifets data to display.')}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return (
|
|
114
|
+
<div className={styles.widgetContainer}>
|
|
115
|
+
<CardHeader title={headerTitle}>{''}</CardHeader>
|
|
116
|
+
<DataTable
|
|
117
|
+
useZebraStyles
|
|
118
|
+
size="sm"
|
|
119
|
+
rows={tableRows ?? []}
|
|
120
|
+
headers={headers}
|
|
121
|
+
render={({ rows, headers, getHeaderProps, getTableProps, getTableContainerProps }) => (
|
|
122
|
+
<TableContainer {...getTableContainerProps()}>
|
|
123
|
+
<Table {...getTableProps()}>
|
|
124
|
+
<TableHead>
|
|
125
|
+
<TableRow>
|
|
126
|
+
{headers.map((header) => (
|
|
127
|
+
<TableHeader
|
|
128
|
+
{...getHeaderProps({
|
|
129
|
+
header,
|
|
130
|
+
isSortable: header.isSortable,
|
|
131
|
+
})}>
|
|
132
|
+
{header.header?.content ?? header.header}
|
|
133
|
+
</TableHeader>
|
|
134
|
+
))}
|
|
135
|
+
</TableRow>
|
|
136
|
+
</TableHead>
|
|
137
|
+
<TableBody>
|
|
138
|
+
{rows.map((row) => (
|
|
139
|
+
<TableRow key={row.id}>
|
|
140
|
+
{row.cells.map((cell) => (
|
|
141
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
142
|
+
))}
|
|
143
|
+
</TableRow>
|
|
144
|
+
))}
|
|
145
|
+
</TableBody>
|
|
146
|
+
</Table>
|
|
147
|
+
</TableContainer>
|
|
148
|
+
)}
|
|
149
|
+
/>
|
|
150
|
+
<Pagination
|
|
151
|
+
page={currentPage}
|
|
152
|
+
pageSize={pageSize}
|
|
153
|
+
pageSizes={pageSizes}
|
|
154
|
+
totalItems={samples.length}
|
|
155
|
+
onChange={({ page, pageSize }) => {
|
|
156
|
+
goTo(page);
|
|
157
|
+
setPageSize(pageSize);
|
|
158
|
+
}}
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export default LabManifestSamples;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
DataTable,
|
|
4
|
+
DataTableSkeleton,
|
|
5
|
+
Dropdown,
|
|
6
|
+
Layer,
|
|
7
|
+
Pagination,
|
|
8
|
+
Table,
|
|
9
|
+
TableBody,
|
|
10
|
+
TableCell,
|
|
11
|
+
TableContainer,
|
|
12
|
+
TableHead,
|
|
13
|
+
TableHeader,
|
|
14
|
+
TableRow,
|
|
15
|
+
Tile,
|
|
16
|
+
} from '@carbon/react';
|
|
17
|
+
import { View } from '@carbon/react/icons';
|
|
18
|
+
import {
|
|
19
|
+
ErrorState,
|
|
20
|
+
formatDate,
|
|
21
|
+
isDesktop,
|
|
22
|
+
navigate,
|
|
23
|
+
parseDate,
|
|
24
|
+
useLayoutType,
|
|
25
|
+
usePagination,
|
|
26
|
+
} from '@openmrs/esm-framework';
|
|
27
|
+
import { CardHeader, EmptyDataIllustration, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
28
|
+
import React, { useState } from 'react';
|
|
29
|
+
import { useTranslation } from 'react-i18next';
|
|
30
|
+
import { useLabManifests } from '../hooks';
|
|
31
|
+
import { LabManifestFilters } from '../lab-manifest.resources';
|
|
32
|
+
import styles from './lab-manifest-table.scss';
|
|
33
|
+
|
|
34
|
+
const LabManifestsTable = () => {
|
|
35
|
+
const { t } = useTranslation();
|
|
36
|
+
const [pageSize, setPageSize] = useState(10);
|
|
37
|
+
const [currFilter, setCurrFilter] = useState('Draft');
|
|
38
|
+
const headerTitle = t('lab Manifest', 'Lab Manifest');
|
|
39
|
+
const layout = useLayoutType();
|
|
40
|
+
const { manifests, error, isLoading } = useLabManifests(currFilter);
|
|
41
|
+
const { results, totalPages, currentPage, goTo } = usePagination(manifests, pageSize);
|
|
42
|
+
const { pageSizes } = usePaginationInfo(pageSize, totalPages, currentPage, results.length);
|
|
43
|
+
|
|
44
|
+
const headers = [
|
|
45
|
+
{
|
|
46
|
+
header: t('startDate', 'Start date'),
|
|
47
|
+
key: 'startDate',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: t('endDate', 'End Date'),
|
|
51
|
+
key: 'endDate',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: t('type', 'Type'),
|
|
55
|
+
key: 'type',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
header: t('courrier', 'Courrier'),
|
|
59
|
+
key: 'courrier',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
header: t('manifestId', 'Manifest Id'),
|
|
63
|
+
key: 'manifestId',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: t('labPersonContact', 'Lab person Contact'),
|
|
67
|
+
key: 'labPersonContact',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
header: t('status', 'Status'),
|
|
71
|
+
key: 'status',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: t('dispatch', 'Dispatch'),
|
|
75
|
+
key: 'dispatch',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
header: t('samples', 'Samples'),
|
|
79
|
+
key: 'samples',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
header: t('actions', 'Actions'),
|
|
83
|
+
key: 'actions',
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
const handleViewManifestSamples = (manifestUuid: string) => {
|
|
88
|
+
navigate({ to: window.getOpenmrsSpaBase() + `home/lab-manifest/${manifestUuid}` });
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const tableRows =
|
|
92
|
+
results?.map((manifest) => {
|
|
93
|
+
return {
|
|
94
|
+
id: `${manifest.uuid}`,
|
|
95
|
+
startDate: manifest.startDate ? formatDate(parseDate(manifest.startDate)) : '--',
|
|
96
|
+
endDate: manifest.endDate ? formatDate(parseDate(manifest.endDate)) : '--',
|
|
97
|
+
courrier: manifest.courierName ? manifest.courierName : '--',
|
|
98
|
+
labPersonContact: manifest.labPersonContact ?? '--',
|
|
99
|
+
type: manifest.manifestType ?? '--',
|
|
100
|
+
status: manifest.manifestStatus ?? '--',
|
|
101
|
+
dispatch: manifest.dispatchDate ? formatDate(parseDate(manifest.dispatchDate)) : '--',
|
|
102
|
+
manifestId: manifest.manifestId ?? '--',
|
|
103
|
+
samples: `${manifest.samples.length}`,
|
|
104
|
+
actions: (
|
|
105
|
+
<Button
|
|
106
|
+
renderIcon={View}
|
|
107
|
+
hasIconOnly
|
|
108
|
+
kind="tertiary"
|
|
109
|
+
iconDescription={t('view', 'View')}
|
|
110
|
+
onClick={() => handleViewManifestSamples(manifest.uuid)}
|
|
111
|
+
/>
|
|
112
|
+
),
|
|
113
|
+
};
|
|
114
|
+
}) ?? [];
|
|
115
|
+
|
|
116
|
+
if (isLoading) {
|
|
117
|
+
return <DataTableSkeleton rowCount={5} />;
|
|
118
|
+
}
|
|
119
|
+
if (error) {
|
|
120
|
+
return <ErrorState headerTitle={headerTitle} error={error} />;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (manifests.length === 0) {
|
|
124
|
+
return (
|
|
125
|
+
<Layer>
|
|
126
|
+
<Tile className={styles.tile}>
|
|
127
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
128
|
+
<h4>{headerTitle}</h4>
|
|
129
|
+
<div style={{ padding: '10px' }}>
|
|
130
|
+
<Dropdown
|
|
131
|
+
style={{ minWidth: '300px' }}
|
|
132
|
+
id="manifestStatus"
|
|
133
|
+
onChange={({ selectedItem }) => {
|
|
134
|
+
setCurrFilter(selectedItem);
|
|
135
|
+
}}
|
|
136
|
+
initialSelectedItem={currFilter}
|
|
137
|
+
label={t('selectManifestStatus', 'Select manifest status')}
|
|
138
|
+
items={LabManifestFilters.map((mn) => mn.value)}
|
|
139
|
+
itemToString={(item) => LabManifestFilters.find((lm) => lm.value === item)?.label ?? ''}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
<EmptyDataIllustration />
|
|
144
|
+
<p className={styles.content}>{t('notLabManifetToDisplay', 'There is no lab manifets data to display.')}</p>
|
|
145
|
+
</Tile>
|
|
146
|
+
</Layer>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return (
|
|
150
|
+
<div className={styles.widgetContainer}>
|
|
151
|
+
<CardHeader title={headerTitle}>
|
|
152
|
+
<div style={{ padding: '10px' }}>
|
|
153
|
+
<Dropdown
|
|
154
|
+
style={{ minWidth: '300px' }}
|
|
155
|
+
id="manifestStatus"
|
|
156
|
+
onChange={({ selectedItem }) => {
|
|
157
|
+
setCurrFilter(selectedItem);
|
|
158
|
+
}}
|
|
159
|
+
initialSelectedItem={currFilter}
|
|
160
|
+
label={t('selectManifestStatus', 'Select manifest status')}
|
|
161
|
+
items={LabManifestFilters.map((mn) => mn.value)}
|
|
162
|
+
itemToString={(item) => LabManifestFilters.find((lm) => lm.value === item)?.label ?? ''}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
</CardHeader>
|
|
166
|
+
<DataTable
|
|
167
|
+
useZebraStyles
|
|
168
|
+
size="sm"
|
|
169
|
+
rows={tableRows ?? []}
|
|
170
|
+
headers={headers}
|
|
171
|
+
render={({ rows, headers, getHeaderProps, getTableProps, getTableContainerProps }) => (
|
|
172
|
+
<TableContainer {...getTableContainerProps()}>
|
|
173
|
+
<Table {...getTableProps()}>
|
|
174
|
+
<TableHead>
|
|
175
|
+
<TableRow>
|
|
176
|
+
{headers.map((header) => (
|
|
177
|
+
<TableHeader
|
|
178
|
+
{...getHeaderProps({
|
|
179
|
+
header,
|
|
180
|
+
isSortable: header.isSortable,
|
|
181
|
+
})}>
|
|
182
|
+
{header.header?.content ?? header.header}
|
|
183
|
+
</TableHeader>
|
|
184
|
+
))}
|
|
185
|
+
</TableRow>
|
|
186
|
+
</TableHead>
|
|
187
|
+
<TableBody>
|
|
188
|
+
{rows.map((row) => (
|
|
189
|
+
<TableRow key={row.id}>
|
|
190
|
+
{row.cells.map((cell) => (
|
|
191
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
192
|
+
))}
|
|
193
|
+
</TableRow>
|
|
194
|
+
))}
|
|
195
|
+
</TableBody>
|
|
196
|
+
</Table>
|
|
197
|
+
</TableContainer>
|
|
198
|
+
)}
|
|
199
|
+
/>
|
|
200
|
+
<Pagination
|
|
201
|
+
page={currentPage}
|
|
202
|
+
pageSize={pageSize}
|
|
203
|
+
pageSizes={pageSizes}
|
|
204
|
+
totalItems={manifests.length}
|
|
205
|
+
onChange={({ page, pageSize }) => {
|
|
206
|
+
goTo(page);
|
|
207
|
+
setPageSize(pageSize);
|
|
208
|
+
}}
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export default LabManifestsTable;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@carbon/styles/scss/spacing';
|
|
5
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
|
6
|
+
|
|
7
|
+
.widgetContainer {
|
|
8
|
+
background-color: colors.$white-0;
|
|
9
|
+
border: spacing.$spacing-01 solid colors.$gray-20;
|
|
10
|
+
margin-bottom: spacing.$spacing-02;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.widgetContainer :global(.cds--data-table) thead th button span {
|
|
14
|
+
height: unset !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tile {
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.content {
|
|
22
|
+
@include type.type-style('heading-compact-01');
|
|
23
|
+
color: colors.$gray-70;
|
|
24
|
+
margin-top: layout.$layout-05;
|
|
25
|
+
margin-bottom: layout.$spacing-03;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.desktopHeading,
|
|
29
|
+
.tabletHeading {
|
|
30
|
+
text-align: left;
|
|
31
|
+
text-transform: capitalize;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
|
|
36
|
+
h4 {
|
|
37
|
+
@include type.type-style('heading-compact-02');
|
|
38
|
+
color: colors.$gray-70;
|
|
39
|
+
|
|
40
|
+
&:after {
|
|
41
|
+
content: '';
|
|
42
|
+
display: block;
|
|
43
|
+
width: spacing.$spacing-01;
|
|
44
|
+
padding-top: spacing.$spacing-03;
|
|
45
|
+
border-bottom: spacing.$spacing-01 solid;
|
|
46
|
+
@include brand-03(border-bottom-color);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import LabManifestActiveRequests from '../tables/lab-manifest-active-requests.component';
|
|
5
|
+
import LabManifestSamples from '../tables/lab-manifest-samples.component';
|
|
6
|
+
import styles from './lab-manifest-tabs.scss';
|
|
7
|
+
|
|
8
|
+
interface LabManifestTabsProps {
|
|
9
|
+
manifestUuid: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const LabManifestTabs: React.FC<LabManifestTabsProps> = ({ manifestUuid }) => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<main>
|
|
17
|
+
<Tabs className={styles.tabs}>
|
|
18
|
+
<TabList className={styles.tablist} aria-label="List tabs" contained>
|
|
19
|
+
<Tab className={styles.tab}>{t('manifestSamples', 'ManifestSamples')}</Tab>
|
|
20
|
+
<Tab className={styles.tab}>{t('activeRequests', 'Active Requests')}</Tab>
|
|
21
|
+
</TabList>
|
|
22
|
+
<TabPanels>
|
|
23
|
+
<TabPanel>
|
|
24
|
+
<LabManifestSamples manifestUuid={manifestUuid} />
|
|
25
|
+
</TabPanel>
|
|
26
|
+
<TabPanel>
|
|
27
|
+
<LabManifestActiveRequests manifestUuid={manifestUuid} />
|
|
28
|
+
</TabPanel>
|
|
29
|
+
</TabPanels>
|
|
30
|
+
</Tabs>
|
|
31
|
+
</main>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
|
3
|
+
@use '@carbon/styles/scss/type';
|
|
4
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
|
5
|
+
|
|
6
|
+
.tabs {
|
|
7
|
+
grid-column: span 2;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.tablist {
|
|
11
|
+
padding: 0 spacing.$spacing-05;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tab {
|
|
15
|
+
min-width: 8.875rem;
|
|
16
|
+
|
|
17
|
+
&:active {
|
|
18
|
+
outline: 2px solid var(--brand-03) !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:focus {
|
|
22
|
+
outline: 2px solid var(--brand-03) !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[aria-selected='true'] {
|
|
26
|
+
box-shadow: inset 0 2px 0 0 var(--brand-03) !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface MappedLabManifest {
|
|
2
|
+
uuid: string;
|
|
3
|
+
startDate: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
manifestType?: string;
|
|
6
|
+
courierName?: string;
|
|
7
|
+
manifestId?: string;
|
|
8
|
+
labPersonContact?: string;
|
|
9
|
+
manifestStatus?: string;
|
|
10
|
+
dispatchDate: string;
|
|
11
|
+
clinicianContact?: string;
|
|
12
|
+
clinicianName?: string;
|
|
13
|
+
county?: string;
|
|
14
|
+
subCounty?: string;
|
|
15
|
+
facilityEmail?: string;
|
|
16
|
+
facilityPhoneContact?: string;
|
|
17
|
+
personHandedTo?: string;
|
|
18
|
+
samples: Array<LabManifestSample>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface LabManifest {
|
|
22
|
+
uuid: string;
|
|
23
|
+
identifier?: string;
|
|
24
|
+
startDate: string;
|
|
25
|
+
endDate: string;
|
|
26
|
+
dispatchDate: string;
|
|
27
|
+
courier?: string;
|
|
28
|
+
courierOfficer?: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
county?: string;
|
|
31
|
+
subCounty?: string;
|
|
32
|
+
facilityEmail?: string;
|
|
33
|
+
facilityPhoneContact?: string;
|
|
34
|
+
clinicianPhoneContact?: string;
|
|
35
|
+
clinicianName?: string;
|
|
36
|
+
labPocPhoneNumber?: string;
|
|
37
|
+
manifestType?: number;
|
|
38
|
+
labManifestOrders: Array<LabManifestSample>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Order {
|
|
42
|
+
patient: {
|
|
43
|
+
id: number;
|
|
44
|
+
uuid: string;
|
|
45
|
+
identifiers: Array<{ identifier: string; uuid: string }>;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface LabManifestSample {
|
|
50
|
+
uuid: string;
|
|
51
|
+
id: number;
|
|
52
|
+
sampleType: string;
|
|
53
|
+
status: string;
|
|
54
|
+
result: string;
|
|
55
|
+
batchNumber: string;
|
|
56
|
+
dateSent: string;
|
|
57
|
+
resultDate: string;
|
|
58
|
+
order: Order;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ActiveRequests {
|
|
62
|
+
uuid: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Constiuency {
|
|
66
|
+
name: string;
|
|
67
|
+
code: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface County {
|
|
71
|
+
name: string;
|
|
72
|
+
number: string;
|
|
73
|
+
capital: string;
|
|
74
|
+
constituencies: Array<Constiuency>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actions": "Actions",
|
|
3
|
+
"activeRequests": "Active Requests",
|
|
4
|
+
"addNewManifest": "Add new Manifest",
|
|
5
|
+
"back": "Back",
|
|
6
|
+
"batchNumber": "Batch Number",
|
|
7
|
+
"cccKDODNumber": "CCC/KDOD Number",
|
|
8
|
+
"courrier": "Courrier",
|
|
9
|
+
"dateRequested": "Date Requested",
|
|
10
|
+
"dispatch": "Dispatch",
|
|
11
|
+
"editManifest": "Edit Manifest",
|
|
12
|
+
"endDate": "End Date",
|
|
13
|
+
"lab Manifest": "Lab Manifest",
|
|
14
|
+
"labManifest": "Lab manifest Management",
|
|
15
|
+
"labManifestSamples": "Lab Manifest Samples",
|
|
16
|
+
"labManifestSummary": "Lab Manifest Summary",
|
|
17
|
+
"labPersonContact": "Lab person Contact",
|
|
18
|
+
"manifestId": "Manifest Id",
|
|
19
|
+
"manifestSamples": "Manifest samples",
|
|
20
|
+
"notLabManifetToDisplay": "There is no lab manifets data to display.",
|
|
21
|
+
"patient": "Patient",
|
|
22
|
+
"patientName": "Patient name",
|
|
23
|
+
"removeFromManifest": "Remove from Manifest",
|
|
24
|
+
"result": "Result",
|
|
25
|
+
"resultDate": "Result Date",
|
|
26
|
+
"samples": "Samples",
|
|
27
|
+
"sampleType": "Sample type",
|
|
28
|
+
"selectManifestStatus": "Select manifest status",
|
|
29
|
+
"startDate": "Start date",
|
|
30
|
+
"status": "Status",
|
|
31
|
+
"type": "Type",
|
|
32
|
+
"view": "View"
|
|
33
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('openmrs/default-webpack-config');
|