Skip to content

Commit

Permalink
fix missing appointment date on TB dashboard summary
Browse files Browse the repository at this point in the history
  • Loading branch information
kajambiya committed Jan 17, 2024
1 parent b28779c commit 29da491
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export const CohortPatientList: React.FC<CohortPatientListProps> = ({
autoFocus: true,
};
}, [
loadedExtraEncounters,
searchTerm,
filteredResults,
paginatedPatients,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function TbHomePatientTabs() {
},
associatedEncounterType: config.encounterTypes.tbProgramEnrollment,
excludeColumns: ['timeAddedToList', 'waitingTime', 'location', 'phoneNumber', 'hivResult'],
extraAssociatedEncounterTypes: [config.encounterTypes.tbTreatmentAndFollowUp],
otherColumns: [
{
key: 'caseID',
Expand All @@ -49,8 +50,14 @@ function TbHomePatientTabs() {
{
key: 'nextAppointmentDate',
header: t('appointmentDate', 'Appointment Date'),
getValue: ({ latestEncounter }) => {
return getObsFromEncounter(latestEncounter, config.obsConcepts.nextAppointmentDate, true);
getValue: (patient) => {
const patientLatestExtraEncounters = patient.latestExtraEncounters
if (patientLatestExtraEncounters && patientLatestExtraEncounters.length) {
const latestFollowUpEncounter = patientLatestExtraEncounters[0];
return getObsFromEncounter(latestFollowUpEncounter, config.obsConcepts.nextAppointmentDate, true);
} else {
return '--';
}
},
},
{
Expand Down

0 comments on commit 29da491

Please sign in to comment.