跳到主要内容
版本:v3

SLIM (Rest API)

Retrieve data from the Agilent SLIMS application, which serves as a comprehensive laboratory management solution.

Specific settings

Here are the details for configuring your connection:

  • URL: This is the address of the SLIMS application.
  • Port: Specify the port that the application is listening on.
  • Username: Provide the username used for authentication.
  • Password: Enter the password used for authentication.
  • Use proxy: Choose whether to route the request through a proxy.
  • Accept unauthorized certificate: Decide whether to accept certificates even if they are outdated or self-signed.

Item settings

In the South connector, each item can be configured to be queried according to the chosen scan mode. Multiple queries to the same database can be configured within the same South connector. OIBus will execute the queries one after another, prepare the output file, and then send it to North connectors.

Endpoint

The endpoint where to send the HTTP request, for instance /slimsrest/rest/Result/advanced.

Body and query params

The Body field supports JSON syntax and can utilize internal variables. These variables serve two primary purposes: ensuring data stream resilience in case of connection failures and breaking down large intervals into smaller chunks, thus reducing the load on both the server and the network (as explained in the big queries section).

The Query params field is structured as a key/value array and can also make use of the same interval variables.

查询变量

In OIBus, you can utilize the following internal variables that will be interpreted by the system:

  • @StartTime: Initially, the @StartTime variable is set to the date of the first execution of the query. When results are retrieved from the application, the @StartTime value is updated to the most recent timestamp among those results in the field used as a reference.
  • @EndTime: The @EndTime variable is set to either the current time (now()) or the end of the sub-interval if a query is split.
Body example with variables
{
"criteria": {
"operator": "and",
"criteria": [
{
"fieldName": "rslt_fk_status",
"operator": "equals",
"value": 14
},
{
"fieldName": "rslt_cf_pid",
"operator": "notNull"
},
{
"fieldName": "rslt_cf_samplingDateAndTime",
"operator": "notNull"
},
{
"fieldName": "rslt_modifiedOn",
"operator": "between",
"start": @StartTime,
"end": @EndTime
}
]
},
"sortBy": [
"rslt_modifiedOn"
]
}

日期时间字段

You can specify in this array which fields are a datetime type, and which format to use.

  • Field name: The field name in the HTTP payload result.
  • Reference field: Use this field as reference for the next @StartTime value (see query variables).
  • Type: The type of the data in the result.
  • Timezone (for string only): The timezone of the datetime stored in the database.
  • Format (for string only): The string format of the datetime retrieved.
  • Locale (for string only): The locale to use when the format contains locale specific string (such as MMM format for months).

For SLIMS, two datetime fields must be specified:

  • rslt_modifiedOn (used as reference): this field will be stored in the internal variable @StartTime for the next HTTP request
  • rslt_cf_samplingDateAndTime: this field is not used as reference but must be specified to be correctly parsed. It will be used as the timestamp of the value retrieved.

OIBus will internally use these dates in ISO UTC format. The output datetime format can be set in the serialization section.

CSV序列化

OIBus提供了将检索到的数据序列化为CSV文件的选项,并且您可以使用以下设置自定义序列化过程:

  • 文件名:结果将被存储的文件的名称。您可以使用若干内部变量,如@ConnectorName(连接器的名称)和@CurrentDate(当前日期,格式为yyyy_MM_dd_HH_mm_ss_SSS - 这与序列化的日期时间格式不相关,用于日期时间字段)。
  • 分隔符:CSV中使用的分隔符。
  • 压缩:选择是否使用gzip压缩文件。
  • 输出日期时间格式:指定CSV中的日期时间格式。OIBus将仅转换指定的日期时间字段。在输出文件名中使用的@CurrentDate变量不会受到影响。
  • 输出时区:用于存储日期时间的时区。

拆分大型查询

在请求大时间间隔时,特别是当使用@StartTime@EndTime查询变量可能对服务器造成显著负载的情况下,您可以将查询拆分为若干个具有更小间隔的子查询。这可以通过配置历史设置中的最大读取间隔字段来实现。