# Medplum HL7 Lab Integration Bots
The bots in this directory demonstrate an example HL7v2 lab integration integration. These bots send and receive HL7 files through an SFTP server and can be automatically triggered by Medplum subscriptions.
For our purposes, we'll be focusing on two specific types of messages, the ORM and the ORU.
- **ORM (Order Message)**: These messages are used by healthcare providers to place an order for a lab test or procedure.
- **ORU (Observation Result Message)**: These messages are used to transmit the results of a lab test or procedure from the performing lab back to the ordering provider.
## Overview of Bots
1. **send-orm-message.ts**: This bot demonstrates how to send an HL7 ORM message to a third-party lab using Medplum and SFTP. This can be triggered when a new `ServiceRequest` resource is created in Medplum.
2. **receive-oru-message.ts**: This bot demonstrates how to read results from an HL7 ORU message using Medplum and SFTP. This can be triggered to be [run on a timer](https://www.medplum.com/docs/bots/bot-cron-job) to poll for results periodically.
3. **send-oru-message.ts**: This bot demonstrates how to send an HL7 ORU message from a DiagnosticReport and associated resources.
4. **receive-orm-message.ts**: This bot demonstrates how to parse an HL7 ORM message into ServiceRequest and associated Encounter, Practitioner, and Patient resources.