Download presentation
Presentation is loading. Please wait.
1
JSON Web Service – Key Commands
Core SDK Training: JSON Web Service – Key Commands Welcome to CORE SDK Training. This is the second lesson about the JSON Web Service. This lesson will specifically cover a survey of the main commands you can use in the web service. If you have not already done so, you should complete the JSON Web Service Introduction lesson prior to starting this section.
2
Course Topics Sample and General Commands Container Commands
Experiment Commands Queue Commands File Commands In the previous lesson you learned how to access JSON code templates that you can incorporate into your own external applications. Here we will examine some of those code templates in detail so that you can better understand how to use them. Consult the documentation for a more comprehensive set of code templates. This lesson will just highlight key commands. These commands will be grouped by the Super Type that they operate on: Samples or any general entity type, containers, experiments, queues, and files. CONFIDENTIAL
3
Commands for Samples & General Entity Types
Get Gets a single record with attributes and associations for the LIMS Create inserts a new record in the LIMS requires EXECUTE_TRIGGERS in logicOptions Trigger context = ENTITY.ON_CREATE Tip: You will need to create sample and sample lot records separately. There is no automatic creation logic for lots and samples. Bulk-create inserts a set of new records in the LIMS Update updates a value of an existing record in the LIMS Trigger context = ENTITY.ON_UPDATE Note: SDK enforces non-editable fields for v5.2 and higher Query constructs and executes the SQL and returns entity Ids way to filter database for multiple records can query for records by sample, lot, and assay criteria under the sample query only published data that meets assay criteria will be returned only returns entity Ids, use Get to lookup more information ALL entity types will universally have 5 basic sdk commands that can be used in the web service: Get, Create, Bulk-create, update, and query. Samples and lots, which are frequently passed between the PFS and external systems also use these 5 basic commands. Since these commands are frequently used, let’s take a closer look at each of them. CONFIDENTIAL
4
(JSON Request & Response)
Sample/General Get (JSON Request & Response) The "Get" command is a straightforward lookup command. It gets a single record with all of its attribute and association values from the LIMS. Here is an example of the Get Command. For all of the slides in this lesson, the red text highlight key parameters and the green text represents an example value manually added to the request template. On the left side, you can see the GET request to Get a generic car entity type that would be displayed in the REST tool. You can see in the entityRef section that you can pass in either the name, entity ID or barcode of a record that you want to look up. If you manually type in the barcode 'Car22' in the REST tool, you can actually request data for a record that matches this request. On the right side is the Get Response. A record was found that matched the request and is being returned with all of the corresponding values: (The color of the car is red) and the corresponding associations (The Car_tire and Car Engine are empty fields.) CONFIDENTIAL
5
Sample/General Create (JSON Request & Response)
Create Request Create Response { "request": { "logicOptions": ["EXECUTE_TRIGGERS"], "data": { "entityTypeName": "CAR", "projectIds": "", "values": { "CI_CAR_COLOR": { "stringData": " Red" } }, "name": "", "associations": { "CAR_TIRE": [ "entityId": "", "barcode": "" ], "CAR_ENGINE": [ ] "locationId": 0, "typeParam": "CAR", "sdkCmd": "create", "responseOptions": ["CONTEXT_GET", "MESSAGE_LEVEL_WARN"] { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "CAR43", "entitySequence": 43, "entityTypeName": "CAR", "likedBy": 0, "values": { "CI_CAR_COLOR": { "stringData": "Red" } }, "entityTypeId": , "name": "CAR43", "associations": { "CAR_TIRE": [], "CAR_ENGINE": [] "active": 1 "success": true, "messages": [] Tip: Leaving the barcode blank will let the LIMS auto-assign the next barcode in the sequence The "Create" command inserts a single, new record into the LIMS. Be sure that you are working in your test system as you work with the REST tool since you are actually committing new records to your database. Remember that if you are working with samples and lots, you will need to create a record for samples and lots separately. There is no special automatic creation logic for samples or lots together at the same time. This slide is showing an example of a generic Create Request and Create Response for a Car entity type. The Rest Tool will automatically display all the attributes and associations that are configured for the entity type that you are creating in the Request template. If you add new configurations later, you will only need to update the JSON templates in your code if it is required to enter values for the new configurations you are adding. To create a new record, enter the values for any attributes and associations directly in the Request template. In this example, the new car will be red. If you want the system to automatically assign the next barcode in the sequence, be sure to leave the barcode reference blank. The Create Request command requires that the EXECUTE_TRIGGERS command be located in the logicOptions section of the code template. The REST tool will add this command in automatically so you do not need to worry about it if you copy the JSON template directly to your own code. If triggers are fired the command will trigger the execution of this action when the record is created. On the right hand side you can see the Create Response that was returned for this example. You can see the new barcode that was automatically generated, and all the information for the record including all attribute and association values you entered when you created the record will be displayed. CONFIDENTIAL
6
Entering Multiple Values
{ "request": { "logicOptions": ["EXECUTE_TRIGGERS"], "data": { "entityTypeName": "CAR", "projectIds": "", "values": { "CI_CAR_COLOR": { "stringData": " Red,Green" } }, "name": "", "associations": { "CAR_TIRE": [ "entityId": "", "barcode": “TRE1" "barcode": "" ], "CAR_ENGINE": [ ] "locationId": 0, "typeParam": "CAR", "sdkCmd": "create", "responseOptions": ["CONTEXT_GET", "MESSAGE_LEVEL_WARN"] Attributes just add values in string data parameter separated by a comma without spaces Associations need to repeat the template to enter parameters you need Just like in the standard user interface, multiple values can also be entered for attributes and associations when the new record is created. If an Attribute is configured to allow multiple values, simply add the values in the string data parameter, each separated by a comma without spaces. In this example, you can see the Red, Green values for the color attribute. If an Association can contain multiple values, repeat the template section to enter in each set of unique parameter values. Enclose each set in squiggly brackets and separate each with a comma. CONFIDENTIAL
7
Sample/General Bulk-Create (JSON Request)
Bulk-Create Request { "request": { "sdkCmd": "bulk-create", "data": { "bulkdata": [ "associations": { "CAR_TIRE": [ "name": "", "entityId": "", "barcode": "" } ], "CAR_ENGINE": [ ] }, "superTypeName": "TEST", "locationId": 0, "values": { "CI_CAR_COLOR": { "mandatory": 1, "stringData": "red" "entityTypeName": "CAR", "projectIds": "", "associations": { { "CAR_TIRE": [ "name": "", "entityId": "", "barcode": "" } ], "CAR_ENGINE": [ ] }, "superTypeName": "TEST", "locationId": 0, "values": { "CI_CAR_COLOR": { "mandatory": 1, "stringData": "green" "entityTypeName": "CAR", "projectIds": "", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" "typeParam": "CAR", "logicOptions": [ "EXECUTE_TRIGGERS" You will need to manually copy the template for each record to create The next command is the Bulk-create command. This command inserts a set of new records into the LIMS. The bulk-create command will allow for the creation of multiple records at the same time. However, the template does not know ahead of time how many records that you wish to create. To use this command in the web service, you will need to programmatically copy and paste the bits of template you need to enter all the values for each record that you want to create. It will look fairly similar to the Create template in that all the attributes and associations that are configured for that entity type will be displayed. You will need to bracket each record in the set with curly brackets and separate them by commas. CONFIDENTIAL
8
Sample/General Bulk-Create (JSON Response)
Bulk-Create Response { "data": { "bulkresponse": [ "response": { "entitySequence": 123, "associations": { "CAR_TIRE": [], "CAR_ENGINE": [] }, "likedBy": 0, "values": { "CI_CAR_COLOR": { "stringData": "red" } "entityTypeName": "CAR", "active": 1, "entityId": , "projectIds": " ", "followedBy": 0, "superTypeName": "TEST", "locationId": , "name": "CAR123", "entityTypeId": , "barcode": "CAR123", "superTypeId": "success": true, "messages": [] { "response": { "data": { "entitySequence": 124, "associations": { "CAR_TIRE": [], "CAR_ENGINE": [] }, "likedBy": 0, "values": { "CI_CAR_COLOR": { "stringData": "green" } "entityTypeName": "CAR", "active": 1, "entityId": , "projectIds": " ", "followedBy": 0, "superTypeName": "TEST", "locationId": , "name": "CAR124", "entityTypeId": , "barcode": "CAR124", "superTypeId": "success": true, "messages": [] ] Each record created will be returned The Bulk-Create Response will return all the information for each record that was created. It will basically look like the Create Response with several records concatenated together. CONFIDENTIAL
9
Sample/General Update (JSON Request)
Update Request Update Request cont. "associations": { "CAR_TIRE": [ { "name": "", "entityId": "", "barcode": "" } ], "CAR_ENGINE": [ ] }, "locationId": , "entityId": , "active": 1, "barcode": "CAR43", "entitySequence": 43 "typeParam": "CAR", "sdkCmd": "update", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "projectIds": " ", "values": { "CI_CAR_COLOR": { "stringData": “Green" } }, "name": "CAR43", The next command is the Update Command. The update command will update the value of an existing record in the database. Note that the web service does NOT enforce non-editable fields that are restricted for end users in the standard user interface. It is assumed that any external applications you are building will only update records when it is appropriate for your business rules. To perform an update using the REST tool, you will first need to specify which record you want to modify so that the tool can look up all the current data in the database. The Request template will therefore look very similar to a get or a create response since all the current attribute and association values will be displayed, but you will see the Update sdk command displayed. The Update command also requires the EXECUTE_TRIGGERS command to be set in the logicOptions section, but the REST Tool will automatically include that in the Request template. The EXECUTE_TRIGGERS will initiate any ON_UPDATE actions configured on the entity type. In this example, we see the current information for a car record (Car43) being displayed so that you can modify the existing values directly in the request template. In this case, we can manually change the color attribute from Red to Green and submit the response. CONFIDENTIAL
10
Sample/General Update (JSON Request)
Update Response { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "CAR43", "entitySequence": 43, "entityTypeName": "CAR", "likedBy": 0, "values": { "CI_CAR_COLOR": { "stringData": "Green" } }, "entityTypeId": , "name": "CAR43", "associations": { "CAR_TIRE": [], "CAR_ENGINE": [] "active": 1 "success": true, "messages": [] The Update Response will return all the attribute and association values after the modifications to the record were committed. Here we can see the record for CAR43 properly updated with the color of Green. CONFIDENTIAL
11
General Query (JSON Request)
Query Request { "request": { "logicOptions": [], "data": { "hasEventType": { "entityTypeName": "", "entityTypeId": "" }, "existsInLocation": { "locationRef": { "name": "", "entityId": "", "barcode": "" "locationQueryType": "" "values": { "CI_CAR_COLOR": { "parameterValue": "", "parameterOperator": "" } "existsInListRef": { "projectRef": { "associations": { "CAR_TIRE": [ { "name": "", "entityId": "", "barcode": "" } ], "CAR_ENGINE": [ ] }, "seq": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" "active": "1", "createdByEmployeeRef": { "createDate": { "entityTypeRefs": [ { "entityTypeName": "", "entityTypeId": "" } ], "comments": "" }, "typeParam": "CAR", "sdkCmd": "query", "responseOptions": ["MESSAGE_LEVEL_WARN"] Tip: Entering no filters is the equivalent to listing all records for the entity type The last generic command that we will focus on is the Query command. The query command allows you to enter query criteria from which the system will automatically construct and execute a SQL script that returns the appropriate Entity IDs of all matching records. The query command provides the user with a convenient way to filter the database for multiple records. The query command can be used for any entity type, but you can query for records by sample, by lot and by assay criteria under the sample query. When the query executes, it will only use data from published experiments for any assay criteria. The query command does NOT return the full information for all the records that met the criteria - it will only return entity IDs that can then be used with the 'Get' to look up more information in a separate step. This slide shows a General JSON query request for a car entity type. Just like the query page in the standard user interface you will see generic filters that apply to all entity types (such as the Project, created By or created date filters). You will also see filters for the attributes and associations that are configured specifically for that entity type (such as the car color or car tire filters in this example). In this example, none of the filters have values applied to the query. If no filters are applied to the query, the query Response will return ALL rows for the Entity Type, so in this case, ALL cars will be returned. CONFIDENTIAL
12
General Query (JSON Response)
Query Response { "data": { "entityIds": [ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " ] }, "success": true, "messages": [] } Tip: Use the Get Request to look up more information on the query hits The JSON query Response, only returns entity ID's, therefore in this example all cars in the database. You could then use the Get Request (that we discussed just a short time ago) to look at more information on the query hits. CONFIDENTIAL
13
Sample Query (JSON Response)
Query Request { "request": { "logicOptions": [], "data": { "sampleCriteria": { "hasEventType": { "entityTypeName": "", "entityTypeId": "" }, "values": { "SMILES": { "parameterValue": "", "parameterOperator": "" "MW": { "rangeTo": "", "parameterOperator": "", "rangeFrom": "" "PEPTIDE_STRUCTURE": { "FORMULA": { "CI_PEPTIDE_STRING": { “CI_CHEMELN_PURITY_PCT": { "parameterValue": "", "parameterOperator": "" } }, "existsInListRef": { "name": "", "entityId": "", "barcode": "" "projectRef": { "associations": {}, "seq": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" "active": "1", "createdByEmployeeRef": { "createDate": { Can search by lot attributes "entityTypeRefs": [ { "entityTypeName": "", "entityTypeId": "" } ], "comments": "" }, "querySortOrder": "", "returnTypeIsSample": "", "querySortAttribute": "", "lotCriteria": { "lotNum": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" "hasEventType": { "existsInLocation": { "locationRef": { "name": "", "entityId": "", "barcode": "" "locationQueryType": "" "projectRef": { A sample query request behaves just like the "General" request, and will allow you to search by Sample attributes, however, the sample query request will also allow you to search by lot attributes and assay attributes. These are labelled sampleCriteria, lotCriteria, and assayCriteria in the template. If there are any attributes that you want to query by, enter them directly into the request template and submit the request. In this example, we are looking for samples that have published area data in the XY assay1. CONFIDENTIAL
14
Sample Query continued (JSON Response)
Query Request cont. "createdByEmployeeRef": { "name": "", "entityId": "", "barcode": "" }, "values": { "SOURCE": { "parameterValue": "", "parameterOperator": "" "RECIEVED": { "parameterValue": "" } "existsInListRef": { "seq": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" "associations": {}, "active": "1", "createDate": { "comments": "", "entityTypeRefs": [ { "entityTypeName": "", "entityTypeId": "" } ] }, "assayCriteria": [ "grouping": "", "criteria": "", "singleData": true, "assayRef": { "name": "XY Assay 1", "entityId": "", "barcode": "" "criteriaOperator": "hasData", "attributeRef": { "attributeName": "area", "attributeId": "" "andOr": "AND" "typeParam": "PEPTIDE", "sdkCmd": "query", "responseOptions": [ "MESSAGE_LEVEL_WARN" Can search by assay data See previous slide notes. CONFIDENTIAL
15
Query Operators Data Type Attribute Query Operators
For query requests, you can fill in an appropriate operator and value before requesting a response Available operators will depend on the kind of query: Data Type Attribute Query Operators Assay Criteria Operators Numeric lessThan greaterThan Numeric or Boolean equals String like contains startsWith endsWith Any hasData When writing a query request through the JSON web service, you can typically enter both a value as well as any available operator. The available operator will depend on what you are querying for. One set of operators is used for general queries using attribute values. There is a slightly different set of operators available if you are querying samples by assay. A reference chart is shown here, with the various options. The operator of 'lessThan' will return any records with stored values that are lower than the query value. The operator of 'greaterThan' will return any records with stored values that are higher than the query value. The Operator 'equals' will return any records with numeric or Boolean values that are the equivalent to the query value. The operator 'like' will return any records with string values that are equivalent to the query value. The operator of 'contains' will return any records with stored values where the query value matches some fragment of the stored value. The operator 'startsWith' will return any records with stored values where the query value matches the starting fragment of the stored value. The operator 'endsWith' will return any records with stored values where the query value matches the ending fragment of the stored value. CONFIDENTIAL
16
Dates For queries or to enter data when updating/creating records, dates should be in ISO 8601 format Date only is YYYY-MM-DD or YYYYMMDD (for example, ) Date + time is YYYY-MM-DDThh:mm:ss (for example, T02:15:33) where T separates the date from the time Z can be used after the time section to specify a time zone For more details, see: When inputting date strings through the JSON web service, the date needs to be entered in a specific ISO 8601 format. This applies to entering date values to create or update records as well as to define queries. This date format requires the year should be specified first, (as four characters) followed by the month (using 2 numerical characters) and then the day. Hyphens may optionally be included as a separator. An example of this format is YYYY-MM-DD or YYYMMDD. If you want to include the time, add a capital T to separate the date from the time. The time can list hours followed by minutes and you can optionally add seconds, as well. For example: 3:33 on April 03, 2013 would enter as T15:33. The Time Zone can be added also, by simply adding a capital Z after the time section. For additional information on other ISO 8601 format requirements, please refer to the link below. CONFIDENTIAL
17
Make sure you are using the correct entity id!
Containers and Container Cells To support filling containers and transferring material between containers, there are extra commands and concepts for this super type Containers have their own unique barcode, name, and entity id (sometimes this is labelled the containerId in templates) All containers have one or more cells that can physically hold contents Each cell also has a unique entity id (called cellId in templates) Sometimes specific cells can be defined using the container reference (name, barcode or entity id of parent container) + the cell number (a number that describes the ordered position of the cell) Special SDK commands that access the container cells are found under the CELL Super Type in the REST tool Container contents can be referenced by the barcode, name, or entity id of the lot (sometimes this is labelled cellContentsId) Make sure you are using the correct entity id! Now that we understand the general commands that are available for all entity types, let’s take a look some special super types that have additional commands. In the previous lesson we learned that the ability to create and fill containers as well as transfer material between containers is supported through the JSON web service. Containers have some unique commands and concepts to support these actions. Container records will each have their own unique barcode, name, and entity id and you can use any of these 3 identifiers to refer to a specific record. In templates where there are many entity ids displayed, this particular entity id may be referred to as the containerId. Since the system supports both single well and multiple well containers like plates, every container also has one or more cells that physically hold the contents. Each of these cells within the parent container has its own unique entity id. This is generally referred to as the cellId in templates. In some cases (like when you do not know a specific cellId) you may opt to enter the cell number (which is simply a number that defines the position in the container) in combination with the name, barcode, or entity ID of the parent container. The cell number should be a number like 1,2,3 and NOT a mixed string like A2,A3, etc. When you are working with sdk commands that involve container cells (such as looking up a cell id or performing a transfer), then you can look under the CELL super type in the REST tool to access these templates. The CELL super type will be listed at the bottom of the list and is only for SDK purposes. It is not a real Super Type that you can configure and will NOT be displayed in the Main Admin Panel. No matter what container type you are using, you will use the Cell entity type underneath the Cell Super Type to access those templates. Also keep in mind that the contents of the containers (usually your sample lots) also have their own unique names, barcodes and entity ids. In templates these entity ids may be displayed as cellContentsId. When copying/pasting ids you should pay close attention to the label so that you are using the correct id. CONFIDENTIAL
18
Commands for Containers
Get gets a single record with container attributes and associations will return cell ids will return container contents (sample lots, amounts, and concentrations) Get-lineage returns the parent and child lineage information of a container Create inserts an empty container record in the LIMS requires EXECUTE_TRIGGERS in logicOptions Trigger context = ENTITY.ON_CREATE Update updates container attributes and associations for an existing record in the LIMS Trigger context = ENTITY.ON_UPDATE Note: SDK enforces non-editable fields for v5.2 and higher Now let’s take quick look at what commands are available for containers. The commands listed on this slide can be accessed under the Container super type in the REST tool. The 'Get' command will get a single container record with the container attributes and associations just like any other record. It will also return the cell ID's, container contents, along with sample lots, amounts, concentrations. The 'Get-lineage' command will return the parent and the child lineage information of the container. The 'Create' command and the ‘Update’ command are the same as the general commands we already discussed earlier. Note that this update command will only update general container attribute information – it does NOT update the container contents or amounts. CONFIDENTIAL
19
More Commands For Containers
Update-cell adds new container contents to empty containers (does NOT display current contents or overwrite existing contents) must enter a sample lot under lotRef must enter either a cellID or a containerRef with cellNum (if multiple wells) must enter amounts and concentrations (if liquid) and units Query can search for a container record by container attributes and associations returns entity Ids of container records only does NOT return container content or other container information To modify container contents you need to use the 'Update-cell' command which is only available under the Container super type. This command is primarily used to fill an empty container with sample lots. It does NOT display any pre-existing contents and if you have existing contents, the database will not commit your updates. Let’s take a quick look at this template. The container query allows you to filter by container attributes and associations only so it is not as useful as a sample query. Just like other query commands, the search will only return the container entity ID's and not the container content information. The ID's can be used to then query for additional information. CONFIDENTIAL
20
Commands For Container Cells
Get gets contents information from a cell ID or containerRef (for single well containers only) use Container Get to find cell IDs submit one cell per get command (no lists of cells) do not need to select container type in JSON tool (all container types should use Cell super type and Cell entity type) Transfer will transfer from source to destination containers requires cell ids (use Container Get to find cell IDs) container barcodes optional (still need source and destination cellRefs) destination container must be created previously requires you to specify transfer amount and concentration and units (if you are transferring solids enter -1 for an unknown concentration) There are 2 special commands under the special CELL super type: Get and Transfer. The get command is the same as for general entity types, but it will return cell IDs as well as entity Ids for the parent container and contents information. This is a useful way to look up the cell ID of a well in a container if you do not know it. You can only submit one cell ID at a time. The transfer command is used to transfer material from source to destination containers within the JSON Web Service. Let’s take a quick look at this template. CONFIDENTIAL
21
Container Get (JSON Request)
Get Request { "request": { "logicOptions": [], "data": { "entityRef": { "name": "", "entityId": "", "barcode": "FD2" } }, "typeParam": "4 DRAM VIAL", "sdkCmd": "get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_CONTAINER_CELL", "INCLUDE_CONTAINER_CELL_CONTENTS" ] The 'Get' command will get a single container record with the container attributes and associations just like any other record. CONFIDENTIAL
22
Container Get (JSON Response)
Get Response Get Response cont. { "data": { "cells": [ "amount": 0.5, "cellContents": [ "concentration": "10000", "lotName": "PD1-1", "lotId": , "cellContentsId": , "lotEntityTypeName": "PEPTIDE LOT", "concentrationUnit": "nM", "lotSuperTypeName": "SAMPLE_LOT", "lotBarcode": "PD1-1" } ], "cellNum": 1, "cellId": , "amountUnit": "mL", "containerId": "projectIds": "", "followedBy": 0, "entityId": , "locationId": , "barcode": "FD2", "entitySequence": 2, "entityTypeName": "4 DRAM VIAL", "likedBy": 0, "values": { "CONTAINER_FORMAT": { "stringData": "Single Well" }, "COMMENTS": { "stringData": "" "TEST_TARE": { } "entityTypeId": , "name": "FD2", "associations": {}, "active": 1 "success": true, "messages": [] The Container Get will also return the cell ID's, container contents, along with sample lots, amounts, concentrations. CONFIDENTIAL
23
Container Get-Lineage (JSON Request & Response)
Get-Lineage Request Get-Lineage Response { "request": { "logicOptions": [], "data": { "entityRef": { "name": "", "entityId": "", "barcode": "FD30284" } }, "typeParam": "CONTAINER", "sdkCmd": "get-lineage", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] { "data": { "parents": [ "projectIds": "", "followedBy": 0, "entityId": , "locationId": , "barcode": "FD2", "entitySequence": 2, "entityTypeName": "4 DRAM VIAL", "likedBy": 0, "values": { "CONTAINER_FORMAT": { "stringData": "Single Well" }, "COMMENTS": { "stringData": "" "TEST_TARE": { } "entityTypeId": , "name": "FD2", "associations": {}, "active": 1 ], "children": [] "success": true, "messages": [] Here is an example of a get-lineage request and response templates. To use this command, you would enter a container barcode into the request template and you should see all the information from any parent container records that material was originally transferred from or child containers that you transferred material into. These are marked as parents and children in the template. CONFIDENTIAL
24
(JSON Request & Response)
Container Create (JSON Request & Response) Create Request Create Response { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "entityTypeName": "4 DRAM VIAL", "projectIds": "", "values": { "COMMENTS": { "stringData": "" }, "TEST_TARE": { } "name": "", "associations": {}, "locationId": 0, "barcode": "" "typeParam": "4 DRAM VIAL", "sdkCmd": "create", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "FD30285", "entitySequence": 30285, "entityTypeName": "4 DRAM VIAL", "likedBy": 0, "values": { "CONTAINER_FORMAT": { "stringData": "Single Well" }, "COMMENTS": { "stringData": "" "TEST_TARE": { } "entityTypeId": , "name": "FD30285", "associations": {}, "active": 1 "success": true, "messages": [] The 'Create' command is the same as the general commands we already discussed earlier. CONFIDENTIAL
25
(JSON Request & Response)
Container Update (JSON Request & Response) Update Request Update Response { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "projectIds": "", "values": { "CONTAINER_FORMAT": { "stringData": "Single Well" }, "COMMENTS": { "stringData": "Test Comment" "TEST_TARE": { "stringData": "" } "name": "FD2", "associations": {}, "locationId": , "entityId": , "active": 1, "barcode": "FD2", "entitySequence": 2 "typeParam": "4 DRAM VIAL", "sdkCmd": "update", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] { "data": { "projectIds": "", "followedBy": 0, "entityId": , "locationId": , "barcode": "FD2", "entitySequence": 2, "entityTypeName": "4 DRAM VIAL", "likedBy": 0, "values": { "CONTAINER_FORMAT": { "stringData": "Single Well" }, "COMMENTS": { "stringData": "Test Comment" "TEST_TARE": { "stringData": "" } "entityTypeId": , "name": "FD2", "associations": {}, "active": 1 "success": true, "messages": [] The ‘Update' command is the same as the general commands we already discussed earlier. Note that this update command will only update general container attribute information – it does NOT update the container contents or amounts. CONFIDENTIAL
26
Container Update-Cell (JSON Request & Response)
Update-Cell Request Update-Cell Response { "request": { "logicOptions": [], "data": { "amount": "1", "concentration": "", "lotRef": { "name": "", "entityId": "", "barcode": "SM7-1" }, "amountUnit": "mg", "concentrationUnit": "", "cellRefs": [ "cellNum": "", "cellId": "", "containerRef": { "barcode": "FD30285" } ] "typeParam": "4 DRAM VIAL", "sdkCmd": "update-cell", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_CONTAINER_CELL_CONTENTS" { "data": { "cells": [ { "amount": 1, "cellContents": [ { "concentration": "", "lotName": "SM7-1", "lotId": , "cellContentsId": , "lotEntityTypeName": "SMALL MOLECULE LOT", "lotSuperTypeName": "SAMPLE_LOT", "lotBarcode": "SM7-1" } ], "cellNum": 1, "cellId": , "amountUnit": "mg", "containerId": } ] }, "success": true, "messages": [] } For this specific command, you must specify the sample lot under lotRef. To define which container you are putting your contents in, you must enter either the cell ID OR a containerRef with cellNum if multiple wells, along with the amounts and concentrations (if in a solution) and units. CONFIDENTIAL
27
Container Query (JSON Request)
Query Request Query Request cont. { "request": { "logicOptions": [], "data": { "hasEventType": { "entityTypeName": "", "entityTypeId": "" }, "existsInLocation": { "locationRef": { "name": "", "entityId": "", "barcode": "" "locationQueryType": "" "values": { "CONTAINER_FORMAT": { "parameterValue": "", "parameterOperator": "" "USE_STATE": { } "existsInListRef": { "projectRef": { "associations": {}, "seq": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" }, "active": "1", "createdByEmployeeRef": { "name": "", "entityId": "", "barcode": "" "createDate": { "entityTypeRefs": [ { "entityTypeName": "", "entityTypeId": "" } ], "comments": "" "typeParam": "BOTTLE", "sdkCmd": "query", "responseOptions": [ "MESSAGE_LEVEL_WARN" ] The ‘Query' command is the same as the general commands we already discussed earlier. CONFIDENTIAL
28
Container Query (JSON Response)
Query Response { "data": { "entityIds": [ , ] }, "success": true, "messages": [] } The ‘Query' command is the same as the general commands we already discussed earlier. CONFIDENTIAL
29
(JSON Request & Response)
Get Container Cell (JSON Request & Response) Get Request Get Response { "request": { "logicOptions": [], "data": { "cellRefs": [ "cellNum": "", "cellId": " ", "containerRef": { "name": "", "entityId": "", "barcode": "" } ] }, "typeParam": "CELL", "sdkCmd": "get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_CONTAINER_CELL_CONTENTS" { "data": { "cells": [ "amount": 0.4, "cellContents": [ "concentration": "10000", "lotName": "PD1-1", "lotId": , "cellContentsId": , "lotEntityTypeName": "PEPTIDE LOT", "concentrationUnit": "nM", "lotSuperTypeName": "SAMPLE_LOT", "lotBarcode": "PD1-1" } ], "cellNum": 1, "cellId": , "amountUnit": "mL", "containerId": ] }, "success": true, "messages": [] The get command is the same as for general entity types, but it will return cell IDs as well as entity Ids for the parent container and contents information. This is a useful way to look up the cell ID of a well in a container if you do not know it. You can only submit one cell ID at a time. CONFIDENTIAL
30
Transfer Container Cell (JSON Request)
Transfer Request { "request": { "logicOptions": [], "data": { "amount": "1", "concentration": "10", "destCellRef": { "cellNum": "", "cellId": " ", "containerRef": { "name": "", "entityId": "", "barcode": "" } }, "amountUnit": "uL", "srcCellRef": { "cellId": " ", "concentrationUnit": "uM" "typeParam": "CELL", "sdkCmd": "transfer", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_CONTAINER_CELL_CONTENTS" ] The transfer command is used to transfer material from source to destination containers within the JSON Web Service. Let’s take a quick look at this template. In the template you can see that you can specify either cell Ids OR the Container ref with the Cell number for both the source and destination containers. You can use the Container Get command to look up cell IDs if you need them. You are required to fill amount, concentration and unit values to commit the transfer. If you are transferring raw solids you can enter -1 for unknown concentrations. Unlike the standard user interface, you will need to precreate the destination container prior to performing the transfer. CONFIDENTIAL
31
Transfer Container Cell (JSON Response)
Transfer Response { "data": { "cells": [ "amount": 1, "cellContents": [ "concentration": "10000", "lotName": "PD1-1", "lotId": , "cellContentsId": , "lotEntityTypeName": "PEPTIDE LOT", "concentrationUnit": "nM", "lotSuperTypeName": "SAMPLE_LOT", "lotBarcode": "PD1-1" } ], "cellNum": 1, "cellId": , "amountUnit": "uL", "containerId": }, { "amount": 0.397, "cellContents": [ "concentration": "10000", "lotName": "PD1-1", "lotId": , "cellContentsId": , "lotEntityTypeName": "PEPTIDE LOT", "concentrationUnit": "nM", "lotSuperTypeName": "SAMPLE_LOT", "lotBarcode": "PD1-1" } ], "cellNum": 1, "cellId": , "amountUnit": "mL", "containerId": ] }, "success": true, "messages": [] Here is an example response after a completed transfer. CONFIDENTIAL
32
Experiment and Experiment Sample
To support adding samples, containers and data to experiments and publishing/unpublishing experiments SDK commands are under 2 main super types Experiments are where the meta data is stored for each set of sample lots that are tested together in one instance of an assay Templates relating creating/looking up/querying/publishing/unpublishing experiments are stored under this super type Experiment Samples is an automatic backend super type that stores the unique identifier for a sample lot associated to a specific experiment Templates related to creating/looking up/updating/adding expt data are stored under this super type Experiment Containers is also an automatic backend super type that stores the unique identifier for a container associated to a specific experiment Template for adding containers to an experiment is under the Experiment super type Adding containers to an experiment automatically creates experiment samples Now that we understand special commands for containers, let’s move on to see what commands are available for experiments. In the previous lesson we learned that you can add samples, containers, and data to experiments and you can publish or unpublish experiments using the JSON web service. To support these actions, the REST Tool has templates under 2 main super types: Experiments and Experiment Samples. Experiments are where the meta data is stored for each set of sample lots that are tested together in one instance of an assay. In the REST Tool you will find templates relating to creating/looking up/querying/publishing/unpublishing experiments stored under this super type. More experiment commands are also stored under the Experiment Sample super type. Experiment Samples is an automatic backend super type that stores the unique identifier for a sample lot associated to a specific experiment. In the standard user interface, users never need to explicitly create or work with these records. However, in the JSON web service you can use the templates to access these records more easily. Templates related to creating/looking up/updating/adding expt data are stored under this super type. Experiment Containers are very similar to Experiment Samples in that they are also automatically created when you attach a container record to an experiment. In fact, if you add a container to an experiment, the experiment sample records are also automatically created as well. However, the template for adding containers to an experiment is under the Experiment super type. We will take a closer look at that template shortly. CONFIDENTIAL
33
Commands for Experiments
Get gets an experiment record with attributes and associations from the LIMS returns assay, protocol, experiment sample ids, or experiment container ids returns experiment results (whether or not it is published) Create inserts an empty experiment record in the LIMS requires EXECUTE_TRIGGERS in logicOptions Trigger context = ENTITY.ON_CREATE Update updates experiment attributes and associations for an existing record in the LIMS only Trigger context = ENTITY.ON_UPDATE Note: SDK enforces non-editable fields for v5.2 and higher Update-experiment-containers adds a container (with its sample lots) to an experiment (will automatically create experiment sample barcodes) possible to add multiple containers by copying template triggers always fire regardless of logicOptions Trigger context = EXPERIMENT SAMPLE.ON_CREATE and EXPERIMENT.ON_EXPT_CONTAINER_UPDATE Now let’s look at some of the key commands relating to experiments. The 'Get' command, for Experiments, will get an experiment record, along with the experiment attributes and associations. It will also by default return the assay, protocol, experiment sample ID's, or experiment container ID's and experiment results. The 'Create' command will insert an empty experiment record in the LIMS just like any entity type. You will probably need to enter the associated assay and protocol. Remember that you can enter the assay or protocol name instead of the bar code. The 'Update" command is also very straightforward and works in the same way as we discussed for general entity types. It ONLY updates experiment attributes and associations for an existing record. It can NOT be used to add samples, containers or data to an experiment. The 'Update-experiment-containers' command will add a container, along with its sample lots, to an experiment. This will automatically create experiment sample barcodes. With this command, it IS possible to add multiple containers at a time, by simply copying the template portion as needed. Triggers will always fire, with this command, regardless of the logicOptions section, on any actions that are configured on the experiment entity type for sample.On_create and experiment.on_expt_container_update. CONFIDENTIAL
34
Commands for Experiment Samples
Note: Experiment Samples are a unique identifier for a sample lot in a specific experiment. You will need to create these for each experiment you add samples to. Adding a container to an experiment will create them automatically. Get returns any experiment data for experiment sample ids added to an experiment Create adds sample lots to an experiment record in the LIMS creates the experiment sample barcode and associates it to the experiment can only add one sample per request requires EXECUTE_TRIGGERS in logicOptions Trigger context = EXPERIMENT SAMPLE.ON_CREATE Update updates experiment samples associations for an existing experiment sample in the LIMS cannot remove experiment samples after created; change accept to false Trigger context = ENTITY.ON_UPDATE Update-experiment-sample-data adds data to experiment samples can only add data for one experiment sample per request any triggers will need to be fired manually Experiment Samples are a unique identifier for a sample lot in a specific experiment. These need to be created for each experiment you add samples to. In the standard user interface, these are automatically created when you add samples or containers to an experiment. In the SDK, there are two ways to create Experiment Samples. You can either explicitly create the experiment sample or add containers to an experiment to automatically create experiment samples directly using the 'Update-experiment-containers' command we just discussed under the Experiment super type. To explicitly create the experiment samples you can use the 'Create' command here under the Experiment Samples super type. The 'Update' command is used to update experiment samples associations for an existing experiment sample in the LIMS. Please note that you cannot remove experiment samples after they are created. If they need to be deleted, you can simply change the 'accept' value to 'false'. The 'Update-experiment-sample-data" command is the way to add data to experiment samples. You can add data for all attributes to one experiment sample per request. CONFIDENTIAL
35
More Commands for Experiments
Publish publishes an experiment record requires EXECUTE_TRIGGERS in logicOptions Trigger context = EXPERIMENT.ON_PUBLISH requires employee barcode Unpublish unpublishes an experiment record Trigger context = EXPERIMENT.ON_UNPUBLISH Query can search for an experiment record by experiment attributes and associations does NOT return experiment data for samples (use experiment get to look up data from experiment ids) use sample query to search by assay data to find specific sample ids that meet assay criteria The last few commands are back under the Experiment super type. The 'Publish' command is used to publish an experiment record. Enter the barcodes for the experiment (in the entityRef section) and the user who has entered or validated the data (employeeRef section). The 'UnPublish' command works exactly as the Publish command, the difference being the UnPublish command unpublishes an existing experiment record. Finally, the 'Query' command is used to search for an existing experiment record by entering values for its attributes and associations into the code template (such as searching by a protocol or an experiment date). If no values are entered into the code template, the response will return all experiment records for that experiment type. The 'Query' command does NOT return experiment data for samples. If this is desired, you must use the experiment GET command to look up the data from the returned experiment ID's. The sample Query can be used to search by assay data to find specific sample ID's that meet the assay criteria. CONFIDENTIAL
36
Experiment Get (JSON Request)
Get Request { "request": { "logicOptions": [], "data": { "entityRef": { "name": "", "entityId": "", "barcode": "XXY6" } }, "typeParam": "XY EXPERIMENT", "sdkCmd": "get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_EXPERIMENT_SAMPLE", "INCLUDE_EXPERIMENT_DATA", "INCLUDE_EXPERIMENT_CONTAINER" ] The 'Get' command, for Experiments, will get an experiment record, along with the experiment attributes and associations. It will also by default return the assay, protocol, experiment sample ID's, or experiment container ID's and experiment results. Let’s take a quick peek at the get request. The user can simply enter an experiment barcode to look up all the information on an experiment record. Notice in the response options that experiment samples, experiment data, and experiment containers are requested to be returned in the response. These options can be removed from your JSON request if you do not need this much information. CONFIDENTIAL
37
Experiment Get (JSON Response)
Get Response { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "XXY6", "entitySequence": 6, "experimentContainers": [], "entityTypeName": "XY EXPERIMENT", "likedBy": 0, "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "" "PUBLISHED": { "stringData": "true" } "entityTypeId": , "name": "XXY6", "associations": { "EXPERIMENT_PROTOCOL": [ "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" ], "EXPERIMENT_ASSAY": [ { "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" } ] }, "active": 1, "experimentSamples": [ "concentration": "", "experimentData": { "INJECTION_VOLUME": { "stringData": "10" "AREA": { "stringData": "1000" "projectIds": " ", "accept": true, "followedBy": 0, "entityId": , "locationId": , "barcode": "ES3321", "concentrationUnit": "nM", "entitySequence": 3321, "entityTypeName": "EXPERIMENT SAMPLE", "likedBy": 0, "timeMin": 10, "values": {}, "entityTypeId": , "name": "XXY6:100-1 Unknown:3321", "associations": { "DERIVES": [] }, "active": 1 } ] "success": true, "messages": [] Tip: Any stored experimental data will be retrieved – check if published parameter is set to true! Here is an example response that shows all the data in that experiment record. Be sure to check for the published flag since the JSON web service will return both published and unpublished data! It is recommended to programmatically filter out any unpublished data before you display them to users in your external applications. CONFIDENTIAL
38
Experiment Create (JSON Request)
Create Request Create Request cont. { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "entityTypeName": "XY EXPERIMENT", "projectIds": "", "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "" "PUBLISHED": { } "name": "", "associations": { "EXPERIMENT_PROTOCOL": [ { "name": "XY Protocol 1", "entityId": "", "barcode": "" } ], "EXPERIMENT_ASSAY": [ "name": "XY Assay 1", ] }, "locationId": 0, "typeParam": "XY EXPERIMENT", "sdkCmd": "create", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" Tip: You can use protocol and assay names instead of barcode The 'Create' command will insert an empty experiment record in the LIMS just like any entity type. You will probably need to enter the associated assay and protocol. Remember that you can enter the assay or protocol name instead of the bar code. CONFIDENTIAL
39
Experiment Create (JSON Response)
Create Response Create Response cont. { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": 0, "barcode": "XXY26", "entitySequence": 26, "entityTypeName": "XY EXPERIMENT", "likedBy": 0, "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "" "PUBLISHED": { } "entityTypeId": , "name": "XXY26", "associations": { "EXPERIMENT_PROTOCOL": [ { "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" } ], "EXPERIMENT_ASSAY": [ "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" ] }, "active": 1 "success": true, "messages": [] See notes for previous slide. This is the response. CONFIDENTIAL
40
Experiment Update (JSON Request)
Update Request Update Request cont. { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "projectIds": " ", "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "Test Dilution Comment" "PUBLISHED": { } "name": "XXY19", "associations": { "EXPERIMENT_PROTOCOL": [ "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" "EXPERIMENT_ASSAY": [ { "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" } ] }, "locationId": , "entityId": , "active": 1, "barcode": "XXY19", "entitySequence": 19 "typeParam": "XY EXPERIMENT", "sdkCmd": "update", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" The 'Update" command is also very straightforward and works in the same way as we discussed for general entity types. It ONLY updates experiment attributes and associations for an existing record. It can NOT be used to add samples, containers or data to an experiment. CONFIDENTIAL
41
Experiment Update (JSON Response)
Update Response Update Response cont. { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "XXY19", "entitySequence": 19, "entityTypeName": "XY EXPERIMENT", "likedBy": 0, "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "Test Dilution Comment" "PUBLISHED": { } "entityTypeId": , "name": "XXY19", "associations": { "EXPERIMENT_PROTOCOL": [ { "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" } ], "EXPERIMENT_ASSAY": [ "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" ] }, "active": 1 "success": true, "messages": [] See notes for previous slide. This is the response. CONFIDENTIAL
42
Experiment Update Container (JSON Request)
Update Request Update Request cont. { "request": { "logicOptions": [], "data": { "containerRefs": [ "name": "", "entityId": "", "barcode": "FD30296" }, "barcode": "FD30297" } ], "employeeRef": { "name": "", "entityId": "", "barcode": "EM21" }, "entityRef": { "barcode": "XXY26" } "typeParam": "XY EXPERIMENT", "sdkCmd": "update-experiment-containers", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN“ "INCLUDE_EXPERIMENT_CONTAINER" ] EntityRef barcode = the barcode of the experiment Tip: To add multiple containers to an experiment add a set of container values for each container (don’t forget to add a comma to separate sets!) Tip: You can also remove response options if you don’t need the information and want a less verbose response The 'Update-experiment-containers' command will add a container, along with its sample lots, to an experiment. This will automatically create experiment sample barcodes. With this command, it IS possible to add multiple containers at a time, by simply copying the template portion as needed. Triggers will always fire, with this command, regardless of the logicOptions section, on any actions that are configured on the experiment entity type for sample.On_create and experiment.on_expt_container_update. CONFIDENTIAL
43
(JSON Request & Response)
Experiment Sample Get (JSON Request & Response) Get Request Get Response { "data": { "concentration": "10000", "experimentData": { "INJECTION_VOLUME": { "stringData": "" }, "AREA": { } "projectIds": " ", "accept": true, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "ES3329", "concentrationUnit": "nM", "entitySequence": 0, "entityTypeName": "EXPERIMENT SAMPLE", "likedBy": 0, "timeMin": 0, "values": {}, "entityTypeId": , "name": "ES3329", "associations": { "DERIVES": [] "active": 1 "success": true, "messages": [] { "request": { "logicOptions": [], "data": { "entityRef": { "name": "", "entityId": "", "barcode": "ES3329" } }, "typeParam": "EXPERIMENT SAMPLE", "sdkCmd": "get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_EXPERIMENT_SAMPLE", "INCLUDE_EXPERIMENT_DATA" ] Need to know barcode of Experiment Sample (NOT sample-lot barcode) This is a standard lookup for samples that are associated to an experiment. CONFIDENTIAL
44
Experiment Sample Create (JSON Request)
Create Request Create Request cont. { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "concentration": "", "projectIds": "", "experimentRef": { "name": "", "entityId": "", "barcode": "XXY26" }, "accept": "", "locationId": 0, "barcode": "", "concentrationUnit": "", "entityTypeName": "EXPERIMENT SAMPLE", "values": {}, "lotRef": { "barcode": "SM102-1" "timeMin": "", "associations": { "DERIVES": [ { "name": "", "entityId": "", "barcode": "" } ] }, "typeParam": "EXPERIMENT SAMPLE", "sdkCmd": "create", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" Enter the barcode of the experiment and sample lot; Leave this barcode blank to let the LIMS generate an Experiment Sample barcode To explicitly create the experiment samples you can use the 'Create' command here under the Experiment Samples super type. Let’s take a quick look at this request template. In the experimentRef section you will need to enter the experiment barcode. In the lotRef section you will need to enter the barcode of the sample lot. You can only add one sample lot at a time to an experiment. You should leave the main barcode in the associations section blank so that the system will automatically generate that Experiment Sample barcode. When you are done, submit the request. It creates the experiment sample barcode and then associates it to the experiment. CONFIDENTIAL
45
Experiment Sample Create (JSON Response)
Create Response { "data": { "concentration": "", "projectIds": " ", "accept": true, "followedBy": 0, "entityId": , "locationId": , "barcode": "ES3331", "entitySequence": 3331, "entityTypeName": "EXPERIMENT SAMPLE", "likedBy": 0, "timeMin": -1, "values": {}, "entityTypeId": , "name": "XXY26:102-1 Unknown:3331", "associations": { "DERIVES": [] }, "active": 1 "success": true, "messages": [] } See notes for previous slide. This is the response. CONFIDENTIAL
46
Experiment Sample Data Update (JSON Request & Response)
Update-expt-sample-data Request Update-expt-sample-data Response { "request": { "logicOptions": [], "data": { "experimentData": { "INJECTION_VOLUME": { "stringData": “20" }, "AREA": { "stringData": “78" } }, "entityRef": { "name": "", "entityId": "", "barcode": "ES3332" } }, "typeParam": "EXPERIMENT SAMPLE", "sdkCmd": "update-experiment-sample-data", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_EXPERIMENT_DATA" ] } } { "data": { "concentration": "10000", "experimentData": { "INJECTION_VOLUME": { "stringData": "20" }, "AREA": { "stringData": "78" } "projectIds": " ", "accept": true, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "ES3332", "concentrationUnit": "nM", "entitySequence": 0, "entityTypeName": "EXPERIMENT SAMPLE", "likedBy": 0, "timeMin": 0, "values": {}, "entityTypeId": , "name": "ES3332", "associations": { "DERIVES": [] "active": 1 "success": true, "messages": [] Enter the experiment sample barcode in the JSON tool to look up current data The 'Update-experiment-sample-data" command is the way to add data to experiment samples. You can add data for all attributes to one experiment sample per request. Since this is a key template, let’s take a look at an example. These templates will vary depending on what attributes have been configured on the assay associated to the experiment. In this examples there is an injection volume and an area attribute that is collected in the experiment. Fill those values in for a specific sample lot. Note that for the Entity reference the barcode needs to be for the experiment sample – NOT the lot barcode. The response on the right will just confirm the data that was committed for that experiment sample. CONFIDENTIAL
47
Experiment Publish (JSON Request)
Publish Request { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "employeeRef": { "name": "", "entityId": "", "barcode": "EM21" }, "entityRef": { "barcode": "XXY27" } "typeParam": "XY EXPERIMENT", "sdkCmd": "experiment-publish", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] Enter the experiment barcode for entityRef; An employee reference is also required The 'Publish' command is used to publish an experiment record. Enter the barcodes for the experiment (in the entityRef section) and the user who has entered or validated the data (employeeRef section). CONFIDENTIAL
48
Experiment Publish (JSON Response)
Publish Response Publish Response cont. { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "XXY27", "entitySequence": 27, "entityTypeName": "XY EXPERIMENT", "likedBy": 0, "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "" "PUBLISHED": { "stringData": "true" } "entityTypeId": , "name": "XXY27", "associations": { "EXPERIMENT_PROTOCOL": [ { "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" } ], "EXPERIMENT_ASSAY": [ "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" ] }, "active": 1 "success": true, "messages": [] See description on previous slide. This is the response. CONFIDENTIAL
49
Experiment Unpublish (JSON Request)
Unpublish Request { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "employeeRef": { "name": "", "entityId": "", "barcode": "EM21" }, "entityRef": { "barcode": "XXY27" } "typeParam": "XY EXPERIMENT", "sdkCmd": "experiment-unpublish", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] Enter the experiment barcode for entityRef; An employee reference is also required The 'UnPublish' command works exactly as the Publish command, the difference being the UnPublish command unpublishes an existing experiment record. CONFIDENTIAL
50
Unpublish Response cont.
Experiment Unpublish (JSON Response) Unpublish Response Unpublish Response cont. { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "XXY27", "entitySequence": 27, "entityTypeName": "XY EXPERIMENT", "likedBy": 0, "values": { "DAEMONEVAL": { "stringData": "false" }, "SAMPLE_DILUTION": { "stringData": "" "PUBLISHED": { "stringData": “false" } "entityTypeId": , "name": "XXY27", "associations": { "EXPERIMENT_PROTOCOL": [ { "entityTypeName": "XY EXPERIMENT PROTOCOL", "name": "XY Protocol 1", "entityId": , "barcode": "ZXY1" } ], "EXPERIMENT_ASSAY": [ "entityTypeName": "XY ASSAY", "name": "XY Assay 1", "entityId": , "barcode": "XYA1" ] }, "active": 1 "success": true, "messages": [] See description on previous slide. This is the response. CONFIDENTIAL
51
Experiment Query (JSON Request)
Query Request { "request": { "logicOptions": [], "data": { "hasEventType": { "entityTypeName": "", "entityTypeId": "" }, "existsInLocation": { "locationRef": { "name": "", "entityId": "", "barcode": "" "locationQueryType": "" "values": { "DAEMONEVAL": { "parameterValue": "" "SAMPLE_DILUTION": { "PUBLISHED": { } "existsInListRef": { "projectRef": { "name": "", "entityId": "", "barcode": "" }, "associations": { "EXPERIMENT_PROTOCOL": [ { } ], "EXPERIMENT_ASSAY": [ "name": "XY Assay 1", ] "seq": { "rangeTo": "", "value": "", "rangeFrom": "", "operator": "" "active": "1", "createdByEmployeeRef": { "name": "", "entityId": "", "barcode": "" }, "createDate": { "rangeTo": "", "value": " ", "rangeFrom": "", "operator": "greaterThan" "entityTypeRefs": [ { "entityTypeName": "", "entityTypeId": "" } ], "comments": "" "typeParam": "XY EXPERIMENT", "sdkCmd": "query", "responseOptions": [ "MESSAGE_LEVEL_WARN" ] Finally, the 'Query' command is used to search for an existing experiment record by entering values for its attributes and associations into the code template (such as searching by a protocol or an experiment date). If no values are entered into the code template, the response will return all experiment records for that experiment type. The 'Query' command does NOT return experiment data for samples. If this is desired, you must use the experiment GET command to look up the data from the returned experiment ID's. The sample Query can be used to search by assay data to find specific sample ID's that meet the assay criteria. CONFIDENTIAL
52
Commands for Queues Get gets a queue record
returns contents of queue and queue member ID and details Create inserts an empty queue record in the LIMS you need to enter the entity id of the parent assay the queue is linked to (use get command on the desired assay) it is a good idea to enter a meaningful queue name or the LIMS will name the queue by the barcode Query can search for an queue record by queue attributes and associations returns only queue IDs – not queue member data Update updates queue attributes only see Queue-member-update command to change queue contents Now that we understand all the Experiment commands, let’s look at some of the queues templates. All of the queue commands can be found under the Queues super type in the REST tool. The 'Get' command simply returns a queue record. It returns the contents of the queue, along with the queue member ID and other details. Since you will probably not need to create queues that often, you may not need to use the Create command, but it works very similarly to templates that we discussed earlier for general entity types. The 'Query' command can search for a queue record by queue attributes and associations. It will return the queue ID's - not the queue members. The 'Update' command will update queue attributes only. If you are looking to update queue contents, you will need to use the Queue-member-update command. CONFIDENTIAL
53
Commands for Queues Queue-member-get returns details of queue member from queue member ID use queue get command to lookup a queue member ID Queue-member-add adds a new sample or lot to a queue requires you to fill in request date (ISO 8601 format) requires you to fill in a priority (0=low; 1=medium; all other numbers = high) Note: this number does not match the number displayed in the GUI requires queue, employee and project references possible to add multiple samples (with same employee/date/project/comment data) at same time by copying template Queue-member-update allows you to change the priority (0=low; 1=medium; all other numbers = high), project, comment or employee making a request of a queue member from a queue member ID allows you to “remove” a queue member by adding a fulfilled date (ISO 8601 format) requires employee and project references and priority Note: you should check the original data so that you do not overwrite it with incorrect data possible to update multiple samples (with same employee/date/project/comment data) at same time by copying template What makes queues a special entity type is the ability to add items to a queue and manage them as tasks. These commands provide that functionality. There is an entity id for each queue as well as a queue member id for each sample or lot that is added to a queue. You will need to use both of these ids to work with these templates. The 'Queue-member-get' command will return the details of the queue member from the provided queue member ID The queue member ID can be found using the Queue 'get' command to lookup the ID needed. The 'Queue-member-add' command will add a new sample or lot to a queue. Since this is a key template, let’s take a look at an example. The Queue-member-update command will allow you to update or change queue member data. You can update the priority, project, comments, or employee making the request. You can remove a queue member from the current open tasks by populating the fulfilled date. When making any updates check the original data first before you overwrite any original data. This command will allow you to update multiple samples with the same employee, date, project and comment data at the same time by copying the template as needed. CONFIDENTIAL
54
Queue Get (JSON Request)
Get Request { "request": { "logicOptions": [], "data": { "entityRef": { "name": "XY Assay 1 Queue", "entityId": "", "barcode": "" } }, "typeParam": "PRIORITIZATION QUEUE", "sdkCmd": "get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_QUEUE_MEMBER", "INCLUDE_QUEUE_MEMBER_ENTITY", "INCLUDE_QUEUE_MEMBER_REQUEST_EVENT", "INCLUDE_QUEUE_MEMBER_FULFILLED_EVENT" ] The 'Get' command simply returns a queue record. It returns the contents of the queue, along with the queue member ID and other details. CONFIDENTIAL
55
Queue Get (JSON Response)
Get Response "requestEventDate": " :00:00.0", "fulfilledEvent": {}, "requestEventId": " ", "queueMemberId": " ", "requestEventEmployeeName": "User, Demo", "fulfilledEventId": "0", "priority": "0", "memberBarcode": "PD1-1", "memberDisplayName": "PX4", "requestEvent": { "employeeId": , "projectIds": " ", "signed": false, "eval": 1, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "CE10248", "date": " :00:00.0", "instrumentId": , "entitySequence": 10248, "entityTypeName": "CREATION EVENT", "likedBy": 0, "values": {}, "entityTypeId": , "name": "CREATION EVENT 10248", "associations": {}, "active": 1, "protocolId": }, "memberId": , "memberName": "PX4" } ], { "data": { "queueMembers": [ "queueId": " ", "reason": "unknown", "entity": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "PD1-1", "lotSeq": "1", "entitySequence": 4, "sampleId": , "entityTypeName": "PEPTIDE LOT", "likedBy": 0, "values": { "SOURCE": { "stringData": "" }, "RECIEVED": { "stringData": "false" } "entityTypeId": , "name": "PX4", "associations": {}, "active": 1 "entityId": " ", "projectId": " ", "fulfilledEventEmployeeName": "", "fulfilledEventDate": "", "projectIds": " ", "followedBy": 0, "entityId": , "locationId": 0, "barcode": "PQ13", "entitySequence": 13, "parentId": , "entityTypeName": "PRIORITIZATION QUEUE", "likedBy": 0, "values": {}, "entityTypeId": , "name": "XY Assay 1 Queue", "associations": {}, "active": 1 }, "success": true, "messages": [] } See description on previous slide. This is the response. CONFIDENTIAL
56
(JSON Request & Response)
Queue Create (JSON Request & Response) Create Request Create Response You will need to enter the entity id of the parent assay { "request": { "logicOptions": [ "EXECUTE_TRIGGERS" ], "data": { "parentId": " ", "entityTypeName": "PRIORITIZATION QUEUE", "projectIds": "", "values": {}, "name": "XY Assay 1 Queue", "associations": {}, "locationId": 0, "barcode": "" }, "typeParam": "PRIORITIZATION QUEUE", "sdkCmd": "create", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ] } { "data": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": 0, "barcode": "PQ13", "entitySequence": 13, "parentId": , "entityTypeName": "PRIORITIZATION QUEUE", "likedBy": 0, "values": {}, "entityTypeId": , "name": "XY Assay 1 Queue", "associations": {}, "active": 1 }, "success": true, "messages": [] } If you don’t enter a name, the queue name will be the barcode This is the same as the general Create command discussed earlier. You will need to enter the id or name of the assay that should be linked if this is a prioritization queue. CONFIDENTIAL
57
Queue-member-get Request
Queue Member Get (JSON Request) Queue-member-get Request { "request": { "logicOptions": [], "data": { "queueMemberRefs": [ "queueMemberId": " " } ] }, "typeParam": "QUEUE", "sdkCmd": "queue-member-get", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_QUEUE_MEMBER_ENTITY", "INCLUDE_QUEUE_MEMBER_REQUEST_EVENT", "INCLUDE_QUEUE_MEMBER_FULFILLED_EVENT" Careful that you are entering the queueMemberId and NOT the memberId or queueId The 'Queue-member-get' command will return the details of the queue member from the provided queue member ID The queue member ID can be found using the Queue 'get' command to lookup the ID needed. CONFIDENTIAL
58
Queue-member-get Response
(JSON Response) Queue-member-get Response { "data": { "queueMembers": [ "queueId": " ", "reason": "unknown", "entity": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "PD1-1", "lotSeq": "1", "entitySequence": 4, "sampleId": , "entityTypeName": "PEPTIDE LOT", "likedBy": 0, "values": { "SOURCE": { "stringData": "" }, "RECIEVED": { "stringData": "false" } "entityTypeId": , "name": "PX4", "associations": {}, "active": 1 "entityId": " ", "projectId": " ", "fulfilledEventEmployeeName": "", "fulfilledEventDate": "", "requestEventDate": " :00:00.0", "fulfilledEvent": {}, "requestEventId": " ", "queueMemberId": " ", "requestEventEmployeeName": "User, Demo", "fulfilledEventId": "0", "priority": "0", "memberBarcode": "PD1-1", "memberDisplayName": "PX4", "requestEvent": { "employeeId": , "projectIds": " ", "signed": false, "eval": 1, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "CE10248", "date": " :00:00.0", "instrumentId": , "entitySequence": 10248, "entityTypeName": "CREATION EVENT", "likedBy": 0, "values": {}, "entityTypeId": , "name": "CREATION EVENT 10248", "associations": {}, "active": 1, "protocolId": }, "memberId": , "memberName": "PX4" } ] "success": true, "messages": [] See description on previous slide. This is the response. CONFIDENTIAL
59
Queue Member Add (JSON Request)
Queue-member-add Request Queue-member-add Request cont. { "request": { "logicOptions": [], "data": { "requestDateTime": " T11:23:00", "priority": "3", "projectRef": { "name": "General", "entityId": "", "barcode": "" }, "queueRef": { "name": "XY Assay 1 Queue", "employeeRef": { "name": "", "barcode": "EM21" "comment": "", "entityRefs": [ { "name": "", "entityId": "", "barcode": "PD2-1" } ] }, "typeParam": "QUEUE", "sdkCmd": "queue-members-add", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_QUEUE_MEMBER_ENTITY", "INCLUDE_QUEUE_MEMBER_REQUEST_EVENT", "INCLUDE_QUEUE_MEMBER_FULFILLED_EVENT" Copy the entityRefs section if you want to enter multiple samples at the same time (separate curly brackets with a comma) The 'Queue-member-add' command will add a new sample or lot to a queue. Since this is a key template, let’s take a look at an example. Here is an example of adding a lot to a prioritization queue. It requires that you fill in a request date. Remember all dates need to be entered in the ISO 8601 format as we learned earlier in the lesson. In addition to the request date, you are also required to fill in a priority. Enter a 0 for a low priority request or enter a 1 for a medium priority request. All other numbers will result in a high priority request. Please note that the number you are entering here does NOT match the number displayed in the priority field on the request page. This is an internal flag only. Along with the priority, you will also need to provide the queue, the employee associated with the queue, and the project reference. With the Queue-member-add command, you do have the ability to add multiple samples by copying the entityRefs section of the template code. Remember to separate each with curly brackets and a comma. Note that all additional samples added with the same template, however, will contain the same employee, date, project and comments. CONFIDENTIAL
60
Queue-member-add Response
(JSON Response) Queue-member-add Response "requestEventDate": " :23:00.0", "fulfilledEvent": {}, "requestEventId": " ", "queueMemberId": " ", "requestEventEmployeeName": "User, Demo", "fulfilledEventId": "0", "priority": "3", "memberBarcode": "PD2-1", "memberDisplayName": "PX2", "requestEvent": { "employeeId": , "projectIds": " ", "signed": false, "eval": 1, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "CE10701", "date": " :23:00.0", "instrumentId": , "entitySequence": 10701, "entityTypeName": "CREATION EVENT", "likedBy": 0, "values": {}, "entityTypeId": , "name": "CE10701", "associations": {}, "active": 1, "protocolId": }, "memberId": , "memberName": "PX2" } ] "success": true, "messages": [] { "data": { "queueMembers": [ "queueId": " ", "reason": "unknown", "entity": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "PD2-1", "lotSeq": "1", "entitySequence": 2, "sampleId": , "entityTypeName": "PEPTIDE LOT", "likedBy": 0, "values": { "SOURCE": { "stringData": "" }, "RECIEVED": { "stringData": "false" } "entityTypeId": , "name": "PX2", "associations": {}, "active": 1 "entityId": " ", "projectId": " ", "fulfilledEventEmployeeName": "", "fulfilledEventDate": "", See description on previous slide. This is the response. CONFIDENTIAL
61
Queue Member Update (JSON Request)
Queue-member-update Request Queue-member-update Request cont. { "request": { "logicOptions": [], "data": { "queueMemberRefs": [ "queueMemberId": " " },{ "queueMemberId": " ", }, ], "priority": "1", "projectRef": { "name": "General", "entityId": "", "barcode": "" "fulfilledDateTime": "", "employeeRef": { "name": "", "barcode": "EM21" "comment": "Test" }, "typeParam": "QUEUE", "sdkCmd": "queue-members-update", "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN", "INCLUDE_QUEUE_MEMBER_ENTITY", "INCLUDE_QUEUE_MEMBER_REQUEST_EVENT", "INCLUDE_QUEUE_MEMBER_FULFILLED_EVENT" ] } Copy the queueMemberId line if you want to update multiple samples at the same time (add commas between the curly brackets) The Queue-member-update command will allow you to update or change queue member data. You can update the priority, project, comments, or employee making the request. You can remove a queue member from the current open tasks by populating the fulfilled date. When making any updates check the original data first before you overwrite any original data. This command will allow you to update multiple samples with the same employee, date, project and comment data at the same time by copying the template as needed. CONFIDENTIAL
62
Queue-member-update Response
(JSON Response) Queue-member-update Response "fulfilledEvent": {}, "requestEventId": " ", "queueMemberId": " ", "requestEventEmployeeName": "User, Demo", "fulfilledEventId": "0", "priority": "1", "memberBarcode": "PD160-1", "memberDisplayName": "PD160-1", "requestEvent": { "employeeId": , "projectIds": " ", "signed": false, "eval": 1, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "CE10709", "date": " :23:00.0", "instrumentId": , "entitySequence": 10709, "entityTypeName": "CREATION EVENT", "likedBy": 0, "values": {}, "entityTypeId": , "name": "CE10709", "associations": {}, "active": 1, "protocolId": }, "memberId": , "memberName": "PD160-1" { "queueId": " ", "reason": "Test", "entity": { { "data": { "queueMembers": [ "queueId": " ", “comment": "Test", "entity": { "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "PD160-1", "lotSeq": "1", "entitySequence": 9, "sampleId": , "entityTypeName": "PEPTIDE LOT", "likedBy": 0, "values": { "SOURCE": { "stringData": "Internal" }, "RECIEVED": { "stringData": "true" } "entityTypeId": , "name": "PD160-1", "associations": {}, "active": 1 "entityId": " ", "projectId": " ", "fulfilledEventEmployeeName": "", "fulfilledEventDate": "", "requestEventDate": " :23:00.0", See description on previous slide. This is the response. CONFIDENTIAL
63
Queue-member-update Response cont.
(JSON Response continued) Queue-member-update Response cont. "priority": "1", "memberBarcode": "PD1-1", "memberDisplayName": "PX4", "requestEvent": { "employeeId": , "projectIds": " ", "signed": false, "eval": 1, "followedBy": 0, "entityId": , "locationId": 0, "barcode": "CE10248", "date": " :00:00.0", "instrumentId": , "entitySequence": 10248, "entityTypeName": "CREATION EVENT", "likedBy": 0, "values": {}, "entityTypeId": , "name": "CREATION EVENT 10248", "associations": {}, "active": 1, "protocolId": }, "memberId": , "memberName": "PX4" } ] "success": true, "messages": [] }", " "projectIds": " ", "followedBy": 0, "entityId": , "locationId": , "barcode": "PD1-1", "lotSeq": "1", "entitySequence": 4, "sampleId": , "entityTypeName": "PEPTIDE LOT", "likedBy": 0, "values": { "SOURCE": { "stringData": "" }, "RECIEVED": { "stringData": "false" } "entityTypeId": , "name": "PX4", "associations": {}, "active": 1 "entityId": " ", "projectId": " ", "fulfilledEventEmployeeName": "", "fulfilledEventDate": "", "requestEventDate": " :00:00.0", "fulfilledEvent": {}, "requestEventId": " ", "queueMemberId": " ", "requestEventEmployeeName": "User, Demo", "fulfilledEventId": "0", See description on previous slide. This is the response. CONFIDENTIAL
64
Commands for Files File-attach
creates a file entity with an uploaded file and links file entity to another entity Create creates a file entity with an uploaded file, but does not attach it to any other records Get fetches all the file entity attributes and associations Update updates file entity attributes or associations Query searches for file entities Bulk-create creates multiple file entities, but does not attach to any other records The final super type that has special templates for added functionality that we will examine is the File super type. You can now attach files to entities using the JSON web service. This involves both creating a file entity record to store a copy of the file and creating the association of the file record to the entity that the file should be attached to. The most direct command to accomplish this is the file-attach command. Let’s take a closer look at how this command works using the REST tool. CONFIDENTIAL
65
(JSON Request & Response)
File-Attach (JSON Request & Response) File-Attach Request File-Attach Response You will need to enter: targetEntityID: the entity ID of the record you want to attach the file to name: the name you want to call the file with a file extension targetAttributeName: if the file needs to be attached to a specific attribute put attribute name here { "request": { "sdkCmd": "file-attach", "data": { "targetEntityId": " ", "name": "SOPExampleFile.txt", "targetAttributeName": "", "fileContentTypeOverride": "" }, "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ], "typeParam": "FILE", "logicOptions": [ "EXECUTE_TRIGGERS" ] } { "data": { "entitySequence": 30, "associations": {}, "likedBy": 0, "values": {}, "entityTypeName": "FILE", "active": 1, "entityId": , "projectIds": " ", "followedBy": 0, "superTypeName": "FILE", "locationId": 0, "name": " SOPExampleFile.txt ", "entityTypeId": , "barcode": "FX30", "superTypeId": }, "success": true, "messages": [] } Name of file entity created Browse to the actual file on the REST Tool page before submitting request Barcode of file entity created File-Attach – In order to access the file–attach template, select the File super type in the REST tool. Next select the appropriate file entity type and then the file-attach command. Here is an example template. Just like in the standard interface, you can attach the file to the general entity as a whole or you can attach it to a specific attribute on the entity. If you want to just attach the file to the whole entity, you need to just fill out the target entity id of the record that you want to attach the file to. It is also a good idea to enter what you want to call the attached file (including the file extension) under the name field. If you leave this blank, the file name will be displayed as a sequence number in the system. The LIMS will NOT automatically assign the file name that you are uploading to the name of the file entity that you are creating. Once you have filled out this information in the REST tool, you can browse to the actual file you want to attach using the Blue File Chooser button at the bottom of the SDK page. When you see the uploaded file name displayed in the Chooser button, you can submit the request to the system. PFS will make a copy of the file and store it in the database. In the response you should see the name and barcode of the file entity that is created. You can also navigate to the object that you attached the file to in the standard user interface to verify that the file is attached as expected. If you want to attach the file to a specific attribute on your record, be sure to enter the name of the attribute that the link to the file will be displayed in the tarbetAttributeName section of the template. CONFIDENTIAL
66
(JSON Request & Response)
File Create (JSON Request & Response) Create Request Create Response You will need to enter the name you want to call the file with a file extension { "request": { "sdkCmd": "create", "data": { "name": "SOPEX.txt", "fileContentTypeOverride": "" }, "responseOptions": [ "CONTEXT_GET", "MESSAGE_LEVEL_WARN" ], "typeParam": "FILE", "logicOptions": [ "EXECUTE_TRIGGERS" ] } { "data": { "entitySequence": 28, "associations": {}, "likedBy": 0, "values": {}, "entityTypeName": "FILE", "active": 1, "entityId": , "projectIds": " ", "followedBy": 0, "superTypeName": "FILE", "locationId": 0, "name": "SOPEX.txt.1", "entityTypeId": , "barcode": "FX28", "superTypeId": }, "success": true, "messages": [] } This is the barcode of the file entity that was created Browse to the actual file on the REST Tool page before submitting request The File Create command just creates a file record in the database but it does not associate it to another object in the LIMS. See the file-attach command discussed earlier. CONFIDENTIAL
67
Special Note on File Uploads
In order to upload files through the LIMS SDK we use a request object with Content-Type set to multipart/form-data . At this point the LIMS will expect a submitted file entitles as "fileData" within the form, separate from the json object being passed into the LIMS. A Javascript Example: var form = new FormData(); form.append("json", myjson); form.append("fileData", file); http.send(form); Special Note on File Uploads In order to upload files through the LIMS API (without using the REST tool), you need to use a request object with the Content-Type set to multipart/form-data. The LIMS will then expect the submitted file entities as "fileData" within the form, but separate from the JSON object being passed into the LIMS. The slide shows an example of this javascript required for this. CONFIDENTIAL
68
Review Sample and General Commands Container Commands
Experiment Commands Queue Commands File Commands This chapter has looked in detail at how to use some general code templates (get, create, bulk-create, update, and query) that are available on most entity types, including samples and lots. We also looked at some templates that support key functionality for containers, experiments, queues, and files. If there is any information you would like to review, please go back through this lesson at this time. Thank you for investing your time in CORE SDK Training. CONFIDENTIAL
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.