@openmrs/esm-dispensing-app 1.9.2-pre.1376 → 1.9.2-pre.1380
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/528844d752ad10fa-meta.json +1 -0
- package/.turbo/cache/528844d752ad10fa.tar.zst +0 -0
- package/.turbo/turbo-build.log +3 -3
- package/dist/1043.js +1 -1
- package/dist/1043.js.map +1 -1
- package/dist/8885.js +1 -1
- package/dist/8885.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/fill-prescription/fill-prescription-button.component.tsx +1 -1
- package/src/fill-prescription/on-prescription-filled.modal.tsx +31 -8
- package/src/fill-prescription/on-prescription-filled.scss +1 -1
- package/src/utils.ts +1 -1
- package/.turbo/cache/3019568427d147c1-meta.json +0 -1
- package/.turbo/cache/3019568427d147c1.tar.zst +0 -0
|
@@ -191,9 +191,9 @@
|
|
|
191
191
|
"initial": false,
|
|
192
192
|
"entry": false,
|
|
193
193
|
"recorded": false,
|
|
194
|
-
"size":
|
|
194
|
+
"size": 21037,
|
|
195
195
|
"sizes": {
|
|
196
|
-
"javascript":
|
|
196
|
+
"javascript": 21037
|
|
197
197
|
},
|
|
198
198
|
"names": [],
|
|
199
199
|
"idHints": [],
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"auxiliaryFiles": [
|
|
208
208
|
"1043.js.map"
|
|
209
209
|
],
|
|
210
|
-
"hash": "
|
|
210
|
+
"hash": "747c31492c00307e",
|
|
211
211
|
"childrenByOrder": {}
|
|
212
212
|
},
|
|
213
213
|
{
|
|
@@ -1489,10 +1489,10 @@
|
|
|
1489
1489
|
"initial": true,
|
|
1490
1490
|
"entry": true,
|
|
1491
1491
|
"recorded": false,
|
|
1492
|
-
"size":
|
|
1492
|
+
"size": 3635040,
|
|
1493
1493
|
"sizes": {
|
|
1494
1494
|
"consume-shared": 210,
|
|
1495
|
-
"javascript":
|
|
1495
|
+
"javascript": 3612064,
|
|
1496
1496
|
"share-init": 378,
|
|
1497
1497
|
"runtime": 22388
|
|
1498
1498
|
},
|
|
@@ -1509,7 +1509,7 @@
|
|
|
1509
1509
|
"auxiliaryFiles": [
|
|
1510
1510
|
"main.js.map"
|
|
1511
1511
|
],
|
|
1512
|
-
"hash": "
|
|
1512
|
+
"hash": "e185f21a9eb6fd0a",
|
|
1513
1513
|
"childrenByOrder": {}
|
|
1514
1514
|
},
|
|
1515
1515
|
{
|
|
@@ -1517,9 +1517,9 @@
|
|
|
1517
1517
|
"initial": false,
|
|
1518
1518
|
"entry": false,
|
|
1519
1519
|
"recorded": false,
|
|
1520
|
-
"size":
|
|
1520
|
+
"size": 319727,
|
|
1521
1521
|
"sizes": {
|
|
1522
|
-
"javascript":
|
|
1522
|
+
"javascript": 319727
|
|
1523
1523
|
},
|
|
1524
1524
|
"names": [],
|
|
1525
1525
|
"idHints": [],
|
|
@@ -1532,7 +1532,7 @@
|
|
|
1532
1532
|
"auxiliaryFiles": [
|
|
1533
1533
|
"8885.js.map"
|
|
1534
1534
|
],
|
|
1535
|
-
"hash": "
|
|
1535
|
+
"hash": "7a309675fad43064",
|
|
1536
1536
|
"childrenByOrder": {}
|
|
1537
1537
|
},
|
|
1538
1538
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"pages":[{"component":"dispensing","route":"dispensing","online":true,"offline":true}],"extensions":[{"name":"dispensing-link","slot":"app-menu-slot","component":"dispensingLink","online":true,"offline":true},{"name":"patient-diagnoses","component":"patientDiagnoses","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"patient-conditions","component":"patientConditions","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"dispensing-dashboard","slot":"dispensing-dashboard-slot","component":"dispensingDashboard","online":true,"offline":true},{"name":"dispensing-dashboard-link","component":"dispensingDashboardLink","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Dispensing"}},{"name":"dispense-action-button","slot":"prescription-action-button-slot","component":"dispenseActionButton"},{"name":"pause-action-button","slot":"prescription-action-button-slot","component":"pauseActionButton"},{"name":"close-action-button","slot":"prescription-action-button-slot","component":"closeActionButton"}],"workspaces2":[{"name":"close-dispense-workspace","component":"closeDispenseWorkspace","window":"dispensing-window"},{"name":"pause-dispense-workspace","component":"pauseDispenseWorkspace","window":"dispensing-window"},{"name":"dispense-workspace","component":"dispenseWorkspace","window":"dispensing-window"},{"name":"dispensing-patient-search-workspace","component":"@openmrs/esm-patient-search-app#patientSearchWorkspace2","window":"fill-prescription-window"},{"name":"dispensing-start-visit-workspace","component":"@openmrs/esm-patient-chart-app#exportedVisitForm","window":"fill-prescription-window"},{"name":"dispensing-order-basket-workspace","component":"@openmrs/esm-patient-orders-app#exportedOrderBasketWorkspace","window":"fill-prescription-window"},{"name":"dispensing-order-basket-add-drug-order-workspace","component":"@openmrs/esm-patient-medications-app#exportedAddDrugOrderWorkspace","window":"fill-prescription-window"}],"workspaceWindows2":[{"name":"dispensing-window","group":"dispensing-group"},{"name":"fill-prescription-window","group":"dispensing-group"}],"workspaceGroups2":[{"name":"dispensing-group","overlay":true}],"modals":[{"name":"prescription-print-preview-modal","component":"printPrescriptionPreviewModal"},{"name":"delete-confirm-modal","component":"deleteConfirmModal"},{"name":"on-prescription-filled-modal","component":"onPrescriptionFilledModal"}],"version":"1.9.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"pages":[{"component":"dispensing","route":"dispensing","online":true,"offline":true}],"extensions":[{"name":"dispensing-link","slot":"app-menu-slot","component":"dispensingLink","online":true,"offline":true},{"name":"patient-diagnoses","component":"patientDiagnoses","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"patient-conditions","component":"patientConditions","slot":"dispensing-condition-and-diagnoses","online":true,"offline":true},{"name":"dispensing-dashboard","slot":"dispensing-dashboard-slot","component":"dispensingDashboard","online":true,"offline":true},{"name":"dispensing-dashboard-link","component":"dispensingDashboardLink","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Dispensing"}},{"name":"dispense-action-button","slot":"prescription-action-button-slot","component":"dispenseActionButton"},{"name":"pause-action-button","slot":"prescription-action-button-slot","component":"pauseActionButton"},{"name":"close-action-button","slot":"prescription-action-button-slot","component":"closeActionButton"}],"workspaces2":[{"name":"close-dispense-workspace","component":"closeDispenseWorkspace","window":"dispensing-window"},{"name":"pause-dispense-workspace","component":"pauseDispenseWorkspace","window":"dispensing-window"},{"name":"dispense-workspace","component":"dispenseWorkspace","window":"dispensing-window"},{"name":"dispensing-patient-search-workspace","component":"@openmrs/esm-patient-search-app#patientSearchWorkspace2","window":"fill-prescription-window"},{"name":"dispensing-start-visit-workspace","component":"@openmrs/esm-patient-chart-app#exportedVisitForm","window":"fill-prescription-window"},{"name":"dispensing-order-basket-workspace","component":"@openmrs/esm-patient-orders-app#exportedOrderBasketWorkspace","window":"fill-prescription-window"},{"name":"dispensing-order-basket-add-drug-order-workspace","component":"@openmrs/esm-patient-medications-app#exportedAddDrugOrderWorkspace","window":"fill-prescription-window"}],"workspaceWindows2":[{"name":"dispensing-window","group":"dispensing-group"},{"name":"fill-prescription-window","group":"dispensing-group"}],"workspaceGroups2":[{"name":"dispensing-group","overlay":true}],"modals":[{"name":"prescription-print-preview-modal","component":"printPrescriptionPreviewModal"},{"name":"delete-confirm-modal","component":"deleteConfirmModal"},{"name":"on-prescription-filled-modal","component":"onPrescriptionFilledModal"}],"version":"1.9.2-pre.1380"}
|
package/package.json
CHANGED
|
@@ -2,10 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { Button, ModalBody, ModalFooter, ModalHeader, Tile } from '@carbon/react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
4
|
import { getPatientName, showSnackbar, useConfig, useSession } from '@openmrs/esm-framework';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
updateMedicationRequestFulfillerStatus,
|
|
7
|
+
usePrescriptionDetails,
|
|
8
|
+
} from '../medication-request/medication-request.resource';
|
|
6
9
|
import {
|
|
7
10
|
getMedicationDisplay,
|
|
8
11
|
getMedicationReferenceOrCodeableConcept,
|
|
12
|
+
getUuidFromReference,
|
|
9
13
|
markEncounterAsStale,
|
|
10
14
|
revalidate,
|
|
11
15
|
} from '../utils';
|
|
@@ -16,7 +20,7 @@ import {
|
|
|
16
20
|
} from '../medication-dispense/medication-dispense.resource';
|
|
17
21
|
import { type PharmacyConfig } from '../config-schema';
|
|
18
22
|
import MedicationEvent from '../components/medication-event.component';
|
|
19
|
-
import { MedicationDispenseStatus } from '../types';
|
|
23
|
+
import { MedicationDispenseStatus, MedicationRequestFulfillerStatus } from '../types';
|
|
20
24
|
import styles from './on-prescription-filled.scss';
|
|
21
25
|
|
|
22
26
|
interface OnPrescriptionFilledModalProps {
|
|
@@ -45,7 +49,7 @@ const OnPrescriptionFilledModal: React.FC<OnPrescriptionFilledModalProps> = ({ p
|
|
|
45
49
|
const { medicationRequestBundles } = usePrescriptionDetails(encounterUuid);
|
|
46
50
|
const { t } = useTranslation();
|
|
47
51
|
|
|
48
|
-
const onConfirm = () => {
|
|
52
|
+
const onConfirm = async () => {
|
|
49
53
|
markEncounterAsStale(encounterUuid);
|
|
50
54
|
for (const medicationRequestBundle of medicationRequestBundles) {
|
|
51
55
|
const medicationDispensePayload = initiateMedicationDispenseBody(
|
|
@@ -57,7 +61,21 @@ const OnPrescriptionFilledModal: React.FC<OnPrescriptionFilledModalProps> = ({ p
|
|
|
57
61
|
const medicationDisplay = getMedicationDisplay(
|
|
58
62
|
getMedicationReferenceOrCodeableConcept(medicationRequestBundle.request),
|
|
59
63
|
);
|
|
60
|
-
|
|
64
|
+
|
|
65
|
+
await saveMedicationDispense(medicationDispensePayload, MedicationDispenseStatus.completed)
|
|
66
|
+
.then((response) => {
|
|
67
|
+
const hasNoRefills = medicationRequestBundle.request.dispenseRequest.numberOfRepeatsAllowed == 0;
|
|
68
|
+
if (response.ok && hasNoRefills) {
|
|
69
|
+
return updateMedicationRequestFulfillerStatus(
|
|
70
|
+
getUuidFromReference(
|
|
71
|
+
medicationDispensePayload.authorizingPrescription[0].reference, // assumes authorizing prescription exist
|
|
72
|
+
),
|
|
73
|
+
MedicationRequestFulfillerStatus.completed,
|
|
74
|
+
).then(() => response);
|
|
75
|
+
} else {
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
})
|
|
61
79
|
.then(() => {
|
|
62
80
|
showSnackbar({
|
|
63
81
|
title: t('stockDispensed', 'Stock dispensed'),
|
|
@@ -87,9 +105,9 @@ const OnPrescriptionFilledModal: React.FC<OnPrescriptionFilledModalProps> = ({ p
|
|
|
87
105
|
<ModalHeader>{t('dispenseAllPrescriptions', 'Dispense prescriptions')}</ModalHeader>
|
|
88
106
|
<ModalBody>
|
|
89
107
|
<p className={styles.modalDescription}>
|
|
90
|
-
<Trans i18nKey="
|
|
91
|
-
Would you like to mark prescriptions ordered for <strong>{{ patientName } as any}</strong> as dispensed
|
|
92
|
-
completed
|
|
108
|
+
<Trans i18nKey="dispenseAllPrescriptionsConfirmation">
|
|
109
|
+
Would you like to mark prescriptions ordered for <strong>{{ patientName } as any}</strong> as dispensed?
|
|
110
|
+
Orders with no refills will be marked as completed.
|
|
93
111
|
</Trans>
|
|
94
112
|
</p>
|
|
95
113
|
{medicationRequestBundles.map((bundle) => (
|
|
@@ -102,7 +120,12 @@ const OnPrescriptionFilledModal: React.FC<OnPrescriptionFilledModalProps> = ({ p
|
|
|
102
120
|
<Button kind="secondary" onClick={close}>
|
|
103
121
|
{t('cancel', 'Cancel')}
|
|
104
122
|
</Button>
|
|
105
|
-
<Button
|
|
123
|
+
<Button
|
|
124
|
+
onClick={() => {
|
|
125
|
+
onConfirm();
|
|
126
|
+
}}>
|
|
127
|
+
{t('dispenseAllPrescriptions', 'Dispense all prescriptions')}
|
|
128
|
+
</Button>
|
|
106
129
|
</ModalFooter>
|
|
107
130
|
</>
|
|
108
131
|
);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
width: 100%;
|
|
13
13
|
margin: layout.$spacing-01 0 layout.$spacing-03;
|
|
14
|
-
padding: 0;
|
|
14
|
+
padding: 0 0 0 layout.$spacing-03;
|
|
15
15
|
background-color: #fff;
|
|
16
16
|
border-left: layout.$spacing-03 solid var(--brand-03);
|
|
17
17
|
color: $text-02;
|
package/src/utils.ts
CHANGED
|
@@ -270,7 +270,7 @@ export function computePrescriptionStatusMessageCode(
|
|
|
270
270
|
return null;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
export function computeQuantityRemaining(medicationRequestBundle): number {
|
|
273
|
+
export function computeQuantityRemaining(medicationRequestBundle: MedicationRequestBundle): number {
|
|
274
274
|
if (medicationRequestBundle) {
|
|
275
275
|
// hard protect against quantity type mistmatch
|
|
276
276
|
if (!getQuantityUnitsMatch([medicationRequestBundle.request, ...medicationRequestBundle.dispenses])) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"3019568427d147c1","duration":43603}
|
|
Binary file
|