tricc-oo 1.4.23__py3-none-any.whl → 1.4.24__py3-none-any.whl
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/converters/tricc_to_xls_form.py +7 -3
- tricc_oo/models/tricc.py +2 -2
- tricc_oo/serializers/xls_form.py +2 -0
- tricc_oo/strategies/output/xls_form.py +8 -3
- tricc_oo/visitors/tricc.py +31 -32
- {tricc_oo-1.4.23.dist-info → tricc_oo-1.4.24.dist-info}/METADATA +1 -1
- {tricc_oo-1.4.23.dist-info → tricc_oo-1.4.24.dist-info}/RECORD +9 -9
- {tricc_oo-1.4.23.dist-info → tricc_oo-1.4.24.dist-info}/WHEEL +0 -0
- {tricc_oo-1.4.23.dist-info → tricc_oo-1.4.24.dist-info}/top_level.txt +0 -0
|
@@ -35,10 +35,14 @@ 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 != True:
|
|
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:
|
tricc_oo/models/tricc.py
CHANGED
|
@@ -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'
|
tricc_oo/serializers/xls_form.py
CHANGED
|
@@ -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,18 @@ 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)):
|
|
620
|
+
last_version = set_last_version_false(node, processed_nodes)
|
|
621
|
+
if not last_version:
|
|
622
|
+
node.last = True
|
|
618
623
|
return True
|
|
619
624
|
return False
|
|
620
625
|
|
tricc_oo/visitors/tricc.py
CHANGED
|
@@ -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: 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)
|
|
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 ):
|
|
@@ -479,12 +479,11 @@ def generate_calculates(node,calculates, used_calculates,processed_nodes):
|
|
|
479
479
|
calc_node.label = "save select: " +node.get_name()
|
|
480
480
|
elif node.name != calculate_name:
|
|
481
481
|
calc_id = generate_id(f"autosave{node.id}")
|
|
482
|
-
|
|
483
482
|
calc_node = TriccNodeCalculate(
|
|
484
483
|
name=calculate_name,
|
|
485
484
|
id = calc_id,
|
|
486
485
|
group = node.group,
|
|
487
|
-
version=get_next_version(calculate_name, processed_nodes, node.version+2),
|
|
486
|
+
#version=get_next_version(calculate_name, processed_nodes, node.version+2),
|
|
488
487
|
activity = node.activity,
|
|
489
488
|
label = "save: " +node.get_name(),
|
|
490
489
|
path_len=node.path_len+ 1,
|
|
@@ -965,8 +964,8 @@ def walkthrough_tricc_option(node, callback, processed_nodes, stashed_nodes, pat
|
|
|
965
964
|
warn = warn,
|
|
966
965
|
node_path = node_path.copy(), **kwargs)
|
|
967
966
|
|
|
968
|
-
def get_next_version(name, processed_nodes, version=0,):
|
|
969
|
-
return max(version,
|
|
967
|
+
def get_next_version(name, processed_nodes, version=0, min=100):
|
|
968
|
+
return max(version, min,*[(getattr(n,'version',0) or getattr(n,'instance',0) or 0) for n in get_versions(name, processed_nodes)])
|
|
970
969
|
|
|
971
970
|
|
|
972
971
|
def get_data_for_log(node):
|
|
@@ -7,7 +7,7 @@ tricc_oo/converters/codesystem_to_ocl.py,sha256=-ZKMBeIvzgqmhJfnn6ptuwpnHQtuE-fC
|
|
|
7
7
|
tricc_oo/converters/cql_to_operation.py,sha256=bsVD4HO5Zr2clHuIWz86gIUnI7aZ676IXDK5S7x32_o,14439
|
|
8
8
|
tricc_oo/converters/datadictionnary.py,sha256=WWKcTtKLfc4aduHcDBhr4JSfU2NqRMaslwX-wdZPIAw,3968
|
|
9
9
|
tricc_oo/converters/drawio_type_map.py,sha256=6ZcnQMtBU1dhf_NP_s0iX1DvRf0qS7-3UAe_WAPFVoQ,7027
|
|
10
|
-
tricc_oo/converters/tricc_to_xls_form.py,sha256=
|
|
10
|
+
tricc_oo/converters/tricc_to_xls_form.py,sha256=lfnM-piCH9EyoOT89VDi1eRGUbMWgpzbvDXZgfEYmrM,2326
|
|
11
11
|
tricc_oo/converters/utils.py,sha256=UyndDORsDbRV5-gYW-yInK5ztjtYdeCw6K-mrYr1Emk,1688
|
|
12
12
|
tricc_oo/converters/xml_to_tricc.py,sha256=IO6jL1ljhrkWnPTe5EsQCfJ4wUoYitLH2P7TIJm4A9I,37457
|
|
13
13
|
tricc_oo/converters/cql/cqlLexer.py,sha256=t0-QvDv5kxCiBZJ9SfDumFOgnRSry_HJpakBZV224Ig,49126
|
|
@@ -20,27 +20,27 @@ tricc_oo/models/calculate.py,sha256=Bw7OGa4OYxHP529wA23CZftMYDL_CA0SPQ0j1IFyTNA,
|
|
|
20
20
|
tricc_oo/models/lang.py,sha256=SwKaoxyRhE7gH_ZlYyFXzGuTQ5RE19y47LWAA35zYxg,2338
|
|
21
21
|
tricc_oo/models/ocl.py,sha256=ol35Gl1jCBp0Ven0yxOKzDIZkVL5Kx9uwaR_64pjxKI,8931
|
|
22
22
|
tricc_oo/models/ordered_set.py,sha256=cdvqlWgbwN0Jl7btssEoXbzQJ2rlMzxGILRblMqjRg0,4182
|
|
23
|
-
tricc_oo/models/tricc.py,sha256=
|
|
23
|
+
tricc_oo/models/tricc.py,sha256=32WvBVBShODBlszdXSoCjisd5gpt6CM_TNabJap1Zfs,16509
|
|
24
24
|
tricc_oo/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
tricc_oo/parsers/xml.py,sha256=vq9PA5Zt4G3QMtZ1zgyN8110O1w19Jqt6JClJYhHJlU,4410
|
|
26
26
|
tricc_oo/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
tricc_oo/serializers/planuml.py,sha256=a81YKsjgng-h2H_rmFE2J5FeBBUaH8kRGT8YrvzpEKE,455
|
|
28
|
-
tricc_oo/serializers/xls_form.py,sha256=
|
|
28
|
+
tricc_oo/serializers/xls_form.py,sha256=LSCZV05Uw-SeKsbWRircMRJLLQtfDDxeo4qqqdIoI5Q,22757
|
|
29
29
|
tricc_oo/strategies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
tricc_oo/strategies/input/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
tricc_oo/strategies/input/base_input_strategy.py,sha256=-GQ_xRvJXzn-q_eT8R-wtFOTWzPtdNj79zjmsH6x070,4065
|
|
32
32
|
tricc_oo/strategies/input/drawio.py,sha256=glLts9whixJM4HOV_GAWAK8az_H-eo9aeFAQbn99-4c,13362
|
|
33
33
|
tricc_oo/strategies/output/base_output_strategy.py,sha256=WiJwqm4g_x-rbksrjoE0ABhNMtM0_fAMoPH34RKZdc0,7173
|
|
34
34
|
tricc_oo/strategies/output/spice.py,sha256=s_COahyYCoc4Xv5TGh_AW9evDOW6GOex0Xwa_JWeLsI,11280
|
|
35
|
-
tricc_oo/strategies/output/xls_form.py,sha256=
|
|
35
|
+
tricc_oo/strategies/output/xls_form.py,sha256=DuDmTuM5h3Njo0RBcQQq1dRKr4XMVJJzZtaZdfJ1T6I,31130
|
|
36
36
|
tricc_oo/strategies/output/xlsform_cdss.py,sha256=8oLlgS1Hr6IVvI0O71kIk5oIKXbt2lPVc1SZIjzcSTc,9452
|
|
37
37
|
tricc_oo/strategies/output/xlsform_cht.py,sha256=SWu1GKI5PScSX420RiVVaCNCTINeTeLpCoX-zXQIhUE,19486
|
|
38
38
|
tricc_oo/strategies/output/xlsform_cht_hf.py,sha256=0D_H68a2S7oLKJENEePaRGIocrRIF45BofHlLOtGsKo,2206
|
|
39
39
|
tricc_oo/visitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
tricc_oo/visitors/tricc.py,sha256
|
|
40
|
+
tricc_oo/visitors/tricc.py,sha256=-tWEo2xxVAvQoy53f-2UDIFDhqMxguDBHNQMclg7GHs,97700
|
|
41
41
|
tricc_oo/visitors/utils.py,sha256=Gol4JNozPEd30Q1l8IPIPhx5fqVyy9R81GofGVebgD8,484
|
|
42
42
|
tricc_oo/visitors/xform_pd.py,sha256=H8x-72EdyT_-QgHGQN-ZAe-wc7tLtJGCM9waA64mz3M,9424
|
|
43
|
-
tricc_oo-1.4.
|
|
44
|
-
tricc_oo-1.4.
|
|
45
|
-
tricc_oo-1.4.
|
|
46
|
-
tricc_oo-1.4.
|
|
43
|
+
tricc_oo-1.4.24.dist-info/METADATA,sha256=1TpiMwhrBuSmKEuUHptgc9RiIwPp_pntudZnVFvPcnY,7878
|
|
44
|
+
tricc_oo-1.4.24.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
45
|
+
tricc_oo-1.4.24.dist-info/top_level.txt,sha256=NvbfMNAiy9m4b1unBsqpeOQWh4IgA1Xa33BtKA4abxk,15
|
|
46
|
+
tricc_oo-1.4.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|