automapper-validation 0.1.63

AHB condition expression parsing, evaluation, and EDIFACT validation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
// <auto-generated>
// Generated by automapper-generator generate-conditions
// AHB: xml-migs-and-ahbs/FV2504/REMADV_AHB_2_5d_Fehlerkorrektur_20250623.xml
// Generated: 2026-03-12T09:52:00Z
// </auto-generated>

// LLM-produced bodies aren't idiomatic Rust — silence stylistic lints at
// file scope so `cargo clippy -D warnings` stays green. Correctness,
// suspicious, and perf categories stay on so real bugs still surface.
#![allow(clippy::style, clippy::complexity)]

#[allow(unused_imports)]
use crate::eval::format_validators::*;
use crate::eval::{Cluster, ConditionEvaluator, ConditionResult, EvaluationContext};
// HAND-EDITED: shared cluster helpers for [14]/[15]/[16]/[517]/[518].
// Preserve across regeneration — see CLAUDE.md "Codelist Providers".
use crate::eval::ebd_cluster::{any_scoped_ajt_in_cluster, resolved_ajt_code_in_cluster};

/// Generated condition evaluator for REMADV FV2504.
pub struct RemadvConditionEvaluatorFV2504 {
    // External condition IDs that require runtime context.
    external_conditions: std::collections::HashSet<u32>,
}

impl Default for RemadvConditionEvaluatorFV2504 {
    fn default() -> Self {
        let mut external_conditions = std::collections::HashSet::new();
        external_conditions.insert(45);
        external_conditions.insert(492);
        external_conditions.insert(493);
        Self {
            external_conditions,
        }
    }
}

impl ConditionEvaluator for RemadvConditionEvaluatorFV2504 {
    fn message_type(&self) -> &str {
        "REMADV"
    }

    fn format_version(&self) -> &str {
        "FV2504"
    }

    fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
        match condition {
            2 => self.evaluate_2(ctx),
            3 => self.evaluate_3(ctx),
            4 => self.evaluate_4(ctx),
            8 => self.evaluate_8(ctx),
            9 => self.evaluate_9(ctx),
            11 => self.evaluate_11(ctx),
            12 => self.evaluate_12(ctx),
            14 => self.evaluate_14(ctx),
            15 => self.evaluate_15(ctx),
            16 => self.evaluate_16(ctx),
            18 => self.evaluate_18(ctx),
            22 => self.evaluate_22(ctx),
            26 => self.evaluate_26(ctx),
            28 => self.evaluate_28(ctx),
            33 => self.evaluate_33(ctx),
            34 => self.evaluate_34(ctx),
            35 => self.evaluate_35(ctx),
            36 => self.evaluate_36(ctx),
            39 => self.evaluate_39(ctx),
            40 => self.evaluate_40(ctx),
            41 => self.evaluate_41(ctx),
            42 => self.evaluate_42(ctx),
            43 => self.evaluate_43(ctx),
            45 => self.evaluate_45(ctx),
            47 => self.evaluate_47(ctx),
            48 => self.evaluate_48(ctx),
            49 => self.evaluate_49(ctx),
            50 => self.evaluate_50(ctx),
            51 => self.evaluate_51(ctx),
            52 => self.evaluate_52(ctx),
            53 => self.evaluate_53(ctx),
            54 => self.evaluate_54(ctx),
            55 => self.evaluate_55(ctx),
            56 => self.evaluate_56(ctx),
            57 => self.evaluate_57(ctx),
            58 => self.evaluate_58(ctx),
            59 => self.evaluate_59(ctx),
            60 => self.evaluate_60(ctx),
            61 => self.evaluate_61(ctx),
            62 => self.evaluate_62(ctx),
            63 => self.evaluate_63(ctx),
            64 => self.evaluate_64(ctx),
            65 => self.evaluate_65(ctx),
            66 => self.evaluate_66(ctx),
            67 => self.evaluate_67(ctx),
            68 => self.evaluate_68(ctx),
            69 => self.evaluate_69(ctx),
            70 => self.evaluate_70(ctx),
            71 => self.evaluate_71(ctx),
            72 => self.evaluate_72(ctx),
            73 => self.evaluate_73(ctx),
            74 => self.evaluate_74(ctx),
            75 => self.evaluate_75(ctx),
            76 => self.evaluate_76(ctx),
            77 => self.evaluate_77(ctx),
            78 => self.evaluate_78(ctx),
            79 => self.evaluate_79(ctx),
            80 => self.evaluate_80(ctx),
            81 => self.evaluate_81(ctx),
            82 => self.evaluate_82(ctx),
            83 => self.evaluate_83(ctx),
            84 => self.evaluate_84(ctx),
            85 => self.evaluate_85(ctx),
            86 => self.evaluate_86(ctx),
            87 => self.evaluate_87(ctx),
            88 => self.evaluate_88(ctx),
            89 => self.evaluate_89(ctx),
            90 => self.evaluate_90(ctx),
            91 => self.evaluate_91(ctx),
            92 => self.evaluate_92(ctx),
            93 => self.evaluate_93(ctx),
            94 => self.evaluate_94(ctx),
            95 => self.evaluate_95(ctx),
            97 => self.evaluate_97(ctx),
            98 => self.evaluate_98(ctx),
            99 => self.evaluate_99(ctx),
            101 => self.evaluate_101(ctx),
            102 => self.evaluate_102(ctx),
            103 => self.evaluate_103(ctx),
            104 => self.evaluate_104(ctx),
            492 => self.evaluate_492(ctx),
            493 => self.evaluate_493(ctx),
            501 => self.evaluate_501(ctx),
            502 => self.evaluate_502(ctx),
            503 => self.evaluate_503(ctx),
            510 => self.evaluate_510(ctx),
            511 => self.evaluate_511(ctx),
            512 => self.evaluate_512(ctx),
            515 => self.evaluate_515(ctx),
            517 => self.evaluate_517(ctx),
            518 => self.evaluate_518(ctx),
            519 => self.evaluate_519(ctx),
            520 => self.evaluate_520(ctx),
            521 => self.evaluate_521(ctx),
            523 => self.evaluate_523(ctx),
            525 => self.evaluate_525(ctx),
            526 => self.evaluate_526(ctx),
            529 => self.evaluate_529(ctx),
            533 => self.evaluate_533(ctx),
            534 => self.evaluate_534(ctx),
            535 => self.evaluate_535(ctx),
            536 => self.evaluate_536(ctx),
            537 => self.evaluate_537(ctx),
            538 => self.evaluate_538(ctx),
            544 => self.evaluate_544(ctx),
            548 => self.evaluate_548(ctx),
            549 => self.evaluate_549(ctx),
            926 => self.evaluate_926(ctx),
            930 => self.evaluate_930(ctx),
            931 => self.evaluate_931(ctx),
            939 => self.evaluate_939(ctx),
            940 => self.evaluate_940(ctx),
            _ => ConditionResult::Unknown,
        }
    }

    fn is_external(&self, condition: u32) -> bool {
        self.external_conditions.contains(&condition)
    }
    fn is_known(&self, condition: u32) -> bool {
        matches!(
            condition,
            2 | 3
                | 4
                | 8
                | 9
                | 11
                | 12
                | 14
                | 15
                | 16
                | 18
                | 22
                | 26
                | 28
                | 33
                | 34
                | 35
                | 36
                | 39
                | 40
                | 41
                | 42
                | 43
                | 45
                | 47
                | 48
                | 49
                | 50
                | 51
                | 52
                | 53
                | 54
                | 55
                | 56
                | 57
                | 58
                | 59
                | 60
                | 61
                | 62
                | 63
                | 64
                | 65
                | 66
                | 67
                | 68
                | 69
                | 70
                | 71
                | 72
                | 73
                | 74
                | 75
                | 76
                | 77
                | 78
                | 79
                | 80
                | 81
                | 82
                | 83
                | 84
                | 85
                | 86
                | 87
                | 88
                | 89
                | 90
                | 91
                | 92
                | 93
                | 94
                | 95
                | 97
                | 98
                | 99
                | 101
                | 102
                | 103
                | 104
                | 492
                | 493
                | 501
                | 502
                | 503
                | 510
                | 511
                | 512
                | 515
                | 517
                | 518
                | 519
                | 520
                | 521
                | 523
                | 525
                | 526
                | 529
                | 533
                | 534
                | 535
                | 536
                | 537
                | 538
                | 544
                | 548
                | 549
                | 926
                | 930
                | 931
                | 939
                | 940
        )
    }
}

impl RemadvConditionEvaluatorFV2504 {
    /// [45] Nur MP-ID aus Sparte Strom
    /// EXTERNAL: Requires context from outside the message.
    fn evaluate_45(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.external.evaluate("mp_id_is_strom_sector")
    }

    /// [2] Wenn SG7 AJT+28 vorhanden
    fn evaluate_2(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "28", &["SG7"])
    }

    /// [3] Bei SG5 DOC+389 / Z25 ist der Wert aus derselben SG5 MOA+9 mit (-1) multipliziert anzugeben.
    fn evaluate_3(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Bei SG5 DOC+389/Z25 ist der Wert aus derselben SG5 MOA+9 mit (-1) multipliziert anzugeben.
        // Informational annotation describing the calculation rule for MOA+12 (Überweisungsbetrag).
        ConditionResult::True
    }

    /// [4] Bei SG5 DOC+380 / 457 ist der Wert aus derselben SG5 MOA+9 unverändert anzugeben.
    fn evaluate_4(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Bei SG5 DOC+380/457 ist der Wert aus derselben SG5 MOA+9 unverändert anzugeben.
        // Informational annotation describing that MOA+12 (Überweisungsbetrag) equals MOA+9 unchanged.
        ConditionResult::True
    }

    /// [8] Wenn SG7 AJT+A01/A02+E_0505 vorhanden
    fn evaluate_8(&self, ctx: &EvaluationContext) -> ConditionResult {
        let ajts = ctx.find_segments("AJT");
        let found = ajts.iter().any(|s| {
            let elem0 = s
                .elements
                .first()
                .and_then(|e| e.first())
                .map(|s| s.as_str())
                .unwrap_or("");
            let elem1 = s
                .elements
                .get(1)
                .and_then(|e| e.first())
                .map(|s| s.as_str())
                .unwrap_or("");
            (elem0 == "A01" || elem0 == "A02") && elem1 == "E_0505"
        });
        ConditionResult::from(found)
    }

    /// [9] Wenn SG7 AJT+A32/A99+E_0503 vorhanden
    fn evaluate_9(&self, ctx: &EvaluationContext) -> ConditionResult {
        let ajts = ctx.find_segments("AJT");
        let found = ajts.iter().any(|s| {
            let elem0 = s
                .elements
                .first()
                .and_then(|e| e.first())
                .map(|s| s.as_str())
                .unwrap_or("");
            let elem1 = s
                .elements
                .get(1)
                .and_then(|e| e.first())
                .map(|s| s.as_str())
                .unwrap_or("");
            (elem0 == "A32" || elem0 == "A99") && elem1 == "E_0503"
        });
        ConditionResult::from(found)
    }

    /// [11] Wenn in diesem AJT DE1082 = E_0406
    // 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)
    fn evaluate_11(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "E_0406")
    }

    /// [12] Wenn in diesem AJT DE1082 = E_0407
    // REVIEW: Check if AJT has DE1082 (elements[1][0]) == E_0407. Same pattern as condition 11. (medium confidence)
    fn evaluate_12(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "E_0407")
    }

    /// [14] A-Code aus Cluster Ablehnung auf Kopfebene
    // HAND-EDITED: per-EBD cluster data (mako_prozesse). Resolves to
    // True when the AJT DE4465 being validated is Ablehnung-Kopfebene
    // in its referenced EBD (DE1082). Unknown without resolved context.
    fn evaluate_14(&self, ctx: &EvaluationContext) -> ConditionResult {
        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_kopfebene)
    }

    /// [15] A-Code aus Cluster Ablehnung auf Positionsebene
    // HAND-EDITED: per-EBD cluster data (mako_prozesse).
    fn evaluate_15(&self, ctx: &EvaluationContext) -> ConditionResult {
        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_positionsebene)
    }

    /// [16] A-Code aus Cluster Ablehnung auf Summenebene
    // HAND-EDITED: per-EBD cluster data (mako_prozesse).
    fn evaluate_16(&self, ctx: &EvaluationContext) -> ConditionResult {
        resolved_ajt_code_in_cluster(ctx, Cluster::is_ablehnung_summenebene)
    }

    /// [18] Wenn in dieser SG7 AJT DE4465 = A74/A75/A76/AC5
    fn evaluate_18(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier("AJT", 0, &["A74", "A75", "A76", "AC5"], &["SG7"])
    }

    /// [22] Wenn in dieser SG7 AJT DE4465 = A02/A06/A16/A66/A67/A68/A69/A78/A90/A95/A96/AC3/AC4
    fn evaluate_22(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            0,
            &[
                "A02", "A06", "A16", "A66", "A67", "A68", "A69", "A78", "A90", "A95", "A96", "AC3",
                "AC4",
            ],
            &["SG7"],
        )
    }

    /// [26] Wenn in dieser SG12 AJT DE4465 = A51/A62/A82/AA1/AA6/AA7/AB8/AD6
    fn evaluate_26(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            0,
            &["A51", "A62", "A82", "AA1", "AA6", "AA7", "AB8", "AD6"],
            &["SG12"],
        )
    }

    /// [28] Wenn in dieser SG12 AJT DE4465 = A23/A26/A35/A36/A38/A46/A47/A48/A50/A58/A59/A61/A77/A84/A99
    fn evaluate_28(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            0,
            &[
                "A23", "A26", "A35", "A36", "A38", "A46", "A47", "A48", "A50", "A58", "A59", "A61",
                "A77", "A84", "A99",
            ],
            &["SG12"],
        )
    }

    /// [33] Wenn in diesem AJT DE1082 = S_0103
    // 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)
    fn evaluate_33(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "S_0103")
    }

    /// [34] Wenn in diesem AJT DE1082 = S_0104
    fn evaluate_34(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "S_0104")
    }

    /// [35] Wenn in dieser SG12 AJT DE4465 = A34/A39/AA2/AB2
    fn evaluate_35(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
    }

    /// [36] Wenn in dieser SG7 AJT DE4465 = A12/A75/A80/AE1
    fn evaluate_36(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier("AJT", 0, &["A12", "A75", "A80", "AE1"], &["SG7"])
    }

    /// [39] Wenn in dieser SG7 AJT DE4465 = AC1
    fn evaluate_39(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "AC1", &["SG7"])
    }

    /// [40] Wenn in dieser SG7 AJT DE1082 = E_0406
    fn evaluate_40(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0406", &["SG7"])
    }

    /// [41] Wenn in dieser SG7 AJT DE1082 = E_0407
    fn evaluate_41(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0407", &["SG7"])
    }

    /// [42] Wenn in SG7 AJT DE1082 = E_0407/E_0568/E_0521/E_0517/E_0266
    fn evaluate_42(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            1,
            &["E_0407", "E_0568", "E_0521", "E_0517", "E_0266"],
            &["SG7"],
        )
    }

    /// [43] Wenn in SG12 AJT DE4465=28
    fn evaluate_43(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "28", &["SG12"])
    }

    /// [47] Wenn in diesem AJT DE1082 = E_0210
    fn evaluate_47(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "E_0210")
    }

    /// [48] Wenn in diesem AJT DE1082 = E_0259
    fn evaluate_48(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualifier("AJT", 1, "E_0259")
    }

    /// [49] Wenn in dieser SG7 AJT DE4465 = A05/A22/A23/A90/A96
    fn evaluate_49(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier("AJT", 0, &["A05", "A22", "A23", "A90", "A96"], &["SG7"])
    }

    /// [50] Wenn in dieser SG7 AJT DE4465 = A05/A18/A19/A20/A90/A96
    fn evaluate_50(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            0,
            &["A05", "A18", "A19", "A20", "A90", "A96"],
            &["SG7"],
        )
    }

    /// [51] Wenn in dieser SG12 AJT DE1082 = E_0406
    fn evaluate_51(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0406", &["SG12"])
    }

    /// [52] Wenn in dieser SG12 AJT DE1082 = E_0407
    fn evaluate_52(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0407", &["SG12"])
    }

    /// [53] Wenn in dieser SG12 AJT DE4465 = A25/A31/A99/AF1
    fn evaluate_53(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier("AJT", 0, &["A25", "A31", "A99", "AF1"], &["SG5", "SG12"])
    }

    /// [54] Wenn in dieser SG12 AJT DE1082 = E_0210
    fn evaluate_54(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG12"])
    }

    /// [55] Wenn in dieser SG12 AJT DE1082 = E_0259
    fn evaluate_55(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG12"])
    }

    /// [56] Wenn in dieser SG7 AJT DE4465 = A21
    fn evaluate_56(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
    }

    /// [57] Wenn in dieser SG7 AJT DE1082 = E_0210
    fn evaluate_57(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0210", &["SG5", "SG7"])
    }

    /// [58] Wenn in dieser SG7 AJT DE1082 = E_0259
    fn evaluate_58(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0259", &["SG5", "SG7"])
    }

    /// [59] Wenn SG7 AJT+A99+E_0459 vorhanden
    fn evaluate_59(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0459"], &["SG5", "SG7"])
    }

    /// [60] Wenn SG7 AJT+A99+E_0243 vorhanden
    fn evaluate_60(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0243"], &["SG5", "SG7"])
    }

    /// [61] Wenn SG7 AJT+A99+E_0261 vorhanden
    fn evaluate_61(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0261"], &["SG5", "SG7"])
    }

    /// [62] Wenn SG7 AJT+A99+E_1007 vorhanden
    fn evaluate_62(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_1007"], &["SG5", "SG7"])
    }

    /// [63] Wenn SG7 AJT+A01/A02+E_1009 vorhanden
    fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
        let a01 =
            ctx.any_group_has_qualified_value("AJT", 0, "A01", 1, 0, &["E_1009"], &["SG5", "SG7"]);
        let a02 =
            ctx.any_group_has_qualified_value("AJT", 0, "A02", 1, 0, &["E_1009"], &["SG5", "SG7"]);
        match (a01, a02) {
            (ConditionResult::True, _) | (_, ConditionResult::True) => ConditionResult::True,
            (ConditionResult::False, ConditionResult::False) => ConditionResult::False,
            _ => ConditionResult::Unknown,
        }
    }

    /// [64] Wenn in dieser SG12 AJT DE1082 = E_0264
    fn evaluate_64(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0264", &["SG5", "SG12"])
    }

    /// [65] Wenn in dieser SG12 AJT DE1082 = E_0515
    fn evaluate_65(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0515", &["SG5", "SG12"])
    }

    /// [66] Wenn in dieser SG12 AJT DE1082 = E_0519
    fn evaluate_66(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0519", &["SG5", "SG12"])
    }

    /// [67] Wenn in dieser SG12 AJT DE1082 = E_0266
    fn evaluate_67(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 1, "E_0266", &["SG5", "SG12"])
    }

    /// [68] Wenn in dieser SG12 AJT DE1082 = E_0517
    fn evaluate_68(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"], &["SG12"])
    }

    /// [69] Wenn in dieser SG12 AJT DE1082 = E_0521
    fn evaluate_69(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"], &["SG12"])
    }

    /// [70] Wenn in dieser SG12 AJT DE4465 = A15
    fn evaluate_70(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "A15", &["SG12"])
    }

    /// [71] Wenn in dieser SG12 AJT DE4465 = A99
    fn evaluate_71(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "A99", &["SG12"])
    }

    /// [72] Wenn SG7 AJT+A99+E_0518 vorhanden
    fn evaluate_72(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0518"], &["SG7"])
    }

    /// [73] Wenn SG7 AJT+A99+E_0522 vorhanden
    fn evaluate_73(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0522"], &["SG7"])
    }

    /// [74] Wenn SG7 AJT+A99+E_0267 vorhanden
    fn evaluate_74(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0267"], &["SG7"])
    }

    /// [75] Wenn in diesem AJT DE1082 = E_0264
    // 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)
    fn evaluate_75(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"])
    }

    /// [76] Wenn in diesem AJT DE1082 = E_0266
    // REVIEW: Same pattern as 75, checking DE1082=E_0266 in any AJT segment. (medium confidence)
    fn evaluate_76(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0266", 1, 0, &["E_0266"])
    }

    /// [77] Wenn in diesem AJT DE1082 = E_0515
    // REVIEW: Same pattern as 75, checking DE1082=E_0515 in any AJT segment. (medium confidence)
    fn evaluate_77(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"])
    }

    /// [78] Wenn in diesem AJT DE1082 = E_0517
    // REVIEW: Same pattern as 75, checking DE1082=E_0517 in any AJT segment. (medium confidence)
    fn evaluate_78(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0517", 1, 0, &["E_0517"])
    }

    /// [79] Wenn in diesem AJT DE1082 = E_0519
    // REVIEW: Same pattern as 75, checking DE1082=E_0519 in any AJT segment. (medium confidence)
    fn evaluate_79(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0519", 1, 0, &["E_0519"])
    }

    /// [80] Wenn in diesem AJT DE1082 = E_0521
    // REVIEW: Same pattern as 75, checking DE1082=E_0521 in any AJT segment. (medium confidence)
    fn evaluate_80(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.has_qualified_value("AJT", 1, "E_0521", 1, 0, &["E_0521"])
    }

    /// [81] Wenn in dieser SG7 AJT DE1082 = E_0264
    fn evaluate_81(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 1, "E_0264", 1, 0, &["E_0264"], &["SG7"])
    }

    /// [82] Wenn in dieser SG7 AJT DE1082 = E_0515
    fn evaluate_82(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 1, "E_0515", 1, 0, &["E_0515"], &["SG7"])
    }

    /// [83] Wenn in dieser SG7 AJT DE1082 = E_0519
    fn evaluate_83(&self, ctx: &EvaluationContext) -> ConditionResult {
        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0519"))
    }

    /// [84] Wenn in dieser SG7 AJT DE1082 = E_0266
    fn evaluate_84(&self, ctx: &EvaluationContext) -> ConditionResult {
        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0266"))
    }

    /// [85] Wenn in dieser SG7 AJT DE1082 = E_0517
    fn evaluate_85(&self, ctx: &EvaluationContext) -> ConditionResult {
        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0517"))
    }

    /// [86] Wenn in dieser SG7 AJT DE1082 = E_0521
    fn evaluate_86(&self, ctx: &EvaluationContext) -> ConditionResult {
        let values = ctx.collect_group_values("AJT", 1, 0, &["SG7"]);
        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0521"))
    }

    /// [87] Wenn in dieser SG7 AJT DE4465 = A05/A21/A22/A23/A90/A96/AE7
    fn evaluate_87(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_any_qualifier(
            "AJT",
            0,
            &["A05", "A21", "A22", "A23", "A90", "A96", "AE7"],
            &["SG7"],
        )
    }

    /// [88] Wenn in dieser SG7 AJT DE4465 = A25
    fn evaluate_88(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "A25", &["SG7"])
    }

    /// [89] wenn im DE3155 in demselben COM der Code EM vorhanden ist
    fn evaluate_89(&self, ctx: &EvaluationContext) -> ConditionResult {
        let segs = ctx.find_segments("COM");
        ConditionResult::from(segs.iter().any(|s| {
            s.elements
                .first()
                .and_then(|e| e.get(1))
                .is_some_and(|v| v == "EM")
        }))
    }

    /// [90] wenn im DE3155 in demselben COM der Code TE / FX / AJ / AL vorhanden ist
    fn evaluate_90(&self, ctx: &EvaluationContext) -> ConditionResult {
        let segs = ctx.find_segments("COM");
        ConditionResult::from(segs.iter().any(|s| {
            s.elements
                .first()
                .and_then(|e| e.get(1))
                .is_some_and(|v| matches!(v.as_str(), "TE" | "FX" | "AJ" | "AL"))
        }))
    }

    /// [91] Wenn in diesem AJT DE1082 = E_0566
    fn evaluate_91(&self, ctx: &EvaluationContext) -> ConditionResult {
        let segs = ctx.find_segments("AJT");
        ConditionResult::from(segs.iter().any(|s| {
            s.elements
                .get(1)
                .and_then(|e| e.first())
                .is_some_and(|v| v == "E_0566")
        }))
    }

    /// [92] Wenn in diesem AJT DE1082 = E_0568
    fn evaluate_92(&self, ctx: &EvaluationContext) -> ConditionResult {
        let segs = ctx.find_segments("AJT");
        ConditionResult::from(segs.iter().any(|s| {
            s.elements
                .get(1)
                .and_then(|e| e.first())
                .is_some_and(|v| v == "E_0568")
        }))
    }

    /// [93] Wenn SG7 AJT+A99+E_0804 vorhanden
    fn evaluate_93(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0804"], &["SG7"])
    }

    /// [94] Wenn SG7 AJT+A99+E_0806 vorhanden
    fn evaluate_94(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0806"], &["SG7"])
    }

    /// [95] Wenn SG7 AJT+A99+E_0569 vorhanden
    fn evaluate_95(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualified_value("AJT", 0, "A99", 1, 0, &["E_0569"], &["SG7"])
    }

    /// [97] Wenn in dieser SG12 AJT DE4465 = A27
    fn evaluate_97(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.any_group_has_qualifier("AJT", 0, "A27", &["SG12"])
    }

    /// [98] Wenn in SG12 AJT DE1082 = E_0407
    fn evaluate_98(&self, ctx: &EvaluationContext) -> ConditionResult {
        let values = ctx.collect_group_values("AJT", 1, 0, &["SG12"]);
        ConditionResult::from(values.iter().any(|(_, v)| v == "E_0407"))
    }

    /// [99] Wenn in SG12 AJT DE1082 = E_0568
    // 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)
    fn evaluate_99(&self, ctx: &EvaluationContext) -> ConditionResult {
        ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
            s.elements
                .get(1)
                .and_then(|e| e.first())
                .is_some_and(|v| v == "E_0568")
        }))
    }

    /// [101] Wenn in dieser SG7 AJT DE1082 = E_0566
    // 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)
    fn evaluate_101(&self, ctx: &EvaluationContext) -> ConditionResult {
        if let Some(nav) = ctx.navigator() {
            let count = nav.group_instance_count(&["SG5", "SG7"]);
            for i in 0..count {
                let ajts = nav.find_segments_in_group("AJT", &["SG5", "SG7"], i);
                if ajts.iter().any(|s| {
                    s.elements
                        .get(1)
                        .and_then(|e| e.first())
                        .is_some_and(|v| v == "E_0566")
                }) {
                    return ConditionResult::True;
                }
            }
            ConditionResult::False
        } else {
            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
                s.elements
                    .get(1)
                    .and_then(|e| e.first())
                    .is_some_and(|v| v == "E_0566")
            }))
        }
    }

    /// [102] Wenn in dieser SG7 AJT DE1082 = E_0568
    // 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)
    fn evaluate_102(&self, ctx: &EvaluationContext) -> ConditionResult {
        if let Some(nav) = ctx.navigator() {
            let count = nav.group_instance_count(&["SG5", "SG7"]);
            for i in 0..count {
                let ajts = nav.find_segments_in_group("AJT", &["SG5", "SG7"], i);
                if ajts.iter().any(|s| {
                    s.elements
                        .get(1)
                        .and_then(|e| e.first())
                        .is_some_and(|v| v == "E_0568")
                }) {
                    return ConditionResult::True;
                }
            }
            ConditionResult::False
        } else {
            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
                s.elements
                    .get(1)
                    .and_then(|e| e.first())
                    .is_some_and(|v| v == "E_0568")
            }))
        }
    }

    /// [103] Wenn in dieser SG12 AJT DE1082 = E_0566
    // 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)
    fn evaluate_103(&self, ctx: &EvaluationContext) -> ConditionResult {
        if let Some(nav) = ctx.navigator() {
            let count = nav.group_instance_count(&["SG10", "SG12"]);
            for i in 0..count {
                let ajts = nav.find_segments_in_group("AJT", &["SG10", "SG12"], i);
                if ajts.iter().any(|s| {
                    s.elements
                        .get(1)
                        .and_then(|e| e.first())
                        .is_some_and(|v| v == "E_0566")
                }) {
                    return ConditionResult::True;
                }
            }
            ConditionResult::False
        } else {
            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
                s.elements
                    .get(1)
                    .and_then(|e| e.first())
                    .is_some_and(|v| v == "E_0566")
            }))
        }
    }

    /// [104] Wenn in dieser SG12 AJT DE1082 = E_0568
    // 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)
    fn evaluate_104(&self, ctx: &EvaluationContext) -> ConditionResult {
        if let Some(nav) = ctx.navigator() {
            let count = nav.group_instance_count(&["SG10", "SG12"]);
            for i in 0..count {
                let ajts = nav.find_segments_in_group("AJT", &["SG10", "SG12"], i);
                if ajts.iter().any(|s| {
                    s.elements
                        .get(1)
                        .and_then(|e| e.first())
                        .is_some_and(|v| v == "E_0568")
                }) {
                    return ConditionResult::True;
                }
            }
            ConditionResult::False
        } else {
            ConditionResult::from(ctx.find_segments("AJT").iter().any(|s| {
                s.elements
                    .get(1)
                    .and_then(|e| e.first())
                    .is_some_and(|v| v == "E_0568")
            }))
        }
    }

    /// [492] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Strom
    /// EXTERNAL: Requires context from outside the message.
    fn evaluate_492(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.external.evaluate("recipient_is_strom")
    }

    /// [493] Wenn MP-ID in NAD+MR (Nachrichtenempfänger) aus Sparte Gas
    /// EXTERNAL: Requires context from outside the message.
    fn evaluate_493(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.external.evaluate("recipient_is_gas")
    }

    /// [501] Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
    fn evaluate_501(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: An dieser Stelle ist der Betrag aus SG50 MOA+9 der zugrundeliegenden INVOIC zu übernehmen.
        // Informational note — always applies
        ConditionResult::True
    }

    /// [502] Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers. Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
    fn evaluate_502(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Bei positivem Betrag ergibt sich eine Forderung des Rechnungsstellers.
        // Bei negativem Betrag ergibt sich eine Forderung für den Rechnungsempfänger.
        // Informational note — always applies
        ConditionResult::True
    }

    /// [503] Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
    fn evaluate_503(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Empfohlen, um bei Abweisung Ansprechpartner für Rückfragen zu erreichen.
        // Informational note — always applies
        ConditionResult::True
    }

    /// [510] Hinweis: Bei Ablehnung einer vorherigen COMDIS
    fn evaluate_510(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Bei Ablehnung einer vorherigen COMDIS
        // Informational note — always applies
        ConditionResult::True
    }

    /// [511] Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht
    fn evaluate_511(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: BGM DE1004 aus der abgelehnten INVOIC-Nachricht — informational note, always applies
        ConditionResult::True
    }

    /// [512] Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht
    fn evaluate_512(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: BGM DE1004 aus der abgelehnten COMDIS-Nachricht — informational note, always applies
        ConditionResult::True
    }

    /// [515] Hinweis: BGM DE1004 aus der bestätigten INVOIC- Nachricht
    fn evaluate_515(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: BGM DE1004 aus der bestätigten INVOIC-Nachricht — informational note, always applies
        ConditionResult::True
    }

    /// [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.
    // HAND-EDITED: per-EBD cluster data (mako_prozesse). Existential
    // check over AJT segments in the current scope; falls back to
    // message-wide when no scope is attached.
    fn evaluate_517(&self, ctx: &EvaluationContext) -> ConditionResult {
        any_scoped_ajt_in_cluster(ctx, &[], Cluster::is_ablehnung_summenebene)
    }

    /// [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.
    // HAND-EDITED: per-EBD cluster data (mako_prozesse). A80 is carved
    // out per the AHB text.
    fn evaluate_518(&self, ctx: &EvaluationContext) -> ConditionResult {
        any_scoped_ajt_in_cluster(ctx, &["A80"], Cluster::is_ablehnung_kopfebene)
    }

    /// [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
    fn evaluate_519(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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
        // Informational note, always applies
        ConditionResult::True
    }

    /// [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...
    fn evaluate_520(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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.
        // Informational note, always applies
        ConditionResult::True
    }

    /// [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...
    fn evaluate_521(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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.
        // Informational note, always applies
        ConditionResult::True
    }

    /// [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...
    fn evaluate_523(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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.
        // Informational note, always applies
        ConditionResult::True
    }

    /// [525] Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
    fn evaluate_525(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Diese SG10 ist so oft zu wiederholen, bis alle Fehler der Positionsebene genannt sind.
        // Informational note, always applies
        ConditionResult::True
    }

    /// [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.
    fn evaluate_526(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Wert aus DE1082 der SG26 in der sich der nachfolgende Fehler in der INVOIC befindet, die in diesem SG5 DOC DE1004 genannt ist.
        ConditionResult::True
    }

    /// [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...
    // 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)
    fn evaluate_529(&self, ctx: &EvaluationContext) -> ConditionResult {
        // Check if this SG7 contains AJT DE4465=A75.
        // The content constraint on FTX DE4440 (only installment invoice numbers
        // from the referenced invoice) requires cross-message business context
        // and cannot be verified from EDIFACT structure alone.
        ctx.any_group_has_qualifier("AJT", 0, "A75", &["SG5", "SG7"])
    }

    /// [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.
    // 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)
    fn evaluate_533(&self, ctx: &EvaluationContext) -> ConditionResult {
        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
        // When any of these codes is present, SG12 must be repeated until all
        // relevant invoice numbers are listed in RFF segments.
        ctx.any_group_has_any_qualifier("AJT", 0, &["AA1", "AA6", "AA7", "AB8", "AD6"], &["SG12"])
    }

    /// [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.
    // 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)
    fn evaluate_534(&self, ctx: &EvaluationContext) -> ConditionResult {
        // Check if this SG12 contains AJT DE4465 with one of the specified codes.
        // When any of these codes is present, SG12 must be repeated until all
        // relevant complaint/claim numbers are listed in RFF segments.
        ctx.any_group_has_any_qualifier("AJT", 0, &["A34", "A39", "AA2", "AB2"], &["SG12"])
    }

    /// [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...
    fn evaluate_535(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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
        ConditionResult::True
    }

    /// [536] Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten
    fn evaluate_536(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Dieses DE darf keine Abschlagsrechnungsnummer enthalten — informational note about field usage restriction, always applies
        ConditionResult::True
    }

    /// [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 ...
    fn evaluate_537(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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
        ConditionResult::True
    }

    /// [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 ...
    fn evaluate_538(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // 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
        ConditionResult::True
    }

    /// [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...
    // 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)
    fn evaluate_544(&self, ctx: &EvaluationContext) -> ConditionResult {
        // Check if this SG7 contains AJT DE4465=A21.
        // The content constraint on FTX DE4440 (each DE4440 may contain only one
        // position number from the confirmed offer that is absent from the invoice)
        // requires cross-message business context and cannot be verified structurally.
        ctx.any_group_has_qualifier("AJT", 0, "A21", &["SG5", "SG7"])
    }

    /// [548] Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
    fn evaluate_548(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Die Befüllung des Datenelements ergibt sich aus dem zugehörigen EBD.
        ConditionResult::True
    }

    /// [549] Hinweis: Es darf nur eine Information im DE3148 übermittelt werden
    fn evaluate_549(&self, _ctx: &EvaluationContext) -> ConditionResult {
        // Hinweis: Es darf nur eine Information im DE3148 übermittelt werden — informational note, always applies
        ConditionResult::True
    }

    /// [926] Format: Möglicher Wert: 0
    // 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)
    fn evaluate_926(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.format_check("MOA", 0, 1, |val| validate_numeric(val, "==", 0.0))
    }

    /// [930] Format: max. 2 Nachkommastellen
    // 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)
    fn evaluate_930(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.format_check("MOA", 0, 1, |val| validate_max_decimal_places(val, 2))
    }

    /// [931] Format: ZZZ = +00
    fn evaluate_931(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.format_check("DTM", 0, 1, validate_timezone_utc)
    }

    /// [939] Format: Die Zeichenkette muss die Zeichen @ und . enthalten
    fn evaluate_939(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.format_check("COM", 0, 0, validate_email)
    }

    /// [940] Format: Die Zeichenkette muss mit dem Zeichen + beginnen und danach dürfen nur noch Ziffern folgen
    fn evaluate_940(&self, ctx: &EvaluationContext) -> ConditionResult {
        ctx.format_check("COM", 0, 0, validate_phone)
    }
}