Boolean
For all boolean operators, the collections passed as operands are first evaluated as Booleans. The operators then use three-valued logic to propagate empty operands.
And
Bases: FHIRPath
A representation of the FHIRPath and
boolean logic operator.
Attributes:
Name | Type | Description |
---|---|---|
left |
FHIRPath
|
Left operand. |
right |
FHIRPath
|
Right operand. |
Source code in fhircraft/fhir/path/engine/boolean.py
evaluate(collection, *args, **kwargs)
Returns True
if both operands evaluate to True
, False
if either operand evaluates to False
, and the empty collection ([]
) otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection. |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/boolean.py
Implies
Bases: FHIRPath
A representation of the FHIRPath implies
boolean logic operator.
Attributes:
Name | Type | Description |
---|---|---|
left |
FHIRPath
|
Left operand. |
right |
FHIRPath
|
Right operand. |
Source code in fhircraft/fhir/path/engine/boolean.py
evaluate(collection, *args, **kwargs)
If the left operand evaluates to True
, this operator returns the boolean evaluation of the right operand. If the
left operand evaluates to False
, this operator returns True
. Otherwise, this operator returns True
if the right
operand evaluates to True
, and the empty collection ([]
) otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection. |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/boolean.py
Not
Bases: FHIRPathFunction
A representation of the FHIRPath not
boolean logic function.
Source code in fhircraft/fhir/path/engine/boolean.py
evaluate(collection, *args, **kwargs)
Returns True
if the input collection evaluates to False
, and False
if it evaluates to True
. Otherwise, the result is empty ([]
):
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection. |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/boolean.py
Or
Bases: FHIRPath
A representation of the FHIRPath or
boolean logic operator.
Attributes:
Name | Type | Description |
---|---|---|
left |
FHIRPath
|
Left operand. |
right |
FHIRPath
|
Right operand. |
Source code in fhircraft/fhir/path/engine/boolean.py
evaluate(collection, *args, **kwargs)
Returns False
if both operands evaluate to False
, True
if either operand evaluates to True
, and empty ([]
) otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection. |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/boolean.py
Xor
Bases: FHIRPath
A representation of the FHIRPath xor
boolean logic operator.
Attributes:
Name | Type | Description |
---|---|---|
left |
FHIRPath
|
Left operand. |
right |
FHIRPath
|
Right operand. |
Source code in fhircraft/fhir/path/engine/boolean.py
evaluate(collection, *args, **kwargs)
Returns True
if exactly one of the operands evaluates to True
, False
if either both operands evaluate to True
or both operands evaluate to False
, and the empty collection ([]
) otherwise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection. |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |