## setIdentifier() function [​](/content/docs/sdk/core.setidentifier#setidentifier-function "Direct link to setIdentifier(/index.html) 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:**

```typescript
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](/content/docs/sdk/core.setidentifieroptions) | _(Optional)_ Optional attributes to set |

**Returns:**

void

- [setIdentifier() function](/content/docs/sdk/core.setidentifier#setidentifier-function/index.html)
- [Parameters](/content/docs/sdk/core.setidentifier#parameters/index.html)
