tricc-oo 1.4.23__tar.gz → 1.4.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/PKG-INFO +1 -1
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/pyproject.toml +1 -1
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/tricc_to_xls_form.py +6 -2
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/tricc.py +2 -2
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/serializers/xls_form.py +2 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xls_form.py +6 -3
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/visitors/tricc.py +86 -79
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo.egg-info/PKG-INFO +1 -1
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/README.md +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/setup.cfg +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tests/build.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tests/test_cql.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tests/to_ocl.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlLexer.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlListener.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlParser.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/cql_to_operation.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/datadictionnary.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/drawio_type_map.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/utils.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/converters/xml_to_tricc.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/base.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/calculate.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/lang.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/ocl.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/models/ordered_set.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/parsers/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/parsers/xml.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/serializers/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/serializers/planuml.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/input/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/input/drawio.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/spice.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/visitors/__init__.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/visitors/utils.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo/visitors/xform_pd.py +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo.egg-info/SOURCES.txt +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo.egg-info/dependency_links.txt +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo.egg-info/requires.txt +0 -0
- {tricc_oo-1.4.23 → tricc_oo-1.4.25}/tricc_oo.egg-info/top_level.txt +0 -0
|
@@ -37,8 +37,12 @@ def get_export_name(node, replace_dots=True):
|
|
|
37
37
|
node.export_name = node.name
|
|
38
38
|
elif node.last == False:
|
|
39
39
|
node.export_name = clean_name(node.name + VERSION_SEPARATOR + str(node.version), replace_dots=replace_dots)
|
|
40
|
-
elif node.activity.instance>1:
|
|
41
|
-
|
|
40
|
+
# elif node.activity.instance>1:
|
|
41
|
+
# if node.version:
|
|
42
|
+
# node.export_name = clean_name(node.name + VERSION_SEPARATOR + str(node.version), replace_dots=replace_dots)
|
|
43
|
+
# else:
|
|
44
|
+
# node.export_name = clean_name(node.name + INSTANCE_SEPARATOR + str(node.activity.instance), replace_dots=replace_dots)
|
|
45
|
+
|
|
42
46
|
elif isinstance(node, TriccNodeInput):
|
|
43
47
|
node.export_name = clean_name('load.' +node.name, replace_dots=replace_dots)
|
|
44
48
|
else:
|
|
@@ -299,7 +299,7 @@ class TriccNodeSelectOption(TriccNodeDisplayModel):
|
|
|
299
299
|
select: TriccNodeInputModel
|
|
300
300
|
list_name: str
|
|
301
301
|
def get_datatype(self):
|
|
302
|
-
if
|
|
302
|
+
if self.name.isnumeric():
|
|
303
303
|
return 'number'
|
|
304
304
|
else:
|
|
305
305
|
return 'string'
|
|
@@ -323,7 +323,7 @@ class TriccNodeSelect(TriccNodeInputModel):
|
|
|
323
323
|
list_name: str
|
|
324
324
|
def get_datatype(self):
|
|
325
325
|
rtype = set()
|
|
326
|
-
for k,o in options.items():
|
|
326
|
+
for k,o in self.options.items():
|
|
327
327
|
rtype.add(o.get_datatype())
|
|
328
328
|
if len(rtype)>1:
|
|
329
329
|
return 'mixed'
|
|
@@ -26,7 +26,8 @@ from tricc_oo.visitors.tricc import (
|
|
|
26
26
|
process_reference,
|
|
27
27
|
get_node_expressions,
|
|
28
28
|
TRICC_TRUE_VALUE,
|
|
29
|
-
TRICC_FALSE_VALUE
|
|
29
|
+
TRICC_FALSE_VALUE,
|
|
30
|
+
set_last_version_false
|
|
30
31
|
)
|
|
31
32
|
from tricc_oo.serializers.xls_form import (
|
|
32
33
|
CHOICE_MAP,
|
|
@@ -607,14 +608,16 @@ class XLSFormStrategy(BaseOutPutStrategy):
|
|
|
607
608
|
# function update the calcualte in the XLSFORM format
|
|
608
609
|
# @param left part
|
|
609
610
|
# @param right part
|
|
610
|
-
def generate_xls_form_calculate(self, node, processed_nodes, stashed_nodes, **kwargs):
|
|
611
|
-
if is_ready_to_process(node, processed_nodes):
|
|
611
|
+
def generate_xls_form_calculate(self, node, processed_nodes, stashed_nodes, calculates, **kwargs):
|
|
612
|
+
if is_ready_to_process(node, processed_nodes, strict=False) and process_reference(node, processed_nodes, calculates, replace_reference=False, codesystems= kwargs.get('codesystems', None)):
|
|
612
613
|
if node not in processed_nodes:
|
|
613
614
|
if kwargs.get('warn', True):
|
|
614
615
|
logger.debug("generation of calculate for node {}".format(node.get_name()))
|
|
615
616
|
if hasattr(node, 'expression') and (node.expression is None) and issubclass(node.__class__,TriccNodeCalculateBase):
|
|
616
617
|
node.expression = get_node_expressions(node, processed_nodes, process=kwargs.get('process', 'main '))
|
|
617
618
|
# continue walk
|
|
619
|
+
if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)):
|
|
620
|
+
last_version = set_last_version_false(node, processed_nodes)
|
|
618
621
|
return True
|
|
619
622
|
return False
|
|
620
623
|
|
|
@@ -95,11 +95,11 @@ def get_node_expressions(node, processed_nodes, process=None):
|
|
|
95
95
|
|
|
96
96
|
def set_last_version_false(node, processed_nodes):
|
|
97
97
|
node_name = node.name if not isinstance(node, TriccNodeEnd) else node.get_reference()
|
|
98
|
-
last_version = get_last_version(node_name, processed_nodes) if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)) and not isinstance(node, TriccNodeSelectOption) else None
|
|
99
|
-
|
|
98
|
+
#last_version = get_last_version(node_name, processed_nodes) if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)) and not isinstance(node, TriccNodeSelectOption) else None
|
|
99
|
+
last_version = processed_nodes.find_prev(node, lambda item: item.id != node.id and hasattr(item, 'name') and item.name == node.name and issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)) and not isinstance(node, TriccNodeSelectOption))
|
|
100
100
|
if last_version and getattr(node, 'process', '') != 'pause':
|
|
101
101
|
# 0-100 for manually specified instance. 100-200 for auto instance
|
|
102
|
-
node.version = last_version.version + 1
|
|
102
|
+
node.version = get_next_version(node.name, processed_nodes, last_version.version + 1, 0)
|
|
103
103
|
last_version.last = False
|
|
104
104
|
node.path_len = max(node.path_len, last_version.path_len + 1)
|
|
105
105
|
return last_version
|
|
@@ -116,23 +116,7 @@ def get_version_inheritance(node, last_version, processed_nodes):
|
|
|
116
116
|
set_prev_next_node(last_version, node)
|
|
117
117
|
else:
|
|
118
118
|
expression = node.expression or node.expression_reference or getattr(node, 'relevance', None)
|
|
119
|
-
|
|
120
|
-
if datatype == 'boolean':
|
|
121
|
-
expression_reference = TriccOperation(
|
|
122
|
-
TriccOperator.OR,
|
|
123
|
-
[TriccOperation(TriccOperator.ISTRUE, [last_version]), expression]
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
elif datatype == 'number':
|
|
127
|
-
expression = TriccOperation(
|
|
128
|
-
TriccOperator.PLUS,
|
|
129
|
-
[last_version, expression]
|
|
130
|
-
)
|
|
131
|
-
else:
|
|
132
|
-
expression = TriccOperation(
|
|
133
|
-
TriccOperator.COALESCE,
|
|
134
|
-
[last_version, expression]
|
|
135
|
-
)
|
|
119
|
+
expression = merge_expression(expression, last_version)
|
|
136
120
|
if node.expression:
|
|
137
121
|
node.expression = expression
|
|
138
122
|
elif node.expression_reference:
|
|
@@ -141,24 +125,20 @@ def get_version_inheritance(node, last_version, processed_nodes):
|
|
|
141
125
|
node.relevance = expression
|
|
142
126
|
else:
|
|
143
127
|
node.last = False
|
|
144
|
-
|
|
145
|
-
|
|
146
128
|
calc = TriccNodeCalculate(
|
|
147
129
|
id=generate_id(f"save{node.id}"),
|
|
148
130
|
name=node.name,
|
|
149
131
|
path_len=node.path_len+1,
|
|
150
|
-
version=get_next_version(node.name, processed_nodes, node.version+2),
|
|
151
|
-
expression=
|
|
152
|
-
|
|
153
|
-
[node, last_version, TriccStatic("''")]
|
|
154
|
-
),
|
|
132
|
+
#version=get_next_version(node.name, processed_nodes, node.version+2),
|
|
133
|
+
expression= merge_expression(node, last_version),
|
|
134
|
+
label= f"merge{node.id}",
|
|
155
135
|
last=True,
|
|
156
136
|
activity=node.activity,
|
|
157
137
|
group=node.group
|
|
158
138
|
)
|
|
159
139
|
node.activity.nodes[calc.id]=calc
|
|
160
140
|
node.activity.calculates.append(calc)
|
|
161
|
-
set_last_version_false(calc, processed_nodes)
|
|
141
|
+
#set_last_version_false(calc, processed_nodes)
|
|
162
142
|
processed_nodes.add(calc)
|
|
163
143
|
if issubclass(node.__class__, TriccNodeInputModel):
|
|
164
144
|
node.expression = TriccOperation(
|
|
@@ -168,6 +148,26 @@ def get_version_inheritance(node, last_version, processed_nodes):
|
|
|
168
148
|
last_version
|
|
169
149
|
]
|
|
170
150
|
)
|
|
151
|
+
|
|
152
|
+
def merge_expression(expression, last_version):
|
|
153
|
+
datatype = expression.get_datatype()
|
|
154
|
+
if datatype == 'boolean':
|
|
155
|
+
expression = TriccOperation(
|
|
156
|
+
TriccOperator.OR,
|
|
157
|
+
[TriccOperation(TriccOperator.ISTRUE, [last_version]), expression]
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
elif datatype == 'number':
|
|
161
|
+
expression = TriccOperation(
|
|
162
|
+
TriccOperator.PLUS,
|
|
163
|
+
[last_version, expression]
|
|
164
|
+
)
|
|
165
|
+
else:
|
|
166
|
+
expression = TriccOperation(
|
|
167
|
+
TriccOperator.COALESCE,
|
|
168
|
+
[last_version, expression]
|
|
169
|
+
)
|
|
170
|
+
return expression
|
|
171
171
|
|
|
172
172
|
def process_calculate(node,processed_nodes, stashed_nodes, calculates, used_calculates,
|
|
173
173
|
warn = False, process=None, **kwargs ):
|
|
@@ -472,39 +472,31 @@ def generate_calculates(node,calculates, used_calculates,processed_nodes):
|
|
|
472
472
|
if hasattr(node, 'save') and node.save is not None and node.save != '':
|
|
473
473
|
# get fragments type.name.icdcode
|
|
474
474
|
calculate_name=node.save
|
|
475
|
-
if
|
|
476
|
-
calc_node = get_count_node(node)
|
|
477
|
-
calc_node.path_len += 1
|
|
478
|
-
calc_node.name=calculate_name
|
|
479
|
-
calc_node.label = "save select: " +node.get_name()
|
|
480
|
-
elif node.name != calculate_name:
|
|
475
|
+
if node.name != calculate_name:
|
|
481
476
|
calc_id = generate_id(f"autosave{node.id}")
|
|
482
477
|
|
|
483
478
|
calc_node = TriccNodeCalculate(
|
|
484
479
|
name=calculate_name,
|
|
485
480
|
id = calc_id,
|
|
486
481
|
group = node.group,
|
|
487
|
-
version=get_next_version(calculate_name, processed_nodes, node.version+2),
|
|
482
|
+
#version=get_next_version(calculate_name, processed_nodes, node.version+2),
|
|
488
483
|
activity = node.activity,
|
|
489
484
|
label = "save: " +node.get_name(),
|
|
490
485
|
path_len=node.path_len+ 1,
|
|
491
|
-
last=True
|
|
486
|
+
last=True,
|
|
487
|
+
expression=get_node_expression(node,processed_nodes,True,True)
|
|
492
488
|
)
|
|
493
|
-
node.activity.
|
|
489
|
+
node.activity.calculates.append(calc_node)
|
|
494
490
|
last_version = set_last_version_false(calc_node, processed_nodes)
|
|
495
491
|
if last_version:
|
|
496
|
-
|
|
492
|
+
calc_node.expression = merge_expression(calc_node.expression, last_version)
|
|
497
493
|
processed_nodes.add(calc_node)
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
list_calc.append(calc_node)
|
|
505
|
-
#add_save_calculate(calc_node, calculates, used_calculates,processed_nodes)
|
|
506
|
-
for calc in list_calc:
|
|
507
|
-
node.activity.nodes[calc.id] = calc
|
|
494
|
+
logger.debug("generate_save_calculate:{}:{} as {}".format(calc_node.tricc_type, node.name if hasattr(node,'name') else node.id, calculate_name))
|
|
495
|
+
|
|
496
|
+
list_calc.append(calc_node)
|
|
497
|
+
#add_save_calculate(calc_node, calculates, used_calculates,processed_nodes)
|
|
498
|
+
for calc in list_calc:
|
|
499
|
+
node.activity.nodes[calc.id] = calc
|
|
508
500
|
return list_calc
|
|
509
501
|
|
|
510
502
|
|
|
@@ -965,8 +957,8 @@ def walkthrough_tricc_option(node, callback, processed_nodes, stashed_nodes, pat
|
|
|
965
957
|
warn = warn,
|
|
966
958
|
node_path = node_path.copy(), **kwargs)
|
|
967
959
|
|
|
968
|
-
def get_next_version(name, processed_nodes, version=0,):
|
|
969
|
-
return max(version,
|
|
960
|
+
def get_next_version(name, processed_nodes, version=0, min=100):
|
|
961
|
+
return max(version, min,*[(getattr(n,'version',None) or getattr(n,'instance',None) or 0) for n in get_versions(name, processed_nodes)])+1
|
|
970
962
|
|
|
971
963
|
|
|
972
964
|
def get_data_for_log(node):
|
|
@@ -1557,6 +1549,8 @@ def get_node_expression( in_node, processed_nodes, is_calculate=False, is_prev=F
|
|
|
1557
1549
|
logger.critical(f"Rhombus without expression {node.get_name()}")
|
|
1558
1550
|
elif is_prev and issubclass(node.__class__, TriccNodeDisplayCalculateBase):
|
|
1559
1551
|
expression = TriccOperation(TriccOperator.ISTRUE, [node])
|
|
1552
|
+
elif is_prev and is_calculate and (issubclass(node.__class__, TriccNodeSelect) or isinstance(node, TriccNodeSelectNotAvailable)):
|
|
1553
|
+
expression = get_count_terms_details( node, processed_nodes, is_calculate, negate, process)
|
|
1560
1554
|
elif hasattr(node, 'expression_reference') and isinstance(node.expression_reference, TriccOperation):
|
|
1561
1555
|
# if issubclass(node.__class__, TriccNodeDisplayCalculateBase):
|
|
1562
1556
|
# expression = TriccOperation(
|
|
@@ -1875,7 +1869,28 @@ def get_activity_end_terms( node, processed_nodes, process=None):
|
|
|
1875
1869
|
|
|
1876
1870
|
def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=None):
|
|
1877
1871
|
terms = []
|
|
1872
|
+
|
|
1878
1873
|
for prev_node in node.prev_nodes:
|
|
1874
|
+
term = get_count_terms_details( prev_node, processed_nodes, is_calculate, negate, process)
|
|
1875
|
+
if term:
|
|
1876
|
+
terms.append(term)
|
|
1877
|
+
if len(terms) == 1:
|
|
1878
|
+
return TriccOperation(
|
|
1879
|
+
TriccOperator.CAST_NUMBER,
|
|
1880
|
+
[terms[0]]
|
|
1881
|
+
)
|
|
1882
|
+
elif len(terms) > 0:
|
|
1883
|
+
return TriccOperation(
|
|
1884
|
+
TriccOperator.PLUS,
|
|
1885
|
+
[
|
|
1886
|
+
TriccOperation(
|
|
1887
|
+
TriccOperator.CAST_NUMBER,
|
|
1888
|
+
[term]
|
|
1889
|
+
) for term in terms
|
|
1890
|
+
]
|
|
1891
|
+
)
|
|
1892
|
+
|
|
1893
|
+
def get_count_terms_details( prev_node, processed_nodes, is_calculate, negate=False, process=None):
|
|
1879
1894
|
operation_none = TriccOperation(
|
|
1880
1895
|
TriccOperator.SELECTED,
|
|
1881
1896
|
[
|
|
@@ -1883,12 +1898,20 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1883
1898
|
TriccStatic('opt_none')
|
|
1884
1899
|
]
|
|
1885
1900
|
)
|
|
1886
|
-
if isinstance(prev_node,
|
|
1901
|
+
if isinstance(prev_node, TriccNodeSelectYesNo):
|
|
1902
|
+
return TriccOperation(
|
|
1903
|
+
TriccOperator.SELECTED,
|
|
1904
|
+
[
|
|
1905
|
+
prev_node,
|
|
1906
|
+
TriccStatic(prev_node.options[0].name)
|
|
1907
|
+
]
|
|
1908
|
+
)
|
|
1909
|
+
elif issubclass(prev_node.__class__, TriccNodeSelect):
|
|
1887
1910
|
if negate:
|
|
1888
|
-
|
|
1911
|
+
return
|
|
1889
1912
|
#terms.append(TRICC_SELECT_MULTIPLE_CALC_NONE_EXPRESSION.format(get_export_name(prev_node)))
|
|
1890
1913
|
else:
|
|
1891
|
-
|
|
1914
|
+
return TriccOperation(
|
|
1892
1915
|
TriccOperator.MINUS,
|
|
1893
1916
|
[
|
|
1894
1917
|
TriccOperation(
|
|
@@ -1903,23 +1926,22 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1903
1926
|
operation_none
|
|
1904
1927
|
]
|
|
1905
1928
|
)
|
|
1906
|
-
])
|
|
1929
|
+
])
|
|
1907
1930
|
#terms.append(TRICC_SELECT_MULTIPLE_CALC_EXPRESSION.format(get_export_name(prev_node)))
|
|
1908
|
-
elif isinstance(prev_node, (
|
|
1909
|
-
|
|
1931
|
+
elif isinstance(prev_node, (TriccNodeSelectNotAvailable)):
|
|
1932
|
+
return TriccOperation(
|
|
1910
1933
|
TriccOperator.SELECTED,
|
|
1911
1934
|
[
|
|
1912
1935
|
prev_node,
|
|
1913
1936
|
TriccStatic('1')
|
|
1914
1937
|
]
|
|
1915
|
-
)
|
|
1938
|
+
)
|
|
1916
1939
|
#terms.append(TRICC_SELECTED_EXPRESSION.format(get_export_name(prev_node), '1'))
|
|
1917
1940
|
elif isinstance(prev_node, TriccNodeSelectOption):
|
|
1918
|
-
|
|
1941
|
+
return get_selected_option_expression(prev_node, negate)
|
|
1919
1942
|
else:
|
|
1920
1943
|
if negate:
|
|
1921
|
-
|
|
1922
|
-
TriccOperation(
|
|
1944
|
+
return TriccOperation(
|
|
1923
1945
|
TriccOperator.CAST_NUMBER,
|
|
1924
1946
|
[
|
|
1925
1947
|
TriccOperation(
|
|
@@ -1940,10 +1962,9 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1940
1962
|
)
|
|
1941
1963
|
]
|
|
1942
1964
|
)
|
|
1943
|
-
|
|
1965
|
+
|
|
1944
1966
|
else:
|
|
1945
|
-
|
|
1946
|
-
TriccOperation(
|
|
1967
|
+
return TriccOperation(
|
|
1947
1968
|
TriccOperator.CAST_NUMBER,
|
|
1948
1969
|
[
|
|
1949
1970
|
get_node_expression(
|
|
@@ -1953,22 +1974,8 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1953
1974
|
is_prev=True,
|
|
1954
1975
|
process=process)
|
|
1955
1976
|
]
|
|
1956
|
-
)
|
|
1957
|
-
|
|
1958
|
-
return TriccOperation(
|
|
1959
|
-
TriccOperator.CAST_NUMBER,
|
|
1960
|
-
[terms[0]]
|
|
1961
|
-
)
|
|
1962
|
-
elif len(terms) > 0:
|
|
1963
|
-
return TriccOperation(
|
|
1964
|
-
TriccOperator.PLUS,
|
|
1965
|
-
[
|
|
1966
|
-
TriccOperation(
|
|
1967
|
-
TriccOperator.CAST_NUMBER,
|
|
1968
|
-
[term]
|
|
1969
|
-
) for term in terms
|
|
1970
|
-
]
|
|
1971
|
-
)
|
|
1977
|
+
)
|
|
1978
|
+
|
|
1972
1979
|
|
|
1973
1980
|
|
|
1974
1981
|
def get_add_terms( node, processed_nodes, is_calculate=False, negate=False, process=None):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|