Skip to main content

core.findresourcebycode

Home > @medplum/core > findResourceByCode

findResourceByCode() function

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

Signature:

export declare function findResourceByCode(resources: ResourceWithCode[], code: CodeableConcept | string, system: string): ResourceWithCode | undefined;

Parameters

Parameter

Type

Description

resources

ResourceWithCode[]

The array of resources to search.

code

CodeableConcept | string

The code to search for.

system

string

The system to search for.

Returns:

ResourceWithCode | undefined

The first resource in the input array that matches the specified code and system, or undefined if no such resource is found.