// <auto-generated>
// Generated by automapper-generator generate-conditions
// AHB: xml-migs-and-ahbs/FV2504/ORDERS_AHB_1_0a_Fehlerkorrektur_20250623.xml
// Generated: 2026-03-12T10:26:58Z
// </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::{ConditionEvaluator, ConditionResult, EvaluationContext};
/// Generated condition evaluator for ORDERS FV2504.
pub struct OrdersConditionEvaluatorFV2504 {
// External condition IDs that require runtime context.
external_conditions: std::collections::HashSet<u32>,
}
impl Default for OrdersConditionEvaluatorFV2504 {
fn default() -> Self {
let mut external_conditions = std::collections::HashSet::new();
external_conditions.insert(6);
external_conditions.insert(7);
external_conditions.insert(9);
external_conditions.insert(15);
external_conditions.insert(16);
external_conditions.insert(17);
external_conditions.insert(23);
external_conditions.insert(26);
external_conditions.insert(27);
external_conditions.insert(28);
external_conditions.insert(29);
external_conditions.insert(36);
external_conditions.insert(45);
external_conditions.insert(60);
external_conditions.insert(61);
external_conditions.insert(62);
external_conditions.insert(63);
external_conditions.insert(76);
external_conditions.insert(78);
external_conditions.insert(82);
external_conditions.insert(86);
external_conditions.insert(91);
external_conditions.insert(95);
external_conditions.insert(96);
external_conditions.insert(100);
external_conditions.insert(101);
external_conditions.insert(104);
external_conditions.insert(105);
external_conditions.insert(125);
external_conditions.insert(126);
external_conditions.insert(127);
external_conditions.insert(128);
external_conditions.insert(129);
external_conditions.insert(131);
external_conditions.insert(132);
external_conditions.insert(133);
external_conditions.insert(140);
external_conditions.insert(141);
external_conditions.insert(142);
external_conditions.insert(143);
external_conditions.insert(152);
external_conditions.insert(153);
external_conditions.insert(154);
external_conditions.insert(155);
external_conditions.insert(156);
external_conditions.insert(157);
external_conditions.insert(158);
external_conditions.insert(159);
external_conditions.insert(160);
external_conditions.insert(162);
external_conditions.insert(164);
external_conditions.insert(165);
external_conditions.insert(166);
external_conditions.insert(172);
external_conditions.insert(178);
external_conditions.insert(180);
external_conditions.insert(492);
external_conditions.insert(493);
external_conditions.insert(2001);
external_conditions.insert(2065);
Self {
external_conditions,
}
}
}
impl ConditionEvaluator for OrdersConditionEvaluatorFV2504 {
fn message_type(&self) -> &str {
"ORDERS"
}
fn format_version(&self) -> &str {
"FV2504"
}
fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
match condition {
1 => self.evaluate_1(ctx),
2 => self.evaluate_2(ctx),
6 => self.evaluate_6(ctx),
7 => self.evaluate_7(ctx),
9 => self.evaluate_9(ctx),
12 => self.evaluate_12(ctx),
13 => self.evaluate_13(ctx),
15 => self.evaluate_15(ctx),
16 => self.evaluate_16(ctx),
17 => self.evaluate_17(ctx),
18 => self.evaluate_18(ctx),
19 => self.evaluate_19(ctx),
21 => self.evaluate_21(ctx),
23 => self.evaluate_23(ctx),
24 => self.evaluate_24(ctx),
26 => self.evaluate_26(ctx),
27 => self.evaluate_27(ctx),
28 => self.evaluate_28(ctx),
29 => self.evaluate_29(ctx),
33 => self.evaluate_33(ctx),
34 => self.evaluate_34(ctx),
35 => self.evaluate_35(ctx),
36 => self.evaluate_36(ctx),
38 => self.evaluate_38(ctx),
45 => self.evaluate_45(ctx),
46 => self.evaluate_46(ctx),
47 => self.evaluate_47(ctx),
51 => self.evaluate_51(ctx),
54 => self.evaluate_54(ctx),
55 => self.evaluate_55(ctx),
56 => self.evaluate_56(ctx),
57 => self.evaluate_57(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),
67 => self.evaluate_67(ctx),
68 => self.evaluate_68(ctx),
69 => self.evaluate_69(ctx),
70 => self.evaluate_70(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),
91 => self.evaluate_91(ctx),
93 => self.evaluate_93(ctx),
94 => self.evaluate_94(ctx),
95 => self.evaluate_95(ctx),
96 => self.evaluate_96(ctx),
97 => self.evaluate_97(ctx),
99 => self.evaluate_99(ctx),
100 => self.evaluate_100(ctx),
101 => self.evaluate_101(ctx),
102 => self.evaluate_102(ctx),
103 => self.evaluate_103(ctx),
104 => self.evaluate_104(ctx),
105 => self.evaluate_105(ctx),
106 => self.evaluate_106(ctx),
107 => self.evaluate_107(ctx),
108 => self.evaluate_108(ctx),
109 => self.evaluate_109(ctx),
110 => self.evaluate_110(ctx),
112 => self.evaluate_112(ctx),
113 => self.evaluate_113(ctx),
114 => self.evaluate_114(ctx),
115 => self.evaluate_115(ctx),
117 => self.evaluate_117(ctx),
118 => self.evaluate_118(ctx),
119 => self.evaluate_119(ctx),
120 => self.evaluate_120(ctx),
121 => self.evaluate_121(ctx),
122 => self.evaluate_122(ctx),
123 => self.evaluate_123(ctx),
124 => self.evaluate_124(ctx),
125 => self.evaluate_125(ctx),
126 => self.evaluate_126(ctx),
127 => self.evaluate_127(ctx),
128 => self.evaluate_128(ctx),
129 => self.evaluate_129(ctx),
130 => self.evaluate_130(ctx),
131 => self.evaluate_131(ctx),
132 => self.evaluate_132(ctx),
133 => self.evaluate_133(ctx),
134 => self.evaluate_134(ctx),
135 => self.evaluate_135(ctx),
136 => self.evaluate_136(ctx),
137 => self.evaluate_137(ctx),
138 => self.evaluate_138(ctx),
139 => self.evaluate_139(ctx),
140 => self.evaluate_140(ctx),
141 => self.evaluate_141(ctx),
142 => self.evaluate_142(ctx),
143 => self.evaluate_143(ctx),
147 => self.evaluate_147(ctx),
148 => self.evaluate_148(ctx),
152 => self.evaluate_152(ctx),
153 => self.evaluate_153(ctx),
154 => self.evaluate_154(ctx),
155 => self.evaluate_155(ctx),
156 => self.evaluate_156(ctx),
157 => self.evaluate_157(ctx),
158 => self.evaluate_158(ctx),
159 => self.evaluate_159(ctx),
160 => self.evaluate_160(ctx),
161 => self.evaluate_161(ctx),
162 => self.evaluate_162(ctx),
163 => self.evaluate_163(ctx),
164 => self.evaluate_164(ctx),
165 => self.evaluate_165(ctx),
166 => self.evaluate_166(ctx),
167 => self.evaluate_167(ctx),
168 => self.evaluate_168(ctx),
169 => self.evaluate_169(ctx),
170 => self.evaluate_170(ctx),
171 => self.evaluate_171(ctx),
172 => self.evaluate_172(ctx),
173 => self.evaluate_173(ctx),
174 => self.evaluate_174(ctx),
175 => self.evaluate_175(ctx),
176 => self.evaluate_176(ctx),
177 => self.evaluate_177(ctx),
178 => self.evaluate_178(ctx),
179 => self.evaluate_179(ctx),
180 => self.evaluate_180(ctx),
490 => self.evaluate_490(ctx),
491 => self.evaluate_491(ctx),
492 => self.evaluate_492(ctx),
493 => self.evaluate_493(ctx),
494 => self.evaluate_494(ctx),
495 => self.evaluate_495(ctx),
500 => self.evaluate_500(ctx),
501 => self.evaluate_501(ctx),
503 => self.evaluate_503(ctx),
506 => self.evaluate_506(ctx),
507 => self.evaluate_507(ctx),
514 => self.evaluate_514(ctx),
515 => self.evaluate_515(ctx),
517 => self.evaluate_517(ctx),
518 => self.evaluate_518(ctx),
519 => self.evaluate_519(ctx),
521 => self.evaluate_521(ctx),
522 => self.evaluate_522(ctx),
523 => self.evaluate_523(ctx),
525 => self.evaluate_525(ctx),
527 => self.evaluate_527(ctx),
530 => self.evaluate_530(ctx),
531 => self.evaluate_531(ctx),
532 => self.evaluate_532(ctx),
533 => self.evaluate_533(ctx),
535 => self.evaluate_535(ctx),
536 => self.evaluate_536(ctx),
539 => self.evaluate_539(ctx),
540 => self.evaluate_540(ctx),
542 => self.evaluate_542(ctx),
543 => self.evaluate_543(ctx),
545 => self.evaluate_545(ctx),
547 => self.evaluate_547(ctx),
548 => self.evaluate_548(ctx),
549 => self.evaluate_549(ctx),
550 => self.evaluate_550(ctx),
551 => self.evaluate_551(ctx),
552 => self.evaluate_552(ctx),
553 => self.evaluate_553(ctx),
554 => self.evaluate_554(ctx),
555 => self.evaluate_555(ctx),
557 => self.evaluate_557(ctx),
558 => self.evaluate_558(ctx),
559 => self.evaluate_559(ctx),
560 => self.evaluate_560(ctx),
561 => self.evaluate_561(ctx),
562 => self.evaluate_562(ctx),
563 => self.evaluate_563(ctx),
564 => self.evaluate_564(ctx),
566 => self.evaluate_566(ctx),
567 => self.evaluate_567(ctx),
568 => self.evaluate_568(ctx),
569 => self.evaluate_569(ctx),
570 => self.evaluate_570(ctx),
571 => self.evaluate_571(ctx),
572 => self.evaluate_572(ctx),
573 => self.evaluate_573(ctx),
574 => self.evaluate_574(ctx),
575 => self.evaluate_575(ctx),
576 => self.evaluate_576(ctx),
903 => self.evaluate_903(ctx),
906 => self.evaluate_906(ctx),
911 => self.evaluate_911(ctx),
914 => self.evaluate_914(ctx),
922 => self.evaluate_922(ctx),
930 => self.evaluate_930(ctx),
931 => self.evaluate_931(ctx),
932 => self.evaluate_932(ctx),
933 => self.evaluate_933(ctx),
934 => self.evaluate_934(ctx),
935 => self.evaluate_935(ctx),
939 => self.evaluate_939(ctx),
940 => self.evaluate_940(ctx),
950 => self.evaluate_950(ctx),
951 => self.evaluate_951(ctx),
955 => self.evaluate_955(ctx),
960 => self.evaluate_960(ctx),
961 => self.evaluate_961(ctx),
962 => self.evaluate_962(ctx),
967 => self.evaluate_967(ctx),
2001 => self.evaluate_2001(ctx),
2002 => self.evaluate_2002(ctx),
2003 => self.evaluate_2003(ctx),
2004 => self.evaluate_2004(ctx),
2005 => self.evaluate_2005(ctx),
2006 => self.evaluate_2006(ctx),
2007 => self.evaluate_2007(ctx),
2044 => self.evaluate_2044(ctx),
2050 => self.evaluate_2050(ctx),
2060 => self.evaluate_2060(ctx),
2061 => self.evaluate_2061(ctx),
2062 => self.evaluate_2062(ctx),
2063 => self.evaluate_2063(ctx),
2064 => self.evaluate_2064(ctx),
2065 => self.evaluate_2065(ctx),
2066 => self.evaluate_2066(ctx),
2088 => self.evaluate_2088(ctx),
2089 => self.evaluate_2089(ctx),
2090 => self.evaluate_2090(ctx),
2092 => self.evaluate_2092(ctx),
2094 => self.evaluate_2094(ctx),
2095 => self.evaluate_2095(ctx),
2096 => self.evaluate_2096(ctx),
2097 => self.evaluate_2097(ctx),
2098 => self.evaluate_2098(ctx),
2099 => self.evaluate_2099(ctx),
_ => ConditionResult::Unknown,
}
}
fn is_external(&self, condition: u32) -> bool {
self.external_conditions.contains(&condition)
}
fn is_known(&self, condition: u32) -> bool {
matches!(
condition,
1 | 2
| 6
| 7
| 9
| 12
| 13
| 15
| 16
| 17
| 18
| 19
| 21
| 23
| 24
| 26
| 27
| 28
| 29
| 33
| 34
| 35
| 36
| 38
| 45
| 46
| 47
| 51
| 54
| 55
| 56
| 57
| 60
| 61
| 62
| 63
| 64
| 65
| 67
| 68
| 69
| 70
| 76
| 77
| 78
| 79
| 80
| 81
| 82
| 83
| 84
| 85
| 86
| 87
| 91
| 93
| 94
| 95
| 96
| 97
| 99
| 100
| 101
| 102
| 103
| 104
| 105
| 106
| 107
| 108
| 109
| 110
| 112
| 113
| 114
| 115
| 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
| 147
| 148
| 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
| 490
| 491
| 492
| 493
| 494
| 495
| 500
| 501
| 503
| 506
| 507
| 514
| 515
| 517
| 518
| 519
| 521
| 522
| 523
| 525
| 527
| 530
| 531
| 532
| 533
| 535
| 536
| 539
| 540
| 542
| 543
| 545
| 547
| 548
| 549
| 550
| 551
| 552
| 553
| 554
| 555
| 557
| 558
| 559
| 560
| 561
| 562
| 563
| 564
| 566
| 567
| 568
| 569
| 570
| 571
| 572
| 573
| 574
| 575
| 576
| 903
| 906
| 911
| 914
| 922
| 930
| 931
| 932
| 933
| 934
| 935
| 939
| 940
| 950
| 951
| 955
| 960
| 961
| 962
| 967
| 2001
| 2002
| 2003
| 2004
| 2005
| 2006
| 2007
| 2044
| 2050
| 2060
| 2061
| 2062
| 2063
| 2064
| 2065
| 2066
| 2088
| 2089
| 2090
| 2092
| 2094
| 2095
| 2096
| 2097
| 2098
| 2099
)
}
}
impl OrdersConditionEvaluatorFV2504 {
/// [16] Wenn eine untergeordnete SG vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Generic structural condition: 'if a subordinate SG is present'. Depends entirely on which child segment group is being checked in context — the condition number is reused across many segment rows with different child SGs. Cannot be resolved from the EDIFACT message content alone; requires the validation framework to supply structural position context. (medium confidence)
fn evaluate_16(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("subordinate_sg_present")
}
/// [17] Wenn ein Segment innerhalb der SG vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Generic structural condition: 'if a segment within the SG is present'. Like [16], this condition number is reused across many rows and the specific segment being checked depends on the validation context. Cannot determine which segment to check without positional context supplied externally. (medium confidence)
fn evaluate_17(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("segment_within_sg_present")
}
/// [78] Wenn in derselben SG29 mit Z55 in LIN DE1229 (Erforderliches Produkt der Netzlokation) das PIA+5 DE7140 mit einem Messprodukt aus Codeliste der Konfigurationen, Kapitel 2 „Codeliste der Standard-...
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Requires checking PIA DE7140 against an external code list from 'Codeliste der Konfigurationen, Kapitel 2 – Codeliste der Standard-Messprodukt Strom für Werte nach Typ 1' filtered to those with the Werteigenschaft 'Blindarbeit'. The structural check (LIN Z55 + PIA+5 in same SG29) is possible via navigator, but the code list membership for 'Blindarbeit' products is an external reference that cannot be determined from the EDIFACT message alone. (medium confidence)
fn evaluate_78(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("pia_has_blindarbeit_product_netzlokation")
}
/// [82] Wenn eine andere SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) mit PIA+5 DE7140 mit einem Messprodukt aus Codeliste der Konfigurationen, Kapitel 2.1.1 „Standard-Messproduk...
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Requires: (1) finding ANOTHER SG29 (not the current one) where LIN DE1229 = Z54, (2) that SG29 also has PIA+5, and (3) PIA DE7140 is from 'Codeliste der Konfigurationen, Kapitel 2.1.1 – Standard-Messprodukt der Marktlokation mit der Wahlmöglichkeit der Zuordnung einer Zählzeit'. The code list membership is external and cannot be determined from the EDIFACT message alone. (medium confidence)
fn evaluate_82(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("other_sg29_z54_with_zaehlzeit_product")
}
/// [83] Wenn keine andere SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) mit PIA+5 DE7140 mit einem Messprodukt aus Codeliste der Konfigurationen Kapitel 2.1.1 „Standard-Messproduk...
// REVIEW: Logical negation of condition [82]: 'wenn KEINE andere SG29 mit Z54 ... vorhanden ist'. Implemented by inverting the external result for [82]. Returns Unknown when the underlying external condition is Unknown (e.g., code list not available). (medium confidence)
fn evaluate_83(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx
.external
.evaluate("other_sg29_z54_with_zaehlzeit_product")
{
ConditionResult::True => ConditionResult::False,
ConditionResult::False => ConditionResult::True,
ConditionResult::Unknown => ConditionResult::Unknown,
}
}
/// [86] Wenn in derselben SG29 mit Z19 in LIN DE1229 (Erforderliches Produkt der Messlokation) das PIA+5 DE7140 mit einem Messprodukt aus Codeliste der Konfigurationen Kapitel 2.3.1 "Standard-Messprodukt d...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_86(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("pia_z19_has_standard_messprodukt_with_zählzeit_wahlmöglichkeit")
}
/// [91] Wenn in diesem Datenelement kein anderes Paket zur Möglichkeit der Angabe von mindestens einem anderen Code führt.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_91(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("no_other_package_enables_additional_code")
}
/// [126] Es sind nur die Konfigurations-Produkte erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.2 „Konfigurationsprodukte Leistungskurvendefinition“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_126(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_in_konfigurationsprodukte_leistungskurvendefinition")
}
/// [127] Es sind nur die Konfigurations-Produkte erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.3 „Konfigurationsprodukte Ad-Hoc-Steuerkanal“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_127(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_in_konfigurationsprodukte_ad_hoc_steuerkanal")
}
/// [128] Es sind nur die Messprodukte erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.5 „Messprodukte für Werte nach Typ 2 aus Backend für LF und NB“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_128(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_in_messprodukte_typ2_backend_lf_nb")
}
/// [129] Es sind nur die Messprodukte erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.4 „Messprodukte mit Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_129(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_in_smgw_typ2_konfiguration_codeliste")
}
/// [141] Es sind nur die Messprodukt-Position-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.7 „Art der Werte für Messprodukte nach Typ 2“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_141(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("messprodukt_position_code_in_typ2_art_codeliste")
}
/// [142] Wenn innerhalb derselben SG29 LIN im PIA+5 DE7140 (Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) ein Produkt angegeben ist, das in der Codeliste der Konfigurationen...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_142(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("smgw_product_triggers_on_threshold_crossing")
}
/// [143] Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Steuerbaren Ressource angegeben ist
/// EXTERNAL: Requires context from outside the message.
fn evaluate_143(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("meldepunkt_is_steuerbare_ressource")
}
/// [152] Wenn in SG29 LIN (Erforderliches Produkt der Messlokation) das PIA+5 DE7140 mit einem Produkt-Code vorhanden ist der in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_152(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("messlokation_product_is_weitere_energieflussrichtung")
}
/// [153] Es sind nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer Änderung an einer Lokation" die in der Spalte "Ebene" mit dem Wert "Mess...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_153(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("product_code_level_messlokation")
}
/// [154] Es sind nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer Änderung an einer Lokation" die in der Spalte "Ebene" mit dem Wert "Netz...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_154(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("product_code_level_netzlokation")
}
/// [155] Es sind nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer Änderung an einer Lokation" die in der Spalte "Ebene" mit dem Wert "Steu...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_155(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_code_level_steuerbare_ressource")
}
/// [156] Es sind weiterhin nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer Änderung an einer Lokation" die in der Spalte "Produkt gegenü...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_156(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("product_code_orderable_by_nb")
}
/// [157] Es sind weiterhin nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 7 "Produkte zur Bestellung einer Änderung an einer Lokation" die in der Spalte "Produkt gegenü...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_157(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("product_code_orderable_by_lf")
}
/// [158] Es sind nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung einer Änderung von Abrechnungsdaten" genannt sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_158(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("product_code_in_abrechnungsdaten_configuration_list")
}
/// [159] Wenn in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 ein Produkt-Code genannt ist, der in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung e...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_159(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("abrechnungsdaten_product_has_property_code_column")
}
/// [160] Es sind nur die Codes der Produkteigenschaft zu dem in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 erlaubt, die in der Codeliste der Konfigurationen im Kapitel 6.2 ...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_160(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("abrechnungsdaten_property_code_matches_product_row")
}
/// [162] Es ist nur der Wertebereich erlaubt, der zu dem in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 genannten Produkt, das in der Codeliste der Konfigurationen im Kapite...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_162(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("abrechnungsdaten_value_range_matches_product_row")
}
/// [164] Wenn die Konfiguration der in SG34 RFF+Z20 DE1154 (Referenz auf ID der Tranche) genannte Tranche innerhalb derselben SG29 LIN++Z16 (Erforderliches Produkt der Tranche) unverändert bestehen bleibt.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_164(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("tranche_configuration_unchanged")
}
/// [165] Wenn die Konfiguration der in SG34 RFF+Z20 DE1154 (Referenz auf ID der Tranche) genannte Tranche innerhalb derselben SG29 LIN++Z16 (Erforderliches Produkt der Tranche) aufgrund einer Zuordnung eine...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_165(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("tranche_reconfiguration_by_lf_assignment")
}
/// [166] Wenn es sich um die Einrichtung der Konfigurationen aufgrund einer Zuordnung eines LF zu einer Tranche handelt
/// EXTERNAL: Requires context from outside the message.
fn evaluate_166(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("configuration_setup_by_lf_tranche_assignment")
}
/// [172] Wenn es sich bei der in SG2 LOC+172 DE3225 genannten Lokation um die Integration in eine Kundenanlage oder Herauslösung aus einer Kundenanlage nach §20 Abs.1d EnWG handelt. Details siehe UTILMD A...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_172(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("location_is_kundenanlage_integration_or_removal")
}
/// [178] Wenn vom NB eine Abtretungserklärung vom Kunden gewünscht ist.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_178(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("nb_requires_assignment_declaration")
}
/// [179] Wenn in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 das Produkt "Empfänger der Vergütung zur Einspeisung" aus der Codeliste der Konfigurationen im Kapitel 6.2 "Pr...
fn evaluate_179(&self, _ctx: &EvaluationContext) -> ConditionResult {
// TODO: Condition [179] requires manual implementation
// Reason: The condition requires checking (a) that PIA+5 DE7140 within the same SG29 contains the specific product code for 'Empfänger der Vergütung zur Einspeisung' from codelist chapter 6.2, and (b) that CAV+ZH9 DE7110 in SG30 contains the code for 'Lieferant'. The structural access is available via any_group_has_co_occurrence and navigator API, but the actual codelist values for these two fields are defined in chapter 6.2 of the AHB document and not provided in the segment schema reference. Without those concrete code values the check cannot be reliably implemented.
ConditionResult::Unknown
}
/// [180] Wenn in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 ein Produkt-Code genannt ist der in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung ei...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_180(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("product_code_abrechnungsdaten_valid")
}
/// [490] wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.5 „Übersicht gesetzliche deutsche Sommerzeit (MESZ)“ der Spalten: „Sommerzei...
fn evaluate_490(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.resolved_value {
Some(val) => is_mesz_utc(val),
None => ConditionResult::False,
}
}
/// [491] wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.6 „Übersicht gesetzliche deutsche Zeit (MEZ)“ der Spalten: „Winterzeit (MEZ)...
fn evaluate_491(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.resolved_value {
Some(val) => is_mez_utc(val),
None => ConditionResult::False,
}
}
/// [967] Format: Zertifikatskörper gemäß X509.1, BSI TR-03109-4
fn evaluate_967(&self, _ctx: &EvaluationContext) -> ConditionResult {
// TODO: Condition [967] requires manual implementation
// Reason: Format condition requires validating an X.509 certificate body per BSI TR-03109-4. Certificate structural validation (ASN.1/DER encoding, BSI profile compliance) is not supported by the available format validation helpers and cannot be meaningfully checked against raw EDIFACT segment values.
ConditionResult::Unknown
}
/// [2001] Die SG29 ist so oft zu wiederholen, wie ab dem DTM+203 (Ausführungsdatum) Tranchen zu der in der SG2 genannten Marktlokation vorhanden sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_2001(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sg29_tranche_count_matches")
}
/// [2003] Die SG29 ist so oft zu wiederholen, wie ab dem DTM+203 (Ausführungsdatum) Messlokationen zu der in der SG2 genannten Marktlokation vorhanden sind und für jede dieser Messlokationen müssen alle M...
fn evaluate_2003(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: SG29 repetition cardinality rule — informational annotation documenting that
// SG29 must repeat once per Messlokation associated with the Marktlokation from DTM+203,
// and all Messprodukte for each Messlokation (including Tranchen) must be listed.
// This is a structural cardinality guidance note, always applies.
ConditionResult::True
}
/// [2065] Diese SG30 ist so oft zu wiederholen, wie zu den unterschiedlichen Messprodukt-Position-Codes zu dem innerhalb derselben SG29 LIN im PIA+5 DE7140 (Erforderliches Produkt Konfigurationserlaubnis fü...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_2065(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("sg30_configuration_threshold_product_cardinality")
}
/// [1] Wenn IMD+Z03 vorhanden
fn evaluate_1(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 0, "Z03")
}
/// [2] Wenn BGM+7 vorhanden
fn evaluate_2(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("BGM", 0, "7")
}
/// [6] Wenn MP-ID in SG2 NAD+MS mit Rolle LF vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_6(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_lf")
}
/// [7] Wenn MP-ID in SG2 NAD+MS mit Rolle NB vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_7(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_nb")
}
/// [9] Wenn bekannt
/// EXTERNAL: Requires context from outside the message.
// REVIEW: 'Wenn bekannt' (when known) depends on whether a value is known in the business context — cannot be derived from EDIFACT segments alone. (medium confidence)
fn evaluate_9(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("information_is_known")
}
/// [12] Wenn vorhanden
// REVIEW: Condition 12 'Wenn vorhanden' is a generic self-referential meta-condition indicating that the attached validation rule applies whenever the field is populated. The validator framework handles actual presence detection; this evaluator simply returns True to indicate the rule is always applicable when invoked. (medium confidence)
fn evaluate_12(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Wenn vorhanden — generic 'when present' meta-condition
// In AHB context this means: validation applies whenever the field is populated.
// Returning True here defers the presence check to the validator framework itself.
ConditionResult::True
}
/// [13] Wenn SG2 LOC+172 nicht vorhanden
fn evaluate_13(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LOC", 0, "172")
}
/// [15] Wenn MP-ID in SG2 NAD+MS mit Rolle MSB vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_15(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_msb")
}
/// [18] Wenn IMD++Z11 vorhanden
fn evaluate_18(&self, ctx: &EvaluationContext) -> ConditionResult {
let imds = ctx.find_segments("IMD");
ConditionResult::from(imds.iter().any(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z11")
}))
}
/// [19] Wenn IMD++Z12 vorhanden
fn evaluate_19(&self, ctx: &EvaluationContext) -> ConditionResult {
let imds = ctx.find_segments("IMD");
ConditionResult::from(imds.iter().any(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z12")
}))
}
/// [21] Wenn BGM+Z28 vorhanden
fn evaluate_21(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("BGM", 0, "Z28")
}
/// [23] Wenn MP-ID in SG2 NAD+MR mit Rolle NB vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_23(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_nb")
}
/// [24] Wenn IMD++Z35 vorhanden
fn evaluate_24(&self, ctx: &EvaluationContext) -> ConditionResult {
let imds = ctx.find_segments("IMD");
ConditionResult::from(imds.iter().any(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z35")
}))
}
/// [26] Wenn MP-ID in SG2 NAD+MS mit Rolle ÜNB vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Whether the NAD+MS market participant holds the role ÜNB (Übertragungsnetzbetreiber) cannot be determined from the EDIFACT message content alone. The role is a business context attribute of the MP-ID that requires an external master data lookup (e.g. Marktstammdatenregister or internal role registry). Marked external with name 'sender_is_uenb'. (medium confidence)
fn evaluate_26(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_uenb")
}
/// [27] Wenn MP-ID in SG2 NAD+MR mit Rolle MSB vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Whether the NAD+MR market participant holds the role MSB (Messstellenbetreiber) cannot be determined from the EDIFACT message content alone. The role is a business context attribute of the MP-ID requiring external master data. Marked external with name 'recipient_is_msb'. (medium confidence)
fn evaluate_27(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_msb")
}
/// [28] Wenn MP-ID in SG2 NAD+MR aus Sparte Strom
/// EXTERNAL: Requires context from outside the message.
fn evaluate_28(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_market_sector_is_strom")
}
/// [29] Wenn MP-ID in SG2 NAD+MR aus Sparte Gas
/// EXTERNAL: Requires context from outside the message.
fn evaluate_29(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_market_sector_is_gas")
}
/// [33] Wenn IMD+Z01 vorhanden
fn evaluate_33(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 1, "Z01")
}
/// [34] Wenn IMD+Z02 vorhanden
fn evaluate_34(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 1, "Z02")
}
/// [35] IMD++Z14+Z06 vorhanden
fn evaluate_35(&self, ctx: &EvaluationContext) -> ConditionResult {
let imds = ctx.find_segments("IMD");
let found = imds.iter().any(|s| {
let has_z14 = s
.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z14");
let has_z06 = s
.elements
.get(2)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z06");
has_z14 && has_z06
});
ConditionResult::from(found)
}
/// [36] Wenn MP-ID in SG2 NAD+MR mit Rolle NB nicht vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_36(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_role_is_not_nb")
}
/// [38] Wenn FTX+Z04/Z05 vorhanden
fn evaluate_38(&self, ctx: &EvaluationContext) -> ConditionResult {
let found = ctx.find_segments("FTX").iter().any(|s| {
s.elements
.first()
.and_then(|e| e.first())
.is_some_and(|v| v == "Z04" || v == "Z05")
});
ConditionResult::from(found)
}
/// [45] Wenn MP-ID in SG2 NAD+MS mit Rolle MSB nicht vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_45(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_role_is_not_msb")
}
/// [46] Wenn SG29 IMD++Z46 vorhanden
fn evaluate_46(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 1, "Z46")
}
/// [47] Wenn SG29 IMD++Z46 nicht vorhanden
fn evaluate_47(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("IMD", 1, "Z46")
}
/// [51] Wenn BGM+Z48 vorhanden
fn evaluate_51(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("BGM", 0, "Z48")
}
/// [54] Wenn FTX+Z06 vorhanden
fn evaluate_54(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("FTX", 0, "Z06")
}
/// [55] Wenn DTM+469 (Beginn zum nächstmöglichen Termin) nicht vorhanden
fn evaluate_55(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("DTM", 0, "469")
}
/// [56] Wenn DTM+203 (Ausführungsdatum) nicht vorhanden
fn evaluate_56(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("DTM", 0, "203")
}
/// [57] Wenn im selben SG2 NAD DE3124 nicht vorhanden
// REVIEW: Checks if any NAD segment in the message lacks DE3124 (C058 at elements[2][0]). 'Im selben SG2' requires group context; falls back to message-wide check. DE3124 is the first component of C058 (Zeile für Name und Anschrift / Zusatzinfo). (medium confidence)
fn evaluate_57(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments("NAD");
if nads.is_empty() {
return ConditionResult::Unknown;
}
let any_without = nads.iter().any(|nad| {
nad.elements
.get(2)
.and_then(|e| e.first())
.map(|v| v.is_empty())
.unwrap_or(true)
});
ConditionResult::from(any_without)
}
/// [60] MP-ID nur aus Sparte Gas
/// EXTERNAL: Requires context from outside the message.
fn evaluate_60(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("market_location_is_gas")
}
/// [61] MP-ID nur aus Sparte Strom
/// EXTERNAL: Requires context from outside the message.
fn evaluate_61(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("market_location_is_electricity")
}
/// [62] MP-ID mit Rolle MSB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_62(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_msb")
}
/// [63] MP-ID mit Rolle NB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("sender_is_nb")
}
/// [64] Wenn SG2 NAD+Z03 nicht vorhanden
fn evaluate_64(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("NAD", 0, "Z03")
}
/// [65] Wenn FTX+Z08 vorhanden
fn evaluate_65(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("FTX", 0, "Z08")
}
/// [67] Wenn DTM+163 nicht vorhanden
fn evaluate_67(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("DTM", 0, "163")
}
/// [68] Wenn DTM+7 nicht vorhanden
fn evaluate_68(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("DTM", 0, "7")
}
/// [69] Wenn NAD+Z23 nicht vorhanden
fn evaluate_69(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("NAD", 0, "Z23")
}
/// [70] Wenn NAD+Z03 nicht vorhanden
fn evaluate_70(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("NAD", 0, "Z03")
}
/// [76] Wenn in derselben SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) das PIA+5 DE7140 mit einem Messprodukt aus Codeliste der Konfigurationen Kapitel 2.1.1 "Standard-Messprodukt ...
/// EXTERNAL: Requires context from outside the message.
fn evaluate_76(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("pia_product_in_standard_messprodukt_wahlmoeglichkeit_list")
}
/// [77] Wenn im selben CCI im DE7059 der Code Z39 (Code der Zählzeitdefinition) vorhanden ist
// REVIEW: Checks if a CCI segment in the same SG29 group has DE7059 == 'Z39' (Code der Zählzeitdefinition). DE7059 is the class/type code at elements[0][0] in CCI. Group-scoped to SG29 with message-wide fallback. (medium confidence)
fn evaluate_77(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_qualifier("CCI", 0, "Z39", &["SG29"])
}
/// [79] Wenn eine andere SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) mit PIA+5+9991000000078:Z11 (für Wirkarbeit Lastgang 1/4 stündlich) vorhanden ist
// REVIEW: Checks if any SG29 instance contains both LIN with Z54 at elements[1][0] and PIA with product code 9991000000078 at elements[1][0]. The 'another SG29' nuance is approximated as 'any SG29' since we have no current-group context. (medium confidence)
fn evaluate_79(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_co_occurrence(
"LIN",
1,
&["Z54"],
"PIA",
1,
0,
&["9991000000078"],
&["SG29"],
)
}
/// [80] Wenn keine andere SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) mit PIA+5+9991000000078:Z11 (Wirkarbeit Lastgang 1/4 stündlich) vorhanden ist
// REVIEW: Negation of condition 79 — no SG29 with LIN+Z54 AND PIA product 9991000000078. (medium confidence)
fn evaluate_80(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.any_group_has_co_occurrence(
"LIN",
1,
&["Z54"],
"PIA",
1,
0,
&["9991000000078"],
&["SG29"],
) {
ConditionResult::True => ConditionResult::False,
ConditionResult::False => ConditionResult::True,
ConditionResult::Unknown => ConditionResult::Unknown,
}
}
/// [81] Wenn in derselben SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation), das PIA+5+9991000000078:Z11 (Wirkarbeit Lastgang 1/4 stündlich) vorhanden ist
// REVIEW: Group-scoped co-occurrence in the same SG29: LIN with Z54 at elements[1][0] AND PIA with product code 9991000000078 at elements[1][0]. Functionally equivalent to condition 79 since the API checks within the same group instance. (medium confidence)
fn evaluate_81(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_co_occurrence(
"LIN",
1,
&["Z54"],
"PIA",
1,
0,
&["9991000000078"],
&["SG29"],
)
}
/// [84] IMD++Z14+Z07 vorhanden
// REVIEW: Checks for IMD segment where elements[1][0]='Z14' (item characteristic) and elements[2][0]='Z07' (item description code). IMD++Z14+Z07 maps directly to these positions. (medium confidence)
fn evaluate_84(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let segments = ctx.find_segments("IMD");
ConditionResult::from(segments.iter().any(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z14")
&& s.elements
.get(2)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z07")
}))
}
}
/// [85] Wenn in derselben SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation), das PIA+5+9991000000086:Z11 (Wirkarbeit höchste 1/4 Stunde im Monat) vorhanden ist
// REVIEW: Group-scoped co-occurrence in SG29: LIN with Z54 at elements[1][0] AND PIA with product code 9991000000086 (Wirkarbeit höchste 1/4 Stunde im Monat) at elements[1][0]. (medium confidence)
fn evaluate_85(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_co_occurrence(
"LIN",
1,
&["Z54"],
"PIA",
1,
0,
&["9991000000086"],
&["SG29"],
)
}
/// [87] Wenn FTX+Z09/Z10 vorhanden
fn evaluate_87(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let segs = ctx.find_segments("FTX");
ConditionResult::from(segs.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.first())
.is_some_and(|v| v == "Z09" || v == "Z10")
}))
}
}
/// [93] Wenn in derselben Nachricht eine SG29 mit Z16 in LIN DE1229 (Erforderliches Produkt der Tranche) nicht vorhanden
fn evaluate_93(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z16")
}
/// [94] Wenn in derselben Nachricht eine SG29 mit Z54 in LIN DE1229 (Erforderliches Produkt der Marktlokation) nicht vorhanden
fn evaluate_94(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z54")
}
/// [95] Messprodukt-Code aus dem Kapitel 2.1 "Standard-Messprodukte der Marktlokation" der Codeliste der Konfigurationen
/// EXTERNAL: Requires context from outside the message.
fn evaluate_95(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("messprodukt_standard_marktlokation")
}
/// [96] Messprodukt-Code aus dem Kapitel 2.2 "Standard-Messprodukte der Tranche" der Codeliste der Konfigurationen
/// EXTERNAL: Requires context from outside the message.
fn evaluate_96(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("messprodukt_standard_tranche")
}
/// [97] Wenn FTX+Z10 vorhanden
fn evaluate_97(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("FTX", 0, "Z10")
}
/// [99] Wenn FTX+Z08/Z10 vorhanden
fn evaluate_99(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_any_qualifier("FTX", 0, &["Z08", "Z10"], &["SG29"])
}
/// [100] Messprodukt-Code aus dem Kapitel 2.3 "Standard-Messprodukte der Messlokation" der Codeliste der Konfigurationen
/// EXTERNAL: Requires context from outside the message.
fn evaluate_100(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("messprodukt_standard_messlokation")
}
/// [101] Wenn MP-ID in SG2 NAD+MR mit Rolle MSB in der Sparte Gas nicht vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Checking whether the NAD+MR recipient has role MSB in Sparte Gas requires external business context about market participant roles — not determinable from message content alone. (medium confidence)
fn evaluate_101(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_msb_gas")
}
/// [102] Wenn in derselben SG29 LIN das CCI+++Z25 (Geräteart Wandler) vorhanden
fn evaluate_102(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_qualifier("CCI", 2, "Z25", &["SG29"])
}
/// [103] Wenn in derselben SG29 LIN das CCI+++Z25 (Geräteart Wandler) nicht vorhanden
fn evaluate_103(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.any_group_has_qualifier("CCI", 2, "Z25", &["SG29"]) {
ConditionResult::True => ConditionResult::False,
ConditionResult::False => ConditionResult::True,
ConditionResult::Unknown => ConditionResult::Unknown,
}
}
/// [104] Wenn MP-ID in SG2 NAD+VY mit Rolle LF vorhanden
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Checking whether the NAD+VY party has role LF requires external market participant role context — cannot be determined from the EDIFACT message alone. (medium confidence)
fn evaluate_104(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("nad_vy_is_lf")
}
/// [105] Wenn die bisherige Konfiguration mit Zählzeiten des LF vom LF beendet werden soll
/// EXTERNAL: Requires context from outside the message.
fn evaluate_105(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("bisherige_konfiguration_zaehltzeiten_lf_beenden")
}
/// [106] wenn IMD++Z60 (Abbestellung Messprodukt mit Zählzeitdefinition des LF) nicht vorhanden
fn evaluate_106(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("IMD", 1, "Z60")
}
/// [107] Wenn IMD++Z57 (Abbestellung Zählzeitdefinition) nicht vorhanden
fn evaluate_107(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("IMD", 1, "Z57")
}
/// [108] Wenn RFF+AGK (Konfigurations-ID) nicht vorhanden
fn evaluate_108(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("RFF", 0, "AGK")
}
/// [109] Wenn LOC+172 (Meldepunkt) nicht vorhanden
fn evaluate_109(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LOC", 0, "172")
}
/// [110] wenn DTM+163 (Beginn Zeitraum für Wertanfrage) vorhanden
fn evaluate_110(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("DTM", 0, "163")
}
/// [112] Wenn in derselben SG29 LIN++Z54 (Erforderliches Produkt der Marktlokation), das PIA+5+9991000000078: Z11 (Wirkarbeit Lastgang 1/4 stündlich) vorhanden ist
// REVIEW: In same SG29: LIN with elements[1][0]=Z54 (Erforderliches Produkt der Marktlokation) co-occurs with PIA where elements[1][0]=9991000000078 (Wirkarbeit Lastgang 1/4h, product code from C212.DE7140). Co-occurrence check scoped to SG29. (medium confidence)
fn evaluate_112(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_co_occurrence(
"LIN",
1,
&["Z54"],
"PIA",
1,
0,
&["9991000000078"],
&["SG29"],
)
}
/// [113] Wenn LIN DE1229 mit Code Z42 (Zählzeitdefinition) vorhanden
fn evaluate_113(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z42")
}
/// [114] Wenn LIN DE1229 mit Code Z69 (Schaltzeitdefinition) vorhanden
fn evaluate_114(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z69")
}
/// [115] Wenn LIN DE1229 mit Code Z70 (Leistungskurvendefinition) vorhanden
fn evaluate_115(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z70")
}
/// [117] Wenn SG29 LIN++Z64 (Erforderliches Produkt Schaltzeitdefinitionen) vorhanden
fn evaluate_117(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z64")
}
/// [118] Wenn SG29 LIN++Z65 (Erforderliches Produkt Leistungskurvendefinitionen) vorhanden
fn evaluate_118(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z65")
}
/// [119] Wenn SG29 LIN++Z66 (Erforderliches Produkt Ad-hoc-Steuerkanal) vorhanden
fn evaluate_119(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z66")
}
/// [120] Wenn SG29 LIN++Z67 (Erforderliches Messprodukt für Werte nach Typ 2 aus Backend) vorhanden
fn evaluate_120(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z67")
}
/// [121] Wenn SG29 LIN++Z68 (Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) vorhanden
fn evaluate_121(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("LIN", 1, "Z68")
}
/// [122] Wenn SG1 RFF+Z41 (Referenznummer des Vorgangs der Anmeldung nach WiM) nicht vorhanden
fn evaluate_122(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("RFF", 0, "Z41")
}
/// [123] Wenn DTM+203 (Ausführungsdatum) nicht vorhanden
fn evaluate_123(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("DTM", 0, "203")
}
/// [124] Wenn SG1 RFF+Z41 (Referenznummer des Vorgangs der Anmeldung nach WiM) vorhanden
fn evaluate_124(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("RFF", 0, "Z41")
}
/// [125] Es sind nur die Konfigurations-Produkte erlaubt, die in der Codeliste der Konfigurationen im Kapitel 4.1 „Konfigurationsprodukte Schaltzeitdefinition“ enthalten sind.
/// EXTERNAL: Requires context from outside the message.
fn evaluate_125(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("konfigurationsprodukt_schaltzeitdefinition")
}
/// [130] Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Marktlokation angegeben ist
fn evaluate_130(&self, ctx: &EvaluationContext) -> ConditionResult {
// Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Marktlokation angegeben ist
// LOC Meldepunkt: elements[0][0]=="172", elements[1][0]==DE3225 (Identifikator)
let locs = ctx.find_segments_with_qualifier("LOC", 0, "172");
match locs
.first()
.and_then(|s| s.elements.get(1))
.and_then(|e| e.first())
{
Some(val) if !val.is_empty() => validate_malo_id(val),
Some(_) => ConditionResult::False,
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [131] Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Messlokation angegeben ist
/// EXTERNAL: Requires context from outside the message.
fn evaluate_131(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("meldepunkt_is_messlokation_id")
}
/// [132] Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Netzlokation angegeben ist
/// EXTERNAL: Requires context from outside the message.
fn evaluate_132(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("meldepunkt_is_netzlokation_id")
}
/// [133] Wenn in LOC+172 DE3225 (Meldepunkt) die ID einer Steuerbaren Ressource angegeben ist
/// EXTERNAL: Requires context from outside the message.
fn evaluate_133(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("meldepunkt_is_steuerbare_ressource_id")
}
/// [134] Wenn die Position in der ursprünglichen Antwort auf die Bestellung aus SG1 RFF+Z42 vorhanden war und reklamiert werden soll
// REVIEW: RFF+Z42 in SG1 (elements[0][0]=="Z42") references the original order response position. Presence of this segment in the current message indicates the reclaim scenario. The 'reklamiert werden soll' clause is implied by the reference existing. (medium confidence)
fn evaluate_134(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("RFF", 0, "Z42")
}
/// [135] Wenn SG29 LIN++Z64 (Erforderliches Produkt Schaltzeitdefinitionen) nicht vorhanden
fn evaluate_135(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z64")
}
/// [136] Wenn SG29 LIN++Z65 (Erforderliches Produkt Leistungskurvendefinitionen) nicht vorhanden
fn evaluate_136(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z65")
}
/// [137] Wenn SG29 LIN++Z66 (Erforderliches Produkt Ad-hoc-Steuerkanal) nicht vorhanden
fn evaluate_137(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z66")
}
/// [138] Wenn SG29 LIN++Z67 (Erforderliches Messprodukt für Werte nach Typ 2 aus Backend) nicht vorhanden
fn evaluate_138(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z67")
}
/// [139] Wenn SG29 LIN++Z68 (Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) nicht vorhanden
fn evaluate_139(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("LIN", 1, "Z68")
}
/// [140] Messprodukt-Code aus dem Kapitel 2.4 "Standard-Messprodukte der Netzlokation" der Codeliste der Konfigurationen
/// EXTERNAL: Requires context from outside the message.
fn evaluate_140(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external
.evaluate("is_standard_messprodukt_netzlokation_code")
}
/// [147] wenn im DE3155 in demselben COM der Code EM vorhanden ist
fn evaluate_147(&self, ctx: &EvaluationContext) -> ConditionResult {
let com_segments = ctx.find_segments("COM");
ConditionResult::from(com_segments.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.get(1))
.is_some_and(|v| v == "EM")
}))
}
/// [148] wenn im DE3155 in demselben COM der Code TE / FX / AJ / AL vorhanden ist
fn evaluate_148(&self, ctx: &EvaluationContext) -> ConditionResult {
let com_segments = ctx.find_segments("COM");
ConditionResult::from(com_segments.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.get(1))
.is_some_and(|v| matches!(v.as_str(), "TE" | "FX" | "AJ" | "AL"))
}))
}
/// [161] Wenn in derselben SG29 LIN (Erforderliches Produkt Abrechnungsdaten) das SG30 CAV+ZH9 (Code der Produkteigenschaft) nicht vorhanden ist.
fn evaluate_161(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_qualifier_without("PIA", 0, "5", "CAV", 0, "ZH9", &["SG4", "SG29"])
}
/// [163] Wenn innerhalb der Nachricht eine SG30 CCI+++ZA9 (Messprodukt für Übertragungsnetzbetreiber relevant) vorhanden ist.
fn evaluate_163(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("CCI", 2, "ZA9")
}
/// [167] Wenn SG2 NAD+DP (Meldepunkt), SG3 RFF+Z20 (Referenz auf ID der Tranche) vorhanden
fn evaluate_167(&self, ctx: &EvaluationContext) -> ConditionResult {
match (
ctx.has_qualifier("NAD", 0, "DP"),
ctx.has_qualifier("RFF", 0, "Z20"),
) {
(ConditionResult::True, ConditionResult::True) => ConditionResult::True,
(ConditionResult::False, _) | (_, ConditionResult::False) => ConditionResult::False,
_ => ConditionResult::Unknown,
}
}
/// [168] Wenn SG2 NAD+DP (Meldepunkt), SG3 RFF+Z20 (Referenz auf ID der Tranche) nicht vorhanden
fn evaluate_168(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.has_qualifier("NAD", 0, "DP") {
ConditionResult::True => ctx.lacks_qualifier("RFF", 0, "Z20"),
other => other,
}
}
/// [169] Wenn in SG29 LIN++Z19 (Erforderliches Produkt der Messlokation) in SG30 CCI (Zugeordnete Zählzeitdefinition im DE7059 der Code Z39 (Code der Zählzeitdefinition) vorhanden ist
fn evaluate_169(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_co_occurrence("LIN", 1, &["Z19"], "CCI", 0, 0, &["Z39"], &["SG29"])
}
/// [170] Wenn in derselben SG29 LIN die SG30 CCI+Z37++ZD1 (Basis zur Bildung der Tranchengröße) (Prozentual) vorhanden
fn evaluate_170(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_qualified_value("CCI", 0, "Z37", 2, 0, &["ZD1"], &["SG29"])
}
/// [171] Wenn in derselben SG29 LIN (Erforderliches Produkt der Tranche) das IMD+++Z64 (Leistungsbeschreibung Konfiguration) (Neukonfiguration) vorhanden ist
fn evaluate_171(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.any_group_has_qualifier("IMD", 2, "Z64", &["SG29"])
}
/// [173] Wenn IMD++Z66 (Beendigung Konfiguration aufgrund Überführung der Marktlokation zu ruhender Marktlokation) vorhanden
fn evaluate_173(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 1, "Z66")
}
/// [174] Wenn IMD++Z67 (Aktivierung Konfiguration in der derzeit ruhenden Marktlokation) vorhanden
fn evaluate_174(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualifier("IMD", 1, "Z67")
}
/// [175] Wenn SG2 NAD+DP (Meldepunkt), SG3 RFF+Z59 (Referenz auf die ID der Marktlokation der Kundenanlage) vorhanden
fn evaluate_175(&self, ctx: &EvaluationContext) -> ConditionResult {
match (
ctx.has_qualifier("NAD", 0, "DP"),
ctx.has_qualifier("RFF", 0, "Z59"),
) {
(ConditionResult::True, ConditionResult::True) => ConditionResult::True,
(ConditionResult::False, _) | (_, ConditionResult::False) => ConditionResult::False,
_ => ConditionResult::Unknown,
}
}
/// [176] Wenn SG2 NAD+DP (Meldepunkt), SG3 RFF+Z59 (Referenz auf die ID der Marktlokation der Kundenanlage) nicht vorhanden
fn evaluate_176(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.has_qualifier("NAD", 0, "DP") {
ConditionResult::True => ctx.lacks_qualifier("RFF", 0, "Z59"),
other => other,
}
}
/// [177] Wenn IMD++Z66 (Beendigung Konfiguration aufgrund Überführung der Marktlokation zu ruhender Marktlokation) nicht vorhanden
fn evaluate_177(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.lacks_qualifier("IMD", 1, "Z66")
}
/// [492] wenn MP-ID in NAD+MR aus Sparte Strom
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Whether the MP-ID in NAD+MR belongs to the Strom (electricity) sector cannot be determined from the EDIFACT message alone — it requires a market participant registry lookup. (medium confidence)
fn evaluate_492(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_strom")
}
/// [493] wenn MP-ID in NAD+MR aus Sparte Gas
/// EXTERNAL: Requires context from outside the message.
// REVIEW: Whether the MP-ID in NAD+MR belongs to the Gas sector cannot be determined from the EDIFACT message alone — it requires a market participant registry lookup. (medium confidence)
fn evaluate_493(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_gas")
}
/// [494] Das hier genannte Datum muss der Zeitpunkt sein, zu dem das Dokument erstellt wurde, oder ein Zeitpunkt, der davor liegt.
// REVIEW: States that the date in this DE must be the document creation time or earlier, i.e. <= DTM+137 Nachrichtendatum. Applied to DTM+203 (Ausführungsdatum) as the most logical target in ORDERS. Lexicographic string comparison is valid for CCYYMMDDHHMM (format 303) values since they are zero-padded fixed-width. (medium confidence)
fn evaluate_494(&self, ctx: &EvaluationContext) -> ConditionResult {
// The date here must be the document creation time (DTM+137 Nachrichtendatum) or earlier.
// DTM+137: elements[0][0]=qualifier(137), elements[0][1]=DE2380 (actual value), elements[0][2]=format(303)
// Applied to Ausführungsdatum (DTM+203) as the most likely subject in ORDERS.
let dtm137_segs = ctx.find_segments_with_qualifier("DTM", 0, "137");
let dtm203_segs = ctx.find_segments_with_qualifier("DTM", 0, "203");
let ref_val = dtm137_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1));
let cmp_val = dtm203_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1));
match (cmp_val, ref_val) {
(Some(cv), Some(rv)) => ConditionResult::from(cv.as_str() <= rv.as_str()),
_ => ConditionResult::Unknown,
}
}
/// [495] Der Zeitpunkt muss ≤ dem Wert im DE2380 des DTM+137 sein
// REVIEW: Explicitly requires the subject timestamp to be <= DE2380 of DTM+137 (Nachrichtendatum). Notation resolved: DTM+137 elements[0][1] is DE2380 per the MIG segment structure reference. Applied to DTM+203 (Ausführungsdatum) as the primary date field requiring this constraint in ORDERS. String comparison is valid for fixed-width CCYYMMDDHHMM format 303. (medium confidence)
fn evaluate_495(&self, ctx: &EvaluationContext) -> ConditionResult {
// The point in time must be <= DE2380 of DTM+137 (Nachrichtendatum).
// DTM element layout per MIG: elements[0][0]=qualifier, elements[0][1]=DE2380 value, elements[0][2]=format code.
// Applied to Ausführungsdatum (DTM+203) as the most relevant cross-date check in ORDERS.
let dtm137_segs = ctx.find_segments_with_qualifier("DTM", 0, "137");
let dtm203_segs = ctx.find_segments_with_qualifier("DTM", 0, "203");
let ref_val = dtm137_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1));
let cmp_val = dtm203_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1));
match (cmp_val, ref_val) {
(Some(cv), Some(rv)) => ConditionResult::from(cv.as_str() <= rv.as_str()),
_ => ConditionResult::Unknown,
}
}
/// [500] Hinweis: Zählpunkt der BAS
fn evaluate_500(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [501] Hinweis: Zählpunkt der DZR
fn evaluate_501(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [503] Hinweis: Angabe eines technischen Ansprechpartners für die Geräteübernahme
fn evaluate_503(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [506] Hinweis: Datum, bis zu dem der MSBA zur Fortführung verpflichtet wird
fn evaluate_506(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [507] Hinweis: Es müssen alle nach Durchführung der Messlokationsänderung eingesetzten/genutzten OBIS- Kennzahlen übermittelt werden (wird eine "Erweiterung" des Messumfangs beauftragt, sind auch die...
fn evaluate_507(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [514] Hinweis: Das Abonnement kann frühestens ab dem aktuellen Liefermonat beim Netzbetreiber gestartet werden.
fn evaluate_514(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [515] Hinweis: Das angegebene Betrachtungszeitintervall bestimmt beim Start Abo bzw. Ende Abo ab bzw. bis wann (einschließlich) das Abo laufen soll.
fn evaluate_515(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [517] Hinweis: Zählpunkt der LF-AASZR
fn evaluate_517(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [518] Hinweis: Das angegebene Ausführungsdatum bestimmt beim Start Abo bzw. Ende Abo ab bzw. bis wann (einschließlich) das Abo laufen soll.
fn evaluate_518(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [519] Hinweis: Bei Gas bezieht sich die Anforderung immer sowohl auf die vorläufigen Profilwerte als auch auf die endgültigen Profilwerte, falls diese bereits vorliegen.
fn evaluate_519(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::Unknown
}
/// [521] Hinweis: Verwendung der ID der Marktlokation
fn evaluate_521(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Marktlokation — informational note, always applies
ConditionResult::True
}
/// [522] Hinweis: Verwendung der ID der Messlokation
fn evaluate_522(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Messlokation — informational note, always applies
ConditionResult::True
}
/// [523] Hinweis: Verwendung der ID der Tranche
fn evaluate_523(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Tranche — informational note, always applies
ConditionResult::True
}
/// [525] Hinweis: Wert aus BGM DE1004 der MSCONS
fn evaluate_525(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM DE1004 der MSCONS — informational note, always applies
ConditionResult::True
}
/// [527] Hinweis: Zählpunkt der BG-SZR (Kategorie B)
fn evaluate_527(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Zählpunkt der BG-SZR (Kategorie B) — informational note, always applies
ConditionResult::True
}
/// [530] Hinweis: Wert aus BGM+310 DE1004 der QUOTES mit der das Angebot erfolgt ist.
fn evaluate_530(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+310 DE1004 der QUOTES mit der das Angebot erfolgt ist — informational note, always applies
ConditionResult::True
}
/// [531] Hinweis: Wert aus LIN DE1082 der QUOTES, mit der das Angebot erfolgt ist
fn evaluate_531(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus LIN DE1082 der QUOTES, mit der das Angebot erfolgt ist — informational note, always applies
ConditionResult::True
}
/// [532] Hinweis: Wert aus BGM+Z29 DE1004 der QUOTES, mit der das Angebot zur Abrechnung des Messstellenbetriebs erfolgt ist.
fn evaluate_532(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+Z29 DE1004 der QUOTES, mit der das Angebot zur Abrechnung des Messstellenbetriebs erfolgt ist — informational note, always applies
ConditionResult::True
}
/// [533] Hinweis: Gerichtsvollzieher hat Termin vorgegeben
fn evaluate_533(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Gerichtsvollzieher hat Termin vorgegeben — informational note, always applies
ConditionResult::True
}
/// [535] Hinweis: Verwendung der ID der Messlokation der Sparte Strom
fn evaluate_535(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Messlokation der Sparte Strom — informational note, always applies
ConditionResult::True
}
/// [536] Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z59
fn evaluate_536(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z59 — informational note, always applies
ConditionResult::True
}
/// [539] Hinweis: Es sind nur Codes von Zählzeiten aus Liste des NB anzugeben
fn evaluate_539(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es sind nur Codes von Zählzeiten aus Liste des NB anzugeben — informational note, always applies
ConditionResult::True
}
/// [540] Hinweis: Es sind nur Codes von Zählzeiten aus Liste des LF anzugeben
fn evaluate_540(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es sind nur Codes von Zählzeiten aus Liste des LF anzugeben — informational note, always applies
ConditionResult::True
}
/// [542] Hinweis: Wert aus BGM+Z57 DE1004 der QUOTES mit der das Angebot erfolgt ist.
fn evaluate_542(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+Z57 DE1004 der QUOTES mit der das Angebot erfolgt ist — informational note, always applies
ConditionResult::True
}
/// [543] Hinweis: Wert aus BGM+Z57 DE1004 der ORDERS mit der die Bestellung der Werte erfolgt ist.
fn evaluate_543(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+Z57 DE1004 der ORDERS mit der die Bestellung der Werte erfolgt ist — informational note, always applies
ConditionResult::True
}
/// [545] Hinweis: Es werden nur die Messprodukte der Messlokationen angegeben, die für die in der SG2 genannte Marktlokation bzw. deren Tranchen erforderlich sind. Messprodukte an der Messlokation für wei...
fn evaluate_545(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es werden nur die Messprodukte der Messlokationen angegeben... — informational note, always applies
ConditionResult::True
}
/// [547] Hinweis: Dokumentennummer aus BGM+Z60 DE1004 der UTILTS
fn evaluate_547(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Dokumentennummer aus BGM+Z60 DE1004 der UTILTS — informational note, always applies
ConditionResult::True
}
/// [548] Hinweis: Wenn die Änderung der Gerätekonfiguration mit einer Zählzeit übermittelt wird, ist hier die MP-ID des Eigentümers der Liste der Zählzeit einzutragen. Wenn anstatt der bisherigen Zäh...
fn evaluate_548(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: MP-ID des Eigentümers der Zählzeitliste — informational note, always applies
ConditionResult::True
}
/// [549] Hinweis: Findet bei der Reklamation von Zählerständen immer Anwendung. Einzige Ausnahme ist, wenn es sich um die Reklamation eines fehlenden Zählerstandes aufgrund einer Turnusablesung handelt, ...
fn evaluate_549(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Reklamation von Zählerständen — Zeitpunktangabe vs. Zeitintervall — informational note, always applies
ConditionResult::True
}
/// [550] Hinweis: Findet nur dann Anwendung, wenn es sich um die Reklamation eines fehlenden Zählerstandes aufgrund einer Turnusablesung handelt, bei welcher der MSB am Objekt der Marktlokation die Informa...
fn evaluate_550(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Reklamation fehlender Zählerstand bei Turnusablesung — informational note, always applies
ConditionResult::True
}
/// [551] Hinweis: Die SG29 ist so oft zu wiederholen, dass alle Messprodukte und Zählzeiten genannt werden, die ab dem in DTM+203 genannten Zeitpunkt auf der Messlokation durch den MSB konfiguriert werden ...
fn evaluate_551(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: SG29 Wiederholung für alle Messprodukte und Zählzeiten — informational note, always applies
ConditionResult::True
}
/// [552] Hinweis: Verwendung der ID der Netzlokation
fn evaluate_552(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Netzlokation — informational note, always applies
ConditionResult::True
}
/// [553] Hinweis: Verwendung der ID der Steuerbaren Ressource
fn evaluate_553(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Steuerbaren Ressource — informational note, always applies
ConditionResult::True
}
/// [554] Hinweis: Wert aus BGM+Z74 DE1004 der QUOTES mit der das Angebot erfolgt ist.
fn evaluate_554(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+Z74 DE1004 der QUOTES — informational note about value origin, always applies
ConditionResult::True
}
/// [555] Hinweis: Vorgangsnummer aus SG4 IDE+24 DE7402 der UTILMD mit BGM+E01 mit der die Anmeldung des MSB-Wechsels erfolgt ist.
fn evaluate_555(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Vorgangsnummer aus SG4 IDE+24 DE7402 der UTILMD — informational note about value origin, always applies
ConditionResult::True
}
/// [557] Hinweis: Es werden nur die Messprodukte der Messlokationen angegeben, die für die in der SG2 genannte Netzlokation erforderlich sind. Messprodukte an der Messlokation für weitere Netzlokationen o...
fn evaluate_557(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Only Messprodukte for Messlokationen required for the named Netzlokation are specified — informational note, always applies
ConditionResult::True
}
/// [558] Hinweis: Dokumentennummer aus BGM+Z78 DE1004 der UTILTS
fn evaluate_558(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Dokumentennummer aus BGM+Z78 DE1004 der UTILTS — informational note, always applies
ConditionResult::True
}
/// [559] Hinweis: Dokumentennummer aus BGM+Z79 DE1004 der UTILTS
fn evaluate_559(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Dokumentennummer aus BGM+Z79 DE1004 der UTILTS — informational note, always applies
ConditionResult::True
}
/// [560] Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z80
fn evaluate_560(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z80 — informational note, always applies
ConditionResult::True
}
/// [561] Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z81
fn evaluate_561(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Vorgangsnummer aus IDE DE7402 der UTILTS mit BGM+Z81 — informational note, always applies
ConditionResult::True
}
/// [562] Hinweis: Wert aus BGM+Z73 DE1004 der IFTSTA mit der die Antwort auf die Bestellung der Konfiguration übermittelt wurde
fn evaluate_562(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wert aus BGM+Z73 DE1004 der IFTSTA — informational note, always applies
ConditionResult::True
}
/// [563] Hinweis: Vorgangsnummer aus CNI DE1490 der IFTSTA mit BGM+Z73 mit der die Antwort auf die Bestellung der Konfiguration übermittelt wurde
fn evaluate_563(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Vorgangsnummer aus CNI DE1490 der IFTSTA mit BGM+Z73 mit der die Antwort auf die Bestellung der Konfiguration übermittelt wurde — informational note, always applies
ConditionResult::True
}
/// [564] Hinweis: Für den Empfang der Werte nach Typ 2 aus dem SMGW.
fn evaluate_564(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Für den Empfang der Werte nach Typ 2 aus dem SMGW — informational note, always applies
ConditionResult::True
}
/// [566] Hinweis: Verwendung der ID der Technischen Ressource
fn evaluate_566(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Verwendung der ID der Technischen Ressource — informational note, always applies
ConditionResult::True
}
/// [567] Hinweis: Es darf nur eine Information im DE3148 übermittelt werden
fn evaluate_567(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es darf nur eine Information im DE3148 übermittelt werden — informational note, always applies
ConditionResult::True
}
/// [568] Hinweis: Wenn die Einrichtung der Konfiguration mit einer Zählzeit übermittelt wird, ist hier die MP-ID des NB als Eigentümer der Liste der Zählzeit einzutragen.
fn evaluate_568(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wenn die Einrichtung der Konfiguration mit einer Zählzeit übermittelt wird, ist hier die MP-ID des NB als Eigentümer der Liste der Zählzeit einzutragen — informational note, always applies
ConditionResult::True
}
/// [569] Hinweis: MaBiS-Zählpunkt der LF-SZR
fn evaluate_569(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: MaBiS-Zählpunkt der LF-SZR — informational note, always applies
ConditionResult::True
}
/// [570] Hinweis: zur Angabe von Kontaktdaten des Kunden des Lieferanten um die Änderung an der Technik zu vereinfachen.
fn evaluate_570(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: zur Angabe von Kontaktdaten des Kunden des Lieferanten um die Änderung an der Technik zu vereinfachen — informational note, always applies
ConditionResult::True
}
/// [571] Hinweis: MSB der Marktlokation, an den die Werte der weiteren Energieflussrichtung der Messlokation zu übermitteln sind.
fn evaluate_571(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: MSB der Marktlokation, an den die Werte der weiteren Energieflussrichtung der Messlokation zu übermitteln sind — informational note, always applies
ConditionResult::True
}
/// [572] Hinweis: MSB der Marktlokation der Kundenanlage, in der die betroffene Lokation integriert wird.
fn evaluate_572(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: MSB der Marktlokation der Kundenanlage, in der die betroffene Lokation integriert wird — informational note, always applies
ConditionResult::True
}
/// [573] Hinweis: Es ist eine URI IPv4 für die Bereitstellung der Werte anzugeben.
fn evaluate_573(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es ist eine URI IPv4 für die Bereitstellung der Werte anzugeben — informational note, always applies
ConditionResult::True
}
/// [574] Hinweis: Es ist eine URI IPv6 für die Bereitstellung der Werte anzugeben.
fn evaluate_574(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es ist eine URI IPv6 für die Bereitstellung der Werte anzugeben.
ConditionResult::True
}
/// [575] Hinweis: Wenn der gewünschte Änderungszeitpunkt ein fixer Zeitpunkt ist.
fn evaluate_575(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wenn der gewünschte Änderungszeitpunkt ein fixer Zeitpunkt ist.
ConditionResult::True
}
/// [576] Hinweis: Wenn der gewünschte Änderungszeitpunkt ein nächst möglicher Termin zum oder nach dem angegebenen Zeitpunkt ist.
fn evaluate_576(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Wenn der gewünschte Änderungszeitpunkt ein nächst möglicher Termin zum oder nach dem angegebenen Zeitpunkt ist.
ConditionResult::True
}
/// [903] Format: Möglicher Wert: 1
fn evaluate_903(&self, _ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::True
}
/// [906] Format: max. 3 Nachkommastellen
fn evaluate_906(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("QTY", 0, 1, |val| validate_max_decimal_places(val, 3))
}
/// [911] Format: Mögliche Werte: 1 bis n, je Nachricht oder Segmentgruppe bei 1 beginnend und fortlaufend aufsteigend
fn evaluate_911(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Mögliche Werte: 1 bis n, je Nachricht oder Segmentgruppe bei 1 beginnend und fortlaufend aufsteigend
// This is a cardinality/sequencing annotation — informational, always applies
ConditionResult::True
}
/// [914] Format: Möglicher Wert: >0
fn evaluate_914(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("QTY", 0, 1, |val| validate_numeric(val, ">", 0.0))
}
/// [922] Format: TR-ID
// REVIEW: TR-ID (Transaktionsreferenz-ID) format. In ORDERS the transaction reference ID appears in BGM C106. The exact segment context depends on the AHB field definition — implemented as max-length-35 check on BGM, consistent with EDIFACT AN..35 data element constraints. Medium confidence because the target segment may differ by AHB row. (medium confidence)
fn evaluate_922(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: TR-ID — Transaktionsreferenz-ID, max 35 alphanumeric characters
// In ORDERS, TR-ID typically appears in BGM element 1 (C106 document identifier)
let segs = ctx.find_segments("BGM");
match segs
.first()
.and_then(|s| s.elements.get(1))
.and_then(|e| e.first())
{
Some(val) if !val.is_empty() => validate_max_length(val, 35),
Some(_) => ConditionResult::False,
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [930] Format: max. 2 Nachkommastellen
fn evaluate_930(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("QTY", 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)
}
/// [932] Format: HHMM = 2200
// REVIEW: HHMM = 2200 time constraint on DTM. In ORDERS FV2504, delivery period end (qualifier 163) must terminate at 22:00 UTC, matching the standard German grid day-end convention. Medium confidence because the target DTM qualifier may differ for the specific AHB row — 163 is the most likely candidate for an end-of-period constraint. (medium confidence)
fn evaluate_932(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check_qualified("DTM", 0, "163", 0, 1, |val| {
validate_hhmm_equals(val, "2200")
})
}
/// [933] Format: HHMM = 2300
fn evaluate_933(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("DTM", 0, 1, |val| validate_hhmm_equals(val, "2300"))
}
/// [934] Format: HHMM = 0400
fn evaluate_934(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("DTM", 0, 1, |val| validate_hhmm_equals(val, "0400"))
}
/// [935] Format: HHMM = 0500
fn evaluate_935(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("DTM", 0, 1, |val| validate_hhmm_equals(val, "0500"))
}
/// [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)
}
/// [950] Format: Marktlokations-ID
fn evaluate_950(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check_qualified("LOC", 0, "Z16", 1, 0, validate_malo_id)
}
/// [951] Format: Zählpunktbezeichnung
fn evaluate_951(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check_qualified("LOC", 0, "Z17", 1, 0, validate_zahlpunkt)
}
/// [955] Format: Möglicher Wert: <100
// REVIEW: Format: Möglicher Wert: <100 — numeric value must be less than 100. Most likely applies to a QTY quantity value (C186.D6060, elements[0][1]). validate_numeric with "<" and threshold 100.0 covers this. Medium confidence because the exact segment context (QTY vs PRI vs PCT) is not specified — QTY is the most common numeric value carrier in ORDERS. (medium confidence)
fn evaluate_955(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("QTY", 0, 1, |val| validate_numeric(val, "<", 100.0))
}
/// [960] Format: Netzlokations-ID
fn evaluate_960(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check_qualified("LOC", 0, "Z18", 1, 0, validate_malo_id)
}
/// [961] Format: SR-ID
fn evaluate_961(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check_qualified("LOC", 0, "Z19", 1, 0, validate_malo_id)
}
/// [962] Format: max. 6 Vorkommastellen
// REVIEW: Format: max 6 integer digits (Vorkommastellen). Applied to QTY element[0][1] as the most common numeric data field in ORDERS requiring integer-part validation. Uses validate_max_integer_digits helper. Confidence medium because the target segment is inferred from context rather than explicitly stated. (medium confidence)
fn evaluate_962(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.format_check("QTY", 0, 1, |val| validate_max_integer_digits(val, 6))
}
/// [2002] Ist mindestens zwei Mal anzugeben
// REVIEW: Must be specified at least twice. Counts DTM+203 (Ausführungsdatum, qualifier at elements[0][0]) occurrences as a proxy for SG29 group instance count since each SG29 contains exactly one DTM+203. Condition is True when count >= 2. (medium confidence)
fn evaluate_2002(&self, ctx: &EvaluationContext) -> ConditionResult {
// "Ist mindestens zwei Mal anzugeben" — SG29 must appear at least twice.
// DTM+203 (Ausführungsdatum) occurs exactly once per SG29 instance,
// so counting DTM+203 segments gives the SG29 repetition count.
let count = ctx.find_segments_with_qualifier("DTM", 0, "203").len();
ConditionResult::from(count >= 2)
}
/// [2004] Die SG29 ist so oft zu wiederholen, dass alle Geräte der betroffenen Geräteart die im Rahmen des Gerätewechsels aufgrund MSB-Wechsel getauscht werden sollen genannt sind.
fn evaluate_2004(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG29 ist so oft zu wiederholen, dass alle Geräte der betroffenen Geräteart
// die im Rahmen des Gerätewechsels aufgrund MSB-Wechsel getauscht werden sollen, genannt sind.
// Informational cardinality note — always applies.
ConditionResult::True
}
/// [2005] Pro SG29 LIN ist die SG34 RFF+Z09 (Gerätenummer) genau einmal anzugeben
// REVIEW: Per SG29 LIN, RFF+Z09 (Gerätenummer) must appear exactly once. We check that there is exactly one RFF segment with qualifier Z09 in the message context. This is a cardinality constraint evaluated at message level via segment counting. (medium confidence)
fn evaluate_2005(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let rffs = ctx.find_segments_with_qualifier("RFF", 0, "Z09");
ConditionResult::from(rffs.len() == 1)
}
}
/// [2006] Pro SG29 LIN ist die SG34 RFF+Z09 (Gerätenummer) bis zu dreimal anzugeben
// REVIEW: Per SG29 LIN, RFF+Z09 (Gerätenummer) may appear up to three times. We verify that at most 3 RFF segments with qualifier Z09 exist in the message context. (medium confidence)
fn evaluate_2006(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let rffs = ctx.find_segments_with_qualifier("RFF", 0, "Z09");
ConditionResult::from(rffs.len() <= 3)
}
}
/// [2007] Die SG29 ist so oft zu wiederholen, wie ab dem DTM+203 (Ausführungsdatum) Messlokationen zu der in der SG2 genannten Netzlokation vorhanden sind und für jede dieser Messlokationen müssen alle Me...
fn evaluate_2007(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG29 ist so oft zu wiederholen, wie ab dem DTM+203 (Ausführungsdatum)
// Messlokationen zu der in der SG2 genannten Netzlokation vorhanden sind und für jede
// dieser Messlokationen müssen alle Messprodukte genannt sein, die ab dem DTM+203
// (Ausführungsdatum) in der SG2 genannten Netzlokation vorhanden sind.
// Informational cardinality note — always applies.
ConditionResult::True
}
/// [2044] Pro SG29 LIN ist die SG29 PIA genau einmal anzugeben
// REVIEW: Per SG29 LIN, the SG29 PIA segment must appear exactly once. We count PIA segments in the message and check for exactly one occurrence. This is a structural cardinality check on the PIA segment. (medium confidence)
fn evaluate_2044(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let pias = ctx.find_segments("PIA");
ConditionResult::from(pias.len() == 1)
}
}
/// [2050] Pro Nachricht ist die SG29 genau einmal anzugeben
// REVIEW: Per message, SG29 (identified by its entry segment LIN) must appear exactly once. We count all LIN segments in the message and check for exactly one occurrence. (medium confidence)
fn evaluate_2050(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let lins = ctx.find_segments("LIN");
ConditionResult::from(lins.len() == 1)
}
}
/// [2060] Pro Nachricht ist die SG29 LIN+Z64 (Erforderliches Produkt Schaltzeitdefinitionen) maximal einmal anzugeben
fn evaluate_2060(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let lins = ctx.find_segments("LIN");
let count = lins
.iter()
.filter(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z64")
})
.count();
ConditionResult::from(count <= 1)
}
}
/// [2061] Pro Nachricht ist die SG29 LIN++Z65 (Erforderliches Produkt Leistungskurvendefinitionen) maximal einmal anzugeben
fn evaluate_2061(&self, ctx: &EvaluationContext) -> ConditionResult {
{
let lins = ctx.find_segments("LIN");
let count = lins
.iter()
.filter(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z65")
})
.count();
ConditionResult::from(count <= 1)
}
}
/// [2062] Pro Nachricht ist die SG29 LIN++Z66 (Erforderliches Produkt Ad-hoc-Steuerkanal) maximal einmal anzugeben
// REVIEW: Count LIN segments where elements[1][0]=="Z66" (LIN++Z66, ad-hoc Steuerkanal). Condition is True when at most one such SG29 line item is present per message. (medium confidence)
fn evaluate_2062(&self, ctx: &EvaluationContext) -> ConditionResult {
let count = ctx
.find_segments("LIN")
.iter()
.filter(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z66")
})
.count();
ConditionResult::from(count <= 1)
}
/// [2063] Pro Nachricht ist die SG29 LIN++Z67 (Erforderliches Messprodukt für Werte nach Typ 2 aus Backend) maximal einmal anzugeben
// REVIEW: Count LIN segments where elements[1][0]=="Z67" (LIN++Z67, Messprodukt Typ 2 Backend). Condition is True when at most one such SG29 line item is present per message. (medium confidence)
fn evaluate_2063(&self, ctx: &EvaluationContext) -> ConditionResult {
let count = ctx
.find_segments("LIN")
.iter()
.filter(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z67")
})
.count();
ConditionResult::from(count <= 1)
}
/// [2064] Pro Nachricht ist die SG29 LIN++Z68 (Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) maximal einmal anzugeben
// REVIEW: Count LIN segments where elements[1][0]=="Z68" (LIN++Z68, Konfigurationserlaubnis Typ 2 SMGW). Condition is True when at most one such SG29 line item is present per message. (medium confidence)
fn evaluate_2064(&self, ctx: &EvaluationContext) -> ConditionResult {
let count = ctx
.find_segments("LIN")
.iter()
.filter(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v == "Z68")
})
.count();
ConditionResult::from(count <= 1)
}
/// [2066] Die SG3 RFF+Z37 Referenz auf ID der Technischen Ressource ist so oft zu wiederholen, bis alle IDs der Technischen Ressourcen angegeben sind, die der Steuerbaren Ressource in LOC+172 DE3225 (Meldepu...
fn evaluate_2066(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG3 RFF+Z37 ist so oft zu wiederholen, bis alle IDs der Technischen
// Ressourcen angegeben sind, die der Steuerbaren Ressource in LOC+172 DE3225 (Meldepunkt)
// mit diesem Vorgang zugeordnet werden sollen.
// Informational cardinality note — always applies.
ConditionResult::True
}
/// [2088] Die SG29 ist so oft zu wiederholen, dass alle Messprodukte ab dem DTM+203 (Ausführungsdatum) zu der in der SG2 genannten Netzlokation genannt sind.
fn evaluate_2088(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG29 ist so oft zu wiederholen, dass alle Messprodukte ab dem DTM+203
// (Ausführungsdatum) zu der in der SG2 genannten Netzlokation genannt sind.
// Informational cardinality note — always applies.
ConditionResult::True
}
/// [2089] Die SG29 ist so oft zu wiederholen, dass alle Messprodukte ab dem DTM+203 (Ausführungsdatum) zu der in der SG2 genannten Marktlokation genannt sind.
fn evaluate_2089(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG29 ist so oft zu wiederholen, dass alle Messprodukte ab dem DTM+203
// (Ausführungsdatum) zu der in der SG2 genannten Marktlokation genannt sind.
// Informational cardinality note about SG29 repetition count — always applies.
ConditionResult::True
}
/// [2090] Für 33-stellige ID im SG2 LOC+172 (Meldepunkt) DE3225 mindestens einmal anzugeben
fn evaluate_2090(&self, ctx: &EvaluationContext) -> ConditionResult {
let locs = ctx.find_segments_with_qualifier("LOC", 0, "172");
ConditionResult::from(locs.iter().any(|s| {
s.elements
.get(1)
.and_then(|e| e.first())
.is_some_and(|v| v.len() == 33)
}))
}
/// [2092] Pro Nachricht ist die SG29 maximal einmal anzugeben
// REVIEW: SG29 is initiated by the LIN segment. Count all LIN segments in the message and verify there is at most one, making the condition True when the cardinality constraint is satisfied. (medium confidence)
fn evaluate_2092(&self, ctx: &EvaluationContext) -> ConditionResult {
ConditionResult::from(ctx.find_segments("LIN").len() <= 1)
}
/// [2094] Pro Nachricht ist die SG29 LIN (Positionsdaten) so oft anzugeben, wie Positionen aus dem Angebot, welches in SG1 RFF+AAG (Referenz Nachrichtennummer), DE1154 angegeben ist, bestellt werden sollen.
fn evaluate_2094(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Pro Nachricht ist die SG29 LIN (Positionsdaten) so oft anzugeben, wie
// Positionen aus dem Angebot (referenziert in SG1 RFF+AAG DE1154) bestellt werden sollen.
// Informational cardinality note — the required repetition count depends on an external
// offer document that cannot be inspected from within this EDIFACT message.
ConditionResult::True
}
/// [2095] Diese SG29 ist so oft zu wiederholen, dass alle Produkte zur Lokation die ab dem DTM+203 (Ausführungsdatum) gewünscht sind und deren Kombination gemäß Codeliste der Konfigurationen Kapitel 7 "P...
fn evaluate_2095(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Diese SG29 ist so oft zu wiederholen, dass alle Produkte zur Lokation
// ab dem DTM+203 (Ausführungsdatum) genannt sind, deren Kombination gemäß
// Codeliste der Konfigurationen Kapitel 7 möglich sind.
// Informational cardinality note — valid combinations are defined by an external
// code list (Kapitel 7) and cannot be validated from EDIFACT content alone.
ConditionResult::True
}
/// [2096] Die SG3 Referenz auf die ID der Tranche ist so oft zu wiederholen, wie ab dem DTM+203 (Ausführungsdatum) Tranchen zu der in der SG2 genannten Marktlokation vorhanden sind.
fn evaluate_2096(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG3 Referenz auf die ID der Tranche ist so oft zu wiederholen, wie
// ab dem DTM+203 (Ausführungsdatum) Tranchen zu der in der SG2 genannten
// Marktlokation vorhanden sind.
// Informational cardinality note — the number of Tranchen for a Marktlokation is
// business context that cannot be determined from the EDIFACT message alone.
ConditionResult::True
}
/// [2097] Die SG29 ist so oft zu wiederholen, dass für alle in SG3 Referenz auf ID der Tranche genannten Tranchen mindestens eine SG29 vorhanden ist.
fn evaluate_2097(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Die SG29 ist so oft zu wiederholen, dass für alle in SG3 RFF+Z20
// (Referenz auf ID der Tranche) genannten Tranchen mindestens eine SG29 vorhanden ist.
// Informational completeness note — each Tranche referenced in SG3 must have
// at least one corresponding SG29. Documents structural pairing requirements.
ConditionResult::True
}
/// [2098] Die SG2 Lieferant an der Lokation ist so oft zu wiederholen, dass für alle in SG3 Referenz auf ID der Tranche genannten Tranchen genau eine SG2 Lieferant der Lokation vorhanden ist.
// REVIEW: Cardinality rule: SG2 repetition count must equal the number of SG3 tranche references. Implemented by comparing count_in_group for both groups within SG29. Medium confidence because exact group paths and SG3 RFF qualifier for 'Tranche ID' are not confirmed without the full MIG segment structure reference — the paths &["SG29", "SG2"] and &["SG29", "SG3"] are based on standard ORDERS tx_group conventions from project memory. (medium confidence)
fn evaluate_2098(&self, ctx: &EvaluationContext) -> ConditionResult {
// SG2 Lieferant an der Lokation must repeat once per SG3 tranche reference.
// Count SG2 group instances (NAD as entry segment) and SG3 RFF tranche references.
// Both counts must be equal and non-zero for the condition to be satisfied.
let sg2_count = ctx.count_in_group("NAD", &["SG29", "SG2"]);
let sg3_count = ctx.count_in_group("RFF", &["SG29", "SG3"]);
if sg2_count == 0 || sg3_count == 0 {
return ConditionResult::Unknown;
}
ConditionResult::from(sg2_count == sg3_count)
}
/// [2099] Die SG2 Lieferant an der Lokation ist genau einmal anzugeben.
// REVIEW: Simple cardinality check: SG2 must appear exactly once (genau einmal). Implemented using count_in_group on NAD (the entry segment of SG2) within SG29. Returns Unknown when no SG2 is found at all (not yet present), False when count > 1, True when exactly 1. Medium confidence due to unconfirmed group path without the full EDIFACT Segment Structure Reference for this PID. (medium confidence)
fn evaluate_2099(&self, ctx: &EvaluationContext) -> ConditionResult {
// SG2 Lieferant an der Lokation must appear exactly once.
// Count NAD segments (entry segment of SG2) within the SG29 SG2 group path.
let count = ctx.count_in_group("NAD", &["SG29", "SG2"]);
if count == 0 {
return ConditionResult::Unknown;
}
ConditionResult::from(count == 1)
}
}