@kenyaemr/esm-billing-app 5.4.5-pre.607 → 5.4.5-pre.611

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 (50) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/104.js +1 -1
  3. package/dist/104.js.map +1 -1
  4. package/dist/3294.js +1 -1
  5. package/dist/3294.js.map +1 -1
  6. package/dist/3378.js +1 -1
  7. package/dist/3378.js.map +1 -1
  8. package/dist/5117.js +1 -1
  9. package/dist/5117.js.map +1 -1
  10. package/dist/5292.js +1 -1
  11. package/dist/5292.js.map +1 -1
  12. package/dist/5809.js +1 -1
  13. package/dist/5809.js.map +1 -1
  14. package/dist/5903.js +1 -1
  15. package/dist/5903.js.map +1 -1
  16. package/dist/6508.js +1 -1
  17. package/dist/6508.js.map +1 -1
  18. package/dist/6967.js +1 -1
  19. package/dist/6967.js.map +1 -1
  20. package/dist/8990.js +1 -1
  21. package/dist/8990.js.map +1 -1
  22. package/dist/9806.js +1 -1
  23. package/dist/9806.js.map +1 -1
  24. package/dist/kenyaemr-esm-billing-app.js +2 -2
  25. package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +33 -81
  26. package/dist/main.js +2 -2
  27. package/dist/main.js.map +1 -1
  28. package/dist/routes.json +1 -1
  29. package/package.json +1 -1
  30. package/src/billing-form/social-health-authority/sha-virtual-claim.resource.ts +1 -3
  31. package/src/billing-tabs/billling-tabs.component.tsx +5 -7
  32. package/src/billing.resource.ts +4 -7
  33. package/src/claims/claims-management/pages/resubmit-claim-page.scss +28 -28
  34. package/src/index.ts +0 -1
  35. package/src/routes.json +1 -6
  36. package/translations/am.json +1 -31
  37. package/translations/en.json +1 -31
  38. package/translations/fr.json +1 -31
  39. package/translations/sw.json +1 -31
  40. package/dist/692.js +0 -1
  41. package/dist/692.js.map +0 -1
  42. package/dist/9326.js +0 -1
  43. package/dist/9326.js.map +0 -1
  44. package/src/visits/visit-attributes.workspace.scss +0 -43
  45. package/src/visits/visit-attributes.workspace.tsx +0 -124
  46. package/src/visits/visits-filters.component.tsx +0 -118
  47. package/src/visits/visits-filters.scss +0 -26
  48. package/src/visits/visits.component.tsx +0 -220
  49. package/src/visits/visits.resource.ts +0 -66
  50. package/src/visits/visits.scss +0 -129
@@ -1,220 +0,0 @@
1
- import React, { useMemo, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import {
4
- Button,
5
- DataTable,
6
- DataTableSkeleton,
7
- Layer,
8
- OverflowMenu,
9
- OverflowMenuItem,
10
- Pagination,
11
- Table,
12
- TableBody,
13
- TableCell,
14
- TableContainer,
15
- TableHead,
16
- TableHeader,
17
- TableRow,
18
- TableToolbar,
19
- TableToolbarContent,
20
- TableToolbarSearch,
21
- Tile,
22
- type DataTableHeader,
23
- } from '@carbon/react';
24
- import { FilterRemove } from '@carbon/react/icons';
25
- import {
26
- ErrorState,
27
- formatDatetime,
28
- isDesktop,
29
- launchWorkspace2,
30
- parseDate,
31
- useLayoutType,
32
- } from '@openmrs/esm-framework';
33
- import { EmptyDataIllustration, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
34
- import { useActiveVisits } from './visits.resource';
35
- import VisitFilters, { getDateRange, type VisitFilterValues } from './visits-filters.component';
36
- import styles from './visits.scss';
37
-
38
- const DEFAULT_FILTERS: VisitFilterValues = {
39
- dateRangePreset: 'today',
40
- };
41
-
42
- const headers: Array<DataTableHeader> = [
43
- { key: 'patientName', header: 'Patient name' },
44
- { key: 'visitType', header: 'Visit type' },
45
- { key: 'location', header: 'Location' },
46
- { key: 'startDatetime', header: 'Start date' },
47
- ];
48
-
49
- const ActiveVisit: React.FC = () => {
50
- const { t } = useTranslation();
51
- const layout = useLayoutType();
52
- const responsiveSize = isDesktop(layout) ? 'sm' : 'lg';
53
-
54
- const [filters, setFilters] = useState<VisitFilterValues>(DEFAULT_FILTERS);
55
- const [pageSize, setPageSize] = useState(10);
56
-
57
- const [fromDate, toDate] = getDateRange(filters);
58
- const { visits, isLoading, error, pagination } = useActiveVisits({ fromDate, toDate, pageSize });
59
- const { goTo, currentPage, totalCount } = pagination;
60
- const { pageSizes } = usePaginationInfo(pageSize, totalCount, currentPage, visits.length);
61
-
62
- const rows = useMemo(
63
- () =>
64
- visits.map((visit) => ({
65
- id: visit.uuid,
66
- patientName: visit.patient?.display?.split('-')?.slice(1)?.join('-')?.trim() || visit.patient?.display || '--',
67
- visitType: visit.visitType?.display ?? '--',
68
- location: visit.location?.display ?? '--',
69
- startDatetime: visit.startDatetime ? formatDatetime(parseDate(visit.startDatetime), { mode: 'wide' }) : '--',
70
- })),
71
- [visits, t],
72
- );
73
-
74
- const visitsByUuid = useMemo(() => new Map(visits.map((visit) => [visit.uuid, visit])), [visits]);
75
-
76
- if (isLoading) {
77
- return (
78
- <div className={styles.loaderContainer}>
79
- <DataTableSkeleton
80
- rowCount={pageSize}
81
- showHeader={false}
82
- showToolbar={false}
83
- zebra
84
- columnCount={headers.length}
85
- />
86
- </div>
87
- );
88
- }
89
-
90
- if (error) {
91
- return (
92
- <div className={styles.errorContainer}>
93
- <Layer>
94
- <ErrorState error={error} headerTitle={t('activeVisits', 'Active visits')} />
95
- </Layer>
96
- </div>
97
- );
98
- }
99
-
100
- if (visits.length === 0) {
101
- return (
102
- <div className={styles.visitsListContainer}>
103
- <VisitFilters values={filters} onChange={setFilters} />
104
- <Layer className={styles.emptyStateContainer}>
105
- <Tile className={styles.tile}>
106
- <div className={styles.illo}>
107
- <EmptyDataIllustration />
108
- </div>
109
- <p className={styles.content}>
110
- {t('noActiveVisitsInRange', 'There are no active visits within the selected date range.')}
111
- </p>
112
- <Button kind="ghost" size="sm" renderIcon={FilterRemove} onClick={() => setFilters(DEFAULT_FILTERS)}>
113
- {t('clearFilters', 'Clear filters')}
114
- </Button>
115
- </Tile>
116
- </Layer>
117
- </div>
118
- );
119
- }
120
-
121
- return (
122
- <div className={styles.visitsListContainer}>
123
- <VisitFilters values={filters} onChange={setFilters} />
124
- <DataTable isSortable rows={rows} headers={headers} size={responsiveSize} useZebraStyles>
125
- {({
126
- rows: tableRows,
127
- headers: tableHeaders,
128
- getHeaderProps,
129
- getRowProps,
130
- getToolbarProps,
131
- getTableProps,
132
- getTableContainerProps,
133
- onInputChange,
134
- }) => (
135
- <TableContainer
136
- title={t('activeVisits', 'Active visits')}
137
- description={t('activeVisitsDescription', 'Patients with an ongoing visit within the selected date range.')}
138
- {...getTableContainerProps()}>
139
- <TableToolbar {...getToolbarProps()}>
140
- <TableToolbarContent>
141
- <TableToolbarSearch
142
- persistent
143
- onChange={(e) => onInputChange(e as React.ChangeEvent<HTMLInputElement>)}
144
- placeholder={t('searchVisits', 'Search visits')}
145
- />
146
- </TableToolbarContent>
147
- </TableToolbar>
148
- <Table {...getTableProps()} aria-label={t('activeVisits', 'Active visits')}>
149
- <TableHead>
150
- <TableRow>
151
- {tableHeaders.map((header) => (
152
- <TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
153
- ))}
154
- <TableHeader aria-label={t('visitActions', 'Visit actions')} />
155
- </TableRow>
156
- </TableHead>
157
- <TableBody>
158
- {tableRows.map((row) => {
159
- const visit = visitsByUuid.get(row.id);
160
- if (!visit) {
161
- return null;
162
- }
163
-
164
- return (
165
- <TableRow {...getRowProps({ row })} key={row.id}>
166
- {row.cells.map((cell) => (
167
- <TableCell key={cell.id}>{cell.value}</TableCell>
168
- ))}
169
- <TableCell className="cds--table-column-menu">
170
- <div className={styles.overflowMenuItemContainer}>
171
- <OverflowMenu aria-label={t('visitActions', 'Visit actions')} size="sm" flipped>
172
- <OverflowMenuItem
173
- itemText={t('manageVisit', 'Manage visit')}
174
- onClick={() =>
175
- launchWorkspace2(
176
- 'visit-attributes-workspace',
177
- {
178
- patientUuid: visit.patient?.uuid,
179
- visit,
180
- workspaceTitle: t('manageVisit', 'Manage visit'),
181
- },
182
- {},
183
- {},
184
- )
185
- }
186
- />
187
- </OverflowMenu>
188
- </div>
189
- </TableCell>
190
- </TableRow>
191
- );
192
- })}
193
- </TableBody>
194
- </Table>
195
- </TableContainer>
196
- )}
197
- </DataTable>
198
- <Pagination
199
- forwardText={t('nextPage', 'Next page')}
200
- backwardText={t('previousPage', 'Previous page')}
201
- page={currentPage ?? 1}
202
- pageSize={pageSize}
203
- pageSizes={pageSizes}
204
- totalItems={totalCount}
205
- className={styles.pagination}
206
- size={responsiveSize}
207
- onChange={({ pageSize: newPageSize, page: newPage }) => {
208
- if (newPageSize !== pageSize) {
209
- setPageSize(newPageSize);
210
- }
211
- if (newPage !== currentPage) {
212
- goTo(newPage);
213
- }
214
- }}
215
- />
216
- </div>
217
- );
218
- };
219
-
220
- export default ActiveVisit;
@@ -1,66 +0,0 @@
1
- import { restBaseUrl, useOpenmrsPagination, type Visit } from '@openmrs/esm-framework';
2
- import dayjs from 'dayjs';
3
-
4
- const activeVisitsRepresentation =
5
- 'custom:(uuid,startDatetime,stopDatetime,patient:(uuid,display),visitType:(uuid,display),location:(uuid,display))';
6
-
7
- export const useActiveVisits = (
8
- options: {
9
- fromDate?: Date;
10
- toDate?: Date;
11
- pageSize?: number;
12
- } = {},
13
- ) => {
14
- const { fromDate = dayjs().startOf('day').toDate(), toDate = dayjs().endOf('day').toDate(), pageSize = 10 } = options;
15
-
16
- const url =
17
- `${restBaseUrl}/visit?includeInactive=false&v=${activeVisitsRepresentation}` +
18
- `&fromStartDate=${dayjs(fromDate).format('YYYY-MM-DD')}`;
19
-
20
- const {
21
- data: visits,
22
- error,
23
- isLoading,
24
- isValidating,
25
- mutate,
26
- totalPages,
27
- totalCount,
28
- currentPage,
29
- currentPageSize,
30
- paginated,
31
- showNextButton,
32
- showPreviousButton,
33
- goTo,
34
- goToNext,
35
- goToPrevious,
36
- } = useOpenmrsPagination<Visit>(url, pageSize, {
37
- swrConfig: { errorRetryCount: 2, keepPreviousData: true, revalidateOnFocus: true },
38
- });
39
-
40
- // The endpoint only filters by a lower `fromStartDate` bound, so enforce the upper bound here.
41
- const toDateMs = dayjs(toDate).valueOf();
42
- const filteredVisits = (visits ?? []).filter(
43
- (visit) => visit.startDatetime && dayjs(visit.startDatetime).valueOf() <= toDateMs,
44
- );
45
-
46
- return {
47
- visits: filteredVisits,
48
- error,
49
- isLoading,
50
- isValidating,
51
- mutate,
52
- pagination: {
53
- totalPages,
54
- totalCount,
55
- currentPage,
56
- currentPageSize,
57
- paginated,
58
- showNextButton,
59
- showPreviousButton,
60
- goTo,
61
- goToNext,
62
- goToPrevious,
63
- pageSize,
64
- },
65
- };
66
- };
@@ -1,129 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '@carbon/type';
3
- @use '@openmrs/esm-styleguide/src/vars' as *;
4
-
5
- .container {
6
- margin-top: layout.$spacing-05;
7
- }
8
-
9
- .emptyStateContainer,
10
- .loaderContainer,
11
- .errorContainer {
12
- @extend .container;
13
- }
14
-
15
- .visitsListContainer {
16
- background-color: $ui-02;
17
- border: 1px solid $ui-03;
18
- width: 100%;
19
- margin: 0 auto;
20
- padding-bottom: 0;
21
-
22
- :global(.cds--table-toolbar) {
23
- position: relative !important;
24
- }
25
- }
26
-
27
- .headerContainer {
28
- display: flex;
29
- justify-content: space-between;
30
- align-items: center;
31
- padding: layout.$spacing-04 layout.$spacing-05;
32
- background-color: $ui-02;
33
- }
34
-
35
- .desktopHeading,
36
- .tabletHeading {
37
- text-align: left;
38
- text-transform: capitalize;
39
- flex: 1;
40
-
41
- h4 {
42
- @include type.type-style('heading-compact-02');
43
- color: $text-02;
44
-
45
- &:after {
46
- content: '';
47
- display: block;
48
- width: 2rem;
49
- padding-top: 3px;
50
- border-bottom: 0.375rem solid;
51
- @include brand-03(border-bottom-color);
52
- }
53
- }
54
- }
55
-
56
- .backgroundDataFetchingIndicator {
57
- align-items: center;
58
- display: flex;
59
- flex: 1;
60
- justify-content: flex-end;
61
-
62
- &:global(.cds--inline-loading) {
63
- max-height: 1rem;
64
- }
65
- }
66
-
67
- .toolbarContent {
68
- align-items: flex-end;
69
- gap: layout.$spacing-05;
70
- }
71
-
72
- .dateRangePicker {
73
- :global(.cds--date-picker-container) {
74
- max-width: 12rem;
75
- }
76
- }
77
-
78
- .pagination {
79
- overflow: hidden;
80
-
81
- &:global(.cds--pagination) {
82
- border-top: none;
83
- }
84
- }
85
-
86
- .tile {
87
- text-align: center;
88
- border: 1px solid $ui-03;
89
- }
90
-
91
- .illo {
92
- margin-top: layout.$spacing-05;
93
- }
94
-
95
- .content {
96
- @include type.type-style('heading-compact-01');
97
- color: $text-02;
98
- margin-top: layout.$spacing-05;
99
- margin-bottom: layout.$spacing-03;
100
- }
101
-
102
- .filterEmptyState {
103
- display: flex;
104
- justify-content: center;
105
- align-items: center;
106
- padding: layout.$spacing-05;
107
- margin: layout.$spacing-09;
108
- text-align: center;
109
- }
110
-
111
- .filterEmptyStateTile {
112
- margin: auto;
113
- }
114
-
115
- .filterEmptyStateContent {
116
- @include type.type-style('heading-compact-02');
117
- color: $text-02;
118
- margin-bottom: 0.5rem;
119
- }
120
-
121
- .filterEmptyStateHelper {
122
- @include type.type-style('body-compact-01');
123
- color: $text-02;
124
- }
125
-
126
- .overflowMenuItemContainer {
127
- display: flex;
128
- justify-content: flex-end;
129
- }