Skip to content

Commit

Permalink
avniproject/avni-client#1253 - added missing method that got deleted …
Browse files Browse the repository at this point in the history
…during commit review
  • Loading branch information
petmongrels committed Dec 28, 2023
1 parent 005069a commit f26ca4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ProgramEnrolment.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,13 @@ class ProgramEnrolment extends BaseEntity {
);
}

everScheduledEncounters() {
return _.filter(
this.getEncounters(true),
(encounter) => !_.isNil(encounter.earliestVisitDateTime) && _.isNil(encounter.cancelDateTime)
);
}

scheduledEncountersOfType(encounterTypeName) {
return this.scheduledEncounters().filter(
(scheduledEncounter) => scheduledEncounter.encounterType.name === encounterTypeName
Expand Down

0 comments on commit f26ca4e

Please sign in to comment.