diff --git a/pyproject.toml b/pyproject.toml index 6acdc37..9dfa185 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] -dependencies = ["pydantic"] # add all the dependencies here +dependencies = ["pydantic", "loguru"] # add all the dependencies here dynamic = ["readme", "version"] [project.urls] diff --git a/requirements.txt b/requirements.txt index 1d5fbc7..2af0685 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,12 +6,10 @@ # annotated-types==0.6.0 # via pydantic -distlib==0.3.8 - # via virtualenv -filelock==3.13.1 - # via virtualenv -platformdirs==4.2.0 - # via virtualenv +colorama==0.4.6 + # via loguru +loguru==0.7.2 + # via migmose (pyproject.toml) pydantic==2.6.3 # via migmose (pyproject.toml) pydantic-core==2.16.3 @@ -20,5 +18,5 @@ typing-extensions==4.10.0 # via # pydantic # pydantic-core -virtualenv==20.25.1 - # via migmose (pyproject.toml) +win32-setctime==1.1.0 + # via loguru diff --git a/src/migmose/mig/nachrichtenstrukturzeile.py b/src/migmose/mig/nachrichtenstrukturzeile.py index 08bcf9b..c962491 100644 --- a/src/migmose/mig/nachrichtenstrukturzeile.py +++ b/src/migmose/mig/nachrichtenstrukturzeile.py @@ -7,7 +7,18 @@ class NachrichtenstrukturZeile(BaseModel): """ - class for lines in mig tables + class for lines in mig tables, e.g. (ORDCHG): + { + "zaehler": "0010", + "nr": "1", + "bezeichnung": "UNH", + "standard_status": "M", + "bdew_status": "M", + "standard_maximale_wiederholungen": 1, + "bdew_maximale_wiederholungen": 1, + "ebene": 0, + "inhalt": "Nachrichten-Kopfsegment" + } """ zaehler: str diff --git a/src/migmose/mig/segmentgruppe.py b/src/migmose/mig/segmentgruppe.py index 29fbc9f..3717aa9 100644 --- a/src/migmose/mig/segmentgruppe.py +++ b/src/migmose/mig/segmentgruppe.py @@ -7,8 +7,53 @@ class SegmentGruppe(NachrichtenstrukturZeile): """ - class for structured segmentgroups in mig tables. builds table recursively. inherits from NachrichtenstrukturZeile + class for structured segmentgroups in mig tables. Builds table recursively. Inherits from NachrichtenstrukturZeile + e.g.(ORDCHG): + { + "segmente": [ + { + "zaehler": "0160", + "nr": "7", + "bezeichnung": "NAD", + "standard_status": "M", + "bdew_status": "M", + "standard_maximale_wiederholungen": 1, + "bdew_maximale_wiederholungen": 1, + "ebene": 1, + "inhalt": "MP-ID Absender" + } + ], + "segmentgruppen": [ + { + "segmente": [ + { + "zaehler": "0260", + "nr": "8", + "bezeichnung": "CTA", + "standard_status": "M", + "bdew_status": "M", + "standard_maximale_wiederholungen": 1, + "bdew_maximale_wiederholungen": 1, + "ebene": 2, + "inhalt": "Ansprechpartner" + }, + { + "zaehler": "0270", + "nr": "9", + "bezeichnung": "COM", + "standard_status": "C", + "bdew_status": "R", + "standard_maximale_wiederholungen": 5, + "bdew_maximale_wiederholungen": 5, + "ebene": 3, + "inhalt": "Kommunikationsverbindung" + } + ], + "segmentgruppen": [] + } + ] + } """ segmente: list[NachrichtenstrukturZeile] - segmentgruppe: list["SegmentGruppe"] + segmentgruppen: list["SegmentGruppe"]