-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor) OHRI-2222 Implement the Maternal and Child Care package sc…
…hema workflow
- Loading branch information
1 parent
07e0ffd
commit 381824c
Showing
8 changed files
with
339 additions
and
466 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
packages/esm-ohri-pmtct-app/src/views/child-health/child-health-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "164803AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"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" | ||
}, | ||
"formList": [ | ||
{ | ||
"name": "Infant - Postanal Form", | ||
"uuid": "5022c5d7-ea45-47ce-bd65-1ba1d8ad2467" | ||
} | ||
] | ||
} | ||
] | ||
} |
30 changes: 21 additions & 9 deletions
30
packages/esm-ohri-pmtct-app/src/views/child-health/child-health.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
121 changes: 0 additions & 121 deletions
121
packages/esm-ohri-pmtct-app/src/views/child-health/tabs/infant-postnatal-care.component.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.