Dev Reference

Task Management

Unified worklist for denial follow-up, payer calls, co-sign requests, RxRenewal routing, referral auth, PA decisions, and document collection — with SLA tracking, macro automation, and time logging.

Data Classification: All entities are org-scoped (partitioned by OrganizationID). See Data Model for ownership rules and IC Reference for isolation constraints.

WorkTask

Org-scoped. Trust Tier: T1 (may reference PHI via source entity).

Schema

FieldTypeRequiredPKFKNotes
WorkTaskIDUUIDYesYesPrimary key
PatientIDUUIDNoPatientNull for non-patient tasks
AssignedToUserIDUUIDNoUserCurrent assignee
CreatedByUserIDUUIDYesUserTask creator (or system)
TaskTypeString(50)YesDenialFollowUp / PayerCall / CoSignRequest / RxRenewal / ReferralAuth / PADecision / DocumentCollection / GenericFollowUp
SourceModuleString(50)NoOriginating module (e.g. RCM, eRx, Referrals)
SourceEntityIDString(50)NoFK to originating entity (polymorphic)
PriorityString(50)YesLow / Normal / High / Urgent
StatusString(50)YesDraft / Ready / InProgress / OnHold / Completed / Cancelled / EnteredInError
SlaDeadlineDateTimeDateTime (UTC)NoAuto-escalation trigger
DescriptionTextNo
AiSuggestedActionString(200)NoAI-generated recommendation
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

FHIR R4 Task Mapping

REV.health FieldFHIR R4 Task ElementNotes
WorkTaskIDTask.identifier
StatusTask.statusMapped: Draft=draft, Ready=ready, InProgress=in-progress, OnHold=on-hold, Completed=completed, Cancelled=cancelled, EnteredInError=entered-in-error
PriorityTask.priorityMapped: Low=routine, Normal=routine, High=urgent, Urgent=stat
TaskTypeTask.codeCustom CodeSystem
DescriptionTask.description
PatientIDTask.forReference(Patient)
AssignedToUserIDTask.ownerReference(Practitioner)
CreatedByUserIDTask.requesterReference(Practitioner)
SlaDeadlineDateTimeTask.restriction.period.end
SourceEntityIDTask.focusReference to source resource

RBAC

RoleTierPermissions
Patient (10)T1Read own task status via portal
Front Desk (30)T1Read task status
MA / RN (40)T1Read / write; use macros; log time
Biller (50)T1Read / write; use macros
Senior Biller (55)T1Read / write / assign tasks
Clinician (60)T1Read / write / assign; co-sign tasks
Practice Manager (70)T1Read / write all; assign; override SLA; create macros
EditAMI (90)T1Schema administration

TaskStatusHistory

Org-scoped. Trust Tier: T2 (status metadata).

Schema

FieldTypeRequiredPKFKNotes
TaskStatusHistoryIDUUIDYesYesPrimary key
WorkTaskIDUUIDYesWorkTask
ChangedByUserIDUUIDYesUser
StatusString(50)YesStatus value at this point
ChangedDateTimeDateTime (UTC)Yes
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
MA / RN (40)T2Read history for assigned tasks
Biller (50)T2Read history for assigned tasks
Clinician (60)T2Read history
Practice Manager (70)T2Read all history
EditAMI (90)T2Schema administration

TaskMacro

Org-scoped. Trust Tier: T3 (workflow configuration, no PHI).

Schema

FieldTypeRequiredPKFKNotes
TaskMacroIDUUIDYesYesPrimary key
MacroNameString(100)Yes
MacroTypeString(50)YesAppealLetter / FollowUpSequence / PayerCallScript / DocumentCollection / StatusTransition
ActionSequenceTextYesJSON-encoded action steps
IsActiveBoolYes
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
MA / RN (40)T3Use macros (execute)
Biller (50)T3Use macros (execute)
Practice Manager (70)T3Create / read / write / deactivate macros
EditAMI (90)T3Schema administration

TaskTimeLog

Org-scoped. Trust Tier: T3 (operational metadata).

Schema

FieldTypeRequiredPKFKNotes
TaskTimeLogIDUUIDYesYesPrimary key
WorkTaskIDUUIDYesWorkTask
UserIDUUIDYesUser
ActionString(50)Yese.g. PhoneCall, Research, Documentation
DurationMinutesIntYes
LoggedDateTimeDateTime (UTC)Yes
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
MA / RN (40)T3Create / read own time logs
Biller (50)T3Create / read own time logs
Practice Manager (70)T3Read all time logs; generate reports
EditAMI (90)T3Schema administration

Trust tier roll-up

EntityTierSource of truth
WorkTask2 — Internal operationalCreated by a credentialed user in this org; references external data (denial codes from 835, PA decisions from payers)
TaskStatusHistory2 — Internal operationalSystem-generated from user actions within this org; auto-escalation entries are system-authored
TaskMacro1 — Internal canonicalAuthored by a credentialed practice manager within this org; macro definitions are fully internal
TaskTimeLog2 — Internal operationalUser-entered time data within this org; duration is self-reported (not externally attested)

RBAC matrix (IC 0–100 scale)

RoleLevelWorkTaskTaskStatusHistoryTaskMacroTaskTimeLog
Patient (self)10Read own (via Patient Portal — patient-facing tasks only)No accessNo accessNo access
Front desk (Jordan)30Read statusRead status historyNo accessNo access
MA / RN (Tasha)40Read / Write (update status, process renewals)Write (transition status)Read (use macros)Read own / Write own
Clinician (Dr. M / Maria)60Read / Write / Assign (re-assign, co-sign)Write (transition status)Read (use macros)Read own / Write own
Biller50Read / Write (work denial queue, payer follow-ups)Write (transition status)Read (use macros)Read own / Write own
Senior biller55Read / Write / Assign (route by skill)WriteReadRead own / Write own
Practice manager (Sam)70Read all / Write all / Assign / Override SLARead all / Override escalationRead / Write (create, edit, deactivate)Read all (biller productivity)
EditAMI90Required for any AMI schema break (per IC hard rule #5)

Skills-based routing RBAC: Only users at level ≥ 55 (senior biller) or ≥ 70 (practice manager) can configure skills-based routing rules. Skill tags are assigned by the practice manager and stored as user attributes. The routing engine matches task TaskTypeString and SourceModuleString against assignee skill tags.

FK Relationship Diagram

erDiagram
    Patient ||--o{ WorkTask : "subject"
    User ||--o{ WorkTask : "AssignedToUserID"
    User ||--o{ WorkTask : "CreatedByUserID"
    WorkTask ||--o{ TaskStatusHistory : "tracks"
    User ||--o{ TaskStatusHistory : "ChangedByUserID"
    WorkTask ||--o{ TaskTimeLog : "logged against"
    User ||--o{ TaskTimeLog : "UserID"
    

SLA Auto-Escalation Flow

flowchart TD
    A[Task created with SlaDeadlineDateTime] --> B{SLA engine checks every 5 min}
    B -- Deadline not reached --> B
    B -- Deadline approaching: 1hr warning --> C[Notify assigned user]
    C --> B
    B -- Deadline breached --> D{Task still open?}
    D -- No --> E[No action]
    D -- Yes --> F[Escalate to Practice Manager]
    F --> G[Priority upgraded to Urgent]
    G --> H[Re-assign if unacknowledged after 30 min]
    H --> I[Create escalation entry in TaskStatusHistory]
    

Functional Requirements

  1. P0 The system SHALL create work tasks automatically when triggering events occur (denial received, co-sign needed, RxRenewal request, referral auth pending, PA decision needed).
  2. P0 The system SHALL track task status through the full lifecycle (Draft through Completed/Cancelled/EnteredInError) with immutable history.
  3. P0 The system SHALL enforce SLA deadlines and auto-escalate to Practice Manager when deadlines are breached.
  4. P0 The system SHALL support task assignment to specific users and reassignment by authorized roles.
  5. P0 The system SHALL map WorkTask to FHIR R4 Task resource for interoperability.
  6. P1 The system SHALL provide a unified worklist with filtering by TaskType, Priority, Status, AssignedToUserID, and SLA proximity.
  7. P1 The system SHALL support task macros that automate multi-step workflows (appeal letters, follow-up sequences, payer call scripts).
  8. P1 The system SHALL track time spent per task via TaskTimeLog for productivity reporting.
  9. P1 The system SHALL display AI-suggested actions when available and allow clinicians/billers to accept or dismiss suggestions.
  10. P1 The system SHALL link tasks to their source entity (Claim, Prescription, Referral) for one-click navigation.
  11. P1 The system SHALL support co-sign request tasks that block the source entity until a supervising clinician signs.
  12. P2 The system SHALL provide task volume and turnaround-time dashboards for practice managers.
  13. P2 The system SHALL support bulk task assignment and status updates for worklist efficiency.
  14. P2 The system SHALL allow Practice Managers to override SLA deadlines with documented justification.
  15. P2 The system SHALL support DocumentCollection task type with checklist of required documents and completion tracking.
  16. P2 The system SHALL allow patients to view their task status (e.g. "referral auth in progress") via the patient portal.

Non-Functional Requirements

icApplication Overrides

How the four Task Management AMI schemas turn into a live application: module-specific stack additions, override component bindings, FHIR R4 Task resource production, Twilio voice/SMS & SES email integration, a versioning worked example, environment cascade, and RBAC enforcement.

Shared generation map. The IC platform code-gen flow, default bindings, environment cascade, RBAC model, and CLI commands are identical across all modules. See the IC Reference for the canonical shared reference. This section covers only Task Management-specific content.

Technology stack P0

The shared platform stack (Cosmos DB, Redis, IC-generated API, Angular 21, SQS+SNS, OpenTelemetry, etc.) is documented in the IC Reference. Module-specific additions:

LayerTechnologyNotes
FHIR resource profilesFHIR R4 TaskWorkTask projected as FHIR Task resource per FHIR R4 spec. Supports CMS-0057-F Provider Access API consumer.
CMS-0057-F consumerFHIR Provider Access API clientConsumes payer Task/Claim/PriorAuth resources for PA status checks, claim adjudication details, and denial reason codes.
Voice / SMS loggingTwilio Voice + Twilio SMSOutbound payer call logging with caller ID, duration, outcome. Inbound/outbound SMS with TCPA consent tracking. Webhooks for call/SMS event ingestion.
Email loggingAWS SES + S3Outbound payer email logging with send timestamp, recipient, subject, body. Inbound email via SES receive rule → S3 → SQS processing.
AI next-best-actionBedrock Claude (internal inference)Suggestion engine trained on denial reason codes, payer appeal outcomes, and task type patterns. Pre-computed for top tasks; cached in Redis.
Skills-based routingInternal routing engineMatches task type + source module + payer against user skill tags. Routing rules configured per org via rules/*.rules.json.
SLA monitorEventBridge scheduled rule + LambdaRuns every 15 minutes; queries active tasks exceeding SLA deadline; triggers auto-escalation flow.

Task Management–specific override bindings P0

These overrides are declared in rules/*.rules.json and replace the default for the matching field name pattern.

FieldDefault would renderOverride componentWhy
WorkTask.StatusString50plain text inputic-ng21-task-1-status-dropdownCoded status dropdown with color-coded badges; validates allowed transitions (e.g., cannot go from Completed back to InProgress without EnteredInError first).
WorkTask.PriorityString50plain text inputic-ng21-core-1-combobox with FHIR priority ValueSetMaps to FHIR Task.priority coded values (urgent / high / routine / low).
WorkTask.AssignedToUserIDentity pickeric-ng21-task-1-assignment-pickerSkills-aware user picker; shows skill tags, active task count, and current workload; supports drag-to-assign from the queue.
WorkTask.SlaDeadlineDateTimeUTCdatetime pickeric-ng21-task-1-sla-badgeSLA deadline display with countdown timer, overdue badge, and escalation indicator. Readonly for auto-computed SLAs; editable for manual overrides at level ≥ 70.
WorkTask.AiSuggestedActionString200plain text displayic-ng21-task-1-ai-suggestion-panelAI next-best-action panel with accept/modify/dismiss buttons; shows confidence level and reasoning snippet. Only rendered for tasks in active status.
WorkTask.TaskTypeString50plain text inputic-ng21-core-1-combobox with task type ValueSetCoded task type dropdown; drives routing rules, SLA defaults, and macro availability.
(synthetic) work queue surfacen/aic-ng21-task-1-work-queueUnified queue with configurable views, sort, filter, and inline action buttons. The primary work surface for billers, MAs, and clinicians.
(synthetic) task detail viewn/aic-ng21-task-1-task-detailFull task detail: description, status history, time log, payer interactions, AI suggestions, and macro execution. Side panel from the queue.
(synthetic) payer call buttonn/aic-ng21-task-1-payer-call-buttonInitiates a Twilio voice call to the payer from the task; auto-logs call metadata and prompts for post-call outcome. TCPA consent verified before dial.
(synthetic) payer SMS paneln/aic-ng21-task-1-payer-sms-panelSMS composition panel with template snippets; logs send/receive via Twilio. TCPA opt-in verified before send.
(synthetic) payer email paneln/aic-ng21-task-1-payer-email-panelEmail composition panel with appeal letter attachment; logs send/receive via SES. Includes PDF generation for appeal letters.
(synthetic) macro runnern/aic-ng21-task-1-macro-runnerMacro selection and execution; shows macro steps, progress, and results. Supports undo of the last macro step.
(synthetic) appeal letter writern/aic-ng21-task-1-appeal-letter-writerRich-text editor populated by appeal letter macros; auto-inserts patient data, diagnosis codes, clinical rationale, and payer coverage criteria.
(synthetic) time loggern/aic-ng21-task-1-time-loggerTime entry form with action type dropdown, duration input (manual or auto-captured from call/email), and historical entries display.
(synthetic) analytics dashboardn/aic-ng21-task-1-analytics-dashboardPractice manager dashboard: queue depth, SLA compliance, aging, AI acceptance rate, biller productivity. Refreshes every 30 seconds.
(synthetic) audit trail viewern/aic-ng21-task-1-audit-trail-viewerFull audit trail per task: status transitions, assignments, escalations, AI suggestions, payer interactions, time entries. Searchable and filterable.

FHIR R4 Task resource production P0

The system projects every WorkTask as a FHIR R4 Task resource for interoperability with payer systems. The FHIR Task endpoint is read-only and supports the standard FHIR search parameters:

FHIR search parameterMapped fromUsage
statusStatusString50Filter tasks by status (e.g., ?status=in-progress)
priorityPriorityString50Filter by priority (e.g., ?priority=urgent)
patientPatientIDFilter by patient (e.g., ?patient=Patient/abc123)
ownerAssignedToUserIDFilter by assignee (e.g., ?owner=Practitioner/xyz789)
periodSlaDeadlineDateTimeUTCFilter by SLA deadline range (e.g., ?period=2026-01-01..2026-01-31)
codeTaskTypeString50Filter by task type (e.g., ?code=http://rev.health/task-type|DenialFollowUp)

The FHIR Task endpoint is secured via SMART on FHIR scopes. The CMS-0057-F Provider Access API consumer reads payer-side Task resources (PA status, claim adjudication) and writes the results back to WorkTask. The Task profile is registered in the rev.health FHIR CapabilityStatement.

Twilio voice/SMS & SES email integration P1

Payer follow-up logging uses three communication channels, each with a dedicated adapter and webhook handler:

ChannelAdapterWebhook handlerWhat is loggedConsent requirement
Voicetwilio-voice.tstwilio-webhook-handler.tsCaller ID, callee (payer), call duration, call status (completed/no-answer/busy), post-call outcome promptTCPA consent not required for business-to-business calls (payer is not a consumer); internal policy requires task-context verification before dial
SMStwilio-sms.tstwilio-webhook-handler.tsSender (system number), recipient (payer), message body, send/receive timestamps, delivery statusTCPA opt-in verified before every outbound SMS to a payer representative; opt-out honored immediately
Emailses-email.tsses-event-handler.tsSender, recipient (payer), subject, body, send timestamp, delivery/open/click events from SES, inbound repliesCAN-SPAM compliance; unsubscribe link in every outbound email

Every logged interaction creates a TaskTimeLog entry with the duration auto-captured from Twilio call duration or manually entered for email/SMS. The interaction metadata is stored as a JSON-structured ActionString200 value (e.g., Payer call — 12 min — spoke with John D., appeal #12345 approved pending medical records).

Versioning — worked example P0

All Task Management artifacts are versioned break.feature.bug.buildtimestamp per IC hard rule #9. The example below traces a feature bump on WorkTask.

WorkTask 1.0.0.20260301T120000Z — Initial schema. 12 business fields plus four org-scoped audit columns. Component ic-ng21-task-1-work-queue and ic-ng21-task-1-task-detail bind to work-task@1.0.0.* via the DI manifest.

WorkTask 1.1.0.20260515T093000Z — feature bump — Adds a single optional field, EscalationLevelInt, to track how many times a task has been auto-escalated. Per the IC change matrix:

ChangeVersion impactApproval neededMin permission
Add optional field EscalationLevelIntfeature bump (1.0.0 → 1.1.0)NoWrite (40)

Because the change is backward-compatible, the component tag stays ic-ng21-task-1-work-queue. Existing UI consumers continue to bind work-task@1.x.* and ignore the new field. New UI surfaces that need escalation-level display bind work-task@^1.1.0. No new database is required (IC rule #13 only applies to break bumps).

WorkTask 2.0.0.20280101T120000Z — break bump (illustrative) — An illustrative future break bump: StatusString50 is split into separate coded fields (StatusCodeString50, StatusReasonString100, StatusDetailText) to support FHIR Task.statusReason. Per the IC change matrix this is change field type + add required fields — break bump, EditAMI (90) approval, and per IC rule #13 a new database is provisioned with ETL from the old one. The component tag becomes ic-ng21-task-2-work-queue; consumers must re-bind. The old database stays live for the configured grace period (default 90 days) for rollback.

Illustrative. The 2.0.0 example is illustrative of the change matrix and IC rule #13; it is not a committed roadmap item.

Task Management environment details

EnvTwilioSES emailCMS-0057-FAI engine
DevTwilio sandbox (test numbers)SES sandbox (test emails)Mock payer APIBedrock Claude mock responses
QATwilio sandbox (expanded test numbers)SES sandbox (internal emails)Mock payer API + test compliant payerBedrock Claude dev endpoint
UATTwilio staging (verified caller IDs)SES staging (verified domains)Test compliant payer APIsBedrock Claude staging
ProdTwilio production (live numbers)SES production (live domains)Live compliant payer APIsBedrock Claude production

Task Management RBAC notes

Cross-Module Dependencies

See also: Task Management walkthrough · IC Reference