diff --git a/packages/esm-ward-app/src/config-schema.ts b/packages/esm-ward-app/src/config-schema.ts index 3c7f772c4..99613e04c 100644 --- a/packages/esm-ward-app/src/config-schema.ts +++ b/packages/esm-ward-app/src/config-schema.ts @@ -254,6 +254,11 @@ export const configSchema: ConfigSchema = { }, }, }, + hideWorkspaceVitalsLinks: { + _description: 'Configure whether to hide vital history and record vital links in the ward patient workspace.', + _type: Type.Boolean, + _default: false, + }, }; export interface WardConfigObject { @@ -266,6 +271,7 @@ export interface WardConfigObject { admissionRequestNote: Array; }; wards: Array; + hideWorkspaceVitalsLinks: boolean; } export interface PendingItemsElementConfig { diff --git a/packages/esm-ward-app/src/ward-workspace/patient-details/ward-patient.workspace.tsx b/packages/esm-ward-app/src/ward-workspace/patient-details/ward-patient.workspace.tsx index 50956d944..a7f7eb084 100644 --- a/packages/esm-ward-app/src/ward-workspace/patient-details/ward-patient.workspace.tsx +++ b/packages/esm-ward-app/src/ward-workspace/patient-details/ward-patient.workspace.tsx @@ -1,14 +1,16 @@ -import { attach, ExtensionSlot } from '@openmrs/esm-framework'; +import { attach, ExtensionSlot, useConfig } from '@openmrs/esm-framework'; import React from 'react'; import { type WardPatientWorkspaceProps } from '../../types'; import WardPatientWorkspaceBanner from '../patient-banner/patient-banner.component'; import styles from './ward-patient.style.scss'; +import { type WardConfigObject } from '../../config-schema'; attach('ward-patient-workspace-header-slot', 'patient-vitals-info'); -export default function WardPatientWorkspace({ wardPatient, WardPatientHeader }: WardPatientWorkspaceProps) { +export default function WardPatientWorkspace({ wardPatient }: WardPatientWorkspaceProps) { const { patient } = wardPatient ?? {}; - const extensionSlotState = { patient, patientUuid: patient?.uuid }; + const { hideWorkspaceVitalsLinks } = useConfig(); + const extensionSlotState = { patient, patientUuid: patient?.uuid, hideLinks: hideWorkspaceVitalsLinks }; return ( <>