> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Map Concepts

> Perform multiple OMOP concept mapping operations in a single batched request - high-throughput cross-vocabulary translation for ETL pipelines.

## Overview

This endpoint allows you to perform multiple concept mapping operations in a single API call. Each mapping request maps a set of source concepts to a target vocabulary, enabling efficient bulk processing.

## Request Body

**mapping\_requests** `array` *required*

Array of mapping requests (1-50 items)

**mapping\_requests**

**request\_id** `string` *required*

Unique identifier for this mapping request (for tracking results)

**source\_concepts** `array[integer]` *required*

Array of OMOP concept IDs to map (minimum 1 integer)

**target\_vocabulary** `string` *required*

Target vocabulary ID to map to (e.g., "ICD10CM", "SNOMED", "ICD9CM")

> [!NOTE]
>
> Mapping batches are capped at 50 requests because each request can contain
> multiple `source_concepts` and performs mapping work for every source concept.
> Hierarchy and relationship batches allow 100 entries because each entry
> addresses one concept.

## Query Parameters

**vocab\_release** `string`

Specific vocabulary release version (e.g., "2025.1")

## Response

**success** `boolean` *required*

Indicates if the batch request was processed successfully

**data** `array` *required*

Array of mapping results matching the input order

**data**

**request\_id** `string`

The request ID provided in the input

**source\_concepts** `array`

Array of source concept IDs that were mapped

**target\_vocabulary** `string`

The target vocabulary for this mapping request

**mappings** `array`

Array of concept mappings found

**mappings**

**source\_concept\_id** `integer`

The source OMOP concept ID that was mapped

**target\_concept\_id** `integer`

The target OMOP concept ID in the target vocabulary

**target\_concept\_name** `string`

Human-readable name of the target concept

**target\_concept\_code** `string`

The code of the target concept in its vocabulary

**relationship\_id** `string`

The relationship type (e.g., "Maps to", "Maps to value")

**success** `boolean`

Whether this individual mapping request succeeded

**error** `string`

Error message if the mapping request failed (null if successful)

**request\_index** `integer`

Index of this request in the original input array

**meta** `object` *required*

Response metadata and API information

**meta**

**request\_id** `string`

Unique request identifier for debugging

**timestamp** `string`

ISO 8601 timestamp of the response

**vocab\_release** `string`

Vocabulary release version used

```bash cURL theme={null}
curl -X POST "https://api.omophub.com/v1/concepts/map/batch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mapping_requests": [
      {
        "request_id": "diabetes_icd10",
        "source_concepts": [201826, 443735],
        "target_vocabulary": "ICD10CM"
      },
      {
        "request_id": "hypertension_snomed",
        "source_concepts": [4182210],
        "target_vocabulary": "SNOMED"
      }
    ]
  }'
```

```ts TypeScript theme={null}
import { OMOPHub } from '@omophub/omophub-node';

// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
// (For single-batch mapping, `client.mappings.map({ sourceConcepts, targetVocabulary })`
// is the dedicated method.)
const client = new OMOPHub();

interface BatchMapResult {
  request_id: string;
  success: boolean;
  target_vocabulary: string;
  mappings: unknown[];
  error?: string;
}

const { data } = await client.post<BatchMapResult[]>('/concepts/map/batch', {
  mapping_requests: [
    { request_id: 'diabetes_icd10', source_concepts: [201826, 443735], target_vocabulary: 'ICD10CM' },
    { request_id: 'hypertension_snomed', source_concepts: [4182210], target_vocabulary: 'SNOMED' },
  ],
});

for (const item of data ?? []) {
  console.log(`Request ${item.request_id}: ${item.success ? 'Success' : 'Failed'}`);
  if (item.success) {
    console.log(`  Found ${item.mappings.length} mappings to ${item.target_vocabulary}`);
  } else {
    console.log(`  Error: ${item.error}`);
  }
}
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.omophub.com/v1/concepts/map/batch",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "mapping_requests": [
            {
                "request_id": "diabetes_icd10",
                "source_concepts": [201826, 443735],
                "target_vocabulary": "ICD10CM"
            },
            {
                "request_id": "hypertension_snomed",
                "source_concepts": [4182210],
                "target_vocabulary": "SNOMED"
            }
        ]
    }
)

result = response.json()
for item in result["data"]:
    status = "Success" if item["success"] else "Failed"
    print(f"Request {item['request_id']}: {status}")
    if item["success"]:
        print(f"  Found {len(item['mappings'])} mappings to {item['target_vocabulary']}")
    else:
        print(f"  Error: {item['error']}")
```

```json theme={null}
{
  "success": true,
  "data": [
    {
      "request_id": "diabetes_icd10",
      "source_concepts": [201826, 443735],
      "target_vocabulary": "ICD10CM",
      "mappings": [
        {
          "source_concept_id": 201826,
          "target_concept_id": 443735,
          "target_concept_name": "Type 2 diabetes mellitus without complications",
          "target_concept_code": "E11.9",
          "relationship_id": "Maps to"
        }
      ],
      "success": true,
      "error": null,
      "request_index": 0
    },
    {
      "request_id": "hypertension_snomed",
      "source_concepts": [4182210],
      "target_vocabulary": "SNOMED",
      "mappings": [
        {
          "source_concept_id": 4182210,
          "target_concept_id": 316866,
          "target_concept_name": "Hypertensive disorder",
          "target_concept_code": "38341003",
          "relationship_id": "Maps to"
        }
      ],
      "success": true,
      "error": null,
      "request_index": 1
    }
  ],
  "meta": {
    "request_id": "req_batch_abc123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.2"
  }
}
```

## Important Notes

* **Batch size limit**: Maximum 50 mapping requests per batch
* **Error isolation**: Individual mapping failures don't affect other mappings in the batch
* **Result ordering**: Results are returned in the same order as input requests
* **Request IDs**: Use unique `request_id` values to correlate results with your input

## Related Endpoints

* [Get Concept Mappings](https://docs.omophub.com/api-reference/mappings/get-concept-mappings.md) - Get mappings for a single concept
* [Validate Mappings](https://docs.omophub.com/api-reference/mappings/validate-mappings.md) - Validate existing mappings


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.