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

changed pattern for data_element #433

Merged
merged 2 commits into from
Jul 31, 2024
Merged
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
6 changes: 4 additions & 2 deletions src/maus/models/anwendungshandbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,15 @@ def _check_that_nearly_all_lines_have_a_segment_group(instance, attribute, value
raise ValueError(f"There is a None segment group in line {last(switches_from_no_sg_to_sg[1])}")


_data_element_pattern = re.compile(r"^\d{4}$")
_data_element_pattern = re.compile(r"^\d{4}$|^\d{5}$|^[A-Za-z]+\d{4}$")


# pylint:disable=unused-argument
def _check_that_line_has_either_none_or_d4_data_element(instance, attribute, value: AhbLine):
"""
checks that the given line has either a None data element or a data element that matches \\d{4}
checks that the given line has either a None data element or a data element that matches
\\d{4},\\ d{5} or [A-Za-z]+\\d{4}.
AhbLine(data_element = 0001), AhbLine(data_element = 00001) or AhbLine(data_element = R0001)
"""
if value.data_element is None:
return
Expand Down
Loading