diff --git a/__mocks__/appointments.mock.ts b/__mocks__/appointments.mock.ts deleted file mode 100644 index 100c175c56..0000000000 --- a/__mocks__/appointments.mock.ts +++ /dev/null @@ -1,446 +0,0 @@ -export const mockAppointmentsData = { - data: [ - { - uuid: '0d54aa56-0411-47f9-9ce9-23d702965881', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1628598900000, - endDateTime: 1628599020000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: null, - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '0f445395-74a7-4d8b-a6ae-8f5195cc172e', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1628598900000, - endDateTime: 1628599020000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: null, - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: 'c5f4fdab-2d48-4412-adf4-ee26a6b0816f', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1628599800000, - endDateTime: 1628600100000, - appointmentKind: 'Scheduled', - status: 'Scheduled', - comments: null, - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '7cd38a6d-377e-491b-8284-b04cf8b8c6d8', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1630326900000, - endDateTime: 1630327200000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Walk in appointments', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: 'e10ce4e3-0e91-4b97-bc6c-9b5068e58428', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631278200000, - endDateTime: 1631278560000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some additional notes', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '8671c6bf-4305-48e4-8d25-bdf227d5f7af', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631367600000, - endDateTime: 1631368800000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: null, - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: 'cdb0676f-0805-4c3e-bfef-7757a005e892', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631537400000, - endDateTime: 1631537760000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some additional notes', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '66565d8b-4849-4b7c-966a-554d6073f80c', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: null, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631605800000, - endDateTime: 1631606100000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some additional notes', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '45dcc19d-dd14-4a07-95c6-afa264972a34', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: { duration: 15, name: 'Chemotherapy', uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1' }, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631623800000, - endDateTime: 1631624160000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some additional notes', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: 'fa4657ad-db46-487d-8e2e-a3858c906ae6', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: { duration: 15, name: 'Chemotherapy', uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1' }, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631712720000, - endDateTime: 1631713080000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some value', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: '45dcc19d-dd14-4a07-95c6-afa264972a35', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: { duration: 15, name: 'Chemotherapy', uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1' }, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631623800000, - endDateTime: 1631624160000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some additional notes', - additionalInfo: null, - providers: [], - recurring: false, - }, - { - uuid: 'fa4657ad-db46-487d-8e2e-a3858c906ae7', - appointmentNumber: '0000', - patient: { identifier: '100GEJ', name: 'John Wilson', uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e' }, - service: { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startTime: '', - endTime: '', - maxAppointmentsLimit: null, - durationMins: null, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - }, - serviceType: { duration: 15, name: 'Chemotherapy', uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1' }, - provider: null, - location: { name: 'Isolation Ward', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' }, - startDateTime: 1631712720000, - endDateTime: 1631713080000, - appointmentKind: 'WalkIn', - status: 'Scheduled', - comments: 'Some value', - additionalInfo: null, - providers: [], - recurring: false, - }, - ], -}; - -export const mockUseAppointmentServiceData = [ - { - appointmentServiceId: 1, - name: 'Outpatient', - description: null, - speciality: {}, - startDateTime: new Date().toISOString(), - endTime: '', - maxAppointmentsLimit: null, - durationMins: 15, - location: {}, - uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90', - color: '#006400', - initialAppointmentStatus: 'Scheduled', - creatorName: null, - weeklyAvailability: [ - { - dayOfWeek: 'MONDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: '7c7c53c8-c104-40cc-9926-50fc6fe4c4c1', - }, - { - dayOfWeek: 'TUESDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: '7683b94e-6c48-4132-b402-54837a8c0fb2', - }, - { - dayOfWeek: 'SUNDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: '00be8427-0037-4984-8875-6a5a2bc57e8e', - }, - { - dayOfWeek: 'FRIDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: 'af6b8d5b-be05-4e24-8601-30573f848bec', - }, - { - dayOfWeek: 'THURSDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: 'eb35e91b-6909-41fe-9d09-750b83fb3b9c', - }, - { - dayOfWeek: 'SATURDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: '7f6347fd-c514-4fd2-ab79-d7fd760bf82f', - }, - { - dayOfWeek: 'WEDNESDAY', - startTime: '07:00:00', - endTime: '20:00:00', - maxAppointmentsLimit: null, - uuid: 'dad83f54-a0a2-4ba9-819b-01e906c89b69', - }, - ], - serviceTypes: [{ duration: 15, name: 'Chemotherapy', uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1' }], - }, -]; diff --git a/__mocks__/index.ts b/__mocks__/index.ts index be3ecee574..e9c23caa57 100644 --- a/__mocks__/index.ts +++ b/__mocks__/index.ts @@ -1,5 +1,4 @@ export * from './allergies.mock'; -export * from './appointments.mock'; export * from './chart-widgets-config.mock'; export * from './conditions.mock'; export * from './encounters.mock'; diff --git a/packages/esm-patient-appointments-app/README.md b/packages/esm-patient-appointments-app/README.md deleted file mode 100644 index 5bc1f43118..0000000000 --- a/packages/esm-patient-appointments-app/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# esm-patient-appointments-app - -The appointments widget. It provides a tabular overview of the appointments recorded for a patient as well as a form for recording appointments. - diff --git a/packages/esm-patient-appointments-app/jest.config.js b/packages/esm-patient-appointments-app/jest.config.js deleted file mode 100644 index 0352f6214c..0000000000 --- a/packages/esm-patient-appointments-app/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -const rootConfig = require('../../jest.config.js'); - -module.exports = rootConfig; diff --git a/packages/esm-patient-appointments-app/package.json b/packages/esm-patient-appointments-app/package.json deleted file mode 100644 index 8349046cd3..0000000000 --- a/packages/esm-patient-appointments-app/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@openmrs/esm-patient-appointments-app", - "version": "7.1.0", - "license": "MPL-2.0", - "description": "Patient appointments microfrontend for the OpenMRS SPA", - "browser": "dist/openmrs-esm-patient-appointments-app.js", - "main": "src/index.ts", - "source": true, - "scripts": { - "start": "openmrs develop", - "serve": "webpack serve --mode=development", - "debug": "npm run serve", - "build": "webpack --mode production --color", - "analyze": "webpack --mode=production --env analyze=true", - "lint": "cross-env eslint src --ext tsx,ts --fix --max-warnings=0", - "test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests --color", - "test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color", - "coverage": "yarn test --coverage", - "typescript": "tsc", - "extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js" - }, - "browserslist": [ - "extends browserslist-config-openmrs" - ], - "keywords": [ - "openmrs" - ], - "homepage": "https://github.com/openmrs/openmrs-esm-patient-chart#readme", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/openmrs/openmrs-esm-patient-chart.git" - }, - "bugs": { - "url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues" - }, - "dependencies": { - "lodash-es": "^4.17.21" - }, - "peerDependencies": { - "@openmrs/esm-framework": "5.x", - "@openmrs/esm-patient-common-lib": "7.x", - "dayjs": "1.x", - "react": "^18.2.0", - "react-i18next": "11.x", - "react-router-dom": "6.x", - "rxjs": "6.x", - "swr": "2.x" - }, - "devDependencies": { - "@openmrs/esm-patient-common-lib": "workspace:*", - "webpack": "^5.88.2" - } -} diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.component.tsx deleted file mode 100644 index b3b839ae25..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.component.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useCallback } from 'react'; -import { useTranslation } from 'react-i18next'; - -import { Layer, OverflowMenu, OverflowMenuItem } from '@carbon/react'; -import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib'; -import { showModal, useLayoutType } from '@openmrs/esm-framework'; -import type { Appointment } from '../types'; -import styles from './appointments-action-menu.scss'; - -interface appointmentsActionMenuProps { - appointment: Appointment; - patientUuid: string; -} - -export const AppointmentsActionMenu = ({ appointment, patientUuid }: appointmentsActionMenuProps) => { - const { t } = useTranslation(); - const isTablet = useLayoutType() === 'tablet'; - - const launchEditAppointmentForm = useCallback( - () => - launchPatientWorkspace('appointments-form-workspace', { - workspaceTitle: t('editAppointment', 'Edit an appointment'), - appointment, - context: 'editing', - }), - [appointment, t], - ); - - const launchCancelAppointmentDialog = () => { - const dispose = showModal('appointment-cancel-confirmation-dialog', { - closeCancelModal: () => dispose(), - appointmentUuid: appointment.uuid, - patientUuid, - }); - }; - - return ( - - - - - - - ); -}; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.scss b/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.scss deleted file mode 100644 index 2aac4db7c1..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-action-menu.scss +++ /dev/null @@ -1,7 +0,0 @@ -.layer { - height: 100%; -} - -.menuItem { - max-width: none; -} diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-base.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-base.component.tsx deleted file mode 100644 index 5f8d62b138..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-base.component.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import React, { useState } from 'react'; -import { useTranslation } from 'react-i18next'; -import dayjs from 'dayjs'; -import { Button, DataTableSkeleton, ContentSwitcher, InlineLoading, Layer, Switch, Tile } from '@carbon/react'; -import { Add } from '@carbon/react/icons'; -import { useLayoutType } from '@openmrs/esm-framework'; -import { CardHeader, EmptyDataIllustration, ErrorState, launchPatientWorkspace } from '@openmrs/esm-patient-common-lib'; -import { useAppointments } from './appointments.resource'; -import AppointmentsTable from './appointments-table.component'; -import styles from './appointments-base.scss'; - -interface AppointmentsBaseProps { - basePath?: string; - patientUuid: string; -} - -enum AppointmentTypes { - UPCOMING = 0, - TODAY = 1, - PAST = 2, -} - -const AppointmentsBase: React.FC = ({ patientUuid }) => { - const { t } = useTranslation(); - const headerTitle = t('appointments', 'Appointments'); - const isTablet = useLayoutType() === 'tablet'; - - const [switchedView, setSwitchedView] = useState(false); - - const [contentSwitcherValue, setContentSwitcherValue] = useState(0); - const startDate = dayjs(new Date().toISOString()).subtract(6, 'month').toISOString(); - const { - data: appointmentsData, - isError, - isLoading, - isValidating, - } = useAppointments(patientUuid, startDate, new AbortController()); - - const launchAppointmentsForm = () => launchPatientWorkspace('appointments-form-workspace'); - - if (isLoading) return ; - if (isError) { - return ; - } - if (Object.keys(appointmentsData)?.length) { - return ( -
- - {isValidating ? ( - - - - ) : null} -
- { - setContentSwitcherValue(index); - setSwitchedView(true); - }} - > - - - - -
|
- -
-
- {(() => { - if (contentSwitcherValue === AppointmentTypes.UPCOMING) { - if (appointmentsData.upcomingAppointments?.length) { - return ( - - ); - } - return ( - - - -

- {t( - 'noUpcomingAppointmentsForPatient', - 'There are no upcoming appointments to display for this patient', - )} -

-
-
- ); - } - if (contentSwitcherValue === AppointmentTypes.TODAY) { - if (appointmentsData.todaysAppointments?.length) { - return ( - - ); - } - return ( - - - -

- {t( - 'noCurrentAppointments', - 'There are no appointments scheduled for today to display for this patient', - )} -

-
-
- ); - } - - if (contentSwitcherValue === AppointmentTypes.PAST) { - if (appointmentsData.pastAppointments?.length) { - return ( - - ); - } - return ( - - - -

- {t('noPastAppointments', 'There are no past appointments to display for this patient')} -

-
-
- ); - } - })()} -
- ); - } -}; - -export default AppointmentsBase; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-base.scss b/packages/esm-patient-appointments-app/src/appointments/appointments-base.scss deleted file mode 100644 index 307c3a490c..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-base.scss +++ /dev/null @@ -1,83 +0,0 @@ -@use '@carbon/colors'; -@use '@carbon/styles/scss/spacing'; -@use '@carbon/styles/scss/type'; -@import '@openmrs/esm-styleguide/src/vars'; - -// TO DO Move this styles to style - guide -// https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/_vars.scss -$color-blue-30 : #a6c8ff; -$color-blue-10: #edf5ff; - -.widgetCard { - border: 1px solid $ui-03; -} - -.productiveHeading01 { - @include type.type-style("heading-compact-01"); -} - -.contentSwitcherWrapper { - display: flex; - width: fit-content; - justify-content: flex-end; - align-items: center; - width: 60%; -} - -.contentSwitcherWrapper > div > button { - background-color: $ui-02; -} - -.contentSwitcherWrapper > div button:first-child { - border-top: 1px solid $color-blue-30; - border-bottom: 1px solid $color-blue-30; - border-left: 1px solid $color-blue-30; - border-right: none; - border-radius: spacing.$spacing-02 0 0px spacing.$spacing-02; -} - -.contentSwitcherWrapper > div button:last-child { - border-top: 1px solid $color-blue-30; - border-bottom: 1px solid $color-blue-30; - border-right: 1px solid $color-blue-30; - border-left: none; - border-radius: 0px spacing.$spacing-02 spacing.$spacing-02 0px; -} - -.contentSwitcherWrapper > div > button[aria-selected=true], -.contentSwitcherWrapper > div > button[aria-selected=true]:first-child { - background-color: $color-blue-10; - color: $color-blue-60-2; - border-color: $color-blue-60-2; - border-right: 1px solid $color-blue-60-2; -} - -.contentSwitcherWrapper > div > button[aria-selected=true], -.contentSwitcherWrapper > div > button[aria-selected=true]:last-child { - background-color: $color-blue-10; - color: $color-blue-60-2; - border-color: $color-blue-60-2; - border-left: 1px solid $color-blue-60-2; -} - -.contentSwitcherWrapper > div > button[aria-selected=true]:focus { - box-shadow: none; -} - -.divider { - width: 1px; - height: spacing.$spacing-05; - color: colors.$gray-20; - margin: 0 spacing.$spacing-05; -} - -.content { - @include type.type-style("heading-compact-01"); - color: $text-02; - margin-top: spacing.$spacing-05; - margin-bottom: spacing.$spacing-03; -} - -.tile { - text-align: center; -} diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-base.test.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-base.test.tsx deleted file mode 100644 index e8aff24abb..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-base.test.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import React from 'react'; -import { screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { openmrsFetch, usePagination } from '@openmrs/esm-framework'; -import { mockAppointmentsData } from '__mocks__'; -import { mockPatient, patientChartBasePath, renderWithSwr, waitForLoadingToFinish } from 'tools'; -import AppointmentsBase from './appointments-base.component'; - -const testProps = { - basePath: patientChartBasePath, - patientUuid: mockPatient.id, -}; - -const mockOpenmrsFetch = openmrsFetch as jest.Mock; -const mockUsePagination = usePagination as jest.Mock; - -jest.mock('@openmrs/esm-framework', () => { - const originalModule = jest.requireActual('@openmrs/esm-framework'); - - return { - ...originalModule, - usePagination: jest.fn().mockImplementation(() => ({ - currentPage: 1, - goTo: () => {}, - results: [], - })), - }; -}); - -describe('AppointmensOverview', () => { - it('renders an empty state if appointments data is unavailable', async () => { - mockOpenmrsFetch.mockReturnValueOnce({ data: [] }); - - renderAppointments(); - - await waitForLoadingToFinish(); - - expect(screen.getByRole('heading', { name: /appointments/i })).toBeInTheDocument(); - expect(screen.getByRole('button', { name: /add/i })).toBeInTheDocument(); - }); - - it('renders an error state if there was a problem fetching appointments data', async () => { - const user = userEvent.setup(); - - const error = { - message: 'Internal server error', - response: { - status: 500, - statusText: 'Internal server error', - }, - }; - - mockOpenmrsFetch.mockRejectedValueOnce(error); - - renderAppointments(); - - await waitForLoadingToFinish(); - - expect(screen.getByRole('heading', { name: /appointments/i })).toBeInTheDocument(); - expect( - screen.getByText( - 'Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.', - ), - ).toBeInTheDocument(); - }); - - it(`renders a tabular overview of the patient's appointment schedule if available`, async () => { - const user = userEvent.setup(); - - mockOpenmrsFetch.mockReturnValueOnce(mockAppointmentsData); - mockUsePagination.mockImplementation(() => ({ - currentPage: 1, - goTo: () => {}, - results: mockAppointmentsData.data, - })); - - renderAppointments(); - - await waitForLoadingToFinish(); - - expect(screen.getByRole('heading', { name: /appointments/i })).toBeInTheDocument(); - expect(screen.getByRole('button', { name: /add/i })).toBeInTheDocument(); - - const upcomingAppointmentsTab = screen.getByRole('tab', { name: /upcoming/i }); - const pastAppointmentsTab = screen.getByRole('tab', { name: /past/i }); - - expect(screen.getByRole('tablist')).toContainElement(upcomingAppointmentsTab); - expect(screen.getByRole('tablist')).toContainElement(pastAppointmentsTab); - expect(screen.getByTitle(/Empty data illustration/i)).toBeInTheDocument(); - expect(screen.getByText(/There are no upcoming appointments to display for this patient/i)).toBeInTheDocument(); - - await user.click(pastAppointmentsTab); - expect(screen.getByRole('table')).toBeInTheDocument(); - - const expectedColumnHeaders = [/date/, /location/, /service/]; - expectedColumnHeaders.forEach((header) => { - expect(screen.getByRole('columnheader', { name: new RegExp(header, 'i') })).toBeInTheDocument(); - }); - - expect(screen.getAllByRole('row').length).toEqual(13); - - const previousPageButton = screen.getByRole('button', { name: /previous page/i }); - const nextPageButton = screen.getByRole('button', { name: /next page/i }); - - expect(previousPageButton).toBeDisabled(); - expect(nextPageButton).not.toBeDisabled(); - }); -}); - -function renderAppointments() { - renderWithSwr(); -} diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-cancel-modal.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-cancel-modal.component.tsx deleted file mode 100644 index 6e99f04967..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-cancel-modal.component.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { useState } from 'react'; -import { useTranslation } from 'react-i18next'; -import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react'; -import { showSnackbar } from '@openmrs/esm-framework'; -import { cancelAppointment, useAppointments } from './appointments.resource'; - -interface CancelAppointmentModalProps { - closeCancelModal: () => void; - appointmentUuid: string; - patientUuid: string; -} - -const CancelAppointmentModal: React.FC = ({ - closeCancelModal, - appointmentUuid, - patientUuid, -}) => { - const { t } = useTranslation(); - const { mutate } = useAppointments(patientUuid, new Date().toUTCString(), new AbortController()); - const [isSubmitting, setIsSubmitting] = useState(false); - - const handleCancel = async () => { - setIsSubmitting(true); - - cancelAppointment('Cancelled', appointmentUuid) - .then(({ status }) => { - if (status === 200) { - mutate(); - closeCancelModal(); - showSnackbar({ - isLowContrast: true, - kind: 'success', - subtitle: t('appointmentCancelledSuccessfully', 'Appointment cancelled successfully'), - title: t('appointmentCancelled', 'Appointment cancelled'), - }); - } - }) - .catch((err) => { - showSnackbar({ - title: t('appointmentCancelError', 'Error cancelling appointment'), - kind: 'error', - isLowContrast: true, - subtitle: err?.message, - }); - }); - }; - - return ( -
- - -

{t('cancelAppointmentModalConfirmationText', 'Are you sure you want to cancel this appointment?')}

-
- - - - -
- ); -}; - -export default CancelAppointmentModal; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-detailed-summary.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-detailed-summary.component.tsx deleted file mode 100644 index 6734b61f7a..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-detailed-summary.component.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import AppointmentBase from './appointments-base.component'; - -interface AppointmentsDetailedSummaryProps { - patientUuid: string; -} - -const AppointmentsDetailedSummary: React.FC = ({ patientUuid }) => { - return ; -}; - -export default AppointmentsDetailedSummary; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-overview.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-overview.component.tsx deleted file mode 100644 index 30f7ed768e..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-overview.component.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import AppointmentsBase from './appointments-base.component'; - -interface AppointmentOverviewProps { - basePath: string; - patientUuid: string; -} - -const AppointmentsOverview: React.FC = ({ patientUuid }) => ( - -); - -export default AppointmentsOverview; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-table.component.tsx b/packages/esm-patient-appointments-app/src/appointments/appointments-table.component.tsx deleted file mode 100644 index 243de1bb77..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments-table.component.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import React, { useEffect, useMemo } from 'react'; -import classNames from 'classnames'; -import dayjs from 'dayjs'; -const utc = require('dayjs/plugin/utc'); -dayjs.extend(utc); -import { useTranslation } from 'react-i18next'; -import { - DataTable, - type DataTableHeader, - Table, - TableCell, - TableContainer, - TableBody, - TableHead, - TableHeader, - TableRow, -} from '@carbon/react'; -import { PatientChartPagination } from '@openmrs/esm-patient-common-lib'; -import { formatDatetime, parseDate, useLayoutType, usePagination } from '@openmrs/esm-framework'; -import { type Appointment } from '../types'; -import { AppointmentsActionMenu } from './appointments-action-menu.component'; -import styles from './appointments-table.scss'; - -const pageSize = 10; - -interface AppointmentTableProps { - patientAppointments: Array; - switchedView: boolean; - setSwitchedView: (value: boolean) => void; - patientUuid: string; -} - -const AppointmentsTable: React.FC = ({ - patientAppointments, - patientUuid, - switchedView, - setSwitchedView, -}) => { - const { t } = useTranslation(); - const { results: paginatedAppointments, currentPage, goTo } = usePagination(patientAppointments, pageSize); - const isTablet = useLayoutType() === 'tablet'; - - useEffect(() => { - if (switchedView && currentPage !== 1) { - goTo(1); - } - }, [switchedView, goTo, currentPage]); - - const tableHeaders: Array = useMemo( - () => [ - { key: 'date', header: t('date', 'Date') }, - { key: 'location', header: t('location', 'Location') }, - { key: 'service', header: t('service', 'Service') }, - { key: 'status', header: t('status', 'Status') }, - { key: 'type', header: t('type', 'Type') }, - { key: 'notes', header: t('notes', 'Notes') }, - ], - [t], - ); - - const tableRows = useMemo( - () => - paginatedAppointments?.map((appointment) => { - return { - id: appointment.uuid, - date: formatDatetime(parseDate(appointment.startDateTime), { mode: 'wide' }), - location: appointment?.location?.name ? appointment?.location?.name : '——', - service: appointment.service.name, - status: appointment.status, - type: appointment.appointmentKind ? appointment.appointmentKind : '——', - notes: appointment.comments ? appointment.comments : '——', - }; - }), - [paginatedAppointments], - ); - - return ( -
- - {({ rows, headers, getHeaderProps, getTableProps }) => ( - - - - - {headers.map((header) => ( - - {header.header?.content ?? header.header} - - ))} - - - - - {rows.map((row, i) => ( - - {row.cells.map((cell) => ( - {cell.value?.content ?? cell.value} - ))} - - - - - ))} - -
-
- )} -
- { - setSwitchedView(false); - goTo(page); - }} - pageNumber={currentPage} - pageSize={pageSize} - /> -
- ); -}; - -export default AppointmentsTable; diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments-table.scss b/packages/esm-patient-appointments-app/src/appointments/appointments-table.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/esm-patient-appointments-app/src/appointments/appointments.resource.ts b/packages/esm-patient-appointments-app/src/appointments/appointments.resource.ts deleted file mode 100644 index 79f45c0386..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/appointments.resource.ts +++ /dev/null @@ -1,71 +0,0 @@ -import dayjs from 'dayjs'; -import useSWR from 'swr'; -import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework'; -import { type AppointmentsFetchResponse } from '../types'; -import isToday from 'dayjs/plugin/isToday'; -dayjs.extend(isToday); - -const appointmentsSearchUrl = `${restBaseUrl}/appointments/search`; - -export function useAppointments(patientUuid: string, startDate: string, abortController: AbortController) { - /* - SWR isn't meant to make POST requests for data fetching. This is a consequence of the API only exposing this resource via POST. - This works but likely isn't recommended. - */ - const fetcher = () => - openmrsFetch(appointmentsSearchUrl, { - method: 'POST', - signal: abortController.signal, - headers: { - 'Content-Type': 'application/json', - }, - body: { - patientUuid: patientUuid, - startDate: startDate, - }, - }); - - const { data, error, isLoading, isValidating, mutate } = useSWR( - appointmentsSearchUrl, - fetcher, - ); - - const appointments = data?.data?.length ? data.data : null; - - const pastAppointments = appointments - ?.sort((a, b) => (b.startDateTime > a.startDateTime ? 1 : -1)) - ?.filter(({ status }) => status !== 'Cancelled') - ?.filter(({ startDateTime }) => - dayjs(new Date(startDateTime).toISOString()).isBefore(new Date().setHours(0, 0, 0, 0)), - ); - - const upcomingAppointments = appointments - ?.sort((a, b) => (a.startDateTime > b.startDateTime ? 1 : -1)) - ?.filter(({ status }) => status !== 'Cancelled') - ?.filter(({ startDateTime }) => dayjs(new Date(startDateTime).toISOString()).isAfter(new Date())); - - const todaysAppointments = appointments - ?.sort((a, b) => (a.startDateTime > b.startDateTime ? 1 : -1)) - ?.filter(({ status }) => status !== 'Cancelled') - ?.filter(({ startDateTime }) => dayjs(new Date(startDateTime).toISOString()).isToday()); - - return { - data: data ? { pastAppointments, upcomingAppointments, todaysAppointments } : null, - isError: error, - isLoading, - isValidating, - mutate, - }; -} - -export const cancelAppointment = async (toStatus: string, appointmentUuid: string) => { - const omrsDateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZZ'; - const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; - const statusChangeTime = dayjs(new Date()).format(omrsDateFormat); - const url = `${restBaseUrl}/appointments/${appointmentUuid}/status-change`; - return await openmrsFetch(url, { - body: { toStatus, onDate: statusChangeTime, timeZone: timeZone }, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - }); -}; diff --git a/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.component.tsx b/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.component.tsx deleted file mode 100644 index 7b78ee6c84..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.component.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import React, { useEffect, useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import isEmpty from 'lodash-es/isEmpty'; - -import { - Checkbox, - InlineLoading, - InlineNotification, - StructuredListHead, - StructuredListCell, - StructuredListRow, - StructuredListBody, - StructuredListWrapper, -} from '@carbon/react'; -import { formatDate, parseDate } from '@openmrs/esm-framework'; -import { useAppointments } from './appointments.resource'; -import { ErrorState } from '@openmrs/esm-patient-common-lib'; - -import styles from './upcoming-appointments-card.scss'; -import dayjs from 'dayjs'; -interface UpcomingAppointmentsProps { - patientUuid: string; - setUpcomingAppointment: (value: any) => void; -} - -const UpcomingAppointmentsCard: React.FC = ({ patientUuid, setUpcomingAppointment }) => { - const { t } = useTranslation(); - const startDate = dayjs(new Date().toISOString()).subtract(6, 'month').toISOString(); - const headerTitle = t('upcomingAppointments', 'Upcoming appointments'); - - const ac = useMemo(() => new AbortController(), []); - useEffect(() => () => ac.abort(), [ac]); - const { data: appointmentsData, isError, isLoading } = useAppointments(patientUuid, startDate, ac); - - const todaysAppointments = appointmentsData?.todaysAppointments?.length ? appointmentsData?.todaysAppointments : []; - const futureAppointments = appointmentsData?.upcomingAppointments?.length - ? appointmentsData?.upcomingAppointments - : []; - const appointments = todaysAppointments.concat(futureAppointments); - const upcomingAppointment = !isEmpty(appointments) - ? appointments?.filter(({ dateHonored }) => dateHonored === null) - : []; - if (isError) { - return ; - } - if (isLoading) { - - - ; - } - - if (upcomingAppointment?.length) { - const structuredListBodyRowGenerator = () => { - return upcomingAppointment.map((appointment, i) => ( - - {formatDate(parseDate(appointment.startDateTime), { mode: 'wide' })} - {appointment.service ? appointment.service.name : '——'} - - (e.target.checked ? setUpcomingAppointment(appointment) : '')} - /> - - - )); - }; - - return ( -
-
-

{headerTitle}

- - {t('appointmentToFulfill', 'Select appointment(s) to fulfill')} - {' '} -
- - - - - {t('date', 'Date')} - {t('appointmentType', 'Appointment type')} - {t('action', 'Action')} - - - {structuredListBodyRowGenerator()} - -
- ); - } - return ( - - ); -}; - -export default UpcomingAppointmentsCard; diff --git a/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.scss b/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.scss deleted file mode 100644 index b9b3c7bcb8..0000000000 --- a/packages/esm-patient-appointments-app/src/appointments/upcoming-appointments-card.scss +++ /dev/null @@ -1,47 +0,0 @@ -@use '@carbon/styles/scss/spacing'; -@use '@carbon/styles/scss/type'; -@import '@openmrs/esm-styleguide/src/vars'; - -.container { - margin: spacing.$spacing-05; - - & section { - margin: spacing.$spacing-05 0; - } -} - -.sectionTitle { - @include type.type-style("heading-compact-02"); - color: $text-02; - margin: 0 0 spacing.$spacing-03 0; -} -.checkbox { - &:not(:first-child) { - margin: 0rem 0rem; - } - } - - .input { - margin: 0rem 1rem 1rem; - } - - .headerLabel { - @include type.type-style('label-01'); - color: $text-02; - } - - .checkboxContainer { - display: grid; - grid-template-columns: 1fr 1fr; - } - - .structuredList { - padding: 0.5rem 0.5rem 0.5rem; - - } - - .inlineNotification { - width: 100%; - max-width: unset; - padding: '0rem'; - } diff --git a/packages/esm-patient-appointments-app/src/constants.ts b/packages/esm-patient-appointments-app/src/constants.ts deleted file mode 100644 index e4243ac16a..0000000000 --- a/packages/esm-patient-appointments-app/src/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const dateFormat = 'DD/MM/YYYY'; diff --git a/packages/esm-patient-appointments-app/src/dashboard.meta.ts b/packages/esm-patient-appointments-app/src/dashboard.meta.ts deleted file mode 100644 index fcd7822f17..0000000000 --- a/packages/esm-patient-appointments-app/src/dashboard.meta.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const dashboardMeta = { - slot: 'patient-chart-appointments-dashboard-slot', - columns: 1, - title: 'Appointments', - path: 'Appointments', -}; diff --git a/packages/esm-patient-appointments-app/src/declarations.d.ts b/packages/esm-patient-appointments-app/src/declarations.d.ts deleted file mode 100644 index b2f3aa3b21..0000000000 --- a/packages/esm-patient-appointments-app/src/declarations.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module '*.css'; -declare module '*.scss'; -declare module '*.png'; diff --git a/packages/esm-patient-appointments-app/src/index.ts b/packages/esm-patient-appointments-app/src/index.ts deleted file mode 100644 index aa147fcbab..0000000000 --- a/packages/esm-patient-appointments-app/src/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle, translateFrom } from '@openmrs/esm-framework'; -import { createDashboardLink, registerWorkspace } from '@openmrs/esm-patient-common-lib'; -import { dashboardMeta } from './dashboard.meta'; -import appointmentsOverviewComponent from './appointments/appointments-overview.component'; -import appointmentsDetailedSummaryComponent from './appointments/appointments-detailed-summary.component'; -import upcomingAppointmentsWidgetComponent from './appointments/upcoming-appointments-card.component'; - -export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); - -const moduleName = '@openmrs/esm-patient-appointments-app'; - -const options = { - featureName: 'patient-appointments', - moduleName, -}; - -export function startupApp() { - defineConfigSchema(moduleName, {}); -} - -export const appointmentsOverview = getSyncLifecycle(appointmentsOverviewComponent, options); - -export const appointmentsDetailedSummary = getSyncLifecycle(appointmentsDetailedSummaryComponent, options); - -// t('Appointments', 'Appointments') -export const appointmentsSummaryDashboardLink = getSyncLifecycle( - createDashboardLink({ ...dashboardMeta, moduleName }), - options, -); - -export const appointmentsCancelConfirmationDialog = getAsyncLifecycle( - () => import('./appointments/appointments-cancel-modal.component'), - options, -); - -export const upcomingAppointmentsWidget = getSyncLifecycle(upcomingAppointmentsWidgetComponent, options); diff --git a/packages/esm-patient-appointments-app/src/routes.json b/packages/esm-patient-appointments-app/src/routes.json deleted file mode 100644 index 02f9cce474..0000000000 --- a/packages/esm-patient-appointments-app/src/routes.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://json.openmrs.org/routes.schema.json", - "backendDependencies": { - "webservices.rest": "^2.2.0" - }, - "extensions": [ - { - "name": "appointments-overview-widget", - "component": "appointmentsOverview", - "order": 8, - "meta": { - "columnSpan": 4 - } - }, - { - "name": "appointments-details-widget", - "component": "appointmentsDetailedSummary", - "slot": "patient-chart-appointments-dashboard-slot", - "meta": { - "columnSpan": 1 - } - }, - { - "name": "appointments-summary-dashboard", - "component": "appointmentsSummaryDashboardLink", - "slot": "patient-chart-dashboard-slot", - "order": 11, - "meta": { - "columns": 1, - "columnSpan": 1, - "slot": "patient-chart-appointments-dashboard-slot", - "title": "Appointments", - "path": "Appointments" - } - }, - { - "name": "appointment-cancel-confirmation-dialog", - "component": "appointmentsCancelConfirmationDialog" - }, - { - "name": "upcoming-appointment-widget", - "component": "upcomingAppointmentsWidget", - "slot": "upcoming-appointment-slot" - } - ], - "pages": [] -} diff --git a/packages/esm-patient-appointments-app/src/types/index.ts b/packages/esm-patient-appointments-app/src/types/index.ts deleted file mode 100644 index 13ad9918ee..0000000000 --- a/packages/esm-patient-appointments-app/src/types/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { OpenmrsResource } from '@openmrs/esm-framework'; - -export interface AppointmentsFetchResponse { - data: Array; -} - -export interface Appointment { - appointmentKind: string; - appointmentNumber: string; - comments: string; - endDateTime: Date | number; - location: OpenmrsResource; - patient: fhir.Patient; - provider: OpenmrsResource; - providers: Array; - recurring: boolean; - service: AppointmentService; - startDateTime: string; - status: string; - dateHonored: Date | number; - uuid: string; -} - -export interface ServiceTypes { - duration: number; - name: string; - uuid: string; -} - -export interface AppointmentService { - appointmentServiceId: number; - color: string; - creatorName: string; - description: string; - durationMins: number; - endTime: string; - initialAppointmentStatus: string; - location: OpenmrsResource; - maxAppointmentsLimit: number | null; - name: string; - speciality: OpenmrsResource; - startTime: string; - uuid: string; - serviceTypes: Array; -} diff --git a/packages/esm-patient-appointments-app/translations/am.json b/packages/esm-patient-appointments-app/translations/am.json deleted file mode 100644 index b2488a10c6..0000000000 --- a/packages/esm-patient-appointments-app/translations/am.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "Action", - "add": "Add", - "appointmentCancelError": "Error cancelling appointment", - "appointmentCancelled": "Appointment cancelled", - "appointmentCancelledSuccessfully": "Appointment cancelled successfully", - "appointments": "Appointments", - "Appointments": "Appointments", - "appointmentToFulfill": "Select appointment(s) to fulfill", - "appointmentType": "Appointment type", - "appointmentType_title": "Appointment Type", - "cancel": "Cancel", - "cancelAppointment": "Cancel appointment", - "cancelAppointmentModalConfirmationText": "Are you sure you want to cancel this appointment?", - "date": "Date", - "discard": "Discard", - "edit": "Edit", - "editAppointment": "Edit an appointment", - "location": "Location", - "noCurrentAppointments": "There are no appointments scheduled for today to display for this patient", - "noPastAppointments": "There are no past appointments to display for this patient", - "notes": "Notes", - "noUpcomingAppointments": "No upcoming appointments found", - "noUpcomingAppointmentsForPatient": "There are no upcoming appointments to display for this patient", - "past": "Past", - "service": "Service", - "status": "Status", - "today": "Today", - "type": "Type", - "upcoming": "Upcoming", - "upcomingAppointments": "Upcoming appointments" -} diff --git a/packages/esm-patient-appointments-app/translations/ar.json b/packages/esm-patient-appointments-app/translations/ar.json deleted file mode 100644 index f4cded43a2..0000000000 --- a/packages/esm-patient-appointments-app/translations/ar.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "الإجراء", - "add": "أضف", - "appointmentCancelError": "خطأ في إلغاء الموعد", - "appointmentCancelled": "تم إلغاء الموعد", - "appointmentCancelledSuccessfully": "تم إلغاء الموعد بنجاح", - "appointments": "المواعيد", - "Appointments": "المواعيد", - "appointmentToFulfill": "حدد الموعد/المواعيد لتنفيذه", - "appointmentType": "نوع الموعد", - "appointmentType_title": "نوع الموعد", - "cancel": "إلغاء", - "cancelAppointment": "إلغاء الموعد", - "cancelAppointmentModalConfirmationText": "هل أنت متأكد أنك تريد إلغاء هذا الموعد؟", - "date": "التاريخ", - "discard": "تجاهل", - "edit": "تعديل", - "editAppointment": "تعديل الموعد", - "location": "الموقع", - "noCurrentAppointments": "لا توجد مواعيد مجدولة لهذا المريض اليوم", - "noPastAppointments": "لا توجد مواعيد سابقة لعرضها لهذا المريض", - "notes": "الملاحظات", - "noUpcomingAppointments": "لم يتم العثور على مواعيد قادمة", - "noUpcomingAppointmentsForPatient": "لا توجد مواعيد قادمة لعرضها لهذا المريض", - "past": "الماضي", - "service": "الخدمة", - "status": "الحالة", - "today": "اليوم", - "type": "النوع", - "upcoming": "القادمة", - "upcomingAppointments": "المواعيد القادمة" -} diff --git a/packages/esm-patient-appointments-app/translations/en.json b/packages/esm-patient-appointments-app/translations/en.json deleted file mode 100644 index b2488a10c6..0000000000 --- a/packages/esm-patient-appointments-app/translations/en.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "Action", - "add": "Add", - "appointmentCancelError": "Error cancelling appointment", - "appointmentCancelled": "Appointment cancelled", - "appointmentCancelledSuccessfully": "Appointment cancelled successfully", - "appointments": "Appointments", - "Appointments": "Appointments", - "appointmentToFulfill": "Select appointment(s) to fulfill", - "appointmentType": "Appointment type", - "appointmentType_title": "Appointment Type", - "cancel": "Cancel", - "cancelAppointment": "Cancel appointment", - "cancelAppointmentModalConfirmationText": "Are you sure you want to cancel this appointment?", - "date": "Date", - "discard": "Discard", - "edit": "Edit", - "editAppointment": "Edit an appointment", - "location": "Location", - "noCurrentAppointments": "There are no appointments scheduled for today to display for this patient", - "noPastAppointments": "There are no past appointments to display for this patient", - "notes": "Notes", - "noUpcomingAppointments": "No upcoming appointments found", - "noUpcomingAppointmentsForPatient": "There are no upcoming appointments to display for this patient", - "past": "Past", - "service": "Service", - "status": "Status", - "today": "Today", - "type": "Type", - "upcoming": "Upcoming", - "upcomingAppointments": "Upcoming appointments" -} diff --git a/packages/esm-patient-appointments-app/translations/es.json b/packages/esm-patient-appointments-app/translations/es.json deleted file mode 100644 index a4e8573f26..0000000000 --- a/packages/esm-patient-appointments-app/translations/es.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "Acción", - "add": "Añadir", - "appointmentCancelError": "Error al cancelar la cita", - "appointmentCancelled": "Cita cancelada", - "appointmentCancelledSuccessfully": "Cita cancelada con éxito", - "appointments": "Citas", - "Appointments": "Citas", - "appointmentToFulfill": "Seleccionar cita(s) para cumplir", - "appointmentType": "Tipo de cita", - "appointmentType_title": "Tipo de cita", - "cancel": "Cancelar", - "cancelAppointment": "Cancelar cita", - "cancelAppointmentModalConfirmationText": "¿Está seguro de que desea cancelar esta cita?", - "date": "Fecha", - "discard": "Descartar", - "edit": "Editar", - "editAppointment": "Editar una cita", - "location": "Ubicación", - "noCurrentAppointments": "No hay citas programadas que mostrar para hoy para este paciente", - "noPastAppointments": "No hay citas anteriores para mostrar para este paciente", - "notes": "Apuntes", - "noUpcomingAppointments": "No hay próximas citas para mostrar para este paciente", - "noUpcomingAppointmentsForPatient": "No hay próximas citas para mostrar para este paciente", - "past": "Anterior", - "service": "Servicio", - "status": "Estado", - "today": "Hoy", - "type": "Tipo", - "upcoming": "Próximo/a", - "upcomingAppointments": "Próximas citas" -} diff --git a/packages/esm-patient-appointments-app/translations/fr.json b/packages/esm-patient-appointments-app/translations/fr.json deleted file mode 100644 index 2d2ceda958..0000000000 --- a/packages/esm-patient-appointments-app/translations/fr.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "Action", - "add": "Ajouter", - "appointmentCancelError": "Error cancelling appointment", - "appointmentCancelled": "Appointment cancelled", - "appointmentCancelledSuccessfully": "Appointment cancelled successfully", - "appointments": "Rendez-vous", - "Appointments": "Appointments", - "appointmentToFulfill": "Select appointment(s) to fulfill", - "appointmentType": "Type de rendez-vous", - "appointmentType_title": "Appointment Type", - "cancel": "Cancel", - "cancelAppointment": "Cancel appointment", - "cancelAppointmentModalConfirmationText": "Are you sure you want to cancel this appointment?", - "date": "Date", - "discard": "Abandonner", - "edit": "Edit", - "editAppointment": "Edit an appointment", - "location": "Emplacement", - "noCurrentAppointments": "Il n'y a pas de rendez-vous prévu aujourd'hui à afficher pour ce patient", - "noPastAppointments": "Il n'y a pas de rendez-vous passé à afficher pour ce patient", - "notes": "Notes", - "noUpcomingAppointments": "Il n'y a pas de rendez-vous à venir à afficher pour ce patient", - "noUpcomingAppointmentsForPatient": "There are no upcoming appointments to display for this patient", - "past": "Passé", - "service": "Service", - "status": "Statut", - "today": "Aujourd'hui", - "type": "Type", - "upcoming": "A venir", - "upcomingAppointments": "Upcoming appointments" -} diff --git a/packages/esm-patient-appointments-app/translations/he.json b/packages/esm-patient-appointments-app/translations/he.json deleted file mode 100644 index 12c1011f5c..0000000000 --- a/packages/esm-patient-appointments-app/translations/he.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "פעולה", - "add": "הוסף", - "appointmentCancelError": "שגיאה בביטול תור", - "appointmentCancelled": "התור בוטל", - "appointmentCancelledSuccessfully": "התור בוטל בהצלחה", - "appointments": "תורים", - "Appointments": "תורים", - "appointmentToFulfill": "בחר תור(ים) למילוי", - "appointmentType": "סוג התור", - "appointmentType_title": "סוג התור", - "cancel": "ביטול", - "cancelAppointment": "ביטול תור", - "cancelAppointmentModalConfirmationText": "?האם אתה בטוח שברצונך לבטל תור זה", - "date": "תאריך", - "discard": "בטל", - "edit": "ערוך", - "editAppointment": "ערוך תור", - "location": "מיקום", - "noCurrentAppointments": "אין תורים מתוזמנים להצגה עבור מטופל זה ליום הזה", - "noPastAppointments": "אין תורים עבריים להצגה עבור מטופל זה", - "notes": "הערות", - "noUpcomingAppointments": "אין תורים עתידיים להצגה עבור מטופל זה", - "noUpcomingAppointmentsForPatient": "אין תורים עתידיים להצגה עבור מטופל זה", - "past": "עבר", - "service": "שירות", - "status": "סטטוס", - "today": "היום", - "type": "סוג", - "upcoming": "עתידי", - "upcomingAppointments": "תורים עתידיים" -} diff --git a/packages/esm-patient-appointments-app/translations/km.json b/packages/esm-patient-appointments-app/translations/km.json deleted file mode 100644 index e7cf0ec160..0000000000 --- a/packages/esm-patient-appointments-app/translations/km.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "សកម្មភាព", - "add": "បន្ថែម", - "appointmentCancelError": "មានបញ្ហាបច្ចេកទេសក្នុងការលុបចោលការណាត់ជួប", - "appointmentCancelled": "ការណាត់ជួបត្រូវបានលុបចោល", - "appointmentCancelledSuccessfully": "ការណាត់ជួបបានលុបចោលដោយជោគជ័យ", - "appointments": "ការណាត់ជួប", - "Appointments": "ការណាត់ជួប", - "appointmentToFulfill": "ជ្រើសរើសការណាត់ជួបដើម្បីបំពេញ", - "appointmentType": "ប្រភេទនៃការណាត់ជួប", - "appointmentType_title": "ប្រភេទនៃការណាត់ជួប", - "cancel": "បោះបង់", - "cancelAppointment": "លុបចោលការណាត់ជួប", - "cancelAppointmentModalConfirmationText": "តើអ្នកពិតជាចង់លុបចោលការណាត់ជួបនេះមែនទេ?", - "date": "កាលបរិច្ឆេទ", - "discard": "បោះបង់", - "edit": "កែសម្រួល", - "editAppointment": "កែសម្រួលការណាត់ជួប", - "location": "ទីតាំង", - "noCurrentAppointments": "មិនមានការណាត់ជួបសម្រាប់ថ្ងៃនេះ ដើម្បីបង្ហាញអ្នកជំងឺនេះទេ", - "noPastAppointments": "មិនមានការណាត់ជួបពីមុនដើម្បីបង្ហាញសម្រាប់អ្នកជំងឺនេះទេ", - "notes": "កំណត់ចំណាំ", - "noUpcomingAppointments": "មិនមានការណាត់ជួបនាពេលខាងមុខដើម្បីបង្ហាញសម្រាប់អ្នកជំងឺនេះទេ", - "noUpcomingAppointmentsForPatient": "មិនមានការណាត់ជួបនាពេលខាងមុខដើម្បីបង្ហាញសម្រាប់អ្នកជំងឺនេះទេ", - "past": "អតីតកាល", - "service": "សេវាកម្ម", - "status": "ស្ថានភាព", - "today": "ថ្ងៃនេះ", - "type": "ប្រភេទ", - "upcoming": "នាពេលខាងមុខ", - "upcomingAppointments": "ការណាត់ជួបនាពេលខាងមុខ" -} diff --git a/packages/esm-patient-appointments-app/translations/zh.json b/packages/esm-patient-appointments-app/translations/zh.json deleted file mode 100644 index 1050a3f05e..0000000000 --- a/packages/esm-patient-appointments-app/translations/zh.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "操作", - "add": "添加", - "appointmentCancelError": "取消预约时出现错误", - "appointmentCancelled": "预约已取消", - "appointmentCancelledSuccessfully": "预约已成功取消", - "appointments": "预约", - "Appointments": "预约", - "appointmentToFulfill": "选择要履行的预约", - "appointmentType": "预约类型", - "appointmentType_title": "预约类型", - "cancel": "取消", - "cancelAppointment": "取消预约", - "cancelAppointmentModalConfirmationText": "您确定要取消这个预约吗?", - "date": "日期", - "discard": "放弃", - "edit": "编辑", - "editAppointment": "编辑一个预约", - "location": "地点", - "noCurrentAppointments": "该患者没有安排在今日的预约", - "noPastAppointments": "该患者没有历史预约", - "notes": "备注", - "noUpcomingAppointments": "未找到即将到来的预约", - "noUpcomingAppointmentsForPatient": "该患者没有即将到来的预约", - "past": "过往", - "service": "服务", - "status": "状态", - "today": "今日", - "type": "类型", - "upcoming": "即将到来", - "upcomingAppointments": "即将到来的预约" -} diff --git a/packages/esm-patient-appointments-app/translations/zh_CN.json b/packages/esm-patient-appointments-app/translations/zh_CN.json deleted file mode 100644 index 1050a3f05e..0000000000 --- a/packages/esm-patient-appointments-app/translations/zh_CN.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "action": "操作", - "add": "添加", - "appointmentCancelError": "取消预约时出现错误", - "appointmentCancelled": "预约已取消", - "appointmentCancelledSuccessfully": "预约已成功取消", - "appointments": "预约", - "Appointments": "预约", - "appointmentToFulfill": "选择要履行的预约", - "appointmentType": "预约类型", - "appointmentType_title": "预约类型", - "cancel": "取消", - "cancelAppointment": "取消预约", - "cancelAppointmentModalConfirmationText": "您确定要取消这个预约吗?", - "date": "日期", - "discard": "放弃", - "edit": "编辑", - "editAppointment": "编辑一个预约", - "location": "地点", - "noCurrentAppointments": "该患者没有安排在今日的预约", - "noPastAppointments": "该患者没有历史预约", - "notes": "备注", - "noUpcomingAppointments": "未找到即将到来的预约", - "noUpcomingAppointmentsForPatient": "该患者没有即将到来的预约", - "past": "过往", - "service": "服务", - "status": "状态", - "today": "今日", - "type": "类型", - "upcoming": "即将到来", - "upcomingAppointments": "即将到来的预约" -} diff --git a/packages/esm-patient-appointments-app/tsconfig.json b/packages/esm-patient-appointments-app/tsconfig.json deleted file mode 100644 index 29fd6726f2..0000000000 --- a/packages/esm-patient-appointments-app/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": ["src/**/*", "../../tools/setup-tests.ts"], -} diff --git a/packages/esm-patient-appointments-app/webpack.config.js b/packages/esm-patient-appointments-app/webpack.config.js deleted file mode 100644 index 2c74029c85..0000000000 --- a/packages/esm-patient-appointments-app/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('openmrs/default-webpack-config'); diff --git a/yarn.lock b/yarn.lock index 98dd65e992..297bb3c52b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4396,25 +4396,6 @@ __metadata: languageName: unknown linkType: soft -"@openmrs/esm-patient-appointments-app@workspace:packages/esm-patient-appointments-app": - version: 0.0.0-use.local - resolution: "@openmrs/esm-patient-appointments-app@workspace:packages/esm-patient-appointments-app" - dependencies: - "@openmrs/esm-patient-common-lib": "workspace:*" - lodash-es: "npm:^4.17.21" - webpack: "npm:^5.88.2" - peerDependencies: - "@openmrs/esm-framework": 5.x - "@openmrs/esm-patient-common-lib": 7.x - dayjs: 1.x - react: ^18.2.0 - react-i18next: 11.x - react-router-dom: 6.x - rxjs: 6.x - swr: 2.x - languageName: unknown - linkType: soft - "@openmrs/esm-patient-attachments-app@workspace:packages/esm-patient-attachments-app": version: 0.0.0-use.local resolution: "@openmrs/esm-patient-attachments-app@workspace:packages/esm-patient-attachments-app"