Crelio Health & Hubble Integration Guide

This document provides comprehensive integration documentation for Crelio Health (Lab Services) and Hubble (FITCOIN Wallet) integrations with the Azodha Platform API.

Table of Contents

  • Overview

  • Crelio Health Integration

    • Configuration

    • Patient Registration

    • Lab Appointment Booking

    • Webhook Processing

    • API Endpoints

  • Hubble Integration

    • Configuration

    • FITCOIN Operations

    • API Endpoints

  • Error Handling

  • Security Considerations

  • Examples

Overview

The Azodha Platform provides seamless integration with:

  1. Crelio Health: Lab services integration for patient registration, appointment booking, and automated lab result processing

  2. Hubble: FITCOIN wallet integration for wellness rewards and digital currency management

Both integrations follow the platform's standard patterns for external service integration, including webhook processing, error handling, and data synchronization.

Crelio Health Integration

Crelio Health integration enables automated lab services including patient registration, appointment booking with billing, and real-time lab result processing through webhooks.

Configuration

Required Environment Variables

Integration Setup

  1. Organization Integration Configuration:

  2. Required Integration Attributes:

    • apiKey: Crelio Health API key for authentication

    • organizationIdLH: Lab organization identifier in Crelio Health system

Invoice Item Configuration

For lab booking, invoice items must include specific Crelio Health attributes:

Patient Registration

Process Flow

  1. Patient Registration: Automatically registers patients in Crelio Health when they are created in the platform

  2. External ID Mapping: Maps platform consumer UUID to Crelio Health patient ID

  3. Data Synchronization: Ensures patient data consistency between systems

API Integration

Endpoint: POST /patientRegister/{apiKey}/

Request Payload:

Response:

Lab Appointment Booking

Process Flow

  1. Invoice Creation: Lab appointment is created with associated invoice

  2. Patient Validation: Verifies patient exists in Crelio Health system

  3. Bill Registration: Registers lab bill with Crelio Health

  4. Appointment Scheduling: Schedules lab appointment

  5. External ID Mapping: Maps invoice and appointment IDs between systems

API Integration

Endpoint: POST /LHRegisterBillAPI/{apiKey}/

Request Payload:

Response:

Webhook Processing

Crelio Health sends webhooks for lab results and observations. The platform processes these automatically.

Lab Report Webhook

Endpoint: POST /webhook/labs/reports

Webhook Payload:

Processing:

  1. Validates webhook payload

  2. Uploads PDF report to cloud storage

  3. Creates file record with health record attributes

  4. Notifies care team providers

  5. Triggers post-processing events

Lab Observations Webhook

Endpoint: POST /webhook/labs/observations

Webhook Payload:

Processing:

  1. Validates webhook payload

  2. Maps observation values to platform observation codes

  3. Creates observation records

  4. Updates file attributes

  5. Triggers post-processing events

API Endpoints

Lab Report Webhook

Lab Observations Webhook

Hubble Integration

Hubble integration provides FITCOIN wallet functionality for wellness rewards and digital currency management.

Configuration

Required Integration Setup

  1. Organization Integration Configuration:

  2. Wallet Configuration:

    • FITCOIN wallet type must be configured for the organization

    • Consumer accounts must be linked to FITCOIN wallets

FITCOIN Operations

Get Coin Balance

Retrieves the current FITCOIN balance for a consumer.

Endpoint: GET /webhooks/hubble/consumers/{consumerId}/balance

Response:

Debit Coins

Debits FITCOIN from a consumer's wallet for wellness activities.

Endpoint: POST /webhooks/hubble/consumers/{consumerId}/transactions

Request Payload:

Response:

Reverse Debit Transaction

Reverses a previous FITCOIN debit transaction.

Endpoint: POST /webhooks/hubble/consumers/{consumerId}/transactions/{transactionId}/reverse

Request Payload:

Response:

SSO Authentication

Provides user information for Hubble SSO integration.

Endpoint: GET /webhooks/hubble/auth/sso

Response:

API Endpoints

Get Coin Balance

Debit Coins

Reverse Debit Transaction

SSO Authentication

Error Handling

HTTP Status Codes

  • 200 - Success

  • 400 - Bad Request (validation errors)

  • 401 - Unauthorized

  • 403 - Forbidden

  • 404 - Not Found

  • 409 - Conflict (duplicate records)

  • 500 - Internal Server Error

Error Response Format

Common Error Codes

Crelio Health Errors

  • LABS_INVALID_CONFIGURATION - Integration configuration missing or invalid

  • LABS_REGISTRATION_FAILED - Patient registration failed

  • LABS_BOOKING_FAILED - Lab appointment booking failed

  • LABS_REPORT_NOT_FOUND - Lab report not found in webhook

  • LABS_WEBHOOK_PROCESSING_FAILED - Webhook processing failed

  • LABS_APPOINTMENT_NOT_FOUND - Appointment not found

  • LABS_INVOICE_ITEM_MISSING_ATTRIBUTES - Invoice item missing required attributes

Hubble Errors

  • PATIENT_NOT_FOUND - Consumer not found

  • TRANSACTION_NOT_FOUND - Transaction not found

  • INVALID_REVERSAL_REQUEST - Invalid reversal request

  • INSUFFICIENT_BALANCE - Insufficient FITCOIN balance

Security Considerations

Authentication

  • All endpoints require valid JWT tokens

  • Organization-level access control enforced

  • API keys stored securely in integration configuration

Data Protection

  • All data transmitted over HTTPS

  • Sensitive data encrypted at rest

  • PII protection for patient information

Webhook Security

  • Webhook payloads validated before processing

  • External ID mapping prevents unauthorized access

  • Audit logging for all operations

Examples

Complete Lab Workflow

  1. Create Patient:

  1. Create Invoice with Lab Items:

  1. Lab Report Webhook (automatically processed):

Complete Hubble Workflow

  1. Get Coin Balance:

  1. Debit Coins:

  1. Reverse Transaction:

Support

For technical support or questions about Crelio Health or Hubble integrations:

  • Support Email: [email protected]

  • Documentation: https://docs.azodha.com

  • API Reference: https://docs.azodha.com/api-reference


Last updated: January 2024

Last updated