ARCHITECTURE

System Architecture

Multi-tenant healthcare infrastructure built for HIPAA compliance, horizontal scalability, and sub-100ms API response times.

SYSTEM OVERVIEW

Platform Architecture

From client applications through the API gateway to infrastructure engines and the data layer — every request is authenticated, authorized, and audit-logged.

Security & Compliance
HIPAA · RBAC · AES-256 · Audit Logging
Data Layer
Encrypted Storage
ORIS
ORIS AI
Intelligence Layer · NLP · Predictive Analytics
Core Engines
Care · Revenue · Compliance · Network · Commerce
API Gateway
Auth, Rate Limiting, Routing
Applications
Web, Mobile, API

Client Applications connect via REST APIs, SDKs, or direct integration. All traffic passes through the API Gateway, which handles authentication, rate limiting, and request routing.

Rymeda Platform engines process domain-specific logic — care delivery, revenue cycle, compliance, ORIS, provider network, and commerce. Each engine is independently deployable and horizontally scalable.

Data Layer uses MongoDB for primary storage with per-tenant data isolation, AWS S3 for encrypted object storage, and Redis for session caching and job queues.

MULTI-TENANT

Multi-Tenant Architecture

Every organization operates in a fully isolated tenant with its own data partition, access policies, and compliance configuration.

Organization Isolation

Each organization gets a unique tenant ID. All database queries are scoped to the tenant — cross-tenant data access is architecturally impossible.

HIPAA Boundaries

PHI is encrypted at rest and in transit. Tenant boundaries enforce BAA-compliant data isolation. Audit trails capture every access.

Data Partitioning

Database collections use compound indexes with tenant ID as the partition key. This ensures query isolation and horizontal scalability.

Role-Based Access Control

RBAC with organization-scoped roles: Admin, Clinical Director, Provider, Billing, Compliance Officer, and custom roles.

Tenant Resolution Flow

Request → API Gateway
  ├─ Extract bearer token
  ├─ Validate token with Cognito
  ├─ Resolve organizationId from token claims
  ├─ Inject tenant context into request pipeline
  └─ All downstream queries scoped to tenant

// Every database query includes tenant scope:
db.collection('sessions').find({
  organizationId: ctx.tenantId,  // injected by middleware
  status: 'scheduled',
})
DATA MODELS

Data Models

Core data models that power the Rymeda platform. All models include tenant isolation, audit timestamps, and soft-delete support.

Patient

Core patient/client record with demographics, insurance, and care relationships.

FieldType
idreq

Unique patient identifier

string
firstNamereq

Legal first name

string
lastNamereq

Legal last name

string
dateOfBirthreq

Date of birth

string (ISO 8601)
statusreq

"active" | "inactive" | "discharged"

enum
insuranceInfo

Primary insurance details

InsuranceInfo
primaryProviderId

Assigned primary provider

string
organizationIdreq

Owning organization (tenant)

string
createdAtreq

Record creation timestamp

string (ISO 8601)
updatedAtreq

Last modification timestamp

string (ISO 8601)

Provider

Healthcare provider with credentials, specialties, and organizational membership.

FieldType
idreq

Unique provider identifier

string
firstNamereq

Provider first name

string
lastNamereq

Provider last name

string
npireq

National Provider Identifier (10 digits)

string
specialtyreq

Primary specialty code

string
credentialStatusreq

"active" | "pending" | "expired" | "revoked"

enum
organizationIdreq

Organization membership

string
licenseStates

Licensed state codes

string[]
createdAtreq

Record creation timestamp

string (ISO 8601)

Session

Care session or encounter with scheduling, duration, and outcome tracking.

FieldType
idreq

Unique session identifier

string
clientIdreq

Associated patient

string
providerIdreq

Assigned provider

string
serviceTypereq

Service type code (e.g., "behavioral_health")

string
statusreq

"scheduled" | "in_progress" | "completed" | "cancelled" | "no_show"

enum
startTimereq

Scheduled or actual start time

string (ISO 8601)
endTime

Actual end time (null until completed)

string (ISO 8601)
scheduledDurationreq

Scheduled duration in minutes

number
notes

Associated progress notes

ProgressNote[]
createdAtreq

Record creation timestamp

string (ISO 8601)

Claim

Insurance claim with CPT/ICD codes, payer details, and lifecycle status.

FieldType
idreq

Unique claim identifier

string
clientIdreq

Patient associated with claim

string
sessionIdreq

Originating care session

string
payerIdreq

Insurance payer

string
statusreq

"draft" | "submitted" | "accepted" | "denied" | "paid" | "appealed"

enum
cptCodesreq

Procedure codes

string[]
icdCodesreq

Diagnosis codes

string[]
totalAmountreq

Billed amount in USD

number
paidAmount

Amount paid (null until payment received)

number
submittedAt

Submission timestamp

string (ISO 8601)

ComplianceArtifact

Compliance document, certificate, or attestation with expiration tracking.

FieldType
idreq

Unique artifact identifier

string
typereq

"policy" | "training_certificate" | "attestation" | "audit_report"

enum
titlereq

Document title

string
statusreq

"active" | "expired" | "superseded"

enum
userId

Associated user (for certificates)

string
fileUrl

Secure download URL

string
expiresAt

Expiration date

string (ISO 8601)
createdAtreq

Upload timestamp

string (ISO 8601)

AuditLog

Immutable audit trail entry capturing every data access and mutation.

FieldType
idreq

Unique audit entry identifier

string
actionreq

"create" | "read" | "update" | "delete" | "export"

enum
resourceTypereq

Resource type (e.g., "care_session", "claim")

string
resourceIdreq

Affected resource identifier

string
userIdreq

User who performed the action

string
ipAddressreq

Client IP address

string
userAgent

Client user agent string

string
metadata

Additional context (varies by action)

object
timestampreq

When the action occurred

string (ISO 8601)

OrisWorkflow

AI-driven automation workflow with trigger conditions and execution history.

FieldType
idreq

Unique workflow identifier

string
namereq

Human-readable workflow name

string
triggerreq

"event" | "schedule" | "manual" | "threshold"

enum
triggerConfigreq

Trigger-specific configuration

object
actionsreq

Ordered list of actions to execute

WorkflowAction[]
statusreq

"active" | "paused" | "disabled"

enum
lastRunAt

Last execution timestamp

string (ISO 8601)
lastRunStatus

"success" | "failed" | "partial"

enum
createdAtreq

Workflow creation timestamp

string (ISO 8601)
SECURITY

Encryption Model

Defense-in-depth encryption strategy protecting data at rest, in transit, and during processing.

At Rest — AES-256

  • All database volumes encrypted with AES-256-GCM
  • S3 objects encrypted with SSE-KMS
  • Backups encrypted with separate key hierarchy
  • Field-level encryption for PII and PHI

In Transit — TLS 1.3

  • TLS 1.3 enforced on all external connections
  • Mutual TLS (mTLS) for service-to-service
  • Certificate pinning for mobile clients
  • HSTS headers with 1-year max-age

Key Management — KMS

  • AWS KMS with hardware security modules (HSM)
  • Automatic key rotation every 365 days
  • Per-tenant encryption keys for data isolation
  • Key usage logged in CloudTrail

Encryption in Practice

// Field-level encryption for PHI
{
  "id": "client_123",
  "firstName": "ENC[AES256:abc123...]",     // encrypted
  "lastName": "ENC[AES256:def456...]",      // encrypted
  "dateOfBirth": "ENC[AES256:ghi789...]",   // encrypted
  "status": "active",                        // not PHI
  "organizationId": "org_100",               // not PHI
  "createdAt": "2024-06-01T12:00:00Z"       // not PHI
}

// Decryption happens at the application layer
// using per-tenant KMS data keys.
// Audit log entry created for every decryption.
INFRASTRUCTURE

Infrastructure Highlights

99.95%
Uptime SLA

Multi-AZ deployment with automatic failover and health monitoring.

<100ms
API Latency (p95)

Edge caching, connection pooling, and optimized query paths.

SOC 2
Type II Certified

Annual SOC 2 audit with continuous monitoring and evidence collection.

HIPAA
BAA Available

Business Associate Agreements and full HIPAA compliance program.

Auto-scale
Horizontal

All services auto-scale based on CPU, memory, and request volume.

Multi-Region
US East / West

Primary in us-east-1, disaster recovery in us-west-2.

Ready to build on Rymeda?

Explore the API reference or talk to our engineering team about your architecture needs.