# CreateFromXml

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.CreateFromXml>

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

| Name           | Description                                                                                                                                                               |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Xml : `String` | <p>The input string containing a message in Xml format.</p><p><br>Default: <code>-</code><br>Example: <code>\<QRY\_R02 xmlns="urn:hl7-org:v2xml"> \</QRY\_R02></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>                                             |   |              |       |                                   |
| Hl7v2Message : `String` | <p>Message in Hl7v2 format.<br>Example: <code>MSH                                                                              |   | CohieCentral | COHIE | Clinical Data Provider</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-27

#### Added

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