automapper-validation 0.9.0

AHB condition expression parsing, evaluation, and EDIFACT validation
Documentation
{
  "generated_at": "2026-09-23T08:11:11Z",
  "ahb_file": "UTILMD_AHB_Strom_2_1_Fehlerkorrektur_20260302.xml",
  "format_version": "FV2510",
  "conditions": {
    "2": {
      "confidence": "high",
      "reasoning": "Check UNH S010.DE0070 (Übermittlungsfolgenummer) at elements[3][0] equals '1', meaning this is the first transmission in the sequence.",
      "description_hash": "31d5d244",
      "is_external": false
    },
    "3": {
      "confidence": "low",
      "reasoning": "Cannot determine from message content alone whether this is the message with the highest Übermittlungsfolgenummer in a split transmission. Requires external context comparing sequence numbers across multiple messages in the same split.",
      "description_hash": "3502aab6",
      "is_external": true
    },
    "20": {
      "confidence": "high",
      "reasoning": "Find any SG8 with SEQ+Z01 (Daten der Marktlokation) and check its SG10 children for CCI where elements[0][0]==\"Z30\" (Lieferrichtung) and elements[2][0]==\"Z07\" (Verbrauch). Uses parent-child navigation: SG8 entry segment is SEQ+Z01, SG10 child has the CCI with Z30/Z07 qualifier combination.",
      "description_hash": "bad11e09",
      "is_external": false
    },
    "28": {
      "confidence": "medium",
      "reasoning": "Within each SG4 containing IDE+24 (Vorgang), check if STS+E01 with Prüfschritt A04:E_0017 (Zusätzlicher Datensatz) or A03:E_0052 (ergänzte Marktlokation) is absent. Uses navigator to scope the check per SG4 instance. STS elements[0][0]=\"E01\", elements[2][0]=Prüfschritt code, elements[2][1]=codelist. Condition is True when this STS is NOT found in the SG4, indicating no 'additional record' status was set.",
      "description_hash": "b404aab2",
      "is_external": false
    },
    "29": {
      "confidence": "medium",
      "reasoning": "Within each SG4 containing IDE+24 (Vorgang), check if STS+E01 with Prüfschritt A06:E_0017 (Zu viele Marktlokationen) or A05:E_0052 (entfallene Marktlokation) is absent. Mirrors condition [28] but for the 'too many / dropped Marktlokation' status codes. True when neither combination is found in the SG4, indicating no 'excess/dropped records' status was set.",
      "description_hash": "90d241f8",
      "is_external": false
    },
    "79": {
      "confidence": "high",
      "reasoning": "Since the 2026-03-02 AHB the text reads STS+7++Z33 (Transaktionsgrund in element 2, as in [157]); FV2504 read STS+7+++Z33 (element 3).",
      "is_external": false,
      "description_hash": "06f71bdd"
    },
    "136": {
      "confidence": "high",
      "reasoning": "Iterates all SG8 instances and their SG10 child groups. In each SG10, checks if a CCI segment has elements[2][0]=='E13' (Zählertyp code, from CCI+++E13 notation) AND a CAV segment has elements[0][0]=='EHZ' (elektronischer Haushaltszähler) in the same SG10 instance.",
      "description_hash": "94b33d39",
      "is_external": false
    },
    "139": {
      "confidence": "medium",
      "reasoning": "True when no SG10 child of any SG8 contains a CAV with elements[0][0]=='IVA'. Iterates all SG8 instances and their SG10 children; returns False as soon as IVA is found, True if absent throughout. 'In dieser SG8' is evaluated message-wide since no specific parent qualifier filter is given.",
      "description_hash": "06aca05b",
      "is_external": false
    },
    "157": {
      "confidence": "high",
      "reasoning": "Checks absence of STS+7++Z33+ZZB. Per the STS Transaktionsgrund segment reference: elements[0][0]='7' (Statuskategorie), elements[2][0]='Z33' (Transaktionsgrund), elements[3][0]='ZZB' (Transaktionsgrundergänzung). The double-plus (++) means elements[1] is empty/skipped. Negates the match result to implement 'nicht vorhanden'.",
      "description_hash": "6d4d5b79",
      "is_external": false
    },
    "158": {
      "confidence": "high",
      "reasoning": "Same-segment DE2379 format-code check on the resolved DTM, as [209] does for code 303.",
      "is_external": false,
      "description_hash": "d894a3f4"
    },
    "168": {
      "confidence": "high",
      "reasoning": "Checks if any SG8 instance has a PIA segment where elements[0][0]=='Z02' (Gruppenartikel-ID qualifier) and elements[1][0] is one of the three article IDs: 1-02-0-002, 1-02-0-003, or 1-02-0-004. Uses any_group_has_qualified_value for concise group-scoped qualifier+value check.",
      "description_hash": "315eadd5",
      "is_external": false
    },
    "169": {
      "confidence": "medium",
      "reasoning": "Complex cross-group condition. Collects all SG8 instances having SEQ+Z45 (Netznutzungsabrechnungsdaten), extracting the Zeitraum-ID from SEQ elements[1][0] (DE1050) and the PIA+Z02 article ID from elements[1][0]. Then checks if two such SG8 instances share the same Zeitraum-ID where one has article 1-02-0-002 and the other has 1-02-0-003 or 1-02-0-004. Medium confidence because the article ID string format ('1-02-0-002') must match exactly as stored in the EDIFACT value.",
      "description_hash": "240e9441",
      "is_external": false
    },
    "242": {
      "confidence": "high",
      "reasoning": "Collect Zeitraum-IDs (DE1050 = elements[1][0]) from all SG8 instances where SEQ has qualifier Z78/ZC7/ZC8/ZD5 (Referenz auf Lokationsbündelstruktur). Check for duplicate IDs using a HashSet.",
      "description_hash": "1fc816f4",
      "is_external": false
    },
    "253": {
      "confidence": "high",
      "reasoning": "Negation of STS+E01++ZC9 presence. STS Status der Antwort: elements[0][0]='E01', elements[2][0]='ZC9'. Use has_segment_matching for multi-element check and negate.",
      "description_hash": "c325106e",
      "is_external": false
    },
    "258": {
      "confidence": "high",
      "reasoning": "Parent-child navigation: find SG8 instances with SEQ+Z01 (Daten der Marktlokation), then check if their SG10 children contain CCI where elements[0][0]='Z30' (Lieferrichtung class code) AND elements[2][0]='Z07' (Verbrauch). Both conditions must hold simultaneously on the CCI segment.",
      "description_hash": "4d683752",
      "is_external": false
    },
    "263": {
      "confidence": "high",
      "reasoning": "FV2504's [20] text, renumbered: message-wide presence of an SG8 SEQ+Z01 with SG10 CCI+Z30++Z07.",
      "is_external": false,
      "description_hash": "a5387753"
    },
    "297": {
      "confidence": "medium",
      "reasoning": "Find SG8 instances with SEQ qualifier Z02 or ZE3 that also have a PIA+5 segment. Collect (de1229_code, zeitraum_id) tuples. Condition is True when more than one such SG8 shares the same combination. Note: 'OBIS-Kennzahl für Energiemenge' filtering is not enforced here (would require knowledge of valid OBIS patterns), so presence of PIA+5 is used as a proxy.",
      "description_hash": "dda2f4a6",
      "is_external": false
    },
    "312": {
      "confidence": "high",
      "reasoning": "Checks if DTM+137 (Nachrichtendatum) value in DE2380 is less than 202603312200+00. The ?+ in AHB notation resolves to a literal + in the parsed value, so the threshold is 202603312200+00. Uses dtm_lt helper with qualifier 137.",
      "description_hash": "a0f9ea7c",
      "is_external": false
    },
    "313": {
      "confidence": "high",
      "reasoning": "Checks if DTM+137 (Nachrichtendatum) value in DE2380 is >= 202603312200+00. Complement of condition 312. Uses dtm_ge helper with qualifier 137.",
      "description_hash": "27406931",
      "is_external": false
    },
    "326": {
      "confidence": "low",
      "reasoning": "Whether a Marktlokation is NOT being decommissioned (stillgelegt) requires business context — the specific STS Transaktionsgrund codes for Stilllegung are not in the provided segment reference, and this is a business-process-level determination that depends on market participant context beyond what can be reliably read from the raw EDIFACT segments without knowing the exact qualifying codes.",
      "description_hash": "ee2dab2b",
      "is_external": true
    },
    "328": {
      "confidence": "low",
      "reasoning": "Whether a Marktlokation IS being decommissioned (stillgelegt) requires business context — the specific STS Transaktionsgrund codes for Stilllegung are not in the provided segment reference and constitute a business-process-level determination that depends on market participant context beyond raw EDIFACT segments.",
      "description_hash": "5c948704",
      "is_external": true
    },
    "346": {
      "confidence": "high",
      "reasoning": "SG10 is a child group of SG8. Iterates all SG8 instances, then their SG10 children. For each SG10, checks if CCI has E13 at elements[2][0] (the characteristic code position per MIG, CCI+++E13 means elements[0]=empty, elements[1]=empty, elements[2]=E13) and if so, checks if CAV in the same SG10 instance has MME at elements[0][0] (Zählertyp code from the CAV Zählertyp reference showing MME as valid code). Falls back to message-wide check when no navigator is available.",
      "description_hash": "2189c317",
      "is_external": false
    },
    "413": {
      "confidence": "low",
      "reasoning": "Requires knowing the 'current SG8' instance being validated: the condition checks whether another SG8 with SEQ+Z02/ZA1/ZA2, same Zeitraum-ID (SEQ DE1050), and identical DE1229 code as the current SG8 exists and has a Wirkarbeit+kumuliert OBIS (C=1/2, D=8) in PIA+5. The 'same Zeitraum-ID and identical DE1229 code as the current SG8' comparison requires per-instance context not available in EvaluationContext. A message-wide existence check would produce false positives by ignoring the Zeitraum-ID/code correlation constraint.",
      "description_hash": "2d07cefe",
      "is_external": false
    },
    "414": {
      "confidence": "low",
      "reasoning": "Negation of condition [413]. Same structural complexity: requires 'current SG8' context to verify that no other SG8 with matching Zeitraum-ID (SEQ DE1050) and same DE1229 code has a Wirkarbeit+kumuliert OBIS in PIA+5. Cannot be correctly implemented without the per-instance current SG8 reference.",
      "description_hash": "14de36b9",
      "is_external": false
    },
    "415": {
      "confidence": "low",
      "reasoning": "Analogous to condition [413] but targets Wirkarbeit+1/4 Stunde (OBIS D=5, quarter-hour interval measurement) instead of kumuliert (D=8). Requires the same 'current SG8' context for Zeitraum-ID and DE1229 code matching against another SG8 instance. Cannot be implemented correctly without per-instance evaluation context.",
      "description_hash": "3b3261a5",
      "is_external": false
    },
    "416": {
      "confidence": "low",
      "reasoning": "This condition requires checking for absence of an SG8 SEQ+Z02/ZA1/ZA2 group that contains a PIA+5 with an OBIS code specifically representing 'Wirkarbeit und 1/4 Stunde'. Determining which OBIS code patterns qualify as 'Wirkarbeit' (active energy) and '1/4 Stunde' (15-minute granularity) requires domain-specific knowledge about OBIS code structure not derivable from the MIG schema alone. The cross-group Zeitraum-ID matching adds further complexity. Cannot implement reliably without an authoritative list of qualifying OBIS code patterns.",
      "description_hash": "cc617b5a",
      "is_external": false
    },
    "461": {
      "confidence": "high",
      "reasoning": "The condition checks if within the same SG10 instance (child group of SG8), a CAV segment with DE7111 code ZG8 (Kategorie der verbrauchenden Technischen Ressource) is present. Since CCI is the entry segment of SG10 and always present when SG10 exists, the condition reduces to checking for CAV+ZG8 within any SG10 group instance. The any_group_has_qualifier helper with path SG4→SG8→SG10 handles this correctly.",
      "description_hash": "64daf9c5",
      "is_external": false
    },
    "534": {
      "confidence": "high",
      "reasoning": "Condition starts with 'Hinweis:' — it is an informational annotation about the maximum repetition count of SG4 STS groups (max 8 Verwendungszeiträume). This is cardinality guidance, not a boolean predicate. Always returns True.",
      "description_hash": "33272cd2",
      "is_external": false
    },
    "557": {
      "confidence": "high",
      "reasoning": "Condition starts with 'Hinweis:' — it is an informational annotation describing processing behavior when more than 8 Verwendungszeiträume are sent. This is a business process note, not a boolean predicate. Always returns True.",
      "description_hash": "3c02e704",
      "is_external": false
    },
    "560": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation, always applies unconditionally.",
      "description_hash": "ab4d00f7",
      "is_external": false
    },
    "561": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation, always applies unconditionally.",
      "description_hash": "fad6440c",
      "is_external": false
    },
    "562": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation describing when the first day of the year is used for value-based Marktlokationen, always applies unconditionally.",
      "description_hash": "39089bfc",
      "is_external": false
    },
    "564": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation explaining the relationship between IDE+Z01 list qualifier and IDE+24 transaction parts, always applies unconditionally.",
      "description_hash": "66d60ebc",
      "is_external": false
    },
    "565": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation clarifying that IDE+24 describes a list component (not the Geschäftsvorfall itself) when IDE+Z01 is present, always applies unconditionally.",
      "description_hash": "0b82b52c",
      "is_external": false
    },
    "578": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational annotation about a time period defined with Z53 (no data). Always applies unconditionally.",
      "description_hash": "f29f0b83",
      "is_external": false
    },
    "681": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational note about Übergangsversorgung (transitional supply) under § 38a EnWG. Always applies unconditionally.",
      "description_hash": "c32f41b8",
      "is_external": false
    },
    "686": {
      "confidence": "high",
      "reasoning": "Hinweis condition — informational note about usage context for deregistering Übergangsversorgung. Always applies unconditionally.",
      "description_hash": "c36dfaa2",
      "is_external": false
    },
    "2000": {
      "confidence": "medium",
      "reasoning": "Checks that per SG4 transaction group, exactly one SG5 child group contains a LOC segment with qualifier Z16 (Marktlokation). Uses parent-child navigator to iterate SG4 instances and count LOC+Z16 occurrences in their SG5 children. Falls back to message-wide count when no navigator is available.",
      "description_hash": "133e3ecd",
      "is_external": false
    },
    "2016": {
      "confidence": "medium",
      "reasoning": "Cross-group Zeitraum-ID correlation: collect DE1156 values from SG6 RFF+Z49/Z53, verify each is covered by at least one SG8 SEQ's DE1050 reference. The mention of 'Anfragenachricht' (request message) and RFF+TN adds ambiguity about whether the source is this message or an external one; implemented as intra-message check on the most direct interpretation.",
      "description_hash": "38b736a3",
      "is_external": false
    },
    "2121": {
      "confidence": "medium",
      "reasoning": "Cardinality condition: this segment group must appear exactly once per qualifying SG8 (those with SEQ+Z01/Z80/Z81 — Daten/Erwartete Daten/Im System vorhandene Daten der Marktlokation). As a boolean predicate the condition evaluates True when such qualifying SG8 instances exist, signalling that the subject segment group is required. Full cardinality validation (exactly-once enforcement) requires the broader validator framework.",
      "description_hash": "d9f0c899",
      "is_external": false
    }
  }
}