You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The equal-to operator silently fails when used with ValueQuantity. When comparing an Observation's value with an integer, the result is always false, regardless of the value on the other side of the comparison (see the NoResult statement).
Attempting to access inner values, such as value.value, results in a type checker error. However, accessing unit.value works as expected. To resolve this issue, we resorted to type casting, as demonstrated in QuantityValueFromObservation below.
Input
library HeartRateValidation version '1.0'
include FHIRHelpers version '4.0.1' called FHIRHelpers
define function QuantityValueFromObservation(o FHIR.Observation):
( cast o.value as FHIR.Quantity ).value.value
define "WithHelper":
[Observation] obs
where QuantityValueFromObservation(obs) = 1
define "NoResult":
[Observation] obs
where obs.value = 1
// internal error - handleProtoValue expected runtimeResultType to be a Named type, got: Choice<Named<FHIR.decimal>, System.String, System.Boolean, System.Integer, System.Time, System.DateTime>
define "TypeCheckerIssue":
[Observation] obs
where obs.value.value = 1
// internal error - handleProtoValue expected runtimeResultType to be a Named type, got: Choice<Named<FHIR.decimal>, System.String, System.Boolean, System.Integer, System.Time, System.DateTime>
define "TypeCheckerIssue":
[Observation] obs
where obs.value.value.value = 1
Description
The equal-to operator silently fails when used with
ValueQuantity
. When comparing anObservation
's value with an integer, the result is alwaysfalse
, regardless of the value on the other side of the comparison (see theNoResult
statement).Attempting to access inner values, such as
value.value
, results in a type checker error. However, accessingunit.value
works as expected. To resolve this issue, we resorted to type casting, as demonstrated inQuantityValueFromObservation
below.Input
Bundle
output
The text was updated successfully, but these errors were encountered: