Skip to main content
Version: v0.0.3

Function: ndcValue()

ndcValue(raw): NdcValue

Classify an NDC string into a NdcSegmentation hint. Hyphenated forms are matched by their digit groups; bare digit strings are classified by total length. Anything else is "unknown".

Parameters

raw

string

The NDC value as it appeared on the wire.

Returns

NdcValue

A frozen NdcValue.

Example

ndcValue("0002-8215-01").segmentation; // "4-4-2"
ndcValue("00002821501").segmentation; // "11-digit"