tricc-oo 1.4.27__tar.gz → 1.4.28__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.27 → tricc_oo-1.4.28}/PKG-INFO +1 -1
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/pyproject.toml +1 -1
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/base.py +1 -1
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/xls_form.py +2 -2
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/xlsform_cht.py +25 -9
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/visitors/tricc.py +4 -4
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/visitors/xform_pd.py +5 -5
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo.egg-info/PKG-INFO +1 -1
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/README.md +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/setup.cfg +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tests/build.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tests/test_cql.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tests/to_ocl.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/cql/cqlLexer.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/cql/cqlListener.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/cql/cqlParser.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/cql_to_operation.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/datadictionnary.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/drawio_type_map.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/tricc_to_xls_form.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/utils.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/converters/xml_to_tricc.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/calculate.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/lang.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/ocl.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/ordered_set.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/models/tricc.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/parsers/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/parsers/xml.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/serializers/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/serializers/planuml.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/serializers/xls_form.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/input/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/input/drawio.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/spice.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/visitors/__init__.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo/visitors/utils.py +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo.egg-info/SOURCES.txt +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo.egg-info/dependency_links.txt +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo.egg-info/requires.txt +0 -0
- {tricc_oo-1.4.27 → tricc_oo-1.4.28}/tricc_oo.egg-info/top_level.txt +0 -0
|
@@ -226,7 +226,7 @@ class TriccNodeBaseModel(TriccBaseModel):
|
|
|
226
226
|
label: Optional[Union[str, Dict[str,str]]] = None
|
|
227
227
|
next_nodes: OrderedSet[TriccNodeBaseModel] = OrderedSet()
|
|
228
228
|
prev_nodes: OrderedSet[TriccNodeBaseModel] = OrderedSet()
|
|
229
|
-
expression: Optional[Union[Expression, TriccOperation]] = None # will be generated based on the input
|
|
229
|
+
expression: Optional[Union[Expression, TriccOperation, TriccStatic]] = None # will be generated based on the input
|
|
230
230
|
expression_inputs: List[Expression] = []
|
|
231
231
|
activity: Optional[FwTriccNodeBaseModel] = None
|
|
232
232
|
ref_def: Optional[Union[int,str]] = None# for medal creator
|
|
@@ -87,8 +87,8 @@ class XLSFormStrategy(BaseOutPutStrategy):
|
|
|
87
87
|
|
|
88
88
|
def clean_coalesce(self, expression):
|
|
89
89
|
if re.match(r"^coalesce\(\${[^}]+},''\)$", str(expression)):
|
|
90
|
-
return expression[9:-4]
|
|
91
|
-
return expression
|
|
90
|
+
return str(expression[9:-4])
|
|
91
|
+
return str(expression)
|
|
92
92
|
|
|
93
93
|
def generate_base(self, node, **kwargs):
|
|
94
94
|
return self.generate_xls_form_condition(node, **kwargs)
|
|
@@ -7,6 +7,7 @@ import pandas as pd
|
|
|
7
7
|
|
|
8
8
|
from tricc_oo.models.lang import SingletonLangClass
|
|
9
9
|
from tricc_oo.models.calculate import TriccNodeEnd
|
|
10
|
+
from tricc_oo.models.tricc import TriccNodeDisplayModel
|
|
10
11
|
from tricc_oo.serializers.xls_form import SURVEY_MAP, get_input_line, get_input_calc_line
|
|
11
12
|
from tricc_oo.strategies.output.xlsform_cdss import XLSFormCDSSStrategy
|
|
12
13
|
from tricc_oo.converters.tricc_to_xls_form import get_export_name
|
|
@@ -366,6 +367,23 @@ class XLSFormCHTStrategy(XLSFormCDSSStrategy):
|
|
|
366
367
|
#df_summary.loc[len(df_summary)] = [ 'end group', '' ,'', '', '', '', '', '', '', '', '', '', '', '', '','', '' ]
|
|
367
368
|
return df_summary
|
|
368
369
|
|
|
370
|
+
def get_last_prev_index(self, df, e, depth=0):
|
|
371
|
+
latest = None
|
|
372
|
+
for p in e.prev_nodes:
|
|
373
|
+
if issubclass(p.__class__, (TriccNodeDisplayModel)):
|
|
374
|
+
if hasattr(p, 'select'):
|
|
375
|
+
p = latest.select
|
|
376
|
+
index = df.index[df['name'] == get_export_name(p)].tolist()
|
|
377
|
+
|
|
378
|
+
if not latest or ( index and index[-1] > latest) :
|
|
379
|
+
latest = index[-1]
|
|
380
|
+
if latest is None and depth > 5:
|
|
381
|
+
for p in e.prev_nodes:
|
|
382
|
+
index = get_last_prev_index(df, e, depth+1)
|
|
383
|
+
if not latest and index and index > latest :
|
|
384
|
+
latest = index
|
|
385
|
+
return latest
|
|
386
|
+
|
|
369
387
|
def export(self, start_pages, version, **kwargs):
|
|
370
388
|
form_id = None
|
|
371
389
|
if start_pages[self.processes[0]].root.form_id is not None:
|
|
@@ -406,15 +424,13 @@ class XLSFormCHTStrategy(XLSFormCDSSStrategy):
|
|
|
406
424
|
ends_prev = []
|
|
407
425
|
for e in ends:
|
|
408
426
|
|
|
409
|
-
latest =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
latest
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
(int(self.df_survey[self.df_survey.name == latest.export_name].index.values[0]), e,)
|
|
417
|
-
)
|
|
427
|
+
latest = self.get_last_prev_index(self.df_survey, e)
|
|
428
|
+
if latest:
|
|
429
|
+
ends_prev.append(
|
|
430
|
+
(int(latest), e,)
|
|
431
|
+
)
|
|
432
|
+
else:
|
|
433
|
+
logger.critical(f"impossible to get last index before pause: {e.get_name()}")
|
|
418
434
|
forms = [form_id]
|
|
419
435
|
for i, e in ends_prev:
|
|
420
436
|
new_form_id = f"{form_id}_{clean_name(e.name)}"
|
|
@@ -74,13 +74,13 @@ def get_node_expressions(node, processed_nodes, process=None):
|
|
|
74
74
|
expression = get_node_expression(node, processed_nodes=processed_nodes, is_calculate=is_calculate, process=process)
|
|
75
75
|
|
|
76
76
|
if is_calculate:
|
|
77
|
-
if expression and (not isinstance(expression, str) or expression != '') and expression is not True :
|
|
77
|
+
if expression and (not isinstance(expression, str) or expression != '') and expression is not TriccStatic(True) :
|
|
78
78
|
num_expression = TriccOperation(
|
|
79
79
|
TriccOperator.CAST_NUMBER,
|
|
80
80
|
[expression]
|
|
81
81
|
)
|
|
82
|
-
elif expression is True
|
|
83
|
-
expression = TriccStatic(
|
|
82
|
+
elif expression is TriccStatic(True) or (not expression and is_calculate):
|
|
83
|
+
expression = TriccStatic(True)
|
|
84
84
|
else:
|
|
85
85
|
expression = ''
|
|
86
86
|
if (
|
|
@@ -96,7 +96,7 @@ 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,
|
|
99
|
+
last_version = processed_nodes.find_prev(node, version_filter(node_name))
|
|
100
100
|
if last_version and getattr(node, 'process', '') != 'pause':
|
|
101
101
|
# 0-100 for manually specified instance. 100-200 for auto instance
|
|
102
102
|
node.version = get_next_version(node.name, processed_nodes, last_version.version + 1, 0)
|
|
@@ -41,7 +41,8 @@ def make_breakpoints(df, pausepoint, calculate_name=None, replace_dots=False):
|
|
|
41
41
|
raise ValueError("input end field not found in input dataframe")
|
|
42
42
|
end_inputs_loc = df.index[df['name'] == 'input end'][0]
|
|
43
43
|
next_begin_group_loc = min([i for i in df.index[df['type'] == 'begin group'] if i > end_inputs_loc])
|
|
44
|
-
|
|
44
|
+
next_pause_point_begin_group_loc = min([i for i in df.index[df['type'] == 'begin group'] if i > pausepoint])
|
|
45
|
+
|
|
45
46
|
df_input = df.loc[next_begin_group_loc:pausepoint]
|
|
46
47
|
|
|
47
48
|
# Define field types to handle
|
|
@@ -125,9 +126,8 @@ def make_breakpoints(df, pausepoint, calculate_name=None, replace_dots=False):
|
|
|
125
126
|
]).reset_index(drop=True)
|
|
126
127
|
|
|
127
128
|
# Handle post-break section
|
|
128
|
-
df_after = df.loc[
|
|
129
|
-
|
|
130
|
-
df_after = df_after.iloc[1:]
|
|
129
|
+
df_after = df.loc[next_pause_point_begin_group_loc:].reset_index(drop=True)
|
|
130
|
+
|
|
131
131
|
|
|
132
132
|
# Final concatenation
|
|
133
133
|
final_df = pd.concat([df_combined, df_after])
|
|
@@ -216,7 +216,7 @@ function {task_name}ResolveIf(contact, report, event, dueDate) {{
|
|
|
216
216
|
}}
|
|
217
217
|
|
|
218
218
|
function {task_name}AppliesIf(contact, report, event, dueDate) {{
|
|
219
|
-
return report.{calculate_name};
|
|
219
|
+
return report.{calculate_name} === '1';
|
|
220
220
|
}}
|
|
221
221
|
|
|
222
222
|
module.exports = {{
|
|
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
|