Mappings
Handle data mapping between workflow steps including creating, updating, and managing step mappings.
Get Step Mapping
GET /v1/steps/{stepId}/mapping
Get all field mappings for a workflow step.
Path Parameters:
stepId
(string, required): Step UUID
Response (200 OK):
[
{
"id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"sourceId": "132afa6c-daa5-4adc-bebe-59329a1d4577",
"sourceForeignFieldId": "patient_name",
"sourceForeignDataType": "string",
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "full_name",
"order": 0,
"staticValue": null,
"fieldMappingMetadata": [
{
"id": "metadata-123",
"fieldMappingId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"key": "displayLabel",
"value": "Patient Full Name"
}
],
"createdAt": "2024-01-20T10:00:00.000Z",
"updatedAt": "2024-01-20T10:00:00.000Z"
},
{
"id": "7d17fec0-2ded-5f52-ad90-a7315f3c3dc1",
"sourceId": null,
"sourceForeignFieldId": null,
"sourceForeignDataType": null,
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "department",
"order": 1,
"staticValue": "Emergency",
"fieldMappingMetadata": [],
"createdAt": "2024-01-20T10:05:00.000Z",
"updatedAt": "2024-01-20T10:05:00.000Z"
}
]
Create Step Mapping
POST /v1/steps/{stepId}/mapping
Create a new field mapping for a workflow step.
Path Parameters:
stepId
(string, required): Step UUID
Request Body:
Required fields:
- targetForeignFieldId
Optional fields:
- sourceId
- sourceForeignFieldId
- sourceForeignDataType
- order
- staticValue
- fieldMappingMetadata
{
"sourceId": "132afa6c-daa5-4adc-bebe-59329a1d4577",
"sourceForeignFieldId": "patient_email",
"sourceForeignDataType": "string",
"targetForeignFieldId": "email_address",
"order": 2,
"fieldMappingMetadata": [
{
"key": "validation",
"value": "email"
}
]
}
Response (201 Created):
{
"id": "8e28gfd1-3eee-6g63-be01-b8426g4d4ed2",
"sourceId": "132afa6c-daa5-4adc-bebe-59329a1d4577",
"sourceForeignFieldId": "patient_email",
"sourceForeignDataType": "string",
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "email_address",
"order": 2,
"staticValue": null,
"fieldMappingMetadata": [
{
"id": "metadata-456",
"fieldMappingId": "8e28gfd1-3eee-6g63-be01-b8426g4d4ed2",
"key": "validation",
"value": "email"
}
],
"createdAt": "2024-01-20T11:00:00.000Z",
"updatedAt": "2024-01-20T11:00:00.000Z"
}
Get Step Mapping by ID
GET /v1/steps/{stepId}/mapping/{mappingId}
Get a specific field mapping by its ID.
Path Parameters:
stepId
(string, required): Step UUIDmappingId
(string, required): Mapping UUID
Response (200 OK):
{
"id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"sourceId": "132afa6c-daa5-4adc-bebe-59329a1d4577",
"sourceForeignFieldId": "patient_name",
"sourceForeignDataType": "string",
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "full_name",
"order": 0,
"staticValue": null,
"fieldMappingMetadata": [
{
"id": "metadata-123",
"fieldMappingId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"key": "displayLabel",
"value": "Patient Full Name"
}
],
"createdAt": "2024-01-20T10:00:00.000Z",
"updatedAt": "2024-01-20T10:00:00.000Z"
}
Update Step Mapping
PATCH /v1/steps/{stepId}/mapping/{mappingId}
Update a field mapping by its ID.
Path Parameters:
stepId
(string, required): Step UUIDmappingId
(string, required): Mapping UUID
Request Body:
Optional fields:
- sourceId
- sourceForeignFieldId
- sourceForeignDataType
- targetForeignFieldId
- order
- staticValue
- fieldMappingMetadata
{
"order": 1,
"fieldMappingMetadata": [
{
"key": "displayLabel",
"value": "Full Patient Name"
},
{
"key": "required",
"value": true
}
]
}
Response (200 OK):
{
"id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"sourceId": "132afa6c-daa5-4adc-bebe-59329a1d4577",
"sourceForeignFieldId": "patient_name",
"sourceForeignDataType": "string",
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "full_name",
"order": 1,
"staticValue": null,
"fieldMappingMetadata": [
{
"id": "metadata-123",
"fieldMappingId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"key": "displayLabel",
"value": "Full Patient Name"
},
{
"id": "metadata-789",
"fieldMappingId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"key": "required",
"value": true
}
],
"createdAt": "2024-01-20T10:00:00.000Z",
"updatedAt": "2024-01-20T11:30:00.000Z"
}
Delete Step Mapping
DELETE /v1/steps/{stepId}/mapping/{mappingId}
Delete a field mapping.
Path Parameters:
stepId
(string, required): Step UUIDmappingId
(string, required): Mapping UUID
Response (200 OK):
No response body.
Batch Create Step Mappings
POST /v1/steps/{stepId}/mapping/batch-create
Create multiple field mappings at once.
Path Parameters:
stepId
(string, required): Step UUID
Request Body:
Array of field mapping field names:
[
"patient_id",
"patient_name",
"patient_email",
"patient_phone"
]
Response (201 Created):
[
{
"id": "9f39hge2-4fff-7h74-cf12-c9537h5e5fe3",
"sourceId": null,
"sourceForeignFieldId": null,
"sourceForeignDataType": null,
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "patient_id",
"order": 0,
"staticValue": null,
"fieldMappingMetadata": [],
"createdAt": "2024-01-20T12:00:00.000Z",
"updatedAt": "2024-01-20T12:00:00.000Z"
},
{
"id": "ag4aihf3-5ggg-8i85-dg23-da648i6f6gf4",
"sourceId": null,
"sourceForeignFieldId": null,
"sourceForeignDataType": null,
"targetId": "9b206fac-619b-432d-8d5a-0ae75008c6c4",
"targetForeignFieldId": "patient_name",
"order": 1,
"staticValue": null,
"fieldMappingMetadata": [],
"createdAt": "2024-01-20T12:00:00.000Z",
"updatedAt": "2024-01-20T12:00:00.000Z"
}
]
Batch Delete Step Mappings
POST /v1/steps/{stepId}/mapping/batch-delete
Delete multiple field mappings at once.
Path Parameters:
stepId
(string, required): Step UUID
Request Body:
Required fields:
- mappingIds
{
"mappingIds": [
"6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
"7d17fec0-2ded-5f52-ad90-a7315f3c3dc1"
]
}
Response (201 Created):
No response body.
Delete Step Mapping Metadata
DELETE /v1/steps/{stepId}/mapping/{mappingId}/metadata/{key}
Delete a specific metadata field from a mapping.
Path Parameters:
stepId
(string, required): Step UUIDmappingId
(string, required): Mapping UUIDkey
(string, required): Metadata key to delete
Response (200 OK):
No response body.
Updated 21 days ago