# Clinical References

## Create a clinical reference

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

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

### Body Parameters

- `name: string`

- `type: ClinicalReferenceType`

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

  - `"facility"`

  - `"referring_provider"`

  - `"study_description"`

  - `"procedure"`

- `expressCustomerId: optional string`

- `externalReferenceId: optional string`

- `metadata: optional map[string]`

### Returns

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $AVARA_API_KEY" \
    -d '{
          "name": "City Medical Center",
          "type": "facility",
          "expressCustomerId": "cus_1234567890abcdef1234567890abcdef"
        }'
```

#### 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

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

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

### Query Parameters

- `cursor: optional string`

  Base64 encoded cursor from previous response

- `expressCustomerId: optional string`

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

- `isActive: optional boolean`

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

- `limit: optional number`

  Number of results to return (1-100)

- `type: optional ClinicalReferenceType`

  Filter by clinical reference type

  - `"facility"`

  - `"referring_provider"`

  - `"study_description"`

  - `"procedure"`

### Returns

- `clinicalReferences: array of ClinicalReference`

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

- `hasMore: boolean`

- `cursor: optional string`

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences \
    -H "Authorization: Bearer $AVARA_API_KEY"
```

#### 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

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

Retrieves a single clinical reference by its unique identifier.

### Path Parameters

- `clinicalReferenceId: string`

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

### Returns

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences/$CLINICAL_REFERENCE_ID \
    -H "Authorization: Bearer $AVARA_API_KEY"
```

#### 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

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

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

### Path Parameters

- `externalReferenceId: string`

  Integrator-provided external reference identifier

### Returns

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences/byExternalReferenceId/$EXTERNAL_REFERENCE_ID \
    -H "Authorization: Bearer $AVARA_API_KEY"
```

#### 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

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

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

### Path Parameters

- `clinicalReferenceId: string`

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

### Body Parameters

- `expressCustomerId: optional string`

- `metadata: optional map[string]`

- `name: optional string`

### Returns

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences/$CLINICAL_REFERENCE_ID \
    -X PATCH \
    -H "Authorization: Bearer $AVARA_API_KEY"
```

#### 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

**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.

### Path Parameters

- `clinicalReferenceId: string`

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

### Returns

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs

### Example

```http
curl https://api.avarasoftware.com/v1/autoScribe/clinicalReferences/$CLINICAL_REFERENCE_ID/delete \
    -X POST \
    -H "Authorization: Bearer $AVARA_API_KEY"
```

#### 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

- `ClinicalReference object { clinicalReferenceId, createdAt, isActive, 6 more }`

  A canonical clinical reference value for study workflow pickers and normalization

  - `clinicalReferenceId: string`

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

  - `createdAt: string`

    Timestamp when the clinical reference was created

  - `isActive: boolean`

    Whether this reference is active and available for pickers

  - `name: string`

    Canonical display name for this reference value

  - `type: ClinicalReferenceType`

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

    - `"facility"`

    - `"referring_provider"`

    - `"study_description"`

    - `"procedure"`

  - `updatedAt: string`

    Timestamp when the clinical reference was last updated

  - `expressCustomer: optional ExpressCustomerReference`

    A reference to an Express customer with basic identifying information

    - `expressCustomerId: string`

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

    - `expressCustomerName: string`

      Name of the Express customer

  - `externalReferenceId: optional string`

    Integrator-provided stable identifier for mapping inbound data

  - `metadata: optional map[string]`

    Optional key-value metadata. Maximum 50 pairs
