From f03d26250c6378832107ef8fc37865ba65b3008c Mon Sep 17 00:00:00 2001 From: Vineet Sharma Date: Mon, 2 Dec 2024 11:11:08 +0530 Subject: [PATCH 1/2] Mutate the vitals and biometrics data when vitals O3 form is submitted --- packages/esm-patient-vitals-app/src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/esm-patient-vitals-app/src/utils.ts b/packages/esm-patient-vitals-app/src/utils.ts index fe9a4a277..a114e7680 100644 --- a/packages/esm-patient-vitals-app/src/utils.ts +++ b/packages/esm-patient-vitals-app/src/utils.ts @@ -2,6 +2,7 @@ import { type Visit } from '@openmrs/esm-framework'; import { launchPatientWorkspace, launchStartVisitPrompt } from '@openmrs/esm-patient-common-lib'; import { type ConfigObject } from './config-schema'; import { patientVitalsBiometricsFormWorkspace } from './constants'; +import { invalidateCachedVitalsAndBiometrics } from './common'; /** * Launches the for entry workspace with the custom form @@ -14,6 +15,7 @@ export function launchFormEntry(formUuid: string, encounterUuid?: string, formNa launchPatientWorkspace('patient-form-entry-workspace', { workspaceTitle: formName, formInfo: { formUuid, encounterUuid }, + mutateForm: invalidateCachedVitalsAndBiometrics, }); } From 8d49e5af51938b01e15c4e482fbb5a9e35786e83 Mon Sep 17 00:00:00 2001 From: Vineet Sharma Date: Mon, 2 Dec 2024 13:34:24 +0530 Subject: [PATCH 2/2] Update unit tests --- .../src/vitals-and-biometrics-header/vitals-header.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/esm-patient-vitals-app/src/vitals-and-biometrics-header/vitals-header.test.tsx b/packages/esm-patient-vitals-app/src/vitals-and-biometrics-header/vitals-header.test.tsx index 6db96b86a..f2adc755d 100644 --- a/packages/esm-patient-vitals-app/src/vitals-and-biometrics-header/vitals-header.test.tsx +++ b/packages/esm-patient-vitals-app/src/vitals-and-biometrics-header/vitals-header.test.tsx @@ -8,7 +8,7 @@ import { mockPatient, getByTextWithMarkup, renderWithSwr, waitForLoadingToFinish import { mockVitalsConfig, mockCurrentVisit, mockConceptUnits, mockConceptMetadata, formattedVitals } from '__mocks__'; import { configSchema, type ConfigObject } from '../config-schema'; import { patientVitalsBiometricsFormWorkspace } from '../constants'; -import { useVitalsAndBiometrics } from '../common'; +import { invalidateCachedVitalsAndBiometrics, useVitalsAndBiometrics } from '../common'; import VitalsHeader from './vitals-header.component'; const testProps = { @@ -188,6 +188,7 @@ describe('VitalsHeader', () => { formUuid: '9f26aad4-244a-46ca-be49-1196df1a8c9a', }, workspaceTitle: 'Triage', + mutateForm: invalidateCachedVitalsAndBiometrics, }); });