@openmrs/esm-dispensing-app 1.6.2 → 1.6.3-pre.11

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.
Files changed (194) hide show
  1. package/.turbo/cache/cd52ef42faa9efe1-meta.json +1 -0
  2. package/.turbo/cache/cd52ef42faa9efe1.tar.zst +0 -0
  3. package/.turbo/turbo-build.log +44 -0
  4. package/README.md +1 -0
  5. package/dist/1616.js +2 -0
  6. package/dist/{524.js.LICENSE.txt → 1616.js.LICENSE.txt} +9 -14
  7. package/dist/1616.js.map +1 -0
  8. package/dist/1637.js +1 -0
  9. package/dist/1637.js.map +1 -0
  10. package/dist/1644.js +1 -0
  11. package/dist/1901.js +1 -0
  12. package/dist/1905.js +1 -0
  13. package/dist/1905.js.map +1 -0
  14. package/dist/2016.js +1 -0
  15. package/dist/2511.js +1 -0
  16. package/dist/2511.js.map +1 -0
  17. package/dist/2757.js +1 -0
  18. package/dist/3574.js +1 -0
  19. package/dist/3652.js +1 -0
  20. package/dist/3935.js +2 -0
  21. package/dist/3935.js.map +1 -0
  22. package/dist/4272.js +1 -0
  23. package/dist/4378.js +1 -0
  24. package/dist/4460.js +1 -0
  25. package/dist/4705.js +1 -0
  26. package/dist/5240.js +1 -0
  27. package/dist/5336.js +1 -0
  28. package/dist/5673.js +1 -0
  29. package/dist/5711.js +1 -0
  30. package/dist/5737.js +1 -0
  31. package/dist/5833.js +1 -0
  32. package/dist/5962.js +1 -0
  33. package/dist/6497.js +1 -0
  34. package/dist/6566.js +1 -0
  35. package/dist/6582.js +1 -0
  36. package/dist/6582.js.map +1 -0
  37. package/dist/6727.js +1 -0
  38. package/dist/6868.js +2 -0
  39. package/dist/6868.js.LICENSE.txt +14 -0
  40. package/dist/6868.js.map +1 -0
  41. package/dist/6936.js +1 -0
  42. package/dist/6936.js.map +1 -0
  43. package/dist/6973.js +1 -0
  44. package/dist/6973.js.map +1 -0
  45. package/dist/7294.js +2 -0
  46. package/dist/7294.js.map +1 -0
  47. package/dist/7484.js +1 -0
  48. package/dist/7484.js.map +1 -0
  49. package/dist/7626.js +1 -0
  50. package/dist/7626.js.map +1 -0
  51. package/dist/7687.js +1 -0
  52. package/dist/7687.js.map +1 -0
  53. package/dist/7807.js +1 -0
  54. package/dist/7998.js +1 -0
  55. package/dist/8077.js +1 -0
  56. package/dist/8077.js.map +1 -0
  57. package/dist/8271.js +1 -0
  58. package/dist/8319.js +1 -0
  59. package/dist/8323.js +1 -0
  60. package/dist/8788.js +1 -0
  61. package/dist/8949.js +1 -0
  62. package/dist/8949.js.map +1 -0
  63. package/dist/9204.js +2 -0
  64. package/dist/{204.js.LICENSE.txt → 9204.js.LICENSE.txt} +2 -0
  65. package/dist/9204.js.map +1 -0
  66. package/dist/9261.js +1 -0
  67. package/dist/9579.js +1 -0
  68. package/dist/9870.js +2 -0
  69. package/dist/9870.js.LICENSE.txt +9 -0
  70. package/dist/9870.js.map +1 -0
  71. package/dist/main.js +1 -1
  72. package/dist/main.js.LICENSE.txt +21 -11
  73. package/dist/main.js.map +1 -1
  74. package/dist/openmrs-esm-dispensing-app.js +1 -1
  75. package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +455 -244
  76. package/dist/openmrs-esm-dispensing-app.js.map +1 -1
  77. package/dist/routes.json +1 -1
  78. package/jest.config.js +3 -1
  79. package/package.json +7 -4
  80. package/src/components/action-buttons.component.tsx +7 -0
  81. package/src/components/{action-buttons.component.test.tsx → action-buttons.test.tsx} +8 -7
  82. package/src/components/medication-card.component.tsx +3 -3
  83. package/src/components/medication-card.scss +8 -8
  84. package/src/components/medication-dispense-review.scss +16 -10
  85. package/src/components/medication-event.component.tsx +4 -4
  86. package/src/components/medication-event.scss +10 -5
  87. package/src/components/patient-details.component.tsx +4 -4
  88. package/src/components/patient-details.scss +12 -12
  89. package/src/components/prescription-actions/close-action-button.component.tsx +1 -1
  90. package/src/components/prescription-actions/dispense-action-button.component.tsx +4 -1
  91. package/src/components/prescription-actions/pause-action-button.component.tsx +1 -1
  92. package/src/conditions/conditions.component.tsx +93 -0
  93. package/src/conditions/conditions.resource.ts +100 -0
  94. package/src/conditions/conditions.scss +9 -0
  95. package/src/config-schema.ts +8 -0
  96. package/src/dashboard/dispensing-dashboard-link.component.tsx +1 -1
  97. package/src/dashboard/dispensing-dashboard.component.tsx +10 -4
  98. package/src/declarations.d.ts +0 -1
  99. package/src/diagnoses/diagnoses.component.tsx +92 -0
  100. package/src/diagnoses/diagnoses.resource.ts +30 -0
  101. package/src/diagnoses/diagnoses.scss +9 -0
  102. package/src/dispensing-tiles/dispensing-tile.component.tsx +20 -17
  103. package/src/dispensing-tiles/dispensing-tile.scss +8 -8
  104. package/src/dispensing-tiles/dispensing-tiles.scss +4 -5
  105. package/src/forms/close-dispense-form.workspace.tsx +25 -23
  106. package/src/forms/dispense-form.workspace.tsx +3 -0
  107. package/src/forms/forms.scss +5 -9
  108. package/src/forms/medication-dispense-review.component.tsx +235 -204
  109. package/src/forms/{medication-dispense-review.component.test.tsx → medication-dispense-review.test.tsx} +2 -1
  110. package/src/forms/pause-dispense-form.workspace.tsx +25 -23
  111. package/src/forms/stock-dispense/stock-dispense.component.tsx +10 -10
  112. package/src/history/history-and-comments.component.tsx +8 -1
  113. package/src/history/history-and-comments.scss +17 -15
  114. package/src/index.ts +3 -0
  115. package/src/location/location.resource.test.tsx +1 -0
  116. package/src/medication/medication.resource.tsx +1 -1
  117. package/src/patient/patient-info-cell.component.tsx +1 -1
  118. package/src/pharmacy-header/pharmacy-header.scss +11 -11
  119. package/src/prescriptions/prescription-actions.scss +0 -1
  120. package/src/prescriptions/prescription-details.component.tsx +6 -6
  121. package/src/prescriptions/prescription-details.scss +10 -10
  122. package/src/prescriptions/prescription-expanded.component.tsx +5 -9
  123. package/src/prescriptions/prescription-expanded.scss +6 -7
  124. package/src/prescriptions/prescription-tab-lists.component.tsx +5 -5
  125. package/src/prescriptions/prescriptions.scss +15 -29
  126. package/src/print-prescription/prescription-printout.component.tsx +1 -1
  127. package/src/routes.json +14 -0
  128. package/src/utils.ts +1 -1
  129. package/tools/setup-tests.ts +1 -0
  130. package/tools/update-openmrs-deps.mjs +42 -0
  131. package/translations/en.json +9 -1
  132. package/translations/es.json +23 -23
  133. package/translations/it.json +87 -87
  134. package/translations/ky.json +92 -0
  135. package/tsconfig.json +3 -2
  136. package/dist/16.js +0 -1
  137. package/dist/204.js +0 -2
  138. package/dist/204.js.map +0 -1
  139. package/dist/240.js +0 -1
  140. package/dist/261.js +0 -1
  141. package/dist/271.js +0 -1
  142. package/dist/272.js +0 -1
  143. package/dist/294.js +0 -2
  144. package/dist/294.js.map +0 -1
  145. package/dist/319.js +0 -1
  146. package/dist/323.js +0 -1
  147. package/dist/336.js +0 -1
  148. package/dist/378.js +0 -1
  149. package/dist/460.js +0 -1
  150. package/dist/484.js +0 -1
  151. package/dist/484.js.map +0 -1
  152. package/dist/497.js +0 -1
  153. package/dist/524.js +0 -2
  154. package/dist/524.js.map +0 -1
  155. package/dist/566.js +0 -1
  156. package/dist/574.js +0 -1
  157. package/dist/579.js +0 -1
  158. package/dist/626.js +0 -1
  159. package/dist/626.js.map +0 -1
  160. package/dist/637.js +0 -1
  161. package/dist/637.js.map +0 -1
  162. package/dist/644.js +0 -1
  163. package/dist/652.js +0 -1
  164. package/dist/673.js +0 -1
  165. package/dist/705.js +0 -1
  166. package/dist/711.js +0 -1
  167. package/dist/727.js +0 -1
  168. package/dist/737.js +0 -1
  169. package/dist/749.js +0 -1
  170. package/dist/749.js.map +0 -1
  171. package/dist/757.js +0 -1
  172. package/dist/77.js +0 -1
  173. package/dist/77.js.map +0 -1
  174. package/dist/788.js +0 -1
  175. package/dist/803.js +0 -1
  176. package/dist/803.js.map +0 -1
  177. package/dist/807.js +0 -1
  178. package/dist/833.js +0 -1
  179. package/dist/888.js +0 -1
  180. package/dist/888.js.map +0 -1
  181. package/dist/890.js +0 -1
  182. package/dist/890.js.map +0 -1
  183. package/dist/901.js +0 -1
  184. package/dist/905.js +0 -1
  185. package/dist/905.js.map +0 -1
  186. package/dist/935.js +0 -2
  187. package/dist/935.js.map +0 -1
  188. package/dist/962.js +0 -1
  189. package/src/root.scss +0 -50
  190. package/src/setup-tests.ts +0 -1
  191. /package/dist/{935.js.LICENSE.txt → 3935.js.LICENSE.txt} +0 -0
  192. /package/dist/{294.js.LICENSE.txt → 7294.js.LICENSE.txt} +0 -0
  193. /package/src/components/{medication-card.component.test.tsx → medication-card.test.tsx} +0 -0
  194. /package/{i18next-parser.config.js → tools/i18next-parser.config.js} +0 -0
@@ -31,6 +31,7 @@ import {
31
31
  getUuidFromReference,
32
32
  revalidate,
33
33
  sortMedicationDispensesByWhenHandedOver,
34
+ computeTotalQuantityDispensed,
34
35
  } from '../utils';
35
36
  import { type PharmacyConfig } from '../config-schema';
36
37
 
@@ -81,12 +82,18 @@ const HistoryAndComments: React.FC<{
81
82
  (medicationDispense?.quantity ? medicationDispense.quantity.value : 0);
82
83
  }
83
84
 
85
+ let quantityDispensed = 0;
86
+ if (medicationRequestBundle.dispenses) {
87
+ quantityDispensed = computeTotalQuantityDispensed(medicationRequestBundle.dispenses);
88
+ }
89
+
84
90
  const dispenseFormProps = {
85
91
  patientUuid,
86
92
  encounterUuid,
87
93
  medicationDispense,
88
94
  medicationRequestBundle,
89
95
  quantityRemaining,
96
+ quantityDispensed,
90
97
  mode: 'edit',
91
98
  };
92
99
 
@@ -231,11 +238,11 @@ const HistoryAndComments: React.FC<{
231
238
  {formatDatetime(parseDate(dispense.whenHandedOver))}
232
239
  </h5>
233
240
  <Tile className={styles.dispenseTile} data-floating-menu-container>
241
+ <MedicationEvent medicationEvent={dispense} status={generateDispenseTag(dispense)} />
234
242
  {generateMedicationDispenseActionMenu(
235
243
  dispense,
236
244
  getMedicationRequestBundleContainingMedicationDispense(medicationRequestBundles, dispense),
237
245
  )}
238
- <MedicationEvent medicationEvent={dispense} status={generateDispenseTag(dispense)} />
239
246
  </Tile>
240
247
  </div>
241
248
  );
@@ -1,6 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
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 10px 0 0;
17
- padding: 10px;
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: 20px;
24
- min-height: 2.5rem !important;
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,24 @@
30
30
 
31
31
  .requestTile {
32
32
  width: 100%;
33
- margin: 2px 0 8px;
34
- padding: 0 8px 0 8px;
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: 4px solid var(--brand-03);
36
+ border-left: layout.$spacing-03 solid var(--brand-03);
37
37
  color: $text-02;
38
- margin-bottom: 1rem !important;
38
+ margin-bottom: layout.$spacing-05 !important;
39
39
  }
40
40
 
41
41
  .dispenseTile {
42
+ display: flex;
43
+ justify-content: space-between;
42
44
  width: 100%;
43
- margin: 2px 0 8px;
44
- padding: 0 8px 0 8px;
45
+ margin: layout.$spacing-01 0 layout.$spacing-03;
46
+ padding: 0 layout.$spacing-03 0 layout.$spacing-03;
45
47
  background-color: #fff;
46
- border-left: 4px solid red;
48
+ border-left: layout.$spacing-03 solid red;
47
49
  color: $text-02;
48
- margin-bottom: 1rem !important;
50
+ margin-bottom: layout.$spacing-05 !important;
49
51
  }
50
52
 
51
53
  .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);
@@ -34,6 +34,7 @@ const pharmacyConfig: PharmacyConfig = {
34
34
  substitutionType: { uuid: '' },
35
35
  },
36
36
  enableStockDispense: false,
37
+ validateBatch: false,
37
38
  };
38
39
 
39
40
  describe('Location Resource tests', () => {
@@ -35,7 +35,7 @@ export function useMedicationFormulations(medicationCodeableConcept: string) {
35
35
  openmrsFetch,
36
36
  );
37
37
 
38
- if (data) {
38
+ if (data?.data?.entry) {
39
39
  return {
40
40
  medicationFormulations: data.data.entry.map((e) => e.resource),
41
41
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { usePatientAge } from './patient.resources';
3
2
  import { useTranslation } from 'react-i18next';
3
+ import { usePatientAge } from './patient.resources';
4
4
 
5
5
  type PatientInfoCellProps = {
6
6
  patient: {
@@ -1,11 +1,11 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .header {
6
6
  @include type.type-style('body-compact-02');
7
7
  color: $text-02;
8
- height: spacing.$spacing-12;
8
+ height: layout.$spacing-12;
9
9
  background-color: $ui-02;
10
10
  display: flex;
11
11
  justify-content: space-between;
@@ -15,13 +15,13 @@
15
15
  display: flex;
16
16
  flex-direction: row;
17
17
  align-items: center;
18
- margin-left: 1rem;
18
+ margin-left: layout.$spacing-05;
19
19
  }
20
20
 
21
21
  .rightJustifiedItems {
22
22
  @include type.type-style('body-compact-02');
23
23
  color: $text-02;
24
- padding-top: 1rem;
24
+ padding-top: layout.$spacing-05;
25
25
  }
26
26
 
27
27
  .pageName {
@@ -29,9 +29,9 @@
29
29
  }
30
30
 
31
31
  .pageLabels {
32
- margin-left: 1rem;
32
+ margin-left: layout.$spacing-05;
33
33
  p:first-of-type {
34
- margin-bottom: 0.25rem;
34
+ margin-bottom: layout.$spacing-02;
35
35
  }
36
36
  }
37
37
 
@@ -39,15 +39,15 @@
39
39
  display: flex;
40
40
  justify-content: flex-end;
41
41
  align-items: center;
42
- margin-right: 1rem;
42
+ margin-right: layout.$spacing-05;
43
43
  }
44
44
 
45
45
  .value {
46
- margin-left: 0.25rem;
46
+ margin-left: layout.$spacing-02;
47
47
  }
48
48
 
49
49
  .middot {
50
- margin: 0 0.5rem;
50
+ margin: 0 layout.$spacing-03;
51
51
  }
52
52
 
53
53
  .view {
@@ -1,6 +1,5 @@
1
1
  @use '@carbon/colors';
2
2
  @use '@carbon/layout';
3
- @use '@carbon/type';
4
3
 
5
4
  .actionsContainer {
6
5
  flex-direction: row;
@@ -1,15 +1,15 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
1
  import { DataTableSkeleton, Tag, Tile } from '@carbon/react';
4
2
  import { WarningFilled } from '@carbon/react/icons';
5
3
  import { type PatientUuid, useConfig, UserHasAccess } from '@openmrs/esm-framework';
4
+ import React, { useEffect, useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import ActionButtons from '../components/action-buttons.component';
7
+ import MedicationEvent from '../components/medication-event.component';
6
8
  import { type PharmacyConfig } from '../config-schema';
7
- import { type AllergyIntolerance, type MedicationRequest, MedicationRequestCombinedStatus } from '../types';
8
- import { computeMedicationRequestCombinedStatus, getConceptCodingDisplay } from '../utils';
9
9
  import { PRIVILEGE_CREATE_DISPENSE } from '../constants';
10
10
  import { usePatientAllergies, usePrescriptionDetails } from '../medication-request/medication-request.resource';
11
- import ActionButtons from '../components/action-buttons.component';
12
- import MedicationEvent from '../components/medication-event.component';
11
+ import { type AllergyIntolerance, type MedicationRequest, MedicationRequestCombinedStatus } from '../types';
12
+ import { computeMedicationRequestCombinedStatus, getConceptCodingDisplay } from '../utils';
13
13
  import PrescriptionsActionsFooter from './prescription-actions.component';
14
14
  import styles from './prescription-details.scss';
15
15
 
@@ -1,22 +1,22 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type/index';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .prescriptionTile {
6
6
  width: 100%;
7
- margin: 2px 0 8px;
7
+ margin: layout.$spacing-01 0 layout.$spacing-03;
8
8
  padding: 0;
9
9
  background-color: #fff;
10
- border-left: 4px solid var(--brand-03);
10
+ border-left: layout.$spacing-02 solid var(--brand-03);
11
11
  color: $text-02;
12
- margin-bottom: 1rem !important;
12
+ margin-bottom: layout.$spacing-05 !important;
13
13
  }
14
14
 
15
15
  .prescriptionContainer {
16
16
  display: flex;
17
17
  flex-direction: column;
18
18
  max-width: 80%;
19
- margin-bottom: 1rem;
19
+ margin-bottom: layout.$spacing-05;
20
20
 
21
21
  &:global(.cds--tile) {
22
22
  min-height: 3rem !important;
@@ -31,9 +31,9 @@
31
31
  }
32
32
 
33
33
  .allergiesTile {
34
- height: 24px;
35
- padding: 0 8px 0 0;
36
- border-left: 4px solid #f1c21b;
34
+ height: layout.$spacing-06;
35
+ padding: 0 layout.$spacing-03 0 0;
36
+ border-left: layout.$spacing-02 solid #f1c21b;
37
37
  background-color: rgba(253, 209, 58, 0.3);
38
38
  margin: auto;
39
39
  width: 100%;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type PatientUuid } from '@openmrs/esm-framework';
2
+ import { ExtensionSlot, type PatientUuid } from '@openmrs/esm-framework';
3
3
  import { Tab, Tabs, TabList, TabPanels, TabPanel } from '@carbon/react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import HistoryAndComments from '../history/history-and-comments.component';
@@ -23,18 +23,14 @@ const PrescriptionExpanded: React.FC<{
23
23
  name: t('prescriptionDetails', 'Prescription details'),
24
24
  component: <PrescriptionDetails encounterUuid={encounterUuid} patientUuid={patientUuid} />,
25
25
  },
26
+ {
27
+ name: t('conditionsAndDiagnoses', 'Conditions and diagnoses'),
28
+ component: <ExtensionSlot name="dispensing-condition-and-diagnoses" state={{ patientUuid, encounterUuid }} />,
29
+ },
26
30
  {
27
31
  name: t('historyComments', 'History and comments'),
28
32
  component: <HistoryAndComments encounterUuid={encounterUuid} patientUuid={patientUuid} />,
29
33
  },
30
- /* {
31
- name: t("patientDetails", "Patient details"),
32
- component: <PatientDetails patientUuid={patientUuid} />,
33
- },*/
34
- // {
35
- // name: t("billing", "Billing"),
36
- // component: <div>Billing</div>,
37
- // },
38
34
  ];
39
35
 
40
36
  return (
@@ -1,11 +1,10 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
3
 
5
4
  .expandedTabsParentContainer {
6
5
  display: flex;
7
6
  flex-direction: column;
8
- margin-bottom: spacing.$spacing-05;
7
+ margin-bottom: layout.$spacing-05;
9
8
  }
10
9
 
11
10
  .expandedTabsContainer {
@@ -13,7 +12,7 @@
13
12
  flex-direction: row;
14
13
 
15
14
  :global(.cds--tabs) {
16
- margin: 1rem 0;
15
+ margin: layout.$spacing-05 0;
17
16
  width: 20%;
18
17
  max-height: 8rem !important;
19
18
  }
@@ -23,7 +22,7 @@
23
22
  }
24
23
 
25
24
  :global(.cds--tab-content) {
26
- margin: 1rem 0;
25
+ margin: layout.$spacing-05 0;
27
26
  width: 100% !important;
28
27
  }
29
28
 
@@ -38,7 +37,7 @@
38
37
  }
39
38
 
40
39
  &:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-item + .cds--tabs--scrollable__nav-item) {
41
- margin-left: 0rem !important;
40
+ margin-left: 0 !important;
42
41
  }
43
42
 
44
43
  > ul {
@@ -1,12 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Tab, Tabs, TabList, TabPanels, Search, ComboBox } from '@carbon/react';
2
+ import { ComboBox, Search, Tab, Tabs, TabList, TabPanels } from '@carbon/react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import PrescriptionTabPanel from './prescription-tab-panel.component';
5
- import styles from './prescriptions.scss';
6
- import { useLocationForFiltering } from '../location/location.resource';
7
4
  import { useConfig } from '@openmrs/esm-framework';
5
+ import { useLocationForFiltering } from '../location/location.resource';
8
6
  import { type SimpleLocation } from '../types';
9
7
  import { type PharmacyConfig } from '../config-schema';
8
+ import PrescriptionTabPanel from './prescription-tab-panel.component';
9
+ import styles from './prescriptions.scss';
10
10
 
11
11
  const PrescriptionTabLists: React.FC = () => {
12
12
  const { t } = useTranslation();
@@ -45,7 +45,7 @@ const PrescriptionTabLists: React.FC = () => {
45
45
  };
46
46
 
47
47
  return (
48
- <main className={`omrs-main-content ${styles.prescriptionListContainer}`}>
48
+ <main className="omrs-main-content">
49
49
  <section className={styles.prescriptionTabsContainer}>
50
50
  <Tabs
51
51
  className={styles.prescriptionTabs}
@@ -1,20 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
4
- @import '../root.scss';
5
-
6
- title {
7
- width: 6.938rem;
8
- height: 1.75rem;
9
- margin: 0.438rem 22.875rem 0.813rem 0;
10
- font-family: IBMPlexSans;
11
- font-size: 1.25rem;
12
- font-weight: normal;
13
- font-stretch: normal;
14
- font-style: normal;
15
- line-height: 1.4;
16
- letter-spacing: normal;
17
- }
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
18
4
 
19
5
  .link {
20
6
  text-decoration: none;
@@ -36,7 +22,7 @@ title {
36
22
 
37
23
  .prescriptionTabs {
38
24
  grid-column: 'span 2';
39
- padding: 0 spacing.$spacing-05;
25
+ padding: 0 layout.$spacing-05;
40
26
  }
41
27
 
42
28
  .newListButton {
@@ -47,10 +33,10 @@ title {
47
33
 
48
34
  .tabsContainer {
49
35
  background-color: $ui-02;
50
- padding: 0 spacing.$spacing-05;
36
+ padding: 0 layout.$spacing-05;
51
37
 
52
38
  :global(.cds--tabs__nav-item--selected) {
53
- box-shadow: inset 0 2px 0 0 var(--brand-03) !important;
39
+ box-shadow: inset 0 layout.$spacing-01 0 0 var(--brand-03) !important;
54
40
  }
55
41
 
56
42
  :global(.cds--tab--list) button {
@@ -67,7 +53,7 @@ title {
67
53
  grid-row: 3 / 4;
68
54
  grid-column: 1 / 2;
69
55
  height: 100%;
70
- margin: 0 spacing.$spacing-05;
56
+ margin: 0 layout.$spacing-05;
71
57
  background-color: $ui-01;
72
58
  border: 0.5px solid #e0e0e0;
73
59
 
@@ -99,7 +85,7 @@ title {
99
85
  }
100
86
 
101
87
  :global(.cds--table-expand__button) {
102
- height: 2rem !important;
88
+ height: layout.$spacing-07 !important;
103
89
  }
104
90
  }
105
91
 
@@ -107,7 +93,7 @@ title {
107
93
  display: flex;
108
94
  align-items: center;
109
95
  flex-direction: row-reverse;
110
- padding: 0.5rem 1rem 0;
96
+ padding: layout.$spacing-05 layout.$spacing-05 0;
111
97
 
112
98
  :global(.cds--search-magnifier-icon) {
113
99
  z-index: 0 !important;
@@ -119,10 +105,10 @@ title {
119
105
  }
120
106
 
121
107
  .addPrescriptionBtn {
122
- width: 10rem !important;
123
- padding: 0.5rem !important;
124
- margin-left: 1rem;
125
- margin-right: 1rem;
108
+ width: layout.$spacing-13 !important;
109
+ padding: layout.$spacing-05 !important;
110
+ margin-left: layout.$spacing-05;
111
+ margin-right: layout.$spacing-05;
126
112
  }
127
113
 
128
114
  .patientSearch {
@@ -149,7 +135,7 @@ title {
149
135
  display: flex;
150
136
  justify-content: center;
151
137
  align-items: center;
152
- padding: spacing.$spacing-09;
138
+ padding: layout.$spacing-09;
153
139
  text-align: center;
154
140
  background-color: $ui-02;
155
141
  }
@@ -162,7 +148,7 @@ title {
162
148
  .filterEmptyStateContent {
163
149
  @include type.type-style('heading-compact-02');
164
150
  color: $text-02;
165
- margin-bottom: spacing.$spacing-03;
151
+ margin-bottom: layout.$spacing-03;
166
152
  }
167
153
 
168
154
  .filterEmptyStateHelper {
@@ -94,7 +94,7 @@ const PrescriptionsPrintout: React.FC<PrescriptionsPrintoutProps> = ({ medicatio
94
94
  </p>
95
95
  <p>
96
96
  <span className={styles.faintText}>{t('datePrescribed', 'Date prescribed')}</span>
97
- {': '} <span>{formatDate(parseDate(request.request.authoredOn))}</span>
97
+ {': '} <span>{formatDate(parseDate(request.request.authoredOn), { noToday: true })}</span>
98
98
  </p>
99
99
  <p>
100
100
  <span className={styles.faintText}>{t('refills', 'Refills')}</span>
package/src/routes.json CHANGED
@@ -20,6 +20,20 @@
20
20
  "online": true,
21
21
  "offline": true
22
22
  },
23
+ {
24
+ "name": "patient-diagnoses",
25
+ "component": "patientDiagnoses",
26
+ "slot": "dispensing-condition-and-diagnoses",
27
+ "online": true,
28
+ "offline": true
29
+ },
30
+ {
31
+ "name": "patient-conditions",
32
+ "component": "patientConditions",
33
+ "slot": "dispensing-condition-and-diagnoses",
34
+ "online": true,
35
+ "offline": true
36
+ },
23
37
  {
24
38
  "name": "dispensing-dashboard",
25
39
  "slot": "dispensing-dashboard-slot",
package/src/utils.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import dayjs from 'dayjs';
1
2
  import { mutate } from 'swr';
2
3
  import {
3
4
  type Coding,
@@ -21,7 +22,6 @@ import {
21
22
  PRESCRIPTION_DETAILS_ENDPOINT,
22
23
  PRESCRIPTIONS_TABLE_ENDPOINT,
23
24
  } from './constants';
24
- import dayjs from 'dayjs';
25
25
 
26
26
  const unitsDontMatchErrorMessage =
27
27
  "Misconfiguration, please contact your System Administrator: Can't calculate quantity dispensed if units don't match. Likely issue: allowModifyingPrescription and restrictTotalQuantityDispensed configuration parameters both set to true. " +
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,42 @@
1
+ import { execSync } from 'node:child_process';
2
+
3
+ try {
4
+ execSync(`yarn up --fixed '@openmrs/esm-framework@next' '@openmrs@next' '@openmrs/esm-patient-common-lib@next'`, {
5
+ stdio: ['ignore', 'inherit', 'inherit'],
6
+ windowsHide: true,
7
+ });
8
+ } catch (error) {
9
+ console.error(`Error while updating dependencies: ${error.message ?? error}`);
10
+ process.exit(1);
11
+ }
12
+
13
+ try {
14
+ execSync(`yarn dedupe`, {
15
+ stdio: ['ignore', 'inherit', 'inherit'],
16
+ windowsHide: true,
17
+ });
18
+ } catch (error) {
19
+ console.error(`Error while deduplicating dependencies: ${error.message ?? error}`);
20
+ process.exit(1);
21
+ }
22
+
23
+ try {
24
+ execSync(`git diff-index --quiet HEAD --`, {
25
+ stdio: 'ignore',
26
+ windowsHide: true,
27
+ });
28
+ process.exit(0);
29
+ } catch (error) {
30
+ // git diff-index --quite HEAD --
31
+ // exits with status 1 if there are changes; we only need to run yarn verify if there are changes
32
+ }
33
+
34
+ try {
35
+ execSync(`yarn verify`, {
36
+ stdio: ['ignore', 'inherit', 'inherit'],
37
+ windowsHide: true,
38
+ });
39
+ } catch (error) {
40
+ console.error(`Error while running yarn verify: ${error.message ?? error}. Updates require manual intervention.`);
41
+ process.exit(1);
42
+ }
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "active": "Active",
3
+ "activecondition": "Active Condition",
4
+ "activeConditions": "Active Condition",
3
5
  "activePrescriptions": "Active prescriptions",
4
6
  "age": "Age",
5
7
  "allergiesCount_one": "{{count}} allergy",
@@ -14,9 +16,12 @@
14
16
  "closedDispense": "closed dispense",
15
17
  "closePrescription": "Close prescription",
16
18
  "completed": "Completed",
19
+ "conditions": "Condition",
20
+ "conditionsAndDiagnoses": "Conditions and diagnoses",
17
21
  "created": "Created",
18
22
  "datePrescribed": "Date prescribed",
19
23
  "delete": "Delete",
24
+ "diagnosis": "Diagnosis",
20
25
  "dispense": "Dispense",
21
26
  "dispensed": "Dispensed",
22
27
  "dispenseDate": "Date of Dispense",
@@ -38,6 +43,7 @@
38
43
  "errorLoadingInventoryItems": "Error fetching inventory items",
39
44
  "expired": "Expired",
40
45
  "filterByLocation": "Filter by location",
46
+ "finalDiagnoses": "Final Diagnoses",
41
47
  "for": "for",
42
48
  "frequency": "Frequency",
43
49
  "historyComments": "History and comments",
@@ -54,6 +60,7 @@
54
60
  "noPrescriptionsToDisplay": "No prescriptions to display",
55
61
  "noRefills": "No refills",
56
62
  "numberIsNotValid": "Number is not valid",
63
+ "onsetDate": "Onset Date",
57
64
  "ordered": "Ordered",
58
65
  "orderedMedication ": "ordered medication",
59
66
  "orders": "Orders",
@@ -88,5 +95,6 @@
88
95
  "substitutionType": "Type of substitution",
89
96
  "tabList": "Tab List",
90
97
  "today": "Today",
91
- "view": "View"
98
+ "view": "View",
99
+ "visitFinalDiagnoses": "Visit final diagnoses"
92
100
  }