Skip to main content
Version: v0.0.3

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?

readonly optional customSegments?: Readonly<Record<string, CustomSegmentDefinition>>


dateFormats?

readonly optional dateFormats?: readonly string[]


describe?

readonly optional describe?: () => string

Returns

string


description?

readonly optional description?: string


lineage?

readonly optional lineage?: readonly string[]


name

readonly name: string


onWarning?

readonly optional onWarning?: OnWarningCallback