-
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.
OHRI-2011: Add a table of all enrolled clients in TPT Program (#1789)
* Add TB Prevention link under Tuberculosis program in the clinical perspectives * Add a table of all enrolled clients in TPT Program * Add a table of all enrolled clients in TPT Program
- Loading branch information
1 parent
7edc0fe
commit bec22f3
Showing
6 changed files
with
108 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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
69 changes: 52 additions & 17 deletions
69
...ages/esm-tb-app/src/views/dashboard/patient-list-tabs/tpt-patient-list-tabs.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,23 +1,58 @@ | ||
import React from 'react'; | ||
import { Tabs, Tab, TabPanels, TabPanel, TabList } from '@carbon/react'; | ||
import React, { useMemo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { getObsFromEncounter, OHRIPatientListTabs } from '@ohri/openmrs-esm-ohri-commons-lib'; | ||
import { moduleName } from '../../../index'; | ||
import { useConfig } from '@openmrs/esm-framework'; | ||
|
||
interface OverviewListProps { | ||
patientUuid: string; | ||
} | ||
|
||
const TptPatientListTabs: React.FC<OverviewListProps> = ({ }) => { | ||
function TptPatientListTabs() { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Tabs> | ||
<TabList contained> | ||
<Tab>{t('allTptClients', 'All TPT Clients')}</Tab> | ||
</TabList> | ||
<TabPanels> | ||
<TabPanel></TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
const { obsConcepts, encounterTypes, cohorts } = useConfig(); | ||
|
||
const tabsConfigs = useMemo( | ||
() => [ | ||
{ | ||
label: t('allTptClients', 'All TPT Clients'), | ||
cohortId: cohorts.clientsEnrolledForTpt, | ||
isReportingCohort: true, | ||
cohortSlotName: 'clients-assessed-for-tpt', | ||
launchableForm: { | ||
editActionText: t('editTptFollowUpForm', 'Edit TPT Follow-up form'), | ||
editLatestEncounter: true, | ||
targetDashboard: 'tb-assessments', | ||
name: 'TPT Followup & Treatment form', | ||
}, | ||
associatedEncounterType: encounterTypes.tptCaseEnrollment, | ||
excludeColumns: ['timeAddedToList', 'waitingTime', 'location', 'phoneNumber', 'hivResult'], | ||
otherColumns: [ | ||
{ | ||
key: 'tptTreatmentId', | ||
header: t('tptTreatmentId', 'TPT Treatment ID'), | ||
getValue: ({ latestEncounter }) => { | ||
return getObsFromEncounter(latestEncounter, obsConcepts.tptTreatmentId); | ||
}, | ||
index: 1, | ||
}, | ||
{ | ||
key: 'EnrolmentDate', | ||
header: t('EnrolmentDate', 'Enrolment Date'), | ||
getValue: ({ latestEncounter }) => { | ||
return getObsFromEncounter(latestEncounter, obsConcepts.tptEnrollmentDate, true); | ||
}, | ||
}, | ||
{ | ||
key: 'indication', | ||
header: t('indication', 'Indication'), | ||
getValue: ({ latestEncounter }) => { | ||
return getObsFromEncounter(latestEncounter, obsConcepts.tptIndication); | ||
}, | ||
}, | ||
], | ||
viewTptPatientProgramSummary: true, | ||
}, | ||
], | ||
[], | ||
); | ||
}; | ||
return <OHRIPatientListTabs patientListConfigs={tabsConfigs} moduleName={moduleName} />; | ||
} | ||
|
||
export default TptPatientListTabs; |
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