How to Enable Automated Lab Orders and Results in OpenEMR Using Quest APIs

How to Enable Automated Lab Orders and Results in OpenEMR Using Quest APIs

Automating the entire laboratory order process is important to deliver healthcare faster. The result delivery in an EHR eliminates the need for paper requisitions, reduces manual data entry, and ensures that structured results appear in the patient’s chart. 

OpenEMR supports this through its Procedures subsystem and, since 2024, a Quest Quantum Hub module that communicates directly with Quest’s APIs. This post explains how OpenEMR handles lab workflows, reviews relevant HL7/FHIR standards, and walks through installing and configuring the Quest module.

How OpenEMR Handles Laboratory Orders

OpenEMR groups diagnostic tests and other procedures under a Procedures module. A procedure order is not just a lab test; it represents any medical act that records results. Storing results in a structured form is necessary for meaningful‑use compliance.

OpenEMR organizes procedures in up to three “tiers”. For in‑house labs, you manually build these tiers; for external commercial labs, you import the lab’s catalog rather than build your own.

  • When a provider places an order in the patient’s encounter, OpenEMR generates an HL7 v2 Order Message (OML) or uses a FHIR ServiceRequest, depending on the integration. 
  • When results are returned, they arrive as HL7 ORU messages or FHIR Observation/DiagnosticReport resources. 
  • OpenEMR imports these into the patient’s chart via Procedures → Electronic Reports. 
  • Users can also set up an HL7 provider to import results automatically – add the lab to the address book, select results only, and specify the filesystem or SFTP path; then process results via Procedures → Electronic Reports.

Related: Implementing e-Prescribing, Lab Interfaces, and Imaging Workflows in OpenEMR

Background: HL7 and FHIR in Lab Workflow

HL7 v2 ORU messages

More than 95 % of healthcare organizations still rely on HL7 v2 for lab interoperability. Observation Result (ORU) messages convey clinical observations, including lab results and imaging reports. 

These messages are organized into segments: 

  • The Message Header (MSH) identifies the sender and control IDs
  • Patient Identification (PID) carries patient demographics
  • Observation Request (OBR) details the requested test
  • Observation Result (OBX) contains the name, value, and units of each result
  • Patient Visit (PV1) records visit details. 

ORU messages are unsolicited but respond to a previous order (HL7 ORM/OML). They transmit lab results as soon as they are available.

FHIR resources for lab orders and results

FHIR uses small, reusable resources (Patient, Observation, ServiceRequest, etc.) to represent healthcare data. RESTful APIs allow systems to exchange these resources via standard HTTP verbs, and FHIR defines security mechanisms like OAuth 2.0 and SMART on FHIR to protect data. 

FHIR also provides service‑based workflows: the Task resource tracks assignments such as lab orders, while the ServiceRequest resource represents orders for tests or procedures.

In the lab context:

  • A ServiceRequest is created for each lab order. It references the patient and requested tests (LOINC codes) and may include specimens, encounter information, and order priority.
  • Quest exposes a LabResults API that returns results as FHIR Observation resources. Each Observation contains a code (LOINC), a numeric or qualitative value, units, reference ranges, and an interpretation. Bundles of Observations are associated with a DiagnosticReport summarizing the test.

Related: How to Overcome the Challenges of Lab Integration in OpenEMR

The Quest Quantum Hub Module

Quest Diagnostics introduced the Quantum Hub to replace older SFTP‑based file transfers with an API‑centric approach. The OpenEMR community developed a Quantum Hub module to communicate with these APIs. According to the official module documentation, the Quantum Hub module allows a bi‑directional or HL7‑results‑only interface with Quest; it integrates seamlessly with OpenEMR’s existing procedure interface and communicates with Quest through a series of API calls. 

When enabled in bi‑directional mode, the module automatically generates a requisition form for each order (you can disable this in the configuration). If you only need to receive results, the module can be configured for results‑only mode.

To use the module, you must sign up for Quest services at getmyinterface.com. The sign‑up form requires a vendor product ID and name (“Juggernaut Systems Express”) and the EHR name (“OpenEMR”). 

Quest uses this information to provision your Quantum Hub account and assign a Quest Hub ID (Juggernaut Systems Express), which you give to your Quest regional representative. Installation instructions in the module explain that the module communicates with Quest via API calls, auto‑generates requisition forms, and retrieves PDF results manually through the Quest portal.

4 Step‑by‑Step Guide to Enabling Automated Lab Orders

Step 1 – Obtain access to Quest’s Quantum Hub

  1. Navigate to getmyinterface.com and register your practice. Use Juggernaut Systems Express as the vendor name and product ID, and specify OpenEMR as your EHR.
  2. Provide practice details (NPI, CLIA number, address, and contact information). Quest will provision a Quantum Hub account and send API credentials (client ID/secret and Quantum Hub ID). You may need to sign a Business Associate Agreement and confirm compliance with HIPAA.
  3. Schedule a “turn‑up” call with Quest. According to the module’s README, Quest must activate the account before you enable the module.

Step 2 – Install the Quantum Hub module

  1. Backup OpenEMR. Always snapshot of your system before installing new modules.
  2. Clone the module into your installation. On your OpenEMR server, go to interface/modules/custom_modules and run (replace <token> with the access token provided by Quest):

    cd interface/modules/custom_modules

git clone https://<token>@github.com/juggernautseinc/oe-quest-lab-hub.git

cd oe-quest-lab-hub

composer install

  1. The repository includes a moduleConfig.php file where you will supply your Quantum Hub credentials and configure the module. The module auto‑generates requisition forms, and that PDF must be retrieved manually via Quest’s portal.
  2. Enable the module in OpenEMR: log in as an administrator, go to Modules → Manage Modules, find “Quest Quantum Hub” under unregistered modules, and click Register, Install, and Enable.

Step 3 – Configure the module

  1. Open the module settings (Modules → Quest Quantum Hub gear icon). Enter the client ID, secret, Quantum Hub ID, and base API URL (Quest provides separate URLs for testing and production).
  2. Choose Bi‑Directional or Results‑Only mode. In bi‑directional mode, the module posts lab orders via Quest’s API and retrieves results. In results‑only mode, it suppresses order creation but polls for results. You can also disable Auto‑generate Requisition if you want to supply your requisition forms.
  3. Set the Requisition File Path (a directory on your server for PDF requisitions) and the Results Path for storing incoming HL7 messages or FHIR bundles.
  4. Save the configuration and perform a test connection. The module will attempt to authenticate to Quest; verify that no errors appear.

Step 4 – Add Quest as a lab provider

  1. Go to Administration → Address Book and click Add New. Enter “Quest Diagnostics” as the company name, choose Service Provider, and supply the lab’s address, phone, NPI, and CLIA numbers.
  2. In Procedures → Providers, click Add New. Select the “Quest Diagnostics” address book entry. Choose Interface Type = Quest Quantum Hub if available; otherwise, for HL7 results imports, choose Protocol = results‑only and specify the filesystem or SFTP path where Quest will drop HL7 ORU files.
  3. Ensure the provider record includes your NPI; imported results will be matched to orders based on the ordering provider’s NPI.

Step 5 – Import Quest’s test catalog

Quest will supply a file containing its lab tests (LOINC codes, internal test codes, and names). Importing the catalog saves you from manually building the multi‑tier structure described in the Procedures tutorial.

  1. In OpenEMR, go to Procedures → Configuration.
  2. Use the Import feature (if provided by the module) to load Quest’s test catalog. Alternatively, you can create procedures manually: add a top‑level tier for each panel, mid‑level tiers for each test, and bottom‑level tiers for discrete results. Each procedure should have a Standard Code and an optional internal code.
  3. Assign appropriate units and reference ranges; these will be displayed when results are imported.

Step 6 – Place laboratory orders

  1. Create or open a patient encounter and click Procedures → Order Labs.
  2. Select Quest Diagnostics as the ordering provider. Choose the desired tests from the imported catalog. You can search by test name or LOINC code.
  3. Enter collection details (specimen type, priority, collection date/time) and confirm patient demographics and insurance.
  4. Click Submit Order. In bi‑directional mode, the module calls the ServiceRequest API to post the order. Behind the scenes, the module packages the order as JSON, including patient, encounter, and test details, and sends it to Quest. Quest returns an order identifier and generates a requisition PDF. The module can automatically download and attach this to the order.

CapMinds’ OpenEMR & Lab Integration Services

At CapMinds, we specialize in end-to-end digital health tech solutions that help healthcare providers streamline clinical workflows and deliver care faster. 

Our expertise in OpenEMR customization and integration ensures your EHR is optimized for seamless lab ordering and results delivery, from setup to automation.

Our Lab Integration Services include:

  • OpenEMR Customization & Integration – Tailored modules and workflows
  • Quest API Integration – Bi-directional or results-only automation
  • HL7/FHIR Interoperability – Standards-based data exchange
  • Custom Lab Workflow Automation – Reduce manual entry and delays
  • Multi-Lab Connectivity – Connect with multiple diagnostic partners

Whether you need full-scale lab automation with Quest or integration with other lab systems, CapMinds delivers secure, compliant, and scalable solutions. 

Let us help you eliminate paper processes, reduce errors, and accelerate patient care.

Empower your EHR with next-generation lab integration. Partner with CapMinds today.

Contact us

Leave a Reply

Your email address will not be published. Required fields are marked *