Given a path, converts it to absolute url based on the baseUrl
. If baseUrl
is not provided, the result would be a rooted path (one that starts with /
).
The path to convert
The base URL
Groups the observations by code. Returns a map that will look like:
const map = client.byCodes(observations, "code");
// map = {
// "55284-4": [ observation1, observation2 ],
// "6082-2": [ observation3 ]
// }
Array of observations
The name of a CodeableConcept property to group by
First groups the observations by code using byCode
. Then returns a function
that accepts codes as arguments and will return a flat array of observations
having that codes. Example:
const filter = client.byCodes(observations, "category");
filter("laboratory") // => [ observation1, observation2 ]
filter("vital-signs") // => [ observation3 ]
filter("laboratory", "vital-signs") // => [ observation1, observation2, observation3 ]
Array of observations
The name of a CodeableConcept property to group by
First groups the observations by code using byCode
. Then returns a function
that accepts codes as arguments and will return a flat array of observations
having that codes. Example:
const filter = client.byCodes(observations, "category");
filter("laboratory") // => [ observation1, observation2 ]
filter("vital-signs") // => [ observation3 ]
filter("laboratory", "vital-signs") // => [ observation1, observation2, observation3 ]
Used in fetch Promise chains to reject if the "ok" property is not true
Fetches the conformance statement from the given base URL. Note that the result is cached in memory (until the page is reloaded in the browser) because it might have to be re-used by the client
The base URL of the FHIR server
Given a token response, computes and returns the expiresAt timestamp. Note that this should only be used immediately after an access token is received, otherwise the computed timestamp will be incorrect.
Makes a request using fetch
and stores the result in internal memory cache.
The cache is cleared when the page is unloaded.
The URL to request
Request options
If true, reload from source and update the cache, even if it has already been cached.
Walks through an object (or array) and returns the value found at the provided path. This function is very simple so it intentionally does not support any argument polymorphism, meaning that the path can only be a dot-separated string. If the path is invalid returns undefined.
The object (or Array) to walk through
The path (eg. "a.b.4.c")
Whatever is found in the path or undefined
Given a conformance statement and a resource type, returns the name of the URL parameter that can be used to scope the resource type by patient ID.
Resolves a reference to target window. It may also open new window or tab if
the target = "popup"
or target = "_blank"
.
Only used when target = "popup"
Only used when target = "popup"
Add a supplied number of seconds to the supplied Date, returning an integer number of seconds since the epoch
How far ahead, in seconds (defaults to 120 seconds)
Initial time (defaults to current time)
This is our built-in request function. It does a few things by default (unless told otherwise):
.blob()
Used in fetch Promise chains to return the JSON version of the response.
Note that resp.json()
will throw on empty body so we use resp.text()
instead.
Like getPath, but if the node is found, its value is set to @value
The object (or Array) to walk through
The path (eg. "a.b.4.c")
The value to set
If true, create missing intermediate objects or arrays
The modified object
Decodes a JWT token and returns it's body.
The token to read
An Adapter
or any other object that has an atob
method
If the argument is an array returns it as is. Otherwise puts it in an array
([arg]
) and returns the result
The element to test and possibly convert to array
Generates random strings. By default this returns random 8 characters long alphanumeric strings.
The length of the output string. Defaults to 8.
A string containing all the possible characters. Defaults to all the upper and lower-case letters plus digits.
Generated using TypeDoc
A namespace with functions for converting between different measurement units