@openmrs/esm-appointments-app 9.0.1-pre.6388 → 9.0.1-pre.6393

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.
@@ -57,9 +57,9 @@
57
57
  "entry": false,
58
58
  "recorded": false,
59
59
  "reason": "split chunk (cache group: default)",
60
- "size": 146160,
60
+ "size": 146337,
61
61
  "sizes": {
62
- "javascript": 146160
62
+ "javascript": 146337
63
63
  },
64
64
  "names": [],
65
65
  "idHints": [],
@@ -73,7 +73,7 @@
73
73
  "auxiliaryFiles": [
74
74
  "525.js.map"
75
75
  ],
76
- "hash": "36088e87b4dd60b3",
76
+ "hash": "9d884b24398d5100",
77
77
  "childrenByOrder": {}
78
78
  },
79
79
  {
@@ -326,7 +326,7 @@
326
326
  "auxiliaryFiles": [
327
327
  "1431.js.map"
328
328
  ],
329
- "hash": "eb84ecc53381895a",
329
+ "hash": "4c271c2fffe86927",
330
330
  "childrenByOrder": {}
331
331
  },
332
332
  {
@@ -892,7 +892,7 @@
892
892
  "4300.js"
893
893
  ],
894
894
  "auxiliaryFiles": [],
895
- "hash": "17c6228d9e5634dd",
895
+ "hash": "4a776e3f7fc7b00c",
896
896
  "childrenByOrder": {}
897
897
  },
898
898
  {
@@ -1638,9 +1638,9 @@
1638
1638
  "initial": false,
1639
1639
  "entry": false,
1640
1640
  "recorded": false,
1641
- "size": 24350,
1641
+ "size": 25265,
1642
1642
  "sizes": {
1643
- "javascript": 24350
1643
+ "javascript": 25265
1644
1644
  },
1645
1645
  "names": [],
1646
1646
  "idHints": [],
@@ -1653,7 +1653,7 @@
1653
1653
  "auxiliaryFiles": [
1654
1654
  "7698.js.map"
1655
1655
  ],
1656
- "hash": "854ff309093db116",
1656
+ "hash": "6c396bd1ca374a75",
1657
1657
  "childrenByOrder": {}
1658
1658
  },
1659
1659
  {
@@ -1793,10 +1793,10 @@
1793
1793
  "initial": true,
1794
1794
  "entry": true,
1795
1795
  "recorded": false,
1796
- "size": 194914,
1796
+ "size": 195829,
1797
1797
  "sizes": {
1798
1798
  "consume-shared": 168,
1799
- "javascript": 171378,
1799
+ "javascript": 172293,
1800
1800
  "share-init": 378,
1801
1801
  "runtime": 22990
1802
1802
  },
@@ -1813,7 +1813,7 @@
1813
1813
  "auxiliaryFiles": [
1814
1814
  "main.js.map"
1815
1815
  ],
1816
- "hash": "41547b67e717efc1",
1816
+ "hash": "05e769f7745af43a",
1817
1817
  "childrenByOrder": {}
1818
1818
  },
1819
1819
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"},"order":2},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-dashboard","slot":"appointments-dashboard-slot","component":"appointmentsDashboard"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"early-appointments-panel","component":"earlyAppointments"},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"hideDashboardTitle":true,"path":"Appointments","slot":"patient-chart-appointments-dashboard-slot","title":"Appointments"}},{"name":"appointments-details-widget","component":"patientAppointmentsDetailedSummary","slot":"patient-chart-appointments-dashboard-slot","meta":{"columnSpan":1}},{"name":"patient-upcoming-appointment-widget","component":"patientUpcomingAppointmentsWidget","slot":"visit-form-top-slot"},{"name":"search-patient","component":"searchPatient"},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"},{"name":"metrics-card-scheduled-appointments","component":"metricsCardScheduledAppointments","slot":"appointments-metrics-slot","order":1},{"name":"metrics-card-highest-volume-service","component":"metricsCardHighestVolumeService","slot":"appointments-metrics-slot","order":2},{"name":"metrics-card-providers-booked","component":"metricsCardProvidersBooked","slot":"appointments-metrics-slot","order":3}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"cancel-appointment-modal","component":"cancelAppointmentModal"}],"workspaces":[{"name":"appointments-form-workspace","component":"appointmentsFormWorkspace","title":"createNewAppointment","type":"form"}],"version":"9.0.1-pre.6388"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"},"order":2},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-dashboard","slot":"appointments-dashboard-slot","component":"appointmentsDashboard"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"early-appointments-panel","component":"earlyAppointments"},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"hideDashboardTitle":true,"path":"Appointments","slot":"patient-chart-appointments-dashboard-slot","title":"Appointments"}},{"name":"appointments-details-widget","component":"patientAppointmentsDetailedSummary","slot":"patient-chart-appointments-dashboard-slot","meta":{"columnSpan":1}},{"name":"patient-upcoming-appointment-widget","component":"patientUpcomingAppointmentsWidget","slot":"visit-form-top-slot"},{"name":"search-patient","component":"searchPatient"},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"},{"name":"metrics-card-scheduled-appointments","component":"metricsCardScheduledAppointments","slot":"appointments-metrics-slot","order":1},{"name":"metrics-card-highest-volume-service","component":"metricsCardHighestVolumeService","slot":"appointments-metrics-slot","order":2},{"name":"metrics-card-providers-booked","component":"metricsCardProvidersBooked","slot":"appointments-metrics-slot","order":3}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"cancel-appointment-modal","component":"cancelAppointmentModal"}],"workspaces":[{"name":"appointments-form-workspace","component":"appointmentsFormWorkspace","title":"createNewAppointment","type":"form"}],"version":"9.0.1-pre.6393"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-appointments-app",
3
- "version": "9.0.1-pre.6388",
3
+ "version": "9.0.1-pre.6393",
4
4
  "description": "Appointments front-end module for O3",
5
5
  "browser": "dist/openmrs-esm-appointments-app.js",
6
6
  "main": "src/index.ts",
@@ -65,34 +65,19 @@ const AppointmentsTable: React.FC<AppointmentsTableProps> = ({
65
65
  const { t } = useTranslation();
66
66
  const [pageSize, setPageSize] = useState(25);
67
67
  const [searchString, setSearchString] = useState('');
68
+ const config = useConfig<ConfigObject>();
69
+ const { appointmentsTableColumns } = config;
68
70
  const searchResults = useAppointmentSearchResults(appointments, searchString);
69
71
  const { results, goTo, currentPage } = usePagination(searchResults, pageSize);
70
72
  const { customPatientChartUrl, patientIdentifierType } = useConfig<ConfigObject>();
71
73
  const { visits } = useTodaysVisits();
72
74
  const layout = useLayoutType();
73
75
  const responsiveSize = isDesktop(layout) ? 'sm' : 'lg';
74
- const headerData = [
75
- {
76
- header: t('patientName', 'Patient name'),
77
- key: 'patientName',
78
- },
79
- {
80
- header: t('identifier', 'Identifier'),
81
- key: 'identifier',
82
- },
83
- {
84
- header: t('location', 'Location'),
85
- key: 'location',
86
- },
87
- {
88
- header: t('serviceType', 'Service type'),
89
- key: 'serviceType',
90
- },
91
- {
92
- header: t('status', 'Status'),
93
- key: 'status',
94
- },
95
- ];
76
+
77
+ const headerData = appointmentsTableColumns.map((columnKey) => ({
78
+ header: t(columnKey, columnKey),
79
+ key: columnKey,
80
+ }));
96
81
 
97
82
  const rowData = results?.map((appointment) => ({
98
83
  id: appointment.uuid,
@@ -106,12 +91,12 @@ const AppointmentsTable: React.FC<AppointmentsTableProps> = ({
106
91
  ),
107
92
  nextAppointmentDate: '--',
108
93
  identifier: patientIdentifierType
109
- ? appointment.patient[patientIdentifierType.replaceAll(' ', '')] ?? appointment.patient.identifier
94
+ ? (appointment.patient[patientIdentifierType.replaceAll(' ', '')] ?? appointment.patient.identifier)
110
95
  : appointment.patient.identifier,
111
96
  dateTime: formatDatetime(new Date(appointment.startDateTime)),
112
97
  serviceType: appointment.service.name,
113
98
  location: appointment.location?.name,
114
- provider: appointment.provider,
99
+ provider: appointment.providers?.[0]?.name ?? '--',
115
100
  status: <AppointmentActions appointment={appointment} />,
116
101
  }));
117
102
 
@@ -1,5 +1,24 @@
1
1
  import { Type, validators } from '@openmrs/esm-framework';
2
2
 
3
+ export const appointmentColumnTypes = [
4
+ // t('patientName', 'Patient name')
5
+ 'patientName',
6
+ // t('identifier', 'Identifier')
7
+ 'identifier',
8
+ // t('location', 'Location')
9
+ 'location',
10
+ // t('serviceType', 'Service type')
11
+ 'serviceType',
12
+ // t('status', 'Status')
13
+ 'status',
14
+ // t('dateTime', 'Date & time')
15
+ 'dateTime',
16
+ // t('provider', 'Provider')
17
+ 'provider',
18
+ ] as const;
19
+
20
+ type AppointmentColumnType = (typeof appointmentColumnTypes)[number];
21
+
3
22
  export const configSchema = {
4
23
  allowAllDayAppointments: {
5
24
  _type: Type.Boolean,
@@ -77,12 +96,23 @@ export const configSchema = {
77
96
  _description:
78
97
  'Whether to show the Unscheduled Appointments tab. Note that configuring this to true requires a custom unscheduledAppointment endpoint not currently available',
79
98
  },
99
+ appointmentsTableColumns: {
100
+ _type: Type.Array,
101
+ _description:
102
+ 'Columns to display in the appointment table. Available options: ' + appointmentColumnTypes.join(', '),
103
+ _default: ['patientName', 'identifier', 'location', 'serviceType', 'status'],
104
+ _elements: {
105
+ _type: Type.String,
106
+ _validators: [validators.oneOf(appointmentColumnTypes)],
107
+ },
108
+ },
80
109
  };
81
110
 
82
111
  export interface ConfigObject {
83
112
  allowAllDayAppointments: boolean;
84
113
  appointmentStatuses: Array<string>;
85
114
  appointmentTypes: Array<string>;
115
+ appointmentsTableColumns: Array<string>;
86
116
  checkInButton: {
87
117
  enabled: boolean;
88
118
  showIfActiveVisit: boolean;
@@ -97,3 +127,8 @@ export interface ConfigObject {
97
127
  patientIdentifierType: string;
98
128
  showUnscheduledAppointmentsTab: boolean;
99
129
  }
130
+
131
+ export type AppointmentTableColumn = {
132
+ header: string;
133
+ key: string;
134
+ };
@@ -86,8 +86,8 @@
86
86
  "gender": "Gender",
87
87
  "highestServiceVolume": "Highest volume service: {{time}}",
88
88
  "highestServiceVolumeCardTitle": "Highest volume service",
89
- "identifier": "Identifier",
90
89
  "invalidNumber": "Number is not valid",
90
+ "identifier": "Identifier",
91
91
  "isRecurringAppointment": "Is this a recurring appointment?",
92
92
  "itemsPerPage": "Items per page",
93
93
  "loading": "Loading",
@@ -140,8 +140,8 @@
140
140
  "selectProvider": "Select a provider",
141
141
  "selectService": "Select a service",
142
142
  "service": "Service",
143
+ "serviceType":"Service type",
143
144
  "serviceName": "Service name",
144
- "serviceType": "Service Type",
145
145
  "serviceUnavailable": "Appointment time is outside of service hours",
146
146
  "status": "Status",
147
147
  "SUN": "SUN",