eehrxf 0.1.131

The European interoperability software component of an EHR system under Regulation (EU) 2025/327: the format-neutral dataset model of the priority categories read from the Xt-EHR EHDS logical models, and the European electronic health record exchange format in FHIR R4, mapped from openEHR by FHIRconnect
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-License-Identifier: BUSL-1.1

//! The format-neutral dataset model of the exchange format.
//!
//! Art 15(1)(a) leaves the "harmonised datasets" to an implementing act. The
//! Xt-EHR joint action publishes them as FHIR logical models, one per
//! priority category with its building blocks, each paired with a profile
//! stating what a producer and a consumer must do with every element
//! (`xtehr.eu.ehds.models`, CC0-1.0). This module reads that package as data:
//! a [`DatasetModel`] holds every logical model, keyed on its canonical URL,
//! with its elements keyed on their element paths, and every obligations
//! profile over them. No element is a Rust type of its own; a path such as
//! `EHDSPatientSummary.allergiesAndIntolerances` is the key a crosswalk to
//! the openEHR side and to the FHIR document is written against.

pub mod constraint;
mod read;

use std::collections::BTreeMap;
use std::fmt;
use std::io;
use std::io::Read;

use crate::category::Root;
use crate::dataset::constraint::Binding;
use crate::dataset::constraint::Invariant;
use crate::dataset::constraint::Pattern;
use crate::dataset::constraint::Slicing;

/// The extension URL of an element obligation.
///
/// FHIR R5 Obligation Extension, `http://hl7.org/fhir/StructureDefinition/obligation`
/// (<https://hl7.org/fhir/extensions/StructureDefinition-obligation.html>).
pub const OBLIGATION_EXTENSION: &str = "http://hl7.org/fhir/StructureDefinition/obligation";

/// The actor the Xt-EHR package declares for a producer of a dataset.
pub const PRODUCER: &str = "https://www.xt-ehr.eu/specifications/fhir/actor-producer";

/// The actor the Xt-EHR package declares for a consumer of a dataset.
pub const CONSUMER: &str = "https://www.xt-ehr.eu/specifications/fhir/actor-consumer";

/// The obligation code that a producer is able to populate an element.
///
/// FHIR Obligation Codes, `SHALL:able-to-populate`
/// (<https://hl7.org/fhir/extensions/CodeSystem-obligation.html>).
pub const ABLE_TO_POPULATE: &str = "SHALL:able-to-populate";

/// The name and version of a FHIR package, from its `package.json`.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PackageId {
    name: String,
    version: String,
}

impl PackageId {
    /// Returns the package name, such as `xtehr.eu.ehds.models`.
    #[must_use]
    pub fn name(&self) -> &str {
        &self.name
    }

    /// Returns the package version, such as `1.0.0`.
    #[must_use]
    pub fn version(&self) -> &str {
        &self.version
    }
}

impl fmt::Display for PackageId {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}#{}", self.name, self.version)
    }
}

/// The path of one element of a logical model, as its `ElementDefinition.id`.
///
/// The id is unique within a model and names a choice slice too
/// (`EHDSLaboratoryObservation.result.value[x]:valueString`), so it is the
/// key; the first segment is the model's name.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ElementPath(String);

impl ElementPath {
    /// Returns the path as written in the package.
    #[must_use]
    pub fn as_str(&self) -> &str {
        &self.0
    }

    /// Returns the name of the model the path starts at.
    #[must_use]
    pub fn model(&self) -> &str {
        self.0
            .split_once('.')
            .map_or(self.0.as_str(), |(model, _)| model)
    }

    /// Returns the path of the element one level up, or `None` for the root.
    #[must_use]
    pub fn parent(&self) -> Option<Self> {
        self.0
            .rsplit_once('.')
            .map(|(parent, _)| Self(parent.to_owned()))
    }
}

impl fmt::Display for ElementPath {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str(&self.0)
    }
}

/// The upper bound of an element's cardinality.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum Max {
    /// At most this many occurrences; `0` removes the element.
    Bounded(u32),
    /// Any number of occurrences, written `*`.
    Unbounded,
}

/// How often an element may occur.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Cardinality {
    min: u32,
    max: Max,
}

impl Cardinality {
    /// Returns the least number of occurrences.
    #[must_use]
    pub const fn lower(&self) -> u32 {
        self.min
    }

    /// Returns the greatest number of occurrences.
    #[must_use]
    pub const fn upper(&self) -> Max {
        self.max
    }

    /// Returns whether the element must occur at least once.
    #[must_use]
    pub const fn is_required(&self) -> bool {
        self.min > 0
    }
}

impl fmt::Display for Cardinality {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.max {
            Max::Bounded(max) => write!(f, "{}..{max}", self.min),
            Max::Unbounded => write!(f, "{}..*", self.min),
        }
    }
}

/// One element of a logical model.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Element {
    path: ElementPath,
    cardinality: Cardinality,
    types: Vec<String>,
    profiles: Vec<String>,
    short: Option<String>,
    pattern: Option<Pattern>,
    slicing: Option<Slicing>,
    invariants: Vec<Invariant>,
    binding: Option<Binding>,
}

impl Element {
    /// Returns the element's path.
    #[must_use]
    pub const fn path(&self) -> &ElementPath {
        &self.path
    }

    /// Returns how often the element may occur.
    #[must_use]
    pub const fn cardinality(&self) -> Cardinality {
        self.cardinality
    }

    /// Returns the type codes the element admits, in package order: a FHIR
    /// data type (`CodeableConcept`), `Base` for a group, or the canonical
    /// URL of another logical model.
    #[must_use]
    pub fn types(&self) -> &[String] {
        &self.types
    }

    /// Returns the canonical URLs of the profiles the element's types are
    /// constrained to, in package order, each as written, a `|version`
    /// suffix included: the `targetProfile` of a reference type.
    #[must_use]
    pub fn target_profiles(&self) -> &[String] {
        &self.profiles
    }

    /// Returns the element's short label, when it carries one.
    #[must_use]
    pub fn short(&self) -> Option<&str> {
        self.short.as_deref()
    }

    /// Returns the value the element must carry, from its `fixed[x]` or
    /// `pattern[x]`, when it names one.
    #[must_use]
    pub const fn pattern(&self) -> Option<&Pattern> {
        self.pattern.as_ref()
    }

    /// Returns how the element is divided into slices, when it is sliced.
    #[must_use]
    pub const fn slicing(&self) -> Option<&Slicing> {
        self.slicing.as_ref()
    }

    /// Returns the element's invariants, in snapshot order.
    #[must_use]
    pub fn invariants(&self) -> &[Invariant] {
        &self.invariants
    }

    /// Returns the element's terminology binding, when it is bound.
    #[must_use]
    pub const fn binding(&self) -> Option<&Binding> {
        self.binding.as_ref()
    }
}

/// The elements of one snapshot, in package order, indexed by path.
#[derive(Debug, Clone, PartialEq, Eq)]
struct Elements {
    list: Vec<Element>,
    index: BTreeMap<ElementPath, usize>,
}

impl Elements {
    /// Returns the element at `path`, when the snapshot has one.
    fn get(&self, path: &str) -> Option<&Element> {
        self.index
            .get(&ElementPath(path.to_owned()))
            .and_then(|position| self.list.get(*position))
    }
}

/// One logical model of the package, with its elements in package order.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LogicalModel {
    url: String,
    name: String,
    base: Option<String>,
    elements: Elements,
}

impl LogicalModel {
    /// Returns the canonical URL of the model.
    #[must_use]
    pub fn url(&self) -> &str {
        &self.url
    }

    /// Returns the model's computable name, such as `EHDSPatientSummary`.
    #[must_use]
    pub fn name(&self) -> &str {
        &self.name
    }

    /// Returns the canonical URL of the model it specializes, when it names
    /// one.
    #[must_use]
    pub fn base(&self) -> Option<&str> {
        self.base.as_deref()
    }

    /// Returns every element of the model's snapshot, in package order.
    #[must_use]
    pub fn elements(&self) -> &[Element] {
        &self.elements.list
    }

    /// Returns the element at `path`, when the model has one.
    #[must_use]
    pub fn element(&self, path: &str) -> Option<&Element> {
        self.elements.get(path)
    }
}

/// One obligation an element carries for one or more actors.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Obligation {
    code: String,
    actors: Vec<String>,
}

impl Obligation {
    /// Returns the obligation code, such as `SHALL:able-to-populate`.
    #[must_use]
    pub fn code(&self) -> &str {
        &self.code
    }

    /// Returns the canonical URLs of the actors the obligation binds; an
    /// obligation that names none binds every actor.
    #[must_use]
    pub fn actors(&self) -> &[String] {
        &self.actors
    }

    /// Returns whether the obligation is `code` and binds `actor`.
    #[must_use]
    pub fn binds(&self, code: &str, actor: &str) -> bool {
        self.code == code
            && (self.actors.is_empty() || self.actors.iter().any(|named| named == actor))
    }
}

/// A profile that constrains a logical model with element obligations.
///
/// Its snapshot holds every element of the model it constrains, and may
/// reach further: into the elements of a logical type an element names
/// (`EHDSHealthProfessional.name.family`) and into the type slices of a
/// choice element (`EHDSObservation.result.value[x]:valueQuantity`). The
/// obligations sit on the elements of that snapshot.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ObligationProfile {
    url: String,
    name: String,
    constrains: String,
    elements: Elements,
    obligations: BTreeMap<ElementPath, Vec<Obligation>>,
}

impl ObligationProfile {
    /// Returns the canonical URL of the profile.
    #[must_use]
    pub fn url(&self) -> &str {
        &self.url
    }

    /// Returns the profile's computable name.
    #[must_use]
    pub fn name(&self) -> &str {
        &self.name
    }

    /// Returns the canonical URL of the logical model it constrains.
    #[must_use]
    pub fn constrains(&self) -> &str {
        &self.constrains
    }

    /// Returns every element of the profile's snapshot, in package order.
    #[must_use]
    pub fn elements(&self) -> &[Element] {
        &self.elements.list
    }

    /// Returns the element of the profile's snapshot at `path`, when it has
    /// one.
    #[must_use]
    pub fn element(&self, path: &str) -> Option<&Element> {
        self.elements.get(path)
    }

    /// Returns the obligations of every element that carries one, by path.
    #[must_use]
    pub const fn obligations(&self) -> &BTreeMap<ElementPath, Vec<Obligation>> {
        &self.obligations
    }

    /// Returns the paths whose obligations include `code` for `actor`, in
    /// path order.
    pub fn paths_with<'a>(
        &'a self,
        code: &'a str,
        actor: &'a str,
    ) -> impl Iterator<Item = &'a ElementPath> + 'a {
        self.obligations.iter().filter_map(move |(path, list)| {
            list.iter()
                .any(|obligation| obligation.binds(code, actor))
                .then_some(path)
        })
    }
}

/// One category's dataset: a logical model with its obligations profile.
#[derive(Debug, Clone, Copy)]
pub struct Dataset<'a> {
    model: &'a LogicalModel,
    obligations: &'a ObligationProfile,
}

impl<'a> Dataset<'a> {
    /// Returns the logical model.
    #[must_use]
    pub const fn model(&self) -> &'a LogicalModel {
        self.model
    }

    /// Returns the obligations profile over it.
    #[must_use]
    pub const fn obligations(&self) -> &'a ObligationProfile {
        self.obligations
    }

    /// Returns the elements a producer shall be able to populate, in path
    /// order: the elements an exchange-format document of the category must
    /// be able to carry.
    pub fn producer_elements(&self) -> impl Iterator<Item = &'a Element> + 'a {
        let profile = self.obligations;
        // NOTE: no specification governs this: our own design; reading puts
        // every obligation on an element of the profile's own snapshot.
        profile
            .paths_with(ABLE_TO_POPULATE, PRODUCER)
            .filter_map(move |path| profile.element(path.as_str()))
    }
}

/// The logical models and obligations profiles of one FHIR package.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DatasetModel {
    package: PackageId,
    models: BTreeMap<String, LogicalModel>,
    profiles: BTreeMap<String, ObligationProfile>,
}

impl DatasetModel {
    /// Reads the dataset model from a FHIR package archive, the gzip-compressed
    /// tarball a FHIR package registry serves.
    ///
    /// Every `StructureDefinition` of kind `logical` directly under `package/`
    /// is read: a `specialization` as a logical model, a `constraint` as an
    /// obligations profile over the model its `baseDefinition` names. Every
    /// other resource of the package is left out.
    ///
    /// # Errors
    ///
    /// Returns [`DatasetError`] when the archive cannot be read, carries no
    /// manifest, holds a JSON file that does not parse, or holds a logical
    /// definition that is defective: no snapshot, an element with no
    /// cardinality, a duplicate canonical URL or element path, a profile over
    /// a model the package lacks or whose snapshot drops one of its elements,
    /// or an obligation with no single code or with an empty actor.
    pub fn read(archive: impl Read) -> Result<Self, DatasetError> {
        read::package(archive)
    }

    /// Returns the package the model was read from.
    #[must_use]
    pub const fn package(&self) -> &PackageId {
        &self.package
    }

    /// Returns every logical model, by canonical URL.
    pub fn models(&self) -> impl Iterator<Item = &LogicalModel> {
        self.models.values()
    }

    /// Returns the logical model at `url`, when the package holds one.
    #[must_use]
    pub fn model(&self, url: &str) -> Option<&LogicalModel> {
        self.models.get(url)
    }

    /// Returns every obligations profile, by canonical URL.
    pub fn profiles(&self) -> impl Iterator<Item = &ObligationProfile> {
        self.profiles.values()
    }

    /// Returns the obligations profile at `url`, when the package holds one.
    #[must_use]
    pub fn profile(&self, url: &str) -> Option<&ObligationProfile> {
        self.profiles.get(url)
    }

    /// Returns the dataset `root` names.
    ///
    /// # Errors
    ///
    /// Returns [`DatasetError::MissingRoot`] when the package lacks the model
    /// or the profile, or holds a profile that constrains another model.
    pub fn dataset(&self, root: Root) -> Result<Dataset<'_>, DatasetError> {
        let missing = || DatasetError::MissingRoot {
            model: root.model.to_owned(),
            obligations: root.obligations.to_owned(),
        };
        let model = self.models.get(root.model).ok_or_else(missing)?;
        let obligations = self
            .profiles
            .get(root.obligations)
            .filter(|profile| profile.constrains == root.model)
            .ok_or_else(missing)?;
        Ok(Dataset { model, obligations })
    }
}

/// One resource profile of a FHIR package, read for its snapshot: the
/// element ids, slices included, a crosswalk names in the exchange format.
///
/// The HL7 Europe guides constrain a FHIR resource (`Composition`) with a
/// `StructureDefinition` of kind `resource` and derivation `constraint`,
/// whose snapshot names every slice by element id
/// (`Composition.section:sectionAllergies.entry:allergyOrIntolerance`) and
/// the profiles each reference may target.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ResourceProfile {
    package: PackageId,
    url: String,
    name: String,
    version: Option<String>,
    elements: Elements,
}

impl ResourceProfile {
    /// Reads the profile at the canonical `url` from a FHIR package archive,
    /// the gzip-compressed tarball a FHIR package registry serves.
    ///
    /// # Errors
    ///
    /// Returns [`DatasetError`] when the archive cannot be read, carries no
    /// manifest, holds a JSON file that does not parse, holds no
    /// `StructureDefinition` at `url` ([`DatasetError::MissingProfile`]) or
    /// two of them, or holds one with no snapshot, an element with no
    /// cardinality, or an element id given twice.
    pub fn read(archive: impl Read, url: &str) -> Result<Self, DatasetError> {
        read::resource_profile(archive, url)
    }

    /// Returns the package the profile was read from.
    #[must_use]
    pub const fn package(&self) -> &PackageId {
        &self.package
    }

    /// Returns the canonical URL of the profile.
    #[must_use]
    pub fn url(&self) -> &str {
        &self.url
    }

    /// Returns the profile's computable name.
    #[must_use]
    pub fn name(&self) -> &str {
        &self.name
    }

    /// Returns the profile's business version, when it carries one.
    #[must_use]
    pub fn version(&self) -> Option<&str> {
        self.version.as_deref()
    }

    /// Returns every element of the profile's snapshot, in package order.
    #[must_use]
    pub fn elements(&self) -> &[Element] {
        &self.elements.list
    }

    /// Returns the element of the snapshot whose id is `id`, when it has one.
    #[must_use]
    pub fn element(&self, id: &str) -> Option<&Element> {
        self.elements.get(id)
    }
}

/// Why a package does not give a dataset model.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DatasetError {
    /// The archive could not be read as a gzip-compressed tarball.
    #[error("the package archive cannot be read")]
    Archive {
        /// The read failure.
        #[source]
        source: io::Error,
    },
    /// The archive holds no `package/package.json`.
    #[error("the package archive holds no package/package.json")]
    MissingManifest,
    /// A JSON file of the package does not parse as the shape it must have.
    #[error("{file} does not parse")]
    Json {
        /// The file, as its archive path.
        file: String,
        /// The parse failure.
        #[source]
        source: serde_json::Error,
    },
    /// Two definitions of the package carry one canonical URL.
    #[error("two definitions carry the canonical URL {url}")]
    DuplicateUrl {
        /// The URL.
        url: String,
    },
    /// A logical definition is neither a specialization nor a constraint.
    #[error("{url} has the derivation {derivation:?}, neither specialization nor constraint")]
    Derivation {
        /// The definition's URL.
        url: String,
        /// The derivation it declares, when it declares one.
        derivation: Option<String>,
    },
    /// A logical definition carries no snapshot.
    #[error("{url} carries no snapshot")]
    MissingSnapshot {
        /// The definition's URL.
        url: String,
    },
    /// An element carries no `id`, no `min` or no `max`, or a `max` that is
    /// neither `*` nor a number.
    #[error("{url} has an element at {path} with no id or no readable cardinality")]
    Element {
        /// The definition's URL.
        url: String,
        /// The element's `path`.
        path: String,
    },
    /// An element of a definition's snapshot does not parse as an
    /// `ElementDefinition`.
    #[error("{url} has an element that does not parse")]
    ElementJson {
        /// The definition's URL.
        url: String,
        /// The parse failure.
        #[source]
        source: serde_json::Error,
    },
    /// An element's slicing names a discriminator type or rules outside the
    /// R4 value sets.
    #[error("{url} slices {path} with a discriminator or rules outside the R4 value sets")]
    Slicing {
        /// The definition's URL.
        url: String,
        /// The sliced element's id.
        path: String,
    },
    /// An element's binding names a strength outside the R4 value set.
    #[error("{url} binds {path} with a strength outside the R4 value set")]
    Binding {
        /// The definition's URL.
        url: String,
        /// The bound element's id.
        path: String,
    },
    /// Two elements of one definition carry one id.
    #[error("{url} carries the element {path} twice")]
    DuplicateElement {
        /// The definition's URL.
        url: String,
        /// The repeated id.
        path: String,
    },
    /// A constraint profile names no `baseDefinition`.
    #[error("{url} is a constraint with no baseDefinition")]
    MissingBase {
        /// The profile's URL.
        url: String,
    },
    /// A constraint profile names a base the package holds no model for.
    #[error("{url} constrains {base}, which the package holds no model for")]
    UnknownBase {
        /// The profile's URL.
        url: String,
        /// The base it names.
        base: String,
    },
    /// A constraint profile's snapshot drops an element of the model it
    /// constrains.
    #[error("{url} constrains {base} but its snapshot lacks {path}")]
    Uncovered {
        /// The profile's URL.
        url: String,
        /// The model's URL.
        base: String,
        /// The element id the profile lacks.
        path: String,
    },
    /// An obligation extension carries no single `code`.
    #[error("{url} has an obligation on {path} with no single code")]
    Obligation {
        /// The profile's URL.
        url: String,
        /// The element id.
        path: String,
    },
    /// The package holds no `StructureDefinition` at the canonical URL asked
    /// for.
    #[error("the package holds no StructureDefinition {url}")]
    MissingProfile {
        /// The URL.
        url: String,
    },
    /// The package lacks the model or the profile a category names.
    #[error("the package holds no model {model} with the profile {obligations} over it")]
    MissingRoot {
        /// The model's URL.
        model: String,
        /// The profile's URL.
        obligations: String,
    },
}