Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conditions to flatahbtable output #353

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-backend = "hatchling.build"
dependencies = [
"click>=8.0.0",
"colorlog>=6.7.0",
"maus>=0.5.0",
"maus>=0.5.2",
"openpyxl>=3.1.1",
"pandas>=1.5.3",
"python-docx>=1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile pyproject.toml
# pip-compile '.\pyproject.toml'
#
annotated-types==0.7.0
# via pydantic
Expand All @@ -22,7 +22,7 @@ lxml==5.2.2
# via python-docx
marshmallow==3.21.3
# via maus
maus==0.5.0
maus==0.5.2
# via kohlrahbi (pyproject.toml)
more-itertools==10.3.0
# via maus
Expand Down
1 change: 1 addition & 0 deletions src/kohlrahbi/unfoldedahb/unfoldedahbtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def convert_to_flat_ahb(self) -> FlatAnwendungshandbuch:
value_pool_entry=unfolded_ahb_line.code,
name=unfolded_ahb_line.beschreibung or unfolded_ahb_line.qualifier,
ahb_expression=unfolded_ahb_line.bedingung_ausdruck,
conditions=unfolded_ahb_line.bedingung,
section_name=unfolded_ahb_line.segment_name if unfolded_ahb_line.segment is not None else None,
index=unfolded_ahb_line.index,
)
Expand Down
24 changes: 24 additions & 0 deletions unittests/test_unfolded_ahb_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ def test_convert_to_flat_ahb(self) -> None:
bedingung_ausdruck="X",
bedingung=None,
),
UnfoldedAhbLine(
index=5,
segment_name="Marktlokation",
segment_gruppe="SG5",
segment="LOC",
datenelement="3225",
code=None,
qualifier="ID der Marktlokation",
beschreibung=None,
bedingung_ausdruck="X[950]",
bedingung="[950] Format:\n Marktlokations-ID",
),
]

unfolded_ahb = UnfoldedAhb(meta_data=meta_data, unfolded_ahb_lines=unfolded_ahb_lines)
Expand Down Expand Up @@ -164,6 +176,18 @@ def test_convert_to_flat_ahb(self) -> None:
ahb_expression="X",
index=4,
),
AhbLine(
guid=None,
section_name="Marktlokation",
conditions="[950] Format:\n Marktlokations-ID",
segment_group_key="SG5",
segment_code="LOC",
data_element="3225",
value_pool_entry=None,
name="ID der Marktlokation",
ahb_expression="X[950]",
index=5,
),
],
)

Expand Down