{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/healthtensor/json-schema/healthtensor-patients-search-request-schema.json",
  "title": "PatientsSearchRequest",
  "description": "Request body for listing/searching patients.\n\nIf mrns is provided, only patients matching those MRNs are returned.\nIf regard_patient_ids is provided, only patients matching those UUIDs are returned.\nIf both are provided, both filters are applied (AND semantics via automed).\nIf neither is provided, all patients are returned (no filter).",
  "x-generated": "2026-12-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/healthtensor-openapi.json#/components/schemas/PatientsSearchRequest",
  "properties": {
    "customer_regard_id": {
      "type": "string",
      "title": "Customer Regard Id",
      "description": "Regard customer identifier (e.g., 'contoso')"
    },
    "mrns": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Mrns",
      "description": "Optional list of MRNs to filter by. If null/empty, returns all."
    },
    "regard_patient_ids": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Regard Patient Ids",
      "description": "Optional list of Regard patient UUIDs to filter by. If null/empty, no filter applied."
    },
    "analysis_status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "analyzed",
            "not-analyzed"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Analysis Status",
      "description": "Filter by analysis status. 'analyzed' returns only patients with at least one analysis run. 'not-analyzed' returns only patients without any analysis run. 'all' or null returns all patients."
    },
    "limit": {
      "type": "integer",
      "maximum": 100.0,
      "minimum": 1.0,
      "title": "Limit",
      "description": "Number of patients per page",
      "default": 50
    },
    "cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cursor",
      "description": "Cursor for keyset pagination"
    }
  },
  "type": "object",
  "required": [
    "customer_regard_id"
  ]
}