-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue:
getEncounters function in Individual.js and ProgramEnrolment.js has facility to consider cancelled encounters as well. But it is not considering cancelDateTime when sorting the encounters. Hence when need to get the latest(including cancelled encounters) another sorting as below need to be done in the report card query:
const encounters = enrolment.getEncounters(false);
const sortedEncounters = _.sortBy(encounters, (encounter) => {
return _.isNil(encounter.cancelDateTime)? moment().diff(encounter.encounterDateTime) :
moment().diff(encounter.cancelDateTime)});
const latestEncounter = _.head(sortedEncounters);
Significance of fixing this issue:
- To prevent code duplication of above in the implementations
- For faster work in implementation team.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
In Analysis Review