Skip to main content

redix-client

Python client for Redix Universal Healthcare Conversion API.

Version: 2.1.1 Repository: PyPI

Install

pip install redix-client

Quick Start

from redix_client import RedixClient

# Initialize client
client = RedixClient(
    base_url="https://demo.redix.com",
    api_key="YOUR_API_KEY"
)

# Health check
response = client.get("/")
print(response)  # {'status': 'healthy', 'version': '2.1.1'}

# List staging files
files = client.get("/api/v2/staging-files")
print(files)

# Upload a file to staging
result = client.post("/api/v2/staging/upload", files={
    "file": "/path/to/input.txt"
})

# Convert HL7 to FHIR
result = client.post("/api/v2/convert/hl7-to-fhir", files={
    "file": "/path/to/message.hl7"
})

API Methods

The client provides simple HTTP methods that work with any API endpoint:

Method Description
client.get(endpoint, params=None) GET request
client.post(endpoint, data=None, json=None, files=None) POST request
client.put(endpoint, data=None, json=None, files=None) PUT request
client.patch(endpoint, data=None, json=None) PATCH request
client.delete(endpoint, params=None) DELETE request
client.download(endpoint, dest_path) Download file

Examples

File Conversion (v1 API - Redix Engine)

# Convert with file upload
result = client.post("/api/v2/convert/file-upload",
    files={
        "Input_File": "/path/to/input.txt",
        "IFD_File": "/path/to/rules/835.ifd",
        "OFD_File": "/path/to/rules/835.ofd"
    },
    data={
        "Conversion_Flag": "e - UN/EDIFACT/RMap",
        "WarningLevel": 1,
        "User_Data": "0*\\**:*?"
    }
)

# View output file
output = client.get(f"/api/v2/view-file/output/{result['filename_base']}.out")
print(output['content'])

FHIR Conversions (v2 API)

# HL7 to FHIR
result = client.post("/api/v2/convert/hl7-to-fhir", files={
    "file": "/path/to/message.hl7"
})

# CDA to FHIR
result = client.post("/api/v2/convert/cda-to-fhir", files={
    "file": "/path/to/document.xml"
})

# HIPAA X12 to FHIR
result = client.post("/api/v2/convert/hipaa-to-fhir", files={
    "file": "/path/to/835.x12"
})

# Smart convert (auto-detect format)
result = client.post("/api/v2/convert/smart", files={
    "file": "/path/to/unknown_format.dat"
})

Batch Processing

# Start batch conversion
job = client.post("/api/v2/batch-convert/folder", data={
    "Input_Subfolder": "incoming",
    "Config_Profile": "835_to_rmap"
})
job_id = job["Job_Id"]

# Check status
status = client.get(f"/api/v2/batch-status/{job_id}")
print(status)

# List all batch jobs
jobs = client.get("/api/v2/batch-jobs", params={"Limit": 10})

File Operations

# Upload to staging
client.post("/api/v2/staging/upload", files={"file": "data.txt"})

# List staging files
files = client.get("/api/v2/staging-files")

# Delete from staging
client.delete("/api/v2/staging/myfile.txt")

# Download converted file
client.download("/api/v2/download-file/output/result.out", "./downloads/")

Admin Operations (v2 API)

# List users
users = client.get("/api/v2/admin/users")

# Create user
client.post("/api/v2/admin/users", json={
    "username": "newuser",
    "password": "secure123",
    "role": "user"
})

# Get statistics
stats = client.get("/api/v2/statistics")

# Get conversion history
history = client.get("/api/v2/history", params={"limit": 50})

Configuration

Environment Variables

export REDIX_API_URL=https://demo.redix.com
export REDIX_API_KEY=your-api-key

Then initialize without parameters:

client = RedixClient()

SSL Verification

For self-signed certificates in development:

client = RedixClient(
    base_url="https://localhost:8080",
    api_key="your-key",
    verify_ssl=False
)

Error Handling

from redix_client import RedixClient, RedixAPIError

client = RedixClient(base_url="https://demo.redix.com", api_key="your-key")

try:
    result = client.get("/api/v2/batch-status/invalid_id")
except RedixAPIError as e:
    print(f"Error {e.status_code}: {e.message}")

Documentation

License

MIT - Redix International, Inc.

Metadata

Release files for redix-client 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redix-client 2.1.1
File Size Uploaded
redix_client-2.1.1.tar.gz 28.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redix-client 2.1.1
File Interpreter ABI Platform
redix_client-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 56.9 kB

Release files / redix_client-2.1.1.tar.gz

Download URL redix_client-2.1.1.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84acd1dc9c34240c31ac2ba8396ca849ca7713d8c608f68655725cdff85b19fd
BLAKE2b-256 checksum
How to use checksums
25e5a1e5cbb1a2d70f9eeddcc6e6f13c08563eac5ca0b9bd92dc027ffa809943
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release files / redix_client-2.1.1-py3-none-any.whl

Download URL redix_client-2.1.1-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c28ca129edbf50d998faec6d271b34389e997fabe35031df6ecb8fa52ef22812
BLAKE2b-256 checksum
How to use checksums
76b9909e44b8725a99c3c5824f0f2a9361be467434e0a8bf1389ad4ff6361fe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

0.2.3

1 release file

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page