Skip to content

Commit

Permalink
(refactor) OHRI-2222 Implement the Maternal and Child Care package sc…
Browse files Browse the repository at this point in the history
…hema workflow
  • Loading branch information
CynthiaKamau committed Jun 8, 2024
1 parent a3ca4d0 commit 1fea17f
Show file tree
Hide file tree
Showing 9 changed files with 341 additions and 467 deletions.
2 changes: 1 addition & 1 deletion packages/esm-ohri-pmtct-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createDashboardLink } from '@openmrs/esm-patient-common-lib';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

export const moduleName = '@ohri/openmrs-esm-ohri-pmtct';
export const moduleName = '@ohri/openmrs-esm-ohri-pmtct-app';

require('./root.scss');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"menuId": "childHealth",
"tabDefinitions": [
{
"tabName": "Infant Postnatal Visit",
"headerTitle": "Infant Postnatal Visit",
"displayText": "Infant Postnatal Visit",
"encounterType": "af1f1b24-d2e8-4282-b308-0bf79b365584",
"columns": [
{
"id": "pTrackerId",
"title": "PTracker Id",
"concept": "6c45421e-2566-47cb-bbb3-07586fffbfe2"
},
{
"id": "mothersName",
"title": "Mothers Name",
"concept": "163260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "artProphylaxisStatus",
"title": "ART Prophylaxis Status",
"concept": "1148AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "linkedToArt",
"title": "Linked to ART",
"concept": "a40d8bc4-56b8-4f28-a1dd-412da5cf20ed"
},
{
"id": "breastfeedingStatus",
"title": "Breastfeeding status",
"concept": "1151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "outcomeStatus",
"title": "Outcome Status",
"concept": "160433AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "nextVisitDate",
"isDate": true,
"title": "Next visit date",
"concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "actions",
"title": "Actions",
"actionOptions": [
{
"formName": "Antenatal Form",
"package": "pmtct",
"label": "View Details",
"mode": "view"
},
{
"formName": "Antenatal Form",
"package": "pmtct",
"label": "Edit Form",
"mode": "edit"
}
]
}
],
"launchOptions": {
"displayText": "Add",
"moduleName": "@ohri/openmrs-esm-ohri-pmtct-app"
},
"formList": [
{
"name": "Infant - Postanal Form",
"uuid": "5022c5d7-ea45-47ce-bd65-1ba1d8ad2467"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
import React from 'react';
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
import styles from '../common.scss';
import { useTranslation } from 'react-i18next';
import InfantPostnatalList from './tabs/infant-postnatal-care.component';
import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib';
import childHealthTabConfigSchema from './child-health-config.json';

interface OverviewListProps {
patientUuid: string;
}

const ChildHealthList: React.FC<OverviewListProps> = ({ patientUuid }) => {
const { t } = useTranslation();
const ChildHealthSummary: React.FC<OverviewListProps> = ({ patientUuid }) => {
const tabs = getMenuItemTabConfiguration(childHealthTabConfigSchema);
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained>
<Tab>{t('infantPostnatalVisit', 'Infant Postnatal Visit')}</Tab>
{tabs.map((tab) => (
<Tab key={tab.name}>{tab.name}</Tab>
))}
</TabList>
<TabPanels>
<TabPanel>
<InfantPostnatalList patientUuid={patientUuid} />
</TabPanel>
{tabs.map((tab) => (
<TabPanel>
<EncounterList
patientUuid={patientUuid}
formList={tab.formList}
columns={tab.columns}
encounterType={tab.encounterType}
launchOptions={tab.launchOptions}
headerTitle={tab.headerTitle}
description={tab.description}
/>
</TabPanel>
))}
</TabPanels>
</Tabs>
</div>
);
};

export default ChildHealthList;
export default ChildHealthSummary;

This file was deleted.

Loading

0 comments on commit 1fea17f

Please sign in to comment.