Skip to content

Commit

Permalink
(fix) Restore ability to optionally launch clinical form from vitals …
Browse files Browse the repository at this point in the history
…and biometrics widget (#1474)
  • Loading branch information
donaldkibet authored Nov 18, 2023
1 parent 084e22d commit 5c56fa7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/esm-patient-vitals-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function launchVitalsAndBiometricsForm(currentVisit: Visit, config: Confi

if (config.vitals.useFormEngine) {
const { formUuid, formName } = config.vitals;
launchFormEntry(formUuid, undefined, formName);
launchFormEntry(formUuid, '', formName);
} else {
launchPatientWorkspace(patientVitalsBiometricsFormWorkspace);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ describe('VitalsHeader: ', () => {

expect(screen.queryByTitle(/abnormal value/i)).toBeInTheDocument();
});

test('should launch Form Entry vitals and biometrics form', async () => {
const user = userEvent.setup();
const { useConfig } = require('@openmrs/esm-framework');
const updateVitalsConfigMock = {
...mockVitalsConfig,
vitals: { ...mockVitalsConfig.vitals, useFormEngine: true, formName: 'Triage' },
};
useConfig.mockImplementation(() => updateVitalsConfigMock);

renderVitalsHeader();
await waitForLoadingToFinish();

const recordVitalsButton = screen.getByText(/Record vitals/i);

await waitFor(() => user.click(recordVitalsButton));
expect(mockLaunchWorkspace).toHaveBeenCalledWith('patient-form-entry-workspace', {
formInfo: { encounterUuid: '', formUuid: updateVitalsConfigMock.vitals.formUuid },
workspaceTitle: updateVitalsConfigMock.vitals.formName,
});
});
});

function renderVitalsHeader() {
Expand Down

0 comments on commit 5c56fa7

Please sign in to comment.