@openmrs/esm-patient-common-lib 8.2.1-pre.5611 → 8.2.1-pre.5614
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/package.json +1 -1
- package/src/form-entry-interop.ts +26 -4
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { launchPatientWorkspace, launchStartVisitPrompt } from '@openmrs/esm-patient-common-lib';
|
|
2
2
|
|
|
3
|
+
export const clinicalFormsWorkspace = 'clinical-forms-workspace';
|
|
4
|
+
export const formEntryWorkspace = 'patient-form-entry-workspace';
|
|
5
|
+
export const htmlFormEntryWorkspace = 'patient-html-form-entry-workspace';
|
|
6
|
+
|
|
3
7
|
interface HtmlFormEntryForm {
|
|
4
8
|
formUuid: string;
|
|
5
9
|
formName: string;
|
|
@@ -19,12 +23,15 @@ export function launchFormEntryOrHtmlForms(
|
|
|
19
23
|
visitStartDatetime?: string,
|
|
20
24
|
visitStopDatetime?: string,
|
|
21
25
|
mutateForms?: () => void,
|
|
26
|
+
clinicalFormsWorkspaceName = clinicalFormsWorkspace,
|
|
27
|
+
formEntryWorkspaceName = formEntryWorkspace,
|
|
28
|
+
htmlFormEntryWorkspaceName = htmlFormEntryWorkspace,
|
|
22
29
|
) {
|
|
23
30
|
if (visitUuid) {
|
|
24
31
|
const htmlForm = htmlFormEntryForms.find((form) => form.formUuid === formUuid);
|
|
25
32
|
|
|
26
33
|
if (htmlForm) {
|
|
27
|
-
launchHtmlFormEntry(formName, encounterUuid, visitUuid, htmlForm);
|
|
34
|
+
launchHtmlFormEntry(patientUuid, formName, encounterUuid, visitUuid, htmlForm, htmlFormEntryWorkspaceName);
|
|
28
35
|
} else {
|
|
29
36
|
launchFormEntry(
|
|
30
37
|
formUuid,
|
|
@@ -37,6 +44,8 @@ export function launchFormEntryOrHtmlForms(
|
|
|
37
44
|
visitStopDatetime,
|
|
38
45
|
htmlForm,
|
|
39
46
|
mutateForms,
|
|
47
|
+
clinicalFormsWorkspaceName,
|
|
48
|
+
formEntryWorkspaceName,
|
|
40
49
|
);
|
|
41
50
|
}
|
|
42
51
|
} else {
|
|
@@ -55,9 +64,14 @@ export function launchFormEntry(
|
|
|
55
64
|
visitStopDatetime?: string,
|
|
56
65
|
htmlForm?: HtmlFormEntryForm,
|
|
57
66
|
mutateForm?: () => void,
|
|
67
|
+
clinicalFormsWorkspaceName = clinicalFormsWorkspace,
|
|
68
|
+
formEntryWorkspaceName = formEntryWorkspace,
|
|
58
69
|
) {
|
|
59
|
-
launchPatientWorkspace(
|
|
70
|
+
launchPatientWorkspace(formEntryWorkspaceName, {
|
|
60
71
|
workspaceTitle: formName,
|
|
72
|
+
clinicalFormsWorkspaceName,
|
|
73
|
+
formEntryWorkspaceName,
|
|
74
|
+
patientUuid,
|
|
61
75
|
mutateForm,
|
|
62
76
|
formInfo: {
|
|
63
77
|
encounterUuid,
|
|
@@ -72,9 +86,17 @@ export function launchFormEntry(
|
|
|
72
86
|
});
|
|
73
87
|
}
|
|
74
88
|
|
|
75
|
-
export function launchHtmlFormEntry(
|
|
76
|
-
|
|
89
|
+
export function launchHtmlFormEntry(
|
|
90
|
+
patientUuid: string,
|
|
91
|
+
formName: string,
|
|
92
|
+
encounterUuid: string,
|
|
93
|
+
visitUuid: string,
|
|
94
|
+
htmlForm: HtmlFormEntryForm,
|
|
95
|
+
workspaceName = htmlFormEntryWorkspace,
|
|
96
|
+
) {
|
|
97
|
+
launchPatientWorkspace(workspaceName, {
|
|
77
98
|
workspaceTitle: formName,
|
|
99
|
+
patientUuid,
|
|
78
100
|
formInfo: {
|
|
79
101
|
encounterUuid,
|
|
80
102
|
visitUuid,
|