All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmTest.com.iprd.report.TransformationTest.kt Maven / Gradle / Ivy

There is a newer version: 1.0.28
Show newest version
/* IPRD Group 2022 */
package com.iprd.report

import com.google.common.truth.Truth
import kotlinx.coroutines.runBlocking
import org.hl7.fhir.r4.model.DateTimeType
import org.junit.jupiter.api.Test
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.Date

class TransformationTest {

  @Test
  fun processFhirPath() = runBlocking {
    val transformation = Transformation()
    val localDateTime = LocalDateTime.of(2023, 3, 11, 0, 0)
    val dateTimeFromLocal = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant())
    val gestationalAge = transformation.processFhirPath(listOf(DateTimeType(dateTimeFromLocal)), "computeGestationalAge", null)
    Truth.assertThat(gestationalAge).isEqualTo("10") // 133
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy