Skip to main content

Validation Rules

What it does​

DOSE validates every record before it reaches RxClaim. Validation catches bad data early — at DOSE — rather than letting it fail inside RxClaim with a harder-to-diagnose error.

When a record fails validation, DOSE rejects it immediately, records the specific violations, and notifies the upstream client (CLIC) so it can correct and resubmit.

Validation layers​

DOSE has two validation layers. Only the first is currently built:

LayerStatusWhat it checks
Schema validation✅ LiveRequired fields present, correct format (6 standard GPI fields)
Business validation🔲 PlannedCross-field consistency, pre-RxClaim business rules (~40 rules)

Schema validation — what is checked today​

Every DOSE record must pass these 6 field checks before it can proceed:

FieldRule
gpiMust be present, must be exactly 14 characters
mscMust be present
rxOtcMust be present, valid indicator value
fromDateMust be present, valid date format
thruDateMust be present, valid date format
drugStatusMust be present, valid status code

What happens on failure​

The upstream client receives a notification containing the record ID and the specific field violations — enough to identify and fix the problem record without re-submitting the whole file.

Business validation — what is planned​

The business validation layer (~40 rules) will enforce cross-field consistency that cannot be expressed in a JSON Schema. Examples of the kinds of rules planned:

  • fromDate must be before thruDate
  • ADD action records must not already exist as active in RxClaim
  • GPI format must match category-specific patterns
  • Specific field combinations required for certain drug categories

This layer has a placeholder in the processing pipeline and will be implemented in RxDose-BusinessValidator-lib.

Technical reference​

DetailValue
Schema libraryRxDose-Validator-lib
Schema standardJSON Schema Draft 2020-12
Upstream notificationCloudEvents 1.0 via RxDose-KafkaUtil-lib (mTLS)
Business validationRxDose-BusinessValidator-lib (not yet built)