@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2475 → 5.4.2-pre.2478

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"hiv-care-and-treatment-dashboard-link","slot":"patient-chart-dashboard-slot","component":"hivCareAndTreatmentLink","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hiv-care-and-treatment-dashboard-slot","path":"hiv-care-and-treatment-dashboard","layoutMode":"anchored"}},{"name":"hiv-care-and-treatment-dashboard","slot":"patient-chart-hiv-care-and-treatment-dashboard-slot","component":"hivCareAndTreatment","order":0,"online":true,"offline":false},{"name":"relationship-dashboard-link","slot":"patient-chart-dashboard-slot","component":"relationshipsLink","order":24,"online":true,"offline":false,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationship-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationship-dashboard","slot":"patient-chart-relationship-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"clinical-encounter-dashboard-link","component":"clinicalEncounterLink","slot":"patient-chart-dashboard-slot","order":25,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter-dashboard","slot":"patient-chart-clinical-encounter-slot","component":"clinicalEncounter","order":0,"online":true,"offline":false},{"name":"maternal-and-child-health-dashboard-link","component":"maternalAndChildHealthDashboardLink","slot":"patient-chart-dashboard-slot","order":26,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-maternal-and-child-health-slot","path":"maternal-and-child-health","layoutMode":"anchored"}},{"name":"maternal-and-child-health-dashboard","slot":"patient-chart-maternal-and-child-health-slot","component":"maternalAndChildHealthDashboard","order":0,"online":true,"offline":false},{"name":"contact-list-dashboard-link","component":"contactListLink","slot":"patient-chart-dashboard-slot","order":27,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-contact-list-slot","path":"contact-list","layoutMode":"anchored"}},{"name":"contact-list-dashboard","slot":"patient-chart-contact-list-slot","component":"contactList","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"special-clinics-dashboard-link","component":"specialClinicsDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinics-slot","path":"special-clinics","layoutMode":"anchored"}},{"name":"special-clinics-dashboard","slot":"patient-chart-special-clinics-slot","component":"specialClinicsDashboard","order":0,"online":true,"offline":false}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"contact-list-form","component":"contactListForm","title":"Contact List Form","type":"form"},{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"contact-list-update-form","component":"contactListUpdateForm","title":"Contact List Update Form","type":"form"},{"name":"other-relationship-form","component":"otherRelationshipsForm","title":"Other Relationships Form","type":"form"},{"name":"end-relationship-form","component":"endRelationshipWorkspace","title":"Discontinue relationship form","type":"form"}],"version":"5.4.2-pre.2475"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"hiv-care-and-treatment-dashboard-link","slot":"patient-chart-dashboard-slot","component":"hivCareAndTreatmentLink","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hiv-care-and-treatment-dashboard-slot","path":"hiv-care-and-treatment-dashboard","layoutMode":"anchored"}},{"name":"hiv-care-and-treatment-dashboard","slot":"patient-chart-hiv-care-and-treatment-dashboard-slot","component":"hivCareAndTreatment","order":0,"online":true,"offline":false},{"name":"relationship-dashboard-link","slot":"patient-chart-dashboard-slot","component":"relationshipsLink","order":24,"online":true,"offline":false,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationship-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationship-dashboard","slot":"patient-chart-relationship-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"clinical-encounter-dashboard-link","component":"clinicalEncounterLink","slot":"patient-chart-dashboard-slot","order":25,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter-dashboard","slot":"patient-chart-clinical-encounter-slot","component":"clinicalEncounter","order":0,"online":true,"offline":false},{"name":"maternal-and-child-health-dashboard-link","component":"maternalAndChildHealthDashboardLink","slot":"patient-chart-dashboard-slot","order":26,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-maternal-and-child-health-slot","path":"maternal-and-child-health","layoutMode":"anchored"}},{"name":"maternal-and-child-health-dashboard","slot":"patient-chart-maternal-and-child-health-slot","component":"maternalAndChildHealthDashboard","order":0,"online":true,"offline":false},{"name":"contact-list-dashboard-link","component":"contactListLink","slot":"patient-chart-dashboard-slot","order":27,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-contact-list-slot","path":"contact-list","layoutMode":"anchored"}},{"name":"contact-list-dashboard","slot":"patient-chart-contact-list-slot","component":"contactList","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"special-clinics-dashboard-link","component":"specialClinicsDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinics-slot","path":"special-clinics","layoutMode":"anchored"}},{"name":"special-clinics-dashboard","slot":"patient-chart-special-clinics-slot","component":"specialClinicsDashboard","order":0,"online":true,"offline":false},{"name":"dispensing-homepage-dashboard-link","component":"pharmacyLink","slot":"homepage-dashboard-slot","meta":{"name":"dispensing","title":"Dispensing","path":"dispensing","slot":"dispensing-homepage-dashboard-slot"}},{"name":"home-page-dispensing-dashboard","component":"pharmacy","slot":"dispensing-homepage-dashboard-slot","order":0,"online":true,"offline":false}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"contact-list-form","component":"contactListForm","title":"Contact List Form","type":"form"},{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"contact-list-update-form","component":"contactListUpdateForm","title":"Contact List Update Form","type":"form"},{"name":"other-relationship-form","component":"otherRelationshipsForm","title":"Other Relationships Form","type":"form"},{"name":"end-relationship-form","component":"endRelationshipWorkspace","title":"Discontinue relationship form","type":"form"}],"version":"5.4.2-pre.2478"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-patient-clinical-view-app",
3
- "version": "5.4.2-pre.2475",
3
+ "version": "5.4.2-pre.2478",
4
4
  "description": "Patient clinical view microfrontend for the OpenMRS SPA",
5
5
  "browser": "dist/kenyaemr-esm-patient-clinical-view-app.js",
6
6
  "main": "src/index.ts",
@@ -90,3 +90,10 @@ export const specialClinicsDashboardMeta = {
90
90
  config: {},
91
91
  icon: 'omrs-icon-location',
92
92
  };
93
+
94
+ export const dispensingDashboardMeta = {
95
+ name: 'dispensing',
96
+ title: 'Pharmacy',
97
+ path: 'dispensing',
98
+ icon: 'omrs-icon-image-medical',
99
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ExtensionSlot, WorkspaceContainer } from '@openmrs/esm-framework';
3
+
4
+ const Pharmacy = () => {
5
+ return (
6
+ <div>
7
+ <ExtensionSlot name="dispensing-dashboard-slot" />
8
+ <WorkspaceContainer key="dispensing" contextKey="dispensing" />
9
+ </div>
10
+ );
11
+ };
12
+
13
+ export default Pharmacy;
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  caseEncounterDashboardMeta,
7
7
  caseManagementDashboardMeta,
8
8
  contactListDashboardMeta,
9
+ dispensingDashboardMeta,
9
10
  peerCalendarDashboardMeta,
10
11
  relationshipsDashboardMeta,
11
12
  specialClinicsDashboardMeta,
@@ -47,6 +48,7 @@ import { configSchema } from './config-schema';
47
48
  import SpecialClinicDashboard from './special-clinics/special-clinic.component';
48
49
  import { createDashboardLink as createDashboardLink2 } from './dashboard/createDashboardLink';
49
50
  import { createLeftPanelLink } from './left-panel-link.component';
51
+ import Pharmacy from './dispensing/pharmacy.component';
50
52
 
51
53
  const moduleName = '@kenyaemr/esm-patient-clinical-view-app';
52
54
 
@@ -108,6 +110,9 @@ export const inPatientChartDashboard = getSyncLifecycle(InPatient, options);
108
110
  export const specialClinicsDashboardLink = getSyncLifecycle(createDashboardLink(specialClinicsDashboardMeta), options);
109
111
  export const specialClinicsDashboard = getSyncLifecycle(SpecialClinicDashboard, options);
110
112
 
113
+ export const pharmacyLink = getSyncLifecycle(createLeftPanelLink(dispensingDashboardMeta), options);
114
+ export const pharmacy = getSyncLifecycle(Pharmacy, options);
115
+
111
116
  export function startupApp() {
112
117
  defineConfigSchema(moduleName, configSchema);
113
118
  }
@@ -1,15 +1,20 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import last from 'lodash-es/last';
3
3
  import { BrowserRouter, useLocation } from 'react-router-dom';
4
- import { ConfigurableLink } from '@openmrs/esm-framework';
4
+ import { ConfigurableLink, MaybeIcon } from '@openmrs/esm-framework';
5
+ import { useTranslation } from 'react-i18next';
6
+
7
+ import styles from './leftt-panel-link.scss';
5
8
 
6
9
  export interface LinkConfig {
7
10
  name: string;
8
11
  title: string;
12
+ icon?: string;
9
13
  }
10
14
 
11
15
  export function LinkExtension({ config }: { config: LinkConfig }) {
12
- const { name, title } = config;
16
+ const { name, title, icon } = config;
17
+ const { t } = useTranslation();
13
18
  const location = useLocation();
14
19
  const spaBasePath = window.getOpenmrsSpaBase() + 'home';
15
20
 
@@ -26,9 +31,12 @@ export function LinkExtension({ config }: { config: LinkConfig }) {
26
31
 
27
32
  return (
28
33
  <ConfigurableLink
29
- to={spaBasePath + '/' + name}
30
- className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}>
31
- {title}
34
+ className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}
35
+ to={spaBasePath + '/' + name}>
36
+ <span className={styles.menu}>
37
+ <MaybeIcon icon={icon} className={styles.icon} size={16} />
38
+ <span>{t(title)}</span>
39
+ </span>
32
40
  </ConfigurableLink>
33
41
  );
34
42
  }
@@ -0,0 +1,13 @@
1
+ @use '@carbon/colors';
2
+ @use '@carbon/layout';
3
+
4
+ .menu {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ }
9
+
10
+ .icon {
11
+ margin-right: layout.$spacing-06;
12
+ fill: colors.$gray-70;
13
+ }
package/src/routes.json CHANGED
@@ -209,6 +209,25 @@
209
209
  "order": 0,
210
210
  "online": true,
211
211
  "offline": false
212
+ },
213
+ {
214
+ "name": "dispensing-homepage-dashboard-link",
215
+ "component": "pharmacyLink",
216
+ "slot": "homepage-dashboard-slot",
217
+ "meta": {
218
+ "name": "dispensing",
219
+ "title": "Dispensing",
220
+ "path": "dispensing",
221
+ "slot": "dispensing-homepage-dashboard-slot"
222
+ }
223
+ },
224
+ {
225
+ "name": "home-page-dispensing-dashboard",
226
+ "component": "pharmacy",
227
+ "slot": "dispensing-homepage-dashboard-slot",
228
+ "order": 0,
229
+ "online": true,
230
+ "offline": false
212
231
  }
213
232
  ],
214
233
  "modals": [