Skip to main content
Version: v0.0.3

Variable: TELECOM_WARNING_CODES

const TELECOM_WARNING_CODES: object

Stable warning codes for NCPDP Telecommunication-standard parsing. Per Postel's Law, the parser is lenient: anything recoverable yields a warning with one of these codes rather than throwing, and the underlying bytes are always preserved verbatim so nothing is silently dropped. Codes are part of the public contract. Renaming one is a breaking change.

Type Declaration

COB_COUNT_MISMATCH

readonly COB_COUNT_MISMATCH: "NCPDP_TELECOM_COB_COUNT_MISMATCH" = "NCPDP_TELECOM_COB_COUNT_MISMATCH"

A Coordination-of-Benefits segment declared an other-payer/other-payment count (337-4C request, 355-NT response) that disagrees with the number of other-payer blocks decoded. Every block is still surfaced; this flags a possible mis-read COB chain so secondary-payer money is never silently dropped or duplicated.

COMPOUND_COUNT_MISMATCH

readonly COMPOUND_COUNT_MISMATCH: "NCPDP_TELECOM_COMPOUND_COUNT_MISMATCH" = "NCPDP_TELECOM_COMPOUND_COUNT_MISMATCH"

A Compound segment declared an ingredient count (447-EC) that disagrees with the number of ingredient occurrences actually decoded. Every ingredient is still surfaced verbatim; this flags a possible truncated/over-stuffed compound so a missing or extra ingredient is never silent (a compound with a missing ingredient is, clinically, a different medication).

MALFORMED_FIELD

readonly MALFORMED_FIELD: "NCPDP_TELECOM_MALFORMED_FIELD" = "NCPDP_TELECOM_MALFORMED_FIELD"

A field token was too short to carry a 2-character field identifier. It is preserved verbatim (with an empty id) rather than dropped.

MISSING_SEGMENT_ID

readonly MISSING_SEGMENT_ID: "NCPDP_TELECOM_MISSING_SEGMENT_ID" = "NCPDP_TELECOM_MISSING_SEGMENT_ID"

A segment's first field was not the Segment Identification (AM). The segment is still surfaced with its fields preserved, but its segment id is left empty since it could not be read from the expected position.

MULTI_TRANSACTION_TRUNCATED

readonly MULTI_TRANSACTION_TRUNCATED: "NCPDP_TELECOM_MULTI_TRANSACTION_TRUNCATED" = "NCPDP_TELECOM_MULTI_TRANSACTION_TRUNCATED"

The transmission carried more than one group-separator-delimited transaction. The parser decodes the first transaction's segments only and surfaces this warning so additional transactions are never silently ignored.

STATUS_CONFLICT

readonly STATUS_CONFLICT: "NCPDP_TELECOM_STATUS_CONFLICT" = "NCPDP_TELECOM_STATUS_CONFLICT"

A response declared a paid/captured/approved Transaction Response Status (112-AN) while also carrying one or more reject codes. The two disagree; the library resolves the disposition to rejected (a reject always wins: a consumer must never be told a rejected claim was paid) and raises this so the conflict is visible, never silent.

UNKNOWN_DUR_REASON

readonly UNKNOWN_DUR_REASON: "NCPDP_TELECOM_UNKNOWN_DUR_REASON" = "NCPDP_TELECOM_UNKNOWN_DUR_REASON"

A request DUR/PPS Reason For Service code (439-E4) is not one this parser recognizes. The code is preserved verbatim and surfaced; only the human-readable description is absent. The interaction is never dropped.

UNKNOWN_REJECT_CODE

readonly UNKNOWN_REJECT_CODE: "NCPDP_TELECOM_UNKNOWN_REJECT_CODE" = "NCPDP_TELECOM_UNKNOWN_REJECT_CODE"

A Reject Code (511-FB) value is not one this parser recognizes. The code is preserved verbatim and surfaced with known: false; only the human-readable description is absent. The reject is never dropped or reinterpreted.

UNKNOWN_RESPONSE_STATUS

readonly UNKNOWN_RESPONSE_STATUS: "NCPDP_TELECOM_UNKNOWN_RESPONSE_STATUS" = "NCPDP_TELECOM_UNKNOWN_RESPONSE_STATUS"

A Transaction Response Status (112-AN) value is not one this parser models. The status is preserved verbatim and the disposition reads "unknown": never assumed paid, so an unrecognized status can never imply payment.

UNKNOWN_SEGMENT

readonly UNKNOWN_SEGMENT: "NCPDP_TELECOM_UNKNOWN_SEGMENT" = "NCPDP_TELECOM_UNKNOWN_SEGMENT"

A segment's identification code is not one this parser models. The segment and its fields are preserved verbatim (keyed by their field ids) and surfaced; only the human-readable segment name is left undefined.

VF6_NOT_DECODED

readonly VF6_NOT_DECODED: "NCPDP_TELECOM_VF6_NOT_DECODED" = "NCPDP_TELECOM_VF6_NOT_DECODED"

The message declares the emerging F6 version stamp. F6 changes the fixed header layout (an 8-byte IIN replaces the 6-byte BIN, among other changes), so this D.0 reader recognizes but does not decode it: the version is surfaced and the body is left untokenized rather than read against the wrong offsets.

Example

import { TELECOM_WARNING_CODES } from "@cosyte/ncpdp/telecom";
TELECOM_WARNING_CODES.UNKNOWN_SEGMENT; // "NCPDP_TELECOM_UNKNOWN_SEGMENT"