core.setidentifier | Medplum

setIdentifier() function

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.

Signature:

export declare function setIdentifier(resource: Resource & {
    identifier?: Identifier[];
}, system: string, value: string, options?: SetIdentifierOptions): void;

Parameters [​](/content/docs/sdk/core.setidentifier#parameters "Direct link to Parameters"/index.html)

Parameter Type Description
resource Resource & { identifier?: Identifier[]; } The resource to add the identifier to.
system string The identifier system.
value string The identifier value.
options SetIdentifierOptions (Optional) Optional attributes to set

Returns:

void