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        ctx.any_group_has_any_qualifier("AJT", 0, &["A74", "A75", "A76", "AC5"], &["SG7"])
388    }
389
390    /// [22] Wenn in dieser SG7 AJT DE4465 = A02/A06/A16/A66/A67/A68/A69/A78/A90/A95/A96/AC3/AC4
391    fn evaluate_22(&self, ctx: &EvaluationContext) -> ConditionResult {
392        ctx.any_group_has_any_qualifier(
393            "AJT",
394            0,
395            &[
396                "A02", "A06", "A16", "A66", "A67", "A68", "A69", "A78", "A90", "A95", "A96", "AC3",
397                "AC4",
398            ],
399            &["SG7"],
400        )
401    }
402
403    /// [26] Wenn in dieser SG12 AJT DE4465 = A51/A62/A82/AA1/AA6/AA7/AB8/AD6
404    fn evaluate_26(&self, ctx: &EvaluationContext) -> ConditionResult {
405        ctx.any_group_has_any_qualifier(
406            "AJT",
407            0,
408            &["A51", "A62", "A82", "AA1", "AA6", "AA7", "AB8", "AD6"],
409            &["SG12"],
410        )
411    }
412
413    /// [28] Wenn in dieser SG12 AJT DE4465 = A23/A26/A35/A36/A38/A46/A47/A48/A50/A58/A59/A61/A77/A84/A99
414    fn evaluate_28(&self, ctx: &EvaluationContext) -> ConditionResult {
415        ctx.any_group_has_any_qualifier(
416            "AJT",
417            0,
418            &[
419                "A23", "A26", "A35", "A36", "A38", "A46", "A47", "A48", "A50", "A58", "A59", "A61",
420                "A77", "A84", "A99",
421            ],
422            &["SG12"],
423        )
424    }
425
426    /// [33] Wenn in diesem AJT DE1082 = S_0103
427    // 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)
428    fn evaluate_33(&self, ctx: &EvaluationContext) -> ConditionResult {
429        ctx.has_qualifier("AJT", 1, "S_0103")
430    }
431
432    /// [34] Wenn in diesem AJT DE1082 = S_0104
433    fn evaluate_34(&self, ctx: &EvaluationContext) -> ConditionResult {
434        ctx.has_qualifier("AJT", 1, "S_0104")
435    }
436
437    /// [35] Wenn in dieser SG12 AJT DE4465 = A34/A39/AA2/AB2
438    fn evaluate_35(&self, ctx: &EvaluationContext) -> ConditionResult {
439        ctx.any_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
440    }
441
442    /// [36] Wenn in dieser SG7 AJT DE4465 = A12/A75/A80/AE1
443    fn evaluate_36(&self, ctx: &EvaluationContext) -> ConditionResult {
444        ctx.any_group_has_any_qualifier("AJT", 0, &["A12", "A75", "A80", "AE1"], &["SG7"])
445    }
446
447    /// [39] Wenn in dieser SG7 AJT DE4465 = AC1
448    fn evaluate_39(&self, ctx: &EvaluationContext) -> ConditionResult {
449        ctx.any_group_has_qualifier("AJT", 0, "AC1", &["SG7"])
450    }
451
452    /// [40] Wenn in dieser SG7 AJT DE1082 = E_0406
453    fn evaluate_40(&self, ctx: &EvaluationContext) -> ConditionResult {
454        ctx.any_group_has_qualifier("AJT", 1, "E_0406", &["SG7"])
455    }
456
457    /// [41] Wenn in dieser SG7 AJT DE1082 = E_0407
458    fn evaluate_41(&self, ctx: &EvaluationContext) -> ConditionResult {
459        ctx.any_group_has_qualifier("AJT", 1, "E_0407", &["SG7"])
460    }
461
462    /// [42] Wenn in SG7 AJT DE1082 = E_0407/E_0568/E_0521/E_0517/E_0266
463    fn evaluate_42(&self, ctx: &EvaluationContext) -> ConditionResult {
464        ctx.any_group_has_any_qualifier(
465            "AJT",
466            1,
467            &["E_0407", "E_0568", "E_0521", "E_0517", "E_0266"],
468            &["SG7"],
469        )
470    }
471
472    /// [43] Wenn in SG12 AJT DE4465=28
473    fn evaluate_43(&self, ctx: &EvaluationContext) -> ConditionResult {
474        ctx.any_group_has_qualifier("AJT", 0, "28", &["SG12"])
475    }
476
477    /// [47] Wenn in diesem AJT DE1082 = E_0210
478    fn evaluate_47(&self, ctx: &EvaluationContext) -> ConditionResult {
479        ctx.has_qualifier("AJT", 1, "E_0210")
480    }
481
482    /// [48] Wenn in diesem AJT DE1082 = E_0259
483    fn evaluate_48(&self, ctx: &EvaluationContext) -> ConditionResult {
484        ctx.has_qualifier("AJT", 1, "E_0259")
485    }
486
487    /// [49] Wenn in dieser SG7 AJT DE4465 = A05/A22/A23/A90/A96
488    fn evaluate_49(&self, ctx: &EvaluationContext) -> ConditionResult {
489        ctx.any_group_has_any_qualifier("AJT", 0, &["A05", "A22", "A23", "A90", "A96"], &["SG7"])
490    }
491
492    /// [50] Wenn in dieser SG7 AJT DE4465 = A05/A18/A19/A20/A90/A96
493    fn evaluate_50(&self, ctx: &EvaluationContext) -> ConditionResult {
494        ctx.any_group_has_any_qualifier(
495            "AJT",
496            0,
497            &["A05", "A18", "A19", "A20", "A90", "A96"],
498            &["SG7"],
499        )
500    }
501
502    /// [51] Wenn in dieser SG12 AJT DE1082 = E_0406
503    fn evaluate_51(&self, ctx: &EvaluationContext) -> ConditionResult {
504        ctx.any_group_has_qualifier("AJT", 1, "E_0406", &["SG12"])
505    }
506
507    /// [52] Wenn in dieser SG12 AJT DE1082 = E_0407
508    fn evaluate_52(&self, ctx: &EvaluationContext) -> ConditionResult {
509        ctx.any_group_has_qualifier("AJT", 1, "E_0407", &["SG12"])
510    }
511
512    /// [53] Wenn in dieser SG12 AJT DE4465 = A25/A31/A99/AF1
513    fn evaluate_53(&self, ctx: &EvaluationContext) -> ConditionResult {
514        ctx.any_group_has_any_qualifier("AJT", 0, &["A25", "A31", "A99", "AF1"], &["SG5", "SG12"])
515    }
516
517    /// [54] Wenn in dieser SG12 AJT DE1082 = E_0210
518    fn evaluate_54(&self, ctx: &EvaluationContext) -> ConditionResult {
519        ctx.any_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG12"])
520    }
521
522    /// [55] Wenn in dieser SG12 AJT DE1082 = E_0259
523    fn evaluate_55(&self, ctx: &EvaluationContext) -> ConditionResult {
524        ctx.any_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG12"])
525    }
526
527    /// [56] Wenn in dieser SG7 AJT DE4465 = A21
528    fn evaluate_56(&self, ctx: &EvaluationContext) -> ConditionResult {
529        ctx.any_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
530    }
531
532    /// [57] Wenn in dieser SG7 AJT DE1082 = E_0210
533    fn evaluate_57(&self, ctx: &EvaluationContext) -> ConditionResult {
534        ctx.any_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG7"])
535    }
536
537    /// [58] Wenn in dieser SG7 AJT DE1082 = E_0259
538    fn evaluate_58(&self, ctx: &EvaluationContext) -> ConditionResult {
539        ctx.any_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG7"])
540    }
541
542    /// [59] Wenn SG7 AJT+A99+E_0459 vorhanden
543    fn evaluate_59(&self, ctx: &EvaluationContext) -> ConditionResult {
544        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0459"], &["SG5", "SG7"])
545    }
546
547    /// [60] Wenn SG7 AJT+A99+E_0243 vorhanden
548    fn evaluate_60(&self, ctx: &EvaluationContext) -> ConditionResult {
549        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0243"], &["SG5", "SG7"])
550    }
551
552    /// [61] Wenn SG7 AJT+A99+E_0261 vorhanden
553    fn evaluate_61(&self, ctx: &EvaluationContext) -> ConditionResult {
554        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0261"], &["SG5", "SG7"])
555    }
556
557    /// [62] Wenn SG7 AJT+A99+E_1007 vorhanden
558    fn evaluate_62(&self, ctx: &EvaluationContext) -> ConditionResult {
559        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_1007"], &["SG5", "SG7"])
560    }
561
562    /// [63] Wenn SG7 AJT+A01/A02+E_1009 vorhanden
563    fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
564        let a01 =
565            ctx.any_group_has_qualified_value("AJT", 0, "A01", 1, 0, &["E_1009"], &["SG5", "SG7"]);
566        let a02 =
567            ctx.any_group_has_qualified_value("AJT", 0, "A02", 1, 0, &["E_1009"], &["SG5", "SG7"]);
568        match (a01, a02) {
569            (ConditionResult::True, _) | (_, ConditionResult::True) => ConditionResult::True,
570            (ConditionResult::False, ConditionResult::False) => ConditionResult::False,
571            _ => ConditionResult::Unknown,
572        }
573    }
574
575    /// [64] Wenn in dieser SG12 AJT DE1082 = E_0264
576    fn evaluate_64(&self, ctx: &EvaluationContext) -> ConditionResult {
577        ctx.any_group_has_qualifier("AJT", 1, "E_0264", &["SG5", "SG12"])
578    }
579
580    /// [65] Wenn in dieser SG12 AJT DE1082 = E_0515
581    fn evaluate_65(&self, ctx: &EvaluationContext) -> ConditionResult {
582        ctx.any_group_has_qualifier("AJT", 1, "E_0515", &["SG5", "SG12"])
583    }
584
585    /// [66] Wenn in dieser SG12 AJT DE1082 = E_0519
586    fn evaluate_66(&self, ctx: &EvaluationContext) -> ConditionResult {
587        ctx.any_group_has_qualifier("AJT", 1, "E_0519", &["SG5", "SG12"])
588    }
589
590    /// [67] Wenn in dieser SG12 AJT DE1082 = E_0266
591    fn evaluate_67(&self, ctx: &EvaluationContext) -> ConditionResult {
592        ctx.any_group_has_qualifier("AJT", 1, "E_0266", &["SG5", "SG12"])
593    }
594
595    /// [68] Wenn in dieser SG12 AJT DE1082 = E_0517
596    fn evaluate_68(&self, ctx: &EvaluationContext) -> ConditionResult {
597        ctx.any_group_has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"], &["SG12"])
598    }
599
600    /// [69] Wenn in dieser SG12 AJT DE1082 = E_0521
601    fn evaluate_69(&self, ctx: &EvaluationContext) -> ConditionResult {
602        ctx.any_group_has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"], &["SG12"])
603    }
604
605    /// [70] Wenn in dieser SG12 AJT DE4465 = A15
606    fn evaluate_70(&self, ctx: &EvaluationContext) -> ConditionResult {
607        ctx.any_group_has_qualifier("AJT", 0, "A15", &["SG12"])
608    }
609
610    /// [71] Wenn in dieser SG12 AJT DE4465 = A99
611    fn evaluate_71(&self, ctx: &EvaluationContext) -> ConditionResult {
612        ctx.any_group_has_qualifier("AJT", 0, "A99", &["SG12"])
613    }
614
615    /// [72] Wenn SG7 AJT+A99+E_0518 vorhanden
616    fn evaluate_72(&self, ctx: &EvaluationContext) -> ConditionResult {
617        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0518"], &["SG7"])
618    }
619
620    /// [73] Wenn SG7 AJT+A99+E_0522 vorhanden
621    fn evaluate_73(&self, ctx: &EvaluationContext) -> ConditionResult {
622        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0522"], &["SG7"])
623    }
624
625    /// [74] Wenn SG7 AJT+A99+E_0267 vorhanden
626    fn evaluate_74(&self, ctx: &EvaluationContext) -> ConditionResult {
627        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0267"], &["SG7"])
628    }
629
630    /// [75] Wenn in diesem AJT DE1082 = E_0264
631    // 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)
632    fn evaluate_75(&self, ctx: &EvaluationContext) -> ConditionResult {
633        ctx.has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"])
634    }
635
636    /// [76] Wenn in diesem AJT DE1082 = E_0266
637    // REVIEW: Same pattern as 75, checking DE1082=E_0266 in any AJT segment. (medium confidence)
638    fn evaluate_76(&self, ctx: &EvaluationContext) -> ConditionResult {
639        ctx.has_qualified_value("AJT", 1, "E_0266", 1, 0, &["E_0266"])
640    }
641
642    /// [77] Wenn in diesem AJT DE1082 = E_0515
643    // REVIEW: Same pattern as 75, checking DE1082=E_0515 in any AJT segment. (medium confidence)
644    fn evaluate_77(&self, ctx: &EvaluationContext) -> ConditionResult {
645        ctx.has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"])
646    }
647
648    /// [78] Wenn in diesem AJT DE1082 = E_0517
649    // REVIEW: Same pattern as 75, checking DE1082=E_0517 in any AJT segment. (medium confidence)
650    fn evaluate_78(&self, ctx: &EvaluationContext) -> ConditionResult {
651        ctx.has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"])
652    }
653
654    /// [79] Wenn in diesem AJT DE1082 = E_0519
655    // REVIEW: Same pattern as 75, checking DE1082=E_0519 in any AJT segment. (medium confidence)
656    fn evaluate_79(&self, ctx: &EvaluationContext) -> ConditionResult {
657        ctx.has_qualified_value("AJT", 1, "E_0519", 1, 0, &["E_0519"])
658    }
659
660    /// [80] Wenn in diesem AJT DE1082 = E_0521
661    // REVIEW: Same pattern as 75, checking DE1082=E_0521 in any AJT segment. (medium confidence)
662    fn evaluate_80(&self, ctx: &EvaluationContext) -> ConditionResult {
663        ctx.has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"])
664    }
665
666    /// [81] Wenn in dieser SG7 AJT DE1082 = E_0264
667    fn evaluate_81(&self, ctx: &EvaluationContext) -> ConditionResult {
668        ctx.any_group_has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"], &["SG7"])
669    }
670
671    /// [82] Wenn in dieser SG7 AJT DE1082 = E_0515
672    fn evaluate_82(&self, ctx: &EvaluationContext) -> ConditionResult {
673        ctx.any_group_has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"], &["SG7"])
674    }
675
676    /// [83] Wenn in dieser SG7 AJT DE1082 = E_0519
677    fn evaluate_83(&self, ctx: &EvaluationContext) -> ConditionResult {
678        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
679        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0519"))
680    }
681
682    /// [84] Wenn in dieser SG7 AJT DE1082 = E_0266
683    fn evaluate_84(&self, ctx: &EvaluationContext) -> ConditionResult {
684        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
685        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0266"))
686    }
687
688    /// [85] Wenn in dieser SG7 AJT DE1082 = E_0517
689    fn evaluate_85(&self, ctx: &EvaluationContext) -> ConditionResult {
690        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
691        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0517"))
692    }
693
694    /// [86] Wenn in dieser SG7 AJT DE1082 = E_0521
695    fn evaluate_86(&self, ctx: &EvaluationContext) -> ConditionResult {
696        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
697        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0521"))
698    }
699
700    /// [87] Wenn in dieser SG7 AJT DE4465 = A05/A21/A22/A23/A90/A96/AE7
701    fn evaluate_87(&self, ctx: &EvaluationContext) -> ConditionResult {
702        ctx.any_group_has_any_qualifier(
703            "AJT",
704            0,
705            &["A05", "A21", "A22", "A23", "A90", "A96", "AE7"],
706            &["SG7"],
707        )
708    }
709
710    /// [88] Wenn in dieser SG7 AJT DE4465 = A25
711    fn evaluate_88(&self, ctx: &EvaluationContext) -> ConditionResult {
712        ctx.any_group_has_qualifier("AJT", 0, "A25", &["SG7"])
713    }
714
715    /// [89] wenn im DE3155 in demselben COM der Code EM vorhanden ist
716    fn evaluate_89(&self, ctx: &EvaluationContext) -> ConditionResult {
717        let segs = ctx.find_segments("COM");
718        ConditionResult::from(segs.iter().any(|s| {
719            s.elements
720                .first()
721                .and_then(|e| e.get(1))
722                .is_some_and(|v| v == "EM")
723        }))
724    }
725
726    /// [90] wenn im DE3155 in demselben COM der Code TE / FX / AJ / AL vorhanden ist
727    fn evaluate_90(&self, ctx: &EvaluationContext) -> ConditionResult {
728        let segs = ctx.find_segments("COM");
729        ConditionResult::from(segs.iter().any(|s| {
730            s.elements
731                .first()
732                .and_then(|e| e.get(1))
733                .is_some_and(|v| matches!(v.as_str(), "TE" | "FX" | "AJ" | "AL"))
734        }))
735    }
736
737    /// [91] Wenn in diesem AJT DE1082 = E_0566
738    fn evaluate_91(&self, ctx: &EvaluationContext) -> ConditionResult {
739        let segs = ctx.find_segments("AJT");
740        ConditionResult::from(segs.iter().any(|s| {
741            s.elements
742                .get(1)
743                .and_then(|e| e.first())
744                .is_some_and(|v| v == "E_0566")
745        }))
746    }
747
748    /// [92] Wenn in diesem AJT DE1082 = E_0568
749    fn evaluate_92(&self, ctx: &EvaluationContext) -> ConditionResult {
750        let segs = ctx.find_segments("AJT");
751        ConditionResult::from(segs.iter().any(|s| {
752            s.elements
753                .get(1)
754                .and_then(|e| e.first())
755                .is_some_and(|v| v == "E_0568")
756        }))
757    }
758
759    /// [93] Wenn SG7 AJT+A99+E_0804 vorhanden
760    fn evaluate_93(&self, ctx: &EvaluationContext) -> ConditionResult {
761        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0804"], &["SG7"])
762    }
763
764    /// [94] Wenn SG7 AJT+A99+E_0806 vorhanden
765    fn evaluate_94(&self, ctx: &EvaluationContext) -> ConditionResult {
766        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0806"], &["SG7"])
767    }
768
769    /// [95] Wenn SG7 AJT+A99+E_0569 vorhanden
770    fn evaluate_95(&self, ctx: &EvaluationContext) -> ConditionResult {
771        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0569"], &["SG7"])
772    }
773
774    /// [97] Wenn in dieser SG12 AJT DE4465 = A27
775    fn evaluate_97(&self, ctx: &EvaluationContext) -> ConditionResult {
776        ctx.any_group_has_qualifier("AJT", 0, "A27", &["SG12"])
777    }
778
779    /// [98] Wenn in SG12 AJT DE1082 = E_0407
780    fn evaluate_98(&self, ctx: &EvaluationContext) -> ConditionResult {
781        let values = ctx.collect_group_values("AJT", 1, 0, &["SG12"]);
782        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0407"))
783    }
784
785    /// [99] Wenn in SG12 AJT DE1082 = E_0568
786    // 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)
787    fn evaluate_99(&self, ctx: &EvaluationContext) -> ConditionResult {
788        ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
789            s.elements
790                .get(1)
791                .and_then(|e| e.first())
792                .is_some_and(|v| v == "E_0568")
793        }))
794    }
795
796    /// [101] Wenn in dieser SG7 AJT DE1082 = E_0566
797    // 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)
798    fn evaluate_101(&self, ctx: &EvaluationContext) -> ConditionResult {
799        if let Some(nav) = ctx.navigator() {
800            let count = nav.group_instance_count(&["SG5", "SG7"]);
801            for i in 0..count {
802                let ajts = nav.find_segments_in_group("AJT", &["SG5", "SG7"], i);
803                if ajts.iter().any(|s| {
804                    s.elements
805                        .get(1)
806                        .and_then(|e| e.first())
807                        .is_some_and(|v| v == "E_0566")
808                }) {
809                    return ConditionResult::True;
810                }
811            }
812            ConditionResult::False
813        } else {
814            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
815                s.elements
816                    .get(1)
817                    .and_then(|e| e.first())
818                    .is_some_and(|v| v == "E_0566")
819            }))
820        }
821    }
822
823    /// [102] Wenn in dieser SG7 AJT DE1082 = E_0568
824    // 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)
825    fn evaluate_102(&self, ctx: &EvaluationContext) -> ConditionResult {
826        if let Some(nav) = ctx.navigator() {
827            let count = nav.group_instance_count(&["SG5", "SG7"]);
828            for i in 0..count {
829                let ajts = nav.find_segments_in_group("AJT", &["SG5", "SG7"], i);
830                if ajts.iter().any(|s| {
831                    s.elements
832                        .get(1)
833                        .and_then(|e| e.first())
834                        .is_some_and(|v| v == "E_0568")
835                }) {
836                    return ConditionResult::True;
837                }
838            }
839            ConditionResult::False
840        } else {
841            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
842                s.elements
843                    .get(1)
844                    .and_then(|e| e.first())
845                    .is_some_and(|v| v == "E_0568")
846            }))
847        }
848    }
849
850    /// [103] Wenn in dieser SG12 AJT DE1082 = E_0566
851    // 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)
852    fn evaluate_103(&self, ctx: &EvaluationContext) -> ConditionResult {
853        if let Some(nav) = ctx.navigator() {
854            let count = nav.group_instance_count(&["SG10", "SG12"]);
855            for i in 0..count {
856                let ajts = nav.find_segments_in_group("AJT", &["SG10", "SG12"], i);
857                if ajts.iter().any(|s| {
858                    s.elements
859                        .get(1)
860                        .and_then(|e| e.first())
861                        .is_some_and(|v| v == "E_0566")
862                }) {
863                    return ConditionResult::True;
864                }
865            }
866            ConditionResult::False
867        } else {
868            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
869                s.elements
870                    .get(1)
871                    .and_then(|e| e.first())
872                    .is_some_and(|v| v == "E_0566")
873            }))
874        }
875    }
876
877    /// [104] Wenn in dieser SG12 AJT DE1082 = E_0568
878    // 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)
879    fn evaluate_104(&self, ctx: &EvaluationContext) -> ConditionResult {
880        if let Some(nav) = ctx.navigator() {
881            let count = nav.group_instance_count(&["SG10", "SG12"]);
882            for i in 0..count {
883                let ajts = nav.find_segments_in_group("AJT", &["SG10", "SG12"], i);
884                if ajts.iter().any(|s| {
885                    s.elements
886                        .get(1)
887                        .and_then(|e| e.first())
888                        .is_some_and(|v| v == "E_0568")
889                }) {
890                    return ConditionResult::True;
891                }
892            }
893            ConditionResult::False
894        } else {
895            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
896                s.elements
897                    .get(1)
898                    .and_then(|e| e.first())
899                    .is_some_and(|v| v == "E_0568")
900            }))
901        }
902    }
903
904    /// [492] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Strom
905    /// EXTERNAL: Requires context from outside the message.
906    fn evaluate_492(&self, ctx: &EvaluationContext) -> ConditionResult {
907        ctx.external.evaluate("recipient_is_strom")
908    }
909
910    /// [493] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Gas
911    /// EXTERNAL: Requires context from outside the message.
912    fn evaluate_493(&self, ctx: &EvaluationContext) -> ConditionResult {
913        ctx.external.evaluate("recipient_is_gas")
914    }
915
916    /// [501] Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
917    fn evaluate_501(&self, _ctx: &EvaluationContext) -> ConditionResult {
918        // Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
919        // Informational note — always applies
920        ConditionResult::True
921    }
922
923    /// [502] Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers. Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
924    fn evaluate_502(&self, _ctx: &EvaluationContext) -> ConditionResult {
925        // Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers.
926        // Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
927        // Informational note — always applies
928        ConditionResult::True
929    }
930
931    /// [503] Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
932    fn evaluate_503(&self, _ctx: &EvaluationContext) -> ConditionResult {
933        // Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
934        // Informational note — always applies
935        ConditionResult::True
936    }
937
938    /// [510] Hinweis: Bei Ablehnung einer vorherigen COMDIS
939    fn evaluate_510(&self, _ctx: &EvaluationContext) -> ConditionResult {
940        // Hinweis: Bei Ablehnung einer vorherigen COMDIS
941        // Informational note — always applies
942        ConditionResult::True
943    }
944
945    /// [511] Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht
946    fn evaluate_511(&self, _ctx: &EvaluationContext) -> ConditionResult {
947        // Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht — informational note, always applies
948        ConditionResult::True
949    }
950
951    /// [512] Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht
952    fn evaluate_512(&self, _ctx: &EvaluationContext) -> ConditionResult {
953        // Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht — informational note, always applies
954        ConditionResult::True
955    }
956
957    /// [515] Hinweis: BGM DE1004 aus der bestätigten INVOIC- Nachricht
958    fn evaluate_515(&self, _ctx: &EvaluationContext) -> ConditionResult {
959        // Hinweis: BGM DE1004 aus der bestätigten INVOIC-Nachricht — informational note, always applies
960        ConditionResult::True
961    }
962
963    /// [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.
964    // HAND-EDITED: per-EBD cluster data (mako_prozesse). Existential
965    // check over AJT segments in the current scope; falls back to
966    // message-wide when no scope is attached.
967    fn evaluate_517(&self, ctx: &EvaluationContext) -> ConditionResult {
968        any_scoped_ajt_in_cluster(ctx, &[], Cluster::is_ablehnung_summenebene)
969    }
970
971    /// [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.
972    // HAND-EDITED: per-EBD cluster data (mako_prozesse). A80 is carved
973    // out per the AHB text.
974    fn evaluate_518(&self, ctx: &EvaluationContext) -> ConditionResult {
975        any_scoped_ajt_in_cluster(ctx, &["A80"], Cluster::is_ablehnung_kopfebene)
976    }
977
978    /// [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
979    fn evaluate_519(&self, _ctx: &EvaluationContext) -> ConditionResult {
980        // 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
981        // Informational note, always applies
982        ConditionResult::True
983    }
984
985    /// [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...
986    fn evaluate_520(&self, _ctx: &EvaluationContext) -> ConditionResult {
987        // 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.
988        // Informational note, always applies
989        ConditionResult::True
990    }
991
992    /// [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...
993    fn evaluate_521(&self, _ctx: &EvaluationContext) -> ConditionResult {
994        // 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.
995        // Informational note, always applies
996        ConditionResult::True
997    }
998
999    /// [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...
1000    fn evaluate_523(&self, _ctx: &EvaluationContext) -> ConditionResult {
1001        // 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.
1002        // Informational note, always applies
1003        ConditionResult::True
1004    }
1005
1006    /// [525] Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
1007    fn evaluate_525(&self, _ctx: &EvaluationContext) -> ConditionResult {
1008        // Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
1009        // Informational note, always applies
1010        ConditionResult::True
1011    }
1012
1013    /// [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.
1014    fn evaluate_526(&self, _ctx: &EvaluationContext) -> ConditionResult {
1015        // Hinweis: Wert aus DE1082 der SG26 in der sich der nachfolgende Fehler in der INVOIC befindet, die in diesem SG5 DOC DE1004 genannt ist.
1016        ConditionResult::True
1017    }
1018
1019    /// [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...
1020    // 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)
1021    fn evaluate_529(&self, ctx: &EvaluationContext) -> ConditionResult {
1022        // Check if this SG7 contains AJT DE4465=A75.
1023        // The content constraint on FTX DE4440 (only installment invoice numbers
1024        // from the referenced invoice) requires cross-message business context
1025        // and cannot be verified from EDIFACT structure alone.
1026        ctx.any_group_has_qualifier("AJT", 0, "A75", &["SG5", "SG7"])
1027    }
1028
1029    /// [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.
1030    // 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)
1031    fn evaluate_533(&self, ctx: &EvaluationContext) -> ConditionResult {
1032        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
1033        // When any of these codes is present, SG12 must be repeated until all
1034        // relevant invoice numbers are listed in RFF segments.
1035        ctx.any_group_has_any_qualifier("AJT", 0, &["AA1", "AA6", "AA7", "AB8", "AD6"], &["SG12"])
1036    }
1037
1038    /// [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.
1039    // 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)
1040    fn evaluate_534(&self, ctx: &EvaluationContext) -> ConditionResult {
1041        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
1042        // When any of these codes is present, SG12 must be repeated until all
1043        // relevant complaint/claim numbers are listed in RFF segments.
1044        ctx.any_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
1045    }
1046
1047    /// [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...
1048    fn evaluate_535(&self, _ctx: &EvaluationContext) -> ConditionResult {
1049        // 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
1050        ConditionResult::True
1051    }
1052
1053    /// [536] Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten
1054    fn evaluate_536(&self, _ctx: &EvaluationContext) -> ConditionResult {
1055        // Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten — informational note about field usage restriction, always applies
1056        ConditionResult::True
1057    }
1058
1059    /// [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 ...
1060    fn evaluate_537(&self, _ctx: &EvaluationContext) -> ConditionResult {
1061        // 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
1062        ConditionResult::True
1063    }
1064
1065    /// [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 ...
1066    fn evaluate_538(&self, _ctx: &EvaluationContext) -> ConditionResult {
1067        // 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
1068        ConditionResult::True
1069    }
1070
1071    /// [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...
1072    // 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)
1073    fn evaluate_544(&self, ctx: &EvaluationContext) -> ConditionResult {
1074        // Check if this SG7 contains AJT DE4465=A21.
1075        // The content constraint on FTX DE4440 (each DE4440 may contain only one
1076        // position number from the confirmed offer that is absent from the invoice)
1077        // requires cross-message business context and cannot be verified structurally.
1078        ctx.any_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
1079    }
1080
1081    /// [548] Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
1082    fn evaluate_548(&self, _ctx: &EvaluationContext) -> ConditionResult {
1083        // Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
1084        ConditionResult::True
1085    }
1086
1087    /// [549] Hinweis: Es darf nur eine Information im DE3148 übermittelt werden
1088    fn evaluate_549(&self, _ctx: &EvaluationContext) -> ConditionResult {
1089        // Hinweis: Es darf nur eine Information im DE3148 übermittelt werden — informational note, always applies
1090        ConditionResult::True
1091    }
1092
1093    /// [926] Format: Möglicher Wert: 0
1094    // 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)
1095    fn evaluate_926(&self, ctx: &EvaluationContext) -> ConditionResult {
1096        ctx.format_check("MOA", 0, 1, |val| validate_numeric(val, "==", 0.0))
1097    }
1098
1099    /// [930] Format: max. 2 Nachkommastellen
1100    // 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)
1101    fn evaluate_930(&self, ctx: &EvaluationContext) -> ConditionResult {
1102        ctx.format_check("MOA", 0, 1, |val| validate_max_decimal_places(val, 2))
1103    }
1104
1105    /// [931] Format: ZZZ = +00
1106    fn evaluate_931(&self, ctx: &EvaluationContext) -> ConditionResult {
1107        ctx.format_check("DTM", 0, 1, validate_timezone_utc)
1108    }
1109
1110    /// [939] Format: Die Zeichenkette muss die Zeichen @ und . enthalten
1111    fn evaluate_939(&self, ctx: &EvaluationContext) -> ConditionResult {
1112        ctx.format_check("COM", 0, 0, validate_email)
1113    }
1114
1115    /// [940] Format: Die Zeichenkette muss mit dem Zeichen + beginnen und danach dürfen nur noch Ziffern folgen
1116    fn evaluate_940(&self, ctx: &EvaluationContext) -> ConditionResult {
1117        ctx.format_check("COM", 0, 0, validate_phone)
1118    }
1119}