-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0c832d
commit 7c2e7aa
Showing
18 changed files
with
1,653 additions
and
1,777 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
127 changes: 0 additions & 127 deletions
127
src/main/java/org/hisp/dhis/rules/models/RuleEvent.java
This file was deleted.
Oops, something went wrong.
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,71 @@ | ||
package org.hisp.dhis.rules.models | ||
|
||
import java.util.* | ||
import java.util.Comparator.comparing | ||
import kotlin.Comparator | ||
|
||
data class RuleEvent( | ||
val event: String, | ||
val programStage: String, | ||
val programStageName: String, | ||
val status: Status, | ||
val eventDate: Date, | ||
val dueDate: Date?, | ||
val completedDate: Date?, | ||
val organisationUnit: String, | ||
val organisationUnitCode: String?, | ||
val dataValues: List<RuleDataValue> | ||
) { | ||
enum class Status { | ||
ACTIVE, | ||
COMPLETED, | ||
SCHEDULE, | ||
SKIPPED, | ||
VISITED, | ||
OVERDUE | ||
} | ||
|
||
fun event(): String { | ||
return event | ||
} | ||
|
||
fun programStage(): String { | ||
return programStage | ||
} | ||
|
||
fun programStageName(): String { | ||
return programStageName | ||
} | ||
|
||
fun status(): Status { | ||
return status | ||
} | ||
|
||
fun eventDate(): Date { | ||
return eventDate | ||
} | ||
|
||
fun dueDate(): Date? { | ||
return dueDate | ||
} | ||
|
||
fun completedDate(): Date? { | ||
return completedDate | ||
} | ||
|
||
fun organisationUnit(): String { | ||
return organisationUnit | ||
} | ||
|
||
fun organisationUnitCode(): String? { | ||
return organisationUnitCode | ||
} | ||
|
||
fun dataValues(): List<RuleDataValue> { | ||
return dataValues | ||
} | ||
|
||
companion object { | ||
val EVENT_DATE_COMPARATOR: Comparator<RuleEvent> = Comparator.comparing{e: RuleEvent-> e.eventDate()}.reversed() | ||
} | ||
} |
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
Oops, something went wrong.