-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OHRI-1994 Add TB Program menu and tabs shell on the patient chart #1695
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,3 +2,41 @@ export const tuberclosisMeta = { | |||||
title: 'Tuberclosis', | ||||||
slotName: 'tuberclosis-slot', | ||||||
}; | ||||||
|
||||||
export const TbDashboardDMeta = { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
title: 'TB Program', | ||||||
slotName: 'ohri-tb-slot', | ||||||
isExpanded: false, | ||||||
}; | ||||||
|
||||||
export const tbPatientSummaryDashboardMeta = { | ||||||
slot: 'tb-patient-summary-dashboard-slot', | ||||||
columns: 1, | ||||||
title: 'Patient Summary', | ||||||
path: 'tb-patient-summary', | ||||||
layoutMode: 'anchored', | ||||||
}; | ||||||
|
||||||
export const tbProgramManagementDashboardMeta = { | ||||||
slot: 'tb-program-management-summary-slot', | ||||||
columns: 1, | ||||||
title: 'Program Management', | ||||||
path: 'tb-program-management', | ||||||
layoutMode: 'anchored', | ||||||
}; | ||||||
|
||||||
export const tbTreatmentFollowUpDashboardMeta = { | ||||||
slot: 'tb-treatment-follow-up-summary-slot', | ||||||
columns: 1, | ||||||
title: 'Treatment and follow-up', | ||||||
path: 'tb-treatment-follow-up', | ||||||
layoutMode: 'anchored', | ||||||
}; | ||||||
|
||||||
export const tbContactListingDashboardMeta = { | ||||||
slot: 'tb-contact-listing-summary-slot', | ||||||
columns: 1, | ||||||
title: 'Tb Contact Listing', | ||||||
path: 'tb-contact-listing', | ||||||
layoutMode: 'anchored', | ||||||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework'; | ||
import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; | ||
import { | ||
TbDashboardDMeta, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update this name after meta change |
||
tbContactListingDashboardMeta, | ||
tbPatientSummaryDashboardMeta, | ||
tbProgramManagementDashboardMeta, | ||
tbTreatmentFollowUpDashboardMeta, | ||
} from './dashboard.meta'; | ||
|
||
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); | ||
|
||
|
@@ -15,3 +22,53 @@ const options = { | |
export function startupApp() { | ||
defineConfigSchema(moduleName, {}); | ||
} | ||
|
||
export const patientChartTbDashboard = getSyncLifecycle(createDashboardGroup(TbDashboardDMeta), options); | ||
|
||
export const tbPatientSummaryDashboardLink = getSyncLifecycle( | ||
createDashboardLink({ ...tbPatientSummaryDashboardMeta, moduleName }), | ||
options, | ||
); | ||
export const tbPatientSummaryList = getAsyncLifecycle( | ||
() => import('./views/patient-summary/tb-patient-summary.component'), | ||
{ | ||
featureName: 'hts-service-summary-list', | ||
moduleName, | ||
}, | ||
); | ||
|
||
export const tbProgramManagementDashboardLink = getSyncLifecycle( | ||
createDashboardLink({ ...tbProgramManagementDashboardMeta, moduleName }), | ||
options, | ||
); | ||
export const tbProgramManagementDashboard = getAsyncLifecycle( | ||
() => import('./views/program-management/maternal-health.component'), | ||
{ | ||
featureName: 'tb-program-management-summary', | ||
moduleName, | ||
}, | ||
); | ||
|
||
export const tbTreatmentFollowUpDashboardLink = getSyncLifecycle( | ||
createDashboardLink({ ...tbTreatmentFollowUpDashboardMeta, moduleName }), | ||
options, | ||
); | ||
export const tbTreatmentFollowUpDashboard = getAsyncLifecycle( | ||
() => import('./views/treatment-and-follow-up/tb-treatment-follow-up.component'), | ||
{ | ||
featureName: 'tb-treatment-follow-up-summary', | ||
moduleName, | ||
}, | ||
); | ||
|
||
export const tbContactListingDashboardLink = getSyncLifecycle( | ||
createDashboardLink({ ...tbContactListingDashboardMeta, moduleName }), | ||
options, | ||
); | ||
export const tbContactListingDashboard = getAsyncLifecycle( | ||
() => import('./views/tb-contact-listing/tb-contact-list.component'), | ||
{ | ||
featureName: 'tb-contact-listing-summary', | ||
moduleName, | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,89 @@ | |
"pages": [ | ||
], | ||
"extensions": [ | ||
{ | ||
"name": "tb-dashboard-link", | ||
"slot": "dashboard-slot", | ||
"component": "tbFolderLink", | ||
"meta": { | ||
"slot": "ohri-tb-dashboard-slot", | ||
"isFolder": true, | ||
"title": "TB Program" | ||
} | ||
}, | ||
{ | ||
"name": "ohri-tb", | ||
"slot": "patient-chart-dashboard-slot", | ||
"component": "patientChartTbDashboard", | ||
"order": 21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change this to 24 so that it appears HIV and COVID |
||
}, | ||
|
||
{ | ||
"name": "tb-summary-dashboard", | ||
"slot": "ohri-tb-slot", | ||
"component": "tbPatientSummaryDashboardLink", | ||
"meta": { | ||
"slot": "tb-patient-summary-dashboard-slot", | ||
"columns": 1, | ||
"path": "tb-patient-summary", | ||
"layoutMode": "anchored" | ||
} | ||
}, | ||
{ | ||
"name": "tb-patient-summary-ext", | ||
"slot": "tb-patient-summary-dashboard-slot", | ||
"component": "tbPatientSummaryList" | ||
}, | ||
|
||
{ | ||
"name": "tb-program-management-summary", | ||
"slot": "ohri-tb-slot", | ||
"component": "tbProgramManagementDashboardLink", | ||
"meta": { | ||
"slot": "tb-program-management-summary-slot", | ||
"columns": 1, | ||
"path": "tb-program-management", | ||
"layoutMode": "anchored" | ||
} | ||
}, | ||
{ | ||
"name": "tb-program-management-summary-ext", | ||
"slot": "tb-program-management-summary-slot", | ||
"component": "tbProgramManagementDashboard" | ||
}, | ||
|
||
{ | ||
"name": "tb-treatment-follow-up-summary", | ||
"slot": "ohri-tb-slot", | ||
"component": "tbTreatmentFollowUpDashboardLink", | ||
"meta": { | ||
"slot": "tb-treatment-follow-up-summary-slot", | ||
"columns": 1, | ||
"path": "tb-treatment-follow-up", | ||
"layoutMode": "anchored" | ||
} | ||
}, | ||
{ | ||
"name": "tb-treatment-follow-up-summary-ext", | ||
"slot": "tb-treatment-follow-up-summary-slot", | ||
"component": "tbTreatmentFollowUpDashboard" | ||
}, | ||
|
||
{ | ||
"name": "tb-contact-listing-summary", | ||
"slot": "ohri-tb-slot", | ||
"component": "tbContactListingDashboardLink", | ||
"meta": { | ||
"slot": "tb-contact-listing-summary-slot", | ||
"columns": 1, | ||
"path": "tb-contact-listing", | ||
"layoutMode": "anchored" | ||
} | ||
}, | ||
{ | ||
"name": "tb-contact-listing-summary-ext", | ||
"slot": "tb-contact-listing-summary-slot", | ||
"component": "tbContactListingDashboard" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
import React, { useMemo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
interface OverviewListProps { | ||
patientUuid: string; | ||
} | ||
|
||
const TBSummaryOverviewList: React.FC<OverviewListProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
|
||
const headerRecentTB = t('recentTuberculosis'); | ||
const headerPreviousCases = t('previousCases'); | ||
const headerVisit = t('visits'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add default incase a translation doesn't exist for example we don't have translations for this in |
||
|
||
return ( | ||
<> | ||
<EmptyStateComingSoon displayText={headerRecentTB} headerTitle={headerRecentTB} /> | ||
<EmptyStateComingSoon displayText={headerPreviousCases} headerTitle={headerPreviousCases} /> | ||
<EmptyStateComingSoon displayText={headerVisit} headerTitle={headerVisit} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default TBSummaryOverviewList; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; | ||
import styles from '../common.scss'; | ||
import { useTranslation } from 'react-i18next'; | ||
import MdrTbList from './tabs/mdr-tb.component'; | ||
import TbPatientTracing from './tabs/tb-patient-tracing.component'; | ||
|
||
interface OverviewListProps { | ||
patientUuid: string; | ||
} | ||
|
||
const ProgramManagementSummary: React.FC<OverviewListProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className={styles.tabContainer}> | ||
<Tabs> | ||
<TabList contained> | ||
<Tab>{t('MdrTbEnrolment')}</Tab> | ||
<Tab>{t('PatientTracing')}</Tab> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment applies here. Change all occurrences of this within this PR |
||
</TabList> | ||
<TabPanels> | ||
<TabPanel> | ||
<MdrTbList patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<TbPatientTracing patientUuid={patientUuid} /> | ||
</TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProgramManagementSummary; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
|
||
interface MdrTbListProps { | ||
patientUuid: string; | ||
} | ||
|
||
const MdrTbList: React.FC<MdrTbListProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
const headerTitle = t('MdrTbEnrolment'); | ||
|
||
return ( | ||
<> | ||
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default MdrTbList; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
|
||
interface TbPatientTracingProps { | ||
patientUuid: string; | ||
} | ||
|
||
const TbPatientTracing: React.FC<TbPatientTracingProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
const headerTitle = t('PatientTracing', 'Patient Tracing'); | ||
|
||
return ( | ||
<> | ||
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default TbPatientTracing; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
|
||
interface TbContactTracingListProps { | ||
patientUuid: string; | ||
} | ||
|
||
const TbContactTracingList: React.FC<TbContactTracingListProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
const headerTitle = t('TbContactListing'); | ||
|
||
return ( | ||
<> | ||
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default TbContactTracingList; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
|
||
interface TbTreatmentFollowUpListProps { | ||
patientUuid: string; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reuse the interface defined in the commons. I think it's |
||
|
||
const TbTreatmentFollowUpList: React.FC<TbTreatmentFollowUpListProps> = ({ patientUuid }) => { | ||
const { t } = useTranslation(); | ||
const headerTitle = t('TbTreatmentFollowUp'); | ||
|
||
return ( | ||
<> | ||
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default TbTreatmentFollowUpList; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
{ | ||
"tuberclosis": "Tuberclosis" | ||
"tuberclosis": "Tuberclosis", | ||
"MdrTbEnrolment": "TB/MDR TB Enrolment", | ||
"PatientTracing": "Patient Tracing", | ||
"TbTreatmentFollowUp": "TB Follow Up", | ||
"TbContactListing": "TB Contact Listing", | ||
"recentTuberculosis": "Recent Tuberclosis", | ||
"previousCases": "Previous Case", | ||
"visits": "Visits" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete this. I had added it as a place holder