@ampath/esm-dha-workflow-app 4.0.0-next.4 → 4.0.0-next.41

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 (167) hide show
  1. package/dist/104.js +2 -0
  2. package/dist/104.js.LICENSE.txt +9 -0
  3. package/dist/104.js.map +1 -0
  4. package/dist/15.js +1 -0
  5. package/dist/15.js.map +1 -0
  6. package/dist/246.js +2 -0
  7. package/dist/246.js.LICENSE.txt +54 -0
  8. package/dist/246.js.map +1 -0
  9. package/dist/327.js +1 -0
  10. package/dist/327.js.map +1 -0
  11. package/dist/339.js +1 -0
  12. package/dist/339.js.map +1 -0
  13. package/dist/709.js +1 -0
  14. package/dist/709.js.map +1 -0
  15. package/dist/710.js +2 -0
  16. package/dist/710.js.map +1 -0
  17. package/dist/729.js +1 -0
  18. package/dist/729.js.map +1 -0
  19. package/dist/752.js +1 -0
  20. package/dist/752.js.map +1 -0
  21. package/dist/833.js +1 -0
  22. package/dist/833.js.map +1 -0
  23. package/dist/91.js +1 -1
  24. package/dist/91.js.map +1 -1
  25. package/dist/93.js +1 -0
  26. package/dist/93.js.map +1 -0
  27. package/dist/938.js +1 -0
  28. package/dist/938.js.map +1 -0
  29. package/dist/esm-dha-workflow-app.js +1 -0
  30. package/dist/{openmrs-esm-home-app.js.buildmanifest.json → esm-dha-workflow-app.js.buildmanifest.json} +294 -55
  31. package/dist/{openmrs-esm-home-app.js.map → esm-dha-workflow-app.js.map} +1 -1
  32. package/dist/main.js +1 -1
  33. package/dist/main.js.map +1 -1
  34. package/dist/routes.json +1 -1
  35. package/package.json +3 -3
  36. package/src/accounting/accounting.component.tsx +13 -0
  37. package/src/appointments/appointments.component.tsx +13 -0
  38. package/src/bookings/daily/daily-bookings.component.scss +38 -0
  39. package/src/bookings/daily/daily-bookings.component.tsx +138 -0
  40. package/src/bookings/daily/daily-bookings.resource.ts +27 -0
  41. package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
  42. package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
  43. package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
  44. package/src/bookings/types/index.ts +68 -0
  45. package/src/config-schema.ts +132 -32
  46. package/src/dashboard/dashboard.component.scss +7 -0
  47. package/src/dashboard/dashboard.component.tsx +63 -0
  48. package/src/dashboard/overview/overview.component.scss +70 -0
  49. package/src/dashboard/overview/overview.component.tsx +107 -0
  50. package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
  51. package/src/hooks/useActions.ts +165 -0
  52. package/src/index.ts +23 -2
  53. package/src/laboratory/laboratory.component.tsx +13 -0
  54. package/src/left-panel/left-panel.component.tsx +20 -0
  55. package/src/left-panel/left-panel.scss +42 -0
  56. package/src/mch/queues/consultation/mch-consultation.tsx +18 -0
  57. package/src/mch/queues/triage/mch-triage.tsx +15 -0
  58. package/src/modals/sign-off-modal.scss +7 -0
  59. package/src/modals/sign-off-modal.tsx +52 -0
  60. package/src/mortuary/mortuary.component.tsx +13 -0
  61. package/src/pharmacy/pharmacy.component.tsx +13 -0
  62. package/src/registry/client-details/client-details.tsx +40 -0
  63. package/src/registry/modal/client-details-modal/client-details-modal.scss +28 -0
  64. package/src/registry/modal/client-details-modal/client-details-modal.tsx +81 -0
  65. package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +31 -0
  66. package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +186 -0
  67. package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +34 -0
  68. package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +302 -0
  69. package/src/registry/payment-details/payment-options/payment-options.tsx +21 -0
  70. package/src/registry/registry.component.scss +83 -0
  71. package/src/registry/registry.component.tsx +397 -2
  72. package/src/registry/registry.resource.ts +60 -0
  73. package/src/registry/types/index.ts +309 -0
  74. package/src/registry/utils/error-handler.ts +37 -0
  75. package/src/registry/utils/format-dependant-display-data.ts +8 -0
  76. package/src/registry/utils/hie-adapter.ts +56 -0
  77. package/src/registry/utils/hie-client-adapter.ts +309 -0
  78. package/src/registry/utils/mask-data.ts +21 -0
  79. package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
  80. package/src/resources/identifier-types.ts +27 -0
  81. package/src/resources/patient-resource.ts +62 -0
  82. package/src/resources/patient-search.resource.ts +22 -0
  83. package/src/resources/queue.resource.ts +60 -0
  84. package/src/resources/visit.resource.ts +38 -0
  85. package/src/root.component.tsx +42 -30
  86. package/src/root.scss +5 -9
  87. package/src/routes.json +43 -4
  88. package/src/service-queues/action-button.component.tsx +34 -0
  89. package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
  90. package/src/service-queues/consultation/consultation.component.scss +7 -0
  91. package/src/service-queues/consultation/consultation.component.tsx +15 -0
  92. package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
  93. package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
  94. package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
  95. package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
  96. package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
  97. package/src/service-queues/metrics/metrics-container.scss +36 -0
  98. package/src/service-queues/metrics/metrics.resource.ts +65 -0
  99. package/src/service-queues/modals/move/move-patient.component.scss +35 -0
  100. package/src/service-queues/modals/move/move-patient.component.tsx +138 -0
  101. package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
  102. package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
  103. package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
  104. package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
  105. package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
  106. package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
  107. package/src/service-queues/queue-list/queue-list.component.scss +19 -0
  108. package/src/service-queues/queue-list/queue-list.component.tsx +169 -0
  109. package/src/service-queues/queue-room.component.tsx +39 -0
  110. package/src/service-queues/room/room.component.tsx +58 -0
  111. package/src/service-queues/service-queue/service-queue.component.scss +14 -0
  112. package/src/service-queues/service-queue/service-queue.component.tsx +245 -0
  113. package/src/service-queues/service-queue/stats/stat-card/stat-card.component.scss +10 -0
  114. package/src/service-queues/service-queue/stats/stat-card/stat-card.component.tsx +23 -0
  115. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +7 -0
  116. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +34 -0
  117. package/src/service-queues/service-queue.scss +27 -0
  118. package/src/service-queues/service-queue.tsx +31 -0
  119. package/src/service-queues/service-queues.resource.ts +177 -0
  120. package/src/service-queues/service.resource.ts +28 -0
  121. package/src/shared/constants/civil-status.ts +29 -0
  122. package/src/shared/constants/concepts.ts +30 -0
  123. package/src/shared/constants/index.ts +1 -0
  124. package/src/shared/constants/person-attributes.ts +33 -0
  125. package/src/shared/services/location.resource.ts +9 -0
  126. package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
  127. package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
  128. package/src/shared/ui/timer/timer.component.scss +5 -0
  129. package/src/shared/ui/timer/timer.component.tsx +40 -0
  130. package/src/shared/utils/get-base-url.ts +17 -0
  131. package/src/side-nav-menu/nav-link-config.ts +82 -0
  132. package/src/side-nav-menu/nav-links.tsx +31 -11
  133. package/src/triage/metrics/attended-patients.extension.tsx +42 -0
  134. package/src/triage/metrics/metrics.scss +36 -0
  135. package/src/triage/metrics/triage-metrics.component.tsx +21 -0
  136. package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
  137. package/src/triage/room/room.scss +29 -0
  138. package/src/triage/triage.component.tsx +15 -0
  139. package/src/triage/triage.resource.ts +19 -0
  140. package/src/triage/types.ts +16 -0
  141. package/src/types/types.ts +128 -0
  142. package/dist/561.js +0 -2
  143. package/dist/561.js.map +0 -1
  144. package/dist/70.js +0 -1
  145. package/dist/70.js.map +0 -1
  146. package/dist/731.js +0 -2
  147. package/dist/731.js.LICENSE.txt +0 -39
  148. package/dist/731.js.map +0 -1
  149. package/dist/819.js +0 -1
  150. package/dist/819.js.map +0 -1
  151. package/dist/openmrs-esm-home-app.js +0 -1
  152. package/src/boxes/extensions/blue-box.component.tsx +0 -15
  153. package/src/boxes/extensions/box.scss +0 -23
  154. package/src/boxes/extensions/brand-box.component.tsx +0 -15
  155. package/src/boxes/extensions/red-box.component.tsx +0 -15
  156. package/src/boxes/slot/boxes.component.tsx +0 -25
  157. package/src/boxes/slot/boxes.scss +0 -29
  158. package/src/greeter/greeter.component.tsx +0 -42
  159. package/src/greeter/greeter.scss +0 -20
  160. package/src/greeter/greeter.test.tsx +0 -28
  161. package/src/patient-getter/patient-getter.component.tsx +0 -40
  162. package/src/patient-getter/patient-getter.resource.ts +0 -39
  163. package/src/patient-getter/patient-getter.scss +0 -16
  164. package/src/patient-getter/patient-getter.test.tsx +0 -40
  165. package/src/resources/resources.component.tsx +0 -56
  166. package/src/resources/resources.scss +0 -68
  167. /package/dist/{561.js.LICENSE.txt → 710.js.LICENSE.txt} +0 -0
@@ -0,0 +1,82 @@
1
+ export const navLinksConfig = [
2
+ {
3
+ to: 'dashboard',
4
+ title: 'Dashboard',
5
+ },
6
+ {
7
+ to: 'registry',
8
+ title: 'Registry',
9
+ },
10
+ {
11
+ to: 'appointments',
12
+ title: 'Appointments',
13
+ },
14
+ {
15
+ to: 'triage',
16
+ title: 'Triage',
17
+ },
18
+ {
19
+ to: 'consultation',
20
+ title: 'Consultation',
21
+ },
22
+ {
23
+ to: 'mch',
24
+ title: 'MCH',
25
+ children: [
26
+ {
27
+ to: 'triage',
28
+ title: 'Triage',
29
+ },
30
+ {
31
+ to: 'consultation',
32
+ title: 'Consultation',
33
+ },
34
+ ],
35
+ },
36
+ {
37
+ to: 'admissions',
38
+ title: 'Admissions',
39
+ },
40
+ {
41
+ to: 'procedures',
42
+ title: 'Procedures',
43
+ },
44
+ {
45
+ to: 'radiology-imaging',
46
+ title: 'Radiology and Imaging',
47
+ },
48
+ {
49
+ to: 'laboratory',
50
+ title: 'Laboratory',
51
+ },
52
+ {
53
+ to: 'pharmacy',
54
+ title: 'Pharmacy',
55
+ },
56
+ {
57
+ to: 'mortuary',
58
+ title: 'Mortuary',
59
+ },
60
+ {
61
+ to: 'accounting',
62
+ title: 'Accounting',
63
+ },
64
+ {
65
+ to: 'registers',
66
+ title: 'Registers',
67
+ },
68
+ {
69
+ to: 'reports',
70
+ title: 'Reports',
71
+ },
72
+ {
73
+ to: 'bookings',
74
+ title: 'Bookings',
75
+ children: [
76
+ {
77
+ to: 'daily',
78
+ title: 'Daily',
79
+ },
80
+ ],
81
+ },
82
+ ];
@@ -1,20 +1,40 @@
1
- import { SideNavMenuItem } from '@carbon/react';
2
1
  import React from 'react';
2
+ import { ConfigurableLink } from '@openmrs/esm-framework';
3
+ import classNames from 'classnames';
4
+ import { navLinksConfig } from './nav-link-config';
5
+ import { SideNavMenu } from '@carbon/react';
3
6
 
4
7
  interface NavLinksProps {}
5
8
  const NavLinks: React.FC<NavLinksProps> = () => {
6
9
  return (
7
10
  <>
8
- <SideNavMenuItem href="consultation/dashboard">Dashboard</SideNavMenuItem>
9
- <SideNavMenuItem href="consultation/registry">Registration</SideNavMenuItem>
10
- <SideNavMenuItem href="consultation/registry">Appointments</SideNavMenuItem>
11
- <SideNavMenuItem href="consultation/registry">Triage</SideNavMenuItem>
12
- <SideNavMenuItem href="consultation/registry">Consultation</SideNavMenuItem>
13
- <SideNavMenuItem href="consultation/registry">Laboratory</SideNavMenuItem>
14
- <SideNavMenuItem href="consultation/registry">Bookings</SideNavMenuItem>
15
- <SideNavMenuItem href="consultation/registry">Reports</SideNavMenuItem>
16
- <SideNavMenuItem href="consultation/registry">Registers</SideNavMenuItem>
17
- <SideNavMenuItem href="consultation/registry">Appointments</SideNavMenuItem>
11
+ {navLinksConfig.map((n) => {
12
+ if (n.children && n.children.length > 0) {
13
+ return (
14
+ <SideNavMenu title={n.title}>
15
+ {n.children.map((c) => {
16
+ return (
17
+ <ConfigurableLink
18
+ to={`${window.getOpenmrsSpaBase()}home/${n.to}/${c.to}`}
19
+ className={classNames('cds--side-nav__link', '')}
20
+ >
21
+ {c.title}
22
+ </ConfigurableLink>
23
+ );
24
+ })}
25
+ </SideNavMenu>
26
+ );
27
+ } else {
28
+ return (
29
+ <ConfigurableLink
30
+ to={`${window.getOpenmrsSpaBase()}home/${n.to}`}
31
+ className={classNames('cds--side-nav__link', '')}
32
+ >
33
+ {n.title}
34
+ </ConfigurableLink>
35
+ );
36
+ }
37
+ })}
18
38
  </>
19
39
  );
20
40
  };
@@ -0,0 +1,42 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import {
4
+ MetricsCard,
5
+ MetricsCardHeader,
6
+ MetricsCardBody,
7
+ MetricsCardItem,
8
+ } from '../../service-queues/metrics/metrics-cards/metrics-card.component';
9
+ import { useSession } from '@openmrs/esm-framework';
10
+ import { QUEUE_SERVICE_UUIDS } from '../../shared/constants/concepts';
11
+ import { getServiceQueueByLocationUuid } from '../../service-queues/service-queues.resource';
12
+ import { type QueueEntryResult } from '../../registry/types';
13
+
14
+ export default function TriageAttendedToPatientsExtension() {
15
+ const { t } = useTranslation();
16
+ const [triageQueueEntries, setTriageQueueEntries] = useState<QueueEntryResult[]>([]);
17
+ const session = useSession();
18
+ const locationUuid = session.sessionLocation.uuid;
19
+ const triageServiceUuid = QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID;
20
+ useEffect(() => {
21
+ getTriageEntryQueues();
22
+ }, []);
23
+
24
+ const getTriageEntryQueues = async () => {
25
+ const res = await getServiceQueueByLocationUuid(triageServiceUuid, locationUuid);
26
+ setTriageQueueEntries(res);
27
+ };
28
+
29
+ const attendedToPatientsCount = triageQueueEntries?.filter((p) => p.status === 'COMPLETED').length ?? 0;
30
+
31
+ return (
32
+ <MetricsCard>
33
+ <MetricsCardHeader title={t('patientsAttendedTo', 'Patients attended to')} />
34
+ <MetricsCardBody>
35
+ <MetricsCardItem
36
+ label={t('patients', 'Patients')}
37
+ value={attendedToPatientsCount ? attendedToPatientsCount : '--'}
38
+ />
39
+ </MetricsCardBody>
40
+ </MetricsCard>
41
+ );
42
+ }
@@ -0,0 +1,36 @@
1
+ @use '@carbon/layout';
2
+ @use '@openmrs/esm-styleguide/src/vars' as *;
3
+
4
+ .cardContainer {
5
+ background-color: $ui-02;
6
+ display: flex;
7
+ padding: layout.$spacing-05;
8
+ flex-flow: row wrap;
9
+ gap: layout.$spacing-05;
10
+ align-items: stretch;
11
+ }
12
+
13
+ .cardContainer > * {
14
+ flex: 1 0 0%;
15
+ min-width: 16rem;
16
+ }
17
+
18
+ // If we're on tablet and the screen is too small for 3 cards across
19
+ // @TODO: This will do nonsense things if there are not exactly 3 cards
20
+ @media (max-width: calc(layout.$spacing-05 * 4 + 18.75rem * 3)) {
21
+ :global(.omrs-breakpoint-lt-desktop) {
22
+ .cardContainer > *:has(:global(.cardWithChildren)) {
23
+ order: 999;
24
+ }
25
+ }
26
+ }
27
+
28
+ // If we're on desktop and the screen is too small for the left nav bar
29
+ // plus 3 cards across
30
+ @media (max-width: calc(16rem + layout.$spacing-05 * 4 + 18.75rem * 3)) {
31
+ :global(.omrs-breakpoint-gt-tablet) {
32
+ .cardContainer > *:has(:global(.cardWithChildren)) {
33
+ order: 999;
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { ExtensionSlot } from '@openmrs/esm-framework';
3
+ import styles from './metrics.scss';
4
+ import TriageWaitingPatientsExtension from './waiting-patients.extension';
5
+ import TriageAttendedToPatientsExtension from './attended-patients.extension';
6
+
7
+ export interface Service {
8
+ display: string;
9
+ uuid?: string;
10
+ }
11
+
12
+ function TriageMetricsContainer() {
13
+ return (
14
+ <div className={styles.cardContainer}>
15
+ <TriageWaitingPatientsExtension />
16
+ <TriageAttendedToPatientsExtension />
17
+ </div>
18
+ );
19
+ }
20
+
21
+ export default TriageMetricsContainer;
@@ -0,0 +1,39 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import {
4
+ MetricsCard,
5
+ MetricsCardHeader,
6
+ MetricsCardBody,
7
+ MetricsCardItem,
8
+ } from '../../service-queues/metrics/metrics-cards/metrics-card.component';
9
+ import { useSession } from '@openmrs/esm-framework';
10
+ import { QUEUE_SERVICE_UUIDS } from '../../shared/constants/concepts';
11
+ import { getServiceQueueByLocationUuid } from '../../service-queues/service-queues.resource';
12
+ import { type QueueEntryResult } from '../../registry/types';
13
+
14
+ export default function TriageWaitingPatientsExtension() {
15
+ const { t } = useTranslation();
16
+ const [triageQueueEntries, setTriageQueueEntries] = useState<QueueEntryResult[]>([]);
17
+ const session = useSession();
18
+ const locationUuid = session.sessionLocation.uuid;
19
+ const triageServiceUuid = QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID;
20
+ useEffect(() => {
21
+ getTriageEntryQueues();
22
+ }, []);
23
+
24
+ const getTriageEntryQueues = async () => {
25
+ const res = await getServiceQueueByLocationUuid(triageServiceUuid, locationUuid);
26
+ setTriageQueueEntries(res);
27
+ };
28
+
29
+ const waitingPatientsCount = triageQueueEntries?.filter((p) => p.status === 'WAITING').length ?? 0;
30
+
31
+ return (
32
+ <MetricsCard>
33
+ <MetricsCardHeader title={t('patientsInWaiting', 'Patients in waiting')} />
34
+ <MetricsCardBody>
35
+ <MetricsCardItem label={t('patients', 'Patients')} value={waitingPatientsCount ? waitingPatientsCount : '--'} />
36
+ </MetricsCardBody>
37
+ </MetricsCard>
38
+ );
39
+ }
@@ -0,0 +1,29 @@
1
+ .container {
2
+ border: 1px solid #9e9e9e;
3
+ padding: 1rem;
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 0.5rem;
7
+ width: fit-content;
8
+ }
9
+
10
+ .room {
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: flex-start;
14
+ margin: 1rem;
15
+ }
16
+
17
+ .roomName {
18
+ margin-bottom: 0.5rem;
19
+ font-size: large;
20
+ font-weight: bold;
21
+ }
22
+
23
+ .field {
24
+ margin: 0.25rem 0 0;
25
+ }
26
+
27
+ .button {
28
+ margin-top: 0.5rem;
29
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import ServiceQueueComponent from '../service-queues/service-queue/service-queue.component';
3
+ import { QUEUE_SERVICE_UUIDS } from '../shared/constants/concepts';
4
+
5
+ interface TriageProps {}
6
+ const Triage: React.FC<TriageProps> = () => {
7
+ return (
8
+ <>
9
+ <div>
10
+ <ServiceQueueComponent serviceTypeUuid={QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID} title="Triage" />
11
+ </div>
12
+ </>
13
+ );
14
+ };
15
+ export default Triage;
@@ -0,0 +1,19 @@
1
+ import useSWR from 'swr';
2
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
3
+
4
+ import { type Patient } from './types';
5
+ export default function useTriagePatients(locationUuid: string) {
6
+ const { data, error, isLoading } = useSWR(
7
+ `${restBaseUrl}/queue-entry?v=custom:(uuid,display,queue:(display,uuid,location:(display,uuid)),status:(display),patient:(uuid,person:(gender,age)))&totalCount=true&isEnded=false&location=${locationUuid}`,
8
+ (url: string) =>
9
+ openmrsFetch<{
10
+ results: Array<Patient>;
11
+ }>(url).then((res) => res.data.results),
12
+ );
13
+
14
+ return {
15
+ patients: data,
16
+ isLoading,
17
+ isError: error,
18
+ };
19
+ }
@@ -0,0 +1,16 @@
1
+ export interface Patient {
2
+ uuid: string;
3
+ middle_name: string;
4
+ given_name: string;
5
+ family_name: string;
6
+ queue_room: string;
7
+ status: string | number;
8
+ patient_name: string;
9
+ patient_uuid: string;
10
+ priority: string | number;
11
+ }
12
+
13
+ export interface Room {
14
+ name: string;
15
+ patients: Patient[];
16
+ }
@@ -0,0 +1,128 @@
1
+ import {
2
+ type Visit,
3
+ type Concept,
4
+ type Patient,
5
+ type OpenmrsResource,
6
+ type Obs,
7
+ type FetchResponse,
8
+ } from '@openmrs/esm-framework';
9
+
10
+ export interface QueueEntry {
11
+ uuid: string;
12
+ display: string;
13
+ endedAt: string;
14
+ locationWaitingFor: Location;
15
+ patient: Patient;
16
+ priority: Concept;
17
+ priorityComment: string | null;
18
+ providerWaitingFor: Provider;
19
+ queue: Queue;
20
+ startedAt: string;
21
+ status: Concept;
22
+ visit: Visit;
23
+ sortWeight: number;
24
+ queueComingFrom: Queue;
25
+ previousQueueEntry: QueueEntry;
26
+ }
27
+
28
+ export interface Provider {
29
+ uuid: string;
30
+ display: string;
31
+ comments: string;
32
+ response?: string;
33
+ person: OpenmrsResource;
34
+ location: string;
35
+ serviceType: string;
36
+ }
37
+
38
+ export interface Queue {
39
+ uuid: string;
40
+ display: string;
41
+ name: string;
42
+ description: string;
43
+ location: Location;
44
+ service: Concept;
45
+ allowedPriorities: Array<Concept>;
46
+ allowedStatuses: Array<Concept>;
47
+ }
48
+
49
+ export interface Identifer {
50
+ identifier: string;
51
+ display: string;
52
+ uuid: string;
53
+ identifierType: {
54
+ uuid: string;
55
+ display: string;
56
+ };
57
+ }
58
+
59
+ interface Encounter {
60
+ diagnoses?: Array<any>;
61
+ encounterDatetime?: string;
62
+ encounterProviders?: Array<{ provider?: { person?: { display?: string } } }>;
63
+ encounterType?: { display: string; uuid: string };
64
+ obs?: Array<Obs>;
65
+ uuid: string;
66
+ voided?: boolean;
67
+ }
68
+
69
+ export interface MappedEncounter extends Omit<Encounter, 'encounterType' | 'provider'> {
70
+ encounterType: string;
71
+ provider: string;
72
+ }
73
+
74
+ export interface MappedVisitQueueEntry {
75
+ id: string;
76
+ encounters: Array<MappedEncounter>;
77
+ name: string;
78
+ patientAge: string;
79
+ patientDob: string;
80
+ patientGender: string;
81
+ patientUuid: string;
82
+ queue: Queue;
83
+ priority: Concept;
84
+ priorityComment: string;
85
+ status: Concept;
86
+ startedAt: Date;
87
+ endedAt: Date;
88
+ visitType: string;
89
+ visitUuid: string;
90
+ visitTypeUuid: string;
91
+ queueUuid: string;
92
+ queueEntryUuid: string;
93
+ queueLocation: string;
94
+ sortWeight: number;
95
+ visitQueueNumber: string;
96
+ identifiers: Array<Identifer>;
97
+ queueComingFrom: string;
98
+ }
99
+
100
+ export type QueueEntryResponse = FetchResponse<{
101
+ results: Array<QueueEntry>;
102
+ links: Array<{
103
+ rel: 'prev' | 'next';
104
+ uri: string;
105
+ }>;
106
+ totalCount: number;
107
+ }>;
108
+
109
+ export type TransitionQueueEntryDto = {
110
+ queueEntryToTransition: string;
111
+ newQueue?: string;
112
+ newStatus?: string;
113
+ newPriority?: string;
114
+ newPriorityComment?: string;
115
+ };
116
+
117
+ export type TagColor = 'green' | 'gray' | 'blue' | 'red';
118
+
119
+ export enum QueueEntryStatus {
120
+ Completed = 'COMPLETED',
121
+ Waiting = 'WAITING',
122
+ InService = 'IN SERVICE',
123
+ }
124
+
125
+ export enum QueueEntryPriority {
126
+ Emergency = 'EMERGENCY',
127
+ Normal = 'NORMAL',
128
+ }