Skip to main content
Version: v0.0.4

Type Alias: DtmPrecision

DtmPrecision = "year" | "month" | "day" | "hour" | "minute" | "second" | "fraction"

Stated precision of a parsed HL7 DTM value: the number of populated characters (excluding the timezone offset) determines which level applies. A value's precision is preserved verbatim: |1970| is "year", never silently promoted to a full timestamp.

Example

import { parseDtm } from "@cosyte/hl7";
console.log(parseDtm("1970").precision); // "year"
console.log(parseDtm("198807050000").precision); // "minute"