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

ParameterTypeDescription
resourcesResourceWithCode[]The array of resources to search.
codeCodeableConcept | stringThe code to search for.
systemstringThe 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.