import { ISatzMeta } from "./incidence-map"; /** * Parses a raw LDT Satz (sentence) into a structured JavaScript object. * * @param {string[]} rawSatzArray - An array of raw LDT lines that make up the Satz. * @param {ISatzMeta} [satzMeta] - An optional metadata object describing the structure of the Satz. * If not provided, the function will attempt to determine the metadata * based on the first line of the rawSatzArray. * * @returns {Satz} An object representing the parsed Satz. Each field in the Satz is represented as an object * in the `fields` array. Each field object has properties for the identifier, name, content, * and length of the field. If a field has children, they are represented as an array of field * objects in the `children` property of the field object. * * @throws {Error} Throws an error if the satzMeta is not provided and cannot be determined from the first line * of the rawSatzArray, or if a field's identifier is not defined in the satzMeta. * * @example * const rawSatzArray = [ * '8000 8220 0009 LDT1001.02', * '8100 8220 0005 00042', * '9212 8220 0010 LDT1001.02', * '0201 8220 0009 123456789', * '0203 8220 0020 Dr. med. Mustermann', * '0212 8220 0009 123456789', * '0211 8220 0020 Dr. med. Mustermann', * '0222 8220 0009 123456789', * '0205 8220 0020 Musterstraße 1', * '0215 8220 0006 12345', * '0216 8220 0020 Musterstadt', * ]; * const satz = parseSatz(rawSatzArray); * console.log(satz); * // Outputs: * // { * // fields: [ * // { identifier: '8000', name: 'Satzart', content: 'LDT1001.02', length: 9 }, * // { identifier: '8100', name: 'Satzlänge', content: '00042', length: 5 }, * // { identifier: '9212', name: 'Version der Satzbeschreibung', content: 'LDT1001.02', length: 10 }, * // { identifier: '0201', name: 'Betriebs- (BSNR) oder Nebenbetriebsstättennummer (NBSNR)', content: '123456789', length: 9 }, * // { identifier: '0203', name: '(N)BSNR-Bezeichnung', content: 'Dr. med. Mustermann', length: 20 }, * // { identifier: '0212', name: 'Lebenslange Arztnummer (LANR)', content: '123456789', length: 9 }, * // { identifier: '0211', name: 'Arztname', content: 'Dr. med. Mustermann', length: 20 }, * // { identifier: '0222', name: 'ASV-Teamnummer', content: '123456789', length: 9 }, * // { identifier: '0205', name: 'Strasse der (N)BSNR', content: 'Musterstraße 1', length: 20 }, * // { identifier: '0215', name: 'PLZ der (N)BSNR', content: '12345', length: 6 }, * // { identifier: '0216', name: 'Ort der (N)BSNR', content: 'Musterstadt', length: 20 }, * // ], * // } */ export declare const parseSatz: (rawSatzArray: string[], satzMeta?: ISatzMeta) => Satz;