Skip to content

Commit

Permalink
(feat) O3-4238: Mutate the vitals and biometrics data when vitals O3 …
Browse files Browse the repository at this point in the history
…form is submitted (#2126)

* Mutate the vitals and biometrics data when vitals O3 form is submitted

* Update unit tests
  • Loading branch information
vasharma05 authored Dec 2, 2024
1 parent 1d717fa commit 7ca5b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/esm-patient-vitals-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,6 +15,7 @@ export function launchFormEntry(formUuid: string, encounterUuid?: string, formNa
launchPatientWorkspace('patient-form-entry-workspace', {
workspaceTitle: formName,
formInfo: { formUuid, encounterUuid },
mutateForm: invalidateCachedVitalsAndBiometrics,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -188,6 +188,7 @@ describe('VitalsHeader', () => {
formUuid: '9f26aad4-244a-46ca-be49-1196df1a8c9a',
},
workspaceTitle: 'Triage',
mutateForm: invalidateCachedVitalsAndBiometrics,
});
});

Expand Down

0 comments on commit 7ca5b09

Please sign in to comment.