@kenyaemr/esm-appointments-app 8.1.2-pre.186 → 8.1.2-pre.192
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.
- package/.turbo/turbo-build.log +1 -1
- package/dist/574.js +1 -1
- package/dist/711.js +1 -1
- package/dist/711.js.map +1 -1
- package/dist/kenyaemr-esm-appointments-app.js.buildmanifest.json +9 -9
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/appointments/details/appointment-details.component.tsx +1 -1
- package/src/appointments/details/appointment-details.test.tsx +1 -1
- package/src/appointments/unscheduled/unscheduled-appointments.component.tsx +1 -1
- package/src/helpers/excel.ts +12 -5
- package/translations/en.json +2 -1
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"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"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":"appointments-form-workspace","component":"appointmentsFormWorkspace","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-appointments-dashboard-slot","title":"Appointments","path":"Appointments"}},{"name":"patientAppointments-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":"edit-appointments-form","component":"appointmentsForm","meta":{"title":{"key":"editAppointment","default":"Edit Appointment"}}},{"name":"search-patient","component":"searchPatient"},{"name":"create-appointment","component":"appointmentsForm","meta":{"title":{"key":"appointmentForm","default":"Appointment Form"}}},{"name":"add-appointment","component":"appointmentsForm","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"patient-appointment-cancel-confirmation-dialog","component":"patientAppointmentsCancelConfirmationDialog"}],"version":"8.1.2-pre.
|
|
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"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"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":"appointments-form-workspace","component":"appointmentsFormWorkspace","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-appointments-dashboard-slot","title":"Appointments","path":"Appointments"}},{"name":"patientAppointments-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":"edit-appointments-form","component":"appointmentsForm","meta":{"title":{"key":"editAppointment","default":"Edit Appointment"}}},{"name":"search-patient","component":"searchPatient"},{"name":"create-appointment","component":"appointmentsForm","meta":{"title":{"key":"appointmentForm","default":"Appointment Form"}}},{"name":"add-appointment","component":"appointmentsForm","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"patient-appointment-cancel-confirmation-dialog","component":"patientAppointmentsCancelConfirmationDialog"}],"version":"8.1.2-pre.192"}
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ const AppointmentDetails: React.FC<AppointmentDetailsProps> = ({ appointment })
|
|
|
38
38
|
<p className={styles.label}>{appointment.patient.age}</p>
|
|
39
39
|
</div>
|
|
40
40
|
<div className={styles.labelContainer}>
|
|
41
|
-
<p className={styles.labelBold}>{t('
|
|
41
|
+
<p className={styles.labelBold}>{t('sex', 'Sex')}: </p>
|
|
42
42
|
<p className={styles.label}>{getGender(appointment.patient.gender, t)}</p>
|
|
43
43
|
</div>
|
|
44
44
|
{patient && patient?.birthDate ? (
|
|
@@ -83,7 +83,7 @@ test('renders appointment details correctly', async () => {
|
|
|
83
83
|
expect(screen.getByText(/John Wilson/i)).toBeInTheDocument();
|
|
84
84
|
expect(screen.getByText(/Age/i)).toBeInTheDocument();
|
|
85
85
|
expect(screen.getByText(/34/i)).toBeInTheDocument();
|
|
86
|
-
expect(screen.getByText(/
|
|
86
|
+
expect(screen.getByText(/Sex/i)).toBeInTheDocument();
|
|
87
87
|
expect(screen.getByText(/Male/i)).toBeInTheDocument();
|
|
88
88
|
expect(screen.getByText(/Date of birth/i)).toBeInTheDocument();
|
|
89
89
|
expect(screen.getByText(/Date of birth/i)).toBeInTheDocument();
|
package/src/helpers/excel.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as XLSX from 'xlsx';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
fetchCurrentPatient,
|
|
4
|
+
formatDate,
|
|
5
|
+
getConfig,
|
|
6
|
+
openmrsFetch,
|
|
7
|
+
type Patient,
|
|
8
|
+
restBaseUrl,
|
|
9
|
+
} from '@openmrs/esm-framework';
|
|
3
10
|
import { type Appointment } from '../types';
|
|
4
11
|
import { type ConfigObject } from '../config-schema';
|
|
5
12
|
import { moduleName } from '../constants';
|
|
@@ -25,7 +32,7 @@ export async function exportAppointmentsToSpreadsheet(appointments: Array<Appoin
|
|
|
25
32
|
|
|
26
33
|
return {
|
|
27
34
|
'Patient name': appointment.patient.name,
|
|
28
|
-
|
|
35
|
+
Sex: appointment.patient.gender === 'F' ? 'Female' : 'Male',
|
|
29
36
|
Age: appointment.patient.age,
|
|
30
37
|
Identifier: extractIdentifier(patientInfo) ?? appointment.patient.identifier ?? '--',
|
|
31
38
|
'Appointment type': appointment.service?.name,
|
|
@@ -51,7 +58,7 @@ export function exportUnscheduledAppointmentsToSpreadsheet(
|
|
|
51
58
|
) {
|
|
52
59
|
const appointmentsJSON = unscheduledAppointments?.map((appointment) => ({
|
|
53
60
|
'Patient name': appointment.name,
|
|
54
|
-
|
|
61
|
+
Sex: appointment.gender === 'F' ? 'Female' : 'Male',
|
|
55
62
|
Age: appointment.age,
|
|
56
63
|
'Phone Number': appointment.phoneNumber ?? '--',
|
|
57
64
|
Identifier: extractIdentifier(appointment) ?? appointment.identifier,
|
|
@@ -95,8 +102,8 @@ export const getPhoneNumber = async (patientUuid: string) => {
|
|
|
95
102
|
export const extractIdentifier = (patientInfo: fhir.Patient) => {
|
|
96
103
|
const patientClinicNumberIdentifierTypeUuid = 'b4d66522-11fc-45c7-83e3-39a1af21ae0d';
|
|
97
104
|
const identifiers = patientInfo?.identifier;
|
|
98
|
-
const clinicNumberIdentifier = identifiers?.find(
|
|
99
|
-
identifier?.type?.coding.find((coding) => coding?.code === patientClinicNumberIdentifierTypeUuid),
|
|
105
|
+
const clinicNumberIdentifier = identifiers?.find(
|
|
106
|
+
(identifier) => identifier?.type?.coding.find((coding) => coding?.code === patientClinicNumberIdentifierTypeUuid),
|
|
100
107
|
);
|
|
101
108
|
return clinicNumberIdentifier?.value ?? '';
|
|
102
109
|
};
|