Skip to main content

automapper_validation/generated/fv2504/
remadv_conditions_fv2504.rs

1// <auto-generated>
2// Generated by automapper-generator generate-conditions
3// AHB: xml-migs-and-ahbs/FV2504/REMADV_AHB_2_5d_Fehlerkorrektur_20250623.xml
4// Generated: 2026-03-12T09:52:00Z
5// </auto-generated>
6
7// LLM-produced bodies aren't idiomatic Rust — silence stylistic lints at
8// file scope so `cargo clippy -D warnings` stays green. Correctness,
9// suspicious, and perf categories stay on so real bugs still surface.
10#![allow(clippy::style, clippy::complexity)]
11
12#[allow(unused_imports)]
13use crate::eval::format_validators::*;
14use crate::eval::{Cluster, ConditionEvaluator, ConditionResult, EvaluationContext};
15// HAND-EDITED: shared cluster helpers for [14]/[15]/[16]/[517]/[518].
16// Preserve across regeneration — see CLAUDE.md "Codelist Providers".
17use crate::eval::ebd_cluster::{any_scoped_ajt_in_cluster, resolved_ajt_code_in_cluster};
18
19/// Generated condition evaluator for REMADV FV2504.
20pub struct RemadvConditionEvaluatorFV2504 {
21    // External condition IDs that require runtime context.
22    external_conditions: std::collections::HashSet<u32>,
23}
24
25impl Default for RemadvConditionEvaluatorFV2504 {
26    fn default() -> Self {
27        let mut external_conditions = std::collections::HashSet::new();
28        external_conditions.insert(45);
29        external_conditions.insert(492);
30        external_conditions.insert(493);
31        Self {
32            external_conditions,
33        }
34    }
35}
36
37impl ConditionEvaluator for RemadvConditionEvaluatorFV2504 {
38    fn message_type(&self) -> &str {
39        "REMADV"
40    }
41
42    fn format_version(&self) -> &str {
43        "FV2504"
44    }
45
46    fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
47        match condition {
48            2 => self.evaluate_2(ctx),
49            3 => self.evaluate_3(ctx),
50            4 => self.evaluate_4(ctx),
51            8 => self.evaluate_8(ctx),
52            9 => self.evaluate_9(ctx),
53            11 => self.evaluate_11(ctx),
54            12 => self.evaluate_12(ctx),
55            14 => self.evaluate_14(ctx),
56            15 => self.evaluate_15(ctx),
57            16 => self.evaluate_16(ctx),
58            18 => self.evaluate_18(ctx),
59            22 => self.evaluate_22(ctx),
60            26 => self.evaluate_26(ctx),
61            28 => self.evaluate_28(ctx),
62            33 => self.evaluate_33(ctx),
63            34 => self.evaluate_34(ctx),
64            35 => self.evaluate_35(ctx),
65            36 => self.evaluate_36(ctx),
66            39 => self.evaluate_39(ctx),
67            40 => self.evaluate_40(ctx),
68            41 => self.evaluate_41(ctx),
69            42 => self.evaluate_42(ctx),
70            43 => self.evaluate_43(ctx),
71            45 => self.evaluate_45(ctx),
72            47 => self.evaluate_47(ctx),
73            48 => self.evaluate_48(ctx),
74            49 => self.evaluate_49(ctx),
75            50 => self.evaluate_50(ctx),
76            51 => self.evaluate_51(ctx),
77            52 => self.evaluate_52(ctx),
78            53 => self.evaluate_53(ctx),
79            54 => self.evaluate_54(ctx),
80            55 => self.evaluate_55(ctx),
81            56 => self.evaluate_56(ctx),
82            57 => self.evaluate_57(ctx),
83            58 => self.evaluate_58(ctx),
84            59 => self.evaluate_59(ctx),
85            60 => self.evaluate_60(ctx),
86            61 => self.evaluate_61(ctx),
87            62 => self.evaluate_62(ctx),
88            63 => self.evaluate_63(ctx),
89            64 => self.evaluate_64(ctx),
90            65 => self.evaluate_65(ctx),
91            66 => self.evaluate_66(ctx),
92            67 => self.evaluate_67(ctx),
93            68 => self.evaluate_68(ctx),
94            69 => self.evaluate_69(ctx),
95            70 => self.evaluate_70(ctx),
96            71 => self.evaluate_71(ctx),
97            72 => self.evaluate_72(ctx),
98            73 => self.evaluate_73(ctx),
99            74 => self.evaluate_74(ctx),
100            75 => self.evaluate_75(ctx),
101            76 => self.evaluate_76(ctx),
102            77 => self.evaluate_77(ctx),
103            78 => self.evaluate_78(ctx),
104            79 => self.evaluate_79(ctx),
105            80 => self.evaluate_80(ctx),
106            81 => self.evaluate_81(ctx),
107            82 => self.evaluate_82(ctx),
108            83 => self.evaluate_83(ctx),
109            84 => self.evaluate_84(ctx),
110            85 => self.evaluate_85(ctx),
111            86 => self.evaluate_86(ctx),
112            87 => self.evaluate_87(ctx),
113            88 => self.evaluate_88(ctx),
114            89 => self.evaluate_89(ctx),
115            90 => self.evaluate_90(ctx),
116            91 => self.evaluate_91(ctx),
117            92 => self.evaluate_92(ctx),
118            93 => self.evaluate_93(ctx),
119            94 => self.evaluate_94(ctx),
120            95 => self.evaluate_95(ctx),
121            97 => self.evaluate_97(ctx),
122            98 => self.evaluate_98(ctx),
123            99 => self.evaluate_99(ctx),
124            101 => self.evaluate_101(ctx),
125            102 => self.evaluate_102(ctx),
126            103 => self.evaluate_103(ctx),
127            104 => self.evaluate_104(ctx),
128            492 => self.evaluate_492(ctx),
129            493 => self.evaluate_493(ctx),
130            501 => self.evaluate_501(ctx),
131            502 => self.evaluate_502(ctx),
132            503 => self.evaluate_503(ctx),
133            510 => self.evaluate_510(ctx),
134            511 => self.evaluate_511(ctx),
135            512 => self.evaluate_512(ctx),
136            515 => self.evaluate_515(ctx),
137            517 => self.evaluate_517(ctx),
138            518 => self.evaluate_518(ctx),
139            519 => self.evaluate_519(ctx),
140            520 => self.evaluate_520(ctx),
141            521 => self.evaluate_521(ctx),
142            523 => self.evaluate_523(ctx),
143            525 => self.evaluate_525(ctx),
144            526 => self.evaluate_526(ctx),
145            529 => self.evaluate_529(ctx),
146            533 => self.evaluate_533(ctx),
147            534 => self.evaluate_534(ctx),
148            535 => self.evaluate_535(ctx),
149            536 => self.evaluate_536(ctx),
150            537 => self.evaluate_537(ctx),
151            538 => self.evaluate_538(ctx),
152            544 => self.evaluate_544(ctx),
153            548 => self.evaluate_548(ctx),
154            549 => self.evaluate_549(ctx),
155            926 => self.evaluate_926(ctx),
156            930 => self.evaluate_930(ctx),
157            931 => self.evaluate_931(ctx),
158            939 => self.evaluate_939(ctx),
159            940 => self.evaluate_940(ctx),
160            _ => ConditionResult::Unknown,
161        }
162    }
163
164    fn is_external(&self, condition: u32) -> bool {
165        self.external_conditions.contains(&condition)
166    }
167    fn is_known(&self, condition: u32) -> bool {
168        matches!(
169            condition,
170            2 | 3
171                | 4
172                | 8
173                | 9
174                | 11
175                | 12
176                | 14
177                | 15
178                | 16
179                | 18
180                | 22
181                | 26
182                | 28
183                | 33
184                | 34
185                | 35
186                | 36
187                | 39
188                | 40
189                | 41
190                | 42
191                | 43
192                | 45
193                | 47
194                | 48
195                | 49
196                | 50
197                | 51
198                | 52
199                | 53
200                | 54
201                | 55
202                | 56
203                | 57
204                | 58
205                | 59
206                | 60
207                | 61
208                | 62
209                | 63
210                | 64
211                | 65
212                | 66
213                | 67
214                | 68
215                | 69
216                | 70
217                | 71
218                | 72
219                | 73
220                | 74
221                | 75
222                | 76
223                | 77
224                | 78
225                | 79
226                | 80
227                | 81
228                | 82
229                | 83
230                | 84
231                | 85
232                | 86
233                | 87
234                | 88
235                | 89
236                | 90
237                | 91
238                | 92
239                | 93
240                | 94
241                | 95
242                | 97
243                | 98
244                | 99
245                | 101
246                | 102
247                | 103
248                | 104
249                | 492
250                | 493
251                | 501
252                | 502
253                | 503
254                | 510
255                | 511
256                | 512
257                | 515
258                | 517
259                | 518
260                | 519
261                | 520
262                | 521
263                | 523
264                | 525
265                | 526
266                | 529
267                | 533
268                | 534
269                | 535
270                | 536
271                | 537
272                | 538
273                | 544
274                | 548
275                | 549
276                | 926
277                | 930
278                | 931
279                | 939
280                | 940
281        )
282    }
283}
284
285impl RemadvConditionEvaluatorFV2504 {
286    /// [45] Nur MP-ID aus Sparte Strom
287    /// EXTERNAL: Requires context from outside the message.
288    fn evaluate_45(&self, ctx: &EvaluationContext) -> ConditionResult {
289        ctx.external.evaluate("mp_id_is_strom_sector")
290    }
291
292    /// [2] Wenn SG7 AJT+28 vorhanden
293    fn evaluate_2(&self, ctx: &EvaluationContext) -> ConditionResult {
294        ctx.any_group_has_qualifier("AJT", 0, "28", &["SG7"])
295    }
296
297    /// [3] Bei SG5 DOC+389 / Z25 ist der Wert aus derselben SG5 MOA+9 mit (-1) multipliziert anzugeben.
298    fn evaluate_3(&self, _ctx: &EvaluationContext) -> ConditionResult {
299        // Hinweis: Bei SG5 DOC+389/Z25 ist der Wert aus derselben SG5 MOA+9 mit (-1) multipliziert anzugeben.
300        // Informational annotation describing the calculation rule for MOA+12 (Überweisungsbetrag).
301        ConditionResult::True
302    }
303
304    /// [4] Bei SG5 DOC+380 / 457 ist der Wert aus derselben SG5 MOA+9 unverändert anzugeben.
305    fn evaluate_4(&self, _ctx: &EvaluationContext) -> ConditionResult {
306        // Hinweis: Bei SG5 DOC+380/457 ist der Wert aus derselben SG5 MOA+9 unverändert anzugeben.
307        // Informational annotation describing that MOA+12 (Überweisungsbetrag) equals MOA+9 unchanged.
308        ConditionResult::True
309    }
310
311    /// [8] Wenn SG7 AJT+A01/A02+E_0505 vorhanden
312    fn evaluate_8(&self, ctx: &EvaluationContext) -> ConditionResult {
313        let ajts = ctx.find_segments("AJT");
314        let found = ajts.iter().any(|s| {
315            let elem0 = s
316                .elements
317                .first()
318                .and_then(|e| e.first())
319                .map(|s| s.as_str())
320                .unwrap_or("");
321            let elem1 = s
322                .elements
323                .get(1)
324                .and_then(|e| e.first())
325                .map(|s| s.as_str())
326                .unwrap_or("");
327            (elem0 == "A01" || elem0 == "A02") && elem1 == "E_0505"
328        });
329        ConditionResult::from(found)
330    }
331
332    /// [9] Wenn SG7 AJT+A32/A99+E_0503 vorhanden
333    fn evaluate_9(&self, ctx: &EvaluationContext) -> ConditionResult {
334        let ajts = ctx.find_segments("AJT");
335        let found = ajts.iter().any(|s| {
336            let elem0 = s
337                .elements
338                .first()
339                .and_then(|e| e.first())
340                .map(|s| s.as_str())
341                .unwrap_or("");
342            let elem1 = s
343                .elements
344                .get(1)
345                .and_then(|e| e.first())
346                .map(|s| s.as_str())
347                .unwrap_or("");
348            (elem0 == "A32" || elem0 == "A99") && elem1 == "E_0503"
349        });
350        ConditionResult::from(found)
351    }
352
353    /// [11] Wenn in diesem AJT DE1082 = E_0406
354    // REVIEW: Check if AJT has DE1082 (elements[1][0]) == E_0406. 'In diesem AJT' implies same-segment context; message-wide fallback via has_qualifier is the safe approximation without per-instance scoping. (medium confidence)
355    fn evaluate_11(&self, ctx: &EvaluationContext) -> ConditionResult {
356        ctx.has_qualifier("AJT", 1, "E_0406")
357    }
358
359    /// [12] Wenn in diesem AJT DE1082 = E_0407
360    // REVIEW: Check if AJT has DE1082 (elements[1][0]) == E_0407. Same pattern as condition 11. (medium confidence)
361    fn evaluate_12(&self, ctx: &EvaluationContext) -> ConditionResult {
362        ctx.has_qualifier("AJT", 1, "E_0407")
363    }
364
365    /// [14] A-Code aus Cluster Ablehnung auf Kopfebene
366    // HAND-EDITED: per-EBD cluster data (mako_prozesse). Resolves to
367    // True when the AJT DE4465 being validated is Ablehnung-Kopfebene
368    // in its referenced EBD (DE1082). Unknown without resolved context.
369    fn evaluate_14(&self, ctx: &EvaluationContext) -> ConditionResult {
370        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_kopfebene)
371    }
372
373    /// [15] A-Code aus Cluster Ablehnung auf Positionsebene
374    // HAND-EDITED: per-EBD cluster data (mako_prozesse).
375    fn evaluate_15(&self, ctx: &EvaluationContext) -> ConditionResult {
376        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_positionsebene)
377    }
378
379    /// [16] A-Code aus Cluster Ablehnung auf Summenebene
380    // HAND-EDITED: per-EBD cluster data (mako_prozesse).
381    fn evaluate_16(&self, ctx: &EvaluationContext) -> ConditionResult {
382        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_summenebene)
383    }
384
385    /// [18] Wenn in dieser SG7 AJT DE4465 = A74/A75/A76/AC5
386    fn evaluate_18(&self, ctx: &EvaluationContext) -> ConditionResult {
387        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
388        ctx.this_group_has_any_qualifier("AJT", 0, &["A74", "A75", "A76", "AC5"], &["SG7"])
389    }
390
391    /// [22] Wenn in dieser SG7 AJT DE4465 = A02/A06/A16/A66/A67/A68/A69/A78/A90/A95/A96/AC3/AC4
392    fn evaluate_22(&self, ctx: &EvaluationContext) -> ConditionResult {
393        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
394        ctx.this_group_has_any_qualifier(
395            "AJT",
396            0,
397            &[
398                "A02", "A06", "A16", "A66", "A67", "A68", "A69", "A78", "A90", "A95", "A96", "AC3",
399                "AC4",
400            ],
401            &["SG7"],
402        )
403    }
404
405    /// [26] Wenn in dieser SG12 AJT DE4465 = A51/A62/A82/AA1/AA6/AA7/AB8/AD6
406    fn evaluate_26(&self, ctx: &EvaluationContext) -> ConditionResult {
407        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
408        ctx.this_group_has_any_qualifier(
409            "AJT",
410            0,
411            &["A51", "A62", "A82", "AA1", "AA6", "AA7", "AB8", "AD6"],
412            &["SG12"],
413        )
414    }
415
416    /// [28] Wenn in dieser SG12 AJT DE4465 = A23/A26/A35/A36/A38/A46/A47/A48/A50/A58/A59/A61/A77/A84/A99
417    fn evaluate_28(&self, ctx: &EvaluationContext) -> ConditionResult {
418        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
419        ctx.this_group_has_any_qualifier(
420            "AJT",
421            0,
422            &[
423                "A23", "A26", "A35", "A36", "A38", "A46", "A47", "A48", "A50", "A58", "A59", "A61",
424                "A77", "A84", "A99",
425            ],
426            &["SG12"],
427        )
428    }
429
430    /// [33] Wenn in diesem AJT DE1082 = S_0103
431    // REVIEW: Check if AJT has DE1082 (elements[1][0]) == S_0103. 'In diesem AJT' scoping approximated by message-wide check via has_qualifier. (medium confidence)
432    fn evaluate_33(&self, ctx: &EvaluationContext) -> ConditionResult {
433        ctx.has_qualifier("AJT", 1, "S_0103")
434    }
435
436    /// [34] Wenn in diesem AJT DE1082 = S_0104
437    fn evaluate_34(&self, ctx: &EvaluationContext) -> ConditionResult {
438        ctx.has_qualifier("AJT", 1, "S_0104")
439    }
440
441    /// [35] Wenn in dieser SG12 AJT DE4465 = A34/A39/AA2/AB2
442    fn evaluate_35(&self, ctx: &EvaluationContext) -> ConditionResult {
443        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
444        ctx.this_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
445    }
446
447    /// [36] Wenn in dieser SG7 AJT DE4465 = A12/A75/A80/AE1
448    fn evaluate_36(&self, ctx: &EvaluationContext) -> ConditionResult {
449        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
450        ctx.this_group_has_any_qualifier("AJT", 0, &["A12", "A75", "A80", "AE1"], &["SG7"])
451    }
452
453    /// [39] Wenn in dieser SG7 AJT DE4465 = AC1
454    fn evaluate_39(&self, ctx: &EvaluationContext) -> ConditionResult {
455        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
456        ctx.this_group_has_qualifier("AJT", 0, "AC1", &["SG7"])
457    }
458
459    /// [40] Wenn in dieser SG7 AJT DE1082 = E_0406
460    fn evaluate_40(&self, ctx: &EvaluationContext) -> ConditionResult {
461        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
462        ctx.this_group_has_qualifier("AJT", 1, "E_0406", &["SG7"])
463    }
464
465    /// [41] Wenn in dieser SG7 AJT DE1082 = E_0407
466    fn evaluate_41(&self, ctx: &EvaluationContext) -> ConditionResult {
467        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
468        ctx.this_group_has_qualifier("AJT", 1, "E_0407", &["SG7"])
469    }
470
471    /// [42] Wenn in SG7 AJT DE1082 = E_0407/E_0568/E_0521/E_0517/E_0266
472    fn evaluate_42(&self, ctx: &EvaluationContext) -> ConditionResult {
473        ctx.any_group_has_any_qualifier(
474            "AJT",
475            1,
476            &["E_0407", "E_0568", "E_0521", "E_0517", "E_0266"],
477            &["SG7"],
478        )
479    }
480
481    /// [43] Wenn in SG12 AJT DE4465=28
482    fn evaluate_43(&self, ctx: &EvaluationContext) -> ConditionResult {
483        ctx.any_group_has_qualifier("AJT", 0, "28", &["SG12"])
484    }
485
486    /// [47] Wenn in diesem AJT DE1082 = E_0210
487    fn evaluate_47(&self, ctx: &EvaluationContext) -> ConditionResult {
488        ctx.has_qualifier("AJT", 1, "E_0210")
489    }
490
491    /// [48] Wenn in diesem AJT DE1082 = E_0259
492    fn evaluate_48(&self, ctx: &EvaluationContext) -> ConditionResult {
493        ctx.has_qualifier("AJT", 1, "E_0259")
494    }
495
496    /// [49] Wenn in dieser SG7 AJT DE4465 = A05/A22/A23/A90/A96
497    fn evaluate_49(&self, ctx: &EvaluationContext) -> ConditionResult {
498        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
499        ctx.this_group_has_any_qualifier("AJT", 0, &["A05", "A22", "A23", "A90", "A96"], &["SG7"])
500    }
501
502    /// [50] Wenn in dieser SG7 AJT DE4465 = A05/A18/A19/A20/A90/A96
503    fn evaluate_50(&self, ctx: &EvaluationContext) -> ConditionResult {
504        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
505        ctx.this_group_has_any_qualifier(
506            "AJT",
507            0,
508            &["A05", "A18", "A19", "A20", "A90", "A96"],
509            &["SG7"],
510        )
511    }
512
513    /// [51] Wenn in dieser SG12 AJT DE1082 = E_0406
514    fn evaluate_51(&self, ctx: &EvaluationContext) -> ConditionResult {
515        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
516        ctx.this_group_has_qualifier("AJT", 1, "E_0406", &["SG12"])
517    }
518
519    /// [52] Wenn in dieser SG12 AJT DE1082 = E_0407
520    fn evaluate_52(&self, ctx: &EvaluationContext) -> ConditionResult {
521        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
522        ctx.this_group_has_qualifier("AJT", 1, "E_0407", &["SG12"])
523    }
524
525    /// [53] Wenn in dieser SG12 AJT DE4465 = A25/A31/A99/AF1
526    fn evaluate_53(&self, ctx: &EvaluationContext) -> ConditionResult {
527        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
528        ctx.this_group_has_any_qualifier("AJT", 0, &["A25", "A31", "A99", "AF1"], &["SG5", "SG12"])
529    }
530
531    /// [54] Wenn in dieser SG12 AJT DE1082 = E_0210
532    fn evaluate_54(&self, ctx: &EvaluationContext) -> ConditionResult {
533        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
534        ctx.this_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG12"])
535    }
536
537    /// [55] Wenn in dieser SG12 AJT DE1082 = E_0259
538    fn evaluate_55(&self, ctx: &EvaluationContext) -> ConditionResult {
539        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
540        ctx.this_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG12"])
541    }
542
543    /// [56] Wenn in dieser SG7 AJT DE4465 = A21
544    fn evaluate_56(&self, ctx: &EvaluationContext) -> ConditionResult {
545        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
546        ctx.this_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
547    }
548
549    /// [57] Wenn in dieser SG7 AJT DE1082 = E_0210
550    fn evaluate_57(&self, ctx: &EvaluationContext) -> ConditionResult {
551        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
552        ctx.this_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG7"])
553    }
554
555    /// [58] Wenn in dieser SG7 AJT DE1082 = E_0259
556    fn evaluate_58(&self, ctx: &EvaluationContext) -> ConditionResult {
557        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
558        ctx.this_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG7"])
559    }
560
561    /// [59] Wenn SG7 AJT+A99+E_0459 vorhanden
562    fn evaluate_59(&self, ctx: &EvaluationContext) -> ConditionResult {
563        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0459"], &["SG5", "SG7"])
564    }
565
566    /// [60] Wenn SG7 AJT+A99+E_0243 vorhanden
567    fn evaluate_60(&self, ctx: &EvaluationContext) -> ConditionResult {
568        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0243"], &["SG5", "SG7"])
569    }
570
571    /// [61] Wenn SG7 AJT+A99+E_0261 vorhanden
572    fn evaluate_61(&self, ctx: &EvaluationContext) -> ConditionResult {
573        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0261"], &["SG5", "SG7"])
574    }
575
576    /// [62] Wenn SG7 AJT+A99+E_1007 vorhanden
577    fn evaluate_62(&self, ctx: &EvaluationContext) -> ConditionResult {
578        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_1007"], &["SG5", "SG7"])
579    }
580
581    /// [63] Wenn SG7 AJT+A01/A02+E_1009 vorhanden
582    fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
583        let a01 =
584            ctx.any_group_has_qualified_value("AJT", 0, "A01", 1, 0, &["E_1009"], &["SG5", "SG7"]);
585        let a02 =
586            ctx.any_group_has_qualified_value("AJT", 0, "A02", 1, 0, &["E_1009"], &["SG5", "SG7"]);
587        match (a01, a02) {
588            (ConditionResult::True, _) | (_, ConditionResult::True) => ConditionResult::True,
589            (ConditionResult::False, ConditionResult::False) => ConditionResult::False,
590            _ => ConditionResult::Unknown,
591        }
592    }
593
594    /// [64] Wenn in dieser SG12 AJT DE1082 = E_0264
595    fn evaluate_64(&self, ctx: &EvaluationContext) -> ConditionResult {
596        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
597        ctx.this_group_has_qualifier("AJT", 1, "E_0264", &["SG5", "SG12"])
598    }
599
600    /// [65] Wenn in dieser SG12 AJT DE1082 = E_0515
601    fn evaluate_65(&self, ctx: &EvaluationContext) -> ConditionResult {
602        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
603        ctx.this_group_has_qualifier("AJT", 1, "E_0515", &["SG5", "SG12"])
604    }
605
606    /// [66] Wenn in dieser SG12 AJT DE1082 = E_0519
607    fn evaluate_66(&self, ctx: &EvaluationContext) -> ConditionResult {
608        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
609        ctx.this_group_has_qualifier("AJT", 1, "E_0519", &["SG5", "SG12"])
610    }
611
612    /// [67] Wenn in dieser SG12 AJT DE1082 = E_0266
613    fn evaluate_67(&self, ctx: &EvaluationContext) -> ConditionResult {
614        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
615        ctx.this_group_has_qualifier("AJT", 1, "E_0266", &["SG5", "SG12"])
616    }
617
618    /// [68] Wenn in dieser SG12 AJT DE1082 = E_0517
619    fn evaluate_68(&self, ctx: &EvaluationContext) -> ConditionResult {
620        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
621        ctx.this_group_has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"], &["SG12"])
622    }
623
624    /// [69] Wenn in dieser SG12 AJT DE1082 = E_0521
625    fn evaluate_69(&self, ctx: &EvaluationContext) -> ConditionResult {
626        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
627        ctx.this_group_has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"], &["SG12"])
628    }
629
630    /// [70] Wenn in dieser SG12 AJT DE4465 = A15
631    fn evaluate_70(&self, ctx: &EvaluationContext) -> ConditionResult {
632        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
633        ctx.this_group_has_qualifier("AJT", 0, "A15", &["SG12"])
634    }
635
636    /// [71] Wenn in dieser SG12 AJT DE4465 = A99
637    fn evaluate_71(&self, ctx: &EvaluationContext) -> ConditionResult {
638        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
639        ctx.this_group_has_qualifier("AJT", 0, "A99", &["SG12"])
640    }
641
642    /// [72] Wenn SG7 AJT+A99+E_0518 vorhanden
643    fn evaluate_72(&self, ctx: &EvaluationContext) -> ConditionResult {
644        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0518"], &["SG7"])
645    }
646
647    /// [73] Wenn SG7 AJT+A99+E_0522 vorhanden
648    fn evaluate_73(&self, ctx: &EvaluationContext) -> ConditionResult {
649        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0522"], &["SG7"])
650    }
651
652    /// [74] Wenn SG7 AJT+A99+E_0267 vorhanden
653    fn evaluate_74(&self, ctx: &EvaluationContext) -> ConditionResult {
654        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0267"], &["SG7"])
655    }
656
657    /// [75] Wenn in diesem AJT DE1082 = E_0264
658    // REVIEW: 'In diesem AJT' means current segment context; approximated as message-wide AJT search. DE1082 at elements[1][0]. Redundant qual+val check correctly matches E_0264. (medium confidence)
659    fn evaluate_75(&self, ctx: &EvaluationContext) -> ConditionResult {
660        ctx.has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"])
661    }
662
663    /// [76] Wenn in diesem AJT DE1082 = E_0266
664    // REVIEW: Same pattern as 75, checking DE1082=E_0266 in any AJT segment. (medium confidence)
665    fn evaluate_76(&self, ctx: &EvaluationContext) -> ConditionResult {
666        ctx.has_qualified_value("AJT", 1, "E_0266", 1, 0, &["E_0266"])
667    }
668
669    /// [77] Wenn in diesem AJT DE1082 = E_0515
670    // REVIEW: Same pattern as 75, checking DE1082=E_0515 in any AJT segment. (medium confidence)
671    fn evaluate_77(&self, ctx: &EvaluationContext) -> ConditionResult {
672        ctx.has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"])
673    }
674
675    /// [78] Wenn in diesem AJT DE1082 = E_0517
676    // REVIEW: Same pattern as 75, checking DE1082=E_0517 in any AJT segment. (medium confidence)
677    fn evaluate_78(&self, ctx: &EvaluationContext) -> ConditionResult {
678        ctx.has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"])
679    }
680
681    /// [79] Wenn in diesem AJT DE1082 = E_0519
682    // REVIEW: Same pattern as 75, checking DE1082=E_0519 in any AJT segment. (medium confidence)
683    fn evaluate_79(&self, ctx: &EvaluationContext) -> ConditionResult {
684        ctx.has_qualified_value("AJT", 1, "E_0519", 1, 0, &["E_0519"])
685    }
686
687    /// [80] Wenn in diesem AJT DE1082 = E_0521
688    // REVIEW: Same pattern as 75, checking DE1082=E_0521 in any AJT segment. (medium confidence)
689    fn evaluate_80(&self, ctx: &EvaluationContext) -> ConditionResult {
690        ctx.has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"])
691    }
692
693    /// [81] Wenn in dieser SG7 AJT DE1082 = E_0264
694    fn evaluate_81(&self, ctx: &EvaluationContext) -> ConditionResult {
695        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
696        ctx.this_group_has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"], &["SG7"])
697    }
698
699    /// [82] Wenn in dieser SG7 AJT DE1082 = E_0515
700    fn evaluate_82(&self, ctx: &EvaluationContext) -> ConditionResult {
701        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
702        ctx.this_group_has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"], &["SG7"])
703    }
704
705    /// [83] Wenn in dieser SG7 AJT DE1082 = E_0519
706    fn evaluate_83(&self, ctx: &EvaluationContext) -> ConditionResult {
707        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
708        let values = ctx.this_group_values("AJT", 1, 0, &["SG7"]);
709        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0519"))
710    }
711
712    /// [84] Wenn in dieser SG7 AJT DE1082 = E_0266
713    fn evaluate_84(&self, ctx: &EvaluationContext) -> ConditionResult {
714        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
715        let values = ctx.this_group_values("AJT", 1, 0, &["SG7"]);
716        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0266"))
717    }
718
719    /// [85] Wenn in dieser SG7 AJT DE1082 = E_0517
720    fn evaluate_85(&self, ctx: &EvaluationContext) -> ConditionResult {
721        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
722        let values = ctx.this_group_values("AJT", 1, 0, &["SG7"]);
723        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0517"))
724    }
725
726    /// [86] Wenn in dieser SG7 AJT DE1082 = E_0521
727    fn evaluate_86(&self, ctx: &EvaluationContext) -> ConditionResult {
728        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
729        let values = ctx.this_group_values("AJT", 1, 0, &["SG7"]);
730        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0521"))
731    }
732
733    /// [87] Wenn in dieser SG7 AJT DE4465 = A05/A21/A22/A23/A90/A96/AE7
734    fn evaluate_87(&self, ctx: &EvaluationContext) -> ConditionResult {
735        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
736        ctx.this_group_has_any_qualifier(
737            "AJT",
738            0,
739            &["A05", "A21", "A22", "A23", "A90", "A96", "AE7"],
740            &["SG7"],
741        )
742    }
743
744    /// [88] Wenn in dieser SG7 AJT DE4465 = A25
745    fn evaluate_88(&self, ctx: &EvaluationContext) -> ConditionResult {
746        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
747        ctx.this_group_has_qualifier("AJT", 0, "A25", &["SG7"])
748    }
749
750    /// [89] wenn im DE3155 in demselben COM der Code EM vorhanden ist
751    fn evaluate_89(&self, ctx: &EvaluationContext) -> ConditionResult {
752        let segs = ctx.find_segments("COM");
753        ConditionResult::from(segs.iter().any(|s| {
754            s.elements
755                .first()
756                .and_then(|e| e.get(1))
757                .is_some_and(|v| v == "EM")
758        }))
759    }
760
761    /// [90] wenn im DE3155 in demselben COM der Code TE / FX / AJ / AL vorhanden ist
762    fn evaluate_90(&self, ctx: &EvaluationContext) -> ConditionResult {
763        let segs = ctx.find_segments("COM");
764        ConditionResult::from(segs.iter().any(|s| {
765            s.elements
766                .first()
767                .and_then(|e| e.get(1))
768                .is_some_and(|v| matches!(v.as_str(), "TE" | "FX" | "AJ" | "AL"))
769        }))
770    }
771
772    /// [91] Wenn in diesem AJT DE1082 = E_0566
773    fn evaluate_91(&self, ctx: &EvaluationContext) -> ConditionResult {
774        let segs = ctx.find_segments("AJT");
775        ConditionResult::from(segs.iter().any(|s| {
776            s.elements
777                .get(1)
778                .and_then(|e| e.first())
779                .is_some_and(|v| v == "E_0566")
780        }))
781    }
782
783    /// [92] Wenn in diesem AJT DE1082 = E_0568
784    fn evaluate_92(&self, ctx: &EvaluationContext) -> ConditionResult {
785        let segs = ctx.find_segments("AJT");
786        ConditionResult::from(segs.iter().any(|s| {
787            s.elements
788                .get(1)
789                .and_then(|e| e.first())
790                .is_some_and(|v| v == "E_0568")
791        }))
792    }
793
794    /// [93] Wenn SG7 AJT+A99+E_0804 vorhanden
795    fn evaluate_93(&self, ctx: &EvaluationContext) -> ConditionResult {
796        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0804"], &["SG7"])
797    }
798
799    /// [94] Wenn SG7 AJT+A99+E_0806 vorhanden
800    fn evaluate_94(&self, ctx: &EvaluationContext) -> ConditionResult {
801        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0806"], &["SG7"])
802    }
803
804    /// [95] Wenn SG7 AJT+A99+E_0569 vorhanden
805    fn evaluate_95(&self, ctx: &EvaluationContext) -> ConditionResult {
806        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0569"], &["SG7"])
807    }
808
809    /// [97] Wenn in dieser SG12 AJT DE4465 = A27
810    fn evaluate_97(&self, ctx: &EvaluationContext) -> ConditionResult {
811        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
812        ctx.this_group_has_qualifier("AJT", 0, "A27", &["SG12"])
813    }
814
815    /// [98] Wenn in SG12 AJT DE1082 = E_0407
816    fn evaluate_98(&self, ctx: &EvaluationContext) -> ConditionResult {
817        let values = ctx.collect_group_values("AJT", 1, 0, &["SG12"]);
818        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0407"))
819    }
820
821    /// [99] Wenn in SG12 AJT DE1082 = E_0568
822    // REVIEW: Checks any AJT segment in the message where DE1082 (elements[1][0]) equals E_0568. No 'dieser' qualifier so message-wide search is appropriate. SG12 scoping not enforced due to API limitations without group path context. (medium confidence)
823    fn evaluate_99(&self, ctx: &EvaluationContext) -> ConditionResult {
824        ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
825            s.elements
826                .get(1)
827                .and_then(|e| e.first())
828                .is_some_and(|v| v == "E_0568")
829        }))
830    }
831
832    /// [101] Wenn in dieser SG7 AJT DE1082 = E_0566
833    // REVIEW: Group-scoped check for AJT DE1082=E_0566 within SG7 (nested under SG5). Uses navigator to iterate SG7 instances; falls back to message-wide AJT scan when no navigator available. 'Dieser SG7' semantics best approximated by iterating all SG7 instances. (medium confidence)
834    fn evaluate_101(&self, ctx: &EvaluationContext) -> ConditionResult {
835        // HAND-EDITED: "in dieser SG7" — scoped to the enclosing group.
836        if ctx.navigator().is_none() {
837            return ConditionResult::Unknown;
838        }
839        ConditionResult::from(
840            ctx.this_group_values("AJT", 1, 0, &["SG5", "SG7"])
841                .iter()
842                .any(|(_, v)| v == "E_0566"),
843        )
844    }
845
846    /// [102] Wenn in dieser SG7 AJT DE1082 = E_0568
847    // REVIEW: Group-scoped check for AJT DE1082=E_0568 within SG7 (nested under SG5). Same pattern as condition 101 but checking E_0568 instead of E_0566. (medium confidence)
848    fn evaluate_102(&self, ctx: &EvaluationContext) -> ConditionResult {
849        // HAND-EDITED: "in dieser SG7" — scoped to the enclosing group.
850        if ctx.navigator().is_none() {
851            return ConditionResult::Unknown;
852        }
853        ConditionResult::from(
854            ctx.this_group_values("AJT", 1, 0, &["SG5", "SG7"])
855                .iter()
856                .any(|(_, v)| v == "E_0568"),
857        )
858    }
859
860    /// [103] Wenn in dieser SG12 AJT DE1082 = E_0566
861    // REVIEW: Group-scoped check for AJT DE1082=E_0566 within SG12 (nested under SG10 for line-item rejections). Uses navigator to iterate SG12 instances; falls back to message-wide scan. (medium confidence)
862    fn evaluate_103(&self, ctx: &EvaluationContext) -> ConditionResult {
863        // HAND-EDITED: "in dieser SG12" — scoped to the enclosing group.
864        if ctx.navigator().is_none() {
865            return ConditionResult::Unknown;
866        }
867        ConditionResult::from(
868            ctx.this_group_values("AJT", 1, 0, &["SG10", "SG12"])
869                .iter()
870                .any(|(_, v)| v == "E_0566"),
871        )
872    }
873
874    /// [104] Wenn in dieser SG12 AJT DE1082 = E_0568
875    // REVIEW: Group-scoped check for AJT DE1082=E_0568 within SG12 (nested under SG10). Same pattern as condition 103 but checking E_0568. (medium confidence)
876    fn evaluate_104(&self, ctx: &EvaluationContext) -> ConditionResult {
877        // HAND-EDITED: "in dieser SG12" — scoped to the enclosing group.
878        if ctx.navigator().is_none() {
879            return ConditionResult::Unknown;
880        }
881        ConditionResult::from(
882            ctx.this_group_values("AJT", 1, 0, &["SG10", "SG12"])
883                .iter()
884                .any(|(_, v)| v == "E_0568"),
885        )
886    }
887
888    /// [492] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Strom
889    /// EXTERNAL: Requires context from outside the message.
890    fn evaluate_492(&self, ctx: &EvaluationContext) -> ConditionResult {
891        ctx.external.evaluate("recipient_is_strom")
892    }
893
894    /// [493] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Gas
895    /// EXTERNAL: Requires context from outside the message.
896    fn evaluate_493(&self, ctx: &EvaluationContext) -> ConditionResult {
897        ctx.external.evaluate("recipient_is_gas")
898    }
899
900    /// [501] Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
901    fn evaluate_501(&self, _ctx: &EvaluationContext) -> ConditionResult {
902        // Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
903        // Informational note — always applies
904        ConditionResult::True
905    }
906
907    /// [502] Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers. Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
908    fn evaluate_502(&self, _ctx: &EvaluationContext) -> ConditionResult {
909        // Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers.
910        // Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
911        // Informational note — always applies
912        ConditionResult::True
913    }
914
915    /// [503] Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
916    fn evaluate_503(&self, _ctx: &EvaluationContext) -> ConditionResult {
917        // Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
918        // Informational note — always applies
919        ConditionResult::True
920    }
921
922    /// [510] Hinweis: Bei Ablehnung einer vorherigen COMDIS
923    fn evaluate_510(&self, _ctx: &EvaluationContext) -> ConditionResult {
924        // Hinweis: Bei Ablehnung einer vorherigen COMDIS
925        // Informational note — always applies
926        ConditionResult::True
927    }
928
929    /// [511] Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht
930    fn evaluate_511(&self, _ctx: &EvaluationContext) -> ConditionResult {
931        // Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht — informational note, always applies
932        ConditionResult::True
933    }
934
935    /// [512] Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht
936    fn evaluate_512(&self, _ctx: &EvaluationContext) -> ConditionResult {
937        // Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht — informational note, always applies
938        ConditionResult::True
939    }
940
941    /// [515] Hinweis: BGM DE1004 aus der bestätigten INVOIC- Nachricht
942    fn evaluate_515(&self, _ctx: &EvaluationContext) -> ConditionResult {
943        // Hinweis: BGM DE1004 aus der bestätigten INVOIC-Nachricht — informational note, always applies
944        ConditionResult::True
945    }
946
947    /// [517] Hinweis: Wenn in dieser SG5 in AJT DE4465 ein Code aus Cluster Ablehnung auf Summenebene verwendet wird, ist diese SG7 so oft zu wiederholen, bis alle Fehler der Summenebene genannt sind.
948    // HAND-EDITED: per-EBD cluster data (mako_prozesse). Existential
949    // check over AJT segments in the current scope; falls back to
950    // message-wide when no scope is attached.
951    fn evaluate_517(&self, ctx: &EvaluationContext) -> ConditionResult {
952        any_scoped_ajt_in_cluster(ctx, &[], Cluster::is_ablehnung_summenebene)
953    }
954
955    /// [518] Hinweis: Wenn in dieser SG5 in AJT DE4465 ein Code aus Cluster Ablehnung auf Kopfebene verwendet wird, der von A80 abweicht, ist diese SG7 genau einmal zu nutzen.
956    // HAND-EDITED: per-EBD cluster data (mako_prozesse). A80 is carved
957    // out per the AHB text.
958    fn evaluate_518(&self, ctx: &EvaluationContext) -> ConditionResult {
959        any_scoped_ajt_in_cluster(ctx, &["A80"], Cluster::is_ablehnung_kopfebene)
960    }
961
962    /// [519] Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A74 zu wiederholen, bis alle Rechnungsnummern im RFF-Segment dieser SG7 genannt sind, die in der INVOIC fehlen, die in diesem SG5 DOC DE1004 genannt ist
963    fn evaluate_519(&self, _ctx: &EvaluationContext) -> ConditionResult {
964        // Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A74 zu wiederholen, bis alle Rechnungsnummern im RFF-Segment dieser SG7 genannt sind, die in der INVOIC fehlen, die in diesem SG5 DOC DE1004 genannt ist
965        // Informational note, always applies
966        ConditionResult::True
967    }
968
969    /// [520] Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A75 zu wiederholen, bis alle Rechnungsnummern der Rechnungen genannt sind, die mindestens eine Abschlagsrechnung enthalten, die in der INVOIC abgerech...
970    fn evaluate_520(&self, _ctx: &EvaluationContext) -> ConditionResult {
971        // Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A75 zu wiederholen, bis alle Rechnungsnummern der Rechnungen genannt sind, die mindestens eine Abschlagsrechnung enthalten, die in der INVOIC abgerechnet wurden, die in diesem SG5 DOC DE1004 genannt ist.
972        // Informational note, always applies
973        ConditionResult::True
974    }
975
976    /// [521] Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A76 zu wiederholen, bis alle Rechnungsnummern der Abschlagsrechnungen genannt sind, die in der INVOIC, die in diesem SG5 DOC DE1004 genannt ist, nicht...
977    fn evaluate_521(&self, _ctx: &EvaluationContext) -> ConditionResult {
978        // Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A76 zu wiederholen, bis alle Rechnungsnummern der Abschlagsrechnungen genannt sind, die in der INVOIC, die in diesem SG5 DOC DE1004 genannt ist, nicht hätten berücksichtigt werden dürfen.
979        // Informational note, always applies
980        ConditionResult::True
981    }
982
983    /// [523] Hinweis: Jede Rechnungsnummer einer Abschlagsrechnung muss in einem separaten DE4440 angegeben werden. Reichen die fünf DE4440 für die Rechnungsnummern aller anzugebenden Abschlagrechnungen nicht...
984    fn evaluate_523(&self, _ctx: &EvaluationContext) -> ConditionResult {
985        // Hinweis: Jede Rechnungsnummer einer Abschlagsrechnung muss in einem separaten DE4440 angegeben werden. Reichen die fünf DE4440 für die Rechnungsnummern aller anzugebenden Abschlagrechnungen nicht aus, ist das FTX+Z14 zu wiederholen.
986        // Informational note, always applies
987        ConditionResult::True
988    }
989
990    /// [525] Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
991    fn evaluate_525(&self, _ctx: &EvaluationContext) -> ConditionResult {
992        // Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
993        // Informational note, always applies
994        ConditionResult::True
995    }
996
997    /// [526] Hinweis: Wert aus DE1082 der SG26 in der sich der nachfolgende Fehler in der INVOIC befindet, die in diesem SG5 DOC DE1004 genannt ist.
998    fn evaluate_526(&self, _ctx: &EvaluationContext) -> ConditionResult {
999        // Hinweis: Wert aus DE1082 der SG26 in der sich der nachfolgende Fehler in der INVOIC befindet, die in diesem SG5 DOC DE1004 genannt ist.
1000        ConditionResult::True
1001    }
1002
1003    /// [529] Hinweis: Wenn in dieser SG7 AJT DE4465 = A75 vorhanden, dann dürfen in den DE4440 dieses FTX-Segments nur Abschlagsrechnungsnummern genannt sein, welche in der Rechnung enthalten sind, deren Numme...
1004    // REVIEW: The trigger 'Wenn in dieser SG7 AJT DE4465=A75 vorhanden' is evaluable via group-scoped qualifier check on SG5.SG7. The subsequent content constraint (FTX DE4440 must contain only installment invoice numbers that appear in the invoice referenced by RFF+AFL) requires cross-message business context not available in the EDIFACT message itself, so only the trigger condition is implemented. (medium confidence)
1005    fn evaluate_529(&self, ctx: &EvaluationContext) -> ConditionResult {
1006        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
1007        // Check if this SG7 contains AJT DE4465=A75.
1008        // The content constraint on FTX DE4440 (only installment invoice numbers
1009        // from the referenced invoice) requires cross-message business context
1010        // and cannot be verified from EDIFACT structure alone.
1011        ctx.this_group_has_qualifier("AJT", 0, "A75", &["SG5", "SG7"])
1012    }
1013
1014    /// [533] Hinweis: Wenn in dieser SG12 AJT DE4465 = AA1/AA6/AA7/AB8/AD6, ist diese SG12 so oft mit AJT DE4465 = Code zu wiederholen, bis alle Rechnungsnummern im RFF-Segment dieser SG12 genannt sind.
1015    // REVIEW: The trigger condition 'Wenn in dieser SG12 AJT DE4465=AA1/AA6/AA7/AB8/AD6' is evaluable via group-scoped multi-qualifier check on SG12. AJT DE4465 is at elements[0][0]. The subsequent repetition rule (how many times to repeat SG12) is informational and not a boolean condition. (medium confidence)
1016    fn evaluate_533(&self, ctx: &EvaluationContext) -> ConditionResult {
1017        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
1018        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
1019        // When any of these codes is present, SG12 must be repeated until all
1020        // relevant invoice numbers are listed in RFF segments.
1021        ctx.this_group_has_any_qualifier("AJT", 0, &["AA1", "AA6", "AA7", "AB8", "AD6"], &["SG12"])
1022    }
1023
1024    /// [534] Hinweis: Wenn in dieser SG12 AJT DE4465 = A34/A39/AA2/AB2, ist diese SG12 ist so oft mit AJT DE4465 = Code zu wiederholen, bis alle Nummern der Reklamationen im RFF-Segment dieser SG12 genannt sind.
1025    // REVIEW: The trigger condition 'Wenn in dieser SG12 AJT DE4465=A34/A39/AA2/AB2' is evaluable via group-scoped multi-qualifier check on SG12. AJT DE4465 is at elements[0][0]. The subsequent repetition rule is informational. (medium confidence)
1026    fn evaluate_534(&self, ctx: &EvaluationContext) -> ConditionResult {
1027        // HAND-EDITED: "in dieser/derselben SG12" — scoped to the enclosing group.
1028        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
1029        // When any of these codes is present, SG12 must be repeated until all
1030        // relevant complaint/claim numbers are listed in RFF segments.
1031        ctx.this_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
1032    }
1033
1034    /// [535] Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A80 zu wiederholen, bis die Rechnungsnummern der nicht stornierten Sonderrechnungen mit derselben Sonderrechnungsart wie sie in Sonderrechnung genannt...
1035    fn evaluate_535(&self, _ctx: &EvaluationContext) -> ConditionResult {
1036        // Hinweis: Diese SG7 ist so oft mit AJT DE4465 = A80 zu wiederholen, bis die Rechnungsnummern der nicht stornierten Sonderrechnungen... — informational note about repetition cardinality, always applies
1037        ConditionResult::True
1038    }
1039
1040    /// [536] Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten
1041    fn evaluate_536(&self, _ctx: &EvaluationContext) -> ConditionResult {
1042        // Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten — informational note about field usage restriction, always applies
1043        ConditionResult::True
1044    }
1045
1046    /// [537] Hinweis: Diese SG7 ist so oft mit AJT DE4465 = AC5 zu wiederholen, bis alle Rechnungsnummern im RFF Segment dieser SG7 genannt sind, die in der INVOIC berücksichtigt werden sollten, die in diesem ...
1047    fn evaluate_537(&self, _ctx: &EvaluationContext) -> ConditionResult {
1048        // Hinweis: Diese SG7 ist so oft mit AJT DE4465 = AC5 zu wiederholen, bis alle Rechnungsnummern im RFF Segment dieser SG7 genannt sind... — informational note about repetition cardinality, always applies
1049        ConditionResult::True
1050    }
1051
1052    /// [538] Hinweis: Jede Positionsnummer eines Angebotes muss in einem separaten DE4440 angegeben werden. Reichen die fünf DE4440 für die Positionsnummern aller anzugebenden Angebote nicht aus, ist das SG7 ...
1053    fn evaluate_538(&self, _ctx: &EvaluationContext) -> ConditionResult {
1054        // Hinweis: Jede Positionsnummer eines Angebotes muss in einem separaten DE4440 angegeben werden. Reichen die fünf DE4440 nicht aus, ist das SG7 FTX+Z16 zu wiederholen. — informational note about field usage, always applies
1055        ConditionResult::True
1056    }
1057
1058    /// [544] Hinweis: Wenn in dieser SG7 AJT DE4465 = A21 vorhanden, dann darf in den DE4440 dieses FTX-Segments jeweils nur eine Positionsnummer genannt sein, welche aus dem bestätigten Angebot nicht in der R...
1059    // REVIEW: The trigger 'Wenn in dieser SG7 AJT DE4465=A21 vorhanden' is evaluable via group-scoped qualifier check on SG5.SG7. AJT DE4465 is at elements[0][0]. The subsequent content constraint (each DE4440 contains exactly one position number from the confirmed offer not found in the invoice) requires cross-message business context and cannot be validated from message structure alone. (medium confidence)
1060    fn evaluate_544(&self, ctx: &EvaluationContext) -> ConditionResult {
1061        // HAND-EDITED: "in dieser/derselben SG7" — scoped to the enclosing group.
1062        // Check if this SG7 contains AJT DE4465=A21.
1063        // The content constraint on FTX DE4440 (each DE4440 may contain only one
1064        // position number from the confirmed offer that is absent from the invoice)
1065        // requires cross-message business context and cannot be verified structurally.
1066        ctx.this_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
1067    }
1068
1069    /// [548] Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
1070    fn evaluate_548(&self, _ctx: &EvaluationContext) -> ConditionResult {
1071        // Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
1072        ConditionResult::True
1073    }
1074
1075    /// [549] Hinweis: Es darf nur eine Information im DE3148 übermittelt werden
1076    fn evaluate_549(&self, _ctx: &EvaluationContext) -> ConditionResult {
1077        // Hinweis: Es darf nur eine Information im DE3148 übermittelt werden — informational note, always applies
1078        ConditionResult::True
1079    }
1080
1081    /// [926] Format: Möglicher Wert: 0
1082    // REVIEW: Format condition checking that the value equals 0. Applied to MOA segment (monetary amount) which is the primary numeric field in REMADV. The segment is the most likely target for this constraint in REMADV context. (medium confidence)
1083    fn evaluate_926(&self, ctx: &EvaluationContext) -> ConditionResult {
1084        ctx.format_check("MOA", 0, 1, |val| validate_numeric(val, "==", 0.0))
1085    }
1086
1087    /// [930] Format: max. 2 Nachkommastellen
1088    // REVIEW: Format condition for maximum 2 decimal places. Applied to MOA segment value (element[0][1]) which is the primary numeric data element in REMADV messages. (medium confidence)
1089    fn evaluate_930(&self, ctx: &EvaluationContext) -> ConditionResult {
1090        ctx.format_check("MOA", 0, 1, |val| validate_max_decimal_places(val, 2))
1091    }
1092
1093    /// [931] Format: ZZZ = +00
1094    fn evaluate_931(&self, ctx: &EvaluationContext) -> ConditionResult {
1095        ctx.format_check("DTM", 0, 1, validate_timezone_utc)
1096    }
1097
1098    /// [939] Format: Die Zeichenkette muss die Zeichen @ und . enthalten
1099    fn evaluate_939(&self, ctx: &EvaluationContext) -> ConditionResult {
1100        ctx.format_check("COM", 0, 0, validate_email)
1101    }
1102
1103    /// [940] Format: Die Zeichenkette muss mit dem Zeichen + beginnen und danach dürfen nur noch Ziffern folgen
1104    fn evaluate_940(&self, ctx: &EvaluationContext) -> ConditionResult {
1105        ctx.format_check("COM", 0, 0, validate_phone)
1106    }
1107}