# Search Orders

> Perform Search Orders through ClearPathMD.

Source: [https://genhealth.ai/docs/workflows/integrations/clear-path-md/clearpath_search_orders](https://genhealth.ai/docs/workflows/integrations/clear-path-md/clearpath_search_orders)

Integration: [ClearPathMD](https://genhealth.ai/docs/workflows/integrations/clear-path-md.md)

- Handler: `clearpath_search_orders`

- Connection type: `clearpathmd`

## Inputs

- `order_statuses` — Order Statuses (multi_select)
  Optional list of selected values.
  Options: Pending ("1"), Ready For Delivery ("2"), Completed ("3"), Incomplete ("4"), Archived ("5")
- `max_records` — Max Records (number)
  Optional numeric value.
  Default: `500`
- `sort` — Sort (text)
  Optional text value.
  Default: `"OrderID-desc"`
- `order_id` — Order Id (expression)
  Optional literal value or workflow expression.
- `patient_id` — Patient Id (expression)
  Optional literal value or workflow expression.
- `patient_first_name` — Patient First Name (text)
  Optional text value.
- `patient_last_name` — Patient Last Name (text)
  Optional text value.
- `practice_id` — Practice Id (expression)
  Optional literal value or workflow expression.
- `location_id` — Location Id (expression)
  Optional literal value or workflow expression.
- `provider_id` — Provider Id (expression)
  Optional literal value or workflow expression.
- `insurance_id` — Insurance Id (expression)
  Optional literal value or workflow expression.
- `from_order_date` — From Order Date (text)
  Optional text value.
- `to_order_date` — To Order Date (text)
  Optional text value.
- `hcpcs` — Hcpcs (text)
  Optional text value.
- `product_id` — Product Id (expression)
  Optional literal value or workflow expression.
- `item_type` — Item Type (expression)
  Optional literal value or workflow expression.

## Outputs

- `success` — Success
- `data` — Data
- `message` — Message
- `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": {
    "sort": {
      "type": "string",
      "default": "OrderID-desc",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "hcpcs": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "order_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "item_type": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "patient_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "product_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "location_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "max_records": {
      "type": "number",
      "default": 500,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "practice_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "provider_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "insurance_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "to_order_date": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "order_statuses": {
      "type": "array",
      "items": {
        "enum": [
          "1",
          "2",
          "3",
          "4",
          "5"
        ],
        "type": "string"
      },
      "description": "Optional list of selected values.",
      "x-workflow-field-type": "multi_select"
    },
    "from_order_date": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "patient_last_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "patient_first_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "data": {},
    "error": {},
    "message": {},
    "success": {}
  },
  "additionalProperties": true
}
```
