@openmrs/esm-patient-forms-app 11.3.1-pre.9452 → 11.3.1-pre.9458
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -15
- package/dist/1197.js +1 -1
- package/dist/1197.js.map +1 -0
- package/dist/2608.js +1 -0
- package/dist/2608.js.map +1 -0
- package/dist/3578.js +1 -0
- package/dist/4341.js +1 -0
- package/dist/4341.js.map +1 -0
- package/dist/5277.js +1 -0
- package/dist/5277.js.map +1 -0
- package/dist/5696.js +1 -1
- package/dist/5696.js.map +1 -1
- package/dist/5764.js +1 -0
- package/dist/5764.js.map +1 -0
- package/dist/5792.js +2 -0
- package/dist/{7906.js.LICENSE.txt → 5792.js.LICENSE.txt} +10 -0
- package/dist/5792.js.map +1 -0
- package/dist/7003.js +1 -1
- package/dist/7003.js.map +1 -1
- package/dist/7007.js +1 -1
- package/dist/7007.js.map +1 -1
- package/dist/707.js +1 -1
- package/dist/707.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-forms-app.js +1 -1
- package/dist/openmrs-esm-patient-forms-app.js.buildmanifest.json +180 -137
- package/dist/openmrs-esm-patient-forms-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/clinical-form-action-button.component.tsx +13 -40
- package/src/clinical-form-action-button.test.tsx +23 -22
- package/src/config-schema.ts +1 -1
- package/src/forms/exported-form-entry.workspace.tsx +37 -0
- package/src/forms/exported-forms-dashboard.workspace.tsx +43 -0
- package/src/forms/form-entry.component.tsx +138 -0
- package/src/forms/form-entry.resources.ts +37 -0
- package/src/forms/form-entry.test.tsx +14 -28
- package/src/forms/form-entry.workspace.tsx +25 -99
- package/src/forms/forms-dashboard.component.tsx +13 -58
- package/src/forms/forms-dashboard.test.tsx +3 -15
- package/src/forms/forms-dashboard.workspace.tsx +34 -10
- package/src/forms/forms-list.component.tsx +20 -41
- package/src/forms/forms-list.test.tsx +2 -2
- package/src/forms/forms-table.component.tsx +1 -1
- package/src/hooks/use-forms.ts +3 -4
- package/src/index.ts +6 -8
- package/src/offline-forms/use-offline-form-encounters.ts +2 -2
- package/src/offline.ts +5 -7
- package/src/routes.json +13 -49
- package/dist/1123.js +0 -2
- package/dist/1123.js.LICENSE.txt +0 -9
- package/dist/1123.js.map +0 -1
- package/dist/2773.js +0 -1
- package/dist/2773.js.map +0 -1
- package/dist/4078.js +0 -1
- package/dist/4078.js.map +0 -1
- package/dist/7906.js +0 -2
- package/dist/7906.js.map +0 -1
- package/dist/8803.js +0 -1
- package/dist/8803.js.map +0 -1
- package/src/htmlformentry/html-form-entry.workspace.tsx +0 -54
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type DefaultPatientWorkspaceProps, type FormEntryProps } from '@openmrs/esm-patient-common-lib';
|
|
3
|
-
import HtmlFormEntryWrapper from './html-form-entry-wrapper.component';
|
|
4
|
-
|
|
5
|
-
interface HtmlFormEntryComponentProps extends DefaultPatientWorkspaceProps {
|
|
6
|
-
formInfo: FormEntryProps;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const HtmlFormEntry: React.FC<HtmlFormEntryComponentProps> = ({
|
|
10
|
-
patientUuid,
|
|
11
|
-
closeWorkspaceWithSavedChanges,
|
|
12
|
-
promptBeforeClosing,
|
|
13
|
-
formInfo,
|
|
14
|
-
visitContext,
|
|
15
|
-
}) => {
|
|
16
|
-
const { encounterUuid, visitUuid, htmlForm } = formInfo || {};
|
|
17
|
-
|
|
18
|
-
// we always want to prompt the user before closing/hiding the workspace because we can't guarantee maintaining the state of the form
|
|
19
|
-
promptBeforeClosing(() => true);
|
|
20
|
-
|
|
21
|
-
// urls for entering a new form and editing an existing form; note that we specify the returnUrl as post-message:close-workspace,
|
|
22
|
-
// which tells HFE-UI to send a message to the parent window to close the workspace when the form is saved or cancelled
|
|
23
|
-
|
|
24
|
-
const uiPage = encounterUuid ? htmlForm.formEditUiPage : htmlForm.formUiPage;
|
|
25
|
-
const url = `${window.openmrsBase}/htmlformentryui/htmlform/${uiPage}.page?`;
|
|
26
|
-
const searchParams = new URLSearchParams();
|
|
27
|
-
searchParams.append('patientId', patientUuid);
|
|
28
|
-
if (visitUuid || visitContext?.uuid) {
|
|
29
|
-
searchParams.append('visitId', visitUuid ?? visitContext?.uuid);
|
|
30
|
-
}
|
|
31
|
-
if (encounterUuid) {
|
|
32
|
-
searchParams.append('encounterId', encounterUuid);
|
|
33
|
-
}
|
|
34
|
-
if (htmlForm.formUiResource) {
|
|
35
|
-
searchParams.append('definitionUiResource', htmlForm.formUiResource);
|
|
36
|
-
} else {
|
|
37
|
-
searchParams.append('formUuid', htmlForm.formUuid);
|
|
38
|
-
}
|
|
39
|
-
searchParams.append('returnUrl', 'post-message:close-workspace');
|
|
40
|
-
|
|
41
|
-
const showFormAndLoadedData = formInfo && patientUuid;
|
|
42
|
-
return (
|
|
43
|
-
<div>
|
|
44
|
-
{showFormAndLoadedData && (
|
|
45
|
-
<HtmlFormEntryWrapper
|
|
46
|
-
src={url + searchParams}
|
|
47
|
-
closeWorkspaceWithSavedChanges={closeWorkspaceWithSavedChanges}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default HtmlFormEntry;
|