---
title: "Importing v3.0.3"
canonical: "https://servicedesk.maxgeo.com/space/DS/1437204510/Importing+v3.0.3"
format: markdown
---
> Macro (toc)

To import a lab assay result file into the normalised assay system in DataShed5 an import layout must be created. This will allow the header information to be appended to the Batch and Batch Details tables and create a normalised data structure for the assay results.

DataShed5 supports SIF (space delimited, fixed width text file) and CSV laboratory files. The Import Layout allows all data to be captured including the lab meta data and all associated analytical information.  The lab metadata from the header is stored in the **Assay Batch** and **Assay Batch Details** tables and the results are normalised and imported into the **Incoming Assay Data **table prior to being validated.

** Required Data:**

**AssayResult:                      the results reported**

**Batch_No:                            the lab reference number**

**LabElement:                       the analytical element code used by the lab**

**OrigMethod:                       the analytical method used by the lab**

**Sample ID:                          the sample number**

**UnitCode:                            the unit each element is reported in**

** **

*Recommended Data*

*Lab_Job_Date:                     the date the lab processed the assays (NB this is required for QAQCr batch selection)*

*Lab_Received_Date:         the date the lab received the assays*

*LimitLower:                          the lower detection limit of the analytical method*

*SourceFile:                           the file name*

*LimitUpper:                          the upper detection limit of the analytical method*

 

Additional Data

Dispatch_No:                       the reference dispatch number

Preparation:                         the preparation used for analysis

SampleCount:                     the number of samples from the lab file

![image-20241008-033131.png](media://474048cb-8b45-4ca6-a3e1-593f88b04471)

# Creating CSV Import Layout

## **Step One:  Create New Layout**

- Click on the **Import Data** menu item then click on the **Import Layout Configuration** button and click on the **+ Add New Layout** button.

![image-20241008-033220.png](media://aa3c84b3-a448-4fd2-8794-032497c3e8d4)

![image-20241008-033233.png](media://0f9327d5-a665-4933-b5d4-693d4306f407)

![image-20241008-033238.png](media://cbe0cc4f-e766-4592-972b-52163b2a64f2)

- Give the new Layout a logical name, i.e. Lab_CSV.
- Select the Laboratory supplying the results from the Laboratory drop down list.   
It is advisable to generate a new Layout and Import Mask for each laboratory.  
If an assay file is from a new lab, the lab must be added to the Lab library table in Assay Manager prior to the import layout being created.
- Post Import Action is blank by default.
- The Process Scheme is configured through the Assay Management Setup and is usually as Default.
- Tick the Normalised box if the data is to be imported into a database with a normalised assay management system.
- Click **Save**

## **Step Two: File Type/Mask Setup**

- Setting up the File Type and Mask allows the import layout to be configured to files with different layouts. Each Layout is linked to a lab code.
- Select the **Import Type/Mask** format from the drop down list. The description is viewed in the drop-down list.  If the File type is not listed, click the **Import File Type List** and add a new file type. For a SIF import** **file, select the basic_type as MASK.  The details_row is the row number where the actual results start. The details_row may be left blank and DataShed5 will populate this field when the file format is captured.

![image-20241008-033352.png](media://a4c4c4c6-4d72-4b11-8d85-ed0af192e788)

- Click the **Buffer** **Modifications** button and set the Destination Table Name. It is required to be a normalised assay table such as tblAssay or tblSYSAssIncomingData.
- The Assay File Format Editor and Check Config buttons will appear.  It is important to select a base table name for all assay Import Layouts. Recommend always using a new import file type for a new assay import layout unless it is known to be exactly the same format as an existing layout

![image-20241008-033503.png](media://353515ac-0f0f-4655-8a4f-b51009da2a3f)

## **Step Three: Assay File Format Editor**

Click the Assay File Format Editor button and click on the **Select File** button to locate the assay file to base the import layout on.

![image-20241008-033527.png](media://065af3db-3074-4b31-b8b9-12ee1190b983)

The CSV file data will appear in the viewing window.

In the Layout Definition, go to the **Data Item **drop down list. Select an item and highlight the item.  Make sure to highlight field as wide as possible to allow for longer records in subsequent files

 As each selection is made the item data chosen, line, column and length will be completed.  
Selecting a new Data Item will save the previous item details.

**NOTE: Only the first column of results and element metadata needs to be swiped as subsequent elements are automatically read.**

- Select Read from file as the **Data Source.**
- If a Data Item is not required select Not Used from the **Data Source** drop down list.

**Example of Data Items**

![image-20241008-033611.png](media://e87d9368-7cd2-4abf-bdf7-c13bd89a1ebe)

**Lab Job Date**

Any dates require their format to be defined. The date format is selected from the drop down list.

![image-20241008-034105.png](media://f989c0f7-d0ba-498d-b4b8-15aa1a3e50c8)

If only one date is present in a file, select the data item Lab Job Date.  This allows the QAQCR program to select the batch. If this field is null, QAQCR will not be able to select the batch number. 

**Sample ID**

![image-20241008-034127.png](media://642fc97e-a44a-470e-9d57-27800e71cf04)

**Unit Code**

![image-20241008-034202.png](media://4f3b06a6-c23d-4400-a288-d6a3eafd099f)

![image-20241008-034240.png](media://eb2d6764-cf04-4bb9-81ba-85cb6e06ecaf)

**Substitution**

Substitution allows for the translation of a non-numeric code into a numeric code. For example ‘X’, or ‘<’ or ‘–‘ can be used to represent below detection values and will be treated as below detection limit (BDL) on import.

Substitution values can be added using the **Substitution** button and there must be one entry for each Scheme Name.

Symbols used by each lab for substitution can be entered and given a substitution value or sysAssayStatus if required. 

Make sure that when a substitution symbol is entered, it is followed by the * symbol, especially if ‘-‘ is used. If a lab uses the ‘–‘ symbol for a null value, then DataShed5 will interpret this as a less than detection limit and not a null value.

![image-20241008-034307.png](media://f5132246-fc53-4bde-ac13-999596b6f7e0)

**BDL:**  Below Detection. The sysResult will be calculated as 0.5*LLD or -1*LLD.

**OR:** Over Range. When a result is analysed at the upper range of the analytical method, the Upper detection limit is required to be reported by the laboratory.

**UP**:  Update – A substitution value is needed in the Subst_Value

**DEL:**  Delete – Delete the assay result from the incoming assay data.

**NOTE: At least one substitution value must be entered for each Import Layout. In a flat system DataShed5 will update the sysResult to the substitution value.**

**Validate**

The validate button will check if all the Data Items have been selected.

## **Step Four**

Click on **Check Config** tab and check the configuration of the new layout. This will check that all the required information is populated in the layout but it **will not** check the file format against the import layout.

When the import layout is completed, the assay file may be imported in DataShed5 using the Import Data option.

![image-20241008-034712.png](media://dc7bda7e-d8e9-4925-8c02-8daa26b7ee28)