@ampath/esm-dispensing-app 1.10.0-next.1
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +80 -0
- package/.husky/pre-commit +7 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +12 -0
- package/.tx/config +11 -0
- package/.yarn/versions/1c40b9b6.yml +0 -0
- package/.yarn/versions/ff162597.yml +0 -0
- package/LICENSE +401 -0
- package/README.md +124 -0
- package/__mocks__/react-i18next.js +51 -0
- package/dist/1043.js +1 -0
- package/dist/1043.js.map +1 -0
- package/dist/1119.js +1 -0
- package/dist/1197.js +1 -0
- package/dist/2146.js +1 -0
- package/dist/2177.js +2 -0
- package/dist/2177.js.LICENSE.txt +9 -0
- package/dist/2177.js.map +1 -0
- package/dist/2690.js +1 -0
- package/dist/2890.js +2 -0
- package/dist/2890.js.LICENSE.txt +14 -0
- package/dist/2890.js.map +1 -0
- package/dist/2898.js +1 -0
- package/dist/2898.js.map +1 -0
- package/dist/3041.js +1 -0
- package/dist/3041.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3184.js +2 -0
- package/dist/3184.js.LICENSE.txt +14 -0
- package/dist/3184.js.map +1 -0
- package/dist/3568.js +1 -0
- package/dist/3568.js.map +1 -0
- package/dist/3584.js +1 -0
- package/dist/4055.js +1 -0
- package/dist/4099.js +1 -0
- package/dist/4099.js.map +1 -0
- package/dist/4132.js +1 -0
- package/dist/4225.js +1 -0
- package/dist/4225.js.map +1 -0
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4353.js +1 -0
- package/dist/4353.js.map +1 -0
- package/dist/439.js +1 -0
- package/dist/4618.js +1 -0
- package/dist/4652.js +1 -0
- package/dist/4944.js +1 -0
- package/dist/5173.js +1 -0
- package/dist/5241.js +1 -0
- package/dist/5422.js +1 -0
- package/dist/5422.js.map +1 -0
- package/dist/5442.js +1 -0
- package/dist/5661.js +1 -0
- package/dist/5897.js +1 -0
- package/dist/5897.js.map +1 -0
- package/dist/6022.js +1 -0
- package/dist/609.js +1 -0
- package/dist/609.js.map +1 -0
- package/dist/6468.js +1 -0
- package/dist/6540.js +2 -0
- package/dist/6540.js.LICENSE.txt +9 -0
- package/dist/6540.js.map +1 -0
- package/dist/6589.js +1 -0
- package/dist/6606.js +1 -0
- package/dist/6606.js.map +1 -0
- package/dist/6679.js +1 -0
- package/dist/6825.js +1 -0
- package/dist/6825.js.map +1 -0
- package/dist/6840.js +1 -0
- package/dist/6841.js +1 -0
- package/dist/6841.js.map +1 -0
- package/dist/6859.js +1 -0
- package/dist/7097.js +1 -0
- package/dist/7159.js +1 -0
- package/dist/723.js +1 -0
- package/dist/7240.js +1 -0
- package/dist/7240.js.map +1 -0
- package/dist/7255.js +1 -0
- package/dist/7255.js.map +1 -0
- package/dist/7617.js +1 -0
- package/dist/795.js +1 -0
- package/dist/8163.js +1 -0
- package/dist/8349.js +1 -0
- package/dist/8371.js +1 -0
- package/dist/8569.js +2 -0
- package/dist/8569.js.LICENSE.txt +41 -0
- package/dist/8569.js.map +1 -0
- package/dist/8600.js +1 -0
- package/dist/8600.js.map +1 -0
- package/dist/8618.js +1 -0
- package/dist/8885.js +1 -0
- package/dist/8885.js.map +1 -0
- package/dist/890.js +1 -0
- package/dist/9214.js +1 -0
- package/dist/9538.js +1 -0
- package/dist/9569.js +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/963.js +1 -0
- package/dist/963.js.map +1 -0
- package/dist/986.js +1 -0
- package/dist/9879.js +1 -0
- package/dist/9895.js +1 -0
- package/dist/9900.js +1 -0
- package/dist/9913.js +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +51 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-dispensing-app.js +1 -0
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +1645 -0
- package/dist/openmrs-esm-dispensing-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/e2e/README.md +119 -0
- package/e2e/commands/drug-order-operations.ts +43 -0
- package/e2e/commands/encounter-operations.ts +60 -0
- package/e2e/commands/index.ts +5 -0
- package/e2e/commands/patient-operations.ts +109 -0
- package/e2e/commands/provider-operations.ts +9 -0
- package/e2e/commands/types/index.ts +157 -0
- package/e2e/commands/visit-operations.ts +38 -0
- package/e2e/core/global-setup.ts +32 -0
- package/e2e/core/index.ts +1 -0
- package/e2e/core/test.ts +31 -0
- package/e2e/fixtures/api.ts +27 -0
- package/e2e/fixtures/index.ts +1 -0
- package/e2e/pages/dispensing-page.ts +9 -0
- package/e2e/pages/index.ts +1 -0
- package/e2e/specs/active-prescriptions.spec.ts +72 -0
- package/e2e/specs/close-prescription.spec.ts +71 -0
- package/e2e/specs/dispense-medication.spec.ts +71 -0
- package/e2e/specs/pause-prescription.spec.ts +72 -0
- package/e2e/support/github/Dockerfile +34 -0
- package/e2e/support/github/docker-compose.yml +24 -0
- package/e2e/support/github/run-e2e-docker-env.sh +42 -0
- package/e2e/types/index.ts +157 -0
- package/example.env +7 -0
- package/jest.config.js +24 -0
- package/package.json +110 -0
- package/playwright.config.ts +36 -0
- package/prettier.config.js +8 -0
- package/src/components/action-buttons.component.tsx +87 -0
- package/src/components/action-buttons.scss +16 -0
- package/src/components/action-buttons.test.tsx +217 -0
- package/src/components/medication-card.component.tsx +37 -0
- package/src/components/medication-card.scss +20 -0
- package/src/components/medication-card.test.tsx +36 -0
- package/src/components/medication-dispense-review.scss +108 -0
- package/src/components/medication-event.component.tsx +96 -0
- package/src/components/medication-event.scss +44 -0
- package/src/components/medication-event.test.tsx +212 -0
- package/src/components/prescription-actions/close-action-button.component.tsx +50 -0
- package/src/components/prescription-actions/dispense-action-button.component.tsx +57 -0
- package/src/components/prescription-actions/pause-action-button.component.tsx +49 -0
- package/src/conditions/conditions.component.tsx +118 -0
- package/src/conditions/conditions.resource.ts +100 -0
- package/src/conditions/conditions.scss +26 -0
- package/src/conditions/conditions.test.tsx +200 -0
- package/src/config-schema.ts +192 -0
- package/src/constants.ts +22 -0
- package/src/dashboard/dispensing-dashboard-link.component.tsx +36 -0
- package/src/dashboard/dispensing-dashboard.component.tsx +36 -0
- package/src/declarations.d.ts +2 -0
- package/src/diagnoses/diagnoses.component.tsx +111 -0
- package/src/diagnoses/diagnoses.resource.ts +30 -0
- package/src/diagnoses/diagnoses.scss +31 -0
- package/src/dispensing-link.component.tsx +9 -0
- package/src/dispensing-tiles/dispensing-tile.component.tsx +42 -0
- package/src/dispensing-tiles/dispensing-tile.scss +43 -0
- package/src/dispensing-tiles/dispensing-tiles.component.tsx +39 -0
- package/src/dispensing-tiles/dispensing-tiles.resource.tsx +30 -0
- package/src/dispensing-tiles/dispensing-tiles.scss +11 -0
- package/src/dispensing.component.tsx +31 -0
- package/src/dispensing.scss +5 -0
- package/src/dispensing.test.tsx +9 -0
- package/src/fill-prescription/fill-prescription-button.component.tsx +103 -0
- package/src/fill-prescription/fill-prescription-button.scss +8 -0
- package/src/fill-prescription/on-prescription-filled.modal.tsx +140 -0
- package/src/fill-prescription/on-prescription-filled.scss +7 -0
- package/src/forms/close-dispense-form.workspace.tsx +194 -0
- package/src/forms/dispense-form.workspace.test.tsx +334 -0
- package/src/forms/dispense-form.workspace.tsx +324 -0
- package/src/forms/forms.scss +152 -0
- package/src/forms/medication-dispense-review.component.tsx +649 -0
- package/src/forms/medication-dispense-review.test.tsx +158 -0
- package/src/forms/pause-dispense-form.workspace.tsx +196 -0
- package/src/forms/stock-dispense/stock-dispense.component.tsx +126 -0
- package/src/forms/stock-dispense/stock.resource.tsx +67 -0
- package/src/history/delete-confirm.modal.tsx +35 -0
- package/src/history/history-and-comments.component.tsx +338 -0
- package/src/history/history-and-comments.scss +54 -0
- package/src/index.ts +57 -0
- package/src/location/location.resource.test.tsx +108 -0
- package/src/location/location.resource.tsx +32 -0
- package/src/medication/medication.resource.test.tsx +156 -0
- package/src/medication/medication.resource.tsx +45 -0
- package/src/medication-dispense/medication-dispense.resource.test.tsx +243 -0
- package/src/medication-dispense/medication-dispense.resource.tsx +178 -0
- package/src/medication-request/medication-request.resource.test.tsx +1333 -0
- package/src/medication-request/medication-request.resource.tsx +257 -0
- package/src/patient/patient-info-cell.component.tsx +26 -0
- package/src/patient/patient.resources.ts +14 -0
- package/src/pharmacy-header/pharmacy-header.component.tsx +35 -0
- package/src/pharmacy-header/pharmacy-header.scss +55 -0
- package/src/pharmacy-header/pharmacy-illustration.component.tsx +30 -0
- package/src/prescriptions/patient-search-tab-panel.component.tsx +58 -0
- package/src/prescriptions/patient-search-tab-panel.scss +26 -0
- package/src/prescriptions/prescription-actions.component.tsx +24 -0
- package/src/prescriptions/prescription-actions.scss +14 -0
- package/src/prescriptions/prescription-details.component.tsx +152 -0
- package/src/prescriptions/prescription-details.scss +87 -0
- package/src/prescriptions/prescription-details.test.tsx +267 -0
- package/src/prescriptions/prescription-expanded.component.tsx +58 -0
- package/src/prescriptions/prescription-expanded.scss +56 -0
- package/src/prescriptions/prescription-tab-lists.component.tsx +70 -0
- package/src/prescriptions/prescription-tab-panel.component.tsx +83 -0
- package/src/prescriptions/prescriptions-table.component.tsx +189 -0
- package/src/prescriptions/prescriptions.scss +152 -0
- package/src/print-prescription/prescription-print-action.component.tsx +30 -0
- package/src/print-prescription/prescription-print-preview.modal.tsx +92 -0
- package/src/print-prescription/prescription-printout.component.tsx +154 -0
- package/src/print-prescription/print-prescription.scss +75 -0
- package/src/print-prescription/printable-prescriptions.component.tsx +57 -0
- package/src/routes.json +137 -0
- package/src/types.ts +530 -0
- package/src/utils.test.ts +2947 -0
- package/src/utils.ts +637 -0
- package/tools/i18next-parser.config.js +89 -0
- package/tools/setup-tests.ts +8 -0
- package/tools/update-openmrs-deps.mjs +42 -0
- package/translations/am.json +133 -0
- package/translations/ar.json +133 -0
- package/translations/ar_SY.json +133 -0
- package/translations/bn.json +133 -0
- package/translations/cs.json +133 -0
- package/translations/de.json +133 -0
- package/translations/en.json +133 -0
- package/translations/en_US.json +133 -0
- package/translations/es.json +133 -0
- package/translations/es_MX.json +133 -0
- package/translations/fr.json +133 -0
- package/translations/he.json +133 -0
- package/translations/hi.json +133 -0
- package/translations/hi_IN.json +133 -0
- package/translations/id.json +133 -0
- package/translations/it.json +133 -0
- package/translations/ka.json +133 -0
- package/translations/km.json +133 -0
- package/translations/ku.json +133 -0
- package/translations/ky.json +133 -0
- package/translations/lg.json +133 -0
- package/translations/ne.json +133 -0
- package/translations/pl.json +133 -0
- package/translations/pt.json +133 -0
- package/translations/pt_BR.json +133 -0
- package/translations/qu.json +133 -0
- package/translations/ro_RO.json +133 -0
- package/translations/ru_RU.json +133 -0
- package/translations/si.json +133 -0
- package/translations/sq.json +133 -0
- package/translations/sw.json +133 -0
- package/translations/sw_KE.json +133 -0
- package/translations/tr.json +133 -0
- package/translations/tr_TR.json +133 -0
- package/translations/uk.json +133 -0
- package/translations/uz.json +133 -0
- package/translations/uz@Latn.json +133 -0
- package/translations/uz_UZ.json +133 -0
- package/translations/vi.json +133 -0
- package/translations/zh.json +133 -0
- package/translations/zh_CN.json +133 -0
- package/translations/zh_TW.json +133 -0
- package/tsconfig.json +23 -0
- package/turbo.json +41 -0
- package/webpack.config.js +1 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import { type OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export interface AllergyIntolerance {
|
|
4
|
+
resourceType: string;
|
|
5
|
+
id: string;
|
|
6
|
+
meta: {
|
|
7
|
+
lastUpdated: string;
|
|
8
|
+
};
|
|
9
|
+
clinicalStatus: {
|
|
10
|
+
coding: [
|
|
11
|
+
{
|
|
12
|
+
system: string;
|
|
13
|
+
code: string;
|
|
14
|
+
display: string;
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
19
|
+
verificationStatus: {
|
|
20
|
+
coding: [
|
|
21
|
+
{
|
|
22
|
+
system: string;
|
|
23
|
+
code: string;
|
|
24
|
+
display: string;
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
type: string;
|
|
30
|
+
category: Array<string>;
|
|
31
|
+
criticality: string;
|
|
32
|
+
code: {
|
|
33
|
+
coding: [
|
|
34
|
+
{
|
|
35
|
+
code: string;
|
|
36
|
+
display: string;
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
text: string;
|
|
40
|
+
};
|
|
41
|
+
patient: {
|
|
42
|
+
reference: string;
|
|
43
|
+
type: string;
|
|
44
|
+
display: string;
|
|
45
|
+
};
|
|
46
|
+
recordedDate: string;
|
|
47
|
+
recorder: {
|
|
48
|
+
reference: string;
|
|
49
|
+
type: string;
|
|
50
|
+
display: string;
|
|
51
|
+
};
|
|
52
|
+
reaction: [
|
|
53
|
+
{
|
|
54
|
+
substance: {
|
|
55
|
+
coding: [
|
|
56
|
+
{
|
|
57
|
+
code: string;
|
|
58
|
+
display: string;
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
text: string;
|
|
62
|
+
};
|
|
63
|
+
manifestation: [
|
|
64
|
+
{
|
|
65
|
+
coding: [
|
|
66
|
+
{
|
|
67
|
+
code: string;
|
|
68
|
+
display: string;
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
text: string;
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
severity: string;
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface AllergyIntoleranceResponse {
|
|
80
|
+
resourceType: string;
|
|
81
|
+
id: string;
|
|
82
|
+
meta: {
|
|
83
|
+
lastUpdated: string;
|
|
84
|
+
};
|
|
85
|
+
type: string;
|
|
86
|
+
total: number;
|
|
87
|
+
entry: Array<{
|
|
88
|
+
resource: AllergyIntolerance;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface Attribute {
|
|
93
|
+
attributeType: OpenmrsResource;
|
|
94
|
+
display: string;
|
|
95
|
+
uuid: string;
|
|
96
|
+
value: string | number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface CodeableConcept {
|
|
100
|
+
coding?: Coding[];
|
|
101
|
+
text?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface Coding {
|
|
105
|
+
system?: string;
|
|
106
|
+
code: string;
|
|
107
|
+
display?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface CommonConfigProps {
|
|
110
|
+
uuid: string;
|
|
111
|
+
display: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface CustomTab {
|
|
115
|
+
title: string;
|
|
116
|
+
customPrescriptionsTableEndpoint: string;
|
|
117
|
+
associatedLocations: [uuid: string];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface DosageInstruction {
|
|
121
|
+
text?: string;
|
|
122
|
+
timing: {
|
|
123
|
+
repeat?: {
|
|
124
|
+
duration: number;
|
|
125
|
+
durationUnit: string;
|
|
126
|
+
};
|
|
127
|
+
code: {
|
|
128
|
+
coding: Array<Coding>;
|
|
129
|
+
text?: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
asNeededBoolean: boolean;
|
|
133
|
+
route: {
|
|
134
|
+
coding: Array<Coding>;
|
|
135
|
+
text?: string;
|
|
136
|
+
};
|
|
137
|
+
doseAndRate: Array<{
|
|
138
|
+
doseQuantity: Quantity;
|
|
139
|
+
}>;
|
|
140
|
+
additionalInstruction?: Array<CodeableConcept>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface Drug {
|
|
144
|
+
uuid: string;
|
|
145
|
+
name: string;
|
|
146
|
+
strength: string;
|
|
147
|
+
concept: OpenmrsResource;
|
|
148
|
+
dosageForm: OpenmrsResource;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// add more properties, or fine just to keep the ones we are using? is there a global definition of this resource?
|
|
152
|
+
export interface Encounter {
|
|
153
|
+
resourceType: string;
|
|
154
|
+
id: string;
|
|
155
|
+
meta: {
|
|
156
|
+
lastUpdated: string;
|
|
157
|
+
};
|
|
158
|
+
period?: {
|
|
159
|
+
start: string;
|
|
160
|
+
};
|
|
161
|
+
subject?: {
|
|
162
|
+
reference: string;
|
|
163
|
+
display: string;
|
|
164
|
+
};
|
|
165
|
+
location?: [{ location: Reference }];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface EncounterResponse {
|
|
169
|
+
resourceType: string;
|
|
170
|
+
id: string;
|
|
171
|
+
meta: {
|
|
172
|
+
lastUpdated: string;
|
|
173
|
+
};
|
|
174
|
+
type: string;
|
|
175
|
+
total: number;
|
|
176
|
+
entry: Array<{
|
|
177
|
+
resource: Encounter | MedicationRequest | MedicationDispense;
|
|
178
|
+
}>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface Extension {
|
|
182
|
+
url: string;
|
|
183
|
+
valueDateTime?: string;
|
|
184
|
+
valueCode?: MedicationRequestFulfillerStatus; // add other possibilties once we start using other extensions
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface Medication {
|
|
188
|
+
resourceType: string;
|
|
189
|
+
id: string;
|
|
190
|
+
meta: {
|
|
191
|
+
lastUpdated: string;
|
|
192
|
+
};
|
|
193
|
+
extension: [
|
|
194
|
+
{
|
|
195
|
+
url: string;
|
|
196
|
+
extension: [
|
|
197
|
+
{
|
|
198
|
+
url: string;
|
|
199
|
+
valueString: string;
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
code: {
|
|
205
|
+
coding: Coding[];
|
|
206
|
+
text: string;
|
|
207
|
+
};
|
|
208
|
+
status: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface MedicationDispense {
|
|
212
|
+
resourceType: string;
|
|
213
|
+
id?: string;
|
|
214
|
+
meta?: {
|
|
215
|
+
lastUpdated: string;
|
|
216
|
+
};
|
|
217
|
+
extension?: Array<Extension>;
|
|
218
|
+
status: MedicationDispenseStatus;
|
|
219
|
+
statusReasonCodeableConcept?: CodeableConcept;
|
|
220
|
+
authorizingPrescription?: [
|
|
221
|
+
{
|
|
222
|
+
reference: string;
|
|
223
|
+
type: string;
|
|
224
|
+
},
|
|
225
|
+
];
|
|
226
|
+
medicationReference: {
|
|
227
|
+
reference: string;
|
|
228
|
+
type?: string;
|
|
229
|
+
display?: string;
|
|
230
|
+
};
|
|
231
|
+
medicationCodeableConcept?: {
|
|
232
|
+
coding: Coding[];
|
|
233
|
+
text: string;
|
|
234
|
+
};
|
|
235
|
+
subject: {
|
|
236
|
+
reference: string;
|
|
237
|
+
type?: string;
|
|
238
|
+
display?: string;
|
|
239
|
+
};
|
|
240
|
+
performer: Array<{
|
|
241
|
+
actor: {
|
|
242
|
+
reference: string;
|
|
243
|
+
type?: string;
|
|
244
|
+
identifier?: {
|
|
245
|
+
value?: string;
|
|
246
|
+
};
|
|
247
|
+
display?: string;
|
|
248
|
+
};
|
|
249
|
+
}>;
|
|
250
|
+
location: Reference;
|
|
251
|
+
type?: CodeableConcept;
|
|
252
|
+
quantity?: Quantity;
|
|
253
|
+
whenPrepared?: any;
|
|
254
|
+
whenHandedOver?: any;
|
|
255
|
+
dosageInstruction?: Array<DosageInstruction>;
|
|
256
|
+
substitution?: {
|
|
257
|
+
wasSubstituted: boolean;
|
|
258
|
+
reason?: CodeableConcept[];
|
|
259
|
+
type?: CodeableConcept;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export enum MedicationDispenseStatus {
|
|
264
|
+
//in_progress = "in-progress", NOT YET IMPLEMENTED
|
|
265
|
+
on_hold = 'on-hold',
|
|
266
|
+
completed = 'completed',
|
|
267
|
+
declined = 'declined',
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface MedicationFormulationsResponse {
|
|
271
|
+
resourceType: string;
|
|
272
|
+
id: string;
|
|
273
|
+
meta: {
|
|
274
|
+
lastUpdated: string;
|
|
275
|
+
};
|
|
276
|
+
type: string;
|
|
277
|
+
total: number;
|
|
278
|
+
entry: Array<{
|
|
279
|
+
resource: Medication;
|
|
280
|
+
}>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface MedicationRequest {
|
|
284
|
+
resourceType: string;
|
|
285
|
+
id: string;
|
|
286
|
+
meta: {
|
|
287
|
+
lastUpdated: string;
|
|
288
|
+
};
|
|
289
|
+
extension?: Array<Extension>;
|
|
290
|
+
status: MedicationRequestStatus;
|
|
291
|
+
intent: string;
|
|
292
|
+
priority: string;
|
|
293
|
+
medicationReference: {
|
|
294
|
+
reference: string;
|
|
295
|
+
type?: string;
|
|
296
|
+
display?: string;
|
|
297
|
+
};
|
|
298
|
+
medicationCodeableConcept?: {
|
|
299
|
+
coding: Coding[];
|
|
300
|
+
text: string;
|
|
301
|
+
};
|
|
302
|
+
subject: {
|
|
303
|
+
reference: string;
|
|
304
|
+
type?: string;
|
|
305
|
+
display?: string;
|
|
306
|
+
};
|
|
307
|
+
encounter: {
|
|
308
|
+
reference: string;
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
requester: {
|
|
312
|
+
reference: string;
|
|
313
|
+
type: string;
|
|
314
|
+
identifier: {
|
|
315
|
+
value: string;
|
|
316
|
+
};
|
|
317
|
+
display: string;
|
|
318
|
+
};
|
|
319
|
+
dosageInstruction: Array<DosageInstruction>;
|
|
320
|
+
dispenseRequest: {
|
|
321
|
+
numberOfRepeatsAllowed: number;
|
|
322
|
+
quantity: Quantity;
|
|
323
|
+
validityPeriod: {
|
|
324
|
+
start: string;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
authoredOn?: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export interface MedicationRequestResponse {
|
|
331
|
+
resourceType: string;
|
|
332
|
+
id: string;
|
|
333
|
+
meta: {
|
|
334
|
+
lastUpdated: string;
|
|
335
|
+
};
|
|
336
|
+
type: string;
|
|
337
|
+
total: number;
|
|
338
|
+
entry: Array<{
|
|
339
|
+
resource: MedicationRequest | MedicationDispense;
|
|
340
|
+
}>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export enum MedicationRequestStatus {
|
|
344
|
+
active = 'active',
|
|
345
|
+
cancelled = 'cancelled',
|
|
346
|
+
completed = 'completed',
|
|
347
|
+
expired = 'expired',
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* These fulfiller statuses are an OpenMRS defined status (as opposed to FHIR) that we define as upper-case,
|
|
352
|
+
* hence the case difference from the other statuses
|
|
353
|
+
*/
|
|
354
|
+
export enum MedicationRequestFulfillerStatus {
|
|
355
|
+
on_hold = 'ON_HOLD',
|
|
356
|
+
declined = 'DECLINED',
|
|
357
|
+
completed = 'COMPLETED',
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Within the UI, the "status" of a request we want to display to the pharmacist is
|
|
362
|
+
* a combination of the status and fulfiller status; this is the actual status we want to display to the pharmacist (see util method
|
|
363
|
+
* computeMedicationRequestCombinedStatus)
|
|
364
|
+
*/
|
|
365
|
+
export enum MedicationRequestCombinedStatus {
|
|
366
|
+
active = 'active',
|
|
367
|
+
cancelled = 'cancelled',
|
|
368
|
+
completed = 'completed',
|
|
369
|
+
expired = 'expired',
|
|
370
|
+
on_hold = 'on-hold',
|
|
371
|
+
declined = 'declined',
|
|
372
|
+
unknown = 'unknown',
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Convenience object to group a medication request with all it's related medication dispenses
|
|
377
|
+
* Invalid if any of the dispenses point to a different request than the one referenced
|
|
378
|
+
*/
|
|
379
|
+
export interface MedicationRequestBundle {
|
|
380
|
+
request: MedicationRequest;
|
|
381
|
+
dispenses: Array<MedicationDispense>;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface MedicationReferenceOrCodeableConcept {
|
|
385
|
+
medicationReference?: {
|
|
386
|
+
reference: string;
|
|
387
|
+
type?: string;
|
|
388
|
+
display?: string;
|
|
389
|
+
};
|
|
390
|
+
medicationCodeableConcept?: {
|
|
391
|
+
coding: Coding[];
|
|
392
|
+
text: string;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface OrderConfig {
|
|
397
|
+
drugRoutes: Array<CommonConfigProps>;
|
|
398
|
+
drugDosingUnits: Array<CommonConfigProps>;
|
|
399
|
+
drugDispensingUnits: Array<CommonConfigProps>;
|
|
400
|
+
durationUnits: Array<CommonConfigProps>;
|
|
401
|
+
orderFrequencies: Array<CommonConfigProps>;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export interface Patient {
|
|
405
|
+
uuid: string;
|
|
406
|
+
display: string;
|
|
407
|
+
identifiers: Array<any>;
|
|
408
|
+
person: Person;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface Person {
|
|
412
|
+
age: number;
|
|
413
|
+
attributes: Array<Attribute>;
|
|
414
|
+
birthDate: string;
|
|
415
|
+
gender: string;
|
|
416
|
+
display: string;
|
|
417
|
+
preferredAddress: OpenmrsResource;
|
|
418
|
+
uuid: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface Provider {
|
|
422
|
+
uuid: string;
|
|
423
|
+
person: {
|
|
424
|
+
display: string;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface ProviderRequestResponse {
|
|
429
|
+
results: Array<Provider>;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// represents a row in the main table
|
|
433
|
+
export interface PrescriptionsTableRow {
|
|
434
|
+
id: string;
|
|
435
|
+
created: string;
|
|
436
|
+
patient: {
|
|
437
|
+
name: string;
|
|
438
|
+
uuid: string;
|
|
439
|
+
};
|
|
440
|
+
prescriber: string;
|
|
441
|
+
drugs: string;
|
|
442
|
+
lastDispenser: string;
|
|
443
|
+
status: string;
|
|
444
|
+
location: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface Quantity {
|
|
448
|
+
value: number;
|
|
449
|
+
unit?: string;
|
|
450
|
+
code: string;
|
|
451
|
+
system?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface Reference {
|
|
455
|
+
reference: string;
|
|
456
|
+
type?: string;
|
|
457
|
+
display?: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// simple representation of a location
|
|
461
|
+
export interface SimpleLocation {
|
|
462
|
+
id: string;
|
|
463
|
+
name: string;
|
|
464
|
+
associatedPharmacyLocation?: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export interface ValueSet {
|
|
468
|
+
id: string;
|
|
469
|
+
title: string;
|
|
470
|
+
status: string;
|
|
471
|
+
date: string;
|
|
472
|
+
description: string;
|
|
473
|
+
compose: {
|
|
474
|
+
include: [
|
|
475
|
+
{
|
|
476
|
+
system: string;
|
|
477
|
+
concept: [
|
|
478
|
+
{
|
|
479
|
+
code: string;
|
|
480
|
+
display: string;
|
|
481
|
+
},
|
|
482
|
+
];
|
|
483
|
+
},
|
|
484
|
+
];
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export type InventoryItem = {
|
|
489
|
+
partyUuid: string;
|
|
490
|
+
locationUuid: string;
|
|
491
|
+
partyName: string;
|
|
492
|
+
stockItemUuid: string | null;
|
|
493
|
+
drugId: string | null;
|
|
494
|
+
drugUuid: string | null;
|
|
495
|
+
drugStrength: string | null;
|
|
496
|
+
conceptId: string | null;
|
|
497
|
+
conceptUuid: string | null;
|
|
498
|
+
stockBatchUuid: string;
|
|
499
|
+
batchNumber: string;
|
|
500
|
+
quantity: number;
|
|
501
|
+
quantityUoM: string;
|
|
502
|
+
quantityFactor: number;
|
|
503
|
+
quantityUoMUuid: string;
|
|
504
|
+
expiration: string;
|
|
505
|
+
commonName: string | null;
|
|
506
|
+
acronym: string | null;
|
|
507
|
+
drugName: string | null;
|
|
508
|
+
conceptName: string | null;
|
|
509
|
+
resourceVersion: string;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
export type StockDispenseRequest = {
|
|
513
|
+
dispenseLocation: string;
|
|
514
|
+
patient: string;
|
|
515
|
+
order: string;
|
|
516
|
+
encounter: string;
|
|
517
|
+
stockItem: string;
|
|
518
|
+
stockBatch: string;
|
|
519
|
+
stockItemPackagingUOM: string;
|
|
520
|
+
quantity: number;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
export interface DispensingStore {
|
|
524
|
+
/**
|
|
525
|
+
* A list of encounterUuids with stale data due to
|
|
526
|
+
* updates (like pausing of dispensing medication) actions,
|
|
527
|
+
* and subsequent SWR revalidation has not yet completed
|
|
528
|
+
*/
|
|
529
|
+
staleEncounterUuids: string[];
|
|
530
|
+
}
|