@openmrs/esm-dispensing-app 1.0.0-pre.21 → 1.0.0-pre.28
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/dist/24.js +1 -2
- package/dist/294.js +1 -2
- package/dist/296.js +1 -0
- package/dist/299.js +1 -0
- package/dist/382.js +2 -0
- package/dist/{680.js.LICENSE.txt → 382.js.LICENSE.txt} +24 -0
- package/dist/573.js +1 -0
- package/dist/574.js +1 -1
- package/dist/595.js +1 -2
- package/dist/781.js +1 -0
- package/dist/906.js +1 -2
- package/dist/978.js +1 -0
- package/dist/openmrs-esm-dispensing-app.js +1 -1
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +114 -70
- package/dist/openmrs-esm-dispensing-app.old +1 -2
- package/package.json +9 -5
- package/src/components/history-and-comments.component.tsx +30 -0
- package/src/components/history-and-comments.scss +26 -0
- package/src/components/medication-card.component.tsx +44 -0
- package/src/components/medication-card.scss +26 -0
- package/src/components/order-expanded.component.tsx +53 -0
- package/src/components/order-expanded.scss +57 -0
- package/src/components/patient-details.component.tsx +106 -0
- package/src/components/patient-details.scss +105 -0
- package/src/components/prescription-details.component.tsx +47 -0
- package/src/components/prescription-details.scss +56 -0
- package/src/constants.ts +3 -0
- package/src/dispensing-link.tsx +13 -0
- package/src/dispensing-tiles/dispensing-tile.component.tsx +45 -0
- package/src/dispensing-tiles/dispensing-tile.scss +39 -0
- package/src/dispensing-tiles/dispensing-tiles.component.tsx +42 -0
- package/src/dispensing-tiles/dispensing-tiles.resource.tsx +33 -0
- package/src/dispensing-tiles/dispensing-tiles.scss +12 -0
- package/src/dispensing.component.tsx +15 -0
- package/src/dispensing.scss +2 -2
- package/src/dispensing.test.tsx +1 -1
- package/src/index.ts +15 -32
- package/src/{medicationrequest/medicationrequest.resource.tsx → medication-request/medication-request.resource.tsx} +32 -3
- package/src/pharmacy-header/pharmacy-header.scss +2 -0
- package/src/pharmacy-header/pharmacy-illustration.component.tsx +22 -14
- package/src/prescriptions/prescription-tab-lists.component.tsx +139 -0
- package/src/prescriptions/prescriptions.scss +131 -0
- package/src/root.scss +51 -0
- package/src/types.ts +185 -0
- package/src/utils.ts +40 -0
- package/translations/en.json +7 -1
- package/dist/132.js +0 -2
- package/dist/132.js.map +0 -1
- package/dist/24.js.map +0 -1
- package/dist/294.js.map +0 -1
- package/dist/595.js.map +0 -1
- package/dist/613.js +0 -2
- package/dist/613.js.map +0 -1
- package/dist/680.js +0 -3
- package/dist/680.js.map +0 -1
- package/dist/70.js +0 -2
- package/dist/70.js.map +0 -1
- package/dist/906.js.map +0 -1
- package/dist/openmrs-esm-dispensing-app.js.map +0 -1
- package/src/dispensing.tsx +0 -64
package/src/index.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is the entrypoint file of the application. It communicates the
|
|
3
|
-
* important features of this microfrontend to the app shell. It
|
|
4
|
-
* connects the app shell to the React application(s) that make up this
|
|
5
|
-
* microfrontend.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
import { getAsyncLifecycle, defineConfigSchema } from "@openmrs/esm-framework";
|
|
9
2
|
import { configSchema } from "./config-schema";
|
|
10
3
|
|
|
11
|
-
/**
|
|
12
|
-
* This tells the app shell how to obtain translation files: that they
|
|
13
|
-
* are JSON files in the directory `../translations` (which you should
|
|
14
|
-
* see in the directory structure).
|
|
15
|
-
*/
|
|
16
4
|
const importTranslation = require.context(
|
|
17
5
|
"../translations",
|
|
18
6
|
false,
|
|
@@ -20,29 +8,11 @@ const importTranslation = require.context(
|
|
|
20
8
|
"lazy"
|
|
21
9
|
);
|
|
22
10
|
|
|
23
|
-
/**
|
|
24
|
-
* This tells the app shell what versions of what OpenMRS backend modules
|
|
25
|
-
* are expected. Warnings will appear if suitable modules are not
|
|
26
|
-
* installed. The keys are the part of the module name after
|
|
27
|
-
* `openmrs-module-`; e.g., `openmrs-module-fhir2` becomes `fhir2`.
|
|
28
|
-
*/
|
|
29
11
|
const backendDependencies = {
|
|
30
12
|
fhir2: "^1.2.0",
|
|
31
13
|
"webservices.rest": "^2.2.0",
|
|
32
14
|
};
|
|
33
15
|
|
|
34
|
-
/**
|
|
35
|
-
* This function performs any setup that should happen at microfrontend
|
|
36
|
-
* load-time (such as defining the config schema) and then returns an
|
|
37
|
-
* object which describes how the React application(s) should be
|
|
38
|
-
* rendered.
|
|
39
|
-
*
|
|
40
|
-
* In this example, our return object contains a single page definition.
|
|
41
|
-
* It tells the app shell that the default export of `greeter.tsx`
|
|
42
|
-
* should be rendered when the route matches `hello`. The full route
|
|
43
|
-
* will be `openmrsSpaBase() + 'hello'`, which is usually
|
|
44
|
-
* `/openmrs/spa/hello`.
|
|
45
|
-
*/
|
|
46
16
|
function setupOpenMRS() {
|
|
47
17
|
const moduleName = "@openmrs/esm-dispensing-app";
|
|
48
18
|
|
|
@@ -56,11 +26,24 @@ function setupOpenMRS() {
|
|
|
56
26
|
return {
|
|
57
27
|
pages: [
|
|
58
28
|
{
|
|
59
|
-
load: getAsyncLifecycle(() => import("./dispensing"), options),
|
|
60
29
|
route: "dispensing",
|
|
30
|
+
load: getAsyncLifecycle(
|
|
31
|
+
() => import("./dispensing.component"),
|
|
32
|
+
options
|
|
33
|
+
),
|
|
34
|
+
online: true,
|
|
35
|
+
offline: true,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
extensions: [
|
|
39
|
+
{
|
|
40
|
+
id: "appointments-link",
|
|
41
|
+
slot: "app-menu-slot",
|
|
42
|
+
load: getAsyncLifecycle(() => import("./dispensing-link"), options),
|
|
43
|
+
online: true,
|
|
44
|
+
offline: false,
|
|
61
45
|
},
|
|
62
46
|
],
|
|
63
|
-
extensions: [],
|
|
64
47
|
};
|
|
65
48
|
}
|
|
66
49
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import useSWR from "swr";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
fhirBaseUrl,
|
|
4
|
+
openmrsFetch,
|
|
5
|
+
openmrsObservableFetch,
|
|
6
|
+
} from "@openmrs/esm-framework";
|
|
7
|
+
import { MedicationRequest, MedicationRequestResponse } from "../types";
|
|
3
8
|
|
|
4
9
|
export type Order = {
|
|
5
10
|
id: string;
|
|
@@ -9,6 +14,7 @@ export type Order = {
|
|
|
9
14
|
drugs: string;
|
|
10
15
|
lastDispenser: string;
|
|
11
16
|
status: string;
|
|
17
|
+
patientUuid: string;
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
interface FHIRMedicationRequestResponse {
|
|
@@ -20,7 +26,6 @@ interface FHIRMedicationRequestResponse {
|
|
|
20
26
|
type: string;
|
|
21
27
|
total: number;
|
|
22
28
|
entry: Array<{
|
|
23
|
-
// Todo: split this into a union type. Possibly just use the types `fhir.Encounter` and `fhir.MedicationRequest`.
|
|
24
29
|
resource: FHIREncounterOrder;
|
|
25
30
|
}>;
|
|
26
31
|
}
|
|
@@ -55,7 +60,7 @@ interface FHIREncounterOrder {
|
|
|
55
60
|
|
|
56
61
|
export function useOrders() {
|
|
57
62
|
const url =
|
|
58
|
-
"/ws/fhir2/R4/Encounter?_revinclude=MedicationRequest:encounter&_has:MedicationRequest:encounter:intent=order&_tag=http%3A%2F%2Ffhir.openmrs.org%2Fext%2Fencounter-tag%7Cencounter";
|
|
63
|
+
"/ws/fhir2/R4/Encounter?_count=10&_revinclude=MedicationRequest:encounter&_has:MedicationRequest:encounter:intent=order&_tag=http%3A%2F%2Ffhir.openmrs.org%2Fext%2Fencounter-tag%7Cencounter";
|
|
59
64
|
const { data, error } = useSWR<
|
|
60
65
|
{ data: FHIRMedicationRequestResponse },
|
|
61
66
|
Error
|
|
@@ -109,9 +114,33 @@ function buildEncounterOrders(
|
|
|
109
114
|
lastDispenser: "tbd",
|
|
110
115
|
prescriber: [...new Set(orders.map((o) => o.requester.display))].join(", "),
|
|
111
116
|
status: computeStatus(orders.map((o) => o.status)),
|
|
117
|
+
patientUuid: encounter?.subject?.reference?.split("/")[1],
|
|
112
118
|
};
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
function computeStatus(orderStatuses: Array<string>) {
|
|
116
122
|
return orderStatuses.filter((s) => s)[0];
|
|
117
123
|
}
|
|
124
|
+
|
|
125
|
+
export function useOrderDetails(encounterUuid: string) {
|
|
126
|
+
let medications = null;
|
|
127
|
+
const { data, error } = useSWR<{ data: MedicationRequestResponse }, Error>(
|
|
128
|
+
`${fhirBaseUrl}/MedicationRequest?encounter=${encounterUuid}`,
|
|
129
|
+
openmrsFetch
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
if (data) {
|
|
133
|
+
const orders = data?.data.entry;
|
|
134
|
+
medications = orders?.map((order) => {
|
|
135
|
+
return order.resource;
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
medications = [];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
medications,
|
|
143
|
+
isError: error,
|
|
144
|
+
isLoading: !medications && !error,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
border: 1px solid $ui-03;
|
|
11
11
|
border-left: 0px;
|
|
12
12
|
display: flex;
|
|
13
|
+
padding-left: 8px;
|
|
13
14
|
justify-content: space-between;
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
.page-labels {
|
|
35
|
+
margin-left: 8px;
|
|
34
36
|
p:first-of-type {
|
|
35
37
|
margin-bottom: 0.25rem;
|
|
36
38
|
}
|
|
@@ -3,22 +3,30 @@ import React from "react";
|
|
|
3
3
|
const PharmacyIllustration: React.FC = () => {
|
|
4
4
|
return (
|
|
5
5
|
<svg
|
|
6
|
-
width="
|
|
7
|
-
height="
|
|
8
|
-
viewBox="0 0
|
|
6
|
+
width="62"
|
|
7
|
+
height="58"
|
|
8
|
+
viewBox="0 0 62 58"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<path
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
<defs>
|
|
12
|
+
<path id="whv9q6f4ta" d="M0 0h62v30.508H0z" />
|
|
13
|
+
<path id="hp71ojgcnc" d="M0 0h24.603v26.571H0z" />
|
|
14
|
+
</defs>
|
|
15
|
+
<g fill="none">
|
|
16
|
+
<g opacity=".193" transform="matrix(-1 0 0 1 62 26.571)">
|
|
17
|
+
<path
|
|
18
|
+
d="M62 0c0 16.85-13.916 30.508-31.037 30.508S0 16.849 0 0h62z"
|
|
19
|
+
fill="#007D79"
|
|
20
|
+
mask="url(#rt0c8mo6eb)"
|
|
21
|
+
/>
|
|
22
|
+
</g>
|
|
23
|
+
<g opacity=".396" transform="matrix(-1 0 0 1 60.032 0)">
|
|
24
|
+
<path
|
|
25
|
+
d="m24.603 26.571-13.35-23.51C9.592.141 5.884-.869 3.011.817.138 2.503-.855 6.272.804 9.193l9.874 17.378"
|
|
26
|
+
fill="#007D79"
|
|
27
|
+
mask="url(#hgianthqwd)"
|
|
28
|
+
/>
|
|
29
|
+
</g>
|
|
22
30
|
</g>
|
|
23
31
|
</svg>
|
|
24
32
|
);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { ReactNode, useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
DataTable,
|
|
4
|
+
DataTableSkeleton,
|
|
5
|
+
Tab,
|
|
6
|
+
Table,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
TableContainer,
|
|
10
|
+
TableExpandedRow,
|
|
11
|
+
TableExpandHeader,
|
|
12
|
+
TableExpandRow,
|
|
13
|
+
TableHead,
|
|
14
|
+
TableHeader,
|
|
15
|
+
TableRow,
|
|
16
|
+
Tabs,
|
|
17
|
+
} from "carbon-components-react";
|
|
18
|
+
import { useTranslation } from "react-i18next";
|
|
19
|
+
import styles from "./prescriptions.scss";
|
|
20
|
+
import {
|
|
21
|
+
Order,
|
|
22
|
+
useOrders,
|
|
23
|
+
} from "../medication-request/medication-request.resource";
|
|
24
|
+
import OrderExpanded from "../components/order-expanded.component";
|
|
25
|
+
|
|
26
|
+
enum TabTypes {
|
|
27
|
+
STARRED,
|
|
28
|
+
SYSTEM,
|
|
29
|
+
USER,
|
|
30
|
+
ALL,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const labelMap = [
|
|
34
|
+
"All prescriptions",
|
|
35
|
+
"Active prescriptions",
|
|
36
|
+
"Complete",
|
|
37
|
+
"Returned",
|
|
38
|
+
"Cancelled",
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
function createLabels() {
|
|
42
|
+
const res: Array<ReactNode> = [];
|
|
43
|
+
|
|
44
|
+
for (let index = 0; index < Object.keys(labelMap).length; index++) {
|
|
45
|
+
res.push(<Tab label={labelMap[index]} key={index} id={"tab-" + index} />);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const columns = [
|
|
52
|
+
{ header: "Created", key: "created" },
|
|
53
|
+
{ header: "Patient name", key: "patientName" },
|
|
54
|
+
{ header: "Prescriber", key: "prescriber" },
|
|
55
|
+
{ header: "Drugs", key: "drugs" },
|
|
56
|
+
{ header: "Last dispenser", key: "lastDispenser" },
|
|
57
|
+
{ header: "Status", key: "status" },
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const PrescriptionTabLists: React.FC = () => {
|
|
61
|
+
const { t } = useTranslation();
|
|
62
|
+
const [selectedTab, setSelectedTab] = useState(TabTypes.STARRED);
|
|
63
|
+
const { orders, isError, isLoading } = useOrders();
|
|
64
|
+
const encounterToPatientMap = {};
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (orders?.length > 0) {
|
|
68
|
+
orders.map((order: Order) => {
|
|
69
|
+
encounterToPatientMap[order.id] = order.patientUuid;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, [orders]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<main className={`omrs-main-content ${styles.prescriptionListContainer}`}>
|
|
76
|
+
<section className={styles.prescriptionTabsContainer}>
|
|
77
|
+
<Tabs
|
|
78
|
+
className={styles.tabs}
|
|
79
|
+
type="container"
|
|
80
|
+
tabContentClassName={styles.hiddenTabsContent}
|
|
81
|
+
onSelectionChange={setSelectedTab}
|
|
82
|
+
>
|
|
83
|
+
{createLabels()}
|
|
84
|
+
</Tabs>
|
|
85
|
+
<div className={styles.patientListTableContainer}>
|
|
86
|
+
{isLoading && <DataTableSkeleton role="progressbar" />}
|
|
87
|
+
{isError && <p>Error</p>}
|
|
88
|
+
{orders && (
|
|
89
|
+
<DataTable rows={orders} headers={columns} isSortable>
|
|
90
|
+
{({
|
|
91
|
+
rows,
|
|
92
|
+
headers,
|
|
93
|
+
getHeaderProps,
|
|
94
|
+
getRowProps,
|
|
95
|
+
getTableProps,
|
|
96
|
+
}) => (
|
|
97
|
+
<TableContainer>
|
|
98
|
+
<Table {...getTableProps()}>
|
|
99
|
+
<TableHead>
|
|
100
|
+
<TableRow>
|
|
101
|
+
<TableExpandHeader />
|
|
102
|
+
{headers.map((header) => (
|
|
103
|
+
<TableHeader {...getHeaderProps({ header })}>
|
|
104
|
+
{header.header}
|
|
105
|
+
</TableHeader>
|
|
106
|
+
))}
|
|
107
|
+
</TableRow>
|
|
108
|
+
</TableHead>
|
|
109
|
+
<TableBody>
|
|
110
|
+
{rows.map((row) => (
|
|
111
|
+
<React.Fragment key={row.id}>
|
|
112
|
+
<TableExpandRow {...getRowProps({ row })}>
|
|
113
|
+
{row.cells.map((cell) => (
|
|
114
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
115
|
+
))}
|
|
116
|
+
</TableExpandRow>
|
|
117
|
+
{row.isExpanded && (
|
|
118
|
+
<TableExpandedRow colSpan={headers.length + 1}>
|
|
119
|
+
<OrderExpanded
|
|
120
|
+
encounterUuid={row.id}
|
|
121
|
+
patientUuid={encounterToPatientMap[row.id]}
|
|
122
|
+
/>
|
|
123
|
+
</TableExpandedRow>
|
|
124
|
+
)}
|
|
125
|
+
</React.Fragment>
|
|
126
|
+
))}
|
|
127
|
+
</TableBody>
|
|
128
|
+
</Table>
|
|
129
|
+
</TableContainer>
|
|
130
|
+
)}
|
|
131
|
+
</DataTable>
|
|
132
|
+
)}
|
|
133
|
+
</div>
|
|
134
|
+
</section>
|
|
135
|
+
</main>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export default PrescriptionTabLists;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
@import '../root.scss';
|
|
2
|
+
|
|
3
|
+
title {
|
|
4
|
+
width: 6.938rem;
|
|
5
|
+
height: 1.75rem;
|
|
6
|
+
margin: 0.438rem 22.875rem 0.813rem 0;
|
|
7
|
+
font-family: IBMPlexSans;
|
|
8
|
+
font-size: 1.25rem;
|
|
9
|
+
font-weight: normal;
|
|
10
|
+
font-stretch: normal;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
line-height: 1.4;
|
|
13
|
+
letter-spacing: normal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.link {
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.prescriptionListContainer {
|
|
21
|
+
display: flex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.breadcrumbsSlot {
|
|
25
|
+
grid-row: 1 / 2;
|
|
26
|
+
grid-column: 1 / 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.prescriptionTabsContainer {
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
background-color: $ui-02;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.patientListHeader {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
margin-left: $spacing-05;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.newListButton {
|
|
43
|
+
width: fit-content;
|
|
44
|
+
justify-self: end;
|
|
45
|
+
align-self: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.tabs {
|
|
49
|
+
grid-column: 'span 2';
|
|
50
|
+
padding: 0 $spacing-05;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.hiddenTabsContent, .tabs .hiddenTabsContent {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.patientListTableContainer {
|
|
58
|
+
grid-row: 3 / 4;
|
|
59
|
+
grid-column: 1 / 2;
|
|
60
|
+
height: 100%;
|
|
61
|
+
padding: $spacing-05;
|
|
62
|
+
background-color: $ui-01;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Patient List Table
|
|
66
|
+
|
|
67
|
+
.searchContainer {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-columns: 1fr 1fr;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.searchContainer > div {
|
|
74
|
+
align-self: center;
|
|
75
|
+
justify-self: flex-end;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.search {
|
|
79
|
+
width: 100%;
|
|
80
|
+
max-width: 16rem;
|
|
81
|
+
background-color: $ui-02;
|
|
82
|
+
border-bottom-color: $ui-03;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tableBody {
|
|
86
|
+
background-color: $ui-01;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tableCell, .interactiveText01 {
|
|
90
|
+
color: $interactive-01;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.desktopRow, .desktopHeader {
|
|
94
|
+
height: $spacing-07 !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tabletRow, .tabletHeader {
|
|
98
|
+
height: $spacing-09 !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Search Overlay
|
|
102
|
+
|
|
103
|
+
.searchOverlay {
|
|
104
|
+
z-index: 1;
|
|
105
|
+
grid-row: 2 / 4;
|
|
106
|
+
grid-column: 1 / 2;
|
|
107
|
+
background-color: $ui-04;
|
|
108
|
+
opacity: 0.7;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.patientListResultsContainer {
|
|
112
|
+
z-index: 1;
|
|
113
|
+
grid-row: 2 / 4;
|
|
114
|
+
grid-column: 1 / 2;
|
|
115
|
+
background-color: $ui-01;
|
|
116
|
+
padding: $spacing-05;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Results Overlay
|
|
120
|
+
|
|
121
|
+
.resultCount {
|
|
122
|
+
@include carbon--type-style('body-short-01');
|
|
123
|
+
color: $text-02;
|
|
124
|
+
border-bottom: solid 1px #e0e0e0;
|
|
125
|
+
padding: $spacing-04 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.patientListResultsTableContainer {
|
|
129
|
+
margin: $spacing-03;
|
|
130
|
+
}
|
|
131
|
+
|
package/src/root.scss
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@import "~carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/type/styles";
|
|
2
|
+
@import "~carbon-components/src/globals/scss/vendor/@carbon/layout/scss/generated/spacing";
|
|
3
|
+
@import "carbon-components/scss/globals/scss/typography.scss";
|
|
4
|
+
@import "~@openmrs/esm-styleguide/src/vars";
|
|
5
|
+
|
|
6
|
+
.productiveHeading01 {
|
|
7
|
+
@include carbon--type-style("productive-heading-01");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.productiveHeading02 {
|
|
11
|
+
@include carbon--type-style("productive-heading-02");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.productiveHeading03 {
|
|
15
|
+
@include carbon--type-style("productive-heading-03");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.productiveHeading04 {
|
|
19
|
+
@include carbon--type-style("productive-heading-04");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bodyLong01 {
|
|
23
|
+
@include carbon--type-style("body-long-01");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.bodyShort01 {
|
|
27
|
+
@include carbon--type-style("body-short-01");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bodyShort02 {
|
|
31
|
+
@include carbon--type-style("body-short-02");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.text02 {
|
|
35
|
+
color: $text-02;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.label01 {
|
|
39
|
+
@include carbon--type-style("label-01")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.modal {
|
|
43
|
+
position: fixed;
|
|
44
|
+
width: 100vw;
|
|
45
|
+
height: 100vh;
|
|
46
|
+
display: grid;
|
|
47
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
48
|
+
z-index: 9000;
|
|
49
|
+
justify-items: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { OpenmrsResource } from "@openmrs/esm-api";
|
|
2
|
+
|
|
3
|
+
export interface DrugOrders {
|
|
4
|
+
id: string;
|
|
5
|
+
display: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Order {
|
|
10
|
+
uuid: string;
|
|
11
|
+
action: string;
|
|
12
|
+
asNeeded: boolean;
|
|
13
|
+
asNeededCondition?: string;
|
|
14
|
+
autoExpireDate: Date;
|
|
15
|
+
brandName?: string;
|
|
16
|
+
careSetting: OpenmrsResource;
|
|
17
|
+
commentToFulfiller: string;
|
|
18
|
+
dateActivated: Date;
|
|
19
|
+
dateStopped?: Date | null;
|
|
20
|
+
dispenseAsWritten: boolean;
|
|
21
|
+
dose: number;
|
|
22
|
+
doseUnits: OpenmrsResource;
|
|
23
|
+
dosingInstructions: string | null;
|
|
24
|
+
dosingType?:
|
|
25
|
+
| "org.openmrs.FreeTextDosingInstructions"
|
|
26
|
+
| "org.openmrs.SimpleDosingInstructions";
|
|
27
|
+
drug: Drug;
|
|
28
|
+
duration: number;
|
|
29
|
+
durationUnits: OpenmrsResource;
|
|
30
|
+
encounter: OpenmrsResource;
|
|
31
|
+
frequency: OpenmrsResource;
|
|
32
|
+
instructions?: string | null;
|
|
33
|
+
numRefills: number;
|
|
34
|
+
orderNumber: string;
|
|
35
|
+
orderReason: string | null;
|
|
36
|
+
orderReasonNonCoded: string | null;
|
|
37
|
+
orderType: {
|
|
38
|
+
conceptClasses: Array<any>;
|
|
39
|
+
description: string;
|
|
40
|
+
display: string;
|
|
41
|
+
name: string;
|
|
42
|
+
parent: string | null;
|
|
43
|
+
retired: boolean;
|
|
44
|
+
uuid: string;
|
|
45
|
+
};
|
|
46
|
+
orderer: {
|
|
47
|
+
display: string;
|
|
48
|
+
person: {
|
|
49
|
+
display: string;
|
|
50
|
+
};
|
|
51
|
+
uuid: string;
|
|
52
|
+
};
|
|
53
|
+
patient: OpenmrsResource;
|
|
54
|
+
previousOrder: { uuid: string; type: string; display: string } | null;
|
|
55
|
+
quantity: number;
|
|
56
|
+
quantityUnits: OpenmrsResource;
|
|
57
|
+
route: OpenmrsResource;
|
|
58
|
+
scheduleDate: null;
|
|
59
|
+
urgency: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface Drug {
|
|
63
|
+
uuid: string;
|
|
64
|
+
name: string;
|
|
65
|
+
strength: string;
|
|
66
|
+
concept: OpenmrsResource;
|
|
67
|
+
dosageForm: OpenmrsResource;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface Patient {
|
|
71
|
+
uuid: string;
|
|
72
|
+
display: string;
|
|
73
|
+
identifiers: Array<any>;
|
|
74
|
+
person: Person;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface Person {
|
|
78
|
+
age: number;
|
|
79
|
+
attributes: Array<Attribute>;
|
|
80
|
+
birthDate: string;
|
|
81
|
+
gender: string;
|
|
82
|
+
display: string;
|
|
83
|
+
preferredAddress: OpenmrsResource;
|
|
84
|
+
uuid: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface Attribute {
|
|
88
|
+
attributeType: OpenmrsResource;
|
|
89
|
+
display: string;
|
|
90
|
+
uuid: string;
|
|
91
|
+
value: string | number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface MedicationRequestResponse {
|
|
95
|
+
resourceType: string;
|
|
96
|
+
id: string;
|
|
97
|
+
meta: {
|
|
98
|
+
lastUpdated: string;
|
|
99
|
+
};
|
|
100
|
+
type: string;
|
|
101
|
+
total: number;
|
|
102
|
+
entry: Array<{
|
|
103
|
+
resource: MedicationRequest;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface MedicationRequest {
|
|
108
|
+
resourceType: string;
|
|
109
|
+
id: string;
|
|
110
|
+
meta: {
|
|
111
|
+
lastUpdated: string;
|
|
112
|
+
};
|
|
113
|
+
status: string;
|
|
114
|
+
intent: string;
|
|
115
|
+
priority: string;
|
|
116
|
+
medicationReference: {
|
|
117
|
+
reference: string;
|
|
118
|
+
type: string;
|
|
119
|
+
display: string;
|
|
120
|
+
};
|
|
121
|
+
subject: {
|
|
122
|
+
reference: string;
|
|
123
|
+
type: string;
|
|
124
|
+
display: string;
|
|
125
|
+
};
|
|
126
|
+
encounter: {
|
|
127
|
+
reference: string;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
requester: {
|
|
131
|
+
reference: string;
|
|
132
|
+
type: string;
|
|
133
|
+
identifier: {
|
|
134
|
+
value: string;
|
|
135
|
+
};
|
|
136
|
+
display: string;
|
|
137
|
+
};
|
|
138
|
+
dosageInstruction: Array<DosageInstruction>;
|
|
139
|
+
dispenseRequest: {
|
|
140
|
+
numberOfRepeatsAllowed: number;
|
|
141
|
+
quantity: {
|
|
142
|
+
value: number;
|
|
143
|
+
unit: string;
|
|
144
|
+
code: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface DosageInstruction {
|
|
150
|
+
text: string;
|
|
151
|
+
timing: {
|
|
152
|
+
repeat: {
|
|
153
|
+
duration: number;
|
|
154
|
+
durationUnit: string;
|
|
155
|
+
};
|
|
156
|
+
code: {
|
|
157
|
+
coding: [
|
|
158
|
+
{
|
|
159
|
+
code: string;
|
|
160
|
+
display: string;
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
text: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
asNeededBoolean: boolean;
|
|
167
|
+
route: {
|
|
168
|
+
coding: [
|
|
169
|
+
{
|
|
170
|
+
code: string;
|
|
171
|
+
display: string;
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
text: string;
|
|
175
|
+
};
|
|
176
|
+
doseAndRate: [
|
|
177
|
+
{
|
|
178
|
+
doseQuantity: {
|
|
179
|
+
value: number;
|
|
180
|
+
unit: string;
|
|
181
|
+
code: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
}
|