@openmrs/esm-fast-data-entry-app 1.0.1-pre.99 → 1.1.0
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/__mocks__/react-i18next.js +9 -14
- package/dist/12.js +1 -0
- package/dist/12.js.map +1 -0
- package/dist/132.js +1 -0
- package/dist/151.js +2 -0
- package/dist/151.js.map +1 -0
- package/dist/195.js +1 -0
- package/dist/195.js.map +1 -0
- package/dist/197.js +1 -0
- package/dist/221.js +1 -0
- package/dist/221.js.map +1 -0
- package/dist/259.js +1 -0
- package/dist/259.js.map +1 -0
- package/dist/265.js +1 -0
- package/dist/265.js.map +1 -0
- package/dist/269.js +1 -0
- package/dist/269.js.map +1 -0
- package/dist/{574.js → 300.js} +1 -1
- package/dist/335.js +1 -0
- package/dist/367.js +1 -0
- package/dist/367.js.map +1 -0
- package/dist/384.js +1 -0
- package/dist/384.js.map +1 -0
- package/dist/{294.js → 540.js} +2 -2
- package/dist/{294.js.map → 540.js.map} +1 -1
- package/dist/55.js +1 -0
- package/dist/579.js +1 -0
- package/dist/579.js.map +1 -0
- package/dist/595.js +2 -0
- package/dist/{409.js.LICENSE.txt → 595.js.LICENSE.txt} +14 -6
- package/dist/595.js.map +1 -0
- package/dist/602.js +1 -0
- package/dist/602.js.map +1 -0
- package/dist/616.js +1 -0
- package/dist/616.js.map +1 -0
- package/dist/626.js +2 -0
- package/dist/626.js.map +1 -0
- package/dist/652.js +1 -0
- package/dist/77.js +1 -0
- package/dist/77.js.map +1 -0
- package/dist/773.js +2 -0
- package/dist/{897.js.LICENSE.txt → 773.js.LICENSE.txt} +13 -2
- package/dist/773.js.map +1 -0
- package/dist/88.js +1 -0
- package/dist/88.js.map +1 -0
- package/dist/930.js +1 -0
- package/dist/930.js.map +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.map +1 -0
- package/dist/983.js +1 -0
- package/dist/983.js.map +1 -0
- package/dist/99.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +386 -154
- package/dist/openmrs-esm-fast-data-entry-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/jest.config.json +2 -1
- package/package.json +39 -36
- package/prettier.config.js +8 -0
- package/src/CancelModal.tsx +9 -15
- package/src/CompleteModal.tsx +7 -18
- package/src/FormBootstrap.tsx +31 -18
- package/src/Root.tsx +7 -12
- package/src/add-group-modal/AddGroupModal.tsx +73 -112
- package/src/add-group-modal/styles.scss +7 -3
- package/src/config-schema.ts +63 -24
- package/src/constant.ts +1 -1
- package/src/context/FormWorkflowContext.tsx +26 -39
- package/src/context/FormWorkflowReducer.ts +50 -74
- package/src/context/GroupFormWorkflowContext.tsx +40 -59
- package/src/context/GroupFormWorkflowReducer.ts +84 -109
- package/src/declarations.d.ts +3 -0
- package/src/empty-state/EmptyDataIllustration.tsx +4 -16
- package/src/empty-state/EmptyState.tsx +8 -13
- package/src/empty-state/styles.scss +14 -14
- package/src/form-entry-workflow/FormEntryWorkflow.tsx +43 -55
- package/src/form-entry-workflow/form-review-card/FormReviewCard.tsx +7 -7
- package/src/form-entry-workflow/form-review-card/index.ts +1 -1
- package/src/form-entry-workflow/form-review-card/styles.scss +9 -11
- package/src/form-entry-workflow/index.ts +1 -1
- package/src/form-entry-workflow/patient-banner/PatientBanner.test.tsx +5 -5
- package/src/form-entry-workflow/patient-banner/PatientBanner.tsx +14 -27
- package/src/form-entry-workflow/patient-banner/index.ts +1 -1
- package/src/form-entry-workflow/patient-banner/styles.scss +11 -12
- package/src/form-entry-workflow/patient-search-header/PatientSearchHeader.tsx +19 -28
- package/src/form-entry-workflow/patient-search-header/index.ts +1 -1
- package/src/form-entry-workflow/patient-search-header/styles.scss +13 -10
- package/src/form-entry-workflow/styles.scss +11 -13
- package/src/form-entry-workflow/workflow-review/WorkflowReview.tsx +13 -11
- package/src/form-entry-workflow/workflow-review/index.ts +1 -1
- package/src/form-entry-workflow/workflow-review/styles.scss +0 -4
- package/src/forms-app-menu-link.tsx +4 -6
- package/src/forms-page/FormsPage.tsx +23 -51
- package/src/forms-page/forms-table/FormsTable.tsx +22 -42
- package/src/forms-page/forms-table/index.ts +1 -1
- package/src/forms-page/forms-table/styles.scss +4 -5
- package/src/forms-page/index.ts +1 -1
- package/src/forms-page/styles.scss +3 -5
- package/src/group-form-entry-workflow/GroupFormEntryWorkflow.tsx +9 -9
- package/src/group-form-entry-workflow/GroupSessionWorkspace.tsx +77 -117
- package/src/group-form-entry-workflow/SessionDetailsForm.tsx +73 -50
- package/src/group-form-entry-workflow/SessionMetaWorkspace.tsx +20 -28
- package/src/group-form-entry-workflow/attendance-table/AttendanceTable.tsx +15 -29
- package/src/group-form-entry-workflow/attendance-table/index.ts +1 -1
- package/src/group-form-entry-workflow/configurable-questions/ConfigurableQuestionsSection.tsx +45 -0
- package/src/group-form-entry-workflow/group-display-header/GroupDisplayHeader.test.tsx +5 -5
- package/src/group-form-entry-workflow/group-display-header/GroupDisplayHeader.tsx +13 -21
- package/src/group-form-entry-workflow/group-display-header/index.ts +1 -1
- package/src/group-form-entry-workflow/group-display-header/styles.scss +20 -20
- package/src/group-form-entry-workflow/group-search/CompactGroupResults.tsx +24 -35
- package/src/group-form-entry-workflow/group-search/CompactGroupSearch.tsx +13 -15
- package/src/group-form-entry-workflow/group-search/GroupSearch.tsx +22 -38
- package/src/group-form-entry-workflow/group-search/compact-group-result.scss +16 -17
- package/src/group-form-entry-workflow/group-search/compact-group-search.scss +7 -8
- package/src/group-form-entry-workflow/group-search/group-search.scss +20 -23
- package/src/group-form-entry-workflow/group-search-header/GroupSearchHeader.tsx +20 -21
- package/src/group-form-entry-workflow/group-search-header/index.ts +1 -1
- package/src/group-form-entry-workflow/group-search-header/styles.scss +8 -8
- package/src/group-form-entry-workflow/index.ts +1 -1
- package/src/group-form-entry-workflow/styles.scss +13 -16
- package/src/hooks/index.ts +7 -6
- package/src/hooks/useFormState.ts +3 -3
- package/src/hooks/useGetAllForms.ts +7 -15
- package/src/hooks/useGetEncounter.ts +3 -3
- package/src/hooks/useGetPatient.ts +2 -2
- package/src/hooks/useGetPatients.ts +4 -6
- package/src/hooks/useGetSystemSetting.ts +3 -5
- package/src/hooks/useKeyPress.ts +5 -5
- package/src/hooks/usePostEndpoint.ts +10 -10
- package/src/hooks/useSearchEndpoint.ts +23 -40
- package/src/hooks/useSpecificQuestions.ts +75 -0
- package/src/hooks/useStartVisit.ts +18 -28
- package/src/index.ts +8 -20
- package/src/patient-card/PatientCard.tsx +8 -20
- package/src/patient-card/index.ts +1 -1
- package/src/patient-card/styles.scss +2 -4
- package/src/routes.json +2 -2
- package/src/setup-tests.ts +1 -1
- package/src/types.ts +25 -0
- package/tools/i18next-parser.config.js +19 -19
- package/translations/am.json +75 -0
- package/translations/ar.json +75 -0
- package/translations/en.json +7 -1
- package/translations/es.json +75 -0
- package/translations/fr.json +33 -8
- package/translations/he.json +75 -0
- package/translations/km.json +75 -0
- package/tsconfig.json +2 -1
- package/turbo.json +18 -0
- package/webpack.config.js +1 -1
- package/dist/136.js +0 -1
- package/dist/136.js.map +0 -1
- package/dist/141.js +0 -2
- package/dist/141.js.map +0 -1
- package/dist/233.js +0 -2
- package/dist/233.js.map +0 -1
- package/dist/242.js +0 -1
- package/dist/242.js.map +0 -1
- package/dist/327.js +0 -1
- package/dist/327.js.map +0 -1
- package/dist/387.js +0 -1
- package/dist/387.js.map +0 -1
- package/dist/405.js +0 -1
- package/dist/405.js.map +0 -1
- package/dist/409.js +0 -2
- package/dist/409.js.map +0 -1
- package/dist/431.js +0 -1
- package/dist/431.js.map +0 -1
- package/dist/559.js +0 -1
- package/dist/559.js.map +0 -1
- package/dist/757.js +0 -1
- package/dist/820.js +0 -1
- package/dist/820.js.map +0 -1
- package/dist/846.js +0 -1
- package/dist/846.js.map +0 -1
- package/dist/885.js +0 -1
- package/dist/885.js.map +0 -1
- package/dist/897.js +0 -2
- package/dist/897.js.map +0 -1
- package/dist/92.js +0 -1
- package/dist/92.js.map +0 -1
- package/dist/935.js +0 -2
- package/dist/935.js.map +0 -1
- package/src/declarations.d.tsx +0 -2
- /package/dist/{141.js.LICENSE.txt → 151.js.LICENSE.txt} +0 -0
- /package/dist/{294.js.LICENSE.txt → 540.js.LICENSE.txt} +0 -0
- /package/dist/{233.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
- /package/dist/{935.js.LICENSE.txt → 961.js.LICENSE.txt} +0 -0
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { ExtensionSlot, useSession } from
|
|
2
|
-
import { Button } from
|
|
3
|
-
import React, { useCallback, useContext, useEffect, useState } from
|
|
4
|
-
import FormBootstrap from
|
|
5
|
-
import PatientCard from
|
|
6
|
-
import styles from
|
|
7
|
-
import PatientSearchHeader from
|
|
8
|
-
import { useTranslation } from
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import useStartVisit from "../hooks/useStartVisit";
|
|
1
|
+
import { ExtensionSlot, useSession } from '@openmrs/esm-framework';
|
|
2
|
+
import { Button } from '@carbon/react';
|
|
3
|
+
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
4
|
+
import FormBootstrap from '../FormBootstrap';
|
|
5
|
+
import PatientCard from '../patient-card/PatientCard';
|
|
6
|
+
import styles from './styles.scss';
|
|
7
|
+
import PatientSearchHeader from './patient-search-header';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { v4 as uuid } from 'uuid';
|
|
10
|
+
import FormWorkflowContext, { FormWorkflowProvider } from '../context/FormWorkflowContext';
|
|
11
|
+
import WorkflowReview from './workflow-review';
|
|
12
|
+
import PatientBanner from './patient-banner';
|
|
13
|
+
import CompleteModal from '../CompleteModal';
|
|
14
|
+
import CancelModal from '../CancelModal';
|
|
15
|
+
import useStartVisit from '../hooks/useStartVisit';
|
|
17
16
|
|
|
18
17
|
const WorkflowNavigationButtons = () => {
|
|
19
18
|
const context = useContext(FormWorkflowContext);
|
|
@@ -29,28 +28,16 @@ const WorkflowNavigationButtons = () => {
|
|
|
29
28
|
<div className={styles.rightPanelActionButtons}>
|
|
30
29
|
<Button
|
|
31
30
|
kind="secondary"
|
|
32
|
-
onClick={
|
|
33
|
-
workflowState === "NEW_PATIENT"
|
|
34
|
-
? () => destroySession()
|
|
35
|
-
: () => setCompleteModalOpen(true)
|
|
36
|
-
}
|
|
31
|
+
onClick={workflowState === 'NEW_PATIENT' ? () => destroySession() : () => setCompleteModalOpen(true)}
|
|
37
32
|
>
|
|
38
|
-
{t(
|
|
33
|
+
{t('saveAndComplete', 'Save & Complete')}
|
|
39
34
|
</Button>
|
|
40
35
|
<Button kind="tertiary" onClick={() => setCancelModalOpen(true)}>
|
|
41
|
-
{t(
|
|
36
|
+
{t('cancel', 'Cancel')}
|
|
42
37
|
</Button>
|
|
43
38
|
</div>
|
|
44
|
-
<CancelModal
|
|
45
|
-
|
|
46
|
-
setOpen={setCancelModalOpen}
|
|
47
|
-
context={context}
|
|
48
|
-
/>
|
|
49
|
-
<CompleteModal
|
|
50
|
-
open={completeModalOpen}
|
|
51
|
-
setOpen={setCompleteModalOpen}
|
|
52
|
-
context={context}
|
|
53
|
-
/>
|
|
39
|
+
<CancelModal open={cancelModalOpen} setOpen={setCancelModalOpen} context={context} />
|
|
40
|
+
<CompleteModal open={completeModalOpen} setOpen={setCompleteModalOpen} context={context} />
|
|
54
41
|
</>
|
|
55
42
|
);
|
|
56
43
|
};
|
|
@@ -72,11 +59,7 @@ const FormWorkspace = () => {
|
|
|
72
59
|
const [visit, setVisit] = useState(null);
|
|
73
60
|
const { sessionLocation } = useSession();
|
|
74
61
|
|
|
75
|
-
const {
|
|
76
|
-
saveVisit,
|
|
77
|
-
updateEncounter,
|
|
78
|
-
success: visitSaveSuccess,
|
|
79
|
-
} = useStartVisit({
|
|
62
|
+
const { updateEncounter, success: visitSaveSuccess } = useStartVisit({
|
|
80
63
|
showSuccessNotification: false,
|
|
81
64
|
showErrorNotification: true,
|
|
82
65
|
});
|
|
@@ -104,29 +87,34 @@ const FormWorkspace = () => {
|
|
|
104
87
|
const handleEncounterCreate = useCallback(
|
|
105
88
|
(payload) => {
|
|
106
89
|
payload.location = sessionLocation?.uuid;
|
|
107
|
-
payload.encounterDatetime = payload.encounterDatetime
|
|
108
|
-
? payload.encounterDatetime
|
|
109
|
-
: new Date().toISOString();
|
|
90
|
+
payload.encounterDatetime = payload.encounterDatetime ? payload.encounterDatetime : new Date().toISOString();
|
|
110
91
|
// Create a visit with the same date as the encounter being saved
|
|
111
92
|
const visitStartDatetime = new Date(payload.encounterDatetime);
|
|
112
93
|
const visitStopDatetime = new Date(payload.encounterDatetime);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
94
|
+
const visitInfo = {
|
|
95
|
+
startDatetime: visitStartDatetime,
|
|
96
|
+
stopDatetime: visitStopDatetime,
|
|
97
|
+
uuid: uuid(),
|
|
98
|
+
patient: {
|
|
99
|
+
uuid: activePatientUuid,
|
|
100
|
+
},
|
|
101
|
+
location: {
|
|
102
|
+
uuid: sessionLocation?.uuid,
|
|
103
|
+
},
|
|
104
|
+
visitType: {
|
|
105
|
+
uuid: singleSessionVisitTypeUuid,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
payload.visit = visitInfo;
|
|
120
110
|
},
|
|
121
|
-
[activePatientUuid, singleSessionVisitTypeUuid,
|
|
111
|
+
[activePatientUuid, singleSessionVisitTypeUuid, sessionLocation],
|
|
122
112
|
);
|
|
123
113
|
|
|
124
114
|
return (
|
|
125
115
|
<div className={styles.workspace}>
|
|
126
116
|
{!patientUuids.length && (
|
|
127
|
-
<div className={styles.selectPatientMessage}>
|
|
128
|
-
{t("selectPatientFirst", "Please select a patient first")}
|
|
129
|
-
</div>
|
|
117
|
+
<div className={styles.selectPatientMessage}>{t('selectPatientFirst', 'Please select a patient first')}</div>
|
|
130
118
|
)}
|
|
131
119
|
{!!patientUuids.length && (
|
|
132
120
|
<div className={styles.formMainContent}>
|
|
@@ -142,7 +130,7 @@ const FormWorkspace = () => {
|
|
|
142
130
|
/>
|
|
143
131
|
</div>
|
|
144
132
|
<div className={styles.rightPanel}>
|
|
145
|
-
<h4>Forms filled</h4>
|
|
133
|
+
<h4>{t('formsFilled', 'Forms filled')}</h4>
|
|
146
134
|
<div className={styles.patientCardsSection}>
|
|
147
135
|
{patientUuids.map((patientUuid) => (
|
|
148
136
|
<PatientCard
|
|
@@ -171,8 +159,8 @@ const FormEntryWorkflow = () => {
|
|
|
171
159
|
<div className={styles.breadcrumbsContainer}>
|
|
172
160
|
<ExtensionSlot extensionSlotName="breadcrumbs-slot" />
|
|
173
161
|
</div>
|
|
174
|
-
{workflowState ===
|
|
175
|
-
{workflowState !==
|
|
162
|
+
{workflowState === 'REVIEW' && <WorkflowReview />}
|
|
163
|
+
{workflowState !== 'REVIEW' && (
|
|
176
164
|
<>
|
|
177
165
|
<PatientSearchHeader />
|
|
178
166
|
<PatientBanner />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Accordion, AccordionItem, Button } from
|
|
2
|
-
import React, { useContext } from
|
|
3
|
-
import { useTranslation } from
|
|
4
|
-
import FormWorkflowContext from
|
|
5
|
-
import { useGetPatient, useGetEncounter } from
|
|
6
|
-
import styles from
|
|
1
|
+
import { Accordion, AccordionItem, Button } from '@carbon/react';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import FormWorkflowContext from '../../context/FormWorkflowContext';
|
|
5
|
+
import { useGetPatient, useGetEncounter } from '../../hooks';
|
|
6
|
+
import styles from './styles.scss';
|
|
7
7
|
|
|
8
8
|
const FormReviewCard = ({ patientUuid }) => {
|
|
9
9
|
const { encounters, editEncounter } = useContext(FormWorkflowContext);
|
|
@@ -39,7 +39,7 @@ const FormReviewCard = ({ patientUuid }) => {
|
|
|
39
39
|
</div>
|
|
40
40
|
)}
|
|
41
41
|
<Button kind="primary" onClick={() => editEncounter(patientUuid)}>
|
|
42
|
-
{t(
|
|
42
|
+
{t('goToForm', 'Go To Form')}
|
|
43
43
|
</Button>
|
|
44
44
|
</AccordionItem>
|
|
45
45
|
</Accordion>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
5
|
-
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
6
4
|
|
|
7
5
|
.formReviewCard {
|
|
8
|
-
background-color:
|
|
9
|
-
padding:
|
|
6
|
+
background-color: colors.$white-0;
|
|
7
|
+
padding: layout.$spacing-02;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.formReviewCard :global(.cds--accordion) :global(.cds--accordion__item) {
|
|
@@ -16,17 +14,17 @@
|
|
|
16
14
|
.formReviewCard :global(.cds--accordion__title) {
|
|
17
15
|
display: flex;
|
|
18
16
|
align-items: baseline;
|
|
19
|
-
column-gap:
|
|
17
|
+
column-gap: layout.$spacing-05;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.formReviewCard :global(.cds--accordion__content) {
|
|
23
|
-
padding:
|
|
21
|
+
padding: layout.$spacing-03;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
.dataField {
|
|
27
25
|
@include type.type-style('code-02');
|
|
28
|
-
background-color:
|
|
29
|
-
padding:
|
|
26
|
+
background-color: colors.$gray-10;
|
|
27
|
+
padding: layout.$spacing-03;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
.displayName {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render } from
|
|
3
|
-
import PatientBanner from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import PatientBanner from './PatientBanner';
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
it(
|
|
5
|
+
describe('PatientBanner', () => {
|
|
6
|
+
it('renders placeholder information when no data is present', () => {
|
|
7
7
|
render(<PatientBanner />);
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { age, ExtensionSlot } from
|
|
2
|
-
import { SkeletonPlaceholder, SkeletonText } from
|
|
3
|
-
import React, { useContext } from
|
|
4
|
-
import styles from
|
|
5
|
-
import { useTranslation } from
|
|
6
|
-
import useGetPatient from
|
|
7
|
-
import FormWorkflowContext from
|
|
1
|
+
import { age, ExtensionSlot } from '@openmrs/esm-framework';
|
|
2
|
+
import { SkeletonPlaceholder, SkeletonText } from '@carbon/react';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
import styles from './styles.scss';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import useGetPatient from '../../hooks/useGetPatient';
|
|
7
|
+
import FormWorkflowContext from '../../context/FormWorkflowContext';
|
|
8
8
|
|
|
9
9
|
const SkeletonPatientInfo = () => {
|
|
10
10
|
return (
|
|
@@ -36,16 +36,14 @@ const PatientBanner = () => {
|
|
|
36
36
|
const { activePatientUuid, workflowState } = useContext(FormWorkflowContext);
|
|
37
37
|
const patient = useGetPatient(activePatientUuid);
|
|
38
38
|
const { t } = useTranslation();
|
|
39
|
-
const patientName = `${patient?.name?.[0].given?.join(
|
|
40
|
-
patient?.name?.[0]?.family
|
|
41
|
-
}`;
|
|
39
|
+
const patientName = `${patient?.name?.[0].given?.join(' ')} ${patient?.name?.[0]?.family}`;
|
|
42
40
|
|
|
43
41
|
const patientPhotoSlotState = React.useMemo(
|
|
44
|
-
() => ({ patientUuid: patient?.id, patientName, size:
|
|
45
|
-
[patient?.id, patientName]
|
|
42
|
+
() => ({ patientUuid: patient?.id, patientName, size: 'small' }),
|
|
43
|
+
[patient?.id, patientName],
|
|
46
44
|
);
|
|
47
45
|
|
|
48
|
-
if (workflowState ===
|
|
46
|
+
if (workflowState === 'NEW_PATIENT') return null;
|
|
49
47
|
|
|
50
48
|
if (!patient) {
|
|
51
49
|
return <SkeletonPatientInfo />;
|
|
@@ -53,29 +51,18 @@ const PatientBanner = () => {
|
|
|
53
51
|
|
|
54
52
|
return (
|
|
55
53
|
<div className={styles.container}>
|
|
56
|
-
<ExtensionSlot
|
|
57
|
-
extensionSlotName="patient-photo-slot"
|
|
58
|
-
state={patientPhotoSlotState}
|
|
59
|
-
/>
|
|
54
|
+
<ExtensionSlot extensionSlotName="patient-photo-slot" state={patientPhotoSlotState} />
|
|
60
55
|
<div className={styles.patientInfoContent}>
|
|
61
56
|
<div className={styles.patientInfoRow}>
|
|
62
57
|
<span className={styles.patientName}>{patientName}</span>
|
|
63
58
|
</div>
|
|
64
59
|
<div className={styles.patientInfoRow}>
|
|
65
|
-
<span>
|
|
66
|
-
{(patient.gender ?? t("unknown", "Unknown")).replace(/^\w/, (c) =>
|
|
67
|
-
c.toUpperCase()
|
|
68
|
-
)}
|
|
69
|
-
</span>
|
|
60
|
+
<span>{(patient.gender ?? t('unknown', 'Unknown')).replace(/^\w/, (c) => c.toUpperCase())}</span>
|
|
70
61
|
<span>·</span>
|
|
71
62
|
<span>{age(patient.birthDate)}</span>
|
|
72
63
|
<span>·</span>
|
|
73
64
|
<span>
|
|
74
|
-
{patient.identifier.length
|
|
75
|
-
? patient.identifier
|
|
76
|
-
.map((identifier) => identifier.value)
|
|
77
|
-
.join(", ")
|
|
78
|
-
: "--"}
|
|
65
|
+
{patient.identifier.length ? patient.identifier.map((identifier) => identifier.value).join(', ') : '--'}
|
|
79
66
|
</span>
|
|
80
67
|
</div>
|
|
81
68
|
</div>
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
5
4
|
|
|
6
5
|
.container {
|
|
7
|
-
height:
|
|
6
|
+
height: layout.$spacing-11;
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
|
-
background-color:
|
|
11
|
-
border-top: 0.0125rem solid
|
|
12
|
-
border-bottom: 0.0125rem solid
|
|
13
|
-
padding: 0
|
|
9
|
+
background-color: colors.$white-0;
|
|
10
|
+
border-top: 0.0125rem solid colors.$gray-20;
|
|
11
|
+
border-bottom: 0.0125rem solid colors.$gray-20;
|
|
12
|
+
padding: 0 layout.$spacing-05;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.photoPlaceholder {
|
|
@@ -35,11 +34,11 @@
|
|
|
35
34
|
min-height: 2rem;
|
|
36
35
|
}
|
|
37
36
|
@include type.type-style('body-compact-02');
|
|
38
|
-
color:
|
|
37
|
+
color: colors.$gray-70;
|
|
39
38
|
column-gap: 0.8rem;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.patientEditBtn {
|
|
43
|
-
color:
|
|
44
|
-
margin:
|
|
42
|
+
color: colors.$gray-100;
|
|
43
|
+
margin: layout.$spacing-03;
|
|
45
44
|
}
|
|
@@ -1,58 +1,49 @@
|
|
|
1
|
-
import { Add, Close } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Link } from "react-router-dom";
|
|
10
|
-
import FormWorkflowContext from "../../context/FormWorkflowContext";
|
|
11
|
-
import styles from "./styles.scss";
|
|
12
|
-
import { useTranslation } from "react-i18next";
|
|
1
|
+
import { Add, Close } from '@carbon/react/icons';
|
|
2
|
+
import { ExtensionSlot, interpolateUrl, navigate } from '@openmrs/esm-framework';
|
|
3
|
+
import { Button } from '@carbon/react';
|
|
4
|
+
import React, { useContext } from 'react';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import FormWorkflowContext from '../../context/FormWorkflowContext';
|
|
7
|
+
import styles from './styles.scss';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
13
9
|
|
|
14
10
|
const PatientSearchHeader = () => {
|
|
15
|
-
const { addPatient, workflowState, activeFormUuid } =
|
|
16
|
-
useContext(FormWorkflowContext);
|
|
11
|
+
const { addPatient, workflowState, activeFormUuid } = useContext(FormWorkflowContext);
|
|
17
12
|
const handleSelectPatient = (patient) => {
|
|
18
|
-
addPatient(patient
|
|
13
|
+
addPatient(patient);
|
|
19
14
|
};
|
|
20
15
|
const { t } = useTranslation();
|
|
21
16
|
|
|
22
|
-
if (workflowState !==
|
|
17
|
+
if (workflowState !== 'NEW_PATIENT') return null;
|
|
23
18
|
|
|
24
|
-
const afterUrl = encodeURIComponent(
|
|
25
|
-
|
|
26
|
-
);
|
|
27
|
-
const patientRegistrationUrl = interpolateUrl(
|
|
28
|
-
`\${openmrsSpaBase}/patient-registration?afterUrl=${afterUrl}`
|
|
29
|
-
);
|
|
19
|
+
const afterUrl = encodeURIComponent(`\${openmrsSpaBase}/forms/form/${activeFormUuid}?patientUuid=\${patientUuid}`);
|
|
20
|
+
const patientRegistrationUrl = interpolateUrl(`\${openmrsSpaBase}/patient-registration?afterUrl=${afterUrl}`);
|
|
30
21
|
|
|
31
22
|
return (
|
|
32
23
|
<div className={styles.searchHeaderContainer}>
|
|
33
|
-
<span className={styles.padded}>{t(
|
|
24
|
+
<span className={styles.padded}>{t('nextPatient', 'Next patient')}:</span>
|
|
34
25
|
<span className={styles.searchBarWrapper}>
|
|
35
26
|
<ExtensionSlot
|
|
36
|
-
|
|
27
|
+
name="patient-search-bar-slot"
|
|
37
28
|
state={{
|
|
38
29
|
selectPatientAction: handleSelectPatient,
|
|
39
30
|
buttonProps: {
|
|
40
|
-
kind:
|
|
31
|
+
kind: 'primary',
|
|
41
32
|
},
|
|
42
33
|
}}
|
|
43
34
|
/>
|
|
44
35
|
</span>
|
|
45
|
-
<span className={styles.padded}>{t(
|
|
36
|
+
<span className={styles.padded}>{t('or', 'or')}</span>
|
|
46
37
|
<span>
|
|
47
38
|
<Button onClick={() => navigate({ to: patientRegistrationUrl })}>
|
|
48
|
-
{t(
|
|
39
|
+
{t('createNewPatient', 'Create new patient')} <Add size={20} />
|
|
49
40
|
</Button>
|
|
50
41
|
</span>
|
|
51
42
|
<span style={{ flexGrow: 1 }} />
|
|
52
43
|
<span>
|
|
53
44
|
<Link to="../">
|
|
54
45
|
<Button kind="ghost">
|
|
55
|
-
{t(
|
|
46
|
+
{t('cancel', 'Cancel')} <Close size={20} />
|
|
56
47
|
</Button>
|
|
57
48
|
</Link>
|
|
58
49
|
</span>
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
5
4
|
|
|
6
5
|
.searchHeaderContainer {
|
|
7
|
-
height:
|
|
6
|
+
height: layout.$spacing-11;
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
|
-
background-color:
|
|
11
|
-
border-top: 0.0125rem solid
|
|
12
|
-
border-bottom: 0.0125rem solid
|
|
13
|
-
padding: 0
|
|
9
|
+
background-color: colors.$white-0;
|
|
10
|
+
border-top: 0.0125rem solid colors.$gray-20;
|
|
11
|
+
border-bottom: 0.0125rem solid colors.$gray-20;
|
|
12
|
+
padding: 0 layout.$spacing-05;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.searchBarWrapper {
|
|
17
16
|
min-width: 35rem;
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
.searchBarWrapper > div button {
|
|
20
|
+
height: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
20
23
|
.padded {
|
|
21
|
-
padding:
|
|
24
|
+
padding: layout.$spacing-05;
|
|
22
25
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
1
|
@use '@carbon/colors';
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@
|
|
5
|
-
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
6
4
|
|
|
7
5
|
.breadcrumbsContainer > div > div > nav {
|
|
8
|
-
background-color:
|
|
9
|
-
padding:
|
|
10
|
-
height:
|
|
6
|
+
background-color: colors.$white-0;
|
|
7
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
8
|
+
height: layout.$spacing-08;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
.workspaceWrapper {
|
|
@@ -20,16 +18,16 @@
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.selectPatientMessage {
|
|
23
|
-
@include type.type-style('
|
|
24
|
-
margin:
|
|
21
|
+
@include type.type-style('heading-03');
|
|
22
|
+
margin: layout.$spacing-07;
|
|
25
23
|
text-align: center;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
.formMainContent {
|
|
29
27
|
display: flex;
|
|
30
28
|
text-align: center;
|
|
31
|
-
margin-top:
|
|
32
|
-
column-gap:
|
|
29
|
+
margin-top: layout.$spacing-05;
|
|
30
|
+
column-gap: layout.$spacing-05;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
.formContainer {
|
|
@@ -50,14 +48,14 @@
|
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
.patientCardsSection {
|
|
53
|
-
margin:
|
|
51
|
+
margin: layout.$spacing-05 0;
|
|
54
52
|
border-bottom: 1px solid colors.$gray-10;
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
.rightPanelActionButtons {
|
|
58
56
|
display: flex;
|
|
59
57
|
flex-direction: column;
|
|
60
|
-
row-gap:
|
|
58
|
+
row-gap: layout.$spacing-03;
|
|
61
59
|
& button {
|
|
62
60
|
width: 100%;
|
|
63
61
|
text-decoration: "none";
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { Button } from
|
|
2
|
-
import React, { useContext } from
|
|
3
|
-
import { useNavigate } from
|
|
4
|
-
import FormWorkflowContext from
|
|
5
|
-
import FormReviewCard from
|
|
6
|
-
import styles from
|
|
1
|
+
import { Button } from '@carbon/react';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import FormWorkflowContext from '../../context/FormWorkflowContext';
|
|
5
|
+
import FormReviewCard from '../form-review-card';
|
|
6
|
+
import styles from './styles.scss';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
7
8
|
|
|
8
9
|
const WorkflowReview = () => {
|
|
9
10
|
const { patientUuids } = useContext(FormWorkflowContext);
|
|
11
|
+
const { t } = useTranslation();
|
|
10
12
|
const navigate = useNavigate();
|
|
11
13
|
return (
|
|
12
14
|
<div className={styles.workspaceWrapper}>
|
|
13
15
|
<div className={styles.workspace}>
|
|
14
16
|
<div className={styles.leftPanel}>
|
|
15
|
-
<h4>Review</h4>
|
|
17
|
+
<h4>{t('review', 'Review')}</h4>
|
|
16
18
|
<div className={styles.navButtons}>
|
|
17
|
-
<Button kind="primary" onClick={() => navigate(
|
|
18
|
-
Save & Close
|
|
19
|
+
<Button kind="primary" onClick={() => navigate('/')}>
|
|
20
|
+
{t('save&close', 'Save & Close')}
|
|
19
21
|
</Button>
|
|
20
|
-
<Button kind="tertiary" onClick={() => navigate(
|
|
21
|
-
Cancel
|
|
22
|
+
<Button kind="tertiary" onClick={() => navigate('/')}>
|
|
23
|
+
{t('cancel', 'Cancel')}
|
|
22
24
|
</Button>
|
|
23
25
|
</div>
|
|
24
26
|
</div>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { useTranslation } from
|
|
3
|
-
import { ConfigurableLink } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
4
4
|
|
|
5
5
|
export default function FormsAppMenuLink() {
|
|
6
6
|
const { t } = useTranslation();
|
|
7
7
|
return (
|
|
8
8
|
// eslint-disable-next-line
|
|
9
|
-
<ConfigurableLink to="${openmrsSpaBase}/forms">
|
|
10
|
-
{t("formsAppMenuLink", "Fast Data Entry")}
|
|
11
|
-
</ConfigurableLink>
|
|
9
|
+
<ConfigurableLink to="${openmrsSpaBase}/forms">{t('formsAppMenuLink', 'Fast Data Entry')}</ConfigurableLink>
|
|
12
10
|
);
|
|
13
11
|
}
|