Skip to content

Commit

Permalink
(feat) adding PMTCT menus for mother and child
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-icap committed Dec 19, 2023
1 parent e4f6dcb commit 1693e70
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 26 deletions.
8 changes: 7 additions & 1 deletion src/ethiohri-dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ export const PMTCT_META = {
};

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

export const MOTHER_HEALTH_SUMMARY = {
title: "Mother Health Summary",
slot: "mother-health-slot",
path: "mother-health",
};

export const PREP_META = {
title: "PrEP Prophylaxis",
slot: "prep-slot",
Expand Down
14 changes: 13 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
POST_META,
PREP_META,
PROGRAM_MANAGEMENT_META,
MOTHER_HEALTH_SUMMARY,
} from "./ethiohri-dashboard.meta";
import {
CalcNextVisitDate,
Expand Down Expand Up @@ -129,7 +130,18 @@ export const childHealthMenu = getSyncLifecycle(
options
);
export const childHealthChart = getAsyncLifecycle(
() => import("./pages/pmtct/pmtct.component"),
() => import("./pages/pmtct/child/pmtct-child.component"),
options
);
export const motherHealthMenu = getSyncLifecycle(
createDashboardLink({
...MOTHER_HEALTH_SUMMARY,
moduleName,
}),
options
);
export const motherHealthChart = getAsyncLifecycle(
() => import("./pages/pmtct/mother/pmtct-mother.component"),
options
);
export const prepMenu = getSyncLifecycle(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* eslint-disable prettier/prettier */
import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react";
import React from "react";
import styles from "../program-management/program-management.scss";
import PMTCTRegistrationEncounterList from "./tabs/pmtct-registration.component";
import PMTCTImmunizationEncounterList from "./tabs/pmtct-immunization.component";
import PMTCTFollowupEncounterList from "./tabs/pmtct-followup.component";
import styles from "../../program-management/program-management.scss";
import PMTCTRegistrationEncounterList from "./tabs/pmtct-child-registration.component";
import PMTCTImmunizationEncounterList from "./tabs/pmtct-child-immunization.component";
import PMTCTFollowupEncounterList from "./tabs/pmtct-child-followup.component";

const ChildHealth: React.FC<{ patientUuid: string }> = ({ patientUuid }) => {
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained aria-label={""}>
<Tab>PMTCT Registration</Tab>
<Tab>PMTCT Immunization</Tab>
<Tab>PMTCT Followup</Tab>
<Tab>Child Registration</Tab>
<Tab>Child Immunization</Tab>
<Tab>Child Followup</Tab>
</TabList>
<TabPanels>
<TabPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
EncounterList,
EncounterListColumn,
} from "@ohri/openmrs-esm-ohri-commons-lib";
import { PMTCT_FOLLOWUP_ENCOUNTER_TYPE } from "../../../constants";
import { getData } from "../../encounterUtils";
import { moduleName } from "../../../index";
import { PMTCT_FOLLOWUP_ENCOUNTER_TYPE } from "../../../../constants";
import { getData } from "../../../encounterUtils";
import { moduleName } from "../../../../index";

const PMTCTFollowupEncounterList: React.FC<{ patientUuid: string }> = ({
patientUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { EncounterList } from "@ohri/openmrs-esm-ohri-commons-lib";
import {
MRN_NULL_WARNING,
PMTCT_IMMUNIZATION_ENCOUNTER_TYPE,
} from "../../../constants";
import { getData } from "../../encounterUtils";
import { moduleName } from "../../../index";
import { fetchIdentifiers } from "../../../api/api";
import styles from "../../../root.scss";
} from "../../../../constants";
import { getData } from "../../../encounterUtils";
import { moduleName } from "../../../../index";
import { fetchIdentifiers } from "../../../../api/api";
import styles from "../../../../root.scss";

const columns = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { EncounterList } from "@ohri/openmrs-esm-ohri-commons-lib";
import {
PMTCT_REGISTRATION_ENCOUNTER_TYPE,
MRN_NULL_WARNING,
} from "../../../constants";
import { getData } from "../../encounterUtils";
import { moduleName } from "../../../index";
import { fetchIdentifiers } from "../../../api/api";
import styles from "../../../root.scss";
} from "../../../../constants";
import { getData } from "../../../encounterUtils";
import { moduleName } from "../../../../index";
import { fetchIdentifiers } from "../../../../api/api";
import styles from "../../../../root.scss";

const columns = [
{
Expand Down
34 changes: 34 additions & 0 deletions src/pages/pmtct/mother/pmtct-mother.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable prettier/prettier */
import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react";
import React from "react";
import styles from "../../program-management/program-management.scss";
import PMTCTRegistrationEncounterList from "../child/tabs/pmtct-child-registration.component";
import PMTCTImmunizationEncounterList from "../child/tabs/pmtct-child-immunization.component";
import PMTCTFollowupEncounterList from "../child/tabs/pmtct-child-followup.component";

const ChildHealth: React.FC<{ patientUuid: string }> = ({ patientUuid }) => {
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained aria-label={""}>
<Tab>Mother's Initial Registration</Tab>
<Tab>Mother's Followup</Tab>
<Tab>Mother's Discharge Information</Tab>
</TabList>
<TabPanels>
<TabPanel>
<PMTCTRegistrationEncounterList patientUuid={patientUuid} />
</TabPanel>
<TabPanel>
<PMTCTImmunizationEncounterList patientUuid={patientUuid} />
</TabPanel>
<TabPanel>
<PMTCTFollowupEncounterList patientUuid={patientUuid} />
</TabPanel>
</TabPanels>
</Tabs>
</div>
);
};

export default ChildHealth;
18 changes: 17 additions & 1 deletion src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"slot": "ethio-pmtct-slot",
"component": "childHealthMenu",
"meta": {
"title": "PMTCT",
"title": "Child Health",
"slot": "child-health-slot",
"path": "child-health",
"columns": 1
Expand All @@ -70,6 +70,22 @@
"slot": "child-health-slot",
"component": "childHealthChart"
},
{
"name": "mother-health-ext",
"slot": "ethio-pmtct-slot",
"component": "motherHealthMenu",
"meta": {
"title": "Mother Health",
"slot": "mother-health-slot",
"path": "mother-health",
"columns": 1
}
},
{
"name": "mother-health-chart-ext",
"slot": "mother-health-slot",
"component": "motherHealthChart"
},
{
"name": "prep-ext",
"slot": "hiv-care-and-treatment-slot",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3129,8 +3129,8 @@ __metadata:
linkType: hard

"@openmrs/openmrs-form-engine-lib@npm:next":
version: 1.0.0-pre.465
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.0.0-pre.465"
version: 1.0.0-pre.498
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.0.0-pre.498"
dependencies:
ace-builds: ^1.4.12
enzyme: ^3.11.0
Expand All @@ -3153,7 +3153,7 @@ __metadata:
react: 18.x
react-i18next: 11.x
rxjs: 6.x
checksum: 22c349ed661c228c1adb779706c84056e771b560f43cccd2ea230009a90bd391b1d54813d9da92130fe51db517ce207298aa2d8c20bb6ff9559bf743477da6b3
checksum: 08abb7abe2dd337e429950ab85c71378512ed97da4f216801eb1b661df89b88811b1d0ecc9f36c8a5990ec333fbb2653a372265e60194742e02fe0177667f845
languageName: node
linkType: hard

Expand Down

0 comments on commit 1693e70

Please sign in to comment.