Function: orders()
orders(
msg): readonlyOrderRecord[]
Every order (O) record in the message, in wire order.
Parameters
msg
A parsed single-message stream.
Returns
readonly OrderRecord[]
The order records (possibly empty).
Throws
AstmAmbiguousStreamError (ASTM_AMBIGUOUS_MULTI_MESSAGE) when the stream
carries more than one message - see messages.
Example
import { parseAstmRecords, orders } from "@cosyte/astm";
const msg = parseAstmRecords("H|\\^&\rO|1|ACC-42||^^^687|R\rL|1\r");
orders(msg)[0]?.specimenId; // "ACC-42"