Variable: SCRIPT_WARNING_CODES
constSCRIPT_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
readonlyLIFECYCLE_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
readonlyLIFECYCLE_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
readonlyMISSING_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
readonlyRESPONSE_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
readonlySIG_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
readonlySIG_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
readonlySTRENGTH_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
readonlyUNSUPPORTED_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
readonlyUNSUPPORTED_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
readonlyVERSION_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"