Skip to content

Commit

Permalink
implement hct and tp dashboard workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hadijahkyampeire committed Jun 18, 2024
1 parent 532817f commit 29be08c
Show file tree
Hide file tree
Showing 35 changed files with 248 additions and 765 deletions.
2 changes: 2 additions & 0 deletions packages/esm-commons-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export * from './hooks/useLastEncounter';
export * from './utils/encounter-list-config-builder';
export * from './utils/summary-card-config-builder';
export * from './utils/encounter-tile-config-builder';
export * from './utils/cohort-list-config-builder';
export * from './utils/patient-list-tabs-config-builder';
// Workspace registration moved to the index.ts and routes.json
const options = {
featureName: 'ohri-forms-workspace-item',
Expand Down
15 changes: 15 additions & 0 deletions packages/esm-commons-lib/src/utils/cohort-list-config-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { extractSchemaValues, replaceWithConfigDefaults } from './schema-manipulation';

export const getCohortListTabsData = (cohortTabsSchema, config) => {
const configDefaults = extractSchemaValues(config);
const transformedSchemaConfig = replaceWithConfigDefaults(cohortTabsSchema, configDefaults);

const tabs = transformedSchemaConfig.tabDefinitions?.map((tab) => {
return {
name: tab.tabName,
cohortListData: tab.cohortContent,
};
});

return tabs;
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const createOHRIDashboardLink = (meta) => {

if (meta.isFolder) {
return (
<SideNavMenu renderIcon={meta.config.icon} title={meta.title}>
<SideNavMenu renderIcon={meta.config?.icon} title={meta.title}>
<ExtensionSlot name={meta.slot} />
</SideNavMenu>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { getObsFromEncounter } from './encounter-list-utils';
import { extractSchemaValues, replaceWithConfigDefaults } from './schema-manipulation';

export const getPatientListTabsData = (patientListTabsSchema, config) => {
const configDefaults = extractSchemaValues(config);
const transformedSchemaConfig = replaceWithConfigDefaults(patientListTabsSchema, configDefaults);

const tabs = transformedSchemaConfig.tabDefinitions?.map((tab) => {
const otherColumnsData = tab.otherColumns.map((column) => {
return {
key: column.id,
header: column.title,
index: column.index || null,
getValue: (row) => {
if (column.type === 'patientId') {
return row.id;
}

if (column.type === 'lastDate') {
return '13/01/2021';
}

if (column.type === 'appointmentDate') {
return '03/03/2021';
}

const { encounter } = row;
return getObsFromEncounter(encounter, column.concept, column.isDate);
},
};
});
return {
...tab,
label: tab.tabName,
queryParams: tab.hasQueryParams ? [`value1=${new Date().toISOString().split('T')[0]}`] : null,
otherColumns: otherColumnsData,
};
});

return tabs;
};
10 changes: 5 additions & 5 deletions packages/esm-hiv-care-treatment-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
import ServiceSummaryOverviewList from './views/service-summary/encounter-list/service-summary-encounter-list.component';
import ProgramManagementSummary from './views/program-management/program-management-summary.component';
import VisitsSummary from './views/visits/visits-summary.component';
import GeneralCounsellingSummary from './views/general-counselling/general-counselling-summary.component';
import PartnerNotificationServices from './views/partner-notification-services/partner-notification-services.component';
import ServiceSummaryOverviewList from './views/patient-chart/service-summary/service-summary-encounter-list.component';
import ProgramManagementSummary from './views/patient-chart/program-management/program-management-summary.component';
import VisitsSummary from './views/patient-chart/visits/visits-summary.component';
import GeneralCounsellingSummary from './views/patient-chart/general-counselling/general-counselling-summary.component';
import PartnerNotificationServices from './views/patient-chart/partner-notification-services/partner-notification-services.component';
import {
createOHRIDashboardLink,
PatientStatusBannerTag,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 29be08c

Please sign in to comment.