Skip to content

Commit

Permalink
Merge pull request #55 from CDC-HIS/chore/v5-migration-fixes
Browse files Browse the repository at this point in the history
(chore) v5 migration fixes
  • Loading branch information
pirupius authored Aug 4, 2023
2 parents 269c1b4 + 0957c3f commit cbddde1
Show file tree
Hide file tree
Showing 23 changed files with 5,562 additions and 5,913 deletions.
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@icap-ethiopia/esm-ethiohri-app",
"version": "1.0.1",
"version": "1.2.0",
"license": "MPL-2.0",
"author": "ICAP Ethiopia",
"description": "A microfrontend ethiohri OpenMRS",
Expand Down Expand Up @@ -50,23 +50,22 @@
"dependencies": {
"@adobe/react-spectrum": "^3.19.0",
"@carbon/charts-react": "^1.5.2",
"@carbon/react": "^1.17.0",
"@carbon/react": "^1.13.0",
"dayjs": "^1.8.16",
"lodash-es": "^4.17.15",
"swr": "^2.0.1"
},
"peerDependencies": {
"@openmrs/esm-framework": "4.x",
"@openmrs/esm-framework": "5.x",
"react": "18.x",
"react-i18next": "11.x",
"rxjs": "6.x"
},
"devDependencies": {
"@ohri/openmrs-esm-ohri-commons-lib": "1.0.7-pre.2497",
"@ohri/openmrs-esm-ohri-commons-lib": "next",
"@openmrs/esm-framework": "next",
"@openmrs/esm-patient-common-lib": "next",
"@openmrs/esm-styleguide": "4.x",
"@openmrs/openmrs-form-engine-lib": "1.0.0-pre.244",
"@openmrs/openmrs-form-engine-lib": "next",
"@playwright/test": "^1.30.0",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.6",
Expand Down Expand Up @@ -110,5 +109,8 @@
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1"
},
"resolutions": {
"@carbon/react": "1.13.0"
},
"packageManager": "[email protected]"
}
8 changes: 8 additions & 0 deletions src/ethiohri-dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,42 @@ export const PMTCT_META = {
export const MATERNAL_HEALTH_SUMMARY = {
title: "Maternal Health",
slot: "maternal-health-slot",
path: "maternal-health",
};

export const CHILD_HEALTH_SUMMARY = {
title: "Child Health",
slot: "child-health-slot",
path: "child-health",
};

export const PREP_META = {
title: "PrEP Prophylaxis",
slot: "prep-slot",
path: "prep-prophylaxis",
};

export const POST_META = {
title: "PEP Prophylaxis",
slot: "post-exposure-slot",
path: "pep-prophylaxis",
columns: 1,
};

export const HIV_TESTING_SERVICE_META = {
title: "HIV Testing Service",
slot: "hiv-testing-service-slot",
path: "hiv-testing-service",
};

export const PROGRAM_MANAGEMENT_META = {
title: "Program Management",
slot: "program-management-slot",
path: "program-management",
};

export const CLINICAL_VISITS = {
title: "Clinical Visits",
slot: "clinical-visits-slot",
path: "clinical-visits",
};
60 changes: 38 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import {
import { configSchema } from "./config-schema";
import ethiohriConfigOverrides from "./ethiohri-configuration-overrides.json";
import ethiohriConfig from "./ethiohri-config";
import {
addToBaseFormsRegistry,
registerControl,
} from "@openmrs/openmrs-form-engine-lib";
import formsRegistry from "./forms/forms-registry";
import { registerControl } from "@openmrs/openmrs-form-engine-lib";
import {
createDashboardGroup,
createDashboardLink,
Expand Down Expand Up @@ -42,16 +38,14 @@ export const importTranslation = require.context(

export function startupApp() {
defineConfigSchema(moduleName, configSchema);
// provide(ethiohriConfigOverrides);
// provide(ethiohriConfig);

// addToBaseFormsRegistry(formsRegistry);
provide(ethiohriConfigOverrides);
provide(ethiohriConfig);

// registerControl({
// id: "eth-date",
// loadControl: () => import("./controls/date/ethiohri-date.component"),
// type: "eth-date",
// });
registerControl({
id: "eth-date",
loadControl: () => import("./controls/date/ethiohri-date.component"),
type: "eth-date",
});
}

export const patientDetailsButton = getAsyncLifecycle(
Expand All @@ -73,7 +67,7 @@ export const hivBaseline = getAsyncLifecycle(
moduleName,
}
);
export const activeMedications = getAsyncLifecycle(
export const ethiohriActiveMedications = getAsyncLifecycle(
() => import("./views/medications/active-medications.component"),
options
);
Expand All @@ -86,16 +80,23 @@ export const hivCareAndTreatmentMenu = getSyncLifecycle(
options
);
export const programManagementMenu = getSyncLifecycle(
createDashboardLink(PROGRAM_MANAGEMENT_META),
createDashboardLink({
...PROGRAM_MANAGEMENT_META,
moduleName,
}),
options
);

export const programManagementChart = getAsyncLifecycle(
() =>
import("./pages/program-management/program-managment-summary.component"),
options
);
export const clinicalVisitsMenu = getSyncLifecycle(
createDashboardLink(CLINICAL_VISITS),
createDashboardLink({
...CLINICAL_VISITS,
moduleName,
}),
options
);
export const clinicalVisitsChart = getAsyncLifecycle(
Expand All @@ -107,39 +108,54 @@ export const pmtctMenu = getSyncLifecycle(
options
);
export const maternalHealthMenu = getSyncLifecycle(
createDashboardLink(MATERNAL_HEALTH_SUMMARY),
createDashboardLink({
...MATERNAL_HEALTH_SUMMARY,
moduleName,
}),
options
);
export const maternalHealthChart = getAsyncLifecycle(
() => import("./pages/pmtct/maternal-health.component"),
options
);
export const childHealthMenu = getSyncLifecycle(
createDashboardLink(CHILD_HEALTH_SUMMARY),
createDashboardLink({
...CHILD_HEALTH_SUMMARY,
moduleName,
}),
options
);
export const childHealthChart = getAsyncLifecycle(
() => import("./pages/child-care/child-care.component"),
options
);
export const prepMenu = getSyncLifecycle(
createDashboardLink(PREP_META),
createDashboardLink({
...PREP_META,
moduleName,
}),
options
);
export const prepChart = getAsyncLifecycle(
() => import("./pages/pre-exposure/pre-exposure-summary.component"),
options
);
export const pepMenu = getSyncLifecycle(
createDashboardLink(POST_META),
createDashboardLink({
...POST_META,
moduleName,
}),
options
);
export const pepChart = getAsyncLifecycle(
() => import("./pages/post-exposure/post-exposure.component"),
options
);
export const hivTestingServiceMenu = getSyncLifecycle(
createDashboardLink(HIV_TESTING_SERVICE_META),
createDashboardLink({
...HIV_TESTING_SERVICE_META,
moduleName,
}),
options
);
export const hivTestingServiceChart = getAsyncLifecycle(
Expand Down
38 changes: 19 additions & 19 deletions src/pages/child-care/child-care.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react";
import React from "react";
import styles from "../program-management/program-management.scss";
import HEIEnrollment from "./tabs/hei-enrollment.component"
import HEIEnrollment from "./tabs/hei-enrollment.component";
import HEIFollowup from "./tabs/hei-followup.component";

const ChildHealth: React.FC<{ patientUuid: string }> = ({ patientUuid }) => {
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained>
<Tab>HEI Enrollment</Tab>
<Tab>HEI Followup</Tab>
</TabList>
<TabPanels>
<TabPanel>
<HEIEnrollment patientUuid={patientUuid} />
</TabPanel>
<TabPanel>
<HEIFollowup patientUuid={patientUuid} />
</TabPanel>
</TabPanels>
</Tabs>
</div>
);
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained>
<Tab>HEI Enrollment</Tab>
<Tab>HEI Followup</Tab>
</TabList>
<TabPanels>
<TabPanel>
<HEIEnrollment patientUuid={patientUuid} />
</TabPanel>
<TabPanel>
<HEIFollowup patientUuid={patientUuid} />
</TabPanel>
</TabPanels>
</Tabs>
</div>
);
};

export default ChildHealth;
8 changes: 4 additions & 4 deletions src/pages/child-care/tabs/hei-enrollment.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React from "react";
import { EmptyStateComingSoon } from "@ohri/openmrs-esm-ohri-commons-lib";

const HEIEnrollment: React.FC<{ patientUuid: string }> = ({ patientUuid }) => {
const pageTitle = "Adherence Counselling Summary";
const pageTitle = "Adherence Counselling Summary";

return (
<EmptyStateComingSoon displayText={pageTitle} headerTitle={pageTitle} />
);
return (
<EmptyStateComingSoon displayText={pageTitle} headerTitle={pageTitle} />
);
};

export default HEIEnrollment;
Loading

0 comments on commit cbddde1

Please sign in to comment.