# ConvertToXml

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Hl7v2/tree/main/Frends.Hl7v2.ConvertToXml>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                    | Description                                                                                                       |      |            |            |              |              |                |   |         |     |   |                |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------- | ---- | ---------- | ---------- | ------------ | ------------ | -------------- | - | ------- | --- | - | -------------- |
| Hl7v2Message : `String` | <p>The input string containing a message in Hl7v2 format.</p><p><br>Default: <code>-</code><br>Example: <code>MSH | ^\~& | SendingApp | SendingFac | ReceivingApp | ReceivingFac | 20060228155525 |   | ADT^A01 | 123 | P | 2.3</code></p> |
| {% endtab %}            |                                                                                                                   |      |            |            |              |              |                |   |         |     |   |                |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                                                                                                                                |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LineEnding : `LineEnding`        | <p>Define the line ending of the output.</p><p>Possible values:</p><ul><li><code>LF</code>:</li></ul><p>Define the line ending of the output.</p><ul><li><code>CRLF</code>:</li></ul><p>Define the line ending of the output.</p><p><br>Default: <code>1</code><br>Example: <code>LineEnding.LF</code></p> |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                            |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                                                             |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                            |

{% tab title="Result: Result" %}

| Name                | Description                                                                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean` | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                             |
| Xml : `String`      | <p>Message in Xml format.<br>Example: <code>\<QRY\_R02 xmlns="urn:hl7-org:v2xml"> \</QRY\_R02></code></p>                      |
| Error : `Error`     | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| {% endtab %}        |                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[1.0.0] - 2026-02-26

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
