Interface: Profile
Structural placeholder for HL7 profiles. A profile bundles vendor-specific
tolerances, date formats, custom segment definitions, and optional
callbacks. Profiles are built with the defineProfile() factory.
customSegments is narrowed to the locked CustomSegmentDefinition shape,
and Profile carries an optional describe? method
so defineProfile()-produced profiles can be introspected without
consumers needing to narrow away from the Profile type. The describe
method is only populated by defineProfile(): hand-authored Profile
objects may omit it.
Example
import type { Profile } from "@cosyte/hl7";
const epic: Profile = {
name: "epic",
description: "Epic-specific quirks and date formats",
dateFormats: ["YYYYMMDDHHmmss", "YYYYMMDD"],
customSegments: {
ZDP: { fields: { departmentCode: 3, departmentName: 4 } },
},
};
Properties
customSegments?
readonlyoptionalcustomSegments?:Readonly<Record<string,CustomSegmentDefinition>>
dateFormats?
readonlyoptionaldateFormats?: readonlystring[]
describe?
readonlyoptionaldescribe?: () =>string
Returns
string
description?
readonlyoptionaldescription?:string
lineage?
readonlyoptionallineage?: readonlystring[]
name
readonlyname:string
onWarning?
readonlyoptionalonWarning?:OnWarningCallback