# 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`](/tasks/tasks/hl7v2/converttoxml.md) task, we can create an integration that receives incoming MLLP messages, validates patient data, and saves it in more redatable format.

<figure><img src="/files/bypj2oBFEOdzVo1hUfCo" alt=""><figcaption><p>Parse Hl7v2</p></figcaption></figure>

### Create Hl7v2 messages from predefined templates

By using the [`Hl7v2 ConvertToXml`](/tasks/tasks/hl7v2/converttoxml.md) and [`Hl7v2 CreateFromXml`](/tasks/tasks/hl7v2/createfromxml.md) 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="/files/ycM1enRlDWuHxo4PPJwQ" alt=""><figcaption><p>Create Hl7 from template</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.frends.com/tasks/tasks/hl7v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
