Expand description
dvgw-edi — DVGW EDIFACT for the German gas transport and balancing market.
Parses, validates and writes the DVGW-governed formats used in gas balancing
(GaBi Gas 2.1, BNetzA BK7-24-01-008). The DVGW counterpart to edi-energy,
which covers the BDEW EDI@Energy retail layer.
§The one thing to know first
A DVGW message does not name itself in UNH. Every format is a subset of
a UN/EDIFACT D.07A message, so UNH carries the carrier — ORDERS or
ORDRSP — and BGM C002 DE 1001 carries the message:
UNH+1+ORDERS:D:07A:UN:DVGW18' ← the carrier
BGM+01G::332+NOMINT00052' ← *this* says NOMINT
DTM+Z05:0:805' ← timestamps below are UTC
DTM+137:201801042056:203' ← message date/time
DTM+Z01:201801050400201801060400:719' ← Gültigkeitszeitraum = the gas day
RFF+Z13:70030' ← PrüfidentifikatorMatching UNH against "NOMINT" therefore rejects every conformant message.
Identity here is resolved from DvgwDocument, with the carrier as a
cross-check.
§Supported formats
| Message | Carrier | Document codes (BGM DE 1001) | Prüfidentifikatoren |
|---|---|---|---|
| ALOCAT — Allokationsnachricht | ORDRSP | X1G X2G X3G X4G X5G X6G X7G XBG | 70001–70023 |
| NOMINT — Nominierung | ORDERS | 01G 55G Y1G Y6G Y7G | 70030–70034 |
| NOMRES — Nominierungsantwort | ORDRSP | 07G 08G 19G 20G Y2G | 70035–70039 |
| SSQNOT — Mehr-/Mindermengenmeldung | ORDRSP | BAG | 70095–70096 |
CONTRL and APERAK acknowledge DVGW interchanges but are BDEW formats;
they live in edi-energy and are not reimplemented here.
§Quick start
use dvgw_edi::{DvgwMessageType, DvgwPlatform};
let platform = DvgwPlatform::default();
for result in platform.parse_interchange(raw) {
let msg = result?;
println!("{} ({})", msg.message_type, msg.document.description());
// The gas day is DTM+Z01, decoded through its own format code.
if let Some(period) = msg.validity_period {
println!(" Gastag {period}");
}
// A LOC group carries a time series, not one value.
for qty in msg.quantities() {
println!(" {:?} {:?}", qty.value, qty.period);
}
if msg.message_type == DvgwMessageType::Nomint {
// RFF+AGO — the nomination a re-nomination corrects. A NOMRES has no
// such reference and is paired on the business key instead.
println!(" korrigiert {:?}", msg.original_nomination_ref());
}
let report = DvgwPlatform::validate_message(&msg);
for issue in report.errors() {
eprintln!(" {issue}");
}
}§Market roles
| Role | Abbreviation |
|---|---|
| Fernleitungsnetzbetreiber | FNB |
| Verteilnetzbetreiber | VNB |
| Bilanzkreisverantwortlicher | BKV |
| Marktgebietsverantwortlicher | MGV |
§Regulatory references
- § 20 Abs. 3
EnWG— Festlegungskompetenz for gas network access and balancing BNetzABK7-24-01-008 —GaBiGas 2.1- Kooperationsvereinbarung Gas (
KoV) — nomination and allocation deadlines - DVGW-Nachrichtenbeschreibungen: https://www.dvgw-sc.de/leistungen/it-dienstleistungen/datenaustausch-gas
§Relationship to other crates
| Crate | Layer |
|---|---|
dvgw-edi | EDIFACT parsing / validation / writing — this crate |
mako-gabi-gas | GaBi Gas process engine (workflows, deadlines) |
edi-energy | BDEW EDI@Energy formats (UTILMD, MSCONS, APERAK, …) |
Re-exports§
pub use model::EnergyByQualifier;pub use model::ItemDescription;pub use model::LineItem;pub use model::LocationGroup;pub use model::Party;pub use model::Quantity;pub use model::Reference;
Modules§
- model
- The typed message model: positions, locations, quantities and parties. The typed message model, shared by all four DVGW families.
- ssqnot
- SSQNOT read as one Mehr-/Mindermengen record. SSQNOT — the Mehr-/Mindermengenmeldung zur Führung des Netzkontos, read as one business record.
Structs§
- Correlation
Key - A resolved Zuordnungstupel — the tuple and the values read for it.
- Dvgw
Issue - A single validation finding.
- Dvgw
Message - A parsed DVGW message.
- Dvgw
Period - A half-open period
[start, end)from a format-719value. - Dvgw
Platform - Parse configuration and entry points for DVGW EDIFACT.
- Dvgw
Report - The result of validating one DVGW message.
- Dvgw
Version - The Anwendungscode from
UNHS009 DE 0057. - Message
Builder - Builds a complete DVGW message.
- PidInfo
- One published DVGW Anwendungsfall.
- Position
- One
LINposition under construction. - Pruefidentifikator
- A validated DVGW Prüfidentifikator.
Enums§
- Carrier
- The UN/EDIFACT message that carries a DVGW format on the wire (
UNHDE 0065). - DtmFormat
- The
DTMC507 DE 2379 format codes DVGW uses. - DtmValue
- A decoded
DTMvalue. - Dvgw
Document - The DVGW document-name code from
BGMC002 DE 1001 — the field that says which business message this actually is. - Dvgw
Message Type - The logical DVGW message family.
- Error
- Errors produced by
dvgw-edi. - Severity
- How badly a finding breaks the message.
- Zuordnung
- The Zuordnungstupel a Prüfidentifikator is assigned.
Constants§
- DVGW_
AGENCY_ CODE - The code-list responsible agency DVGW stamps on every coded value
(
DE 3055=332). - PID_MAX
- Highest code DVGW allocates.
- PID_MIN
- Lowest code DVGW allocates.
- SSQNOT_
RLM_ CUTOFF - The Anwendungsfall SSQNOT 5.7 §4 Hinweis [500] retires: 70096
(Mehr-/Mindermengenmeldung RLM) is admitted only for Zeiträume before this
day, as is the
STS+A2GRLM marker (Hinweis [501]).
Functions§
- assigned_
pids - Every Prüfidentifikator the shipped catalogue assigns a Zuordnung.
- catalogue
- Every catalogued Anwendungsfall, ascending by Prüfidentifikator.
- catalogue_
for - The catalogued Anwendungsfälle for one message family.
- sniff
- Does this interchange carry a DVGW message?