# Integrating Clarity LIMS with Upstream Sample Accessioning Systems

This section discusses methods for integrating BaseSpace Clarity LIMS with upstream sample accessioning systems.

The following illustration shows a typical architectural overview:

<figure><img src="/files/lKeoeaB47YqRJy24jvM9" alt=""><figcaption></figcaption></figure>

### Creating a Sample in Clarity LIMS

**Required:**

* A sample must have a Name / ID
* A sample must be associated with a Case / Patient / Study / Project
* A sample must be associated with a Container (Tube / Plate etc)

**Optional (but expected):**

User-defined fields (UDFs)/custom fields (defined by your LIMS configuration)

Typical flowchart of actions within the broker:

<figure><img src="/files/OGYTMAk92DyaXoYgavmC" alt=""><figcaption></figcaption></figure>

The following animation illustrates the elements of an XML sample-creation message to Clarity LIMS.

<figure><img src="/files/S9w5hcgiyBhTynvZDETq" alt=""><figcaption></figcaption></figure>

### Common options for the broker

**Build your own:**

* Pro: Not too difficult
* Con: Stability as number of messages increases
* ?: Maintainable over the long-term

**Use a commercial / open-source offering (e.g. Mirth Connect)**

* Pro: Quicker than build
* Pro: Robust, multi-threaded support for millions of messages per day
* ?: May prove to be an excessive or over-complicated means to accomplish something relatively simple

**Does the broker need to carry out other business logic?**

For example, one customer added logic to their broker that dealt with medical billing and was able to distinguish between physicians ordering duplicate tests for a subject (not reimbursable, therefore the duplicate sample wasn’t submitted to Clarity LIMS), versus a temporal study that was reimbursable.

The best practice is to take advantage of as many legacy systems as possible, rather than creating samples in Clarity LIMS, then reinventing business logic to remove unwanted ones.


---

# 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://help.connected.illumina.com/clarity-lims/api-and-database/api-docs/tips-and-tricks/integrating-clarity-lims-with-upstream-sample-accessioning-systems.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.
