Skip to main content

Eligibility Verification Integration

Integrate Oneliac's privacy-preserving eligibility verification into your application.

Overview

The eligibility verification service checks patient insurance coverage without exposing sensitive medical information using zero-knowledge proofs.

API Endpoint

POST /api/v1/eligibility/verify

Request

{
"patient_id": "patient_hash_abc123",
"member_id": "insurance_member_123",
"procedure_code": "99213",
"provider_npi": "1234567890"
}

Response

{
"eligible": true,
"coverage_percentage": 85,
"requires_authorization": false,
"deductible_met": true,
"copay_amount": 25,
"verification_proof": {
"proof_data": "0x...",
"public_inputs": ["0x...", "0x..."],
"blockchain_tx": "5dXf..."
}
}

Implementation Example

from oneliac.eligibility import EligibilityVerifier

verifier = EligibilityVerifier(
api_key="sk_live_...",
network="mainnet"
)

result = verifier.verify(
patient_id="patient_abc123",
member_id="mem_123456",
procedure_code="99213"
)

if result.eligible:
print(f"Eligible for procedure with {result.coverage_percentage}% coverage")
else:
print("Patient not eligible")

Zero-Knowledge Proof Verification

Verify the proof independently:

from oneliac.verification import ProofVerifier

verifier = ProofVerifier()

is_valid = verifier.verify(
proof=result.verification_proof['proof_data'],
public_inputs=result.verification_proof['public_inputs'],
vkey_path="./verifying_keys/eligibility.vkey"
)

if is_valid:
print("Proof verified on-chain")

Error Codes

CodeDescription
PATIENT_NOT_FOUNDPatient record not in system
NO_INSURANCEPatient has no active insurance
PROOF_INVALIDZK proof verification failed
NETWORK_ERRORBlockchain verification failed

Rate Limiting

  • Pro Plan: 10,000 verifications/day
  • Enterprise: Unlimited

Caching

Cache verification results for 24 hours:

result = verifier.verify(
patient_id="...",
cache=True,
cache_ttl=86400
)

Compliance

  • HIPAA compliant data handling
  • No patient PII stored in proofs
  • Audit trail for all verifications