# Search Orders

> Perform Search Orders through NikoHealth.

Source: [https://genhealth.ai/docs/workflows/integrations/nikohealth/nikohealth_search_orders](https://genhealth.ai/docs/workflows/integrations/nikohealth/nikohealth_search_orders)

Integration: [NikoHealth](https://genhealth.ai/docs/workflows/integrations/nikohealth.md)

- Handler: `nikohealth_search_orders`

- Connection type: `nikohealth`

## Inputs

- `patient_id` — Patient Id (text)
  Optional text value.
- `require_patient_id` — Require Patient Id (boolean)
  Optional true-or-false value.
  Default: `false`
- `status` — Status (multi_select, dynamic options)
  Optional list of selected values. Retrieve allowed values from the dynamic options endpoint.
  Default: `["New"]`
- `lookback_hours` — Lookback Hours (number)
  Optional numeric value.
- `created_from` — Created From (expression)
  Optional literal value or workflow expression.
- `created_to` — Created To (expression)
  Optional literal value or workflow expression.
- `timezone` — Timezone (text)
  Optional text value.
  Default: `"America/Chicago"`
- `order_types` — Order Types (expression)
  Optional literal value or workflow expression.
- `page_size` — Page Size (number)
  Optional numeric value.
  Default: `50`
- `max_pages` — Max Pages (number)
  Optional numeric value.
- `record_limit` — Record Limit (number)
  Optional numeric value.
- `sort_expression` — Sort Expression (text)
  Optional text value.
  Default: `"CreatedDate DESC"`
- `exclude_tag_ids` — Exclude Tag Ids (expression)
  Optional literal value or workflow expression.
- `exclude_tag_names` — Exclude Tag Names (expression)
  Optional literal value or workflow expression.
- `hydrate_details` — Hydrate Details (boolean)
  Optional true-or-false value.
  Default: `false`
- `require_complete` — Require Complete (boolean)
  Optional true-or-false value.
  Default: `false`
- `default_on_error` — Default On Error (boolean)
  Optional true-or-false value.
  Default: `false`

## Outputs

- `success` — Success
- `orders` — Orders
- `count` — Count
- `excluded_by_tag_count` — Excluded By Tag Count
- `truncated_by_record_limit` — Truncated By Record Limit
- `pages_fetched` — Pages Fetched
- `truncated_by_page_cap` — Truncated By Page Cap
- `details_hydrated` — Details Hydrated
- `window_source` — Window Source
- `created_from` — Created From
- `created_to` — Created To
- `defaulted` — Defaulted
- `reason` — Reason
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `read`
- Confirmation recommended: no
- Retry safe: yes
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [
        "New"
      ],
      "description": "Optional list of selected values. Retrieve allowed values from the dynamic options endpoint.",
      "x-dynamic-options": true,
      "x-workflow-field-type": "multi_select"
    },
    "timezone": {
      "type": "string",
      "default": "America/Chicago",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "max_pages": {
      "type": "number",
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "page_size": {
      "type": "number",
      "default": 50,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "created_to": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "patient_id": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "order_types": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "created_from": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "record_limit": {
      "type": "number",
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "lookback_hours": {
      "type": "number",
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "exclude_tag_ids": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "hydrate_details": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "sort_expression": {
      "type": "string",
      "default": "CreatedDate DESC",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "default_on_error": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "require_complete": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "exclude_tag_names": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "require_patient_id": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "count": {},
    "error": {},
    "orders": {},
    "reason": {},
    "success": {},
    "defaulted": {},
    "created_to": {},
    "created_from": {},
    "pages_fetched": {},
    "window_source": {},
    "details_hydrated": {},
    "excluded_by_tag_count": {},
    "truncated_by_page_cap": {},
    "truncated_by_record_limit": {}
  },
  "additionalProperties": true
}
```
