Labcorp Data Connection Integration Guide
Please follow the steps below to create a Labcorp direct connection from the search flow.
Step 1: Create Consent
Before creating a connection, the user must grant consent for Labcorp to share data. Call the createConsent mutation with the DIRECT_IMPORT_RECORDS category code and the Labcorp organization reference.
Mutation:
mutation createConsent($consentInput: ConsentInput!) {
createConsent(consentInput: $consentInput) {
id
provision {
type
}
category {
coding {
code
}
}
status
patient {
resource {
id
}
}
organization {
resource {
id
}
}
}
}
Variables:
{
"consentInput": {
"category": [
{
"coding": [
{
"system": "http://www.icanbwell.com/consent-category",
"code": "DIRECT_IMPORT_RECORDS"
}
]
}
],
"provision": {
"type": "PERMIT"
},
"status": "ACTIVE",
"organization": [
{
"type": "Organization",
"reference": "Organization/<connection_id>"
}
]
}
}
Expected Response (success):
{
"data": {
"createConsent": {
"id": "<consent-id>",
"provision": {
"type": "PERMIT"
},
"category": [
{
"coding": [
{
"code": "direct:import:records"
}
]
}
],
"status": "active",
"patient": {
"resource": {
"id": "<patient-id>"
}
}
}
}
}
Step 2: Create Connection
Once the consent is in place, create the Labcorp direct connection. Since this is a direct connection, no username or password is required. Pass integrationType as DIRECT.
Mutation:
mutation createConnection(
$connectionId: String!
$username: String
$password: String
$integrationType: IntegrationType
) {
createConnection(
connectionId: $connectionId
username: $username
password: $password
integrationType: $integrationType
) {
id
status
name
category
type
syncStatus
statusUpdated
lastSynced
created
}
}
Variables:
{
"connectionId": "Labcorp",
"integrationType": "DIRECT"
}
Expected Response (success):
"data": {
"createConnection": {
"id": "Labcorp",
"status": "CONNECTED",
"name": "Labcorp",
"category": "IDENTITY",
"type": "LAB",
"syncStatus": "PENDING",
"statusUpdated": "2026-04-03T...",
"lastSynced": "2026-04-03T...",
"created": "2026-04-03T..."
}
}
}
Note: username and password are not required for direct connections. They are only required for credential-based BASIC connections.
Step 4: Verify Connection Status After creating the connection, use the getMemberConnections query to verify the connection status.
Query:
query getMemberConnections() {
getMemberConnections {
id
name
category
integrationType
type
status
syncStatus
syncErrors {
coding {
display
code
}
}
statusUpdated
lastSynced
created
}
}
Expected Response:
{
"data": {
"getMemberConnections": [
{
"id": "Labcorp",
"name": "Labcorp",
"category": "IDENTITY",
"integrationType": "direct",
"type": "LAB",
"status": "CONNECTED",
"syncStatus": "PENDING",
"syncErrors": null,
"statusUpdated": "2026-03-23T11:58:00.909000+00:00",
"lastSynced": null,
"created": "2026-03-18T07:45:47.947000"
}
]
}
}
Connection Lifecycle Summary
| Step | API Call | Required? |
|---|---|---|
| 1 | createConsent with DIRECT_IMPORT_RECORDS category and organization id | Yes |
| 2 | createConnection with integrationType: "DIRECT" | Yes |
| 3 | getMemberConnections to check status | Recommended |
Updated 8 days ago
