Data Model
Storage
MongoDB Atlas — single region, 3-node replica set. Stores all CLIC documents including draft states, completed payloads, and audit information.
Azure Cache for Redis (future) — will cache frequently accessed drug/formulary metadata from FSOT to reduce latency.
Collections
Client
Stores client organization info, template associations, and integration data.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
clientDetails.name | string | Client display name |
clientDetails.lob | string | Line of Business |
associatedTemplate | ref | Template assigned to this client |
carriers | array | Carrier identifiers |
accounts | array | Account identifiers |
groups | array | Group identifiers |
fbCodes | array | F&B (Formulary & Benefit) codes |
status | enum | Active / Inactive |
contacts | array | Contact persons |
Field
Defines reusable, configurable form fields that Admins create and Templates reference.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
sn | string | Sequential number |
name | string | Field label |
description | string | Field description |
isRequired | boolean | Whether field is mandatory on the form |
status | enum | Active / Inactive |
uiOptions | object | Display options (dropdown values, date picker, etc.) |
auditInfo | object | createdAt, createdBy, updatedAt, updatedBy |
version | integer | Version number |
dataType | string | text / number / date / select |
isLatest | boolean | Points to current version |
Template
Defines the structure of a Form F for a specific client type. Admins create and publish templates; clients select one when starting a Form F.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
sn | string | Sequential number |
name | string | Template display name |
description | string | Template description |
isLatest | boolean | Current version flag |
status | enum | Draft / Published / Inactive |
auditInfo | object | createdAt, createdBy, updatedAt, updatedBy |
version | integer | Version number |
type | string | Template category |
elements | array | Sections and fields (ordered) |
FormFRequest
One document per Form F submission. Tracks the full lifecycle from draft through completion.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
sn | string | Sequential number (human-readable ID) |
requestName | string | Name given by the submitter |
clientId | ref | Links to Client |
status | enum | DRAFT / SUBMITTED / DISPATCHED / COMPLETED / CANCELLED |
stage | string | Sub-stage within status |
isLatest | boolean | Current version flag |
auditInfo | object | createdAt, createdBy, updatedAt, updatedBy |
type | string | Form type |
templateRowsData | array | Field values from the template |
DrugIntent
One document per drug record within a Form F. Captures drug-specific intent fields.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
sn | string | Sequential number |
formFRequestId | ref | Links to FormFRequest |
version | integer | Version of this drug intent record |
isLatest | boolean | Current version flag |
drugIntentElements | object | Drug intent payload (see below) |
auditInfo | object | createdAt, createdBy, updatedAt, updatedBy |
drugIntentElements shape
{
"formId": "string",
"formName": "string",
"status": "string",
"fAndBCode": "string",
"NDC": "string",
"GPI": "string",
"CAGP": {
"accountId": "string",
"carrierId": "string",
"groupId": "string",
"planCode": "string"
}
}
Indexes
| Collection | Index | Purpose |
|---|---|---|
| DrugIntent | formId (unique, case-insensitive GUID) | Fast lookup by form |
| DrugIntent | auditInfo.createdBy + auditInfo.createdAt | Recent actions by user |
| FormFRequest | clientId + status | Client-scoped status queries |
Data Validation Rules
All inputs validated at API layer before persistence:
- Mandatory fields must not be null/blank
- Numeric fields (e.g., NPI) — 10 digits max, no alphabetic characters
clientIdmust resolve in RxClient360- Duplicate records rejected with structured error message
- Optimistic locking via
@Versionon all update paths — prevents lost updates under concurrent edits
Audit Trail
Every write operation emits an audit event. CLIC supports two audit mechanisms:
- Application-layer auditing — every CRUD operation captures
createdBy/updatedBy/timestamps - MongoDB Atlas Change Streams — DB-level change capture for admin/compliance auditing
Audit data is retained per data lifecycle policy (to be defined); archived records are not deleted, only flagged.
Shared Java Library — RxDrugIntentDataModelLib
The MongoDB collections above are backed by a shared Java library (RxDrugIntentDataModelLib) providing strongly-typed schema classes used across the Drug Intent backend services, so RxDrugIntent-MP-Core and other services share one consistent data model instead of duplicating types.
The library is organized into three packages under com.optum.rxdrugintent:
| Package | Contents |
|---|---|
dto | API request/response models — e.g. DrugIntentCreateRequestDTO, DrugIntentUpdateRequestDTO, FieldDTO, ProductSearchRequest/ProductSearchResponse, paging types |
entity | Persistent objects — e.g. DrugIntentEntity, DrugIntentAudit, CAG, DrugDetails, Field, AuditInfo, UiOption |
enums | Strongly typed categorization — e.g. AnswerOptionType, ControlType, DataType, FormStatus, Status, VersionStatus |
Built with Java 21, using Jackson for JSON serialization, Spring Data Reactive MongoDB annotations (@Document, @Field) on entities, Jakarta validation on DTOs, and Lombok for boilerplate reduction. Published as a versioned JAR to JFrog Artifactory for embedding into any microservice.
| Detail | Value |
|---|---|
| Repo | RxDrugIntentDataModelLib |
| Package root | com.optum.rxdrugintent |
| Language | Java 21 |
| Persistence | Spring Data Reactive MongoDB |
| Distribution | JFrog Artifactory (versioned JAR) |