Skip to content

Commit

Permalink
OHRI-2044: HIV - Update package index.ts to syncronously load pages a…
Browse files Browse the repository at this point in the history
…nd extensions (UCSF-IGHS#1752)

* HIV - Update package index.ts to syncronously load pages and extensions

* removing the unused 'getAsyncLifecycle'
  • Loading branch information
lucyjemutai authored Jan 11, 2024
1 parent 7d3798a commit 2789424
Showing 1 changed file with 63 additions and 79 deletions.
142 changes: 63 additions & 79 deletions packages/esm-hiv-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
import ServiceSummaryOverviewList from './views/service-summary/encounter-list/service-summary-encounter-list.component';
import HTSSummaryTiles from './views/hts/home/summary-tiles/hts-summary-tiles.component';
import OHRIPatientTabs from './views/hts/home/patient-tabs/ohri-patient-tabs.component';
import CTSummaryTiles from './views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component';
import CTHomePatientTabs from './views/hts/patient-list-tabs/ct-patient-list-tabs.component';
import LabResultsSummaryTiles from './views/hts/lab-results/lab-results-summary-tiles.component';
import LabResultsSummary from './views/hts/lab-results/lab-results-summary.component';
import HTSPreventionSummary from './views/hiv-testing-services/hts-prevention-summary.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 {
createOHRIDashboardLink,
PatientStatusBannerTag,
Expand Down Expand Up @@ -39,55 +51,40 @@ export function startupApp() {

export const patientHIVStatusTag = getSyncLifecycle(PatientStatusBannerTag, options);

export const htsServiceSummaryList = getAsyncLifecycle(
() => import('./views/service-summary/encounter-list/service-summary-encounter-list.component'),
{
featureName: 'hts-service-summary-list',
moduleName,
},
);
export const htsServiceSummaryList = getSyncLifecycle(ServiceSummaryOverviewList, {
featureName: 'hts-service-summary-list',
moduleName,
});

export const htsHomeHeader = getSyncLifecycle(OHRIWelcomeSection, {
featureName: 'hts-home-header',
moduleName,
});

export const htsHomeTiles = getAsyncLifecycle(
() => import('./views/hts/home/summary-tiles/hts-summary-tiles.component'),
{
featureName: 'hts-home-tiles',
moduleName,
},
);
export const htsHomeTiles = getSyncLifecycle(HTSSummaryTiles, {
featureName: 'hts-home-tiles',
moduleName,
});

export const htsHomeTabs = getAsyncLifecycle(
() => import('./views/hts/home/patient-tabs/ohri-patient-tabs.component'),
{
featureName: 'hts-home-tabs',
moduleName,
},
);
export const htsHomeTabs = getSyncLifecycle(OHRIPatientTabs, {
featureName: 'hts-home-tabs',
moduleName,
});

export const ctHomeHeader = getSyncLifecycle(OHRIWelcomeSection, {
featureName: 'ct-home-header',
moduleName,
});

export const ctHomeTiles = getAsyncLifecycle(
() => import('./views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component'),
{
featureName: 'ct-home-tiles',
moduleName,
},
);
export const ctHomeTiles = getSyncLifecycle(CTSummaryTiles, {
featureName: 'ct-home-tiles',
moduleName,
});

export const ctHomeTabs = getAsyncLifecycle(
() => import('./views/hts/patient-list-tabs/ct-patient-list-tabs.component'),
{
featureName: 'ct-home-tabs',
moduleName,
},
);
export const ctHomeTabs = getSyncLifecycle(CTHomePatientTabs, {
featureName: 'ct-home-tabs',
moduleName,
});

export const hivCareAndTreatmentFolderLink = getSyncLifecycle(
createOHRIDashboardLink(hivCareAndTreatmentFolderDashboardMeta),
Expand Down Expand Up @@ -117,20 +114,16 @@ export const labResultsHomeHeader = getSyncLifecycle(OHRIWelcomeSection, {
featureName: 'lab-results-home-header',
moduleName,
});
export const labResultsHomeTiles = getAsyncLifecycle(
() => import('./views/hts/lab-results/lab-results-summary-tiles.component'),
{
featureName: 'lab-results-home-tiles',
moduleName,
},
);
export const labResultsHomeTabs = getAsyncLifecycle(
() => import('./views/hts/lab-results/lab-results-summary.component'),
{
featureName: 'lab-results-tabs',
moduleName,
},
);

export const labResultsHomeTiles = getSyncLifecycle(LabResultsSummaryTiles, {
featureName: 'lab-results-home-tiles',
moduleName,
});

export const labResultsHomeTabs = getSyncLifecycle(LabResultsSummary, {
featureName: 'lab-results-tabs',
moduleName,
});

// Patient Chart
export const patientChartHIVPreventionDashboard = getSyncLifecycle(
Expand All @@ -142,14 +135,11 @@ export const htsSummaryDashboardLink = getSyncLifecycle(
createDashboardLink({ ...htsSummaryDashboardMeta, moduleName }),
options,
);
export const htsSummaryDashboard = getAsyncLifecycle(
() => import('./views/hiv-testing-services/hts-prevention-summary.component'),
{
featureName: 'hts-patient-encounters-list',
moduleName,
},
);

export const htsSummaryDashboard = getSyncLifecycle(HTSPreventionSummary, {
featureName: 'hts-patient-encounters-list',
moduleName,
});
export const patientChartHIVCareAndTreatmentDashboard = getSyncLifecycle(
createDashboardGroup(hivCareAndTreatmentDashboardDMeta),
options,
Expand All @@ -162,19 +152,17 @@ export const programManagementDashboardLink = getSyncLifecycle(
createDashboardLink({ ...programManagementDashboardMeta, moduleName }),
options,
);
export const programManagementDashboard = getAsyncLifecycle(
() => import('./views/program-management/program-management-summary.component'),
{
featureName: 'program-management-summary',
moduleName,
},
);

export const programManagementDashboard = getSyncLifecycle(ProgramManagementSummary, {
featureName: 'program-management-summary',
moduleName,
});
export const clinicalVisitsDashboardLink = getSyncLifecycle(
createDashboardLink({ ...clinicalVisitsDashboardMeta, moduleName }),
options,
);
export const clinicalVisitsDashboard = getAsyncLifecycle(() => import('./views/visits/visits-summary.component'), {

export const clinicalVisitsDashboard = getSyncLifecycle(VisitsSummary, {
featureName: 'visits-summary',
moduleName,
});
Expand All @@ -183,22 +171,18 @@ export const generalCounsellingDashboardLink = getSyncLifecycle(
createDashboardLink({ ...generalCounsellingDashboardMeta, moduleName }),
options,
);
export const generalCounsellingDashboard = getAsyncLifecycle(
() => import('./views/general-counselling/general-counselling-summary.component'),
{
featureName: 'general-counselling-summary',
moduleName,
},
);

export const generalCounsellingDashboard = getSyncLifecycle(GeneralCounsellingSummary, {
featureName: 'general-counselling-summary',
moduleName,
});

export const partnerNotificationServicesDashboardLink = getSyncLifecycle(
createDashboardLink({ ...partnerNotificationServicesDashboardMeta, moduleName }),
options,
);
export const partnerNotificationServicesDashboard = getAsyncLifecycle(
() => import('./views/partner-notification-services/partner-notification-services.component'),
{
featureName: 'partner-notification-services',
moduleName,
},
);

export const partnerNotificationServicesDashboard = getSyncLifecycle(PartnerNotificationServices, {
featureName: 'partner-notification-services',
moduleName,
});

0 comments on commit 2789424

Please sign in to comment.