Skip to main content
Version: v0.0.6

Interface: ResultStatus

A modeled result status. The three booleans are the safety surface a consumer reads instead of string-matching the code:

  • isActiveFinal is true only for a plain F (final). It is false for a correction (C), a cancellation (X), a preliminary/partial/pending result, an absent status, and an unrecognized one, so a superseded or cancelled result can never read as current/final.
  • supersedes is true for C: this value replaces a previously transmitted one.
  • cancelled is true for X: the result cannot be done / was cancelled.

Example

import { interpretResultStatus } from "@cosyte/astm";
interpretResultStatus("C").isActiveFinal; // false (a correction is not active-final)
interpretResultStatus("X").cancelled; // true
interpretResultStatus(undefined).meaning; // "unspecified" (never "final")

Properties

cancelled

readonly cancelled: boolean

true for X: the result cannot be done / was cancelled.


code?

readonly optional code?: ResultStatusCode

The recognized status code, present only when the raw text is a known status.


isActiveFinal

readonly isActiveFinal: boolean

true only for a plain F (final): never for C, X, absent, or unrecognized.


meaning

readonly meaning: ResultStatusMeaning

The modeled meaning; "unspecified" when absent, "undefined" when unrecognized.


raw?

readonly optional raw?: string

The verbatim field text, present only when field 9 carried a value.


recognized

readonly recognized: boolean

Whether the raw text matched a recognized status letter.


supersedes

readonly supersedes: boolean

true for C: this value supersedes a previously transmitted result.