@kenyaemr/esm-service-queues-app 8.1.1-pre.129 → 8.1.2-pre.154

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.
Files changed (256) hide show
  1. package/.turbo/turbo-build.log +26 -26
  2. package/dist/1006.js +1 -0
  3. package/dist/1006.js.map +1 -0
  4. package/dist/1060.js +1 -0
  5. package/dist/1060.js.map +1 -0
  6. package/dist/130.js +1 -1
  7. package/dist/130.js.map +1 -1
  8. package/dist/1325.js +1 -0
  9. package/dist/1325.js.map +1 -0
  10. package/dist/1644.js +1 -0
  11. package/dist/1727.js +1 -0
  12. package/dist/1727.js.map +1 -0
  13. package/dist/1800.js +1 -0
  14. package/dist/1800.js.map +1 -0
  15. package/dist/236.js +1 -1
  16. package/dist/2757.js +1 -0
  17. package/dist/{282.js → 2760.js} +1 -1
  18. package/dist/2760.js.map +1 -0
  19. package/dist/2784.js +2 -0
  20. package/dist/2784.js.map +1 -0
  21. package/dist/3199.js +1 -0
  22. package/dist/3199.js.map +1 -0
  23. package/dist/3372.js +2 -0
  24. package/dist/3372.js.map +1 -0
  25. package/dist/3574.js +1 -0
  26. package/dist/3604.js +1 -0
  27. package/dist/3604.js.map +1 -0
  28. package/dist/3652.js +1 -0
  29. package/dist/3760.js +1 -0
  30. package/dist/3760.js.map +1 -0
  31. package/dist/3818.js +1 -0
  32. package/dist/3818.js.map +1 -0
  33. package/dist/3828.js +1 -0
  34. package/dist/3828.js.map +1 -0
  35. package/dist/4272.js +1 -0
  36. package/dist/4378.js +1 -0
  37. package/dist/443.js +1 -0
  38. package/dist/443.js.map +1 -0
  39. package/dist/4460.js +1 -0
  40. package/dist/4705.js +1 -0
  41. package/dist/4911.js +1 -0
  42. package/dist/4911.js.map +1 -0
  43. package/dist/5236.js +1 -0
  44. package/dist/5236.js.map +1 -0
  45. package/dist/5240.js +1 -0
  46. package/dist/5282.js +1 -0
  47. package/dist/5282.js.map +1 -0
  48. package/dist/5336.js +1 -0
  49. package/dist/539.js +1 -0
  50. package/dist/5673.js +1 -0
  51. package/dist/5711.js +1 -0
  52. package/dist/5737.js +1 -0
  53. package/dist/5833.js +1 -0
  54. package/dist/6566.js +1 -0
  55. package/dist/6578.js +2 -0
  56. package/dist/{660.js.LICENSE.txt → 6578.js.LICENSE.txt} +5 -0
  57. package/dist/6578.js.map +1 -0
  58. package/dist/6591.js +2 -0
  59. package/dist/6591.js.map +1 -0
  60. package/dist/6670.js +1 -0
  61. package/dist/6670.js.map +1 -0
  62. package/dist/6727.js +1 -0
  63. package/dist/744.js +1 -0
  64. package/dist/752.js +1 -1
  65. package/dist/752.js.map +1 -1
  66. package/dist/7807.js +1 -0
  67. package/dist/8271.js +1 -0
  68. package/dist/8319.js +1 -0
  69. package/dist/8788.js +1 -0
  70. package/dist/899.js +1 -0
  71. package/dist/9261.js +1 -0
  72. package/dist/9392.js +1 -0
  73. package/dist/9392.js.map +1 -0
  74. package/dist/9993.js +1 -0
  75. package/dist/9993.js.map +1 -0
  76. package/dist/kenyaemr-esm-service-queues-app.js +1 -1
  77. package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +541 -234
  78. package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
  79. package/dist/main.js +1 -1
  80. package/dist/main.js.LICENSE.txt +5 -0
  81. package/dist/main.js.map +1 -1
  82. package/dist/routes.json +1 -1
  83. package/package-lock.json +2 -2
  84. package/package.json +8 -5
  85. package/src/active-visits/active-visits-table.resource.ts +0 -62
  86. package/src/active-visits/change-status-dialog.component.tsx +10 -3
  87. package/src/active-visits/change-status-dialog.scss +29 -1
  88. package/src/active-visits/change-status-dialog.test.tsx +11 -3
  89. package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +53 -54
  90. package/src/add-provider-queue-room/add-provider-queue-room.scss +28 -0
  91. package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +1 -1
  92. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -0
  93. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +29 -0
  94. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +4 -1
  95. package/src/config-schema.ts +28 -8
  96. package/src/create-queue-entry/create-queue-entry.workspace.tsx +99 -0
  97. package/src/create-queue-entry/existing-visit-form/existing-visit-form.component.tsx +73 -0
  98. package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx → create-queue-entry/queue-fields/queue-fields.component.tsx} +76 -50
  99. package/src/create-queue-entry/queue-fields/queue-fields.resource.ts +63 -0
  100. package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.scss → create-queue-entry/queue-fields/queue-fields.scss} +0 -4
  101. package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx → create-queue-entry/queue-fields/queue-fields.test.tsx} +37 -17
  102. package/src/create-queue-entry/queue-fields/visit-form-queue-fields.extension.tsx +31 -0
  103. package/src/hooks/useQueueEntries.ts +13 -12
  104. package/src/index.ts +8 -14
  105. package/src/patient-info/patient-info.component.tsx +10 -8
  106. package/src/patient-queue-header/patient-queue-header.component.tsx +18 -13
  107. package/src/patient-queue-metrics/metrics-header.component.tsx +4 -4
  108. package/src/queue-entry-table-components/queue-priority.component.tsx +16 -11
  109. package/src/queue-entry-table-components/queue-priority.scss +5 -0
  110. package/src/queue-entry-table-components/transition-entry.component.tsx +1 -1
  111. package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +1 -1
  112. package/src/queue-patient-linelists/queue-linelist-filter.workspace.tsx +13 -12
  113. package/src/queue-patient-linelists/scheduled-appointments-table.component.tsx +1 -1
  114. package/src/queue-rooms/queue-room-form.test.tsx +2 -2
  115. package/src/queue-rooms/queue-room-form.workspace.tsx +1 -1
  116. package/src/queue-screen/queue-screen.test.tsx +11 -4
  117. package/src/queue-services/queue-service-form.test.tsx +76 -16
  118. package/src/queue-services/queue-service-form.workspace.tsx +131 -131
  119. package/src/queue-services/queue-service.resource.ts +7 -2
  120. package/src/queue-table/cells/columns.resource.ts +10 -7
  121. package/src/queue-table/cells/queue-table-visit-attribute-queue-number-cell.component.tsx +1 -0
  122. package/src/queue-table/default-queue-table.component.tsx +12 -13
  123. package/src/queue-table/default-queue-table.test.tsx +3 -3
  124. package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +28 -0
  125. package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +8 -2
  126. package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.modal.tsx +2 -1
  127. package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.scss +29 -0
  128. package/src/queue-table/queue-table.component.tsx +1 -1
  129. package/src/queue-table/queue-table.scss +12 -2
  130. package/src/queue-table/queue-table.test.tsx +10 -1
  131. package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +16 -4
  132. package/src/remove-queue-entry-dialog/remove-queue-entry.scss +29 -0
  133. package/src/routes.json +4 -8
  134. package/src/transition-latest-queue-entry/transition-latest-queue-entry.resource.ts +2 -10
  135. package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +41 -32
  136. package/src/transition-queue-entry/transition-queue-entry-dialog.scss +28 -0
  137. package/src/types/index.ts +0 -8
  138. package/src/views/queue-tables-for-all-statuses.component.tsx +12 -15
  139. package/translations/am.json +5 -78
  140. package/translations/ar.json +5 -78
  141. package/translations/de.json +235 -0
  142. package/translations/en.json +9 -86
  143. package/translations/es.json +3 -76
  144. package/translations/fr.json +5 -78
  145. package/translations/he.json +5 -78
  146. package/translations/hi.json +235 -0
  147. package/translations/hi_IN.json +235 -0
  148. package/translations/id.json +235 -0
  149. package/translations/it.json +235 -0
  150. package/translations/km.json +5 -78
  151. package/translations/ne.json +235 -0
  152. package/translations/pt.json +235 -0
  153. package/translations/pt_BR.json +235 -0
  154. package/translations/qu.json +235 -0
  155. package/translations/si.json +235 -0
  156. package/translations/sw.json +235 -0
  157. package/translations/sw_KE.json +235 -0
  158. package/translations/tr.json +235 -0
  159. package/translations/tr_TR.json +235 -0
  160. package/translations/uk.json +235 -0
  161. package/translations/vi.json +235 -0
  162. package/translations/zh.json +6 -79
  163. package/translations/zh_CN.json +5 -78
  164. package/dist/169.js +0 -1
  165. package/dist/169.js.map +0 -1
  166. package/dist/199.js +0 -1
  167. package/dist/199.js.map +0 -1
  168. package/dist/236.js.map +0 -1
  169. package/dist/271.js +0 -1
  170. package/dist/282.js.map +0 -1
  171. package/dist/319.js +0 -1
  172. package/dist/325.js +0 -1
  173. package/dist/325.js.map +0 -1
  174. package/dist/366.js +0 -1
  175. package/dist/366.js.map +0 -1
  176. package/dist/372.js +0 -2
  177. package/dist/372.js.map +0 -1
  178. package/dist/392.js +0 -1
  179. package/dist/392.js.map +0 -1
  180. package/dist/460.js +0 -1
  181. package/dist/501.js +0 -1
  182. package/dist/501.js.map +0 -1
  183. package/dist/574.js +0 -1
  184. package/dist/591.js +0 -2
  185. package/dist/591.js.map +0 -1
  186. package/dist/6.js +0 -1
  187. package/dist/6.js.map +0 -1
  188. package/dist/60.js +0 -1
  189. package/dist/60.js.map +0 -1
  190. package/dist/604.js +0 -1
  191. package/dist/604.js.map +0 -1
  192. package/dist/644.js +0 -1
  193. package/dist/660.js +0 -2
  194. package/dist/660.js.map +0 -1
  195. package/dist/670.js +0 -1
  196. package/dist/670.js.map +0 -1
  197. package/dist/727.js +0 -1
  198. package/dist/727.js.map +0 -1
  199. package/dist/748.js +0 -1
  200. package/dist/748.js.map +0 -1
  201. package/dist/757.js +0 -1
  202. package/dist/760.js +0 -1
  203. package/dist/760.js.map +0 -1
  204. package/dist/784.js +0 -2
  205. package/dist/784.js.map +0 -1
  206. package/dist/788.js +0 -1
  207. package/dist/800.js +0 -1
  208. package/dist/800.js.map +0 -1
  209. package/dist/807.js +0 -1
  210. package/dist/818.js +0 -1
  211. package/dist/818.js.map +0 -1
  212. package/dist/828.js +0 -1
  213. package/dist/828.js.map +0 -1
  214. package/dist/833.js +0 -1
  215. package/dist/911.js +0 -1
  216. package/dist/911.js.map +0 -1
  217. package/dist/940.js +0 -1
  218. package/dist/940.js.map +0 -1
  219. package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +0 -228
  220. package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +0 -32
  221. package/src/patient-search/advanced-search.component.tsx +0 -191
  222. package/src/patient-search/advanced-search.scss +0 -154
  223. package/src/patient-search/advanced-search.test.tsx +0 -26
  224. package/src/patient-search/basic-search.component.tsx +0 -112
  225. package/src/patient-search/basic-search.scss +0 -139
  226. package/src/patient-search/basic-search.test.tsx +0 -18
  227. package/src/patient-search/empty-data-illustration.component.tsx +0 -41
  228. package/src/patient-search/hooks/useActivePatientEnrollment.tsx +0 -29
  229. package/src/patient-search/hooks/useDefaultLocation.ts +0 -14
  230. package/src/patient-search/hooks/usePatients.tsx +0 -25
  231. package/src/patient-search/hooks/useRecommendedVisitTypes.tsx +0 -35
  232. package/src/patient-search/hooks/useScheduledVisits.ts +0 -52
  233. package/src/patient-search/patient-scheduled-visits.component.tsx +0 -315
  234. package/src/patient-search/patient-scheduled-visits.scss +0 -131
  235. package/src/patient-search/patient-scheduled-visits.test.tsx +0 -39
  236. package/src/patient-search/patient-search.workspace.tsx +0 -135
  237. package/src/patient-search/search-illustration.component.tsx +0 -27
  238. package/src/patient-search/search-results.component.tsx +0 -75
  239. package/src/patient-search/search-results.scss +0 -80
  240. package/src/patient-search/search-results.test.tsx +0 -69
  241. package/src/patient-search/search.resource.ts +0 -10
  242. package/src/patient-search/visit-form/existing-visit-form.component.tsx +0 -112
  243. package/src/patient-search/visit-form/queue.resource.ts +0 -64
  244. package/src/patient-search/visit-form/visit-form.component.tsx +0 -337
  245. package/src/patient-search/visit-form/visit-type-selector.component.tsx +0 -153
  246. package/src/patient-search/visit-form/visit-type-selector.scss +0 -100
  247. package/src/patient-search/visit-form/visit-type-selector.test.tsx +0 -84
  248. package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +0 -277
  249. package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +0 -93
  250. package/src/visits-missing-inqueue/visits-missing-inqueue.scss +0 -111
  251. /package/dist/{784.js.LICENSE.txt → 2784.js.LICENSE.txt} +0 -0
  252. /package/dist/{372.js.LICENSE.txt → 3372.js.LICENSE.txt} +0 -0
  253. /package/dist/{591.js.LICENSE.txt → 6591.js.LICENSE.txt} +0 -0
  254. /package/src/{patient-search/patient-search.scss → create-queue-entry/create-queue-entry.scss} +0 -0
  255. /package/src/{patient-search/visit-form/visit-form.scss → create-queue-entry/existing-visit-form/existing-visit-form.scss} +0 -0
  256. /package/src/{patient-search → create-queue-entry}/hooks/useQueueLocations.tsx +0 -0
@@ -1,277 +0,0 @@
1
- import React, { useMemo, useEffect, useState, useCallback, type AnchorHTMLAttributes } from 'react';
2
- import classNames from 'classnames';
3
- import {
4
- DataTable,
5
- DataTableSkeleton,
6
- InlineLoading,
7
- Layer,
8
- Pagination,
9
- Search,
10
- Table,
11
- TableContainer,
12
- TableHead,
13
- TableRow,
14
- TableHeader,
15
- TableBody,
16
- TableCell,
17
- TableToolbar,
18
- TableToolbarContent,
19
- TableExpandRow,
20
- TableExpandHeader,
21
- TableExpandedRow,
22
- Tile,
23
- Button,
24
- } from '@carbon/react';
25
- import {
26
- useLayoutType,
27
- isDesktop,
28
- useConfig,
29
- usePagination,
30
- ExtensionSlot,
31
- formatDatetime,
32
- parseDate,
33
- showModal,
34
- ConfigurableLink,
35
- } from '@openmrs/esm-framework';
36
- import { useTranslation } from 'react-i18next';
37
- import { type ActiveVisit, useMissingQueueEntries } from './visits-missing-inqueue.resource';
38
- import { Add } from '@carbon/react/icons';
39
- import { type ConfigObject } from '../config-schema';
40
- import styles from './visits-missing-inqueue.scss';
41
-
42
- interface PaginationData {
43
- goTo: (page: number) => void;
44
- results: Array<ActiveVisit>;
45
- currentPage: number;
46
- }
47
-
48
- function AddMenu({ visitDetails }: { visitDetails: ActiveVisit }) {
49
- const { t } = useTranslation();
50
- const launchAddVisitToQueueModal = useCallback(() => {
51
- const dispose = showModal('add-visit-to-queue-modal', {
52
- closeModal: () => dispose(),
53
- visitDetails,
54
- });
55
- }, [visitDetails]);
56
-
57
- return (
58
- <Button
59
- kind="ghost"
60
- onClick={launchAddVisitToQueueModal}
61
- iconDescription={t('addisitToQueueTooltip', 'Add to queue')}
62
- renderIcon={(props) => <Add size={16} {...props} />}>
63
- {t('addToQueue', 'Add to queue')}
64
- </Button>
65
- );
66
- }
67
-
68
- const MissingQueueEntries = () => {
69
- const { t } = useTranslation();
70
- const config = useConfig<ConfigObject>();
71
- const layout = useLayoutType();
72
- const { activeVisits, isLoading, visitsIsValidating } = useMissingQueueEntries();
73
- const pageSizes = [10, 20, 30, 40, 50];
74
- const [currentPageSize, setPageSize] = useState(10);
75
- const [searchString, setSearchString] = useState('');
76
-
77
- const headerData = useMemo(
78
- () => [
79
- {
80
- id: 0,
81
- header: t('visitStartTime', 'Visit Time'),
82
- key: 'visitStartTime',
83
- },
84
- {
85
- id: 1,
86
- header: t('idNumber', 'ID Number'),
87
- key: 'idNumber',
88
- },
89
- {
90
- id: 2,
91
- header: t('name', 'Name'),
92
- key: 'name',
93
- },
94
- {
95
- id: 3,
96
- header: t('gender', 'Gender'),
97
- key: 'gender',
98
- },
99
- {
100
- id: 4,
101
- header: t('age', 'Age'),
102
- key: 'age',
103
- },
104
- {
105
- id: 5,
106
- header: t('visitType', 'Visit Type'),
107
- key: 'visitType',
108
- },
109
- ],
110
- [t],
111
- );
112
-
113
- const rowData = activeVisits.map((visit) => ({
114
- ...visit,
115
- visitStartTime: formatDatetime(parseDate(visit.visitStartTime)),
116
- }));
117
-
118
- const searchResults = useMemo(() => {
119
- if (searchString && searchString.trim() !== '') {
120
- const search = searchString.toLowerCase();
121
- return rowData.filter((activeVisitRow) =>
122
- Object.keys(activeVisitRow).some((header) => {
123
- if (header === 'patientUuid') {
124
- return false;
125
- }
126
- return `${activeVisitRow[header]}`.toLowerCase().includes(search);
127
- }),
128
- );
129
- } else {
130
- return rowData;
131
- }
132
- }, [searchString, rowData]);
133
-
134
- const {
135
- goTo,
136
- results: paginatedActiveVisits,
137
- currentPage,
138
- }: PaginationData = usePagination(searchResults, currentPageSize);
139
-
140
- const handleSearch = useCallback((e) => setSearchString(e.target.value), []);
141
-
142
- useEffect(() => {
143
- if (currentPage !== 1) {
144
- goTo(1);
145
- }
146
- }, [searchString, currentPage, goTo]);
147
-
148
- if (isLoading) {
149
- return <DataTableSkeleton role="progressbar" />;
150
- }
151
- if (activeVisits?.length) {
152
- return (
153
- <div className={styles.activeVisitsContainer}>
154
- <div className={styles.activeVisitsDetailHeaderContainer}>
155
- <div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
156
- <h4>{t('activeVisitsNotInQueue', 'Active visits not in queue')}</h4>
157
- </div>
158
- <div className={styles.backgroundDataFetchingIndicator}>
159
- <span>{visitsIsValidating ? <InlineLoading /> : null}</span>
160
- </div>
161
- </div>
162
- <DataTable
163
- rows={paginatedActiveVisits}
164
- headers={headerData}
165
- size={isDesktop(layout) ? 'xs' : 'md'}
166
- useZebraStyles={activeVisits?.length > 1 ? true : false}>
167
- {({ rows, headers, getHeaderProps, getTableProps, getBatchActionProps, getRowProps }) => (
168
- <TableContainer className={styles.tableContainer}>
169
- <TableToolbar>
170
- <TableToolbarContent>
171
- <Search
172
- tabIndex={getBatchActionProps().shouldShowBatchActions ? -1 : 0}
173
- labelText=""
174
- placeholder={t('filterTable', 'Filter table')}
175
- onChange={handleSearch}
176
- />
177
- </TableToolbarContent>
178
- </TableToolbar>
179
- <Table className={styles.activeVisitsTable} {...getTableProps()}>
180
- <TableHead>
181
- <TableRow>
182
- <TableExpandHeader />
183
- {headers.map((header) => (
184
- <TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
185
- ))}
186
- </TableRow>
187
- </TableHead>
188
- <TableBody>
189
- {rows.map((row, index) => (
190
- <React.Fragment key={index}>
191
- <TableExpandRow {...getRowProps({ row })}>
192
- {row.cells.map((cell) => (
193
- <TableCell key={cell.id}>
194
- {cell.info.header === 'name' ? (
195
- <ConfigurableLink
196
- to={`\${openmrsSpaBase}/patient/${paginatedActiveVisits?.[index]?.patientUuid}/chart/`}>
197
- {cell.value}
198
- </ConfigurableLink>
199
- ) : (
200
- cell.value
201
- )}
202
- </TableCell>
203
- ))}
204
- <TableCell className="cds--table-column-menu">
205
- <AddMenu visitDetails={paginatedActiveVisits?.[index]} />
206
- </TableCell>
207
- </TableExpandRow>
208
- {row.isExpanded ? (
209
- <TableRow className={styles.expandedActiveVisitRow}>
210
- <th colSpan={headers.length + 2}>
211
- <ExtensionSlot
212
- className={styles.visitSummaryContainer}
213
- name="visit-summary-slot"
214
- state={{
215
- visitUuid: paginatedActiveVisits[index]?.visitUuid,
216
- patientUuid: paginatedActiveVisits[index]?.patientUuid,
217
- }}
218
- />
219
- </th>
220
- </TableRow>
221
- ) : (
222
- <TableExpandedRow className={styles.hiddenRow} colSpan={headers.length + 2} />
223
- )}
224
- </React.Fragment>
225
- ))}
226
- </TableBody>
227
- </Table>
228
- {rows.length === 0 && (
229
- <p
230
- style={{
231
- height: isDesktop(layout) ? '2rem' : '3rem',
232
- margin: '1rem 1.5rem',
233
- }}
234
- className={classNames(styles.emptyRow, styles.bodyLong01)}>
235
- {t('noVisitsNotInQueueFound', 'No visits currently not in queue found')}
236
- </p>
237
- )}
238
- <Pagination
239
- forwardText="Next page"
240
- backwardText="Previous page"
241
- page={currentPage}
242
- pageSize={currentPageSize}
243
- pageSizes={pageSizes}
244
- totalItems={searchResults.length}
245
- className={styles.pagination}
246
- onChange={({ pageSize, page }) => {
247
- if (pageSize !== currentPageSize) {
248
- setPageSize(pageSize);
249
- }
250
- if (page !== currentPage) {
251
- goTo(page);
252
- }
253
- }}
254
- />
255
- </TableContainer>
256
- )}
257
- </DataTable>
258
- </div>
259
- );
260
- }
261
- return (
262
- <div className={styles.activeVisitsContainer}>
263
- <Layer>
264
- <Tile className={styles.tile}>
265
- <div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
266
- <h4>{t('activeVisits', 'Active Visits')}</h4>
267
- </div>
268
- <p className={styles.content}>
269
- {t('noActiveVisitsForLocation', 'There are no active visits to display for this location.')}
270
- </p>
271
- </Tile>
272
- </Layer>
273
- </div>
274
- );
275
- };
276
-
277
- export default MissingQueueEntries;
@@ -1,93 +0,0 @@
1
- import useSWR from 'swr';
2
- import dayjs from 'dayjs';
3
- import isToday from 'dayjs/plugin/isToday';
4
- import last from 'lodash-es/last';
5
- import { openmrsFetch, type Visit, useSession, restBaseUrl } from '@openmrs/esm-framework';
6
- import { type VisitQueueEntry } from '../active-visits/active-visits-table.resource';
7
-
8
- dayjs.extend(isToday);
9
-
10
- export interface ActiveVisit {
11
- age: string;
12
- id: string;
13
- idNumber: string;
14
- gender: string;
15
- location: string;
16
- name: string;
17
- patientUuid: string;
18
- visitStartTime: string;
19
- visitType: string;
20
- visitUuid: string;
21
- }
22
-
23
- export function useMissingQueueEntries() {
24
- const currentUserSession = useSession();
25
- const startDate = dayjs().format('YYYY-MM-DD');
26
- const sessionLocation = currentUserSession?.sessionLocation?.uuid;
27
-
28
- const customRepresentation =
29
- 'custom:(uuid,patient:(uuid,identifiers:(identifier,uuid),person:(age,display,gender,uuid)),' +
30
- 'visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,' +
31
- 'stopDatetime)&fromStartDate=' +
32
- startDate +
33
- '&location=' +
34
- sessionLocation;
35
- const url = `${restBaseUrl}/visit?includeInactive=false&v=${customRepresentation}`;
36
- const {
37
- data: visitsData,
38
- error: visitsError,
39
- isValidating: visitsIsValidating,
40
- } = useSWR<{ data: { results: Array<Visit> } }, Error>(sessionLocation ? url : null, openmrsFetch);
41
-
42
- const apiUrl = `${restBaseUrl}/visit-queue-entry`;
43
- const {
44
- data: queueData,
45
- error: queueError,
46
- isValidating: queueIsValidating,
47
- mutate: mutateQueueEntries,
48
- } = useSWR<{ data: { results: Array<VisitQueueEntry> } }, Error>(apiUrl, openmrsFetch);
49
-
50
- const byId = {};
51
- queueData?.data?.results.forEach((item) => {
52
- if (item?.queueEntry.patient?.uuid) {
53
- byId[item?.queueEntry.patient?.uuid] = true;
54
- }
55
- });
56
-
57
- const data = visitsData?.data?.results?.filter((item) => {
58
- if (byId[item?.patient?.uuid]) {
59
- return false;
60
- }
61
- return true;
62
- });
63
-
64
- const mapVisitProperties = (visit: Visit): ActiveVisit => ({
65
- age: visit?.patient?.person?.age,
66
- id: visit.uuid,
67
- idNumber: visit?.patient?.identifiers[0]?.identifier,
68
- gender: visit?.patient?.person?.gender,
69
- location: visit?.location?.uuid,
70
- name: visit?.patient?.person?.display,
71
- patientUuid: visit?.patient?.uuid,
72
- visitStartTime: visit?.startDatetime,
73
- visitType: visit?.visitType?.display,
74
- visitUuid: visit.uuid,
75
- });
76
-
77
- const formattedActiveVisits = data?.length
78
- ? data.map(mapVisitProperties).filter(({ visitStartTime }) => dayjs(visitStartTime).isToday())
79
- : [];
80
-
81
- return {
82
- activeVisits: formattedActiveVisits,
83
- isLoading: !data && !visitsError && !queueError,
84
- error: !visitsError && !queueError,
85
- visitsIsValidating,
86
- mutateQueueEntries,
87
- };
88
- }
89
-
90
- export const getOriginFromPathName = (pathname = '') => {
91
- const from = pathname.split('/');
92
- return last(from);
93
- };
@@ -1,111 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '@carbon/type';
3
-
4
- .activeVisitsContainer {
5
- background-color: $ui-background;
6
- border: 1px solid $ui-03;
7
- width: 100%;
8
- margin: 0 auto;
9
- max-width: 95vw;
10
- }
11
-
12
- .activeVisitsDetailHeaderContainer {
13
- display: flex;
14
- justify-content: space-between;
15
- align-items: center;
16
- padding: layout.$spacing-04 0 layout.$spacing-04 layout.$spacing-05;
17
- background-color: $ui-background;
18
- }
19
-
20
- .backgroundDataFetchingIndicator {
21
- align-items: center;
22
- display: flex;
23
- flex: 1 1 0%;
24
- justify-content: center;
25
- }
26
-
27
- .tableContainer section {
28
- position: relative;
29
- }
30
-
31
- .tableContainer a {
32
- text-decoration: none;
33
- }
34
-
35
- .tableContainer {
36
- :global(.cds--data-table) {
37
- background-color: $ui-03;
38
- }
39
- }
40
-
41
- .pagination {
42
- overflow: hidden;
43
- }
44
-
45
- .hiddenRow {
46
- display: none;
47
- }
48
-
49
- .emptyRow {
50
- padding: 0 layout.$spacing-05;
51
- display: flex;
52
- align-items: center;
53
- }
54
-
55
- .visitSummaryContainer {
56
- width: 100%;
57
- max-width: 48rem;
58
- margin: layout.$spacing-05 auto;
59
- }
60
-
61
- .expandedActiveVisitRow > td > div {
62
- max-height: max-content !important;
63
- }
64
-
65
- .expandedActiveVisitRow td {
66
- padding: 0 layout.$spacing-07;
67
- }
68
-
69
- .expandedActiveVisitRow th[colspan] td[colspan] > div:first-child {
70
- padding: 0 layout.$spacing-05;
71
- }
72
-
73
- .action {
74
- margin-bottom: layout.$spacing-03;
75
- }
76
-
77
- .content {
78
- @include type.type-style('heading-compact-01');
79
- color: $text-02;
80
- margin-top: layout.$spacing-05;
81
- margin-bottom: layout.$spacing-03;
82
- }
83
-
84
- .desktopHeading,
85
- .tabletHeading {
86
- text-align: left;
87
- text-transform: capitalize;
88
- margin-bottom: layout.$spacing-05;
89
-
90
- h4 {
91
- @include type.type-style('heading-compact-02');
92
- color: $text-02;
93
-
94
- &:after {
95
- content: '';
96
- display: block;
97
- width: layout.$spacing-07;
98
- padding-top: 3px;
99
- border-bottom: 0.375rem solid;
100
- @include brand-03(border-bottom-color);
101
- }
102
- }
103
- }
104
-
105
- .tile {
106
- text-align: center;
107
- }
108
-
109
- .bodyLong01 {
110
- @include type.type-style('body-01');
111
- }