Skip to main content
Version: v0.0.3

Variable: SCRIPT_WARNING_CODES

const SCRIPT_WARNING_CODES: object

Stable warning codes for NCPDP SCRIPT parsing. Per Postel's Law, the parser is lenient: anything recoverable yields a warning with one of these codes rather than throwing. Codes are part of the public contract: renaming one is a breaking change.

Type Declaration

LIFECYCLE_AMBIGUOUS_OUTCOME

readonly LIFECYCLE_AMBIGUOUS_OUTCOME: "NCPDP_SCRIPT_LIFECYCLE_AMBIGUOUS_OUTCOME" = "NCPDP_SCRIPT_LIFECYCLE_AMBIGUOUS_OUTCOME"

A lifecycle response (RxRenewalResponse/RxChangeResponse/CancelRxResponse) carried more than one outcome choice (e.g. both <Approved> and <Denied>); the most conservative outcome (a denial before an approval) is reported so an approval can never mask a denial.

LIFECYCLE_OUTCOME_UNRECOGNIZED

readonly LIFECYCLE_OUTCOME_UNRECOGNIZED: "NCPDP_SCRIPT_LIFECYCLE_OUTCOME_UNRECOGNIZED" = "NCPDP_SCRIPT_LIFECYCLE_OUTCOME_UNRECOGNIZED"

A lifecycle response carried no recognized outcome choice; the outcome is surfaced as "unknown" rather than being assumed to be an approval.

MISSING_REQUIRED_ELEMENT

readonly MISSING_REQUIRED_ELEMENT: "NCPDP_SCRIPT_MISSING_REQUIRED_ELEMENT" = "NCPDP_SCRIPT_MISSING_REQUIRED_ELEMENT"

A required element for the detected transaction was missing; left undefined.

RESPONSE_AMBIGUOUS_DISPOSITION

readonly RESPONSE_AMBIGUOUS_DISPOSITION: "NCPDP_SCRIPT_RESPONSE_AMBIGUOUS_DISPOSITION" = "NCPDP_SCRIPT_RESPONSE_AMBIGUOUS_DISPOSITION"

More than one response transaction (<Status>/<Error>/<Verify>) was present in one body; the most conservative disposition (error first) is reported so a failure is never masked by a co-present success.

SIG_AMBIGUOUS_DOSE

readonly SIG_AMBIGUOUS_DOSE: "NCPDP_SCRIPT_SIG_AMBIGUOUS_DOSE" = "NCPDP_SCRIPT_SIG_AMBIGUOUS_DOSE"

A structured dose element was present but no unambiguous dose quantity could be derived from it. The dose is surfaced as absent (provenance "absent") rather than a guessed value, so an ambiguous SIG never yields a confident dose.

SIG_STRUCTURED_LOSSY

readonly SIG_STRUCTURED_LOSSY: "NCPDP_SCRIPT_SIG_STRUCTURED_LOSSY" = "NCPDP_SCRIPT_SIG_STRUCTURED_LOSSY"

A structured <Sig> was decoded into typed dosing components. The decode is best-effort and lossy; the free-text SigText remains the source of truth and is preserved verbatim. Raised once per medication carrying any structured component so a consumer never mistakes the additive structured view for an authoritative one.

STRENGTH_CODED_AND_EXPLICIT

readonly STRENGTH_CODED_AND_EXPLICIT: "NCPDP_SCRIPT_STRENGTH_CODED_AND_EXPLICIT" = "NCPDP_SCRIPT_STRENGTH_CODED_AND_EXPLICIT"

A coded drug and an explicit Strength were both present; both surfaced, never reconciled.

UNSUPPORTED_TRANSACTION

readonly UNSUPPORTED_TRANSACTION: "NCPDP_SCRIPT_UNSUPPORTED_TRANSACTION" = "NCPDP_SCRIPT_UNSUPPORTED_TRANSACTION"

The transaction body is a SCRIPT type this parser does not model; surfaced as unsupported.

UNSUPPORTED_VERSION_TOLERATED

readonly UNSUPPORTED_VERSION_TOLERATED: "NCPDP_SCRIPT_UNSUPPORTED_VERSION_TOLERATED" = "NCPDP_SCRIPT_UNSUPPORTED_VERSION_TOLERATED"

Version is a plausible SCRIPT release we don't explicitly support; tolerated.

VERSION_ABSENT

readonly VERSION_ABSENT: "NCPDP_SCRIPT_VERSION_ABSENT" = "NCPDP_SCRIPT_VERSION_ABSENT"

No version could be determined from the message; parsed best-effort.

Example

import { SCRIPT_WARNING_CODES } from "@cosyte/ncpdp/common";
SCRIPT_WARNING_CODES.VERSION_ABSENT; // "NCPDP_SCRIPT_VERSION_ABSENT"