@medplum/core 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -23
- package/dist/cjs/index.js +2696 -93
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/esm/index.js +2691 -92
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/types/client.d.ts +134 -36
- package/dist/types/fhirpath/atoms.d.ts +150 -0
- package/dist/types/fhirpath/date.d.ts +1 -0
- package/dist/types/fhirpath/functions.d.ts +964 -0
- package/dist/types/fhirpath/index.d.ts +2 -0
- package/dist/types/fhirpath/parse.d.ts +17 -0
- package/dist/types/fhirpath/tokenize.d.ts +5 -0
- package/dist/types/fhirpath/utils.d.ts +65 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils.d.ts +12 -0
- package/package.json +2 -4
- package/dist/types/fix-ro-iddentifiers.d.ts +0 -0
|
@@ -0,0 +1,964 @@
|
|
|
1
|
+
import { Quantity } from '@medplum/fhirtypes';
|
|
2
|
+
import { Atom } from './atoms';
|
|
3
|
+
/**
|
|
4
|
+
* Returns true if the input collection is empty ({ }) and false otherwise.
|
|
5
|
+
*
|
|
6
|
+
* See: https://hl7.org/fhirpath/#empty-boolean
|
|
7
|
+
*
|
|
8
|
+
* @param input The input collection.
|
|
9
|
+
* @returns True if the input collection is empty ({ }) and false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function empty(input: unknown[]): [boolean];
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if the collection has unknown elements, and false otherwise.
|
|
14
|
+
* This is the opposite of empty(), and as such is a shorthand for empty().not().
|
|
15
|
+
* If the input collection is empty ({ }), the result is false.
|
|
16
|
+
*
|
|
17
|
+
* The function can also take an optional criteria to be applied to the collection
|
|
18
|
+
* prior to the determination of the exists. In this case, the function is shorthand
|
|
19
|
+
* for where(criteria).exists().
|
|
20
|
+
*
|
|
21
|
+
* See: https://hl7.org/fhirpath/#existscriteria-expression-boolean
|
|
22
|
+
*
|
|
23
|
+
* @param input
|
|
24
|
+
* @param criteria
|
|
25
|
+
* @returns True if the collection has unknown elements, and false otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function exists(input: unknown[], criteria?: Atom): [boolean];
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if for every element in the input collection, criteria evaluates to true.
|
|
30
|
+
* Otherwise, the result is false.
|
|
31
|
+
*
|
|
32
|
+
* If the input collection is empty ({ }), the result is true.
|
|
33
|
+
*
|
|
34
|
+
* See: https://hl7.org/fhirpath/#allcriteria-expression-boolean
|
|
35
|
+
*
|
|
36
|
+
* @param input The input collection.
|
|
37
|
+
* @param criteria The evaluation criteria.
|
|
38
|
+
* @returns True if for every element in the input collection, criteria evaluates to true.
|
|
39
|
+
*/
|
|
40
|
+
export declare function all(input: unknown[], criteria: Atom): [boolean];
|
|
41
|
+
/**
|
|
42
|
+
* Takes a collection of Boolean values and returns true if all the items are true.
|
|
43
|
+
* If unknown items are false, the result is false.
|
|
44
|
+
* If the input is empty ({ }), the result is true.
|
|
45
|
+
*
|
|
46
|
+
* See: https://hl7.org/fhirpath/#alltrue-boolean
|
|
47
|
+
*
|
|
48
|
+
* @param input The input collection.
|
|
49
|
+
* @param criteria The evaluation criteria.
|
|
50
|
+
* @returns True if all the items are true.
|
|
51
|
+
*/
|
|
52
|
+
export declare function allTrue(input: unknown[]): [boolean];
|
|
53
|
+
/**
|
|
54
|
+
* Takes a collection of Boolean values and returns true if unknown of the items are true.
|
|
55
|
+
* If all the items are false, or if the input is empty ({ }), the result is false.
|
|
56
|
+
*
|
|
57
|
+
* See: https://hl7.org/fhirpath/#anytrue-boolean
|
|
58
|
+
*
|
|
59
|
+
* @param input The input collection.
|
|
60
|
+
* @param criteria The evaluation criteria.
|
|
61
|
+
* @returns True if unknown of the items are true.
|
|
62
|
+
*/
|
|
63
|
+
export declare function anyTrue(input: unknown[]): [boolean];
|
|
64
|
+
/**
|
|
65
|
+
* Takes a collection of Boolean values and returns true if all the items are false.
|
|
66
|
+
* If unknown items are true, the result is false.
|
|
67
|
+
* If the input is empty ({ }), the result is true.
|
|
68
|
+
*
|
|
69
|
+
* See: https://hl7.org/fhirpath/#allfalse-boolean
|
|
70
|
+
*
|
|
71
|
+
* @param input The input collection.
|
|
72
|
+
* @param criteria The evaluation criteria.
|
|
73
|
+
* @returns True if all the items are false.
|
|
74
|
+
*/
|
|
75
|
+
export declare function allFalse(input: unknown[]): [boolean];
|
|
76
|
+
/**
|
|
77
|
+
* Takes a collection of Boolean values and returns true if unknown of the items are false.
|
|
78
|
+
* If all the items are true, or if the input is empty ({ }), the result is false.
|
|
79
|
+
*
|
|
80
|
+
* See: https://hl7.org/fhirpath/#anyfalse-boolean
|
|
81
|
+
*
|
|
82
|
+
* @param input The input collection.
|
|
83
|
+
* @param criteria The evaluation criteria.
|
|
84
|
+
* @returns True if for every element in the input collection, criteria evaluates to true.
|
|
85
|
+
*/
|
|
86
|
+
export declare function anyFalse(input: unknown[]): [boolean];
|
|
87
|
+
/**
|
|
88
|
+
* Returns true if all items in the input collection are members of the collection passed
|
|
89
|
+
* as the other argument. Membership is determined using the = (Equals) (=) operation.
|
|
90
|
+
*
|
|
91
|
+
* Conceptually, this function is evaluated by testing each element in the input collection
|
|
92
|
+
* for membership in the other collection, with a default of true. This means that if the
|
|
93
|
+
* input collection is empty ({ }), the result is true, otherwise if the other collection
|
|
94
|
+
* is empty ({ }), the result is false.
|
|
95
|
+
*
|
|
96
|
+
* See: http://hl7.org/fhirpath/#subsetofother-collection-boolean
|
|
97
|
+
*/
|
|
98
|
+
export declare const subsetOf: () => [];
|
|
99
|
+
/**
|
|
100
|
+
* Returns true if all items in the collection passed as the other argument are members of
|
|
101
|
+
* the input collection. Membership is determined using the = (Equals) (=) operation.
|
|
102
|
+
*
|
|
103
|
+
* Conceptually, this function is evaluated by testing each element in the other collection
|
|
104
|
+
* for membership in the input collection, with a default of true. This means that if the
|
|
105
|
+
* other collection is empty ({ }), the result is true, otherwise if the input collection
|
|
106
|
+
* is empty ({ }), the result is false.
|
|
107
|
+
*
|
|
108
|
+
* See: http://hl7.org/fhirpath/#supersetofother-collection-boolean
|
|
109
|
+
*/
|
|
110
|
+
export declare const supersetOf: () => [];
|
|
111
|
+
/**
|
|
112
|
+
* Returns the integer count of the number of items in the input collection.
|
|
113
|
+
* Returns 0 when the input collection is empty.
|
|
114
|
+
*
|
|
115
|
+
* See: https://hl7.org/fhirpath/#count-integer
|
|
116
|
+
*
|
|
117
|
+
* @param input The input collection.
|
|
118
|
+
* @returns The integer count of the number of items in the input collection.
|
|
119
|
+
*/
|
|
120
|
+
export declare function count(input: unknown[]): [number];
|
|
121
|
+
/**
|
|
122
|
+
* Returns a collection containing only the unique items in the input collection.
|
|
123
|
+
* To determine whether two items are the same, the = (Equals) (=) operator is used,
|
|
124
|
+
* as defined below.
|
|
125
|
+
*
|
|
126
|
+
* If the input collection is empty ({ }), the result is empty.
|
|
127
|
+
*
|
|
128
|
+
* Note that the order of elements in the input collection is not guaranteed to be
|
|
129
|
+
* preserved in the result.
|
|
130
|
+
*
|
|
131
|
+
* See: https://hl7.org/fhirpath/#distinct-collection
|
|
132
|
+
*
|
|
133
|
+
* @param input The input collection.
|
|
134
|
+
* @returns The integer count of the number of items in the input collection.
|
|
135
|
+
*/
|
|
136
|
+
export declare function distinct(input: unknown[]): unknown[];
|
|
137
|
+
/**
|
|
138
|
+
* Returns true if all the items in the input collection are distinct.
|
|
139
|
+
* To determine whether two items are distinct, the = (Equals) (=) operator is used,
|
|
140
|
+
* as defined below.
|
|
141
|
+
*
|
|
142
|
+
* See: https://hl7.org/fhirpath/#isdistinct-boolean
|
|
143
|
+
*
|
|
144
|
+
* @param input The input collection.
|
|
145
|
+
* @returns The integer count of the number of items in the input collection.
|
|
146
|
+
*/
|
|
147
|
+
export declare function isDistinct(input: unknown[]): [boolean];
|
|
148
|
+
/**
|
|
149
|
+
* Returns a collection containing only those elements in the input collection
|
|
150
|
+
* for which the stated criteria expression evaluates to true.
|
|
151
|
+
* Elements for which the expression evaluates to false or empty ({ }) are not
|
|
152
|
+
* included in the result.
|
|
153
|
+
*
|
|
154
|
+
* If the input collection is empty ({ }), the result is empty.
|
|
155
|
+
*
|
|
156
|
+
* If the result of evaluating the condition is other than a single boolean value,
|
|
157
|
+
* the evaluation will end and signal an error to the calling environment,
|
|
158
|
+
* consistent with singleton evaluation of collections behavior.
|
|
159
|
+
*
|
|
160
|
+
* See: https://hl7.org/fhirpath/#wherecriteria-expression-collection
|
|
161
|
+
*
|
|
162
|
+
* @param input The input collection.
|
|
163
|
+
* @param condition The condition atom.
|
|
164
|
+
* @returns A collection containing only those elements in the input collection for which the stated criteria expression evaluates to true.
|
|
165
|
+
*/
|
|
166
|
+
export declare function where(input: unknown[], criteria: Atom): unknown[];
|
|
167
|
+
/**
|
|
168
|
+
* Evaluates the projection expression for each item in the input collection.
|
|
169
|
+
* The result of each evaluation is added to the output collection. If the
|
|
170
|
+
* evaluation results in a collection with multiple items, all items are added
|
|
171
|
+
* to the output collection (collections resulting from evaluation of projection
|
|
172
|
+
* are flattened). This means that if the evaluation for an element results in
|
|
173
|
+
* the empty collection ({ }), no element is added to the result, and that if
|
|
174
|
+
* the input collection is empty ({ }), the result is empty as well.
|
|
175
|
+
*
|
|
176
|
+
* See: http://hl7.org/fhirpath/#selectprojection-expression-collection
|
|
177
|
+
*/
|
|
178
|
+
export declare function select(input: unknown[], criteria: Atom): unknown[];
|
|
179
|
+
/**
|
|
180
|
+
* A version of select that will repeat the projection and add it to the output
|
|
181
|
+
* collection, as long as the projection yields new items (as determined by
|
|
182
|
+
* the = (Equals) (=) operator).
|
|
183
|
+
*
|
|
184
|
+
* See: http://hl7.org/fhirpath/#repeatprojection-expression-collection
|
|
185
|
+
*/
|
|
186
|
+
export declare const repeat: () => [];
|
|
187
|
+
/**
|
|
188
|
+
* Returns a collection that contains all items in the input collection that
|
|
189
|
+
* are of the given type or a subclass thereof. If the input collection is
|
|
190
|
+
* empty ({ }), the result is empty. The type argument is an identifier that
|
|
191
|
+
* must resolve to the name of a type in a model
|
|
192
|
+
*
|
|
193
|
+
* See: http://hl7.org/fhirpath/#oftypetype-type-specifier-collection
|
|
194
|
+
*/
|
|
195
|
+
export declare const ofType: () => [];
|
|
196
|
+
/**
|
|
197
|
+
* Will return the single item in the input if there is just one item.
|
|
198
|
+
* If the input collection is empty ({ }), the result is empty.
|
|
199
|
+
* If there are multiple items, an error is signaled to the evaluation environment.
|
|
200
|
+
* This function is useful for ensuring that an error is returned if an assumption
|
|
201
|
+
* about cardinality is violated at run-time.
|
|
202
|
+
*
|
|
203
|
+
* See: https://hl7.org/fhirpath/#single-collection
|
|
204
|
+
*
|
|
205
|
+
* @param input The input collection.
|
|
206
|
+
* @returns The single item in the input if there is just one item.
|
|
207
|
+
*/
|
|
208
|
+
export declare function single(input: unknown[]): unknown[];
|
|
209
|
+
/**
|
|
210
|
+
* Returns a collection containing only the first item in the input collection.
|
|
211
|
+
* This function is equivalent to item[0], so it will return an empty collection if the input collection has no items.
|
|
212
|
+
*
|
|
213
|
+
* See: https://hl7.org/fhirpath/#first-collection
|
|
214
|
+
*
|
|
215
|
+
* @param input The input collection.
|
|
216
|
+
* @returns A collection containing only the first item in the input collection.
|
|
217
|
+
*/
|
|
218
|
+
export declare function first(input: unknown[]): unknown[];
|
|
219
|
+
/**
|
|
220
|
+
* Returns a collection containing only the last item in the input collection.
|
|
221
|
+
* Will return an empty collection if the input collection has no items.
|
|
222
|
+
*
|
|
223
|
+
* See: https://hl7.org/fhirpath/#last-collection
|
|
224
|
+
*
|
|
225
|
+
* @param input The input collection.
|
|
226
|
+
* @returns A collection containing only the last item in the input collection.
|
|
227
|
+
*/
|
|
228
|
+
export declare function last(input: unknown[]): unknown[];
|
|
229
|
+
/**
|
|
230
|
+
* Returns a collection containing all but the first item in the input collection.
|
|
231
|
+
* Will return an empty collection if the input collection has no items, or only one item.
|
|
232
|
+
*
|
|
233
|
+
* See: https://hl7.org/fhirpath/#tail-collection
|
|
234
|
+
*
|
|
235
|
+
* @param input The input collection.
|
|
236
|
+
* @returns A collection containing all but the first item in the input collection.
|
|
237
|
+
*/
|
|
238
|
+
export declare function tail(input: unknown[]): unknown[];
|
|
239
|
+
/**
|
|
240
|
+
* Returns a collection containing all but the first num items in the input collection.
|
|
241
|
+
* Will return an empty collection if there are no items remaining after the
|
|
242
|
+
* indicated number of items have been skipped, or if the input collection is empty.
|
|
243
|
+
* If num is less than or equal to zero, the input collection is simply returned.
|
|
244
|
+
*
|
|
245
|
+
* See: https://hl7.org/fhirpath/#skipnum-integer-collection
|
|
246
|
+
*
|
|
247
|
+
* @param input The input collection.
|
|
248
|
+
* @returns A collection containing all but the first item in the input collection.
|
|
249
|
+
*/
|
|
250
|
+
export declare function skip(input: unknown[], num: Atom): unknown[];
|
|
251
|
+
/**
|
|
252
|
+
* Returns a collection containing the first num items in the input collection,
|
|
253
|
+
* or less if there are less than num items.
|
|
254
|
+
* If num is less than or equal to 0, or if the input collection is empty ({ }),
|
|
255
|
+
* take returns an empty collection.
|
|
256
|
+
*
|
|
257
|
+
* See: https://hl7.org/fhirpath/#takenum-integer-collection
|
|
258
|
+
*
|
|
259
|
+
* @param input The input collection.
|
|
260
|
+
* @returns A collection containing the first num items in the input collection.
|
|
261
|
+
*/
|
|
262
|
+
export declare function take(input: unknown[], num: Atom): unknown[];
|
|
263
|
+
/**
|
|
264
|
+
* Returns the set of elements that are in both collections.
|
|
265
|
+
* Duplicate items will be eliminated by this function.
|
|
266
|
+
* Order of items is not guaranteed to be preserved in the result of this function.
|
|
267
|
+
*
|
|
268
|
+
* See: http://hl7.org/fhirpath/#intersectother-collection-collection
|
|
269
|
+
*/
|
|
270
|
+
export declare function intersect(input: unknown[], other: Atom): unknown[];
|
|
271
|
+
/**
|
|
272
|
+
* Returns the set of elements that are not in the other collection.
|
|
273
|
+
* Duplicate items will not be eliminated by this function, and order will be preserved.
|
|
274
|
+
*
|
|
275
|
+
* e.g. (1 | 2 | 3).exclude(2) returns (1 | 3).
|
|
276
|
+
*
|
|
277
|
+
* See: http://hl7.org/fhirpath/#excludeother-collection-collection
|
|
278
|
+
*/
|
|
279
|
+
export declare function exclude(input: unknown[], other: Atom): unknown[];
|
|
280
|
+
/**
|
|
281
|
+
* Merge the two collections into a single collection,
|
|
282
|
+
* eliminating unknown duplicate values (using = (Equals) (=) to determine equality).
|
|
283
|
+
* There is no expectation of order in the resulting collection.
|
|
284
|
+
*
|
|
285
|
+
* In other words, this function returns the distinct list of elements from both inputs.
|
|
286
|
+
*
|
|
287
|
+
* See: http://hl7.org/fhirpath/#unionother-collection
|
|
288
|
+
*/
|
|
289
|
+
export declare function union(input: unknown[], other: Atom): unknown[];
|
|
290
|
+
/**
|
|
291
|
+
* Merge the input and other collections into a single collection
|
|
292
|
+
* without eliminating duplicate values. Combining an empty collection
|
|
293
|
+
* with a non-empty collection will return the non-empty collection.
|
|
294
|
+
*
|
|
295
|
+
* There is no expectation of order in the resulting collection.
|
|
296
|
+
*
|
|
297
|
+
* See: http://hl7.org/fhirpath/#combineother-collection-collection
|
|
298
|
+
*/
|
|
299
|
+
export declare function combine(input: unknown[], other: Atom): unknown[];
|
|
300
|
+
/**
|
|
301
|
+
* The iif function in FHIRPath is an immediate if,
|
|
302
|
+
* also known as a conditional operator (such as C’s ? : operator).
|
|
303
|
+
*
|
|
304
|
+
* The criterion expression is expected to evaluate to a Boolean.
|
|
305
|
+
*
|
|
306
|
+
* If criterion is true, the function returns the value of the true-result argument.
|
|
307
|
+
*
|
|
308
|
+
* If criterion is false or an empty collection, the function returns otherwise-result,
|
|
309
|
+
* unless the optional otherwise-result is not given, in which case the function returns an empty collection.
|
|
310
|
+
*
|
|
311
|
+
* Note that short-circuit behavior is expected in this function. In other words,
|
|
312
|
+
* true-result should only be evaluated if the criterion evaluates to true,
|
|
313
|
+
* and otherwise-result should only be evaluated otherwise. For implementations,
|
|
314
|
+
* this means delaying evaluation of the arguments.
|
|
315
|
+
*
|
|
316
|
+
* @param input
|
|
317
|
+
* @param criterion
|
|
318
|
+
* @param trueResult
|
|
319
|
+
* @param otherwiseResult
|
|
320
|
+
* @returns
|
|
321
|
+
*/
|
|
322
|
+
export declare function iif(input: unknown[], criterion: Atom, trueResult: Atom, otherwiseResult?: Atom): unknown[];
|
|
323
|
+
/**
|
|
324
|
+
* Converts an input collection to a boolean.
|
|
325
|
+
*
|
|
326
|
+
* If the input collection contains a single item, this function will return a single boolean if:
|
|
327
|
+
* 1) the item is a Boolean
|
|
328
|
+
* 2) the item is an Integer and is equal to one of the possible integer representations of Boolean values
|
|
329
|
+
* 3) the item is a Decimal that is equal to one of the possible decimal representations of Boolean values
|
|
330
|
+
* 4) the item is a String that is equal to one of the possible string representations of Boolean values
|
|
331
|
+
*
|
|
332
|
+
* If the item is not one the above types, or the item is a String, Integer, or Decimal, but is not equal to one of the possible values convertible to a Boolean, the result is empty.
|
|
333
|
+
*
|
|
334
|
+
* See: https://hl7.org/fhirpath/#toboolean-boolean
|
|
335
|
+
*
|
|
336
|
+
* @param input
|
|
337
|
+
* @returns
|
|
338
|
+
*/
|
|
339
|
+
export declare function toBoolean(input: unknown[]): boolean[];
|
|
340
|
+
/**
|
|
341
|
+
* If the input collection contains a single item, this function will return true if:
|
|
342
|
+
* 1) the item is a Boolean
|
|
343
|
+
* 2) the item is an Integer that is equal to one of the possible integer representations of Boolean values
|
|
344
|
+
* 3) the item is a Decimal that is equal to one of the possible decimal representations of Boolean values
|
|
345
|
+
* 4) the item is a String that is equal to one of the possible string representations of Boolean values
|
|
346
|
+
*
|
|
347
|
+
* If the item is not one of the above types, or the item is a String, Integer, or Decimal, but is not equal to one of the possible values convertible to a Boolean, the result is false.
|
|
348
|
+
*
|
|
349
|
+
* Possible values for Integer, Decimal, and String are described in the toBoolean() function.
|
|
350
|
+
*
|
|
351
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
352
|
+
*
|
|
353
|
+
* If the input collection is empty, the result is empty.
|
|
354
|
+
*
|
|
355
|
+
* See: http://hl7.org/fhirpath/#convertstoboolean-boolean
|
|
356
|
+
*
|
|
357
|
+
* @param input
|
|
358
|
+
* @returns
|
|
359
|
+
*/
|
|
360
|
+
export declare function convertsToBoolean(input: unknown[]): boolean[];
|
|
361
|
+
/**
|
|
362
|
+
* Returns the integer representation of the input.
|
|
363
|
+
*
|
|
364
|
+
* If the input collection contains a single item, this function will return a single integer if:
|
|
365
|
+
* 1) the item is an Integer
|
|
366
|
+
* 2) the item is a String and is convertible to an integer
|
|
367
|
+
* 3) the item is a Boolean, where true results in a 1 and false results in a 0.
|
|
368
|
+
*
|
|
369
|
+
* If the item is not one the above types, the result is empty.
|
|
370
|
+
*
|
|
371
|
+
* If the item is a String, but the string is not convertible to an integer (using the regex format (\\+|-)?\d+), the result is empty.
|
|
372
|
+
*
|
|
373
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
374
|
+
*
|
|
375
|
+
* If the input collection is empty, the result is empty.
|
|
376
|
+
*
|
|
377
|
+
* See: https://hl7.org/fhirpath/#tointeger-integer
|
|
378
|
+
*
|
|
379
|
+
* @param input The input collection.
|
|
380
|
+
* @returns The string representation of the input.
|
|
381
|
+
*/
|
|
382
|
+
export declare function toInteger(input: unknown[]): number[];
|
|
383
|
+
/**
|
|
384
|
+
* Returns true if the input can be converted to string.
|
|
385
|
+
*
|
|
386
|
+
* If the input collection contains a single item, this function will return true if:
|
|
387
|
+
* 1) the item is an Integer
|
|
388
|
+
* 2) the item is a String and is convertible to an Integer
|
|
389
|
+
* 3) the item is a Boolean
|
|
390
|
+
* 4) If the item is not one of the above types, or the item is a String, but is not convertible to an Integer (using the regex format (\\+|-)?\d+), the result is false.
|
|
391
|
+
*
|
|
392
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
393
|
+
*
|
|
394
|
+
* If the input collection is empty, the result is empty.
|
|
395
|
+
*
|
|
396
|
+
* See: https://hl7.org/fhirpath/#convertstointeger-boolean
|
|
397
|
+
*
|
|
398
|
+
* @param input The input collection.
|
|
399
|
+
* @returns
|
|
400
|
+
*/
|
|
401
|
+
export declare function convertsToInteger(input: unknown[]): boolean[];
|
|
402
|
+
/**
|
|
403
|
+
* If the input collection contains a single item, this function will return a single date if:
|
|
404
|
+
* 1) the item is a Date
|
|
405
|
+
* 2) the item is a DateTime
|
|
406
|
+
* 3) the item is a String and is convertible to a Date
|
|
407
|
+
*
|
|
408
|
+
* If the item is not one of the above types, the result is empty.
|
|
409
|
+
*
|
|
410
|
+
* If the item is a String, but the string is not convertible to a Date (using the format YYYY-MM-DD), the result is empty.
|
|
411
|
+
*
|
|
412
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
413
|
+
*
|
|
414
|
+
* If the input collection is empty, the result is empty.
|
|
415
|
+
*
|
|
416
|
+
* See: https://hl7.org/fhirpath/#todate-date
|
|
417
|
+
*/
|
|
418
|
+
export declare function toDate(input: unknown[]): string[];
|
|
419
|
+
/**
|
|
420
|
+
* If the input collection contains a single item, this function will return true if:
|
|
421
|
+
* 1) the item is a Date
|
|
422
|
+
* 2) the item is a DateTime
|
|
423
|
+
* 3) the item is a String and is convertible to a Date
|
|
424
|
+
*
|
|
425
|
+
* If the item is not one of the above types, or is not convertible to a Date (using the format YYYY-MM-DD), the result is false.
|
|
426
|
+
*
|
|
427
|
+
* If the item contains a partial date (e.g. '2012-01'), the result is a partial date.
|
|
428
|
+
*
|
|
429
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
430
|
+
*
|
|
431
|
+
* If the input collection is empty, the result is empty.
|
|
432
|
+
*
|
|
433
|
+
* See: https://hl7.org/fhirpath/#convertstodate-boolean
|
|
434
|
+
*/
|
|
435
|
+
export declare function convertsToDate(input: unknown[]): boolean[];
|
|
436
|
+
/**
|
|
437
|
+
* If the input collection contains a single item, this function will return a single datetime if:
|
|
438
|
+
* 1) the item is a DateTime
|
|
439
|
+
* 2) the item is a Date, in which case the result is a DateTime with the year, month, and day of the Date, and the time components empty (not set to zero)
|
|
440
|
+
* 3) the item is a String and is convertible to a DateTime
|
|
441
|
+
*
|
|
442
|
+
* If the item is not one of the above types, the result is empty.
|
|
443
|
+
*
|
|
444
|
+
* If the item is a String, but the string is not convertible to a DateTime (using the format YYYY-MM-DDThh:mm:ss.fff(+|-)hh:mm), the result is empty.
|
|
445
|
+
*
|
|
446
|
+
* If the item contains a partial datetime (e.g. '2012-01-01T10:00'), the result is a partial datetime.
|
|
447
|
+
*
|
|
448
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
449
|
+
*
|
|
450
|
+
* If the input collection is empty, the result is empty.
|
|
451
|
+
|
|
452
|
+
* See: https://hl7.org/fhirpath/#todatetime-datetime
|
|
453
|
+
*
|
|
454
|
+
* @param input
|
|
455
|
+
* @returns
|
|
456
|
+
*/
|
|
457
|
+
export declare function toDateTime(input: unknown[]): string[];
|
|
458
|
+
/**
|
|
459
|
+
* If the input collection contains a single item, this function will return true if:
|
|
460
|
+
* 1) the item is a DateTime
|
|
461
|
+
* 2) the item is a Date
|
|
462
|
+
* 3) the item is a String and is convertible to a DateTime
|
|
463
|
+
*
|
|
464
|
+
* If the item is not one of the above types, or is not convertible to a DateTime (using the format YYYY-MM-DDThh:mm:ss.fff(+|-)hh:mm), the result is false.
|
|
465
|
+
*
|
|
466
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
467
|
+
*
|
|
468
|
+
* If the input collection is empty, the result is empty.
|
|
469
|
+
*
|
|
470
|
+
* See: https://hl7.org/fhirpath/#convertstodatetime-boolean
|
|
471
|
+
*
|
|
472
|
+
* @param input
|
|
473
|
+
* @returns
|
|
474
|
+
*/
|
|
475
|
+
export declare function convertsToDateTime(input: unknown[]): boolean[];
|
|
476
|
+
/**
|
|
477
|
+
* If the input collection contains a single item, this function will return a single decimal if:
|
|
478
|
+
* 1) the item is an Integer or Decimal
|
|
479
|
+
* 2) the item is a String and is convertible to a Decimal
|
|
480
|
+
* 3) the item is a Boolean, where true results in a 1.0 and false results in a 0.0.
|
|
481
|
+
* 4) If the item is not one of the above types, the result is empty.
|
|
482
|
+
*
|
|
483
|
+
* If the item is a String, but the string is not convertible to a Decimal (using the regex format (\\+|-)?\d+(\.\d+)?), the result is empty.
|
|
484
|
+
*
|
|
485
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
486
|
+
*
|
|
487
|
+
* If the input collection is empty, the result is empty.
|
|
488
|
+
*
|
|
489
|
+
* See: https://hl7.org/fhirpath/#decimal-conversion-functions
|
|
490
|
+
*
|
|
491
|
+
* @param input The input collection.
|
|
492
|
+
* @returns
|
|
493
|
+
*/
|
|
494
|
+
export declare function toDecimal(input: unknown[]): number[];
|
|
495
|
+
/**
|
|
496
|
+
* If the input collection contains a single item, this function will true if:
|
|
497
|
+
* 1) the item is an Integer or Decimal
|
|
498
|
+
* 2) the item is a String and is convertible to a Decimal
|
|
499
|
+
* 3) the item is a Boolean
|
|
500
|
+
*
|
|
501
|
+
* If the item is not one of the above types, or is not convertible to a Decimal (using the regex format (\\+|-)?\d+(\.\d+)?), the result is false.
|
|
502
|
+
*
|
|
503
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
504
|
+
*
|
|
505
|
+
* If the input collection is empty, the result is empty.
|
|
506
|
+
|
|
507
|
+
* See: https://hl7.org/fhirpath/#convertstodecimal-boolean
|
|
508
|
+
*
|
|
509
|
+
* @param input The input collection.
|
|
510
|
+
* @returns
|
|
511
|
+
*/
|
|
512
|
+
export declare function convertsToDecimal(input: unknown[]): boolean[];
|
|
513
|
+
/**
|
|
514
|
+
* If the input collection contains a single item, this function will return a single quantity if:
|
|
515
|
+
* 1) the item is an Integer, or Decimal, where the resulting quantity will have the default unit ('1')
|
|
516
|
+
* 2) the item is a Quantity
|
|
517
|
+
* 3) the item is a String and is convertible to a Quantity
|
|
518
|
+
* 4) the item is a Boolean, where true results in the quantity 1.0 '1', and false results in the quantity 0.0 '1'
|
|
519
|
+
*
|
|
520
|
+
* If the item is not one of the above types, the result is empty.
|
|
521
|
+
*
|
|
522
|
+
* See: https://hl7.org/fhirpath/#quantity-conversion-functions
|
|
523
|
+
*
|
|
524
|
+
* @param input The input collection.
|
|
525
|
+
* @returns
|
|
526
|
+
*/
|
|
527
|
+
export declare function toQuantity(input: unknown[]): Quantity[];
|
|
528
|
+
/**
|
|
529
|
+
* If the input collection contains a single item, this function will return true if:
|
|
530
|
+
* 1) the item is an Integer, Decimal, or Quantity
|
|
531
|
+
* 2) the item is a String that is convertible to a Quantity
|
|
532
|
+
* 3) the item is a Boolean
|
|
533
|
+
*
|
|
534
|
+
* If the item is not one of the above types, or is not convertible to a Quantity using the following regex format:
|
|
535
|
+
*
|
|
536
|
+
* (?'value'(\+|-)?\d+(\.\d+)?)\s*('(?'unit'[^']+)'|(?'time'[a-zA-Z]+))?
|
|
537
|
+
*
|
|
538
|
+
* then the result is false.
|
|
539
|
+
*
|
|
540
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
541
|
+
*
|
|
542
|
+
* If the input collection is empty, the result is empty.
|
|
543
|
+
*
|
|
544
|
+
* If the unit argument is provided, it must be the string representation of a UCUM code (or a FHIRPath calendar duration keyword), and is used to determine whether the input quantity can be converted to the given unit, according to the unit conversion rules specified by UCUM. If the input quantity can be converted, the result is true, otherwise, the result is false.
|
|
545
|
+
*
|
|
546
|
+
* See: https://hl7.org/fhirpath/#convertstoquantityunit-string-boolean
|
|
547
|
+
*
|
|
548
|
+
* @param input The input collection.
|
|
549
|
+
* @returns
|
|
550
|
+
*/
|
|
551
|
+
export declare function convertsToQuantity(input: unknown[]): boolean[];
|
|
552
|
+
/**
|
|
553
|
+
* Returns the string representation of the input.
|
|
554
|
+
*
|
|
555
|
+
* If the input collection contains a single item, this function will return a single String if:
|
|
556
|
+
*
|
|
557
|
+
* 1) the item in the input collection is a String
|
|
558
|
+
* 2) the item in the input collection is an Integer, Decimal, Date, Time, DateTime, or Quantity the output will contain its String representation
|
|
559
|
+
* 3) the item is a Boolean, where true results in 'true' and false in 'false'.
|
|
560
|
+
*
|
|
561
|
+
* If the item is not one of the above types, the result is false.
|
|
562
|
+
*
|
|
563
|
+
* See: https://hl7.org/fhirpath/#tostring-string
|
|
564
|
+
*
|
|
565
|
+
* @param input The input collection.
|
|
566
|
+
* @returns The string representation of the input.
|
|
567
|
+
*/
|
|
568
|
+
export declare function toString(input: unknown[]): string[];
|
|
569
|
+
/**
|
|
570
|
+
* Returns true if the input can be converted to string.
|
|
571
|
+
*
|
|
572
|
+
* If the input collection contains a single item, this function will return true if:
|
|
573
|
+
* 1) the item is a String
|
|
574
|
+
* 2) the item is an Integer, Decimal, Date, Time, or DateTime
|
|
575
|
+
* 3) the item is a Boolean
|
|
576
|
+
* 4) the item is a Quantity
|
|
577
|
+
*
|
|
578
|
+
* If the item is not one of the above types, the result is false.
|
|
579
|
+
*
|
|
580
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
581
|
+
*
|
|
582
|
+
* If the input collection is empty, the result is empty.
|
|
583
|
+
*
|
|
584
|
+
* See: https://hl7.org/fhirpath/#tostring-string
|
|
585
|
+
*
|
|
586
|
+
* @param input The input collection.
|
|
587
|
+
* @returns
|
|
588
|
+
*/
|
|
589
|
+
export declare function convertsToString(input: unknown[]): boolean[];
|
|
590
|
+
/**
|
|
591
|
+
* If the input collection contains a single item, this function will return a single time if:
|
|
592
|
+
* 1) the item is a Time
|
|
593
|
+
* 2) the item is a String and is convertible to a Time
|
|
594
|
+
*
|
|
595
|
+
* If the item is not one of the above types, the result is empty.
|
|
596
|
+
*
|
|
597
|
+
* If the item is a String, but the string is not convertible to a Time (using the format hh:mm:ss.fff(+|-)hh:mm), the result is empty.
|
|
598
|
+
*
|
|
599
|
+
* If the item contains a partial time (e.g. '10:00'), the result is a partial time.
|
|
600
|
+
*
|
|
601
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
602
|
+
*
|
|
603
|
+
* If the input collection is empty, the result is empty.
|
|
604
|
+
*
|
|
605
|
+
* See: https://hl7.org/fhirpath/#totime-time
|
|
606
|
+
*
|
|
607
|
+
* @param input
|
|
608
|
+
* @returns
|
|
609
|
+
*/
|
|
610
|
+
export declare function toTime(input: unknown[]): string[];
|
|
611
|
+
/**
|
|
612
|
+
* If the input collection contains a single item, this function will return true if:
|
|
613
|
+
* 1) the item is a Time
|
|
614
|
+
* 2) the item is a String and is convertible to a Time
|
|
615
|
+
*
|
|
616
|
+
* If the item is not one of the above types, or is not convertible to a Time (using the format hh:mm:ss.fff(+|-)hh:mm), the result is false.
|
|
617
|
+
*
|
|
618
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
619
|
+
*
|
|
620
|
+
* If the input collection is empty, the result is empty.
|
|
621
|
+
*
|
|
622
|
+
* See: https://hl7.org/fhirpath/#convertstotime-boolean
|
|
623
|
+
*
|
|
624
|
+
* @param input
|
|
625
|
+
* @returns
|
|
626
|
+
*/
|
|
627
|
+
export declare function convertsToTime(input: unknown[]): boolean[];
|
|
628
|
+
/**
|
|
629
|
+
* Returns the 0-based index of the first position substring is found in the input string, or -1 if it is not found.
|
|
630
|
+
*
|
|
631
|
+
* If substring is an empty string (''), the function returns 0.
|
|
632
|
+
*
|
|
633
|
+
* If the input or substring is empty ({ }), the result is empty ({ }).
|
|
634
|
+
*
|
|
635
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
636
|
+
*
|
|
637
|
+
* See: https://hl7.org/fhirpath/#indexofsubstring-string-integer
|
|
638
|
+
*
|
|
639
|
+
* @param input The input collection.
|
|
640
|
+
* @returns The index of the substring.
|
|
641
|
+
*/
|
|
642
|
+
export declare function indexOf(input: unknown[], substringAtom: Atom): number[];
|
|
643
|
+
/**
|
|
644
|
+
* Returns the part of the string starting at position start (zero-based). If length is given, will return at most length number of characters from the input string.
|
|
645
|
+
*
|
|
646
|
+
* If start lies outside the length of the string, the function returns empty ({ }). If there are less remaining characters in the string than indicated by length, the function returns just the remaining characters.
|
|
647
|
+
*
|
|
648
|
+
* If the input or start is empty, the result is empty.
|
|
649
|
+
*
|
|
650
|
+
* If an empty length is provided, the behavior is the same as if length had not been provided.
|
|
651
|
+
*
|
|
652
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
653
|
+
*
|
|
654
|
+
* @param input The input collection.
|
|
655
|
+
* @returns The index of the substring.
|
|
656
|
+
*/
|
|
657
|
+
export declare function substring(input: unknown[], startAtom: Atom, lengthAtom?: Atom): string[];
|
|
658
|
+
/**
|
|
659
|
+
*
|
|
660
|
+
* @param input The input collection.
|
|
661
|
+
* @returns The index of the substring.
|
|
662
|
+
*/
|
|
663
|
+
export declare function startsWith(input: unknown[], prefixAtom: Atom): boolean[];
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* @param input The input collection.
|
|
667
|
+
* @returns The index of the substring.
|
|
668
|
+
*/
|
|
669
|
+
export declare function endsWith(input: unknown[], suffixAtom: Atom): boolean[];
|
|
670
|
+
/**
|
|
671
|
+
*
|
|
672
|
+
* @param input The input collection.
|
|
673
|
+
* @returns The index of the substring.
|
|
674
|
+
*/
|
|
675
|
+
export declare function contains(input: unknown[], substringAtom: Atom): boolean[];
|
|
676
|
+
/**
|
|
677
|
+
*
|
|
678
|
+
* @param input The input collection.
|
|
679
|
+
* @returns The index of the substring.
|
|
680
|
+
*/
|
|
681
|
+
export declare function upper(input: unknown[]): string[];
|
|
682
|
+
/**
|
|
683
|
+
*
|
|
684
|
+
* @param input The input collection.
|
|
685
|
+
* @returns The index of the substring.
|
|
686
|
+
*/
|
|
687
|
+
export declare function lower(input: unknown[]): string[];
|
|
688
|
+
/**
|
|
689
|
+
*
|
|
690
|
+
* @param input The input collection.
|
|
691
|
+
* @returns The index of the substring.
|
|
692
|
+
*/
|
|
693
|
+
export declare function replace(input: unknown[], patternAtom: Atom, substitionAtom: Atom): string[];
|
|
694
|
+
/**
|
|
695
|
+
*
|
|
696
|
+
* @param input The input collection.
|
|
697
|
+
* @returns The index of the substring.
|
|
698
|
+
*/
|
|
699
|
+
export declare function matches(input: unknown[], regexAtom: Atom): boolean[];
|
|
700
|
+
/**
|
|
701
|
+
*
|
|
702
|
+
* @param input The input collection.
|
|
703
|
+
* @returns The index of the substring.
|
|
704
|
+
*/
|
|
705
|
+
export declare function replaceMatches(input: unknown[], regexAtom: Atom, substitionAtom: Atom): string[];
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* @param input The input collection.
|
|
709
|
+
* @returns The index of the substring.
|
|
710
|
+
*/
|
|
711
|
+
export declare function length(input: unknown[]): number[];
|
|
712
|
+
/**
|
|
713
|
+
* Returns the list of characters in the input string. If the input collection is empty ({ }), the result is empty.
|
|
714
|
+
*
|
|
715
|
+
* See: https://hl7.org/fhirpath/#tochars-collection
|
|
716
|
+
*
|
|
717
|
+
* @param input The input collection.
|
|
718
|
+
*/
|
|
719
|
+
export declare function toChars(input: unknown[]): string[][];
|
|
720
|
+
/**
|
|
721
|
+
* Returns the absolute value of the input. When taking the absolute value of a quantity, the unit is unchanged.
|
|
722
|
+
*
|
|
723
|
+
* If the input collection is empty, the result is empty.
|
|
724
|
+
*
|
|
725
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
726
|
+
*
|
|
727
|
+
* See: https://hl7.org/fhirpath/#abs-integer-decimal-quantity
|
|
728
|
+
*
|
|
729
|
+
* @param input The input collection.
|
|
730
|
+
* @returns A collection containing the result.
|
|
731
|
+
*/
|
|
732
|
+
export declare function abs(input: unknown[]): Quantity[] | number[];
|
|
733
|
+
/**
|
|
734
|
+
* Returns the first integer greater than or equal to the input.
|
|
735
|
+
*
|
|
736
|
+
* If the input collection is empty, the result is empty.
|
|
737
|
+
*
|
|
738
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
739
|
+
*
|
|
740
|
+
* See: https://hl7.org/fhirpath/#ceiling-integer
|
|
741
|
+
*
|
|
742
|
+
* @param input The input collection.
|
|
743
|
+
* @returns A collection containing the result.
|
|
744
|
+
*/
|
|
745
|
+
export declare function ceiling(input: unknown[]): Quantity[] | number[];
|
|
746
|
+
/**
|
|
747
|
+
* Returns e raised to the power of the input.
|
|
748
|
+
*
|
|
749
|
+
* If the input collection contains an Integer, it will be implicitly converted to a Decimal and the result will be a Decimal.
|
|
750
|
+
*
|
|
751
|
+
* If the input collection is empty, the result is empty.
|
|
752
|
+
*
|
|
753
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
754
|
+
*
|
|
755
|
+
* See: https://hl7.org/fhirpath/#exp-decimal
|
|
756
|
+
*
|
|
757
|
+
* @param input The input collection.
|
|
758
|
+
* @returns A collection containing the result.
|
|
759
|
+
*/
|
|
760
|
+
export declare function exp(input: unknown[]): Quantity[] | number[];
|
|
761
|
+
/**
|
|
762
|
+
* Returns the first integer less than or equal to the input.
|
|
763
|
+
*
|
|
764
|
+
* If the input collection is empty, the result is empty.
|
|
765
|
+
*
|
|
766
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
767
|
+
*
|
|
768
|
+
* See: https://hl7.org/fhirpath/#floor-integer
|
|
769
|
+
*
|
|
770
|
+
* @param input The input collection.
|
|
771
|
+
* @returns A collection containing the result.
|
|
772
|
+
*/
|
|
773
|
+
export declare function floor(input: unknown[]): Quantity[] | number[];
|
|
774
|
+
/**
|
|
775
|
+
* Returns the natural logarithm of the input (i.e. the logarithm base e).
|
|
776
|
+
*
|
|
777
|
+
* When used with an Integer, it will be implicitly converted to a Decimal.
|
|
778
|
+
*
|
|
779
|
+
* If the input collection is empty, the result is empty.
|
|
780
|
+
*
|
|
781
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
782
|
+
*
|
|
783
|
+
* See: https://hl7.org/fhirpath/#ln-decimal
|
|
784
|
+
*
|
|
785
|
+
* @param input The input collection.
|
|
786
|
+
* @returns A collection containing the result.
|
|
787
|
+
*/
|
|
788
|
+
export declare function ln(input: unknown[]): Quantity[] | number[];
|
|
789
|
+
/**
|
|
790
|
+
* Returns the logarithm base base of the input number.
|
|
791
|
+
*
|
|
792
|
+
* When used with Integers, the arguments will be implicitly converted to Decimal.
|
|
793
|
+
*
|
|
794
|
+
* If base is empty, the result is empty.
|
|
795
|
+
*
|
|
796
|
+
* If the input collection is empty, the result is empty.
|
|
797
|
+
*
|
|
798
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
799
|
+
*
|
|
800
|
+
* See: https://hl7.org/fhirpath/#logbase-decimal-decimal
|
|
801
|
+
*
|
|
802
|
+
* @param input The input collection.
|
|
803
|
+
* @returns A collection containing the result.
|
|
804
|
+
*/
|
|
805
|
+
export declare function log(input: unknown[], baseAtom: Atom): Quantity[] | number[];
|
|
806
|
+
/**
|
|
807
|
+
* Raises a number to the exponent power. If this function is used with Integers, the result is an Integer. If the function is used with Decimals, the result is a Decimal. If the function is used with a mixture of Integer and Decimal, the Integer is implicitly converted to a Decimal and the result is a Decimal.
|
|
808
|
+
*
|
|
809
|
+
* If the power cannot be represented (such as the -1 raised to the 0.5), the result is empty.
|
|
810
|
+
*
|
|
811
|
+
* If the input is empty, or exponent is empty, the result is empty.
|
|
812
|
+
*
|
|
813
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
814
|
+
*
|
|
815
|
+
* See: https://hl7.org/fhirpath/#powerexponent-integer-decimal-integer-decimal
|
|
816
|
+
*
|
|
817
|
+
* @param input The input collection.
|
|
818
|
+
* @returns A collection containing the result.
|
|
819
|
+
*/
|
|
820
|
+
export declare function power(input: unknown[], expAtom: Atom): Quantity[] | number[];
|
|
821
|
+
/**
|
|
822
|
+
* Rounds the decimal to the nearest whole number using a traditional round (i.e. 0.5 or higher will round to 1). If specified, the precision argument determines the decimal place at which the rounding will occur. If not specified, the rounding will default to 0 decimal places.
|
|
823
|
+
*
|
|
824
|
+
* If specified, the number of digits of precision must be >= 0 or the evaluation will end and signal an error to the calling environment.
|
|
825
|
+
*
|
|
826
|
+
* If the input collection contains a single item of type Integer, it will be implicitly converted to a Decimal.
|
|
827
|
+
*
|
|
828
|
+
* If the input collection is empty, the result is empty.
|
|
829
|
+
*
|
|
830
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
831
|
+
*
|
|
832
|
+
* See: https://hl7.org/fhirpath/#roundprecision-integer-decimal
|
|
833
|
+
*
|
|
834
|
+
* @param input The input collection.
|
|
835
|
+
* @returns A collection containing the result.
|
|
836
|
+
*/
|
|
837
|
+
export declare function round(input: unknown[]): Quantity[] | number[];
|
|
838
|
+
/**
|
|
839
|
+
* Returns the square root of the input number as a Decimal.
|
|
840
|
+
*
|
|
841
|
+
* If the square root cannot be represented (such as the square root of -1), the result is empty.
|
|
842
|
+
*
|
|
843
|
+
* If the input collection is empty, the result is empty.
|
|
844
|
+
*
|
|
845
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
846
|
+
*
|
|
847
|
+
* Note that this function is equivalent to raising a number of the power of 0.5 using the power() function.
|
|
848
|
+
*
|
|
849
|
+
* See: https://hl7.org/fhirpath/#sqrt-decimal
|
|
850
|
+
*
|
|
851
|
+
* @param input The input collection.
|
|
852
|
+
* @returns A collection containing the result.
|
|
853
|
+
*/
|
|
854
|
+
export declare function sqrt(input: unknown[]): Quantity[] | number[];
|
|
855
|
+
/**
|
|
856
|
+
* Returns the integer portion of the input.
|
|
857
|
+
*
|
|
858
|
+
* If the input collection is empty, the result is empty.
|
|
859
|
+
*
|
|
860
|
+
* If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
|
|
861
|
+
*
|
|
862
|
+
* See: https://hl7.org/fhirpath/#truncate-integer
|
|
863
|
+
*
|
|
864
|
+
* @param input The input collection.
|
|
865
|
+
* @returns A collection containing the result.
|
|
866
|
+
*/
|
|
867
|
+
export declare function truncate(input: unknown[]): Quantity[] | number[];
|
|
868
|
+
export declare const children: () => [];
|
|
869
|
+
export declare const descendants: () => [];
|
|
870
|
+
/**
|
|
871
|
+
* Adds a String representation of the input collection to the diagnostic log,
|
|
872
|
+
* using the name argument as the name in the log. This log should be made available
|
|
873
|
+
* to the user in some appropriate fashion. Does not change the input, so returns
|
|
874
|
+
* the input collection as output.
|
|
875
|
+
*
|
|
876
|
+
* If the projection argument is used, the trace would log the result of evaluating
|
|
877
|
+
* the project expression on the input, but still return the input to the trace
|
|
878
|
+
* function unchanged.
|
|
879
|
+
*
|
|
880
|
+
* See: https://hl7.org/fhirpath/#tracename-string-projection-expression-collection
|
|
881
|
+
*
|
|
882
|
+
* @param input The input collection.
|
|
883
|
+
* @param nameAtom The log name.
|
|
884
|
+
*/
|
|
885
|
+
export declare function trace(input: unknown[], nameAtom: Atom): unknown[];
|
|
886
|
+
/**
|
|
887
|
+
* Returns the current date and time, including timezone offset.
|
|
888
|
+
*
|
|
889
|
+
* See: https://hl7.org/fhirpath/#now-datetime
|
|
890
|
+
*/
|
|
891
|
+
export declare function now(): string[];
|
|
892
|
+
/**
|
|
893
|
+
* Returns the current time.
|
|
894
|
+
*
|
|
895
|
+
* See: https://hl7.org/fhirpath/#timeofday-time
|
|
896
|
+
*/
|
|
897
|
+
export declare function timeOfDay(): string[];
|
|
898
|
+
/**
|
|
899
|
+
* Returns the current date.
|
|
900
|
+
*
|
|
901
|
+
* See: https://hl7.org/fhirpath/#today-date
|
|
902
|
+
*/
|
|
903
|
+
export declare function today(): string[];
|
|
904
|
+
/**
|
|
905
|
+
* Calculates the difference between two dates or date/times.
|
|
906
|
+
*
|
|
907
|
+
* This is not part of the official FHIRPath spec.
|
|
908
|
+
*
|
|
909
|
+
* IBM FHIR issue: https://github.com/IBM/FHIR/issues/1014
|
|
910
|
+
* IBM FHIR PR: https://github.com/IBM/FHIR/pull/1023
|
|
911
|
+
*/
|
|
912
|
+
export declare function between(context: unknown, startAtom: Atom, endAtom: Atom, unitsAtom: Atom): Quantity[];
|
|
913
|
+
/**
|
|
914
|
+
* The is() function is supported for backwards compatibility with previous
|
|
915
|
+
* implementations of FHIRPath. Just as with the is keyword, the type argument
|
|
916
|
+
* is an identifier that must resolve to the name of a type in a model.
|
|
917
|
+
*
|
|
918
|
+
* For implementations with compile-time typing, this requires special-case
|
|
919
|
+
* handling when processing the argument to treat it as a type specifier rather
|
|
920
|
+
* than an identifier expression:
|
|
921
|
+
*
|
|
922
|
+
* @param input
|
|
923
|
+
* @param typeAtom
|
|
924
|
+
* @returns
|
|
925
|
+
*/
|
|
926
|
+
export declare function is(input: unknown[], typeAtom: Atom): boolean[];
|
|
927
|
+
/**
|
|
928
|
+
* 6.5.3. not() : Boolean
|
|
929
|
+
*
|
|
930
|
+
* Returns true if the input collection evaluates to false, and false if it evaluates to true. Otherwise, the result is empty ({ }):
|
|
931
|
+
*
|
|
932
|
+
* @param input
|
|
933
|
+
* @returns
|
|
934
|
+
*/
|
|
935
|
+
export declare function not(input: unknown[]): boolean[];
|
|
936
|
+
/**
|
|
937
|
+
* For each item in the collection, if it is a string that is a uri (or canonical or url), locate the target of the reference, and add it to the resulting collection. If the item does not resolve to a resource, the item is ignored and nothing is added to the output collection.
|
|
938
|
+
* The items in the collection may also represent a Reference, in which case the Reference.reference is resolved.
|
|
939
|
+
* @param input The input collection.
|
|
940
|
+
* @returns
|
|
941
|
+
*/
|
|
942
|
+
export declare function resolve(input: unknown[]): unknown[];
|
|
943
|
+
/**
|
|
944
|
+
* The as operator can be used to treat a value as a specific type.
|
|
945
|
+
* @param context The context value.
|
|
946
|
+
* @returns The value as the specific type.
|
|
947
|
+
*/
|
|
948
|
+
export declare function as(context: unknown): unknown;
|
|
949
|
+
/**
|
|
950
|
+
* Returns the type of the input.
|
|
951
|
+
*
|
|
952
|
+
* 12.2. Model Information
|
|
953
|
+
*
|
|
954
|
+
* The model information returned by the reflection function type() is specified as an
|
|
955
|
+
* XML Schema document (xsd) and included in this specification at the following link:
|
|
956
|
+
* https://hl7.org/fhirpath/modelinfo.xsd
|
|
957
|
+
*
|
|
958
|
+
* See: https://hl7.org/fhirpath/#model-information
|
|
959
|
+
*
|
|
960
|
+
* @param input The input collection.
|
|
961
|
+
* @returns
|
|
962
|
+
*/
|
|
963
|
+
export declare function type(input: unknown[]): unknown[];
|
|
964
|
+
export declare function conformsTo(input: unknown[], systemAtom: Atom): boolean[];
|