@openmrs/esm-service-queues-app 9.2.1-pre.7118 → 9.2.1-pre.7126

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 (58) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/dist/2799.js +1 -1
  3. package/dist/2799.js.map +1 -1
  4. package/dist/3386.js +1 -1
  5. package/dist/3386.js.map +1 -1
  6. package/dist/3683.js +1 -1
  7. package/dist/3683.js.map +1 -1
  8. package/dist/4300.js +1 -1
  9. package/dist/5228.js +1 -1
  10. package/dist/5228.js.map +1 -1
  11. package/dist/5278.js +2 -0
  12. package/dist/5278.js.map +1 -0
  13. package/dist/5578.js +1 -1
  14. package/dist/5578.js.map +1 -1
  15. package/dist/5680.js +1 -1
  16. package/dist/5680.js.map +1 -1
  17. package/dist/714.js +1 -1
  18. package/dist/714.js.map +1 -1
  19. package/dist/8233.js +1 -0
  20. package/dist/8233.js.map +1 -0
  21. package/dist/8844.js +1 -1
  22. package/dist/8844.js.map +1 -1
  23. package/dist/9384.js +1 -1
  24. package/dist/9384.js.map +1 -1
  25. package/dist/9707.js +1 -1
  26. package/dist/9707.js.map +1 -1
  27. package/dist/main.js +1 -1
  28. package/dist/main.js.map +1 -1
  29. package/dist/openmrs-esm-service-queues-app.js +1 -1
  30. package/dist/openmrs-esm-service-queues-app.js.buildmanifest.json +85 -85
  31. package/dist/routes.json +1 -1
  32. package/package.json +1 -1
  33. package/src/admin/admin-page/admin-page.component.tsx +3 -3
  34. package/src/admin/queue-rooms/queue-room-form.workspace.tsx +88 -85
  35. package/src/admin/queue-services/queue-service-form.workspace.tsx +85 -83
  36. package/src/create-queue-entry/create-queue-entry.workspace.tsx +72 -61
  37. package/src/create-queue-entry/existing-visit-form/existing-visit-form.component.tsx +8 -14
  38. package/src/index.ts +0 -2
  39. package/src/patient-banner-extension/patient-banner-queue-entry-status.extension.tsx +2 -3
  40. package/src/patient-banner-extension/patient-banner-queue-entry-status.scss +2 -1
  41. package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +3 -21
  42. package/src/queue-patient-linelists/queue-services-table.component.tsx +1 -1
  43. package/src/queue-table/components/add-patient-to-queue-button.component.tsx +45 -0
  44. package/src/queue-table/components/queue-priority.component.tsx +2 -2
  45. package/src/queue-table/components/queue-priority.scss +2 -2
  46. package/src/queue-table/default-queue-table.component.tsx +4 -52
  47. package/src/routes.json +33 -15
  48. package/src/views/queue-tables-for-all-statuses.component.tsx +3 -20
  49. package/translations/en.json +1 -12
  50. package/dist/3050.js +0 -1
  51. package/dist/3050.js.map +0 -1
  52. package/dist/7706.js +0 -2
  53. package/dist/7706.js.map +0 -1
  54. package/src/hooks/usePatientSearchVisibility.tsx +0 -26
  55. package/src/queue-patient-linelists/queue-linelist-filter.scss +0 -53
  56. package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +0 -83
  57. package/src/queue-patient-linelists/queue-linelist-filter.workspace.tsx +0 -180
  58. /package/dist/{7706.js.LICENSE.txt → 5278.js.LICENSE.txt} +0 -0
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { Button } from '@carbon/react';
3
2
  import { useTranslation } from 'react-i18next';
3
+ import { Button } from '@carbon/react';
4
4
  import { type ConfigObject, isDesktop, showModal, useConfig, useLayoutType } from '@openmrs/esm-framework';
5
5
  import { useQueueEntries } from '../hooks/useQueueEntries';
6
- import styles from './patient-banner-queue-entry-status.scss';
7
6
  import QueuePriority from '../queue-table/components/queue-priority.component';
7
+ import styles from './patient-banner-queue-entry-status.scss';
8
8
 
9
9
  interface PatientBannerQueueEntryStatusProps {
10
10
  patientUuid: string;
@@ -25,7 +25,6 @@ const PatientBannerQueueEntryStatus: React.FC<PatientBannerQueueEntryStatusProps
25
25
 
26
26
  return (
27
27
  <div className={styles.queueEntryStatusContainer}>
28
- <span className={styles.separator}>&middot;</span>
29
28
  <span>{queueEntry.queue.name}</span>
30
29
  <QueuePriority
31
30
  priority={queueEntry.priority}
@@ -6,7 +6,8 @@
6
6
  .queueEntryStatusContainer {
7
7
  display: flex;
8
8
  align-items: center;
9
- gap: layout.$spacing-02;
9
+ column-gap: layout.$spacing-02;
10
+ margin: 0 layout.$spacing-02;
10
11
  }
11
12
 
12
13
  .navDivider {
@@ -1,4 +1,4 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type TFunction } from 'i18next';
4
4
  import {
@@ -21,15 +21,8 @@ import {
21
21
  DataTableSkeleton,
22
22
  Pagination,
23
23
  } from '@carbon/react';
24
- import { Filter, OverflowMenuVertical } from '@carbon/react/icons';
25
- import {
26
- ConfigurableLink,
27
- ExtensionSlot,
28
- formatDatetime,
29
- launchWorkspace,
30
- parseDate,
31
- usePagination,
32
- } from '@openmrs/esm-framework';
24
+ import { OverflowMenuVertical } from '@carbon/react/icons';
25
+ import { ConfigurableLink, ExtensionSlot, formatDatetime, parseDate, usePagination } from '@openmrs/esm-framework';
33
26
  import styles from './queue-linelist-base-table.scss';
34
27
  import { type FilterTypes } from '../types';
35
28
 
@@ -151,17 +144,6 @@ const QueuePatientBaseTable: React.FC<QueuePatientTableProps> = ({
151
144
  <Tag size="md" type="blue">
152
145
  {t('today', 'Today')}
153
146
  </Tag>
154
-
155
- <div className={styles.actionsBtn}>
156
- <Button
157
- kind="ghost"
158
- renderIcon={(props) => <Filter size={16} {...props} />}
159
- iconDescription={t('filter', 'Filter')}
160
- onClick={() => launchWorkspace('service-queues-linelist-filter')}
161
- size="sm">
162
- {t('filter', 'Filter')}
163
- </Button>
164
- </div>
165
147
  </Tile>
166
148
  </Layer>
167
149
 
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import QueuePatientBaseTable from './queue-linelist-base-table.component';
4
3
  import { useServiceQueueEntries } from '../service-queues.resource';
4
+ import QueuePatientBaseTable from './queue-linelist-base-table.component';
5
5
 
6
6
  const ServicesTable: React.FC = () => {
7
7
  const { t } = useTranslation();
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { Button } from '@carbon/react';
3
+ import { AddIcon, launchWorkspace2, type Workspace2DefinitionProps } from '@openmrs/esm-framework';
4
+ import { serviceQueuesPatientSearchWorkspace } from '../../constants';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { useServiceQueuesStore } from '../../store/store';
7
+
8
+ const AddPatientToQueueButton: React.FC = () => {
9
+ const { t } = useTranslation();
10
+ const { selectedServiceUuid } = useServiceQueuesStore();
11
+
12
+ return (
13
+ <Button
14
+ kind="secondary"
15
+ renderIcon={(props) => <AddIcon size={16} {...props} />}
16
+ size="sm"
17
+ onClick={() =>
18
+ launchWorkspace2(
19
+ 'queue-patient-search-workspace',
20
+ {
21
+ initialQuery: '',
22
+ workspaceTitle: t('addPatientToQueue', 'Add patient to queue'),
23
+ onPatientSelected(
24
+ patientUuid: string,
25
+ patient: fhir.Patient,
26
+ launchChildWorkspace: Workspace2DefinitionProps['launchChildWorkspace'],
27
+ closeWorkspace: Workspace2DefinitionProps['launchChildWorkspace'],
28
+ ) {
29
+ launchChildWorkspace(serviceQueuesPatientSearchWorkspace, {
30
+ currentServiceQueueUuid: selectedServiceUuid,
31
+ selectedPatientUuid: patient.id,
32
+ });
33
+ },
34
+ },
35
+ {
36
+ startVisitWorkspaceName: 'queue-patient-search-start-visit-workspace',
37
+ },
38
+ )
39
+ }>
40
+ {t('addPatientToQueue', 'Add patient to queue')}
41
+ </Button>
42
+ );
43
+ };
44
+
45
+ export default AddPatientToQueueButton;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
+ import classNames from 'classnames';
2
3
  import { DefinitionTooltip, Tag } from '@carbon/react';
3
- import styles from './queue-priority.scss';
4
4
  import { type PriorityConfig } from '../../config-schema';
5
5
  import { type Concept } from '../../types';
6
- import classNames from 'classnames';
6
+ import styles from './queue-priority.scss';
7
7
 
8
8
  interface QueuePriorityProps {
9
9
  priority: Concept;
@@ -1,9 +1,9 @@
1
+ @use '@carbon/colors';
1
2
  @use '@carbon/layout';
2
3
  @use '@openmrs/esm-styleguide/src/vars' as *;
3
- @use '@carbon/colors';
4
4
 
5
5
  .tag {
6
- margin: layout.$spacing-02 0;
6
+ margin: 0 layout.$spacing-02;
7
7
  white-space: nowrap;
8
8
  }
9
9
 
@@ -1,38 +1,20 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
2
  import { DataTableSkeleton, Dropdown, Layer, TableToolbarSearch } from '@carbon/react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { Add } from '@carbon/react/icons';
5
- import {
6
- closeWorkspace,
7
- ExtensionSlot,
8
- isDesktop,
9
- launchWorkspace,
10
- showSnackbar,
11
- useLayoutType,
12
- } from '@openmrs/esm-framework';
13
- import { serviceQueuesPatientSearchWorkspace } from '../constants';
4
+ import { isDesktop, showSnackbar, useLayoutType } from '@openmrs/esm-framework';
14
5
  import { updateSelectedQueueStatus, useServiceQueuesStore } from '../store/store';
15
6
  import { useColumns } from './cells/columns.resource';
16
7
  import { useQueueEntries } from '../hooks/useQueueEntries';
17
8
  import useQueueStatuses from '../hooks/useQueueStatuses';
18
- import usePatientSearchVisibility from '../hooks/usePatientSearchVisibility';
19
9
  import ClearQueueEntries from '../modals/clear-queue-entries-modal/clear-queue-entries.component';
20
10
  import QueueTableExpandedRow from './queue-table-expanded-row.component';
21
11
  import QueueTable from './queue-table.component';
22
12
  import styles from './queue-table.scss';
13
+ import AddPatientToQueueButton from './components/add-patient-to-queue-button.component';
23
14
 
24
15
  function DefaultQueueTable() {
25
16
  const { t } = useTranslation();
26
17
  const layout = useLayoutType();
27
- const { selectedServiceUuid } = useServiceQueuesStore();
28
- const [patientSearchQuery, setPatientSearchQuery] = useState('');
29
-
30
- const { isPatientSearchOpen, hidePatientSearch, showPatientSearch } = usePatientSearchVisibility();
31
-
32
- const handleReturnToSearchList = useCallback(() => {
33
- showPatientSearch();
34
- closeWorkspace(serviceQueuesPatientSearchWorkspace);
35
- }, [showPatientSearch]);
36
18
 
37
19
  return (
38
20
  <div className={styles.defaultQueueTable}>
@@ -42,37 +24,7 @@ function DefaultQueueTable() {
42
24
  <h4>{t('patientsCurrentlyInQueue', 'Patients currently in queue')}</h4>
43
25
  </div>
44
26
  <div className={styles.headerButtons}>
45
- {/**
46
- * Attaches the patient search button extension and overrides the default button props and passes some other state down which will eventually get passed to the patient search workspace upon clicking the button
47
- * https://github.com/openmrs/openmrs-esm-patient-management/blob/main/packages/esm-patient-search-app/src/patient-search-button/patient-search-button.component.tsx#L74
48
- * */}
49
- <ExtensionSlot
50
- name="patient-search-button-slot"
51
- state={{
52
- // Overrides the default button props for the patient search button
53
- buttonText: t('addPatientToQueue', 'Add patient to queue'),
54
- buttonProps: {
55
- kind: 'secondary',
56
- renderIcon: (props) => <Add size={16} {...props} />,
57
- size: 'sm',
58
- },
59
- handleReturnToSearchList,
60
- hidePatientSearch,
61
- isOpen: isPatientSearchOpen,
62
- searchQuery: patientSearchQuery,
63
- searchQueryUpdatedAction: (searchQuery) => setPatientSearchQuery(searchQuery),
64
- selectPatientAction: (selectedPatientUuid) => {
65
- hidePatientSearch();
66
- launchWorkspace(serviceQueuesPatientSearchWorkspace, {
67
- currentServiceQueueUuid: selectedServiceUuid,
68
- handleReturnToSearchList,
69
- selectedPatientUuid,
70
- });
71
- },
72
- showPatientSearch,
73
- workspaceTitle: t('addPatientToQueue', 'Add patient to queue'),
74
- }}
75
- />
27
+ <AddPatientToQueueButton />
76
28
  </div>
77
29
  </div>
78
30
  <QueueTableSection />
package/src/routes.json CHANGED
@@ -149,31 +149,49 @@
149
149
  "component": "deleteQueueEntryModal"
150
150
  }
151
151
  ],
152
- "workspaces": [
152
+ "workspaces2": [
153
+ {
154
+ "name": "create-queue-entry-workspace",
155
+ "component": "createQueueEntryWorkspace",
156
+ "window": "add-queue-entry"
157
+ },
158
+ {
159
+ "name": "queue-patient-search-workspace",
160
+ "component": "@openmrs/esm-patient-search-app#patientSearchWorkspace2",
161
+ "window": "add-queue-entry"
162
+ },
163
+ {
164
+ "name": "queue-patient-search-start-visit-workspace",
165
+ "component": "@openmrs/esm-patient-chart-app#exportedVisitForm",
166
+ "window": "add-queue-entry"
167
+ },
153
168
  {
154
169
  "name": "service-queues-service-form",
155
- "title": "addNewQueueService",
156
170
  "component": "addNewQueueServiceWorkspace",
157
- "type": "service-queues"
171
+ "window": "add-queue"
158
172
  },
159
173
  {
160
174
  "name": "service-queues-room-workspace",
161
- "title": "addNewQueueServiceRoom",
162
175
  "component": "addNewQueueServiceRoomWorkspace",
163
- "type": "service-queues"
176
+ "window": "add-queue-room"
177
+ }
178
+ ],
179
+ "workspaceWindows2": [
180
+ {
181
+ "name": "add-queue-entry",
182
+ "group": "service-queues"
164
183
  },
165
184
  {
166
- "name": "service-queues-linelist-filter",
167
- "title": "filter",
168
- "component": "queueLinelistFilterWorkspace",
169
- "type": "service-queues"
185
+ "name": "add-queue",
186
+ "group": "service-queues"
170
187
  },
171
188
  {
172
- "name": "create-queue-entry-workspace",
173
- "title": "addPatientToQueue",
174
- "component": "createQueueEntryWorkspace",
175
- "type": "service-queues",
176
- "width": "wider"
189
+ "name": "add-queue-room",
190
+ "group": "service-queues"
177
191
  }
178
- ]
192
+ ],
193
+ "workspaceGroups2": [{
194
+ "name": "service-queues"
195
+ }]
196
+
179
197
  }
@@ -1,8 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import { InlineNotification, Search, SkeletonText } from '@carbon/react';
3
- import { Add } from '@carbon/react/icons';
4
3
  import { useTranslation } from 'react-i18next';
5
- import { ExtensionSlot, isDesktop, launchWorkspace, showToast, useLayoutType } from '@openmrs/esm-framework';
4
+ import { isDesktop, showToast, useLayoutType } from '@openmrs/esm-framework';
6
5
  import type { Concept, Queue, QueueEntry } from '../types';
7
6
  import { useQueueEntries } from '../hooks/useQueueEntries';
8
7
  import { useColumns } from '../queue-table/cells/columns.resource';
@@ -11,6 +10,7 @@ import PatientQueueHeader from '../patient-queue-header/patient-queue-header.com
11
10
  import QueueTable from '../queue-table/queue-table.component';
12
11
  import QueueTableMetrics from '../queue-table/queue-table-metrics.component';
13
12
  import styles from '../queue-table/queue-table.scss';
13
+ import AddPatientToQueueButton from '../queue-table/components/add-patient-to-queue-button.component';
14
14
 
15
15
  interface QueueTablesForAllStatusesProps {
16
16
  selectedQueue: Queue; // the selected queue
@@ -47,24 +47,7 @@ const QueueTablesForAllStatuses: React.FC<QueueTablesForAllStatusesProps> = ({
47
47
  showFilters={false}
48
48
  actions={
49
49
  <div className={styles.headerButtons}>
50
- <ExtensionSlot
51
- name="patient-search-button-slot"
52
- state={{
53
- buttonText: t('addPatientToQueue', 'Add patient to queue'),
54
- buttonProps: {
55
- kind: 'secondary',
56
- renderIcon: (props) => <Add size={16} {...props} />,
57
- size: isDesktop(layout) ? 'sm' : 'lg',
58
- },
59
- selectPatientAction: (selectedPatientUuid) => {
60
- launchWorkspace('create-queue-entry-workspace', {
61
- selectedPatientUuid,
62
- currentServiceQueueUuid: selectedQueue.uuid,
63
- });
64
- },
65
- workspaceTitle: t('addPatientToQueue', 'Add patient to queue'),
66
- }}
67
- />
50
+ <AddPatientToQueueButton />
68
51
  <div className={styles.filterSearch}>
69
52
  <Search
70
53
  labelText=""
@@ -10,12 +10,9 @@
10
10
  "age": "Age",
11
11
  "aListOfPatients": "A list of patients waiting for ",
12
12
  "all": "All",
13
- "and": "And",
14
13
  "any": "Any",
15
- "applyFilters": "Apply filters",
16
14
  "averageWaitTime": "Average wait time today",
17
15
  "backToSearchResults": "Back to search results",
18
- "between": "Between",
19
16
  "bmi": "Bmi",
20
17
  "bp": "Bp",
21
18
  "call": "Call",
@@ -50,7 +47,6 @@
50
47
  "editQueueEntryForPatient": "Edit queue entry for {{patient}}",
51
48
  "encounters": "Encounters",
52
49
  "encounterType": "Encounter type",
53
- "endAgeRangeInvalid": "End age range is not valid",
54
50
  "endDate": "End date",
55
51
  "enterCommentHere": "Enter comment here",
56
52
  "errorClearingQueues": "Error clearing queues",
@@ -61,8 +57,6 @@
61
57
  "errorLoadingQueueEntry": "Error loading queue entry",
62
58
  "failedToLoadLocations": "Failed to load locations",
63
59
  "female": "Female",
64
- "femaleLabelText": "Female",
65
- "filter": "Filter",
66
60
  "filterTable": "Filter table",
67
61
  "formValidationFailed": "Form validation failed",
68
62
  "gender": "Gender",
@@ -75,7 +69,6 @@
75
69
  "invalidtableConfig": "Invalid table configuration",
76
70
  "location": "Location",
77
71
  "male": "Male",
78
- "maleLabelText": "Male",
79
72
  "manageServiceQueues": "Manage Service Queues",
80
73
  "medications": "Medications",
81
74
  "minuteFormatted": "{{minutes}} minute(s)",
@@ -101,8 +94,6 @@
101
94
  "noVitalsFound": "No vitals found",
102
95
  "noVitalsRecorded": "No vitals have been recorded in this visit",
103
96
  "now": "Now",
104
- "off": "Off",
105
- "on": "On",
106
97
  "onTime": "On time",
107
98
  "orderDurationAndUnit": "for {{duration}} {{durationUnit}}",
108
99
  "orderIndefiniteDuration": "Indefinite duration",
@@ -170,7 +161,6 @@
170
161
  "scheduledToday": "Scheduled for today",
171
162
  "searchThisList": "Search this list",
172
163
  "selectALocation": "Select a location",
173
- "selectAVisitType": "Select visit type",
174
164
  "selectQueueLocation": "Select a queue location",
175
165
  "selectQueueRoomLocation": "Select a queue room location",
176
166
  "selectQueueRoomService": "Select a queue room service",
@@ -185,7 +175,6 @@
185
175
  "serviceQueuesAdmin": "Service Queues Admin",
186
176
  "showPatientsWithStatus": "Show patients with status:",
187
177
  "sp02": "Sp02",
188
- "startAgeRangeInvalid": "Start age range is not valid",
189
178
  "status": "Status",
190
179
  "success": "Success",
191
180
  "temperature": "Temperature",
@@ -210,7 +199,7 @@
210
199
  "unknown": "Unknown",
211
200
  "unknownError": "An unknown error occurred",
212
201
  "urgent": "Urgent",
213
- "useTodaysDate": "Use today's date",
202
+ "visitRequiredToCreateQueueEntry": "A visit is required to add patient to queue",
214
203
  "visitTabs": "Visit tabs",
215
204
  "visitType": "Visit Type",
216
205
  "vitals": "Vitals",