diff options
author | vlad <vlad@driver.xyz> | 2017-06-30 19:38:37 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-30 19:38:37 -0700 |
commit | 96d81a36286e41035ff4068859a3b0f9da924fbc (patch) | |
tree | 8d9f0014140d1f07ca449b56adaba8ccb3d2fc59 /src/test/scala/xyz/driver/pdsuidomain | |
parent | a997aa6539d1f0af4ab4fc395ff2033335da312a (diff) | |
download | rest-query-96d81a36286e41035ff4068859a3b0f9da924fbc.tar.gz rest-query-96d81a36286e41035ff4068859a3b0f9da924fbc.tar.bz2 rest-query-96d81a36286e41035ff4068859a3b0f9da924fbc.zip |
Latest PDS UI utils including all the domain stuffv0.1.12
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala index 3955667..f851680 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala @@ -33,6 +33,35 @@ class DocumentSuite extends BaseSuite { } } + "getRequiredType" - { + "getOPNType" in { + val documentForOPNType = sampleDocument.copy( + typeId = Some(LongId(1L)), + providerTypeId = Some(LongId(1L)), + startDate = Some(LocalDate.now().minus(2, ChronoUnit.DAYS)) + ) + val r = documentForOPNType.getRequiredType("Outpatient Physician Note", "Medical Oncology") + assert(r.contains(Document.RequiredType.OPN), s"document should have the requiredType=OPN, but:$r") + } + + "getPNType" in { + val documentForPNType = sampleDocument.copy( + typeId = Some(LongId(6)) + ) + val r = documentForPNType.getRequiredType("Pathology Report", "") + assert(r.contains(Document.RequiredType.PN), s"document should have the requiredType=PN, but:$r") + } + "get None" in { + val document = sampleDocument.copy( + typeId = Some(LongId(1L)), + providerTypeId = Some(LongId(1L)), + startDate = Some(LocalDate.now().minus(7, ChronoUnit.MONTHS)) + ) + val r = document.getRequiredType("Outpatient Physician Note", "Medical Oncology") + assert(r.isEmpty, s"document should have the requiredType=None, but:$r") + } + } + private def sampleDocument = { val lastUpdate = LocalDateTime.now() @@ -42,11 +71,13 @@ class DocumentSuite extends BaseSuite { previousStatus = None, assignee = None, previousAssignee = None, + lastActiveUserId = None, recordId = LongId(2003), physician = None, typeId = Some(LongId(123)), providerName = Some("etst"), providerTypeId = Some(LongId(123)), + requiredType = None, startDate = Some(lastUpdate.toLocalDate.minusDays(2)), endDate = None, lastUpdate = lastUpdate, |