@openmrs/esm-dispensing-app 1.6.2 → 1.6.3-pre.3
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/cache/3973258467ef7c66-meta.json +1 -0
- package/.turbo/cache/3973258467ef7c66.tar.zst +0 -0
- package/.turbo/turbo-build.log +44 -0
- package/dist/1616.js +2 -0
- package/dist/{524.js.LICENSE.txt → 1616.js.LICENSE.txt} +9 -14
- package/dist/1616.js.map +1 -0
- package/dist/1637.js +1 -0
- package/dist/1637.js.map +1 -0
- package/dist/1644.js +1 -0
- package/dist/1901.js +1 -0
- package/dist/1905.js +1 -0
- package/dist/1905.js.map +1 -0
- package/dist/2016.js +1 -0
- package/dist/2511.js +1 -0
- package/dist/2511.js.map +1 -0
- package/dist/2757.js +1 -0
- package/dist/3574.js +1 -0
- package/dist/3652.js +1 -0
- package/dist/3935.js +2 -0
- package/dist/3935.js.map +1 -0
- package/dist/4272.js +1 -0
- package/dist/4378.js +1 -0
- package/dist/4460.js +1 -0
- package/dist/4705.js +1 -0
- package/dist/5240.js +1 -0
- package/dist/5336.js +1 -0
- package/dist/5673.js +1 -0
- package/dist/5711.js +1 -0
- package/dist/5737.js +1 -0
- package/dist/5833.js +1 -0
- package/dist/5962.js +1 -0
- package/dist/6497.js +1 -0
- package/dist/6566.js +1 -0
- package/dist/6582.js +1 -0
- package/dist/6582.js.map +1 -0
- package/dist/6727.js +1 -0
- package/dist/6868.js +2 -0
- package/dist/6868.js.LICENSE.txt +14 -0
- package/dist/6868.js.map +1 -0
- package/dist/6936.js +1 -0
- package/dist/6936.js.map +1 -0
- package/dist/6973.js +1 -0
- package/dist/6973.js.map +1 -0
- package/dist/7294.js +2 -0
- package/dist/7294.js.map +1 -0
- package/dist/7484.js +1 -0
- package/dist/7484.js.map +1 -0
- package/dist/7626.js +1 -0
- package/dist/7626.js.map +1 -0
- package/dist/7687.js +1 -0
- package/dist/7687.js.map +1 -0
- package/dist/7807.js +1 -0
- package/dist/7998.js +1 -0
- package/dist/8077.js +1 -0
- package/dist/8077.js.map +1 -0
- package/dist/8271.js +1 -0
- package/dist/8319.js +1 -0
- package/dist/8323.js +1 -0
- package/dist/8788.js +1 -0
- package/dist/8949.js +1 -0
- package/dist/8949.js.map +1 -0
- package/dist/9204.js +2 -0
- package/dist/{204.js.LICENSE.txt → 9204.js.LICENSE.txt} +2 -0
- package/dist/9204.js.map +1 -0
- package/dist/9261.js +1 -0
- package/dist/9579.js +1 -0
- package/dist/9870.js +2 -0
- package/dist/9870.js.LICENSE.txt +9 -0
- package/dist/9870.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +21 -11
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-dispensing-app.js +1 -1
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +455 -244
- package/dist/openmrs-esm-dispensing-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/jest.config.js +3 -1
- package/package.json +7 -4
- package/src/components/{action-buttons.component.test.tsx → action-buttons.test.tsx} +7 -7
- package/src/components/medication-card.component.tsx +3 -3
- package/src/components/medication-card.scss +8 -8
- package/src/components/medication-dispense-review.scss +10 -10
- package/src/components/medication-event.component.tsx +4 -4
- package/src/components/medication-event.scss +10 -5
- package/src/components/patient-details.component.tsx +4 -4
- package/src/components/patient-details.scss +12 -12
- package/src/components/prescription-actions/close-action-button.component.tsx +1 -1
- package/src/components/prescription-actions/dispense-action-button.component.tsx +1 -1
- package/src/components/prescription-actions/pause-action-button.component.tsx +1 -1
- package/src/conditions/conditions.component.tsx +93 -0
- package/src/conditions/conditions.resource.ts +100 -0
- package/src/conditions/conditions.scss +9 -0
- package/src/config-schema.ts +8 -0
- package/src/dashboard/dispensing-dashboard-link.component.tsx +1 -1
- package/src/dashboard/dispensing-dashboard.component.tsx +10 -4
- package/src/declarations.d.ts +0 -1
- package/src/diagnoses/diagnoses.component.tsx +92 -0
- package/src/diagnoses/diagnoses.resource.ts +30 -0
- package/src/diagnoses/diagnoses.scss +9 -0
- package/src/dispensing-tiles/dispensing-tile.component.tsx +20 -17
- package/src/dispensing-tiles/dispensing-tile.scss +8 -8
- package/src/dispensing-tiles/dispensing-tiles.scss +4 -5
- package/src/forms/close-dispense-form.workspace.tsx +25 -23
- package/src/forms/forms.scss +5 -9
- package/src/forms/medication-dispense-review.component.tsx +211 -196
- package/src/forms/pause-dispense-form.workspace.tsx +25 -23
- package/src/forms/stock-dispense/stock-dispense.component.tsx +10 -10
- package/src/history/history-and-comments.scss +15 -15
- package/src/index.ts +3 -0
- package/src/location/location.resource.test.tsx +1 -0
- package/src/medication/medication.resource.tsx +1 -1
- package/src/patient/patient-info-cell.component.tsx +1 -1
- package/src/pharmacy-header/pharmacy-header.scss +11 -11
- package/src/prescriptions/prescription-actions.scss +0 -1
- package/src/prescriptions/prescription-details.component.tsx +6 -6
- package/src/prescriptions/prescription-details.scss +10 -10
- package/src/prescriptions/prescription-expanded.component.tsx +5 -9
- package/src/prescriptions/prescription-expanded.scss +6 -7
- package/src/prescriptions/prescription-tab-lists.component.tsx +5 -5
- package/src/prescriptions/prescriptions.scss +15 -29
- package/src/print-prescription/prescription-printout.component.tsx +1 -1
- package/src/routes.json +14 -0
- package/src/utils.ts +1 -1
- package/tools/setup-tests.ts +1 -0
- package/tools/update-openmrs-deps.mjs +42 -0
- package/translations/en.json +9 -1
- package/translations/es.json +23 -23
- package/translations/it.json +87 -87
- package/translations/ky.json +92 -0
- package/tsconfig.json +3 -2
- package/dist/16.js +0 -1
- package/dist/204.js +0 -2
- package/dist/204.js.map +0 -1
- package/dist/240.js +0 -1
- package/dist/261.js +0 -1
- package/dist/271.js +0 -1
- package/dist/272.js +0 -1
- package/dist/294.js +0 -2
- package/dist/294.js.map +0 -1
- package/dist/319.js +0 -1
- package/dist/323.js +0 -1
- package/dist/336.js +0 -1
- package/dist/378.js +0 -1
- package/dist/460.js +0 -1
- package/dist/484.js +0 -1
- package/dist/484.js.map +0 -1
- package/dist/497.js +0 -1
- package/dist/524.js +0 -2
- package/dist/524.js.map +0 -1
- package/dist/566.js +0 -1
- package/dist/574.js +0 -1
- package/dist/579.js +0 -1
- package/dist/626.js +0 -1
- package/dist/626.js.map +0 -1
- package/dist/637.js +0 -1
- package/dist/637.js.map +0 -1
- package/dist/644.js +0 -1
- package/dist/652.js +0 -1
- package/dist/673.js +0 -1
- package/dist/705.js +0 -1
- package/dist/711.js +0 -1
- package/dist/727.js +0 -1
- package/dist/737.js +0 -1
- package/dist/749.js +0 -1
- package/dist/749.js.map +0 -1
- package/dist/757.js +0 -1
- package/dist/77.js +0 -1
- package/dist/77.js.map +0 -1
- package/dist/788.js +0 -1
- package/dist/803.js +0 -1
- package/dist/803.js.map +0 -1
- package/dist/807.js +0 -1
- package/dist/833.js +0 -1
- package/dist/888.js +0 -1
- package/dist/888.js.map +0 -1
- package/dist/890.js +0 -1
- package/dist/890.js.map +0 -1
- package/dist/901.js +0 -1
- package/dist/905.js +0 -1
- package/dist/905.js.map +0 -1
- package/dist/935.js +0 -2
- package/dist/935.js.map +0 -1
- package/dist/962.js +0 -1
- package/src/root.scss +0 -50
- package/src/setup-tests.ts +0 -1
- package/dist/{935.js.LICENSE.txt → 3935.js.LICENSE.txt} +0 -0
- package/dist/{294.js.LICENSE.txt → 7294.js.LICENSE.txt} +0 -0
- package/src/components/{medication-card.component.test.tsx → medication-card.test.tsx} +0 -0
- package/src/forms/{medication-dispense-review.component.test.tsx → medication-dispense-review.test.tsx} +1 -1
- /package/{i18next-parser.config.js → tools/i18next-parser.config.js} +0 -0
|
@@ -2,7 +2,14 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { ComboBox, Dropdown, NumberInput, Stack, TextArea } from '@carbon/react';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
OpenmrsDatePicker,
|
|
7
|
+
useLayoutType,
|
|
8
|
+
useConfig,
|
|
9
|
+
useSession,
|
|
10
|
+
userHasAccess,
|
|
11
|
+
ResponsiveWrapper,
|
|
12
|
+
} from '@openmrs/esm-framework';
|
|
6
13
|
import { getConceptCodingUuid, getMedicationReferenceOrCodeableConcept, getOpenMRSMedicineDrugName } from '../utils';
|
|
7
14
|
import { useMedicationCodeableConcept, useMedicationFormulations } from '../medication/medication.resource';
|
|
8
15
|
import { useMedicationRequest, usePrescriptionDetails } from '../medication-request/medication-request.resource';
|
|
@@ -206,94 +213,97 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
206
213
|
editAction={userCanModify && allowEditing ? () => setIsEditingFormulation(true) : null}
|
|
207
214
|
/>
|
|
208
215
|
) : (
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
initialSelectedItem={{
|
|
215
|
-
...medicationFormulations?.find(
|
|
216
|
-
(formulation) => formulation.id === medicationDispense.medicationReference?.reference.split('/')[1],
|
|
217
|
-
),
|
|
218
|
-
}}
|
|
219
|
-
onChange={({ selectedItem }) => {
|
|
220
|
-
updateMedicationDispense({
|
|
221
|
-
...medicationDispense,
|
|
222
|
-
medicationCodeableConcept: undefined,
|
|
223
|
-
medicationReference: {
|
|
224
|
-
reference: 'Medication/' + selectedItem?.id,
|
|
225
|
-
display: getOpenMRSMedicineDrugName(selectedItem),
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
setIsEditingFormulation(false);
|
|
229
|
-
}}
|
|
230
|
-
required
|
|
231
|
-
/>
|
|
232
|
-
)}
|
|
233
|
-
|
|
234
|
-
{isSubstitution && (
|
|
235
|
-
<div className={styles.dispenseDetailsContainer}>
|
|
236
|
-
<ComboBox
|
|
237
|
-
className={styles.substitutionType}
|
|
238
|
-
id="substitutionType"
|
|
239
|
-
light={isTablet}
|
|
240
|
-
items={substitutionTypes}
|
|
241
|
-
titleText={t('substitutionType', 'Type of substitution')}
|
|
242
|
-
itemToString={(item) => item?.text}
|
|
216
|
+
<ResponsiveWrapper>
|
|
217
|
+
<Dropdown
|
|
218
|
+
id="medicationFormulation"
|
|
219
|
+
items={medicationFormulations}
|
|
220
|
+
itemToString={(item: Medication) => getOpenMRSMedicineDrugName(item)}
|
|
243
221
|
initialSelectedItem={{
|
|
244
|
-
|
|
245
|
-
|
|
222
|
+
...medicationFormulations?.find(
|
|
223
|
+
(formulation) => formulation.id === medicationDispense.medicationReference?.reference.split('/')[1],
|
|
224
|
+
),
|
|
246
225
|
}}
|
|
247
226
|
onChange={({ selectedItem }) => {
|
|
248
227
|
updateMedicationDispense({
|
|
249
228
|
...medicationDispense,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
{
|
|
255
|
-
code: selectedItem?.id,
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
},
|
|
229
|
+
medicationCodeableConcept: undefined,
|
|
230
|
+
medicationReference: {
|
|
231
|
+
reference: 'Medication/' + selectedItem?.id,
|
|
232
|
+
display: getOpenMRSMedicineDrugName(selectedItem),
|
|
259
233
|
},
|
|
260
234
|
});
|
|
235
|
+
setIsEditingFormulation(false);
|
|
261
236
|
}}
|
|
237
|
+
required
|
|
262
238
|
/>
|
|
263
|
-
</
|
|
239
|
+
</ResponsiveWrapper>
|
|
264
240
|
)}
|
|
265
241
|
|
|
266
242
|
{isSubstitution && (
|
|
267
243
|
<div className={styles.dispenseDetailsContainer}>
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
{
|
|
244
|
+
<ResponsiveWrapper>
|
|
245
|
+
<ComboBox
|
|
246
|
+
className={styles.substitutionType}
|
|
247
|
+
id="substitutionType"
|
|
248
|
+
items={substitutionTypes}
|
|
249
|
+
titleText={t('substitutionType', 'Type of substitution')}
|
|
250
|
+
itemToString={(item) => item?.text}
|
|
251
|
+
initialSelectedItem={{
|
|
252
|
+
id: medicationDispense.substitution.type?.coding[0]?.code,
|
|
253
|
+
text: medicationDispense.substitution.type?.text,
|
|
254
|
+
}}
|
|
255
|
+
onChange={({ selectedItem }) => {
|
|
256
|
+
updateMedicationDispense({
|
|
257
|
+
...medicationDispense,
|
|
258
|
+
substitution: {
|
|
259
|
+
...medicationDispense.substitution,
|
|
260
|
+
type: {
|
|
286
261
|
coding: [
|
|
287
262
|
{
|
|
288
263
|
code: selectedItem?.id,
|
|
289
264
|
},
|
|
290
265
|
],
|
|
291
266
|
},
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
}}
|
|
270
|
+
/>
|
|
271
|
+
</ResponsiveWrapper>
|
|
272
|
+
</div>
|
|
273
|
+
)}
|
|
274
|
+
|
|
275
|
+
{isSubstitution && (
|
|
276
|
+
<div className={styles.dispenseDetailsContainer}>
|
|
277
|
+
<ResponsiveWrapper>
|
|
278
|
+
<ComboBox
|
|
279
|
+
className={styles.substitutionReason}
|
|
280
|
+
id="substitutionReason"
|
|
281
|
+
items={substitutionReasons}
|
|
282
|
+
titleText={t('substitutionReason', 'Reason for substitution')}
|
|
283
|
+
itemToString={(item) => item?.text}
|
|
284
|
+
initialSelectedItem={{
|
|
285
|
+
id: medicationDispense.substitution.reason[0]?.coding[0]?.code,
|
|
286
|
+
text: medicationDispense.substitution.reason[0]?.text,
|
|
287
|
+
}}
|
|
288
|
+
onChange={({ selectedItem }) => {
|
|
289
|
+
updateMedicationDispense({
|
|
290
|
+
...medicationDispense,
|
|
291
|
+
substitution: {
|
|
292
|
+
...medicationDispense.substitution,
|
|
293
|
+
reason: [
|
|
294
|
+
{
|
|
295
|
+
coding: [
|
|
296
|
+
{
|
|
297
|
+
code: selectedItem?.id,
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
306
|
+
</ResponsiveWrapper>
|
|
297
307
|
</div>
|
|
298
308
|
)}
|
|
299
309
|
|
|
@@ -324,29 +334,30 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
324
334
|
}}
|
|
325
335
|
/>
|
|
326
336
|
|
|
327
|
-
<
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
337
|
+
<ResponsiveWrapper>
|
|
338
|
+
<ComboBox
|
|
339
|
+
id="quantityUnits"
|
|
340
|
+
disabled={!userCanModify || !allowEditing}
|
|
341
|
+
items={drugDispensingUnits}
|
|
342
|
+
titleText={t('drugDispensingUnit', 'Dispensing unit')}
|
|
343
|
+
itemToString={(item) => item?.text}
|
|
344
|
+
initialSelectedItem={{
|
|
345
|
+
id: medicationDispense.quantity.code,
|
|
346
|
+
text: medicationDispense.quantity.unit,
|
|
347
|
+
}}
|
|
348
|
+
onChange={({ selectedItem }) => {
|
|
349
|
+
updateMedicationDispense({
|
|
350
|
+
...medicationDispense,
|
|
351
|
+
// note that we specifically recreate doesQuantity to overwrite any unit or system properties that may have been set
|
|
352
|
+
quantity: {
|
|
353
|
+
value: medicationDispense.quantity.value,
|
|
354
|
+
code: selectedItem?.id,
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
}}
|
|
358
|
+
required
|
|
359
|
+
/>
|
|
360
|
+
</ResponsiveWrapper>
|
|
350
361
|
</div>
|
|
351
362
|
|
|
352
363
|
<div className={styles.dispenseDetailsContainer}>
|
|
@@ -380,49 +391,83 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
380
391
|
}}
|
|
381
392
|
/>
|
|
382
393
|
|
|
383
|
-
<
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
394
|
+
<ResponsiveWrapper>
|
|
395
|
+
<ComboBox
|
|
396
|
+
id="dosingUnits"
|
|
397
|
+
disabled={!userCanModify || !allowEditing}
|
|
398
|
+
items={drugDosingUnits}
|
|
399
|
+
titleText={t('doseUnit', 'Dose unit')}
|
|
400
|
+
itemToString={(item) => item?.text}
|
|
401
|
+
initialSelectedItem={{
|
|
402
|
+
id: medicationDispense.dosageInstruction[0].doseAndRate[0].doseQuantity?.code,
|
|
403
|
+
text: medicationDispense.dosageInstruction[0].doseAndRate[0].doseQuantity?.unit,
|
|
404
|
+
}}
|
|
405
|
+
onChange={({ selectedItem }) => {
|
|
406
|
+
updateMedicationDispense({
|
|
407
|
+
...medicationDispense,
|
|
408
|
+
dosageInstruction: [
|
|
409
|
+
{
|
|
410
|
+
...medicationDispense.dosageInstruction[0],
|
|
411
|
+
doseAndRate: [
|
|
412
|
+
{
|
|
413
|
+
doseQuantity: {
|
|
414
|
+
// note that we specifically recreate doesQuantity to overwrite any unit or system properties that may have been set
|
|
415
|
+
value: medicationDispense.dosageInstruction[0].doseAndRate[0].doseQuantity?.value,
|
|
416
|
+
code: selectedItem?.id,
|
|
417
|
+
},
|
|
406
418
|
},
|
|
419
|
+
],
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
});
|
|
423
|
+
}}
|
|
424
|
+
required
|
|
425
|
+
/>
|
|
426
|
+
</ResponsiveWrapper>
|
|
427
|
+
|
|
428
|
+
<ResponsiveWrapper>
|
|
429
|
+
<ComboBox
|
|
430
|
+
id="editRoute"
|
|
431
|
+
disabled={!userCanModify || !allowEditing}
|
|
432
|
+
items={drugRoutes}
|
|
433
|
+
initialSelectedItem={{
|
|
434
|
+
id: medicationDispense.dosageInstruction[0].route?.coding[0]?.code,
|
|
435
|
+
text: medicationDispense.dosageInstruction[0].route?.text,
|
|
436
|
+
}}
|
|
437
|
+
titleText={t('route', 'Route')}
|
|
438
|
+
itemToString={(item) => item?.text}
|
|
439
|
+
onChange={({ selectedItem }) => {
|
|
440
|
+
updateMedicationDispense({
|
|
441
|
+
...medicationDispense,
|
|
442
|
+
dosageInstruction: [
|
|
443
|
+
{
|
|
444
|
+
...medicationDispense.dosageInstruction[0],
|
|
445
|
+
route: {
|
|
446
|
+
coding: [
|
|
447
|
+
{
|
|
448
|
+
code: selectedItem?.id,
|
|
449
|
+
},
|
|
450
|
+
],
|
|
407
451
|
},
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
});
|
|
455
|
+
}}
|
|
456
|
+
required
|
|
457
|
+
/>
|
|
458
|
+
</ResponsiveWrapper>
|
|
459
|
+
</div>
|
|
415
460
|
|
|
461
|
+
<ResponsiveWrapper>
|
|
416
462
|
<ComboBox
|
|
417
|
-
id="
|
|
463
|
+
id="frequency"
|
|
418
464
|
disabled={!userCanModify || !allowEditing}
|
|
419
|
-
|
|
420
|
-
items={drugRoutes}
|
|
465
|
+
items={orderFrequencies}
|
|
421
466
|
initialSelectedItem={{
|
|
422
|
-
id: medicationDispense.dosageInstruction[0].
|
|
423
|
-
text: medicationDispense.dosageInstruction[0].
|
|
467
|
+
id: medicationDispense.dosageInstruction[0].timing?.code?.coding[0]?.code,
|
|
468
|
+
text: medicationDispense.dosageInstruction[0].timing?.code?.text,
|
|
424
469
|
}}
|
|
425
|
-
titleText={t('
|
|
470
|
+
titleText={t('frequency', 'Frequency')}
|
|
426
471
|
itemToString={(item) => item?.text}
|
|
427
472
|
onChange={({ selectedItem }) => {
|
|
428
473
|
updateMedicationDispense({
|
|
@@ -430,12 +475,15 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
430
475
|
dosageInstruction: [
|
|
431
476
|
{
|
|
432
477
|
...medicationDispense.dosageInstruction[0],
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
478
|
+
timing: {
|
|
479
|
+
...medicationDispense.dosageInstruction[0].timing,
|
|
480
|
+
code: {
|
|
481
|
+
coding: [
|
|
482
|
+
{
|
|
483
|
+
code: selectedItem?.id,
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
},
|
|
439
487
|
},
|
|
440
488
|
},
|
|
441
489
|
],
|
|
@@ -443,41 +491,7 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
443
491
|
}}
|
|
444
492
|
required
|
|
445
493
|
/>
|
|
446
|
-
</
|
|
447
|
-
|
|
448
|
-
<ComboBox
|
|
449
|
-
id="frequency"
|
|
450
|
-
disabled={!userCanModify || !allowEditing}
|
|
451
|
-
light={isTablet}
|
|
452
|
-
items={orderFrequencies}
|
|
453
|
-
initialSelectedItem={{
|
|
454
|
-
id: medicationDispense.dosageInstruction[0].timing?.code?.coding[0]?.code,
|
|
455
|
-
text: medicationDispense.dosageInstruction[0].timing?.code?.text,
|
|
456
|
-
}}
|
|
457
|
-
titleText={t('frequency', 'Frequency')}
|
|
458
|
-
itemToString={(item) => item?.text}
|
|
459
|
-
onChange={({ selectedItem }) => {
|
|
460
|
-
updateMedicationDispense({
|
|
461
|
-
...medicationDispense,
|
|
462
|
-
dosageInstruction: [
|
|
463
|
-
{
|
|
464
|
-
...medicationDispense.dosageInstruction[0],
|
|
465
|
-
timing: {
|
|
466
|
-
...medicationDispense.dosageInstruction[0].timing,
|
|
467
|
-
code: {
|
|
468
|
-
coding: [
|
|
469
|
-
{
|
|
470
|
-
code: selectedItem?.id,
|
|
471
|
-
},
|
|
472
|
-
],
|
|
473
|
-
},
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
],
|
|
477
|
-
});
|
|
478
|
-
}}
|
|
479
|
-
required
|
|
480
|
-
/>
|
|
494
|
+
</ResponsiveWrapper>
|
|
481
495
|
|
|
482
496
|
<TextArea
|
|
483
497
|
labelText={t('patientInstructions', 'Patient instructions')}
|
|
@@ -514,33 +528,34 @@ const MedicationDispenseReview: React.FC<MedicationDispenseReviewProps> = ({
|
|
|
514
528
|
value={dayjs(medicationDispense.whenHandedOver).toDate()}></OpenmrsDatePicker>
|
|
515
529
|
|
|
516
530
|
{providers && (
|
|
517
|
-
<
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
531
|
+
<ResponsiveWrapper>
|
|
532
|
+
<ComboBox
|
|
533
|
+
id="dispenser"
|
|
534
|
+
initialSelectedItem={
|
|
535
|
+
medicationDispense?.performer[0].actor.reference
|
|
536
|
+
? providers.find(
|
|
537
|
+
(provider) => provider.uuid === medicationDispense?.performer[0].actor.reference.split('/')[1],
|
|
538
|
+
)
|
|
539
|
+
: null
|
|
540
|
+
}
|
|
541
|
+
onChange={({ selectedItem }) => {
|
|
542
|
+
updateMedicationDispense({
|
|
543
|
+
...medicationDispense,
|
|
544
|
+
performer: [
|
|
545
|
+
{
|
|
546
|
+
actor: {
|
|
547
|
+
reference: `Practitioner/${selectedItem?.uuid}`,
|
|
548
|
+
},
|
|
534
549
|
},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
550
|
+
],
|
|
551
|
+
});
|
|
552
|
+
}}
|
|
553
|
+
items={providers}
|
|
554
|
+
itemToString={(item) => item?.person?.display}
|
|
555
|
+
required
|
|
556
|
+
titleText={t('dispensedBy', 'Dispensed by')}
|
|
557
|
+
/>
|
|
558
|
+
</ResponsiveWrapper>
|
|
544
559
|
)}
|
|
545
560
|
</Stack>
|
|
546
561
|
</div>
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type DefaultWorkspaceProps,
|
|
6
6
|
ExtensionSlot,
|
|
7
7
|
getCoreTranslation,
|
|
8
|
+
ResponsiveWrapper,
|
|
8
9
|
showSnackbar,
|
|
9
10
|
useConfig,
|
|
10
11
|
useLayoutType,
|
|
@@ -152,29 +153,30 @@ const PauseDispenseForm: React.FC<PauseDispenseFormProps> = ({
|
|
|
152
153
|
)}
|
|
153
154
|
{patient && <ExtensionSlot name="patient-header-slot" state={bannerState} />}
|
|
154
155
|
<section className={styles.formGroup}>
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
<ResponsiveWrapper>
|
|
157
|
+
<ComboBox
|
|
158
|
+
id="reasonForPause"
|
|
159
|
+
items={reasonsForPause}
|
|
160
|
+
titleText={t('reasonForPause', 'Reason for pause')}
|
|
161
|
+
itemToString={(item) => item?.text}
|
|
162
|
+
initialSelectedItem={{
|
|
163
|
+
id: medicationDispense.statusReasonCodeableConcept?.coding[0]?.code,
|
|
164
|
+
text: medicationDispense.statusReasonCodeableConcept?.text,
|
|
165
|
+
}}
|
|
166
|
+
onChange={({ selectedItem }) => {
|
|
167
|
+
setMedicationDispensePayload({
|
|
168
|
+
...medicationDispensePayload,
|
|
169
|
+
statusReasonCodeableConcept: {
|
|
170
|
+
coding: [
|
|
171
|
+
{
|
|
172
|
+
code: selectedItem?.id,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
}}
|
|
178
|
+
/>
|
|
179
|
+
</ResponsiveWrapper>
|
|
178
180
|
</section>
|
|
179
181
|
</div>
|
|
180
182
|
<section className={styles.buttonGroup}>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { ComboBox, InlineLoading, InlineNotification, Layer } from '@carbon/react';
|
|
4
|
+
import { formatDate, useConfig } from '@openmrs/esm-framework';
|
|
3
5
|
import { type MedicationDispense, type InventoryItem } from '../../types';
|
|
6
|
+
import { type PharmacyConfig } from '../../config-schema';
|
|
4
7
|
import { useDispenseStock } from './stock.resource';
|
|
5
|
-
import { formatDate } from '@openmrs/esm-framework';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
8
|
|
|
8
9
|
type StockDispenseProps = {
|
|
9
10
|
medicationDispense: MedicationDispense;
|
|
@@ -13,17 +14,13 @@ type StockDispenseProps = {
|
|
|
13
14
|
|
|
14
15
|
const StockDispense: React.FC<StockDispenseProps> = ({ medicationDispense, updateInventoryItem }) => {
|
|
15
16
|
const { t } = useTranslation();
|
|
17
|
+
const config = useConfig<PharmacyConfig>();
|
|
18
|
+
|
|
16
19
|
const drugUuid = medicationDispense?.medicationReference?.reference?.split('/')[1];
|
|
17
20
|
const { inventoryItems, error, isLoading } = useDispenseStock(drugUuid);
|
|
18
|
-
const validInventoryItems = inventoryItems
|
|
19
|
-
const validInventoryItemss = inventoryItems
|
|
21
|
+
const validInventoryItems = inventoryItems
|
|
20
22
|
.filter((item) => isValidBatch(medicationDispense, item))
|
|
21
|
-
.sort((a, b) =>
|
|
22
|
-
const dateA = new Date(a.expiration);
|
|
23
|
-
const dateB = new Date(b.expiration);
|
|
24
|
-
|
|
25
|
-
return dateA.getDate() - dateB.getDate();
|
|
26
|
-
});
|
|
23
|
+
.sort((a, b) => new Date(a.expiration).getTime() - new Date(b.expiration).getTime());
|
|
27
24
|
|
|
28
25
|
function parseDate(dateString) {
|
|
29
26
|
return new Date(dateString);
|
|
@@ -31,6 +28,9 @@ const StockDispense: React.FC<StockDispenseProps> = ({ medicationDispense, updat
|
|
|
31
28
|
|
|
32
29
|
//check whether the drug will expire before the medication period ends
|
|
33
30
|
function isValidBatch(medicationToDispense, inventoryItem) {
|
|
31
|
+
if (typeof config !== 'undefined' && !config.validateBatch) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
34
|
if (medicationToDispense?.dosageInstruction && medicationToDispense?.dosageInstruction.length > 0) {
|
|
35
35
|
return medicationToDispense.dosageInstruction.some((instruction) => {
|
|
36
36
|
if (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.historyAndCommentsContainer {
|
|
6
6
|
max-width: 80%;
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
form input {
|
|
15
15
|
vertical-align: middle;
|
|
16
|
-
margin: 0
|
|
17
|
-
padding:
|
|
16
|
+
margin: 0 0.625rem 0 0;
|
|
17
|
+
padding: 0.625rem;
|
|
18
18
|
border: 1px solid #8d8d8d !important;
|
|
19
19
|
background-color: white;
|
|
20
20
|
}
|
|
21
21
|
form button {
|
|
22
22
|
width: 90px;
|
|
23
|
-
height:
|
|
24
|
-
min-height:
|
|
23
|
+
height: 1.25rem;
|
|
24
|
+
min-height: layout.$spacing-08 !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
form :global(.cds--btn--ghost) {
|
|
@@ -30,22 +30,22 @@
|
|
|
30
30
|
|
|
31
31
|
.requestTile {
|
|
32
32
|
width: 100%;
|
|
33
|
-
margin:
|
|
34
|
-
padding: 0
|
|
33
|
+
margin: layout.$spacing-01 0 layout.$spacing-03;
|
|
34
|
+
padding: 0 layout.$spacing-03 0 layout.$spacing-03;
|
|
35
35
|
background-color: #fff;
|
|
36
|
-
border-left:
|
|
36
|
+
border-left: layout.$spacing-03 solid var(--brand-03);
|
|
37
37
|
color: $text-02;
|
|
38
|
-
margin-bottom:
|
|
38
|
+
margin-bottom: layout.$spacing-05 !important;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.dispenseTile {
|
|
42
42
|
width: 100%;
|
|
43
|
-
margin:
|
|
44
|
-
padding: 0
|
|
43
|
+
margin: layout.$spacing-01 0 layout.$spacing-03;
|
|
44
|
+
padding: 0 layout.$spacing-03 0 layout.$spacing-03;
|
|
45
45
|
background-color: #fff;
|
|
46
|
-
border-left:
|
|
46
|
+
border-left: layout.$spacing-03 solid red;
|
|
47
47
|
color: $text-02;
|
|
48
|
-
margin-bottom:
|
|
48
|
+
margin-bottom: layout.$spacing-05 !important;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.medicationEventActionMenu {
|
package/src/index.ts
CHANGED
|
@@ -44,3 +44,6 @@ export const dispenseWorkspace = getAsyncLifecycle(() => import('./forms/dispens
|
|
|
44
44
|
export const pauseDispenseWorkspace = getAsyncLifecycle(() => import('./forms/pause-dispense-form.workspace'), options);
|
|
45
45
|
|
|
46
46
|
export const printPrescriptionPreviewModal = getSyncLifecycle(PrescriptionPrintPreviewModal, options);
|
|
47
|
+
|
|
48
|
+
export const patientDiagnoses = getAsyncLifecycle(() => import('./diagnoses/diagnoses.component'), options);
|
|
49
|
+
export const patientConditions = getAsyncLifecycle(() => import('./conditions/conditions.component'), options);
|