diff --git a/core/src/test/scala/com/rallyhealth/vapors/core/algebra/CapturePSpec.scala b/core/src/test/scala/com/rallyhealth/vapors/core/algebra/CapturePSpec.scala index db6ba92ef..22b6b5acd 100644 --- a/core/src/test/scala/com/rallyhealth/vapors/core/algebra/CapturePSpec.scala +++ b/core/src/test/scala/com/rallyhealth/vapors/core/algebra/CapturePSpec.scala @@ -15,8 +15,8 @@ class CapturePSpec extends AnyWordSpec with TypeCheckedTripleEquals { import com.rallyhealth.vapors.core.example.CaptureTimeRange._ "find a single fact from a query" in { - val q = valuesOfType(FactTypes.WeightMeasurement).exists { - _.get(_.select(_.value)) > 18 + val q = factsOfType(FactTypes.WeightMeasurement).exists { + _.get(_.select(_.value.value)) > 18.0 } val result = eval(JoeSchmoe.factTable)(q) assert(result.param.value === TimeRange(JoeSchmoe.weight.value.timestamp)) diff --git a/core/src/test/scala/com/rallyhealth/vapors/core/dsl/ExprBuilderSpec.scala b/core/src/test/scala/com/rallyhealth/vapors/core/dsl/ExprBuilderSpec.scala index 94d24f336..a325045cb 100644 --- a/core/src/test/scala/com/rallyhealth/vapors/core/dsl/ExprBuilderSpec.scala +++ b/core/src/test/scala/com/rallyhealth/vapors/core/dsl/ExprBuilderSpec.scala @@ -14,8 +14,8 @@ class ExprBuilderSpec extends AnyWordSpec { "ValExprBuilder" should { "combine lenses from chained .get() methods" in { - val q = valuesOfType(FactTypes.GenericMeasurement).exists { - _.get(_.select(_.value)) > 0.0 + val q = factsOfType(FactTypes.GenericMeasurement).exists { + _.get(_.select(_.value)).get(_.select(_.value)) > 0.0 }.returnOutput inside(q) { case Expr.ExistsInOutput(_, condExpr, _) => diff --git a/core/src/test/scala/com/rallyhealth/vapors/core/example/Snippets.scala b/core/src/test/scala/com/rallyhealth/vapors/core/example/Snippets.scala index a7e030238..650dcb1c5 100644 --- a/core/src/test/scala/com/rallyhealth/vapors/core/example/Snippets.scala +++ b/core/src/test/scala/com/rallyhealth/vapors/core/example/Snippets.scala @@ -16,11 +16,11 @@ class Snippets(val clock: Clock) { this(Clock.fixed(fixedLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant, ZoneId.systemDefault())) val ageFromDateOfBirth: Expr[FactTable, Seq[Int], Unit] = { - valuesOfType(FactTypes.DateOfBirth).map { value => + valuesOfType(FactTypes.DateOfBirth).map { dob => val ageInYears = dateDiff( - value, - value.embedResult(today(clock)), - value.embedConst(ChronoUnit.YEARS), + dob, + dob.embedResult(today(clock)), + dob.embedConst(ChronoUnit.YEARS), ) ageInYears.withOutputValue.get(_.select(_.toInt)) } @@ -34,15 +34,15 @@ class Snippets(val clock: Clock) { val isOver18: RootExpr[Boolean, Unit] = { usingDefinitions(ageFromDateOfBirthDef) { - valuesOfType(FactTypes.Age).exists { - _ >= 18 + factsOfType(FactTypes.Age).exists { + _.value >= 18 } } } lazy val isUser: RootExpr[Boolean, Unit] = { - valuesOfType(FactTypes.Role).exists { - _ >= Role.User + factsOfType(FactTypes.Role).exists { + _.value >= Role.User } } diff --git a/core/src/test/scala/com/rallyhealth/vapors/core/interpreter/UsingDefinitionsExprSpec.scala b/core/src/test/scala/com/rallyhealth/vapors/core/interpreter/UsingDefinitionsExprSpec.scala index 6f106555b..9b0831682 100644 --- a/core/src/test/scala/com/rallyhealth/vapors/core/interpreter/UsingDefinitionsExprSpec.scala +++ b/core/src/test/scala/com/rallyhealth/vapors/core/interpreter/UsingDefinitionsExprSpec.scala @@ -48,7 +48,9 @@ class UsingDefinitionsExprSpec extends AnyWordSpec { val definition = Snippets.isEligibleDef val result = eval(facts) { usingDefinitions(definition) { - valuesOfType(definition.factType).exists(_ === true) + factsOfType(definition.factType).exists { + _.get(_.select(_.value)) + } } } assert(result.output.value)