Python library
python-astm
A BSD-licensed Python implementation of the ASTM E1381 and E1394 protocol, published on PyPI as astm. Its last release on PyPI dates from March 2013.
ASTM
@cosyte/astm reads the delimiters each header declares, decodes escapes before it splits a value, verifies frame checksums, and reports every deviation it tolerated as a stable, value-free warning. Zero runtime dependencies.
npm install @cosyte/astmNeed it integrated? Talk to us.
The standard
@cosyte/astm
Every analyzer reads the standard a little differently, and the usual answer is a hand-rolled split on | and ^ that returns a confidently wrong value the first time a vendor escapes a delimiter. This library surfaces a deviation it cannot resolve instead of resolving it for you.
import { parseAstmRecords, patient, results } from "@cosyte/astm";
// Synthetic ASTM records, CR-delimited. The header declares the delimiters.
const stream =
"H|\\^&|||analyzer^1|||||||P|LIS02-A2|20240115103000\r" +
"P|1|PRACTICE-0001|LAB-0002|||||F\r" +
"O|1|SPEC-7|ACC-42|^^^687|||20240115102500\r" +
"R|1|^^^687|28.6|U/L|10-40|N||F\r" +
"L|1|N\r";
const msg = parseAstmRecords(stream);
const [first] = results(msg);
console.log(first?.value, first?.units);
console.log(first?.status.meaning, first?.status.isActiveFinal);
console.log(first?.flag?.meaning);
console.log(first?.universalTestId?.localCode);
console.log(patient(msg)?.practiceAssignedId, patient(msg)?.laboratoryAssignedId);
console.log(msg.warnings.length);From the @cosyte/astm README on GitHub, verbatim. Every value in it is synthetic.
Limits
Its README names what is still moving and what is not covered:
Alternatives
Each description comes from the project’s own documentation or listing, linked below.
Python library
A BSD-licensed Python implementation of the ASTM E1381 and E1394 protocol, published on PyPI as astm. Its last release on PyPI dates from March 2013.
Node.js library
An MIT-licensed Node.js package described as reading data from ASTM. Its latest npm release dates from February 2021.
Platform agent
An application that runs inside your firewall and connects to devices over low-level protocols such as HL7/MLLP, ASTM and DICOM, as part of the Medplum platform.
Works with
It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.
Need it integrated? Talk to us, or see what our integration services cover.