Skip to content

Commit

Permalink
Merge branch 'main' into feature/vitals-biometrics-crud-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored May 22, 2024
2 parents 2ebc8ea + c217152 commit 27b225c
Show file tree
Hide file tree
Showing 32 changed files with 393 additions and 774 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,13 @@ yarn
The patient chart consists of the following parts:

- Navigation menu
- Breadcrumbs menu
- Patient header
- Chart review / Dashboards
- Workspace
- Side menu

The **navigation menu** lives on the left side of the screen and provides links to dashboards in the patient chart.

The **breadcrumbs menu** gets shown at the top of the page under the navigation bar. It shows the user their current location relative to the information architecture and helps them quickly navigate to a parent level or previous step.

The **patient header** contains the [patient banner](packages/esm-patient-banner-app/README.md). Uninvasive notifications also appear in this area following actions such as form submissions.

The **chart review** area is the main part of the screen. It displays whatever dashboard is active.
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@openmrs/esm-patient-chart",
"private": true,
"version": "8.0.0",
"version": "8.0.1",
"workspaces": [
"packages/*"
],
Expand All @@ -15,21 +15,28 @@
"postinstall": "husky install",
"test-e2e": "playwright test"
},
"dependencies": {
"@hookform/resolvers": "^3.3.1",
"classnames": "^2.3.2",
"react-hook-form": "^7.46.2",
"react-to-print": "^2.14.13",
"zod": "^3.22.2"
},
"devDependencies": {
"@openmrs/esm-framework": "next",
"@playwright/test": "1.44.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.89",
"@swc/jest": "^0.2.29",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/fhir": "^0.0.31",
"@types/jest": "^29.5.11",
"@types/lodash-es": "^4.17.9",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"babel-preset-minify": "^0.5.2",
Expand All @@ -53,8 +60,8 @@
"lodash": "^4.17.21",
"openmrs": "next",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^11.18.6",
"react-router-dom": "^6.16.0",
"rxjs": "^7.8.0",
Expand All @@ -73,12 +80,5 @@
"resolutions": {
"sass": "^1.54.3"
},
"packageManager": "[email protected]",
"dependencies": {
"@hookform/resolvers": "^3.3.1",
"classnames": "^2.3.2",
"react-hook-form": "^7.46.2",
"react-to-print": "^2.14.13",
"zod": "^3.22.2"
}
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/esm-form-engine-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openmrs/esm-form-engine-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Forms engine microfrontend for the OpenMRS SPA",
"description": "Wrapper ESM for the O3 React Form Engine",
"browser": "dist/openmrs-esm-form-engine-app.js",
"main": "src/index.ts",
"source": true,
Expand Down Expand Up @@ -40,11 +40,11 @@
"@carbon/react": "^1.12.0",
"@openmrs/openmrs-form-engine-lib": "next",
"lodash-es": "^4.17.21",
"react-error-boundary": "^4.0.11"
"react-error-boundary": "^4.0.13"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "7.x",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-form-entry-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-form-entry-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Form engine entry capabilities for the OpenMRS SPA",
"browser": "dist/openmrs-esm-form-entry-app.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-generic-patient-widgets-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-generic-patient-widgets-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Generic widgets for the patient chart",
"browser": "dist/openmrs-esm-generic-patient-widgets-app.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "7.x",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-allergies-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-allergies-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Patient allergies microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-allergies-app.js",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "7.x",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-patient-attachments-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-attachments-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Patient attachments microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-attachments-app.js",
Expand Down Expand Up @@ -38,14 +38,14 @@
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@openmrs/esm-patient-common-lib": "^8.0.0",
"@openmrs/esm-patient-common-lib": "^8.0.1",
"lodash-es": "^4.17.21",
"react-grid-gallery": "^0.5.6",
"react-html5-camera-photo": "^1.5.11"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "7.x",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-patient-banner-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-banner-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Patient banner microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-banner-app.js",
Expand Down Expand Up @@ -38,12 +38,12 @@
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@openmrs/esm-patient-common-lib": "^8.0.0",
"@openmrs/esm-patient-common-lib": "^8.0.1",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "7.x",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-chart-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-chart-app",
"version": "8.0.0",
"version": "8.0.1",
"license": "MPL-2.0",
"description": "Patient dashboard microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-chart-app.js",
Expand Down
39 changes: 1 addition & 38 deletions packages/esm-patient-chart-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
registerBreadcrumbs,
defineConfigSchema,
getAsyncLifecycle,
getSyncLifecycle,
Expand All @@ -9,7 +8,7 @@ import {
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';
import * as PatientCommonLib from '@openmrs/esm-patient-common-lib';
import { esmPatientChartSchema } from './config-schema';
import { moduleName, spaBasePath } from './constants';
import { moduleName } from './constants';
import { summaryDashboardMeta, encountersDashboardMeta } from './dashboard.meta';
import { setupOfflineVisitsSync, setupCacheableRoutes } from './offline';
import { genericDashboardConfigSchema } from './side-nav/generic-dashboard.component';
Expand Down Expand Up @@ -45,42 +44,6 @@ export function startupApp() {
defineExtensionConfigSchema('nav-group', genericNavGroupConfigSchema);
defineExtensionConfigSchema('dashboard', genericDashboardConfigSchema);

/**
* This comment tells i18n to still keep the following translation keys (DO NOT DELETE THESE):
*
* t('patientBreadcrumb', 'Patient')
* t('Patient Summary dashboard', 'Patient Summary dashboard')
* t('Allergies dashboard', 'Allergies dashboard')
* t('Appointments dashboard', 'Appointments dashboard')
* t('Vitals & Biometrics dashboard', 'Vitals & Biometrics dashboard')
* t('Medications dashboard', 'Medications dashboard')
* t('Visits dashboard', 'Visits dashboard')
* t('Conditions dashboard', 'Conditions dashboard')
* t('Attachments dashboard', 'Attachments dashboard')
* t('Programs dashboard', 'Programs dashboard')
* t('Offline Actions dashboard', 'Offline Actions dashboard')
* t('Forms & Notes dashboard', 'Forms & Notes dashboard')
* t('Results Viewer dashboard', 'Results Viewer dashboard')
*/
registerBreadcrumbs([
{
path: spaBasePath,
title: () => Promise.resolve(window.i18next.t('patientBreadcrumb', { defaultValue: 'Patient', ns: moduleName })),
parent: `${window.spaBase}/home`,
},
{
path: `${spaBasePath}/:view`,
title: ([_, key]) =>
Promise.resolve(
window.i18next.t(`${decodeURIComponent(key)} dashboard`, {
ns: moduleName,
defaultValue: `${decodeURIComponent(key)} dashboard`,
}),
),
parent: spaBasePath,
},
]);

registerFeatureFlag(
'rde',
'Retrospective Data Entry',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const PatientChart: React.FC = () => {
workspaceWindowState === 'normal' && active ? styles.closeWorkspace : styles.activeWorkspace,
)}
>
<ExtensionSlot name="breadcrumbs-slot" />
{isLoadingPatient ? (
<Loader />
) : (
Expand Down
16 changes: 5 additions & 11 deletions packages/esm-patient-chart-app/src/visit/hooks/useServiceQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ export async function saveQueueEntry(
priority: string,
status: string,
sortWeight: number,
abortController: AbortController,
locationUuid: string,
visitQueueNumberAttributeUuid: string,
abortController?: AbortController,
) {
await Promise.all([
generateVisitQueueNumber(locationUuid, visitUuid, queueUuid, abortController, visitQueueNumberAttributeUuid),
generateVisitQueueNumber(locationUuid, visitUuid, queueUuid, visitQueueNumberAttributeUuid, abortController),
]);

return openmrsFetch(`${restBaseUrl}/visit-queue-entry`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
signal: abortController.signal,
body: {
visit: { uuid: visitUuid },
queueEntry: {
Expand All @@ -40,25 +39,20 @@ export async function saveQueueEntry(
sortWeight: sortWeight,
},
},
signal: abortController?.signal,
});
}

export async function generateVisitQueueNumber(
location: string,
visitUuid: string,
queueUuid: string,
abortController: AbortController,
visitQueueNumberAttributeUuid: string,
abortController?: AbortController,
) {
await openmrsFetch(
`${restBaseUrl}/queue-entry-number?location=${location}&queue=${queueUuid}&visit=${visitUuid}&visitAttributeType=${visitQueueNumberAttributeUuid}`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
signal: abortController.signal,
},
{ signal: abortController?.signal },
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export interface AppointmentPayload {
export const updateAppointmentStatus = async (
toStatus: string,
appointmentUuid: string,
abortController: AbortController,
abortController?: AbortController,
) => {
const statusChangeTime = dayjs().format(omrsDateFormat);
const url = `${restBaseUrl}/appointments/${appointmentUuid}/status-change`;
return await openmrsFetch(url, {
body: { toStatus, onDate: statusChangeTime },
method: 'POST',
headers: { 'Content-Type': 'application/json' },
signal: abortController.signal,
signal: abortController?.signal,
});
};
Loading

0 comments on commit 27b225c

Please sign in to comment.