aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-06-16 11:12:52 -0700
committervlad <vlad@driver.xyz>2017-06-16 11:12:52 -0700
commit111311fd935d9bd271c673cf10c0babe54bde8a6 (patch)
tree4742679ca244bb417e3d8fdacd51f269f4b969ae /src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala
parentc1993e0f834cb4e0ccfd1dd54610ffe50de60238 (diff)
downloadrest-query-111311fd935d9bd271c673cf10c0babe54bde8a6.tar.gz
rest-query-111311fd935d9bd271c673cf10c0babe54bde8a6.tar.bz2
rest-query-111311fd935d9bd271c673cf10c0babe54bde8a6.zip
Update PDS UI common code to be up to datev0.1.5
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala
index 9fc1992..19c0021 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/entities/Document.scala
@@ -101,15 +101,15 @@ object Document {
startDate <- Validators.nonEmpty("startDate")(input.startDate)
isOrderRight <- input.endDate match {
- case Some(endDate) if startDate.isAfter(endDate) =>
- Validators.fail("The start date should be less, than the end one")
+ case Some(endDate) if startDate.isAfter(endDate) =>
+ Validators.fail("The start date should be less, than the end one")
- case _ => Validators.success(true)
- }
+ case _ => Validators.success(true)
+ }
areDatesInThePast <- {
- val dates = List(input.startDate, input.endDate).flatten
- val now = LocalDate.now()
+ val dates = List(input.startDate, input.endDate).flatten
+ val now = LocalDate.now()
val hasInvalid = dates.exists(_.isAfter(now))
if (hasInvalid) Validators.fail("Dates should be in the past")
@@ -129,7 +129,7 @@ case class Document(id: LongId[Document] = LongId(0L),
recordId: LongId[MedicalRecord],
physician: Option[String],
typeId: Option[LongId[DocumentType]], // not null
- providerName: Option[String], // not null
+ providerName: Option[String], // not null
providerTypeId: Option[LongId[ProviderType]], // not null
meta: Option[TextJson[Meta]], // not null
startDate: Option[LocalDate], // not null
@@ -139,8 +139,7 @@ case class Document(id: LongId[Document] = LongId(0L),
import Document.Status._
if (previousStatus.nonEmpty) {
- assert(AllPrevious.contains(previousStatus.get),
- s"Previous status has invalid value: ${previousStatus.get}")
+ assert(AllPrevious.contains(previousStatus.get), s"Previous status has invalid value: ${previousStatus.get}")
}
// TODO: with the current business logic code this constraint sometimes harmful