Open API
Rules

Search validation rules

Search and filter validation rules for the tenant.

**Use Case:** Retrieve validation rules to understand claim requirements or debug validation failures.

**Authentication:** API Key (X-API-Key header)
**Required Scope:** `rules:read`

**Search Parameters:**
- q: Search query (use "*" for all rules)
- scope: Rule scope - "tenant" (custom rules) or "system" (system rules)
- severity: Filter by severity - ERROR | WARNING | INFO
- status: Filter by status - ACTIVE | INACTIVE
- icd10: Filter rules applicable to specific ICD-10 diagnosis code
- icd9: Filter rules applicable to specific ICD-9 procedure code
- sex: Filter rules for specific patient gender (M/F)
- category: Filter by document category
- care_type: Filter by care type (Rawat Inap/Rawat Jalan)
- sort: Sort field (e.g., "created_at", "-priority")
- page: Page number (starting from 1)
- per_page: Results per page (max 100)

**Response Format:**
- rules: Array of validation rules
  - rule_id: Unique rule identifier
  - rule_code: Human-readable code
  - rule_name: Display name
  - description: Rule explanation
  - severity: ERROR | WARNING | INFO
  - status: ACTIVE | INACTIVE
  - condition: Validation logic
- pagination: Page metadata (total, current_page, per_page)

**Use Cases:**
- List all active ERROR rules before submitting claims
- Search rules by ICD code to understand specific diagnosis requirements
- Debug validation failures by finding rule details

**Example Request:**
```
GET /rules/search?q=*&scope=tenant&severity=ERROR&status=ACTIVE&page=1&per_page=20
```

**Example Response:**
```json
{
    "rules": [
        {
            "rule_id": "rule-uuid-123",
            "rule_code": "R-001",
            "rule_name": "Diagnosis Gender Match",
            "description": "Pregnancy diagnosis must match female gender",
            "severity": "ERROR",
            "status": "ACTIVE",
            "condition": {
                "if": "diagnosis.code starts with 'O'",
                "then": "patient.gender == 'F'"
            }
        }
    ],
    "pagination": {
        "total": 45,
        "page": 1,
        "per_page": 20,
        "total_pages": 3
    }
}
```

**Integration Tips:**
- Cache rules locally to avoid repeated queries
- Use scope=tenant to see only custom rules
- Filter by icd10/icd9 to understand diagnosis-specific requirements
- Use status=ACTIVE to see only enforced rules
get/api/v1/rules/search

Request

  • Base URL
    https://developer.claimmind.life (the document declares no server; this is the origin it was published from)
  • Auth
    none declared. Required headers: X-API-Key

Query parameters

qstring

Search query

scopestring

Rule scope (tenant or system)

severitystring nullable

Filter by severity

sexstring nullable

Filter by patient gender

statusstring nullable

Filter by status (ACTIVE/INACTIVE)

icd10string nullable

Filter by ICD-10 code

icd9string nullable

Filter by ICD-9 code

categorystring nullable

Filter by document category

care_typestring nullable

Filter by care type

documents_to_validatestring nullable

Filter by documents to validate

sortstring nullable

Sort field

pageinteger

Page number

per_pageinteger

Results per page

Headers

X-API-Keystring required

Response

Rules retrieved successfully

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.