Skip to main content

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.

FieldTypeDescription
_idObjectIdUnique identifier
clientDetails.namestringClient display name
clientDetails.lobstringLine of Business
associatedTemplaterefTemplate assigned to this client
carriersarrayCarrier identifiers
accountsarrayAccount identifiers
groupsarrayGroup identifiers
fbCodesarrayF&B (Formulary & Benefit) codes
statusenumActive / Inactive
contactsarrayContact persons

Field​

Defines reusable, configurable form fields that Admins create and Templates reference.

FieldTypeDescription
_idObjectIdUnique identifier
snstringSequential number
namestringField label
descriptionstringField description
isRequiredbooleanWhether field is mandatory on the form
statusenumActive / Inactive
uiOptionsobjectDisplay options (dropdown values, date picker, etc.)
auditInfoobjectcreatedAt, createdBy, updatedAt, updatedBy
versionintegerVersion number
dataTypestringtext / number / date / select
isLatestbooleanPoints 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.

FieldTypeDescription
_idObjectIdUnique identifier
snstringSequential number
namestringTemplate display name
descriptionstringTemplate description
isLatestbooleanCurrent version flag
statusenumDraft / Published / Inactive
auditInfoobjectcreatedAt, createdBy, updatedAt, updatedBy
versionintegerVersion number
typestringTemplate category
elementsarraySections and fields (ordered)

FormFRequest​

One document per Form F submission. Tracks the full lifecycle from draft through completion.

FieldTypeDescription
_idObjectIdUnique identifier
snstringSequential number (human-readable ID)
requestNamestringName given by the submitter
clientIdrefLinks to Client
statusenumDRAFT / SUBMITTED / DISPATCHED / COMPLETED / CANCELLED
stagestringSub-stage within status
isLatestbooleanCurrent version flag
auditInfoobjectcreatedAt, createdBy, updatedAt, updatedBy
typestringForm type
templateRowsDataarrayField values from the template

DrugIntent​

One document per drug record within a Form F. Captures drug-specific intent fields.

FieldTypeDescription
_idObjectIdUnique identifier
snstringSequential number
formFRequestIdrefLinks to FormFRequest
versionintegerVersion of this drug intent record
isLatestbooleanCurrent version flag
drugIntentElementsobjectDrug intent payload (see below)
auditInfoobjectcreatedAt, 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​

CollectionIndexPurpose
DrugIntentformId (unique, case-insensitive GUID)Fast lookup by form
DrugIntentauditInfo.createdBy + auditInfo.createdAtRecent actions by user
FormFRequestclientId + statusClient-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
  • clientId must resolve in RxClient360
  • Duplicate records rejected with structured error message
  • Optimistic locking via @Version on 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:

PackageContents
dtoAPI request/response models — e.g. DrugIntentCreateRequestDTO, DrugIntentUpdateRequestDTO, FieldDTO, ProductSearchRequest/ProductSearchResponse, paging types
entityPersistent objects — e.g. DrugIntentEntity, DrugIntentAudit, CAG, DrugDetails, Field, AuditInfo, UiOption
enumsStrongly 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.

DetailValue
RepoRxDrugIntentDataModelLib
Package rootcom.optum.rxdrugintent
LanguageJava 21
PersistenceSpring Data Reactive MongoDB
DistributionJFrog Artifactory (versioned JAR)