IC Application Reference

The IC (Integrated Components) framework is the code-generation and runtime layer that powers every REV.health module. This page documents the shared stack, conventions, and commands.

Shared Technology Stack

LayerTechnologyNotes
DatabaseAzure Cosmos DB (NoSQL API)Partition-key multi-tenancy, tunable consistency
CacheRedis (Azure Cache)Session, lookup tables, rate limiting
FrontendAngular 21Standalone components, signals, SSR-ready
MessagingSQS + SNS (AWS)Async command/event bus, dead-letter queues
SecretsAzure Key VaultAll secrets, connection strings, certificates
ObservabilityOpenTelemetryTraces, metrics, logs → Azure Monitor + Grafana
Component CDNAzure CDN / CloudflareVersioned component bundles, env-tagged
AuthOAuth 2.1 / OIDC + SMART on FHIRSSO federation, SMART launch context

Project Directory Skeleton

module-root/
  ami/                  # AMI schema definitions (.ami.json)
    patient.ami.json
    encounter.ami.json
  rules/                # Business rules (.rules.json)
    eligibility.rules.json
  api/                  # Generated API controllers + DTOs
    controllers/
    dtos/
    validators/
  components/           # Generated Angular components
    forms/
    tables/
    detail-views/
  adapters/             # External integration adapters
    surescripts/
    stedi/
    waystar/
  jobs/                 # Background job definitions
    sync/
    cleanup/
  deploy/               # IaC and deployment manifests
    cosmos/
    cdn/
    k8s/

Component Naming Convention

Pattern: ic-{framework}{majorVer}-{scope}-{break}-{name}

Examples:
ic-ng21-scheduling-form-appointment — Angular 21, scheduling module, form component, appointment entity
ic-ng21-rcm-table-claim — Angular 21, RCM module, table component, claim entity
ic-ng21-clinical-doc-detail-encounter — Angular 21, clinical-doc module, detail-view, encounter entity

Code Generation Flow

graph TD
  AMI["AMI Schema
(.ami.json)"] --> PARSE["Parse & Validate"] PARSE --> DB["Generate Cosmos
Container Config"] PARSE --> API["Generate API
Controllers + DTOs"] PARSE --> COMP["Generate Angular
Components"] PARSE --> TEST["Generate Test
Scaffolds"] DB --> DEPLOY["Deploy Stage:
Cosmos containers"] API --> DEPLOY COMP --> CDN["Deploy Stage:
CDN bundle"] TEST --> CI["CI/CD Pipeline"] CI --> DEPLOY

Default Bindings

When generating components from AMI schemas, each field type maps to a default Angular component:

AMI TypeDefault ComponentNotes
Stringtext-inputSingle-line text
TexttextareaMulti-line text
Intint-inputInteger with step controls
Decimaldecimal-inputDecimal with precision control
Moneymoney-inputCurrency-formatted with locale
BoolcheckboxToggle / checkbox
DateTimedatetime-pickerDate + time with timezone
Guidshort-guid-displayRead-only Base62 display
Emailemail-inputEmail with validation
Phonephone-inputE.164 formatted with mask
Urlurl-inputURL with protocol validation
Entity FKentity-pickerSearchable entity selector
ListjtableInline editable table for child collections

Environment Cascade

EnvironmentCosmos DatabaseCDN TagPurpose
Devcosmos-devdevLocal development, feature branches
QAcosmos-qaqaAutomated testing, integration tests
UATcosmos-uatuatUser acceptance testing, demo environment
Prodcosmos-prodprodProduction, real patient data

Permissions / RBAC Enforcement

The core RBAC rules are the same for all modules. Module-specific thresholds (e.g., which level can submit a claim vs. prescribe a controlled substance) are documented on each module's IC application page.

Access control is enforced at four layers:

Every API endpoint has a numeric permission level (0–100); the caller's role must meet or exceed the required level:

LevelDescriptionExample Roles
0Public / unauthenticatedAnonymous patient portal pages
10Patient self-servicePatient
30Clinical readMA, Nurse, Reception
50Clinical writePA/NP, Physician
70AdministrativePractice Manager, RCM Specialist
90System adminIT Admin, Super Admin
100Platform operatorREV.health internal ops

Build / Test / Run Commands

The command pattern is the same for all modules. Replace {noun} with the module's root noun (e.g., eligibility, rcm, erx-epcs, scheduling). Module-specific test flags (e.g., --scrubbing for RCM, --epcs for eRx / EPCS, --pdmp for eRx / EPCS) are documented on each module's IC application page.

CommandWhat it does
ic generate {noun}Runs DB → API → Components in order from the AMI/rules sources.
ic generate {noun} --stage dbRun only the DB stage (Cosmos container definition diff, partition-key isolation, indexes).
ic generate {noun} --stage apiRun only the API stage; requires DB stage already applied.
ic generate {noun} --stage componentsRun only the Components stage; publishes to the configured CDN.
ic test {noun} --unitGenerated-controller unit tests + module-specific parser/serialization tests.
ic test {noun} --integrationEnd-to-end against vendor sandboxes; uses test data appropriate for the module.
ic test {noun} --contractFHIR profile validation for the module's resource profiles.
ic deploy {noun} --env devDeploys the latest built artifact to Dev only.
ic deploy {noun} --env qa --cascadeDeploys to QA and cascades Dev to the same version.
ic deploy {noun} --env prod --cascade --approveDeploys to Prod (requires manager approval) and cascades all environments.
ic schema bump {noun} {entity} --featureAdds a feature bump to the entity's *.ami.json; rejects if the diff is not backward-compatible.
ic schema bump {noun} {entity} --breakAdds a break bump; requires EditAMI (90) and triggers IC rule #13 new-database flow.
Module root nouns. {noun} maps to the module's directory name and CLI slug: eligibility, scheduling, clinical-doc, coding-cds, referrals, patient-portal, erx-epcs, rcm, task-mgmt, payer-opt.

Module Root Nouns

Each module is identified by a root noun used in container names, API routes, component prefixes, and deploy manifests:

Root NounModule
eligibilityEligibility & Prior Authorization
schedulingScheduling & Appointments
clinical-docClinical Documentation
coding-cdsCoding & Clinical Decision Support
referralsReferrals & Specialist Coordination
patient-portalPatient Portal & Mobile
erx-epcse-Prescribing & EPCS
rcmRevenue Cycle Management
task-mgmtTask Management & Workflows
payer-optPayer Optimization & Rules