tricc-oo 1.4.24__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.24 → tricc_oo-1.4.25}/PKG-INFO +1 -1
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/pyproject.toml +1 -1
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/tricc_to_xls_form.py +1 -1
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xls_form.py +1 -3
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/visitors/tricc.py +59 -51
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo.egg-info/PKG-INFO +1 -1
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/README.md +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/setup.cfg +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tests/build.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tests/test_cql.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tests/to_ocl.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlLexer.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlListener.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlParser.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/cql_to_operation.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/datadictionnary.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/drawio_type_map.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/utils.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/converters/xml_to_tricc.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/base.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/calculate.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/lang.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/ocl.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/ordered_set.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/models/tricc.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/parsers/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/parsers/xml.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/serializers/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/serializers/planuml.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/serializers/xls_form.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/input/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/input/drawio.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/spice.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/visitors/__init__.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/visitors/utils.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo/visitors/xform_pd.py +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo.egg-info/SOURCES.txt +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo.egg-info/dependency_links.txt +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo.egg-info/requires.txt +0 -0
- {tricc_oo-1.4.24 → tricc_oo-1.4.25}/tricc_oo.egg-info/top_level.txt +0 -0
|
@@ -35,7 +35,7 @@ def get_export_name(node, replace_dots=True):
|
|
|
35
35
|
node.gen_name()
|
|
36
36
|
if isinstance(node, TriccNodeSelectOption):
|
|
37
37
|
node.export_name = node.name
|
|
38
|
-
elif node.last
|
|
38
|
+
elif node.last == False:
|
|
39
39
|
node.export_name = clean_name(node.name + VERSION_SEPARATOR + str(node.version), replace_dots=replace_dots)
|
|
40
40
|
# elif node.activity.instance>1:
|
|
41
41
|
# if node.version:
|
|
@@ -616,10 +616,8 @@ class XLSFormStrategy(BaseOutPutStrategy):
|
|
|
616
616
|
if hasattr(node, 'expression') and (node.expression is None) and issubclass(node.__class__,TriccNodeCalculateBase):
|
|
617
617
|
node.expression = get_node_expressions(node, processed_nodes, process=kwargs.get('process', 'main '))
|
|
618
618
|
# continue walk
|
|
619
|
-
if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase)):
|
|
619
|
+
if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)):
|
|
620
620
|
last_version = set_last_version_false(node, processed_nodes)
|
|
621
|
-
if not last_version:
|
|
622
|
-
node.last = True
|
|
623
621
|
return True
|
|
624
622
|
return False
|
|
625
623
|
|
|
@@ -96,10 +96,10 @@ def get_node_expressions(node, processed_nodes, process=None):
|
|
|
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
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: hasattr(item, 'name') and item.name == node.name and issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)) and not isinstance(node, TriccNodeSelectOption))
|
|
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 = get_next_version(node.name, processed_nodes, 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
|
|
@@ -472,13 +472,9 @@ 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}")
|
|
477
|
+
|
|
482
478
|
calc_node = TriccNodeCalculate(
|
|
483
479
|
name=calculate_name,
|
|
484
480
|
id = calc_id,
|
|
@@ -487,23 +483,20 @@ def generate_calculates(node,calculates, used_calculates,processed_nodes):
|
|
|
487
483
|
activity = node.activity,
|
|
488
484
|
label = "save: " +node.get_name(),
|
|
489
485
|
path_len=node.path_len+ 1,
|
|
490
|
-
last=True
|
|
486
|
+
last=True,
|
|
487
|
+
expression=get_node_expression(node,processed_nodes,True,True)
|
|
491
488
|
)
|
|
492
|
-
node.activity.
|
|
489
|
+
node.activity.calculates.append(calc_node)
|
|
493
490
|
last_version = set_last_version_false(calc_node, processed_nodes)
|
|
494
491
|
if last_version:
|
|
495
|
-
|
|
492
|
+
calc_node.expression = merge_expression(calc_node.expression, last_version)
|
|
496
493
|
processed_nodes.add(calc_node)
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
list_calc.append(calc_node)
|
|
504
|
-
#add_save_calculate(calc_node, calculates, used_calculates,processed_nodes)
|
|
505
|
-
for calc in list_calc:
|
|
506
|
-
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
|
|
507
500
|
return list_calc
|
|
508
501
|
|
|
509
502
|
|
|
@@ -965,7 +958,7 @@ def walkthrough_tricc_option(node, callback, processed_nodes, stashed_nodes, pat
|
|
|
965
958
|
node_path = node_path.copy(), **kwargs)
|
|
966
959
|
|
|
967
960
|
def get_next_version(name, processed_nodes, version=0, min=100):
|
|
968
|
-
return max(version, min,*[(getattr(n,'version',
|
|
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
|
|
969
962
|
|
|
970
963
|
|
|
971
964
|
def get_data_for_log(node):
|
|
@@ -1556,6 +1549,8 @@ def get_node_expression( in_node, processed_nodes, is_calculate=False, is_prev=F
|
|
|
1556
1549
|
logger.critical(f"Rhombus without expression {node.get_name()}")
|
|
1557
1550
|
elif is_prev and issubclass(node.__class__, TriccNodeDisplayCalculateBase):
|
|
1558
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)
|
|
1559
1554
|
elif hasattr(node, 'expression_reference') and isinstance(node.expression_reference, TriccOperation):
|
|
1560
1555
|
# if issubclass(node.__class__, TriccNodeDisplayCalculateBase):
|
|
1561
1556
|
# expression = TriccOperation(
|
|
@@ -1874,7 +1869,28 @@ def get_activity_end_terms( node, processed_nodes, process=None):
|
|
|
1874
1869
|
|
|
1875
1870
|
def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=None):
|
|
1876
1871
|
terms = []
|
|
1872
|
+
|
|
1877
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):
|
|
1878
1894
|
operation_none = TriccOperation(
|
|
1879
1895
|
TriccOperator.SELECTED,
|
|
1880
1896
|
[
|
|
@@ -1882,12 +1898,20 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1882
1898
|
TriccStatic('opt_none')
|
|
1883
1899
|
]
|
|
1884
1900
|
)
|
|
1885
|
-
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):
|
|
1886
1910
|
if negate:
|
|
1887
|
-
|
|
1911
|
+
return
|
|
1888
1912
|
#terms.append(TRICC_SELECT_MULTIPLE_CALC_NONE_EXPRESSION.format(get_export_name(prev_node)))
|
|
1889
1913
|
else:
|
|
1890
|
-
|
|
1914
|
+
return TriccOperation(
|
|
1891
1915
|
TriccOperator.MINUS,
|
|
1892
1916
|
[
|
|
1893
1917
|
TriccOperation(
|
|
@@ -1902,23 +1926,22 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1902
1926
|
operation_none
|
|
1903
1927
|
]
|
|
1904
1928
|
)
|
|
1905
|
-
])
|
|
1929
|
+
])
|
|
1906
1930
|
#terms.append(TRICC_SELECT_MULTIPLE_CALC_EXPRESSION.format(get_export_name(prev_node)))
|
|
1907
|
-
elif isinstance(prev_node, (
|
|
1908
|
-
|
|
1931
|
+
elif isinstance(prev_node, (TriccNodeSelectNotAvailable)):
|
|
1932
|
+
return TriccOperation(
|
|
1909
1933
|
TriccOperator.SELECTED,
|
|
1910
1934
|
[
|
|
1911
1935
|
prev_node,
|
|
1912
1936
|
TriccStatic('1')
|
|
1913
1937
|
]
|
|
1914
|
-
)
|
|
1938
|
+
)
|
|
1915
1939
|
#terms.append(TRICC_SELECTED_EXPRESSION.format(get_export_name(prev_node), '1'))
|
|
1916
1940
|
elif isinstance(prev_node, TriccNodeSelectOption):
|
|
1917
|
-
|
|
1941
|
+
return get_selected_option_expression(prev_node, negate)
|
|
1918
1942
|
else:
|
|
1919
1943
|
if negate:
|
|
1920
|
-
|
|
1921
|
-
TriccOperation(
|
|
1944
|
+
return TriccOperation(
|
|
1922
1945
|
TriccOperator.CAST_NUMBER,
|
|
1923
1946
|
[
|
|
1924
1947
|
TriccOperation(
|
|
@@ -1939,10 +1962,9 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1939
1962
|
)
|
|
1940
1963
|
]
|
|
1941
1964
|
)
|
|
1942
|
-
|
|
1965
|
+
|
|
1943
1966
|
else:
|
|
1944
|
-
|
|
1945
|
-
TriccOperation(
|
|
1967
|
+
return TriccOperation(
|
|
1946
1968
|
TriccOperator.CAST_NUMBER,
|
|
1947
1969
|
[
|
|
1948
1970
|
get_node_expression(
|
|
@@ -1952,22 +1974,8 @@ def get_count_terms( node, processed_nodes, is_calculate, negate=False, process=
|
|
|
1952
1974
|
is_prev=True,
|
|
1953
1975
|
process=process)
|
|
1954
1976
|
]
|
|
1955
|
-
)
|
|
1956
|
-
|
|
1957
|
-
return TriccOperation(
|
|
1958
|
-
TriccOperator.CAST_NUMBER,
|
|
1959
|
-
[terms[0]]
|
|
1960
|
-
)
|
|
1961
|
-
elif len(terms) > 0:
|
|
1962
|
-
return TriccOperation(
|
|
1963
|
-
TriccOperator.PLUS,
|
|
1964
|
-
[
|
|
1965
|
-
TriccOperation(
|
|
1966
|
-
TriccOperator.CAST_NUMBER,
|
|
1967
|
-
[term]
|
|
1968
|
-
) for term in terms
|
|
1969
|
-
]
|
|
1970
|
-
)
|
|
1977
|
+
)
|
|
1978
|
+
|
|
1971
1979
|
|
|
1972
1980
|
|
|
1973
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
|
|
File without changes
|
|
File without changes
|