Skip to content

Commit

Permalink
avniproject/avni-client#1253 - get all ever scheduled visits
Browse files Browse the repository at this point in the history
  • Loading branch information
petmongrels committed Dec 27, 2023
1 parent ac085ba commit 79cf718
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ProgramEnrolment.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,12 @@ class ProgramEnrolment extends BaseEntity {
);
}

everScheduledEncountersOfType(encounterTypeName) {
return this.everScheduledEncounters().filter(
(scheduledEncounter) => scheduledEncounter.encounterType.name === encounterTypeName
);
}

getAllScheduledVisits(currentEncounter) {
return _.defaults(this.scheduledEncounters(true), [])
.filter((encounter) => encounter.uuid !== currentEncounter.uuid)
Expand Down

0 comments on commit 79cf718

Please sign in to comment.