Skip to main content

automapper_validation/generated/fv2610/
utilmd_strom_conditions_fv2610.rs

1// <auto-generated>
2// Generated by automapper-generator generate-conditions
3// AHB: xml-migs-and-ahbs/FV2610/UTILMD_AHB_Strom_2_2_Fehlerkorrektur_20260629_.xml
4// Generated: 2026-04-22T18:25:39Z
5// Delegates unchanged conditions to UtilmdStromConditionEvaluatorFV2604 (FV2604).
6// </auto-generated>
7
8#![allow(clippy::style, clippy::complexity)]
9
10#[allow(unused_imports)]
11use crate::eval::format_validators::*;
12use crate::eval::{ConditionEvaluator, ConditionResult, EvaluationContext};
13use crate::generated::fv2604::UtilmdStromConditionEvaluatorFV2604;
14
15/// Condition evaluator for UTILMD_Strom FV2610.
16///
17/// Delegates to [`UtilmdStromConditionEvaluatorFV2604`] for conditions whose AHB description is
18/// unchanged from that version. Local overrides: [23, 24, 41, 63, 67, 79, 80, 81, 82, 158, 159, 181, 185, 186, 187, 203, 263, 272, 274, 275, 276, 353, 354, 381, 382, 383, 422, 423, 424, 531, 555, 571, 701, 2002].
19pub struct UtilmdStromConditionEvaluatorFV2610 {
20    fallback: UtilmdStromConditionEvaluatorFV2604,
21}
22
23impl Default for UtilmdStromConditionEvaluatorFV2610 {
24    fn default() -> Self {
25        Self {
26            fallback: UtilmdStromConditionEvaluatorFV2604::default(),
27        }
28    }
29}
30
31/// Condition IDs whose implementation differs from the fallback.
32const FV2610_OVERRIDES: &[u32] = &[
33    23, 24, 41, 63, 67, 79, 80, 81, 82, 158, 159, 181, 185, 186, 187, 203, 263, 272, 274, 275, 276,
34    353, 354, 381, 382, 383, 422, 423, 424, 531, 555, 571, 701, 2002,
35];
36
37impl ConditionEvaluator for UtilmdStromConditionEvaluatorFV2610 {
38    fn message_type(&self) -> &str {
39        "UTILMD_Strom"
40    }
41
42    fn format_version(&self) -> &str {
43        "FV2610"
44    }
45
46    fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
47        match condition {
48            23 => self.evaluate_23(ctx),
49            24 => self.evaluate_24(ctx),
50            41 => self.evaluate_41(ctx),
51            63 => self.evaluate_63(ctx),
52            67 => self.evaluate_67(ctx),
53            79 => self.evaluate_79(ctx),
54            80 => self.evaluate_80(ctx),
55            81 => self.evaluate_81(ctx),
56            82 => self.evaluate_82(ctx),
57            158 => self.evaluate_158(ctx),
58            159 => self.evaluate_159(ctx),
59            181 => self.evaluate_181(ctx),
60            203 => self.evaluate_203(ctx),
61            263 => self.evaluate_263(ctx),
62            353 => self.evaluate_353(ctx),
63            354 => self.evaluate_354(ctx),
64            381 => self.evaluate_381(ctx),
65            382 => self.evaluate_382(ctx),
66            383 => self.evaluate_383(ctx),
67            422 => self.evaluate_422(ctx),
68            423 => self.evaluate_423(ctx),
69            424 => self.evaluate_424(ctx),
70            531 => self.evaluate_531(ctx),
71            555 => self.evaluate_555(ctx),
72            571 => self.evaluate_571(ctx),
73            701 => self.evaluate_701(ctx),
74            2002 => self.evaluate_2002(ctx),
75            185 => self.evaluate_185(ctx),
76            186 => self.evaluate_186(ctx),
77            187 => self.evaluate_187(ctx),
78            272 => self.evaluate_272(ctx),
79            274 => self.evaluate_274(ctx),
80            275 => self.evaluate_275(ctx),
81            276 => self.evaluate_276(ctx),
82            other => self.fallback.evaluate(other, ctx),
83        }
84    }
85
86    fn is_external(&self, condition: u32) -> bool {
87        matches!(
88            condition,
89            181 | 185 | 186 | 187 | 274 | 275 | 276 | 353 | 354 | 381 | 382 | 383 | 422 | 423 | 424
90        ) || (!FV2610_OVERRIDES.contains(&condition) && self.fallback.is_external(condition))
91    }
92
93    fn is_known(&self, condition: u32) -> bool {
94        FV2610_OVERRIDES.contains(&condition) || self.fallback.is_known(condition)
95    }
96}
97
98impl UtilmdStromConditionEvaluatorFV2610 {
99    /// [23] Wenn in dieser SG4 das STS+E01++A05 (Status der Antwort) vorhanden
100    fn evaluate_23(&self, ctx: &EvaluationContext) -> ConditionResult {
101        ctx.has_segment_matching_in_group("STS", &[(0, 0, "E01"), (2, 0, "A05")], &["SG4"])
102    }
103
104    /// [24] Wenn in dieser SG4 das STS+E01++A25 (Status der Antwort) vorhanden
105    fn evaluate_24(&self, ctx: &EvaluationContext) -> ConditionResult {
106        ctx.has_segment_matching_in_group("STS", &[(0, 0, "E01"), (2, 0, "A25")], &["SG4"])
107    }
108
109    /// [41] Es ist eine Produktpaket-ID aus dem DE1050 von einem SG8 SEQ+Z79 (Bestandteil eines Produktpakets) zu nennen
110    // REVIEW: Cross-reference validation: the current field must contain a Produktpaket-ID from DE1050 (elements[1][0]) of some SG8 SEQ+Z79. Collects all valid Produktpaket-IDs across SG8 instances and checks the resolved field value is among them. Medium confidence: 'zu nennen' interpreted as a cross-reference constraint; if it is purely informational the body should return True unconditionally. (medium confidence)
111    fn evaluate_41(&self, ctx: &EvaluationContext) -> ConditionResult {
112        let nav = match ctx.navigator() {
113            Some(n) => n,
114            None => return ConditionResult::Unknown,
115        };
116        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
117        let mut valid_ids: std::collections::HashSet<String> = std::collections::HashSet::new();
118        for i in 0..sg8_count {
119            let seq_segs = nav.find_segments_in_group("SEQ", &["SG4", "SG8"], i);
120            for seq in &seq_segs {
121                if seq
122                    .elements
123                    .first()
124                    .and_then(|e| e.first())
125                    .is_some_and(|v| v == "Z79")
126                {
127                    if let Some(val) = seq.elements.get(1).and_then(|e| e.first()) {
128                        if !val.is_empty() {
129                            valid_ids.insert(val.clone());
130                        }
131                    }
132                }
133            }
134        }
135        if valid_ids.is_empty() {
136            return ConditionResult::Unknown;
137        }
138        if let Some(current_val) = ctx.resolved_value {
139            return ConditionResult::from(valid_ids.contains(current_val));
140        }
141        ConditionResult::Unknown
142    }
143
144    /// [63] Wenn in dieser SG4 das STS+E01++A15 (Status der Antwort) vorhanden
145    fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
146        ctx.has_segment_matching_in_group("STS", &[(0, 0, "E01"), (2, 0, "A15")], &["SG4"])
147    }
148
149    /// [67] Wenn in keinem SG8 SEQ+Z79 (Bestandteil eine Produktpakets) CCI+Z66/CAV+ZH9 (Produkteigenschaft/ Code der Produkteigenschaft) der Code 9991000002933 (Ruhende Marktlokation ausprägen) vorhanden ist.
150    // REVIEW: Absence check: returns True when NO SG8 with SEQ+Z79 has an SG10 child containing CCI+Z66 (Produkteigenschaft) co-occurring with CAV bearing value 9991000002933 (Ruhende Marktlokation ausprägen). Returns False as soon as the disqualifying combination is found. Medium confidence: CAV element layout for ZH9/9991000002933 is ambiguous without the MIG XML — implementation checks both ZH9+9991000002933 as a composite and 9991000002933 as a bare first component. (medium confidence)
151    fn evaluate_67(&self, ctx: &EvaluationContext) -> ConditionResult {
152        let nav = match ctx.navigator() {
153            Some(n) => n,
154            None => return ConditionResult::Unknown,
155        };
156        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
157        for i in 0..sg8_count {
158            let seq_segs = nav.find_segments_in_group("SEQ", &["SG4", "SG8"], i);
159            let has_z79 = seq_segs.iter().any(|s| {
160                s.elements
161                    .first()
162                    .and_then(|e| e.first())
163                    .is_some_and(|v| v == "Z79")
164            });
165            if !has_z79 {
166                continue;
167            }
168            let sg10_count = nav.child_group_instance_count(&["SG4", "SG8"], i, "SG10");
169            for j in 0..sg10_count {
170                let ccis = nav.find_segments_in_child_group("CCI", &["SG4", "SG8"], i, "SG10", j);
171                let has_cci_z66 = ccis.iter().any(|s| {
172                    s.elements
173                        .first()
174                        .and_then(|e| e.first())
175                        .is_some_and(|v| v == "Z66")
176                });
177                if has_cci_z66 {
178                    let cavs =
179                        nav.find_segments_in_child_group("CAV", &["SG4", "SG8"], i, "SG10", j);
180                    let has_target = cavs.iter().any(|s| {
181                        let first_elem = s.elements.first();
182                        let qualifier = first_elem.and_then(|e| e.first()).map(|v| v.as_str());
183                        let value = first_elem.and_then(|e| e.get(1)).map(|v| v.as_str());
184                        (qualifier == Some("ZH9") && value == Some("9991000002933"))
185                            || qualifier == Some("9991000002933")
186                    });
187                    if has_target {
188                        return ConditionResult::False;
189                    }
190                }
191            }
192        }
193        ConditionResult::True
194    }
195
196    /// [79] Wenn SG4 STS+7++Z33 (Auszug wegen Stilllegung) vorhanden
197    fn evaluate_79(&self, ctx: &EvaluationContext) -> ConditionResult {
198        ctx.has_segment_matching_in_group("STS", &[(0, 0, "7"), (2, 0, "Z33")], &["SG4"])
199    }
200
201    /// [80] Wenn in derselben SG8 SEQ+Z61 (Produkt-Daten der Steuerbaren Ressource) das PIA+5 (Produkt-Daten der Steuerbaren Ressource) nicht vorhanden
202    fn evaluate_80(&self, ctx: &EvaluationContext) -> ConditionResult {
203        ctx.any_group_has_qualifier_without("SEQ", 0, "Z61", "PIA", 0, "5", &["SG4", "SG8"])
204    }
205
206    /// [81] Wenn in derselben SG8 SEQ+Z61/ ZB3/ ZB4 (Produkt-Daten der Steuerbaren Ressource) das SG10 CCI+11 (Details zum Produkt der Steuerbaren Ressource) nicht vorhanden
207    // REVIEW: Multi-qualifier SEQ check (Z61/ZB3/ZB4) combined with SG10 child absence requires the navigator. Returns True when any SG8 with a qualifying SEQ has no SG10 child with CCI+11. Medium confidence: three-way qualifier match and SG10 absence via child group iteration. (medium confidence)
208    fn evaluate_81(&self, ctx: &EvaluationContext) -> ConditionResult {
209        let nav = match ctx.navigator() {
210            Some(n) => n,
211            None => return ConditionResult::Unknown,
212        };
213        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
214        for i in 0..sg8_count {
215            let seq_segs = nav.find_segments_in_group("SEQ", &["SG4", "SG8"], i);
216            let has_qualifying_seq = seq_segs.iter().any(|s| {
217                s.elements
218                    .first()
219                    .and_then(|e| e.first())
220                    .is_some_and(|v| matches!(v.as_str(), "Z61" | "ZB3" | "ZB4"))
221            });
222            if !has_qualifying_seq {
223                continue;
224            }
225            let sg10_count = nav.child_group_instance_count(&["SG4", "SG8"], i, "SG10");
226            let has_cci_11 = (0..sg10_count).any(|j| {
227                let ccis = nav.find_segments_in_child_group("CCI", &["SG4", "SG8"], i, "SG10", j);
228                ccis.iter().any(|s| {
229                    s.elements
230                        .first()
231                        .and_then(|e| e.first())
232                        .is_some_and(|v| v == "11")
233                })
234            });
235            if !has_cci_11 {
236                return ConditionResult::True;
237            }
238        }
239        ConditionResult::False
240    }
241
242    /// [82] Wenn in der selben SG8 (Daten der technischen Einrichtungen) das SG10 CCI+Z63 (Information zu technischen Einrichtungen) CAV+ZH7 (Technische Einrichtungen vorhanden) vorhanden
243    // REVIEW: Checks if any SG10 child of any SG8 contains both CCI+Z63 (Information zu technischen Einrichtungen) and CAV+ZH7 (Technische Einrichtungen vorhanden) in the same SG10 instance. Both qualifiers checked at elements[0][0] following the CAV+qualifier pattern from Example 10. Medium confidence: no parent SG8 qualifier filter specified; CCI element position assumed from established pattern. (medium confidence)
244    fn evaluate_82(&self, ctx: &EvaluationContext) -> ConditionResult {
245        let nav = match ctx.navigator() {
246            Some(n) => n,
247            None => return ctx.has_qualifier("CAV", 0, "ZH7"),
248        };
249        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
250        for i in 0..sg8_count {
251            let sg10_count = nav.child_group_instance_count(&["SG4", "SG8"], i, "SG10");
252            for j in 0..sg10_count {
253                let ccis = nav.find_segments_in_child_group("CCI", &["SG4", "SG8"], i, "SG10", j);
254                let has_cci_z63 = ccis.iter().any(|s| {
255                    s.elements
256                        .first()
257                        .and_then(|e| e.first())
258                        .is_some_and(|v| v == "Z63")
259                });
260                if has_cci_z63 {
261                    let cavs =
262                        nav.find_segments_in_child_group("CAV", &["SG4", "SG8"], i, "SG10", j);
263                    if cavs.iter().any(|s| {
264                        s.elements
265                            .first()
266                            .and_then(|e| e.first())
267                            .is_some_and(|v| v == "ZH7")
268                    }) {
269                        return ConditionResult::True;
270                    }
271                }
272            }
273        }
274        ConditionResult::False
275    }
276
277    /// [158] Wenn in derselben SG8 SEQ+Z57/ ZD9 (OBIS-Daten der Netzlokation) das PIA+5 (OBIS-Daten der Netzlokation) nicht vorhanden
278    fn evaluate_158(&self, ctx: &EvaluationContext) -> ConditionResult {
279        ctx.any_group_has_qualifier_without("SEQ", 0, "Z57", "PIA", 0, "5", &["SG4", "SG8"])
280            .or(ctx.any_group_has_qualifier_without(
281                "SEQ",
282                0,
283                "ZD9",
284                "PIA",
285                0,
286                "5",
287                &["SG4", "SG8"],
288            ))
289    }
290
291    /// [159] Wenn in derselben SG8 SEQ+Z57/ ZD9 (OBIS-Daten der Netzlokation) das SG10 CCI+11 (OBIS-Daten der Netzlokation) nicht vor...
292    fn evaluate_159(&self, ctx: &EvaluationContext) -> ConditionResult {
293        let with_cci = |seq: &str| {
294            ctx.filtered_parent_child_has_qualifier(
295                &["SG4", "SG8"],
296                "SEQ",
297                0,
298                seq,
299                "SG10",
300                "CCI",
301                0,
302                "11",
303            )
304        };
305        with_cci("Z57").or(with_cci("ZD9")).negate()
306    }
307
308    /// [181] Wenn der Versender datenschutzrechtliche Voraussetzungen geschaffen hat, um die Daten bereitstellen zu dürfen
309    /// EXTERNAL: Requires context from outside the message.
310    fn evaluate_181(&self, ctx: &EvaluationContext) -> ConditionResult {
311        ctx.external
312            .evaluate("sender_has_data_protection_prerequisites")
313    }
314
315    /// [203] Wenn STS+7++E06 / Z39 / ZC6 / ZC7/ ZT6/ ZT7 / Z02 / ZZD vorhanden
316    fn evaluate_203(&self, ctx: &EvaluationContext) -> ConditionResult {
317        ctx.has_qualified_value(
318            "STS",
319            0,
320            "7",
321            2,
322            0,
323            &["E06", "Z39", "ZC6", "ZC7", "ZT6", "ZT7", "Z02", "ZZD"],
324        )
325    }
326
327    /// [263] Wenn SG8 SEQ+Z01 (Daten der Marktlokation) SG10 CCI+Z30++Z07 (Verbrauch) vorhanden
328    fn evaluate_263(&self, ctx: &EvaluationContext) -> ConditionResult {
329        let nav = match ctx.navigator() {
330            Some(n) => n,
331            None => return ctx.has_qualified_value("CCI", 0, "Z30", 2, 0, &["Z07"]),
332        };
333        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
334        for i in 0..sg8_count {
335            let seq_segs = nav.find_segments_in_group("SEQ", &["SG4", "SG8"], i);
336            let has_z01 = seq_segs.iter().any(|s| {
337                s.elements
338                    .first()
339                    .and_then(|e| e.first())
340                    .is_some_and(|v| v == "Z01")
341            });
342            if !has_z01 {
343                continue;
344            }
345            let sg10_count = nav.child_group_instance_count(&["SG4", "SG8"], i, "SG10");
346            for j in 0..sg10_count {
347                let ccis = nav.find_segments_in_child_group("CCI", &["SG4", "SG8"], i, "SG10", j);
348                for cci in &ccis {
349                    let elem0 = cci
350                        .elements
351                        .first()
352                        .and_then(|e| e.first())
353                        .map(|s| s.as_str());
354                    let elem2 = cci
355                        .elements
356                        .get(2)
357                        .and_then(|e| e.first())
358                        .map(|s| s.as_str());
359                    if elem0 == Some("Z30") && elem2 == Some("Z07") {
360                        return ConditionResult::True;
361                    }
362                }
363            }
364        }
365        ConditionResult::False
366    }
367
368    /// [353] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/NeLo“ als auch in der ...
369    /// EXTERNAL: Requires context from outside the message.
370    fn evaluate_353(&self, ctx: &EvaluationContext) -> ConditionResult {
371        ctx.external
372            .evaluate("verwendungszweck_code_valid_nelocation_nb")
373    }
374
375    /// [354] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/NeLo“ als auch in der ...
376    /// EXTERNAL: Requires context from outside the message.
377    fn evaluate_354(&self, ctx: &EvaluationContext) -> ConditionResult {
378        ctx.external
379            .evaluate("verwendungszweck_code_valid_nelocation_lf")
380    }
381
382    /// [381] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
383    /// EXTERNAL: Requires context from outside the message.
384    fn evaluate_381(&self, ctx: &EvaluationContext) -> ConditionResult {
385        ctx.external
386            .evaluate("verwendungszweck_code_valid_malocation_nb")
387    }
388
389    /// [382] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
390    /// EXTERNAL: Requires context from outside the message.
391    fn evaluate_382(&self, ctx: &EvaluationContext) -> ConditionResult {
392        ctx.external
393            .evaluate("verwendungszweck_code_valid_malocation_lf")
394    }
395
396    /// [383] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
397    /// EXTERNAL: Requires context from outside the message.
398    fn evaluate_383(&self, ctx: &EvaluationContext) -> ConditionResult {
399        ctx.external
400            .evaluate("verwendungszweck_code_valid_malocation_uenb")
401    }
402
403    /// [422] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
404    /// EXTERNAL: Requires context from outside the message.
405    fn evaluate_422(&self, ctx: &EvaluationContext) -> ConditionResult {
406        ctx.external
407            .evaluate("verwendungszweck_code_valid_tranche_nb")
408    }
409
410    /// [423] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
411    /// EXTERNAL: Requires context from outside the message.
412    // REVIEW: References external code list from Kapitel 2 (Codeliste der Verwendungszwecke) filtered by 'Lokation/Tranche' and 'Verwendbar für Marktrolle/LF' columns, plus OBIS-Kennzahl matching — all three criteria require external business context unavailable in the EDIFACT message alone (medium confidence)
413    fn evaluate_423(&self, ctx: &EvaluationContext) -> ConditionResult {
414        ctx.external.evaluate("verwendungszweck_valid_for_lf")
415    }
416
417    /// [424] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
418    /// EXTERNAL: Requires context from outside the message.
419    // REVIEW: References external code list from Kapitel 2 (Codeliste der Verwendungszwecke) filtered by 'Lokation/Tranche' and 'Verwendbar für Marktrolle/ÜNB' columns, plus OBIS-Kennzahl matching — all three criteria require external business context unavailable in the EDIFACT message alone (medium confidence)
420    fn evaluate_424(&self, ctx: &EvaluationContext) -> ConditionResult {
421        ctx.external.evaluate("verwendungszweck_valid_for_uenb")
422    }
423
424    /// [531] Hinweis: Es ist das Jahr anzugeben in dem die nächste Netznutzungsabrechnung erfolgt. Diese Information ist zu der Zeitraum-ID anzugeben, welche SG6 RFF+Z49 (Verwendungszeitraum der Daten: Gültig...
425    fn evaluate_531(&self, _ctx: &EvaluationContext) -> ConditionResult {
426        // Hinweis: year of next Netznutzungsabrechnung to be stated for the Zeitraum-ID in SG6 RFF+Z49 — informational note, always applies
427        ConditionResult::True
428    }
429
430    /// [555] Hinweis: Es sind die Produktpaket-ID aus der Anmeldung zu nennen, welche nicht umgesetzt werden konnten
431    fn evaluate_555(&self, _ctx: &EvaluationContext) -> ConditionResult {
432        // Hinweis: Produktpaket-IDs from the Anmeldung that could not be implemented — informational note, always applies
433        ConditionResult::True
434    }
435
436    /// [571] Hinweis: Es sind alle erforderlichen Produkte aus der Anmeldung des LF des im selben SG8 genannten Produktpaket-ID zu nennen welche nicht umgesetzt werden konnten
437    fn evaluate_571(&self, _ctx: &EvaluationContext) -> ConditionResult {
438        // Hinweis: all required products from LF Anmeldung for the Produktpaket-ID in the same SG8 that could not be implemented — informational note, always applies
439        ConditionResult::True
440    }
441
442    /// [701] Hinweis: Es ist die Malo-ID der Tranche zu nennen, der die Technische Ressource zugeordnet ist
443    fn evaluate_701(&self, _ctx: &EvaluationContext) -> ConditionResult {
444        // Hinweis: MaLo-ID of the Tranche to which the Technische Ressource is assigned — informational note, always applies
445        ConditionResult::True
446    }
447
448    /// [2002] Für jede Produktpaket-ID im SG8 SEQ+Z79 (Bestandteil eines Produktpakets) DE1050 genau einmal anzugeben
449    fn evaluate_2002(&self, ctx: &EvaluationContext) -> ConditionResult {
450        let nav = match ctx.navigator() {
451            Some(n) => n,
452            None => return ConditionResult::Unknown,
453        };
454        let sg8_count = nav.group_instance_count(&["SG4", "SG8"]);
455        let mut seen = std::collections::HashSet::new();
456        for i in 0..sg8_count {
457            let seq_segs = nav.find_segments_in_group("SEQ", &["SG4", "SG8"], i);
458            for seq in &seq_segs {
459                if seq
460                    .elements
461                    .first()
462                    .and_then(|e| e.first())
463                    .is_some_and(|v| v == "Z79")
464                {
465                    if let Some(val) = seq.elements.get(1).and_then(|e| e.first()) {
466                        if !val.is_empty() && !seen.insert(val.clone()) {
467                            return ConditionResult::False;
468                        }
469                    }
470                }
471            }
472        }
473        if seen.is_empty() {
474            ConditionResult::Unknown
475        } else {
476            ConditionResult::True
477        }
478    }
479
480    /// [185] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
481    /// EXTERNAL: Requires context from outside the message.
482    fn evaluate_185(&self, ctx: &EvaluationContext) -> ConditionResult {
483        ctx.external
484            .evaluate("verwendungszweck_code_valid_malocation_nb_produkt")
485    }
486
487    /// [186] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
488    /// EXTERNAL: Requires context from outside the message.
489    fn evaluate_186(&self, ctx: &EvaluationContext) -> ConditionResult {
490        ctx.external
491            .evaluate("verwendungszweck_code_valid_malocation_lf_produkt")
492    }
493
494    /// [187] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
495    /// EXTERNAL: Requires context from outside the message.
496    fn evaluate_187(&self, ctx: &EvaluationContext) -> ConditionResult {
497        ctx.external
498            .evaluate("verwendungszweck_code_valid_malocation_uenb_produkt")
499    }
500
501    /// [274] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
502    /// EXTERNAL: Requires context from outside the message.
503    fn evaluate_274(&self, ctx: &EvaluationContext) -> ConditionResult {
504        ctx.external
505            .evaluate("verwendungszweck_code_valid_tranche_nb_produkt")
506    }
507
508    /// [275] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
509    /// EXTERNAL: Requires context from outside the message.
510    fn evaluate_275(&self, ctx: &EvaluationContext) -> ConditionResult {
511        ctx.external
512            .evaluate("verwendungszweck_code_valid_tranche_lf_produkt")
513    }
514
515    /// [276] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in ders...
516    /// EXTERNAL: Requires context from outside the message.
517    fn evaluate_276(&self, ctx: &EvaluationContext) -> ConditionResult {
518        ctx.external
519            .evaluate("verwendungszweck_code_valid_tranche_uenb_produkt")
520    }
521
522    /// [272] Wenn im selben Segment im DE2379 der Code 106 vorhanden ist
523    fn evaluate_272(&self, ctx: &EvaluationContext) -> ConditionResult {
524        ConditionResult::from(ctx.self_segment_value_equals("DTM", 0, 2, "106"))
525    }
526}