-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1185 | WIP: allOverdueVisitsIn based on location filters
- Loading branch information
Showing
5 changed files
with
168 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Program} from "openchs-models"; | ||
import General from "../../src/utility/General"; | ||
|
||
class TestProgramFactory { | ||
static create({ | ||
uuid = General.randomUUID(), | ||
name, | ||
colour = '#012345', | ||
allowMultipleEnrolments = false, | ||
manualEligibilityCheckRequired = false | ||
}) { | ||
const program = new Program(); | ||
program.uuid = uuid; | ||
program.name = name; | ||
program.displayName = name; | ||
program.programSubjectLabel = name; | ||
program.operationalProgramName = name; | ||
program.colour = colour; | ||
program.allowMultipleEnrolments = allowMultipleEnrolments; | ||
program.manualEligibilityCheckRequired = manualEligibilityCheckRequired; | ||
return program; | ||
} | ||
} | ||
|
||
export default TestProgramFactory; |
34 changes: 34 additions & 0 deletions
34
packages/openchs-android/test/model/txn/TestProgramEncounterFactory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import General from "../../src/utility/General"; | ||
import {ProgramEncounter} from 'openchs-models'; | ||
|
||
class TestProgramEncounterFactory { | ||
static create({ | ||
uuid = General.randomUUID(), | ||
name, | ||
encounterType, | ||
programEnrolment, | ||
encounterDateTime, | ||
earliestVisitDateTime, | ||
maxVisitDateTime, | ||
subject: subject, | ||
observations = [], | ||
approvalStatuses = [] | ||
}) { | ||
const programEncounter = new ProgramEncounter(); | ||
programEncounter.uuid = uuid; | ||
programEncounter.name = name; | ||
programEncounter.displayName = name; | ||
programEncounter.encounterType = encounterType; | ||
programEncounter.programEnrolment = programEnrolment; | ||
programEncounter.encounterDateTime = encounterDateTime; | ||
programEncounter.individual = subject; | ||
programEncounter.observations = observations; | ||
programEncounter.approvalStatuses = approvalStatuses; | ||
programEncounter.earliestVisitDateTime = earliestVisitDateTime; | ||
programEncounter.maxVisitDateTime = maxVisitDateTime; | ||
programEncounter.setLatestEntityApprovalStatus(programEncounter.latestEntityApprovalStatus); | ||
return programEncounter; | ||
} | ||
} | ||
|
||
export default TestProgramEncounterFactory; |
35 changes: 35 additions & 0 deletions
35
packages/openchs-android/test/model/txn/TestProgramEnrolmentFactory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import General from "../../src/utility/General"; | ||
import {ProgramEnrolment} from 'openchs-models'; | ||
|
||
class TestProgramEnrolmentFactory { | ||
static create({ | ||
uuid = General.randomUUID(), | ||
name, | ||
program, | ||
subject, | ||
enrolmentDateTime, | ||
encounters = [], | ||
checklists = [], | ||
observations = [], | ||
approvalStatuses = [], | ||
latestEntityApprovalStatus | ||
}) { | ||
const programEnrolment = new ProgramEnrolment(); | ||
programEnrolment.uuid = uuid; | ||
programEnrolment.name = name; | ||
programEnrolment.program = program; | ||
programEnrolment.individual = subject; | ||
programEnrolment.displayName = name; | ||
programEnrolment.operationalProgramName = name; | ||
programEnrolment.encounters = encounters; | ||
programEnrolment.checklists = checklists; | ||
programEnrolment.observations = observations; | ||
programEnrolment.enrolmentDateTime = enrolmentDateTime; | ||
programEnrolment.approvalStatuses = approvalStatuses; | ||
programEnrolment.setLatestEntityApprovalStatus(programEnrolment.latestEntityApprovalStatus); | ||
|
||
return programEnrolment; | ||
} | ||
} | ||
|
||
export default TestProgramEnrolmentFactory; |