DrChrono Lab API and Webhook

Pre-Requisite 

This article will help provide an overview of creating a DrChrono app instance. We also have an article to connect with our API via Postman.

To start, please send an email to api@drchrono.com. Aside from our API scopes and User Permissions, a specialist will need to enable the Lab Vendor permission for your application to be able to POST to our lab APIs. Provide the name of your DrChrono API app and the name of the lab you are connecting to.

DrChrono Lab API

Our Lab endpoints have a required sequence.

  • When you receive orders, submit them to api/lab_orders so the user can view them in DrChrono
     -> If there is a lab requisition pdf, submit them to api/lab_documents
  • Submit the test values via api/lab_tests endpoint
  • Submit the lab result pdf via api/lab_documents endpoint
  • Submit the final results via api/lab_results endpoint

Sublab API

When creating a lab order via API, the sublab is a required field. The sublab is an identifier for your laboratory. For instance, I am looking to connect to a Lab called "Custom DRC Labs". I will first need to create a sublab for my lab and store it inside the DrChrono system.

Here is a POST call to accomplish a new sublab creation.

POST https://app.drchrono.com/api/sublabs
{
    "facility_code": "00999CL",
    "name": "Custom DRC Labs"
}

Please ensure you save the "id" from the response.

[To note, in the api/sublab response the "vendor_name" comes from the DrChrono API Specialist. When requesting lab vendor access, the specialist will input the name of the lab. If you would like a different name please specify in the support ticket.]

Lab Order

JSON example for submitting an order via API.

POST https://app.drchrono.com/api/lab_orders
{
    "doctor": "319108",
    "patient": "124818685",
    "sublab": "1084",
    "status": "S",
    "notes": "Input Notes Here",
    "accession_number": "01X",
    "icd10_codes": [
        {
            "code": "F01.50"
        }
    ],
    "priority": "N"
}

If you are including a lab requisition form, please use the api/lab_documents endpoint and set "type" to REQ.

curl --location 'https://app.drchrono.com/api/lab_documents' \
--header 'Authorization: Bearer 123456' \
--form 'document=@"/Users/your.macbook/Downloads/LAB DOCUMENT A.pdf"' \
--form 'lab_order="11104895"' \
--form 'type="REQ"'

The patient's lab order should show in the patient chart > Lab Orders. 

Lastly, to update a status make a PATCH call to the lab_orders API.

PATCH https://app.drchrono.com/api/lab_orders/11104895
{
    "status": "R"
}

Here is a complete list of lab order status.

ValueNote
NNot Sent
AABN Required (Advance Beneficiary Notice)
SSent
RResults Received
EError
PPreliminary Results
QQueued
CCanceled

Lab Tests

Submit the test values here, you can input as many tests per order.

JSON example

POST https://app.drchrono.com/api/lab_tests
[
    {
        "lab_order": 11104895,
        "code": "your unique code",
        "name": "customdrclabs Testing Result",
        "description": "description for ICD-10 code",
        "collection_date": "2025-01-14T13:30:00",
        "internal_notes": "Lab notes here",
        "report_notes": "report notes",
        "status": "F",
        "specimen_source": "string",
        "specimen_condition": "string2",
        "specimen_total_volume": 10
    },
    {
        "lab_order": 11104895,
        "code": "your unique code",
        "name": "customdrclabs Testing Result",
        "description": "description for ICD-10 code",
        "collection_date": "2025-01-14T13:30:00",
        "internal_notes": "Lab notes here",
        "report_notes": "report notes",
        "status": "F",
        "specimen_source": "string",
        "specimen_condition": "string2",
        "specimen_total_volume": 11
    }
]

Lab Document

curl --location 'https://app.drchrono.com/api/lab_documents' \
--header 'Authorization: Bearer 123456' \
--form 'document=@"/Users/your.macbook/Downloads/LAB DOCUMENT B.pdf"' \
--form 'lab_order="11104895"' \
--form 'type="RES"'

The DrChrono patient chart orders page should look like this.

The "type" field will determine the type of document upload. Here is a complete list of the "type" values.

ValueNote
REQRequisition Form
RESLab Results
R-ARequisition Form and ABN 
ABNABN (Advance Beneficiary Notice)

Lab Results

The last step of the sequence is to submit the results. If you submitted more than one tests for an order, ensure you include them in the request. To note, you can always update the test results later using the PATCH /api/lab_results/id HTTP request.

POST https://app.drchrono.com/api/lab_results
[
{
    "status": "F",
    "abnormal_status": "N",
    "document": 17836725,
    "is_abnormal": false,
    "lab_test": 156196635,
    "lab_order": 11104895,
    "normal_range": "70.0 99.0",
    "observation_description": "Total White Blood Cell Count",
    "observation_code": "26464-8",
    "test_performed": "2023-06-27T12:27:58",
    "unit": "5*3/l",
    "value": "7.1",
    "value_is_numeric": "True",
    "comments": "input comments"
},
{
    "status": "F",
    "abnormal_status": "N",
    "document": 17836725,
    "is_abnormal": false,
    "lab_test": 156196636,
    "lab_order": 11104895,
    "normal_range": "30.0 49.0",
    "observation_description": "Total X Cell Count",
    "observation_code": "26464-8",
    "test_performed": "2023-06-27T12:27:58",
    "unit": "5*3/l",
    "value": "3.1",
    "value_is_numeric": "True",
    "comments": "input comments"
}
]


Lab Webhook

The lab order API has a webhook for when the order was created, modified, and deleted. You can subscribe to those events from the API page (Account > API). 

Reference

https://app.drchrono.com/api-docs/#tag/Clinical/operation/sublabs_create

https://app.drchrono.com/api-docs/#tag/Clinical/operation/lab_orders_create

https://app.drchrono.com/api-docs/#tag/Clinical/operation/lab_documents_create

https://app.drchrono.com/api-docs/#tag/Clinical/operation/lab_tests_create

https://app.drchrono.com/api-docs/#tag/Clinical/operation/lab_results_create

https://app.drchrono.com/api-docs/#section/Webhooks