Skip to main content

TestProgramConditionRow

Reads one field of the lab test and checks it with operator against value.

  • A field can hold several values (for example product_category of a lab test with several products). is, isAnyOf and gt … lte match when any value matches; isNot and isNoneOf match when no value is one of the values given.
  • Texts are compared exactly, case included. A number is not equal to the same digits as text.
  • When the field has no value, only isEmpty matches. Every other operator, isNot and isNoneOf included, does not. To match "not X, or empty", put isNoneOf X and isEmpty in one group joined by or.
idstring

Optional. A problem found in this row names it as rowId.

Example: r1
field objectrequired

Which field the row reads. A system field is named by key alone; an additional field also needs entityType. A field that is not in the organization's field list is saved with the warning condition.unknown_field, and its row then matches only isEmpty.

keystringrequired

The field's key (see Fields on Update Test Program).

Example: product_category
fieldTypestringrequired

Possible values: [system, additional_field]

entityTypestring

Additional fields only: lab_test (Lab Test Additional Data), itm (Item), pdt (Style), mat (Material) or po (Purchase Order).

Possible values: [lab_test, itm, pdt, mat, po]

labelstring

Optional in the request; the backend writes the field list's label on save.

Example: Product Category
operatorstringrequired

Must be one the field offers (see Fields on Update Test Program); otherwise 400 (condition.parse, reason: operator_not_allowed).

OperatorMatches when the field …Value
is / isNotis / is not the valueone value
isAnyOf / isNoneOfis one / none of the valuesa non-empty list
hasAllOfhas every value (no Test Program field offers it today)a non-empty list
gt / gte / lt / lteis greater / greater or equal / less / less or equala number, or a date YYYY-MM-DD
isEmpty / isNotEmptyhas no value / has a valuenone: leave value out

Possible values: [is, isNot, isAnyOf, isNoneOf, hasAllOf, gt, gte, lt, lte, isEmpty, isNotEmpty]

value

Left out for isEmpty / isNotEmpty, one value for is, isNot and the comparisons, a non-empty list for isAnyOf / isNoneOf. Each value is plain ("S", 10000, "2026-01-01") or an option { "id", "label" }, of which only id is compared:

  • for a number field, a JSON number (10000, not "10000");
  • for a date field, a text YYYY-MM-DD;
  • for a choice field, the option id (lab_test);
  • for a taxonomy field (product_category, brand, …), the category's Custom ID;
  • for a text field, the exact text;
  • for an Organization field, always { "id", "label" } with id = a Local Organization ID (see Organization values under Fields on Update Test Program).

Fields on Update Test Program lists what each field holds, with a sample value.

A value of the wrong kind for the field is refused with 400 (condition.parse, reason: value_not_allowed). A choice the field does not list is saved with the warning condition.unknown_option.

Example: ["EU","UK"]
extraobject

A free object the rule engine ignores.

TestProgramConditionRow
{
"id": "r1",
"field": {
"key": "product_category",
"fieldType": "system",
"entityType": "lab_test",
"label": "Product Category"
},
"operator": "is",
"value": [
"EU",
"UK"
],
"extra": {}
}