# Clinical References

## Create a clinical reference

`ClinicalReference AutoScribe.ClinicalReferences.Create(ClinicalReferenceCreateParamsparameters, CancellationTokencancellationToken = default)`

**post** `/v1/autoScribe/clinicalReferences`

Creates a canonical clinical reference value for study workflow pickers and normalization.

### Parameters

- `ClinicalReferenceCreateParams parameters`

  - `required string name`

  - `required ClinicalReferenceType type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

  - `string expressCustomerID`

  - `string? externalReferenceID`

  - `IReadOnlyDictionary<string, string> metadata`

### Returns

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs

### Example

```csharp
ClinicalReferenceCreateParams parameters = new()
{
    Name = "City Medical Center",
    Type = ClinicalReferenceType.Facility,
};

var clinicalReference = await client.AutoScribe.ClinicalReferences.Create(parameters);

Console.WriteLine(clinicalReference);
```

#### Response

```json
{
  "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "name": "City Medical Center",
  "type": "facility",
  "updatedAt": "2024-03-15T14:20:00Z",
  "expressCustomer": {
    "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
    "expressCustomerName": "City Medical Center"
  },
  "externalReferenceId": "FAC-001",
  "metadata": {
    "region": "northeast"
  }
}
```

## List clinical references

`ClinicalReferenceListPageResponse AutoScribe.ClinicalReferences.List(ClinicalReferenceListParams?parameters, CancellationTokencancellationToken = default)`

**get** `/v1/autoScribe/clinicalReferences`

Lists clinical references with cursor-based pagination and optional filters.

### Parameters

- `ClinicalReferenceListParams parameters`

  - `string cursor`

    Base64 encoded cursor from previous response

  - `string expressCustomerID`

    Filter by Express customer ID. Omit for no filter; pass null for clinic-wide references

  - `Boolean? isActive`

    Filter by active status. Defaults to true (active references only). Pass false to list inactive references.

  - `Double limit`

    Number of results to return (1-100)

  - `ClinicalReferenceType type`

    Filter by clinical reference type

### Returns

- `class ClinicalReferenceListPageResponse:`

  Paginated list of clinical references

  - `required IReadOnlyList<ClinicalReference> ClinicalReferences`

    - `required string ClinicalReferenceID`

      Unique clinical reference identifier. Format: ref_{32-hex-chars}

    - `required DateTimeOffset? CreatedAt`

      Timestamp when the clinical reference was created

    - `required Boolean IsActive`

      Whether this reference is active and available for pickers

    - `required string Name`

      Canonical display name for this reference value

    - `required ClinicalReferenceType Type`

      Category of canonical clinical reference value used for study workflow pickers and normalization.

      - `"facility"Facility`

      - `"referring_provider"ReferringProvider`

      - `"study_description"StudyDescription`

      - `"procedure"Procedure`

    - `required DateTimeOffset? UpdatedAt`

      Timestamp when the clinical reference was last updated

    - `ExpressCustomerReference? ExpressCustomer`

      A reference to an Express customer with basic identifying information

      - `required string ExpressCustomerID`

        Unique Express customer identifier. Format: cus_{32-hex-chars}

      - `required string ExpressCustomerName`

        Name of the Express customer

    - `string? ExternalReferenceID`

      Integrator-provided stable identifier for mapping inbound data

    - `IReadOnlyDictionary<string, string> Metadata`

      Optional key-value metadata. Maximum 50 pairs

  - `required Boolean HasMore`

  - `string Cursor`

### Example

```csharp
ClinicalReferenceListParams parameters = new();

var page = await client.AutoScribe.ClinicalReferences.List(parameters);
await foreach (var item in page.Paginate())
{
    Console.WriteLine(item);
}
```

#### Response

```json
{
  "clinicalReferences": [
    {
      "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
      "createdAt": "2024-01-15T09:00:00Z",
      "isActive": true,
      "name": "City Medical Center",
      "type": "facility",
      "updatedAt": "2024-03-15T14:20:00Z",
      "expressCustomer": {
        "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
        "expressCustomerName": "City Medical Center"
      },
      "externalReferenceId": "FAC-001",
      "metadata": {
        "region": "northeast"
      }
    }
  ],
  "hasMore": true,
  "cursor": "cursor"
}
```

## Retrieve a clinical reference by ID

`ClinicalReference AutoScribe.ClinicalReferences.Retrieve(ClinicalReferenceRetrieveParamsparameters, CancellationTokencancellationToken = default)`

**get** `/v1/autoScribe/clinicalReferences/{clinicalReferenceId}`

Retrieves a single clinical reference by its unique identifier.

### Parameters

- `ClinicalReferenceRetrieveParams parameters`

  - `required string clinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

### Returns

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs

### Example

```csharp
ClinicalReferenceRetrieveParams parameters = new()
{
    ClinicalReferenceID = "ref_1234567890abcdef1234567890abcdef"
};

var clinicalReference = await client.AutoScribe.ClinicalReferences.Retrieve(parameters);

Console.WriteLine(clinicalReference);
```

#### Response

```json
{
  "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "name": "City Medical Center",
  "type": "facility",
  "updatedAt": "2024-03-15T14:20:00Z",
  "expressCustomer": {
    "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
    "expressCustomerName": "City Medical Center"
  },
  "externalReferenceId": "FAC-001",
  "metadata": {
    "region": "northeast"
  }
}
```

## Retrieve a clinical reference by external reference ID

`ClinicalReference AutoScribe.ClinicalReferences.RetrieveByExternalReferenceID(ClinicalReferenceRetrieveByExternalReferenceIDParamsparameters, CancellationTokencancellationToken = default)`

**get** `/v1/autoScribe/clinicalReferences/byExternalReferenceId/{externalReferenceId}`

Retrieves a single clinical reference by its integrator-provided external reference identifier.

### Parameters

- `ClinicalReferenceRetrieveByExternalReferenceIDParams parameters`

  - `required string externalReferenceID`

    Integrator-provided external reference identifier

### Returns

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs

### Example

```csharp
ClinicalReferenceRetrieveByExternalReferenceIDParams parameters = new()
{
    ExternalReferenceID = "FAC-001"
};

var clinicalReference = await client.AutoScribe.ClinicalReferences.RetrieveByExternalReferenceID(parameters);

Console.WriteLine(clinicalReference);
```

#### Response

```json
{
  "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "name": "City Medical Center",
  "type": "facility",
  "updatedAt": "2024-03-15T14:20:00Z",
  "expressCustomer": {
    "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
    "expressCustomerName": "City Medical Center"
  },
  "externalReferenceId": "FAC-001",
  "metadata": {
    "region": "northeast"
  }
}
```

## Update a clinical reference

`ClinicalReference AutoScribe.ClinicalReferences.Update(ClinicalReferenceUpdateParamsparameters, CancellationTokencancellationToken = default)`

**patch** `/v1/autoScribe/clinicalReferences/{clinicalReferenceId}`

Updates name, metadata, and Express customer assignment. Type is immutable after create.

### Parameters

- `ClinicalReferenceUpdateParams parameters`

  - `required string clinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `string expressCustomerID`

  - `IReadOnlyDictionary<string, string>? metadata`

  - `string name`

### Returns

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs

### Example

```csharp
ClinicalReferenceUpdateParams parameters = new()
{
    ClinicalReferenceID = "ref_1234567890abcdef1234567890abcdef"
};

var clinicalReference = await client.AutoScribe.ClinicalReferences.Update(parameters);

Console.WriteLine(clinicalReference);
```

#### Response

```json
{
  "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "name": "City Medical Center",
  "type": "facility",
  "updatedAt": "2024-03-15T14:20:00Z",
  "expressCustomer": {
    "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
    "expressCustomerName": "City Medical Center"
  },
  "externalReferenceId": "FAC-001",
  "metadata": {
    "region": "northeast"
  }
}
```

## Delete a clinical reference

`ClinicalReference AutoScribe.ClinicalReferences.Delete(ClinicalReferenceDeleteParamsparameters, CancellationTokencancellationToken = default)`

**post** `/v1/autoScribe/clinicalReferences/{clinicalReferenceId}/delete`

Soft-deletes a clinical reference by setting isActive to false and suffixing the name to free the unique constraint.

### Parameters

- `ClinicalReferenceDeleteParams parameters`

  - `required string clinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

### Returns

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs

### Example

```csharp
ClinicalReferenceDeleteParams parameters = new()
{
    ClinicalReferenceID = "ref_1234567890abcdef1234567890abcdef"
};

var clinicalReference = await client.AutoScribe.ClinicalReferences.Delete(parameters);

Console.WriteLine(clinicalReference);
```

#### Response

```json
{
  "clinicalReferenceId": "ref_1234567890abcdef1234567890abcdef",
  "createdAt": "2024-01-15T09:00:00Z",
  "isActive": true,
  "name": "City Medical Center",
  "type": "facility",
  "updatedAt": "2024-03-15T14:20:00Z",
  "expressCustomer": {
    "expressCustomerId": "cus_1234567890abcdef1234567890abcdef",
    "expressCustomerName": "City Medical Center"
  },
  "externalReferenceId": "FAC-001",
  "metadata": {
    "region": "northeast"
  }
}
```

## Domain Types

### Clinical Reference

- `class ClinicalReference:`

  A canonical clinical reference value for study workflow pickers and normalization

  - `required string ClinicalReferenceID`

    Unique clinical reference identifier. Format: ref_{32-hex-chars}

  - `required DateTimeOffset? CreatedAt`

    Timestamp when the clinical reference was created

  - `required Boolean IsActive`

    Whether this reference is active and available for pickers

  - `required string Name`

    Canonical display name for this reference value

  - `required ClinicalReferenceType Type`

    Category of canonical clinical reference value used for study workflow pickers and normalization.

    - `"facility"Facility`

    - `"referring_provider"ReferringProvider`

    - `"study_description"StudyDescription`

    - `"procedure"Procedure`

  - `required DateTimeOffset? UpdatedAt`

    Timestamp when the clinical reference was last updated

  - `ExpressCustomerReference? ExpressCustomer`

    A reference to an Express customer with basic identifying information

    - `required string ExpressCustomerID`

      Unique Express customer identifier. Format: cus_{32-hex-chars}

    - `required string ExpressCustomerName`

      Name of the Express customer

  - `string? ExternalReferenceID`

    Integrator-provided stable identifier for mapping inbound data

  - `IReadOnlyDictionary<string, string> Metadata`

    Optional key-value metadata. Maximum 50 pairs
