/** * The two EDF+ identification grammars. * * Layer 2. Sole owner of the subfield structure of the 80-byte local patient identification * (offset 8) and the 80-byte local recording identification (offset 88). * * Three rules run through both: * * - `'X'` means unknown in ANY subfield and becomes `undefined`, never the string `'X'`. * - The raw text is ALWAYS preserved, whatever the grammar says, and subfields beyond the ones * the spec names go to `extraSubfields` — EDF+ says the field must *start with* its * subfields, so trailing extras are legal and are not a non-conformance. * - Underscores are exposed verbatim. EDF+ says a space inside a subfield must be replaced by * another character and suggests an underscore, but it mandates neither the character nor a * way back: `'Mac_Donald'` and a genuine underscore are indistinguishable, so substituting * here would corrupt one to display the other. `raw` and the subfields both keep what the * file wrote. * * Plain EDF puts free text in these fields, which is normal and not a defect. The diagnostic * therefore fires only when the file carries an EDF+/BDF+ marker; `conformant` is set honestly * either way. */ import type { DiagnosticSink } from '../diagnostics/collector.js'; import type { EdfPatientId, EdfRecordingId } from '../types.js'; /** * Whether the subfield grammar is a requirement or a convention. The same bytes are parsed * either way — plain EDF files often follow the convention anyway — and this only decides * whether a deviation is worth reporting, which is why it is an option and not a mode. */ export interface IdentificationOptions { /** * The reserved field carries an EDF+/BDF+ marker, so the subfield grammar is required rather * than merely conventional. Only then is a deviation worth a diagnostic. */ readonly edfPlus: boolean; } /** * The local patient identification: code, sex, birthdate, name, then anything else the writer * appended. * * `raw` on the result is the text exactly as it was passed in, padding included. */ export declare function parsePatientId(raw: string, options: IdentificationOptions, sink: DiagnosticSink): EdfPatientId; /** * The local recording identification: the literal `Startdate`, the start date, and the * investigation, technician and equipment codes. * * This is the only field in an EDF file that can carry a four-digit year, which is what makes * it the authority `dates.ts` prefers and the only way past 2084. */ export declare function parseRecordingId(raw: string, options: IdentificationOptions, sink: DiagnosticSink): EdfRecordingId; //# sourceMappingURL=identification.d.ts.map