Skip to main content
Version: v0.0.4

Class: ProfileDefinitionError

Thrown by defineProfile() and profile-validation code when a profile definition is structurally invalid: e.g. references an undefined parent, declares a malformed custom segment, or includes an unsupported date format. Callers may optionally supply the offending profile name for better diagnostics.

Example

import { ProfileDefinitionError } from "@cosyte/hl7";
throw new ProfileDefinitionError(
"Unknown parent profile: epic-v7",
"my-epic-extension",
);

Extends

  • Error

Constructors

Constructor

new ProfileDefinitionError(message, profileName?): ProfileDefinitionError

Internal

Construct a new ProfileDefinitionError. profileName is optional so callers may omit it when the offending profile cannot be named (e.g. during initial validation before a name is parsed).

Parameters

message

string

profileName?

string

Returns

ProfileDefinitionError

Overrides

Error.constructor

Properties

profileName

readonly profileName: string | undefined