Skip to main content

Official Python SDK for the CXR SaaS API - Claim Reasoning Engine

Project description

CXR SDK

Official Python SDK for the CXR SaaS API - Claim Reasoning Engine.

Installation

pip install cxr-sdk

Quick Start

import asyncio
from cxr_sdk import CXRClient, CXRClientConfig

async def main():
    config = CXRClientConfig(
        base_url="https://api.cxr.cloud/v1",
        client_id="your-client-id",
        client_secret="your-client-secret",
    )
    
    async with CXRClient(config) as client:
        # Submit a claim
        submission = await client.submit_claim({
            "claimId": "CLM-001",
            "lines": [
                {"procedureCode": "99213", "billedAmount": 120.0, "paidAmount": 80.0}
            ]
        })
        
        # Wait for results
        result = await client.submit_and_wait(submission.jobId)
        print(f"Verdict: {result.verdict}")

asyncio.run(main())

Features

  • Automatic Token Renewal: Tokens are automatically refreshed before expiry
  • Bulk Operations: Submit and process multiple claims concurrently
  • Error Handling: Comprehensive error handling with retry patterns
  • Type Safety: Full type hints and Pydantic models
  • Async/Await: Built on async/await for high performance

Examples

See the examples/ directory for:

  • basic_quickstart.py - Basic claim submission workflow
  • bulk_submission.py - Bulk claim processing
  • error_handling.py - Error handling patterns
  • benchmark_analysis.py - Benchmark metrics analysis
  • sdk_demo.ipynb - Interactive Jupyter notebook

API Reference

CXRClient

Main client class for interacting with the CXR API.

Methods

  • submit_claim(claim_payload, *, idempotency_key=None) - Submit a single claim
  • submit_claims_bulk(claims, *, max_concurrent=10) - Submit multiple claims concurrently
  • get_claim(job_id) - Get job status
  • get_results(job_id) - Get claim results
  • submit_and_wait(job_id, *, interval=1.0, timeout=60.0) - Submit and wait for results
  • submit_and_wait_bulk(job_ids, *, interval=1.0, timeout=60.0, max_concurrent=10) - Wait for multiple jobs
  • get_benchmarks() - Get current benchmark metrics
  • get_benchmark_history(*, limit=None) - Get benchmark history

Requirements

  • Python >= 3.10
  • httpx >= 0.28
  • pydantic >= 2.5

License

Proprietary - CXR Labs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cxr_sdk-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cxr_sdk-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file cxr_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: cxr_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cxr_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58d1398973aa15fc3d5115e273207849127100c1630255d7f734998cebe595b6
MD5 83a7e53d94925951638e9cb6b19e9ee4
BLAKE2b-256 684055b24c80ff577b8c3a952be26bfc213922b0554df6fe728e00b4ffd26cc5

See more details on using hashes here.

File details

Details for the file cxr_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cxr_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cxr_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ae03bc4c3a090fceadb65b1b3bc4573fd772e63a26009ef42f97723209d82b3
MD5 3171fa6c1d5db57f23d96f26bdf9005e
BLAKE2b-256 fcc9b0ddd804c22d969c2f45c5b401196d59e9d7b4951cc149ad35526c14f3ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page