diff options
author | vlad <vlad@driver.xyz> | 2017-06-13 16:12:20 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-13 16:12:20 -0700 |
commit | cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c (patch) | |
tree | 062e8dad1a1513e26b0fd08b1742d6ff2ee874f7 /src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala | |
parent | 0000a65ab4479a2a40e2d6468036438e9705b4aa (diff) | |
download | rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.gz rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.bz2 rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.zip |
Adding domain entitiesv0.1.0
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala new file mode 100644 index 0000000..c9d1d88 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/entities/DirectReport.scala @@ -0,0 +1,42 @@ +package xyz.driver.pdsuidomain.entities + +import java.time.LocalDateTime + +import xyz.driver.pdsuicommon.domain.UuidId +import xyz.driver.pdsuicommon.logging._ +import xyz.driver.pdsuicommon.utils.Utils +import xyz.driver.pdsuidomain.entities.DirectReport.ReportType + +object DirectReport { + + sealed trait ReportType extends Product with Serializable { + def oneOf(xs: ReportType*): Boolean = xs.contains(this) + + def oneOf(xs: Set[ReportType]): Boolean = xs.contains(this) + } + + object ReportType { + case object IHC extends ReportType + case object DNA extends ReportType + case object CFDNA extends ReportType + + val All = Set(IHC, DNA, CFDNA) + implicit def toPhiString(x: ReportType): PhiString = Unsafe(Utils.getClassSimpleName(x.getClass)) + } + + implicit def toPhiString(x: DirectReport): PhiString = { + import x._ + phi"DirectReport(id=$id, patientId=$patientId, reportType=$reportType, date=${Unsafe(date)}, " + + phi"documentType=${Unsafe(documentType)}, providerType=${Unsafe(providerType)}, " + + phi"providerName=${Unsafe(providerName)})" + } + +} + +case class DirectReport(id: UuidId[DirectReport], + patientId: UuidId[Patient], + reportType: ReportType, + date: LocalDateTime, + documentType: String, + providerType: String, + providerName: String) |