# Hl7v2

Frends offers seamless integration with [Hl7v2](https://en.wikipedia.org/wiki/Health_Level_7), enabling you to effortlessly connect and automate healthcare data flows that require reading and manipulating Hl7 messages.

Frends has tasks for performing all core Hl7v2 operations, supporting various versions and segment structures.

By leveraging Frends' task-based approach, you can configure and customize Hl7 integrations according to clinical workflows. Frends offers a wide range of tasks that facilitate integrations between Electronic Health Records (EHR), Laboratory Information Systems (LIS), and other medical platforms.

## Use cases

Below you will find typical use cases for Hl7v2 integrations and how they are implemented in Frends.

### Parse Hl7v2 and save data to SQL Server

By using the [`Hl7v2 ConvertToXml`](https://docs.frends.com/tasks/tasks/hl7v2/converttoxml) task, we can create an integration that receives incoming MLLP messages, validates patient data, and saves it in more redatable format.

<figure><img src="https://2096450325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FevBo49UTUjEN84O2WPl6%2Fuploads%2Fgit-blob-89cb099088a68e282b68fa781b1c0fedf595031a%2Fhl7-parse.svg?alt=media" alt=""><figcaption><p>Parse Hl7v2</p></figcaption></figure>

### Create Hl7v2 messages from predefined templates

By using the [`Hl7v2 ConvertToXml`](https://docs.frends.com/tasks/tasks/hl7v2/converttoxml) and [`Hl7v2 CreateFromXml`](https://docs.frends.com/tasks/tasks/hl7v2/createfromxml) tasks, we can create an integration that generates new Hl7 messages (such as ADT or ORM) based on existing templates or incoming Xml data from a web API.

<figure><img src="https://2096450325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FevBo49UTUjEN84O2WPl6%2Fuploads%2Fgit-blob-1812914458090ed3e88b6b88092cd8f8680c6020%2Fhl7-create-from-template.svg?alt=media" alt=""><figcaption><p>Create Hl7 from template</p></figcaption></figure>
