Skip to content

Commit

Permalink
OHRI-1998 Follow-up visit table under Treatment and Follow-up menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ODORA0 committed Nov 23, 2023
1 parent 1d7f11e commit 7a50f56
Showing 1 changed file with 60 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,70 @@
import React, { useEffect, useState } from 'react';
import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { EmptyStateComingSoon, PatientChartProps } from '@ohri/openmrs-esm-ohri-commons-lib';
import {
EncounterList,
EncounterListColumn,
PatientChartProps,
getObsFromEncounter,
} from '@ohri/openmrs-esm-ohri-commons-lib';
import { moduleName } from '../..';

const TbTreatmentFollowUpList: React.FC<PatientChartProps> = ({ patientUuid }) => {
const { t } = useTranslation();
const headerTitle = t('TbTreatmentFollowUp', 'TB Follow-up');
const columns: EncounterListColumn[] = useMemo(
() => [
{
key: 'visitDate',
header: t('visitDate', 'Visit Date'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, ' ');
},
},
{
key: 'caseId',
header: t('caseId', 'Case ID'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, '', true);
},
},
{
key: 'monthOfTreatment',
header: t('monthOfTreatment', 'Month of Treatment'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, '');
},
},
{
key: 'adherenceAssessment',
header: t('adherenceAssessment', 'Adherence Assessment'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, '', true);
},
},
{
key: 'nextAppointment',
header: t('nextAppointment', 'Next Appointment'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, '', true);
},
},
],
[],
);

return (
<>
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} />
</>
<EncounterList
patientUuid={patientUuid}
encounterType={''}
formList={[{ name: '' }]}
columns={columns}
description={headerTitle}
headerTitle={headerTitle}
launchOptions={{
displayText: t('add', 'Add'),
moduleName: moduleName,
}}
/>
);
};

Expand Down

0 comments on commit 7a50f56

Please sign in to comment.