File tree Expand file tree Collapse file tree 2 files changed +45
-35
lines changed Expand file tree Collapse file tree 2 files changed +45
-35
lines changed Original file line number Diff line number Diff line change
1
+ """shared logic between MIG and AHB reader to distinguish elements from the XML"""
2
+
3
+ import xml .etree .ElementTree as ET
4
+
5
+
6
+ def _is_segment_group (element : ET .Element ) -> bool :
7
+ """
8
+ returns True if the given element is a segment group
9
+ """
10
+ return element .tag .startswith ("G_SG" )
11
+
12
+
13
+ def _is_segment (element : ET .Element ) -> bool :
14
+ """
15
+ returns True if the given element is a segment
16
+ """
17
+ return element .tag .startswith ("S_" )
18
+
19
+
20
+ def _is_data_element_group (element : ET .Element ) -> bool :
21
+ """
22
+ returns True if the given element is a data element group
23
+ """
24
+ return element .tag .startswith ("C_" )
25
+
26
+
27
+ def _is_data_element (element : ET .Element ) -> bool :
28
+ """
29
+ returns True if the given element is a data element
30
+ """
31
+ return element .tag .startswith ("D_" )
32
+
33
+
34
+ def _is_code (element : ET .Element ) -> bool :
35
+ """
36
+ returns True if the given element is a code
37
+ """
38
+ return element .tag == "Code"
Original file line number Diff line number Diff line change 15
15
Segment ,
16
16
SegmentGroup ,
17
17
)
18
-
19
-
20
- def _is_segment_group (element : ET .Element ) -> bool :
21
- """
22
- returns True if the given element is a segment group
23
- """
24
- return element .tag .startswith ("G_SG" )
25
-
26
-
27
- def _is_segment (element : ET .Element ) -> bool :
28
- """
29
- returns True if the given element is a segment
30
- """
31
- return element .tag .startswith ("S_" )
32
-
33
-
34
- def _is_data_element_group (element : ET .Element ) -> bool :
35
- """
36
- returns True if the given element is a data element group
37
- """
38
- return element .tag .startswith ("C_" )
39
-
40
-
41
- def _is_data_element (element : ET .Element ) -> bool :
42
- """
43
- returns True if the given element is a data element
44
- """
45
- return element .tag .startswith ("D_" )
46
-
47
-
48
- def _is_code (element : ET .Element ) -> bool :
49
- """
50
- returns True if the given element is a code
51
- """
52
- return element .tag == "Code"
18
+ from fundamend .reader .element_distinction import (
19
+ _is_code ,
20
+ _is_data_element ,
21
+ _is_data_element_group ,
22
+ _is_segment ,
23
+ _is_segment_group ,
24
+ )
53
25
54
26
55
27
def _to_code (element : ET .Element ) -> Code :
You can’t perform that action at this time.
0 commit comments