@thrustdevs/esm-procedure-orders-app 1.0.2-pre.6
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 +41 -0
- package/README.md +7 -0
- package/dist/122.js +1 -0
- package/dist/122.js.map +1 -0
- package/dist/144.js +2 -0
- package/dist/144.js.LICENSE.txt +19 -0
- package/dist/144.js.map +1 -0
- package/dist/182.js +1 -0
- package/dist/182.js.map +1 -0
- package/dist/205.js +1 -0
- package/dist/205.js.map +1 -0
- package/dist/216.js +2 -0
- package/dist/216.js.LICENSE.txt +9 -0
- package/dist/216.js.map +1 -0
- package/dist/290.js +2 -0
- package/dist/290.js.LICENSE.txt +5 -0
- package/dist/290.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/341.js +2 -0
- package/dist/341.js.LICENSE.txt +29 -0
- package/dist/341.js.map +1 -0
- package/dist/41.js +2 -0
- package/dist/41.js.LICENSE.txt +9 -0
- package/dist/41.js.map +1 -0
- package/dist/470.js +1 -0
- package/dist/470.js.map +1 -0
- package/dist/495.js +1 -0
- package/dist/495.js.map +1 -0
- package/dist/506.js +2 -0
- package/dist/506.js.LICENSE.txt +39 -0
- package/dist/506.js.map +1 -0
- package/dist/537.js +1 -0
- package/dist/537.js.map +1 -0
- package/dist/647.js +2 -0
- package/dist/647.js.LICENSE.txt +5 -0
- package/dist/647.js.map +1 -0
- package/dist/7.js +1 -0
- package/dist/7.js.map +1 -0
- package/dist/719.js +2 -0
- package/dist/719.js.LICENSE.txt +5 -0
- package/dist/719.js.map +1 -0
- package/dist/720.js +1 -0
- package/dist/720.js.map +1 -0
- package/dist/876.js +1 -0
- package/dist/876.js.map +1 -0
- package/dist/883.js +1 -0
- package/dist/883.js.map +1 -0
- package/dist/89.js +1 -0
- package/dist/89.js.map +1 -0
- package/dist/892.js +1 -0
- package/dist/892.js.map +1 -0
- package/dist/895.js +1 -0
- package/dist/895.js.map +1 -0
- package/dist/913.js +2 -0
- package/dist/913.js.LICENSE.txt +32 -0
- package/dist/913.js.map +1 -0
- package/dist/924.js +1 -0
- package/dist/924.js.map +1 -0
- package/dist/943.js +1 -0
- package/dist/943.js.map +1 -0
- package/dist/99.js +2 -0
- package/dist/99.js.LICENSE.txt +5 -0
- package/dist/99.js.map +1 -0
- package/dist/kenyaemr-esm-procedure-orders-app.js +1 -0
- package/dist/kenyaemr-esm-procedure-orders-app.js.buildmanifest.json +786 -0
- package/dist/kenyaemr-esm-procedure-orders-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +35 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +8 -0
- package/package.json +55 -0
- package/src/completed-list/completed-list.component.tsx +40 -0
- package/src/completed-list/completed-list.resource.ts +0 -0
- package/src/completed-list/completed-list.scss +223 -0
- package/src/components/create-dashboard-link.component.tsx +35 -0
- package/src/components/overlay/hook.ts +47 -0
- package/src/components/overlay/overlay.component.tsx +42 -0
- package/src/components/overlay/overlay.scss +92 -0
- package/src/config-schema.ts +78 -0
- package/src/constants.ts +5 -0
- package/src/declarations.d.ts +6 -0
- package/src/empty-state/empty-state-component.tsx +21 -0
- package/src/empty-state/empty-state.scss +23 -0
- package/src/form/post-procedures/post-procedure-form.component.tsx +468 -0
- package/src/form/post-procedures/post-procedure-form.scss +189 -0
- package/src/form/post-procedures/post-procedure.resource.tsx +71 -0
- package/src/form/procedures-orders/add-procedures-order/add-procedures-order.scss +44 -0
- package/src/form/procedures-orders/add-procedures-order/add-procedures-order.workspace.tsx +93 -0
- package/src/form/procedures-orders/add-procedures-order/procedures-order-form.component.tsx +476 -0
- package/src/form/procedures-orders/add-procedures-order/procedures-order-form.scss +80 -0
- package/src/form/procedures-orders/add-procedures-order/procedures-order.ts +17 -0
- package/src/form/procedures-orders/add-procedures-order/procedures-type-search.scss +115 -0
- package/src/form/procedures-orders/add-procedures-order/procedures-type-search.tsx +236 -0
- package/src/form/procedures-orders/add-procedures-order/useProceduresTypes.ts +93 -0
- package/src/form/procedures-orders/api.ts +282 -0
- package/src/form/procedures-orders/order-config.ts +48 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-icon.component.tsx +39 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-item-tile.component.tsx +100 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-item-tile.scss +72 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-panel.extension.tsx +190 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket-panel.scss +74 -0
- package/src/form/procedures-orders/procedures-order-basket-panel/procedures-order-basket.scss +55 -0
- package/src/header/procedure-header.component.tsx +32 -0
- package/src/header/procedure-header.scss +70 -0
- package/src/header/procedure-illustration.component.tsx +52 -0
- package/src/hooks/useOrdersWorklist.ts +70 -0
- package/src/hooks/useSearchGroupedResults.ts +22 -0
- package/src/hooks/useSearchResults.ts +39 -0
- package/src/index.ts +59 -0
- package/src/left-panel-link.tsx +40 -0
- package/src/not-done-list/not-done-list.component.tsx +44 -0
- package/src/not-done-list/not-done.scss +207 -0
- package/src/patient-chart/patient-procedure-order-results-table.resource.ts +43 -0
- package/src/patient-chart/patient-procedure-order-results.component.tsx +12 -0
- package/src/patient-chart/patient-procedure-order-results.resource.ts +485 -0
- package/src/patient-chart/patient-procedure-results.component.tsx +30 -0
- package/src/patient-chart/procedure-active-order/procedure-active-order-results.component.tsx +390 -0
- package/src/patient-chart/procedure-active-order/procedure-active-order-results.scss +78 -0
- package/src/patient-chart/procedure-order-referals/procedure-order-referals.component.tsx +394 -0
- package/src/patient-chart/procedure-order-referals/procedure-order-referals.resource.tsx +0 -0
- package/src/patient-chart/procedure-order-referals/procedure-order-referals.scss +78 -0
- package/src/patient-chart/procedure-past-test/laboratory-past-test-order-results.component.tsx +366 -0
- package/src/patient-chart/procedure-past-test/laboratory-past-test-order-results.scss +74 -0
- package/src/patient-chart/procedure-tabs/laboratory-order-tabs.component.tsx +44 -0
- package/src/patient-chart/procedure-tabs/laboratory-order-tabs.scss +7 -0
- package/src/patient-chart/procedure-workspaces/laboratory-referral.workspace.component.tsx +11 -0
- package/src/patient-chart/procedure-workspaces/laboratory-referral.workspace.scss +0 -0
- package/src/patient-chart/results-summary/print-results-summary.component.tsx +152 -0
- package/src/patient-chart/results-summary/print-results-summary.scss +80 -0
- package/src/patient-chart/results-summary/print-results-table.component.tsx +134 -0
- package/src/patient-chart/results-summary/results-summary.resource.tsx +174 -0
- package/src/patient-chart/results-summary/results-summary.scss +158 -0
- package/src/patient-chart/results-summary/send-email-dialog.component.tsx +59 -0
- package/src/patient-chart/results-summary/test-children-results.component.tsx +177 -0
- package/src/patient-chart/results-summary/test-print-results-table.component.tsx +105 -0
- package/src/patient-chart/results-summary/test-results-table.component.tsx +103 -0
- package/src/print/print-procedure-results.component.tsx +49 -0
- package/src/print/print-procedure.component.tsx +105 -0
- package/src/print/print-procedure.scss +98 -0
- package/src/procedure-tabs/completed-tab.component.tsx +12 -0
- package/src/procedure-tabs/not-done-tab.component.tsx +12 -0
- package/src/procedure-tabs/referred-tab.component.tsx +12 -0
- package/src/procedure-tabs/work-list-tab.component.tsx +13 -0
- package/src/procedure.component.tsx +24 -0
- package/src/procedures-ordered/_pick-procedure-request-menu.component.tsx +33 -0
- package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.component.tsx +105 -0
- package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.resource.ts +106 -0
- package/src/procedures-ordered/pick-procedure-order/add-to-worklist-dialog.scss +38 -0
- package/src/procedures-ordered/pick-procedure-request-menu.component.tsx +32 -0
- package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.component.tsx +300 -0
- package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.resource.ts +153 -0
- package/src/procedures-ordered/procedure-dialogs/add-to-worklist-dialog.scss +38 -0
- package/src/procedures-ordered/procedure-instructions/instructions.scss +24 -0
- package/src/procedures-ordered/procedure-instructions/procedure-instructions-menu.component.tsx +32 -0
- package/src/procedures-ordered/procedure-instructions/procedure-instructions.component.tsx +78 -0
- package/src/procedures-ordered/procedure-instructions/procedure-instructions.scss +24 -0
- package/src/procedures-ordered/procedure-queue.scss +211 -0
- package/src/procedures-ordered/procedure-tabs.component.tsx +104 -0
- package/src/procedures-ordered/procedure-tests/procedure-tests.component.tsx +83 -0
- package/src/procedures-ordered/procedure-tests/procedure-tests.resource.ts +14 -0
- package/src/procedures-ordered/procedure-tests/procedure-tests.scss +12 -0
- package/src/procedures-ordered/procedures-ordered-list.component.tsx +38 -0
- package/src/procedures-ordered/reject-order-dialog/reject-order-dialog.scss +14 -0
- package/src/procedures-ordered/reject-order-dialog/reject-procedure-order-dialog.component.tsx +98 -0
- package/src/procedures-ordered/reject-reason/procedure-reject-reason-menu.component.tsx +32 -0
- package/src/procedures-ordered/reject-reason/procedure-reject-reason.component.tsx +40 -0
- package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.component.tsx +42 -0
- package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss +14 -0
- package/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.test.tsx +67 -0
- package/src/referred-procedures/referred-procedures.component.tsx +37 -0
- package/src/results/result-form-field.component.tsx +141 -0
- package/src/results/result-form.component.tsx +120 -0
- package/src/results/result-form.resource.ts +361 -0
- package/src/results/result-form.scss +22 -0
- package/src/root.component.tsx +16 -0
- package/src/routes.json +152 -0
- package/src/setup-tests.ts +7 -0
- package/src/shared/ui/common/action-button/action-button.component.tsx +68 -0
- package/src/shared/ui/common/action-button/action-button.scss +12 -0
- package/src/shared/ui/common/action-button/order-action-extension.component.tsx +21 -0
- package/src/shared/ui/common/grouped-orders-table.component.tsx +176 -0
- package/src/shared/ui/common/grouped-orders-table.scss +30 -0
- package/src/shared/ui/common/grouped-procedure-types.ts +47 -0
- package/src/shared/ui/common/list-order-details.component.tsx +171 -0
- package/src/shared/ui/common/list-order-details.resource.ts +41 -0
- package/src/shared/ui/common/list-order-details.scss +118 -0
- package/src/shared/ui/common/orders-date-range-picker.scss +15 -0
- package/src/shared/ui/common/orders-date-range-picker.tsx +38 -0
- package/src/summary-tiles/procedure-summary-tiles.component.tsx +36 -0
- package/src/summary-tiles/procedure-summary-tiles.scss +11 -0
- package/src/summary-tiles/procedure-summary.resource.tsx +79 -0
- package/src/summary-tiles/summary-tile.component.tsx +41 -0
- package/src/summary-tiles/summary-tile.scss +53 -0
- package/src/types/index.ts +661 -0
- package/src/types/patient-queue.ts +77 -0
- package/src/ui-components/overflow-menu.component.tsx +74 -0
- package/src/ui-components/overflow-menu.scss +39 -0
- package/src/utils/functions.ts +236 -0
- package/src/utils/orders-table/orders-data-table.component.tsx +129 -0
- package/src/utils/orders-table/orders-data-table.scss +50 -0
- package/src/work-list/work-list.component.tsx +38 -0
- package/src/work-list/work-list.resource.ts +26 -0
- package/src/work-list/work-list.scss +207 -0
- package/translations/en.json +141 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import styles from './result-form.scss';
|
|
3
|
+
import { Button, InlineLoading, ModalBody, ModalFooter, TextArea, FormLabel } from '@carbon/react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { closeOverlay } from '../components/overlay/hook';
|
|
6
|
+
import { ExtensionSlot, showNotification, showToast, usePatient } from '@openmrs/esm-framework';
|
|
7
|
+
import { useGetOrderConceptByUuid, saveProcedureReport } from './result-form.resource';
|
|
8
|
+
import { useForm } from 'react-hook-form';
|
|
9
|
+
import { type Result } from '../types';
|
|
10
|
+
|
|
11
|
+
interface ResultFormProps {
|
|
12
|
+
patientUuid: string;
|
|
13
|
+
order: Result;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const PostProcedureForm: React.FC<ResultFormProps> = ({ order, patientUuid }) => {
|
|
17
|
+
const [report, setProcedureReport] = useState('');
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const {
|
|
20
|
+
formState: { isSubmitting, errors },
|
|
21
|
+
handleSubmit,
|
|
22
|
+
} = useForm<{ testResult: string }>({
|
|
23
|
+
defaultValues: {},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const { patient, isLoading } = usePatient(patientUuid);
|
|
27
|
+
const { concept, isLoading: isLoadingConcepts } = useGetOrderConceptByUuid(order.concept.uuid);
|
|
28
|
+
|
|
29
|
+
const bannerState = useMemo(() => {
|
|
30
|
+
if (patient) {
|
|
31
|
+
return {
|
|
32
|
+
patient,
|
|
33
|
+
patientUuid,
|
|
34
|
+
hideActionsOverflow: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}, [patient, patientUuid]);
|
|
38
|
+
|
|
39
|
+
if (isLoadingConcepts) {
|
|
40
|
+
return <div>Loading procedure details</div>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const onSubmit = (data, e) => {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
// assign result to test order
|
|
46
|
+
|
|
47
|
+
const reportPayload = {
|
|
48
|
+
patient: patientUuid,
|
|
49
|
+
procedureOrder: order.uuid,
|
|
50
|
+
concept: order.concept.uuid,
|
|
51
|
+
status: 'IN_PROGRESS',
|
|
52
|
+
procedureReport: report,
|
|
53
|
+
participants: [],
|
|
54
|
+
procedureResults: [],
|
|
55
|
+
complications: [],
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
saveProcedureReport(reportPayload).then(
|
|
59
|
+
() => {
|
|
60
|
+
showToast({
|
|
61
|
+
critical: true,
|
|
62
|
+
title: t('saveReport', 'Report updated sucessful'),
|
|
63
|
+
kind: 'success',
|
|
64
|
+
description: t('generateSuccessfully', 'Report saved successfully'),
|
|
65
|
+
});
|
|
66
|
+
closeOverlay();
|
|
67
|
+
},
|
|
68
|
+
(err) => {
|
|
69
|
+
showNotification({
|
|
70
|
+
title: t(`errorSavingReport', 'Error occurred while saving the report`),
|
|
71
|
+
kind: 'error',
|
|
72
|
+
critical: true,
|
|
73
|
+
description: err?.message,
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<div className="">
|
|
81
|
+
<ModalBody>
|
|
82
|
+
{isLoading && (
|
|
83
|
+
<InlineLoading
|
|
84
|
+
className={styles.bannerLoading}
|
|
85
|
+
iconDescription="Loading"
|
|
86
|
+
description="Loading banner"
|
|
87
|
+
status="active"
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
{patient && <ExtensionSlot name="patient-header-slot" state={bannerState} />}
|
|
91
|
+
<section className={styles.section}>
|
|
92
|
+
<form>
|
|
93
|
+
<FormLabel className={styles.textArea}>{concept?.display}</FormLabel>
|
|
94
|
+
{Object.keys(errors).length > 0 && <div className={styles.errorDiv}>Procedure report is required</div>}
|
|
95
|
+
<TextArea
|
|
96
|
+
id="procedureReport"
|
|
97
|
+
name="procedureReport"
|
|
98
|
+
rules={{
|
|
99
|
+
required: true,
|
|
100
|
+
}}
|
|
101
|
+
invalidText="Required"
|
|
102
|
+
autofocus
|
|
103
|
+
onChange={(e) => setProcedureReport(e.target.value)}
|
|
104
|
+
/>
|
|
105
|
+
</form>
|
|
106
|
+
</section>
|
|
107
|
+
</ModalBody>
|
|
108
|
+
|
|
109
|
+
<ModalFooter>
|
|
110
|
+
<Button disabled={isSubmitting} onClick={() => closeOverlay()} kind="secondary">
|
|
111
|
+
{t('cancel', 'Cancel')}
|
|
112
|
+
</Button>
|
|
113
|
+
<Button onClick={handleSubmit(onSubmit)}>Save report</Button>
|
|
114
|
+
</ModalFooter>
|
|
115
|
+
</div>
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default PostProcedureForm;
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
import { updateOrder } from '../procedures-ordered/pick-procedure-order/add-to-worklist-dialog.resource';
|
|
4
|
+
|
|
5
|
+
export interface ConceptResponse {
|
|
6
|
+
uuid: string;
|
|
7
|
+
display: string;
|
|
8
|
+
name: Name;
|
|
9
|
+
datatype: Datatype;
|
|
10
|
+
conceptClass: ConceptClass;
|
|
11
|
+
set: boolean;
|
|
12
|
+
version: string;
|
|
13
|
+
retired: boolean;
|
|
14
|
+
names: Name2[];
|
|
15
|
+
descriptions: Description[];
|
|
16
|
+
mappings: Mapping[];
|
|
17
|
+
answers: any[];
|
|
18
|
+
setMembers: ConceptReference[];
|
|
19
|
+
auditInfo: AuditInfo;
|
|
20
|
+
attributes: any[];
|
|
21
|
+
links: Link18[];
|
|
22
|
+
resourceVersion: string;
|
|
23
|
+
hiNormal?: number;
|
|
24
|
+
hiAbsolute?: number;
|
|
25
|
+
hiCritical?: number;
|
|
26
|
+
lowNormal?: number;
|
|
27
|
+
lowAbsolute?: number;
|
|
28
|
+
lowCritical?: number;
|
|
29
|
+
units?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface Name {
|
|
33
|
+
display: string;
|
|
34
|
+
uuid: string;
|
|
35
|
+
name: string;
|
|
36
|
+
locale: string;
|
|
37
|
+
localePreferred: boolean;
|
|
38
|
+
conceptNameType: string;
|
|
39
|
+
links: Link[];
|
|
40
|
+
resourceVersion: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Link {
|
|
44
|
+
rel: string;
|
|
45
|
+
uri: string;
|
|
46
|
+
resourceAlias: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface Datatype {
|
|
50
|
+
uuid: string;
|
|
51
|
+
display: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
hl7Abbreviation: string;
|
|
55
|
+
retired: boolean;
|
|
56
|
+
links: Link2[];
|
|
57
|
+
resourceVersion: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface Link2 {
|
|
61
|
+
rel: string;
|
|
62
|
+
uri: string;
|
|
63
|
+
resourceAlias: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConceptClass {
|
|
67
|
+
uuid: string;
|
|
68
|
+
display: string;
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
retired: boolean;
|
|
72
|
+
links: Link3[];
|
|
73
|
+
resourceVersion: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface Link3 {
|
|
77
|
+
rel: string;
|
|
78
|
+
uri: string;
|
|
79
|
+
resourceAlias: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface Name2 {
|
|
83
|
+
display: string;
|
|
84
|
+
uuid: string;
|
|
85
|
+
name: string;
|
|
86
|
+
locale: string;
|
|
87
|
+
localePreferred: boolean;
|
|
88
|
+
conceptNameType?: string;
|
|
89
|
+
links: Link4[];
|
|
90
|
+
resourceVersion: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface Link4 {
|
|
94
|
+
rel: string;
|
|
95
|
+
uri: string;
|
|
96
|
+
resourceAlias: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface Description {
|
|
100
|
+
display: string;
|
|
101
|
+
uuid: string;
|
|
102
|
+
description: string;
|
|
103
|
+
locale: string;
|
|
104
|
+
links: Link5[];
|
|
105
|
+
resourceVersion: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface Link5 {
|
|
109
|
+
rel: string;
|
|
110
|
+
uri: string;
|
|
111
|
+
resourceAlias: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface Mapping {
|
|
115
|
+
display: string;
|
|
116
|
+
uuid: string;
|
|
117
|
+
conceptReferenceTerm: ConceptReferenceTerm;
|
|
118
|
+
conceptMapType: ConceptMapType;
|
|
119
|
+
links: Link8[];
|
|
120
|
+
resourceVersion: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface ConceptReferenceTerm {
|
|
124
|
+
uuid: string;
|
|
125
|
+
display: string;
|
|
126
|
+
links: Link6[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface Link6 {
|
|
130
|
+
rel: string;
|
|
131
|
+
uri: string;
|
|
132
|
+
resourceAlias: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ConceptMapType {
|
|
136
|
+
uuid: string;
|
|
137
|
+
display: string;
|
|
138
|
+
links: Link7[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface Link7 {
|
|
142
|
+
rel: string;
|
|
143
|
+
uri: string;
|
|
144
|
+
resourceAlias: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface Link8 {
|
|
148
|
+
rel: string;
|
|
149
|
+
uri: string;
|
|
150
|
+
resourceAlias: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ConceptReference {
|
|
154
|
+
uuid: string;
|
|
155
|
+
display: string;
|
|
156
|
+
name: Name3;
|
|
157
|
+
datatype: Datatype2;
|
|
158
|
+
conceptClass: ConceptClass2;
|
|
159
|
+
set: boolean;
|
|
160
|
+
version: string;
|
|
161
|
+
retired: boolean;
|
|
162
|
+
names: Name4[];
|
|
163
|
+
descriptions: any[];
|
|
164
|
+
mappings: Mapping2[];
|
|
165
|
+
answers: Answer[];
|
|
166
|
+
setMembers: any[];
|
|
167
|
+
attributes: any[];
|
|
168
|
+
links: Link15[];
|
|
169
|
+
resourceVersion: string;
|
|
170
|
+
hiNormal?: number;
|
|
171
|
+
hiAbsolute?: number;
|
|
172
|
+
hiCritical?: number;
|
|
173
|
+
lowNormal?: number;
|
|
174
|
+
lowAbsolute?: number;
|
|
175
|
+
lowCritical?: number;
|
|
176
|
+
units?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface Name3 {
|
|
180
|
+
display: string;
|
|
181
|
+
uuid: string;
|
|
182
|
+
name: string;
|
|
183
|
+
locale: string;
|
|
184
|
+
localePreferred: boolean;
|
|
185
|
+
conceptNameType: string;
|
|
186
|
+
links: Link9[];
|
|
187
|
+
resourceVersion: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface Link9 {
|
|
191
|
+
rel: string;
|
|
192
|
+
uri: string;
|
|
193
|
+
resourceAlias: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface Datatype2 {
|
|
197
|
+
uuid: string;
|
|
198
|
+
display: string;
|
|
199
|
+
links: Link10[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface Link10 {
|
|
203
|
+
rel: string;
|
|
204
|
+
uri: string;
|
|
205
|
+
resourceAlias: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ConceptClass2 {
|
|
209
|
+
uuid: string;
|
|
210
|
+
display: string;
|
|
211
|
+
links: Link11[];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface Link11 {
|
|
215
|
+
rel: string;
|
|
216
|
+
uri: string;
|
|
217
|
+
resourceAlias: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface Name4 {
|
|
221
|
+
uuid: string;
|
|
222
|
+
display: string;
|
|
223
|
+
links: Link12[];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface Link12 {
|
|
227
|
+
rel: string;
|
|
228
|
+
uri: string;
|
|
229
|
+
resourceAlias: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface Mapping2 {
|
|
233
|
+
uuid: string;
|
|
234
|
+
display: string;
|
|
235
|
+
links: Link13[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface Link13 {
|
|
239
|
+
rel: string;
|
|
240
|
+
uri: string;
|
|
241
|
+
resourceAlias: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface Answer {
|
|
245
|
+
uuid: string;
|
|
246
|
+
display: string;
|
|
247
|
+
links: Link14[];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface Link14 {
|
|
251
|
+
rel: string;
|
|
252
|
+
uri: string;
|
|
253
|
+
resourceAlias: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface Link15 {
|
|
257
|
+
rel: string;
|
|
258
|
+
uri: string;
|
|
259
|
+
resourceAlias: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface AuditInfo {
|
|
263
|
+
creator: Creator;
|
|
264
|
+
dateCreated: string;
|
|
265
|
+
changedBy: ChangedBy;
|
|
266
|
+
dateChanged: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface Creator {
|
|
270
|
+
uuid: string;
|
|
271
|
+
display: string;
|
|
272
|
+
links: Link16[];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface Link16 {
|
|
276
|
+
rel: string;
|
|
277
|
+
uri: string;
|
|
278
|
+
resourceAlias: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface ChangedBy {
|
|
282
|
+
uuid: string;
|
|
283
|
+
display: string;
|
|
284
|
+
links: Link17[];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface Link17 {
|
|
288
|
+
rel: string;
|
|
289
|
+
uri: string;
|
|
290
|
+
resourceAlias: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface Link18 {
|
|
294
|
+
rel: string;
|
|
295
|
+
uri: string;
|
|
296
|
+
resourceAlias: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface ObPayload {
|
|
300
|
+
concept: string;
|
|
301
|
+
order: string;
|
|
302
|
+
value: string | number;
|
|
303
|
+
status: string;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// get order concept
|
|
307
|
+
export async function GetOrderConceptByUuid(uuid: string) {
|
|
308
|
+
const abortController = new AbortController();
|
|
309
|
+
return openmrsFetch(`/ws/rest/v1/concept/${uuid}?v=full`, {
|
|
310
|
+
headers: {
|
|
311
|
+
'Content-Type': 'application/json',
|
|
312
|
+
},
|
|
313
|
+
signal: abortController.signal,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export function useGetOrderConceptByUuid(uuid: string) {
|
|
318
|
+
const apiUrl = `/ws/rest/v1/concept/${uuid}?v=custom:(uuid,display,name,datatype,set,answers,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units,setMembers:(uuid,display,answers,datatype,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units))`;
|
|
319
|
+
|
|
320
|
+
const { data, error, isLoading, isValidating, mutate } = useSWR<{ data: ConceptResponse }, Error>(
|
|
321
|
+
apiUrl,
|
|
322
|
+
openmrsFetch,
|
|
323
|
+
);
|
|
324
|
+
return {
|
|
325
|
+
concept: data?.data,
|
|
326
|
+
isLoading,
|
|
327
|
+
isError: error,
|
|
328
|
+
isValidating,
|
|
329
|
+
mutate,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export async function UpdateEncounter(uuid: string, payload: any) {
|
|
334
|
+
const abortController = new AbortController();
|
|
335
|
+
return openmrsFetch(`/ws/rest/v1/encounter/${uuid}`, {
|
|
336
|
+
method: 'POST',
|
|
337
|
+
headers: {
|
|
338
|
+
'Content-Type': 'application/json',
|
|
339
|
+
},
|
|
340
|
+
signal: abortController.signal,
|
|
341
|
+
body: payload,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export async function saveProcedureReport(reportPayload) {
|
|
346
|
+
const abortController = new AbortController();
|
|
347
|
+
const updateResults = await openmrsFetch(`/ws/rest/v1/procedure`, {
|
|
348
|
+
method: 'POST',
|
|
349
|
+
headers: {
|
|
350
|
+
'Content-Type': 'application/json',
|
|
351
|
+
},
|
|
352
|
+
signal: abortController.signal,
|
|
353
|
+
body: reportPayload,
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
if (updateResults.status === 201 || updateResults.status === 200) {
|
|
357
|
+
return await updateOrder(reportPayload.procedureOrder, {
|
|
358
|
+
fulfillerStatus: 'COMPLETED',
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
|
|
4
|
+
.section {
|
|
5
|
+
margin: spacing.$spacing-03;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.sectionTitle {
|
|
9
|
+
margin-bottom: spacing.$spacing-04;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.modalBody {
|
|
13
|
+
padding-bottom: spacing.$spacing-05;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.textInput {
|
|
17
|
+
margin: 5px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.errorDiv {
|
|
21
|
+
color: red;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
3
|
+
import Procedure from './procedure.component';
|
|
4
|
+
import { basePath } from './constants';
|
|
5
|
+
|
|
6
|
+
const Root: React.FC = () => {
|
|
7
|
+
return (
|
|
8
|
+
<BrowserRouter basename={basePath}>
|
|
9
|
+
<Routes>
|
|
10
|
+
<Route path="/" element={<Procedure />} />
|
|
11
|
+
</Routes>
|
|
12
|
+
</BrowserRouter>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Root;
|
package/src/routes.json
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.openmrs.org/routes.schema.json",
|
|
3
|
+
"backendDependencies": {
|
|
4
|
+
"fhir2": ">=1.2",
|
|
5
|
+
"webservices.rest": "^2.24.0"
|
|
6
|
+
},
|
|
7
|
+
"extensions": [
|
|
8
|
+
{
|
|
9
|
+
"component": "procedureDashboardLink",
|
|
10
|
+
"name": "procedure-dashboard-link",
|
|
11
|
+
"meta": {
|
|
12
|
+
"name": "procedure",
|
|
13
|
+
"title": "procedure",
|
|
14
|
+
"slot": "procedure-dashboard-slot"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"component": "root",
|
|
19
|
+
"name": "procedure-dashboard-root",
|
|
20
|
+
"slot": "procedure-dashboard-slot"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "procedures-ordered-tile-component",
|
|
24
|
+
"slot": "procedure-tiles-slot",
|
|
25
|
+
"component": "OrderedTileComponent",
|
|
26
|
+
"meta": {
|
|
27
|
+
"name": "proceduresOrderedTileSlot",
|
|
28
|
+
"title": "Active Orders"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "procedures-worklist-tile-component",
|
|
33
|
+
"slot": "procedure-tiles-slot",
|
|
34
|
+
"component": "worklistTileComponent",
|
|
35
|
+
"meta": {
|
|
36
|
+
"name": "worklisTileSlot",
|
|
37
|
+
"title": "Worklist"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "procedures-referred-tile-component",
|
|
42
|
+
"slot": "procedure-tiles-slot",
|
|
43
|
+
"component": "referredOutTileComponent",
|
|
44
|
+
"meta": {
|
|
45
|
+
"name": "referredTileSlot",
|
|
46
|
+
"title": "Referred Out"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "procedures-not-done-tile-component",
|
|
51
|
+
"slot": "procedure-tiles-slot",
|
|
52
|
+
"component": "notDoneTileComponent",
|
|
53
|
+
"meta": {
|
|
54
|
+
"name": "notDoneTileSlot",
|
|
55
|
+
"title": "Not Done"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "procedures-completed-tile-component",
|
|
60
|
+
"slot": "procedure-tiles-slot",
|
|
61
|
+
"component": "completedTileComponent",
|
|
62
|
+
"meta": {
|
|
63
|
+
"name": "completedTileSlot",
|
|
64
|
+
"title": "Completed"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "procedures-worklist-tab-component",
|
|
69
|
+
"slot": "procedures-panels-slot",
|
|
70
|
+
"component": "worklistProceduresTabComponent",
|
|
71
|
+
"meta": {
|
|
72
|
+
"name": "proceduresPanelSlot",
|
|
73
|
+
"title": "Worklist"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "procedures-referred-tab-component",
|
|
78
|
+
"slot": "procedures-panels-slot",
|
|
79
|
+
"component": "referredProceduresTabComponent",
|
|
80
|
+
"meta": {
|
|
81
|
+
"name": "proceduresPanelSlot",
|
|
82
|
+
"title": "Referred Out"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "procedures-not-done-tab-component",
|
|
87
|
+
"slot": "procedures-panels-slot",
|
|
88
|
+
"component": "notDoneProceduresTabComponent",
|
|
89
|
+
"meta": {
|
|
90
|
+
"name": "proceduresPanelSlot",
|
|
91
|
+
"title": "Not Done"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "procedures-completed-tab-component",
|
|
96
|
+
"slot": "procedures-panels-slot",
|
|
97
|
+
"component": "completedProceduresTabComponent",
|
|
98
|
+
"meta": {
|
|
99
|
+
"name": "proceduresPanelSlot",
|
|
100
|
+
"title": "Completed"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name":"procedure-instructions-modal",
|
|
105
|
+
"component": "procedureInstructionsModalComponent"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name":"procedure-reject-reason-modal",
|
|
109
|
+
"component": "procedureRejectModalComponent"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name":"add-procedure-to-worklist-dialog",
|
|
113
|
+
"component": "addProcedureToWorklistDialogComponent"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "reject-procedure-order-dialog",
|
|
117
|
+
"component": "rejectProcedureOrderDialogComponent"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "procedures-order-panel",
|
|
121
|
+
"component": "proceduresOrderPanel",
|
|
122
|
+
"slot": "order-basket-slot",
|
|
123
|
+
"order": 4
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"workspaces": [
|
|
127
|
+
{
|
|
128
|
+
"name": "add-procedures-order",
|
|
129
|
+
"type": "order",
|
|
130
|
+
"title": "Add procedure order",
|
|
131
|
+
"component": "addProceduresOrderWorkspace"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "procedure-report-form",
|
|
135
|
+
"component": "postProcedureResults",
|
|
136
|
+
"title": "Procedure Report Form",
|
|
137
|
+
"type": "form"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"modals": [
|
|
141
|
+
{
|
|
142
|
+
"name": "print-procedure-report-modal",
|
|
143
|
+
"component": "printProcedureReportModal"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"pages": [
|
|
147
|
+
{
|
|
148
|
+
"component": "root",
|
|
149
|
+
"route": "procedure"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|