API Lab Interface Capabilities

DrChrono offers open APIs and webhooks for custom lab interfaces designed to streamline lab order management. Our lab APIs and webhooks can be reviewed here

While DrChrono does not have the ability to directly send lab orders to vendors, we provide alternative solutions to ensure smooth lab order processing.

Lab Ordering Methods

[IMPORTANT: These methods have to be paired with our Lab APIs to reflect the order -> result progression via patient chart]

Iframe Integration

Users can embed a lab vendor’s portal directly into the patient chart and clinical note pages using an iFrame. This method allows providers to place lab orders within DrChrono without needing to switch platforms, maintaining a seamless user experience.

When a doctor views your iFrame, the source URL will include various query parameters appended to it. For example, for the patient page, the src parameter of the iFrame will be:

<iframe_url>?doctor_id=<doctor_id>&patient_id=<patient_id>&practice_id=<practice_id>&iat=<iat>&jwt=<jwt>

These IDs can be used to enhance the user experience by making API calls to retrieve relevant data and prepopulate most of the lab order fields automatically.

Security Considerations for iFrame Integration:

  • X-Frame-Options: same-origin – Allows a page to be rendered in an iFrame only if the origin of the iFrame matches that of the page.

  • Referrer Policy: origin-when-cross-origin – For same-origin requests, the browser sends the full URL (origin, path, and query string). For cross-origin requests, only the document’s origin is sent.

  • Mixed Content Restrictions – If any resource from the lab vendor is served over HTTP instead of HTTPS, the browser will block the iFrame due to mixed content security policies.

Utilizing Task Center

DrChrono’s Tasks Center can be leveraged to track and manage lab orders efficiently. We offer both API and Webhooks.

Users can perform the following:

  • Create a category in the task center. Example: Lab Orders
  • Create a manual task entry for lab orders
    -> You can programmatically create a script or cron job to poll for tasks OR listen to the Task_Create webhook. For example:GET /api/tasks?since=yyyy-mm-dd&category=id
    -> A list of categories can be found in GET /api/task_categories
    -> Once the new order is obtained, push the order details back into DrChrono via POST /api/lab_orders. This will allow the doctor to view the order in the patient chart > Lab Orders.

This initial step can help begin the ordering process. You can create a 'Lab Results' category to inform the doctor or staff that the results are in. However, once you POST the lab_documents + lab_results on the same day we automatically send out a message to the provider from the Message Center. 

Faxing

DrChrono Faxing feature can be utilized to directly send to a lab vendor if the vendor allows faxes. It is a great alternative for minimal development work.

However, faxing directly from DrChrono comes with limitations as we do not support composing and sending messages through our fax line. Faxes have to be sent through the patient chart or referral. You can, however, compose a message, upload or scan it into DrChrono as a PDF document, and then send that as a fax.

For example, a lab order sheet is filled on a computer. You can upload it into the patient's chart > Documents. You can then fax the document to the vendor.

With the 'Faxing' alternative, you can keep it simple by bypassing the API and using the practice's fax number to send results.

Alternatively, instead of following the lab API sequence, you can post the lab results into the 'uploaded documents'. An example flow of this method can be.

  • The doctor sends out a fax
  • Once the fax is received, you can utilize the patient's name and other identifiers to prepare for the final results pdf.
  • Make a call to GET /api/patients?first_name=Joe&last_name=Turner&date_of_birth=yyyy-mm-dd
    -> A complete list of patient query parameters can be found here.
  • POST final result document
curl --location 'https://app.drchrono.com/api/documents' \
--header 'Authorization: Bearer 1234' \
--form 'date="2024-09-23"' \
--form 'description="Lab Result"' \
--form 'doctor="319108"' \
--form 'document=@"/Users/mac.book/Documents/output_105mb.dcm"' \
--form 'patient="103541179"' \
--form 'metatags="[\"Lab Results\"]"'

References

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

https://app.drchrono.com/api-docs-old/v4/documentation#iframe-integration

https://app.drchrono.com/api-docs/#tag/Practice-Management/operation/tasks_list

https://app.drchrono.com/api-docs/#tag/Practice-Management/operation/task_categories_list

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