Skip to main content

core

Home > @medplum/core

core package

Classes

Class

Description

AndAtom

6.5.1. and Returns true if both operands evaluate to true, false if either operand evaluates to false, and the empty collection otherwise.

ArithemticOperatorAtom

AsAtom

ClientStorage

The ClientStorage class is a utility class for storing strings and objects.

When using MedplumClient in the browser, it will be backed by browser localStorage.

When Using MedplumClient in the server, it will be backed by the MemoryStorage class. For example, the Medplum CLI uses FileSystemStorage.

ConcatAtom

ContainsAtom

DotAtom

EmptySetAtom

EqualsAtom

EquivalentAtom

EventTarget_2

FhircastConnection

A class representing a FHIRcast connection.

FhircastConnection extends EventTarget and emits 3 lifecycle events: 1. connect - An event to signal when a WebSocket connection has been opened. Fired as soon as a WebSocket emits open. 2. message - Contains a payload field containing a FHIRcast message payload exactly as it comes in over WebSockets. 3. disconnect - An event to signal when a WebSocket connection has been closed. Fired as soon as a WebSocket emits close.

To close the connection, call connection.disconnect() and listen to the disconnect event to know when the connection has been disconnected.

FhirFilterComparison

The FhirFilterComparison class represents a comparison expression.

FhirFilterConnective

The FhirFilterConnective class represents a connective expression. It contains a list of child expressions.

FhirFilterNegation

The FhirFilterNegation class represents a negation expression. It contains a single child expression.

FhirPathAtom

FunctionAtom

Hl7Context

The Hl7Context class represents the parsing context for an HL7 message.

Hl7Field

The Hl7Field class represents one HL7 field. A field is a collection of components.

Hl7Message

The Hl7Message class represents one HL7 message. A message is a collection of segments.

Hl7Segment

The Hl7Segment class represents one HL7 segment. A segment is a collection of fields. The name field is the first field.

ImpliesAtom

6.5.5. implies Returns true if left is true and right is true, true left is false and right true, false or empty true left is empty

InAtom

IndexerAtom

IsAtom

LiteralAtom

Logger

LRUCache

LRU cache (least recently used) Source: https://stackoverflow.com/a/46432113

MedplumClient

The MedplumClient class provides a client for the Medplum FHIR server.

The client can be used in the browser, in a Node.js application, or in a Medplum Bot.

The client provides helpful methods for common operations such as: 1. Authenticating 2. Creating resources 3. Reading resources 4. Updating resources 5. Deleting resources 6. Searching 7. Making GraphQL queries

The client can also be used to integrate with other FHIR servers. For an example, see the Epic Connection Demo Bot [here](https://github.com/medplum/medplum/tree/main/examples/medplum-demo-bots/src/epic).

MedplumKeyValueClient

MemoryStorage

The MemoryStorage class is a minimal in-memory implementation of the Storage interface.

MockAsyncClientStorage

The MockAsyncClientStorage class is a mock implementation of the ClientStorage class. This can be used for testing async initialization of the MedplumClient.

NotEqualsAtom

NotEquivalentAtom

OperationOutcomeError

OrAtom

6.5.2. or Returns false if both operands evaluate to false, true if either operand evaluates to true, and empty ({ }) otherwise:

Parser

ParserBuilder

ReadablePromise

The ReadablePromise class wraps a request promise suitable for React Suspense. See: https://blog.logrocket.com/react-suspense-data-fetching/\#wrappromise-js See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js

RobustWebSocket

SubscriptionEmitter

An EventTarget that emits events when new subscription notifications come in over WebSockets.

-----

### Events emitted:

  • connect - A new subscription is connected to the SubscriptionManager and message events for this subscription can be expected. - disconnect - The specified subscription is no longer being monitored by the SubscriptionManager. - error - An error has occurred. - message - A message containing a notification Bundle has been received. - open - The WebSocket has been opened. - close - The WebSocket has been closed. - heartbeat - A heartbeat message has been received.

SubscriptionManager

SymbolAtom

Tokenizer

TypedEventTarget

UnaryOperatorAtom

UnionAtom

XorAtom

6.5.4. xor 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.

Abstract Classes

Abstract Class

Description

BooleanInfixOperatorAtom

InfixOperatorAtom

PrefixOperatorAtom

Enumerations

Enumeration

Description

AccessPolicyInteraction

Interactions with a resource that can be controlled via an access policy.

Codes taken from http://hl7.org/fhir/codesystem-restful-interaction.html

LogLevel

Logging level, with greater values representing more detailed logs emitted.

The zero value means no server logs will be emitted.

OAuthClientAssertionType

OAuth 2.0 Client Authentication Methods See: https://datatracker.ietf.org/doc/html/rfc7523\#section-2.2

OAuthGrantType

OAuth 2.0 Grant Type Identifiers Standard identifiers: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-07\#name-grant-types JWT bearer extension: https://datatracker.ietf.org/doc/html/rfc7523 Token exchange extension: https://datatracker.ietf.org/doc/html/rfc8693

OAuthTokenAuthMethod

OAuth 2.0 Client Authentication Methods See: https://openid.net/specs/openid-connect-core-1\_0.html\#ClientAuthentication

OAuthTokenType

OAuth 2.0 Token Type Identifiers See: https://datatracker.ietf.org/doc/html/rfc8693\#name-token-type-identifiers

Operator

Search operators. These operators represent "modifiers" and "prefixes" in FHIR search. See: https://www.hl7.org/fhir/search.html

SearchParameterType

Functions

Function

Description

accepted(location)

addProfileToResource(resource, profileUrl)

Adds the supplied profileUrl to the resource.meta.profile if it is not already specified

append(array, value)

applyDefaultValuesToElement(existingValue, elements, key)

Adds default values to existingValue for the given key and its children. If key is undefined, default values are added to all elements in elements. Default values consist of all fixed and pattern values defined in the relevant elements.

applyDefaultValuesToElementWithVisitor(existingValue, path, element, elements, schema)

applyDefaultValuesToResource(resource, schema)

Adds default values to resource based on the supplied schema. Default values includes all required fixed and pattern values specified on elements in the schema. If an element has a fixed/pattern value but is optional, i.e. element.min === 0, the default value is not added.

applyFixedOrPatternValue(inputValue, key, element, elements)

arrayBufferToBase64(arrayBuffer)

Converts an ArrayBuffer to a base-64 encoded string.

arrayBufferToHex(arrayBuffer)

Converts an ArrayBuffer to hex string. See: https://stackoverflow.com/a/55200387

arrayify(value)

assertContextVersionOptional(event)

assertOk(outcome, resource)

Asserts that the operation completed successfully and that the resource is defined.

badRequest(details, expression)

booleanToTypedValue(value)

Returns a single element array with a typed boolean value.

buildElementsContext({ parentContext, path, elements, profileUrl, debugMode, accessPolicyResource, })

buildTypeName(components)

calculateAge(birthDateStr, endDateStr)

Calculates the age in years from the birth date.

calculateAgeString(birthDateStr, endDateStr)

Calculates the age string for display using the age appropriate units. If the age is greater than or equal to 2 years, then the age is displayed in years. If the age is greater than or equal to 1 month, then the age is displayed in months. Otherwise, the age is displayed in days.

canReadResourceType(accessPolicy, resourceType)

Determines if the current user can read the specified resource type.

canWriteResource(accessPolicy, resource)

Determines if the current user can write the specified resource. This is a more in-depth check after building the candidate result of a write operation.

canWriteResourceType(accessPolicy, resourceType)

Determines if the current user can write the specified resource type. This is a preliminary check before evaluating a write operation in depth. If a user cannot write a resource type at all, then don't bother looking up previous versions.

capitalize(word)

checkForNull(value, path, issues)

Recursively checks for null values in an object.

Note that "null" is a special value in JSON that is not allowed in FHIR.

compressElement(element)

concatUrls(baseUrl, path)

Concatenates the given base URL and URL.

If the URL is absolute, it is returned as-is.

conceptMapTranslate(map, params)

conflict(details)

convertContainedResourcesToBundle(resource)

Converts a resource with contained resources to a transaction bundle. This function is useful when creating a resource that contains other resources. Handles local references and topological sorting.

convertToTransactionBundle(bundle)

Takes a bundle and creates a Transaction Type bundle

crawlResource(resource, visitor, schema, initialPath)

crawlResource(resource, visitor, options)

createConstraintIssue(expression, constraint)

createFhircastMessagePayload(topic, event, context, versionId)

Creates a serializable JSON payload for the FHIRcast protocol

createFhircastMessagePayload(topic, event, context, versionId)

createOperationOutcomeIssue(severity, code, message, path, data)

createProcessingIssue(expression, message, err, data)

createReference(resource)

Creates a reference resource.

createStructureIssue(expression, details)

decodeBase64(data)

Decodes a base64 string. Handles both browser and Node environments.

deepClone(input)

Creates a deep clone of the input value.

Limitations: - Only supports JSON primitives and arrays. - Does not support Functions, lambdas, etc. - Does not support circular references.

See: https://web.dev/structured-clone/ See: https://stackoverflow.com/questions/40488190/how-is-structured-clone-algorithm-different-from-deep-copy

deepEquals(object1, object2, path)

Resource equality. Ignores meta.versionId and meta.lastUpdated.

deepIncludes(value, pattern)

Checks if value includes all fields and values of pattern. It doesn't matter if value has extra fields, values, etc.

encodeBase64(data)

Encodes a base64 string. Handles both browser and Node environments.

encryptSHA256(str)

Encrypts a string with SHA256 encryption.

ensureNoLeadingSlash(url)

Ensures the given URL has no leading slash.

ensureTrailingSlash(url)

Ensures the given URL has a trailing slash.

evalFhirPath(expression, input)

Evaluates a FHIRPath expression against a resource or other object.

evalFhirPathTyped(expression, input, variables)

Evaluates a FHIRPath expression against a resource or other object.

fhirPathArrayEquals(x, y)

Determines if two arrays are equal according to FHIRPath equality rules.

fhirPathArrayEquivalent(x, y)

Determines if two arrays are equivalent according to FHIRPath equality rules.

fhirPathEquals(x, y)

Determines if two values are equal according to FHIRPath equality rules.

fhirPathEquivalent(x, y)

Determines if two values are equivalent according to FHIRPath equality rules.

fhirPathIs(typedValue, desiredType)

Determines if the typed value is the desired type.

fhirPathNot(input)

Returns a negated FHIRPath boolean expression.

findObservationInterval(definition, patient, value, category)

Tries to find an observation interval for the given patient and value.

findObservationReferenceRange(definition, patient, names)

Tries to find an observation reference range for the given patient and condition names.

findResourceByCode(resources, code, system)

Finds the first resource in the input array that matches the specified code and system.

formatAddress(address, options)

Formats a FHIR Address as a string.

formatCodeableConcept(codeableConcept)

Formats a CodeableConcept element as a string.

formatCoding(coding)

Formats a Coding element as a string.

formatDate(date, locales, options)

Formats a FHIR date string as a human readable string. Handles missing values and invalid dates.

formatDateTime(dateTime, locales, options)

Formats a FHIR dateTime string as a human readable string. Handles missing values and invalid dates.

formatFamilyName(name)

Formats the family name portion of a FHIR HumanName element.

formatGivenName(name)

Formats the given name portion of a FHIR HumanName element.

formatHl7DateTime(isoDate)

Formats an ISO date/time string into an HL7 date/time string.

formatHumanName(name, options)

Formats a FHIR HumanName as a string.

formatMoney(money)

formatObservationValue(obs)

Formats a FHIR Observation resource value as a string.

formatPeriod(period, locales, options)

Formats a FHIR Period as a human readable string.

formatQuantity(quantity, precision)

Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators

formatRange(range, precision, exclusive)

Returns a human-readable string for a FHIR Range datatype, taking into account one-sided ranges

formatSearchQuery(definition)

Formats a search definition object into a query string. Note: The return value does not include the resource type.

formatTime(time, locales, options)

Formats a FHIR time string as a human readable string. Handles missing values and invalid dates.

formatTiming(timing)

Formats a FHIR Timing as a human readable string.

generateId()

Cross platform random UUID generator Note that this is not intended for production use, but rather for testing This should be replaced when crypto.randomUUID is fully supported See: https://stackoverflow.com/revisions/2117523/28

getAllDataTypes()

getAllQuestionnaireAnswers(response)

Returns an array of questionnaire answers as a map by link ID.

getCodeBySystem(concept, system)

Tries to find a code string for a given system within a given codeable concept.

getDataType(type, profileUrl)

getDateProperty(date)

Returns a Date property as a Date. When working with JSON objects, Dates are often serialized as ISO-8601 strings. When that happens, we need to safely convert to a proper Date object.

getDefaultValuesForNewSliceEntry(key, slice, slicing, schema)

getDisplayString(resource)

Returns a display string for the resource.

getElementDefinition(typeName, propertyName, profileUrl)

Returns an element definition by type and property name.

getElementDefinitionFromElements(elements, propertyName)

Returns an element definition from mapping of elements by property name.

getElementDefinitionTypeName(elementDefinition)

Returns the type name for an ElementDefinition.

getExpressionForResourceType(resourceType, expression)

getExpressionsForResourceType(resourceType, expression)

getExtension(resource, urls)

Returns an extension by extension URLs.

getExtensionValue(resource, urls)

Returns an extension value by extension URLs.

getIdentifier(resource, system)

Returns the resource identifier for the given system.

If multiple identifiers exist with the same system, the first one is returned.

If the system is not found, then returns undefined.

getImageSrc(resource)

Returns an image URL for the resource, if one is available.

getNestedProperty(value, key, options)

getNestedProperty(value, key, options)

getPathDifference(parentPath, path)

Returns the difference between two paths which is often suitable to use as a key in a Record<string, InternalSchemaElement>

getPathDisplayName(path)

Returns a human friendly display name for a FHIR element definition path.

getPropertyDisplayName(propertyName)

Returns a human friendly display name for a FHIR element property or slice name

getQueryString(query)

Converts the given query to a string.

getQuestionnaireAnswers(response)

Returns all questionnaire answers as a map by link ID.

getRandomString()

Returns a cryptographically secure random string.

getReferenceString(input)

Returns a reference string for a resource.

getResourceTypes()

Returns an array of all resource types. Note that this is based on globalSchema, and will only return resource types that are currently in memory.

getSearchParameter(resourceType, code)

Returns a search parameter for a resource type by search code.

getSearchParameterDetails(resourceType, searchParam)

Returns the type details of a SearchParameter.

The SearchParameter resource has a "type" parameter, but that is missing some critical information.

For example: 1) The "date" type includes "date", "datetime", and "period". 2) The "token" type includes enums and booleans. 3) Arrays/multiple values are not reflected at all.

getSearchParameters(resourceType)

Returns the search parameters for the resource type indexed by search code.

getStatus(outcome)

getTypedPropertyValue(input, path, options)

Returns the value of the property and the property type. Some property definitions support multiple types. For example, "Observation.value[x]" can be "valueString", "valueInteger", "valueQuantity", etc. According to the spec, there can only be one property for a given element definition. This function returns the value and the type.

getTypedPropertyValueWithPath(input, path, options)

getTypedPropertyValueWithSchema(typedValue, path, element)

Returns the value of the property and the property type using a type schema.

getValueSliceName(value, slices, discriminators, profileUrl)

getWebSocketUrl(baseUrl, path)

Concatenates a given base URL and path, ensuring the URL has the appropriate ws:// or wss:// protocol instead of http:// or https://.

indexSearchParameter(searchParam)

Indexes a SearchParameter resource for fast lookup. Indexes by SearchParameter.code, which is the query string parameter name.

indexSearchParameterBundle(bundle)

Indexes a bundle of SearchParameter resources for faster lookup.

indexStructureDefinitionBundle(bundle, profileUrl)

Parses and indexes structure definitions

inflateBaseSchema(base)

inflateElement(path, partial)

initFhirPathParserBuilder()

isAccepted(outcome)

isCodeableConcept(value)

Returns true if the input value is a CodeableConcept object. This is a heuristic check based on the presence of the "coding" property.

isCoding(value)

Returns true if the input value is a Coding object. This is a heuristic check based on the presence of the "code" property.

isCompletedSubscriptionRequest(subscriptionRequest)

isComplexTypeCode(code)

isContextVersionRequired(event)

isCreated(outcome)

isDataTypeLoaded(type)

isDateString(input)

Returns true if the input value is a YYYY-MM-DD date string.

isDateTimeString(input)

Returns true if the input value is a YYYY-MM-DDThh:mm:ss.sssZ date/time string.

isEmpty(v)

Returns true if the value is empty (null, undefined, empty string, or empty object).

isFhircastResourceType(resourceType)

Checks if a ResourceType can be used in a FHIRcast context.

isFhirCriteriaMet(subscription, currentResource, getPreviousResource)

isGone(outcome)

isJwt(token)

Returns true if the token is a JWT.

isLowerCase(c)

isMedplumAccessToken(accessToken)

Returns true if the access token was issued by a Medplum server.

isNotFound(outcome)

isObject(obj)

Returns true if the input is an object.

isOk(outcome)

isOperationOutcome(value)

isPeriod(input)

Determines if the input is a Period object. This is heuristic based, as we do not have strong typing at runtime.

isPopulated(arg)

Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object

isProfileLoaded(profileUrl)

isProfileResource(resource)

Returns true if the resource is a "ProfileResource".

isQuantity(input)

Determines if the input is a Quantity object. This is heuristic based, as we do not have strong typing at runtime.

isQuantityEquivalent(x, y)

isReference(value)

Typeguard to validate that an object is a FHIR resource

isResource(value)

Typeguard to validate that an object is a FHIR resource

isResourceType(resourceType)

Returns true if the given string is a valid FHIR resource type.

isResourceTypeSchema(typeSchema)

Returns true if the type schema is a non-abstract FHIR resource.

isSliceDefinitionWithTypes(slice)

isString(value)

Returns true if the input value is a string.

isStringArray(arr)

Returns true if the input array is an array of strings.

isTextObject(value)

Returns true if the input value is an object with a string text property. This is a heuristic check based on the presence of the "text" property.

isUUID(input)

Returns true if the input string is a UUID.

isValidDate(date)

Returns true if the given date object is a valid date. Dates can be invalid if created by parsing an invalid string.

isValidHostname(input)

Tests whether a given input is a valid hostname.

__NOTE: Does not validate that the input is a valid domain name, only a valid hostname.__

lazy(fn)

Memoizes the result of a parameterless function

loadDataType(sd, profileUrl)

mapByIdentifier(resourceBundle, identifierSystem)

Returns a Map of resources from a bundle, using the specified identifier system as the key.

matchDiscriminant(value, discriminator, slice, elements)

matchesAccessPolicy(accessPolicy, resource, readonlyMode)

Returns true if the resource satisfies the current access policy.

matchesRange(value, range, precision)

Returns true if the value is in the range accounting for precision.

matchesSearchRequest(resource, searchRequest)

Determines if the resource matches the search request.

normalizeCreateBinaryOptions(arg1, arg2, arg3, arg4)

normalizeCreatePdfOptions(arg1, arg2, arg3, arg4)

normalizeErrorString(error)

Normalizes an error object into a displayable error string.

normalizeOperationOutcome(error)

Normalizes an error object into an OperationOutcome.

operationOutcomeIssueToString(issue)

Returns a string represenation of the operation outcome issue.

operationOutcomeToString(outcome)

Returns a string represenation of the operation outcome.

parseCriteriaAsSearchRequest(criteria)

Parses a FHIR criteria string into a SearchRequest. FHIR criteria strings are found on resources such as Subscription.

parseFhirPath(input)

Parses a FHIRPath expression into an AST. The result can be used to evaluate the expression against a resource or other object. This method is useful if you know that you will evaluate the same expression many times against different resources.

parseFilterParameter(input)

Parses a FHIR _filter parameter expression into an AST.

parseHl7DateTime(hl7DateTime, options)

Returns a formatted string representing the date in ISO-8601 format.

HL7-Definition V2 Specifies a point in time using a 24-hour clock notation.

Format: YYYY[MM[DD[HH[MM[SS[. S[S[S[S]]]]]]]]][+/-ZZZZ].

parseJWTPayload(token)

Parses the JWT payload.

parseLogLevel(level)

parseMappingLanguage(input)

Parses a FHIR Mapping Language document into an AST.

parseParameter(searchParam, modifier, value)

parseReference(reference)

Parses a reference and returns a tuple of [ResourceType, ID].

parseSearchDefinition(url)

Parses a URL string into a SearchRequest.

parseSearchRequest(url, query)

Parses a search URL into a search request.

parseSearchUrl(url)

Parses a search URL into a search request.

parseStructureDefinition(sd)

Parses a StructureDefinition resource into an internal schema better suited for programmatic validation and usage in internal systems

parseXFhirQuery(query, variables)

Parses an extended FHIR search criteria string (i.e. application/x-fhir-query).

preciseEquals(a, b, precision)

Returns true if the two numbers are equal to the given precision.

preciseGreaterThan(a, b, precision)

Returns true if the first number is greater than the second number to the given precision.

preciseGreaterThanOrEquals(a, b, precision)

Returns true if the first number is greater than or equal to the second number to the given precision.

preciseLessThan(a, b, precision)

Returns true if the first number is less than the second number to the given precision.

preciseLessThanOrEquals(a, b, precision)

Returns true if the first number is less than or equal to the second number to the given precision.

preciseRound(a, precision)

Returns the input number rounded to the specified number of digits.

removeDuplicates(arr)

Removes duplicates in array using FHIRPath equality rules.

removeProfileFromResource(resource, profileUrl)

Removes the supplied profileUrl from the resource.meta.profile if it is present

reorderBundle(bundle)

Topologically sorts a batch or transaction bundle to improve reference resolution. The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.

In the event of cycles, this function will first create a POST request for each resource in the cycle, and then will append a PUT request to the bundle. This ensures that each resources in the cycle is visited twice, and all references can be resolved

resolveId(input)

Returns the ID portion of a reference.

resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, })

satisfiedAccessPolicy(resource, interaction, accessPolicy)

Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.

serializeFhircastSubscriptionRequest(subscriptionRequest)

Creates a serialized url-encoded payload for a FHIRcast subscription from a SubscriptionRequest object that can be directly used in an HTTP request to the Hub.

serverError(err)

setCodeBySystem(concept, system, code)

Sets a code for a given system within a given codeable concept.

setIdentifier(resource, system, value)

Sets a resource identifier for the given system.

Note that this method is only available on resources that have an "identifier" property, and that property must be an array of Identifier objects, which is not true for all FHIR resources.

If the identifier already exists, then the value is updated.

Otherwise a new identifier is added.

singleton(collection, type)

sleep(ms)

Sleeps for the specified number of milliseconds.

sortStringArray(array)

Sorts an array of strings in place using the localeCompare method.

This method will mutate the input array.

splitN(str, delim, n)

Splits a string into an array of strings using the specified delimiter. Unlike the built-in split function, this function will split the string into a maximum of exactly n parts. Trailing empty strings are included in the result.

splitSearchOnComma(input)

Splits a FHIR search value on commas. Respects backslash escape.

See: https://hl7.org/fhir/r4/search.html\#escaping

streamToBuffer(stream)

Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.

stringify(value, pretty)

FHIR JSON stringify. Removes properties with empty string values. Removes objects with zero properties. See: https://www.hl7.org/fhir/json.html

stringifyTypedValue(v)

Output the string representation of a value, suitable for use as part of a search query.

structureMapTransform(structureMap, input, loader)

Transforms input values using a FHIR StructureMap.

See: https://www.hl7.org/fhir/mapping-language.html

subsetResource(resource, properties)

Construct the subset of a resource containing a minimum set of fields. The returned resource is not guaranteed to contain only the provided properties, and may contain others (e.g. resourceType and id)

toJsBoolean(obj)

Converts unknown object into a JavaScript boolean. Note that this is different than the FHIRPath "toBoolean", which has particular semantics around arrays, empty arrays, and type conversions.

toPeriod(input)

Tries to convert an unknown input value to a Period object.

toTypedValue(value)

Returns a "best guess" TypedValue for a given value.

tryGetDataType(type, profileUrl)

tryGetJwtExpiration(token)

Returns the JWT expiration time in number of milliseconds elapsed since the epoch.

tryGetProfile(profileUrl)

validateFhircastSubscriptionRequest(subscriptionRequest)

Validates that a SubscriptionRequest.

validateResource(resource, options)

validateResourceType(resourceType)

Validates that the given string is a valid FHIR resource type.

On success, silently returns void. On failure, throws an OperationOutcomeError.

validationError(details)

Interfaces

Interface

Description

AddressFormatOptions

AgentConnectRequest

AgentConnectResponse

AgentError

AgentHeartbeatRequest

AgentHeartbeatResponse

AgentReloadConfigRequest

AgentReloadConfigResponse

AgentTransmitRequest

AgentTransmitResponse

AsyncResourceVisitor

Atom

AtomContext

BackgroundJobContext

BaseAgentMessage

BaseAgentRequestMessage

BaseLoginRequest

BotEvent

Code

ConceptMapTranslateMatch

ConceptMapTranslateOutput

ConceptMapTranslateParameters

Constraint

CreateBinaryOptions

Binary upload options.

CreateMediaOptions

CreatePdfFunction

CreatePdfOptions

PDF upload options.

ElementType

EmailPasswordLoginRequest

Event_2

ExtendedInternalSchemaElement

Filter

GetTypedPropertyValueOptions

GoogleCredentialResponse

GoogleLoginRequest

Hl7DateParseOptions

HumanNameFormatOptions

IClientStorage

IncludeTarget

IndexedStructureDefinition

An IndexedStructureDefinition is a lookup-optimized version of a StructureDefinition.

StructureDefinition resources contain schema information for other resource types. These schemas can be used to automatically generate user interface elements for resources.

However, a StructureDefinition resource is not optimized for realtime lookups. All resource types, sub types, and property definitions are stored in a flat array of ElementDefinition objects. Therefore, to lookup the schema for a property (i.e., "Patient.name") requires a linear scan of all ElementDefinition objects

A StructureDefinition resource contains information about one or more types. For example, the "Patient" StructureDefinition includes "Patient", "Patient_Contact", "Patient_Communication", and "Patient_Link". This is inefficient.

Instead, we create an indexed version of the StructureDefinition, called IndexedStructureDefinition. In an IndexedStructureDefinition, retrieving a property definition is a hashtable lookup.

The hierarchy is: IndexedStructureDefinition - top level for one resource type TypeSchema - one per resource type and all contained BackboneElements PropertySchema - one per property/field

InfixParselet

InternalSchemaElement

InternalTypeSchema

Internal representation of a non-primitive FHIR type, suitable for use in resource validation

InviteRequest

IRobustWebSocket

IRobustWebSocketCtor

LoggerConfig

LoggerOptions

LoginAuthenticationResponse

LoginProfileResponse

LoginScopeResponse

LoginState

MailAddress

Email address definition. Compatible with nodemailer Mail.Address.

MailAttachment

Email attachment definition. Compatible with nodemailer Mail.Options.

MailOptions

Email message definition. Compatible with nodemailer Mail.Options.

Marker

MedplumClientOptions

The MedplumClientOptions interface defines configuration options for MedplumClient.

All configuration settings are optional.

MedplumInfraConfig

MedplumRequestOptions

MedplumSourceInfraConfig

NewPatientRequest

NewProjectRequest

NewUserRequest

PatchOperation

JSONPatch patch operation. Compatible with fast-json-patch and rfc6902 Operation.

PrefixParselet

RequestProfileSchemaOptions

ResourceVisitor

SearchParameterDetails

SearchRequest

SliceDefinition

SliceDiscriminator

SlicingRules

SortRule

SubManagerOptions

Token

TokenizerOptions

TokenResponse

TypedValue

TypeInfo

An indexed TypeSchema.

Example: The IndexedStructureDefinition for "Patient" would include the following TypeSchemas: 1) Patient 2) Patient_Contact 3) Patient_Communication 4) Patient_Link

ValidatorOptions

ValueSetExpandParams

ValueSet $expand operation parameters. See: https://hl7.org/fhir/r4/valueset-operation-expand.html

Variables

Variable

Description

allOk

ContentType

Content type constants.

CPT

created

DEFAULT_ACCEPT

DEFAULT_SEARCH_COUNT

ExternalSecretSystems

FHIRCAST_EVENT_NAMES

FHIRCAST_EVENT_RESOURCES

FHIRCAST_EVENT_VERSION_REQUIRED

FHIRCAST_RESOURCE_TYPES

fhirTypeToJsType

forbidden

globalSchema

Global schema singleton.

gone

HTTP_HL7_ORG

HTTP_TERMINOLOGY_HL7_ORG

ICD10

LOINC

MEDPLUM_CLI_CLIENT_ID

MEDPLUM_VERSION

multipleMatches

notFound

notModified

OperatorPrecedence

Operator precedence See: https://hl7.org/fhirpath/\#operator-precedence

preconditionFailed

projectAdminResourceTypes

Project admin resource types are special resources that are only accessible to project administrators.

PropertyType

List of property types. http://www.hl7.org/fhir/valueset-defined-types.html The list here includes additions found from StructureDefinition resources.

protectedResourceTypes

Protected resource types are in the "medplum" project. Reading and writing is limited to the system account.

RXNORM

SNOMED

tooManyRequests

UCUM

unauthorized

VALID_HOSTNAME_REGEX

validationRegexes

Type Aliases

Type Alias

Description

AgentMessage

AgentRequestMessage

AgentResponseMessage

BackgroundJobInteraction

BaseSchema

BinarySource

Source for a FHIR Binary.

CanBePopulated

CodeChallengeMethod

Allowed values for code_challenge_method in a PKCE exchange.

ConvertToUnion

CurrentContext

DataTypesMap

ElementsContextType

Information for the set of elements at a given path within in a resource. This mostly exists to normalize access to elements regardless of whether they are from a profile, extension, or slice.

EventListener_2

ExtendedElementProperties

ExternalSecret

ExternalSecretPrimitive

ExternalSecretPrimitiveType

ExternalSecretSystem

FetchLike

FhircastConnectEvent

FhircastDisconnectEvent

FhircastEventContext

FhircastEventContextDetails

FhircastEventContextKey

FhircastEventContextMap

FhircastEventName

FhircastEventPayload

FhircastEventResource

FhircastEventResourceType

FhircastEventVersionOptional

FhircastEventVersionRequired

FhircastMessageEvent

FhircastMessagePayload

FhircastMultiResourceContext

FhircastResourceEventName

FhircastResourceType

FhircastSingleResourceContext

FhircastSubscriptionEventMap

FhircastValidContextForEvent

FhirFilterExpression

The FhirFilterExpression type is the base type of all filter expressions.

IssueSeverity

IssueType

LoggerConfigOverride

MailDestination

Email destination definition.

MedplumClientEventMap

This map enumerates all the lifecycle events that MedplumClient emits and what the shape of the Event is.

PendingSubscriptionRequest

ProfileResource

QueryTypes

QueryTypes defines the different ways to specify FHIR search parameters.

Can be any valid input to the URLSearchParams() constructor.

TypeScript definitions for URLSearchParams do not match runtime behavior. The official spec only accepts string values. Web browsers and Node.js automatically coerce values to strings. See: https://github.com/microsoft/TypeScript/issues/32951

ResourceArray

ResourceArray is an array of resources with a bundle property. The bundle property is a FHIR Bundle containing the search results. This is useful for retrieving bundle metadata such as total, offset, and next link.

ResourceCrawlerOptions

ResourceMatchesSubscriptionCriteria

ResourceWithCode

RobustWebSocketEventMap

SliceDefinitionWithTypes

StringMap

SubscriptionEventMap

SubscriptionRequest

A FHIRcast subscription request.

Can be passed to MedplumClient.fhircastConnect or MedplumClient.fhircastUnsubscribe to either open a FHIRcast connection, or unsubscribe from the subscription.

TypedValueWithPath

TypeName

ValueOrExternalSecret