Existence
The filtering module contains the object representations of the existence-category FHIRPath functions.
All
Bases: FHIRPathFunction
Representation of the FHIRPath all()
function.
Attributes:
Name | Type | Description |
---|---|---|
criteria |
FHIRPath
|
Optional criteria to be applied to the collection prior to the evalution. |
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns True
if for every element in the input collection, criteria evaluates to True
.
Otherwise, the result is False
. If the input collection is empty ({}
), the result is True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
AllFalse
Bases: FHIRPathFunction
Representation of the FHIRPath allFalse()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Takes a collection of Boolean values and returns True
if all the items are False
.
If any items are True
, the result is False
. If the input is empty ({}
), the result is True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
AllTrue
Bases: FHIRPathFunction
Representation of the FHIRPath allTrue()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Takes a collection of Boolean values and returns True
if all the items are True
. If any
items are False
, the result is False
. If the input is empty ({}
), the result is True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
AnyFalse
Bases: FHIRPathFunction
Representation of the FHIRPath anyFalse()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Takes a collection of Boolean values and returns True
if any of the items are False
. If all
the items are True
, or if the input is empty ({}
), the result is False
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
AnyTrue
Bases: FHIRPathFunction
Representation of the FHIRPath anyTrue()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Takes a collection of Boolean values and returns True
if any of the items are True
.
If all the items are False
, or if the input is empty ({}
), the result is False
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
Count
Bases: FHIRPathFunction
Representation of the FHIRPath count()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns the integer count of the number of items in the input collection. Returns 0 when the input collection is empty.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Name | Type | Description |
---|---|---|
count |
int
|
THe number of items in the collection |
Source code in fhircraft/fhir/path/engine/existence.py
Distinct
Bases: FHIRPathFunction
Representation of the FHIRPath distinct()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns a collection containing only the unique items in the input collection. If the input collection is empty ([]
), the result is empty.
Note that the order of elements in the input collection is not guaranteed to be preserved in the result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Name | Type | Description |
---|---|---|
collection |
List[FHIRPathCollectionItem])
|
The output collection |
Source code in fhircraft/fhir/path/engine/existence.py
Empty
Bases: FHIRPathFunction
Representation of the FHIRPath empty()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns True
if the input collection is empty ({}
) and False
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/existence.py
Exists
Bases: FHIRPathFunction
Representation of the FHIRPath exists()
function.
Attributes:
Name | Type | Description |
---|---|---|
criteria |
FHIRPath
|
Optional criteria to be applied to the collection prior to the determination of the exists |
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns True
if the collection has any elements, and False
otherwise.
This is the opposite of empty(), and as such is a shorthand for empty().not().
If the input collection is empty ({}
), the result is False
.
The function can also take an optional criteria to be applied to the collection
prior to the determination of the exists. In this case, the function is
shorthand for where(criteria).exists().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
IsDistinct
Bases: FHIRPathFunction
Representation of the FHIRPath isDistinct()
function.
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns True
if all the items in the input collection are distinct.
If the input collection is empty ([]
), the result is True
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Source code in fhircraft/fhir/path/engine/existence.py
SubsetOf
Bases: FHIRPathFunction
Representation of the FHIRPath subsetOf()
function.
Attributes:
Name | Type | Description |
---|---|---|
other |
Union[List[FHIRPathCollectionItem], FHIRPath]
|
Other collection to which to determine whether input is a subset of. |
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns True
if all items in the input collection are members of the collection passed as the
other argument.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Note
Conceptually, this function is evaluated by testing each element in the input collection for
membership in the other collection, with a default of True
. This means that if the input collection
is empty ([]
), the result is True
, otherwise if the other collection is empty, the result is False
.
Source code in fhircraft/fhir/path/engine/existence.py
SupersetOf
Bases: FHIRPathFunction
Representation of the FHIRPath supersetOf()
function.
Attributes:
Name | Type | Description |
---|---|---|
other |
Union[List[FHIRPathCollectionItem], FHIRPath]
|
Other collection to which to determine whether input is a superset of. |
Source code in fhircraft/fhir/path/engine/existence.py
evaluate(collection, *args, **kwargs)
Returns true if all items in the collection passed as the other argument are members of the input collection. Membership is determined using the = (Equals) (=) operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection |
List[FHIRPathCollectionItem]
|
The input collection |
required |
Returns:
Type | Description |
---|---|
bool
|
bool |
Note
Conceptually, this function is evaluated by testing each element in the other collection for
membership in the input collection, with a default of True
. This means that if the other collection
is empty ([]
), the result is True
, otherwise if the other collection is empty, the result is False
.