Skip to main content

core.isresourcetype

Home > @medplum/core > isResourceType

isResourceType() function

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

Signature:

export declare function isResourceType(resourceType: string): boolean;

Parameters

ParameterTypeDescription
resourceTypestringThe candidate resource type string.

Returns:

boolean

True if the resource type is a valid FHIR resource type.

Example

isResourceType('Patient'); // true
isResourceType('XYZ'); // false