tricc-oo 1.4.8__tar.gz → 1.4.10__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.8 → tricc_oo-1.4.10}/PKG-INFO +1 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/pyproject.toml +1 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/utils.py +21 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/xml_to_tricc.py +5 -4
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/base.py +3 -3
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/calculate.py +1 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/tricc.py +1 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/input/base_input_strategy.py +2 -2
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/visitors/tricc.py +16 -16
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo.egg-info/PKG-INFO +1 -1
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/LICENSE +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/README.md +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/setup.cfg +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tests/build.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tests/test_cql.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tests/to_ocl.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/cql/cqlLexer.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/cql/cqlListener.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/cql/cqlParser.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/cql_to_operation.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/datadictionnary.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/drawio_type_map.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/converters/tricc_to_xls_form.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/lang.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/ocl.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/models/ordered_set.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/parsers/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/parsers/xml.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/serializers/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/serializers/planuml.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/serializers/xls_form.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/input/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/input/drawio.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/spice.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/xls_form.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/visitors/__init__.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo/visitors/xform_pd.py +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo.egg-info/SOURCES.txt +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo.egg-info/dependency_links.txt +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo.egg-info/requires.txt +0 -0
- {tricc_oo-1.4.8 → tricc_oo-1.4.10}/tricc_oo.egg-info/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import re
|
|
2
3
|
import random
|
|
3
4
|
import string
|
|
4
5
|
import hashlib
|
|
@@ -48,5 +49,24 @@ def get_rand_name(name=None, length=8):
|
|
|
48
49
|
|
|
49
50
|
# the soup.text strips off the html formatting also
|
|
50
51
|
def remove_html(string):
|
|
51
|
-
|
|
52
|
+
placeholders = {}
|
|
53
|
+
|
|
54
|
+
def replace_placeholders(match):
|
|
55
|
+
key = f"__PLACEHOLDER_{len(placeholders)}__"
|
|
56
|
+
placeholders[key] = match.group(0)
|
|
57
|
+
return key
|
|
58
|
+
|
|
59
|
+
protected_text = re.sub(r"\${.*?\}", replace_placeholders, string)
|
|
60
|
+
|
|
61
|
+
text = md(
|
|
62
|
+
protected_text,
|
|
63
|
+
strip=["img", "table", "a"],
|
|
64
|
+
strong_em_symbol="*",
|
|
65
|
+
escape_underscores=False,
|
|
66
|
+
escape_asterisks=False,
|
|
67
|
+
bullets=["-", "*"],
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
for key, original in placeholders.items():
|
|
71
|
+
text = text.replace(key, original)
|
|
52
72
|
return text
|
|
@@ -186,7 +186,7 @@ def process_edges(diagram, media_path, activity, nodes):
|
|
|
186
186
|
if image is not None:
|
|
187
187
|
images.append({"file_path": enriched, "image_content": image})
|
|
188
188
|
|
|
189
|
-
elif isinstance(nodes[edge.target], (TriccNodeActivityEnd, TriccNodeEnd)):
|
|
189
|
+
elif isinstance(nodes[edge.target], (TriccNodeActivityEnd)) or (isinstance(nodes[edge.target], (TriccNodeEnd)) and isinstance(activity.root, TriccNodeMainStart )):
|
|
190
190
|
end_found = True
|
|
191
191
|
if (
|
|
192
192
|
edge.target in nodes
|
|
@@ -240,7 +240,7 @@ def process_edges(diagram, media_path, activity, nodes):
|
|
|
240
240
|
)
|
|
241
241
|
)
|
|
242
242
|
if not end_found:
|
|
243
|
-
fake_end = TriccNodeActivityEnd(id=generate_id(), activity=activity, group=activity)
|
|
243
|
+
fake_end = TriccNodeActivityEnd(id=generate_id(f"e{activity.name}"), activity=activity, group=activity)
|
|
244
244
|
last_nodes = [
|
|
245
245
|
n for n in list(activity.nodes.values())
|
|
246
246
|
if (
|
|
@@ -490,8 +490,9 @@ def get_max_named_version(calculates, name):
|
|
|
490
490
|
|
|
491
491
|
|
|
492
492
|
def inject_bridge_path(node, nodes):
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
calc_name = "p" + node.id
|
|
494
|
+
calc_id = generate_id(calc_name)
|
|
495
|
+
|
|
495
496
|
data = {
|
|
496
497
|
"id": calc_id,
|
|
497
498
|
"group": node.group,
|
|
@@ -116,7 +116,7 @@ class TriccBaseModel(BaseModel):
|
|
|
116
116
|
def make_instance(self, nb_instance, **kwargs):
|
|
117
117
|
instance = self.copy()
|
|
118
118
|
# change the id to avoid collision of name
|
|
119
|
-
instance.id = generate_id()
|
|
119
|
+
instance.id = generate_id(f"{self.id}{nb_instance}")
|
|
120
120
|
instance.instance = int(nb_instance)
|
|
121
121
|
instance.base_instance = self
|
|
122
122
|
|
|
@@ -149,7 +149,7 @@ class TriccBaseModel(BaseModel):
|
|
|
149
149
|
|
|
150
150
|
def __init__(self, **data):
|
|
151
151
|
if 'id' not in data:
|
|
152
|
-
data['id'] = generate_id()
|
|
152
|
+
data['id'] = generate_id(str(data))
|
|
153
153
|
super().__init__(**data)
|
|
154
154
|
|
|
155
155
|
|
|
@@ -181,7 +181,7 @@ class TriccGroup(TriccBaseModel):
|
|
|
181
181
|
def __init__(self, **data):
|
|
182
182
|
super().__init__(**data)
|
|
183
183
|
if self.name is None:
|
|
184
|
-
self.name = generate_id()
|
|
184
|
+
self.name = generate_id(str(data))
|
|
185
185
|
|
|
186
186
|
def get_name(self):
|
|
187
187
|
result = str(super().get_name())
|
|
@@ -224,7 +224,7 @@ class TriccNodeActivity(TriccNodeBaseModel):
|
|
|
224
224
|
TriccNodeEnd,
|
|
225
225
|
TriccNodeActivityEnd,
|
|
226
226
|
)
|
|
227
|
-
return list(filter(lambda x:
|
|
227
|
+
return list(filter(lambda x: isinstance(x, (TriccNodeActivityEnd)) or (isinstance(x, (TriccNodeEnd)) and isinstance(self.root, TriccNodeMainStart )), self.nodes.values()))
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
|
|
@@ -53,14 +53,14 @@ class BaseInputStrategy:
|
|
|
53
53
|
project.start_pages['determine-diagnosis'] = diags_activity
|
|
54
54
|
root_process = sorted_pages[list(sorted_pages.keys())[0]][0].root
|
|
55
55
|
root = TriccNodeMainStart(
|
|
56
|
-
id=generate_id(),
|
|
56
|
+
id=generate_id('s-determine-diagnosis'),
|
|
57
57
|
form_id=root_process.form_id,
|
|
58
58
|
label=root_process.label
|
|
59
59
|
)
|
|
60
60
|
nodes = {}
|
|
61
61
|
nodes[root.id] = root
|
|
62
62
|
app = TriccNodeActivity(
|
|
63
|
-
id=generate_id(),
|
|
63
|
+
id=generate_id('a-determine-diagnosis'),
|
|
64
64
|
name=root_process.name,
|
|
65
65
|
root=root,
|
|
66
66
|
nodes=nodes
|
|
@@ -162,7 +162,7 @@ def process_calculate(node,processed_nodes, stashed_nodes, calculates, used_calc
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
calc = TriccNodeCalculate(
|
|
165
|
-
id=generate_id(),
|
|
165
|
+
id=generate_id(f"save{node.id}"),
|
|
166
166
|
name=node.name,
|
|
167
167
|
path_len=node.path_len+1,
|
|
168
168
|
version=last_version.version + 2,
|
|
@@ -304,7 +304,7 @@ def get_max_named_version(calculates,name):
|
|
|
304
304
|
return max
|
|
305
305
|
|
|
306
306
|
def get_count_node(node):
|
|
307
|
-
count_id = generate_id()
|
|
307
|
+
count_id = generate_id(f"count{node.id}")
|
|
308
308
|
count_name = "cnt_"+count_id
|
|
309
309
|
return TriccNodeCount(
|
|
310
310
|
id = count_id,
|
|
@@ -331,7 +331,7 @@ def get_activity_wait(prev_nodes, nodes_to_wait, next_nodes, replaced_node = Non
|
|
|
331
331
|
|
|
332
332
|
activity = activity or prev_node.activity
|
|
333
333
|
calc_node = TriccNodeWait(
|
|
334
|
-
id =
|
|
334
|
+
id = generate_id(f"ar{''.join([x.id for x in nodes_to_wait])}{activity.id}"),
|
|
335
335
|
reference = nodes_to_wait,
|
|
336
336
|
activity = activity,
|
|
337
337
|
group = activity,
|
|
@@ -359,7 +359,7 @@ def get_bridge_path(prev_nodes, node=None,edge_only=False):
|
|
|
359
359
|
p_p_node = next(iterator)
|
|
360
360
|
if node is None:
|
|
361
361
|
node = p_p_node
|
|
362
|
-
calc_id = generate_id()
|
|
362
|
+
calc_id = generate_id(f"br{''.join([x.id for x in prev_nodes])}{node.id}")
|
|
363
363
|
calc_name = "path_"+calc_id
|
|
364
364
|
data = {
|
|
365
365
|
'id': calc_id,
|
|
@@ -478,7 +478,7 @@ def generate_calculates(node,calculates, used_calculates,processed_nodes):
|
|
|
478
478
|
calc_node.name=calculate_name
|
|
479
479
|
calc_node.label = "save select: " +node.get_name()
|
|
480
480
|
else:
|
|
481
|
-
calc_id = generate_id()
|
|
481
|
+
calc_id = generate_id(f"autosave{node.id}")
|
|
482
482
|
calc_node = TriccNodeCalculate(
|
|
483
483
|
name=calculate_name,
|
|
484
484
|
id = calc_id,
|
|
@@ -735,7 +735,7 @@ def add_used_calculate(node, prev_node, calculates, used_calculates, processed_n
|
|
|
735
735
|
|
|
736
736
|
def get_select_not_available_options(node,group,label):
|
|
737
737
|
return {0:TriccNodeSelectOption(
|
|
738
|
-
id = generate_id(),
|
|
738
|
+
id = generate_id(f"notavaialble{node.id}"),
|
|
739
739
|
name="1",
|
|
740
740
|
label=label,
|
|
741
741
|
select = node,
|
|
@@ -745,7 +745,7 @@ def get_select_not_available_options(node,group,label):
|
|
|
745
745
|
|
|
746
746
|
def get_select_yes_no_options(node, group):
|
|
747
747
|
yes = TriccNodeSelectOption(
|
|
748
|
-
id = generate_id(),
|
|
748
|
+
id = generate_id(f'yes{node.id}'),
|
|
749
749
|
name=f"{TRICC_TRUE_VALUE}",
|
|
750
750
|
label="Yes",
|
|
751
751
|
select = node,
|
|
@@ -753,7 +753,7 @@ def get_select_yes_no_options(node, group):
|
|
|
753
753
|
list_name = node.list_name
|
|
754
754
|
)
|
|
755
755
|
no = TriccNodeSelectOption(
|
|
756
|
-
id = generate_id(),
|
|
756
|
+
id = generate_id(f'no{node.id}'),
|
|
757
757
|
name=f"{TRICC_FALSE_VALUE}",
|
|
758
758
|
label="No",
|
|
759
759
|
select = node,
|
|
@@ -1584,7 +1584,7 @@ def export_proposed_diags(activity, diags=None, **kwargs):
|
|
|
1584
1584
|
|
|
1585
1585
|
def get_accept_diagnostic_node(code, display, severity, activity):
|
|
1586
1586
|
node = TriccNodeAcceptDiagnostic(
|
|
1587
|
-
id=generate_id(),
|
|
1587
|
+
id=generate_id("pre_final." + code),
|
|
1588
1588
|
name="pre_final." + code,
|
|
1589
1589
|
label=display,
|
|
1590
1590
|
list_name="acc_rej",
|
|
@@ -1597,7 +1597,7 @@ def get_accept_diagnostic_node(code, display, severity, activity):
|
|
|
1597
1597
|
|
|
1598
1598
|
def get_diagnostic_node(code, display, severity, activity):
|
|
1599
1599
|
node = TriccNodeAcceptDiagnostic(
|
|
1600
|
-
id=generate_id(),
|
|
1600
|
+
id=generate_id("final." + code),
|
|
1601
1601
|
name="final." + code,
|
|
1602
1602
|
label=display,
|
|
1603
1603
|
list_name="acc_rej",
|
|
@@ -1610,7 +1610,7 @@ def get_diagnostic_node(code, display, severity, activity):
|
|
|
1610
1610
|
|
|
1611
1611
|
def get_select_accept_reject_options(node, group):
|
|
1612
1612
|
yes = TriccNodeSelectOption(
|
|
1613
|
-
id = generate_id(),
|
|
1613
|
+
id = generate_id(f'accept{node.id}'),
|
|
1614
1614
|
name=f"{TRICC_TRUE_VALUE}",
|
|
1615
1615
|
label="Accept",
|
|
1616
1616
|
select = node,
|
|
@@ -1618,7 +1618,7 @@ def get_select_accept_reject_options(node, group):
|
|
|
1618
1618
|
list_name = node.list_name
|
|
1619
1619
|
)
|
|
1620
1620
|
no = TriccNodeSelectOption(
|
|
1621
|
-
id = generate_id(),
|
|
1621
|
+
id = generate_id(f'reject{node.id}'),
|
|
1622
1622
|
name=f"{TRICC_FALSE_VALUE}",
|
|
1623
1623
|
label="Reject",
|
|
1624
1624
|
select = node,
|
|
@@ -1629,13 +1629,13 @@ def get_select_accept_reject_options(node, group):
|
|
|
1629
1629
|
|
|
1630
1630
|
def create_determine_diagnosis_activity(diags):
|
|
1631
1631
|
start = TriccNodeActivityStart(
|
|
1632
|
-
id=generate_id(),
|
|
1632
|
+
id=generate_id('start.determine-diagnosis'),
|
|
1633
1633
|
name="start.determine-diagnosis"
|
|
1634
1634
|
)
|
|
1635
1635
|
|
|
1636
1636
|
|
|
1637
1637
|
activity = TriccNodeActivity(
|
|
1638
|
-
id=generate_id(),
|
|
1638
|
+
id=generate_id('activity-determine-diagnosis'),
|
|
1639
1639
|
name='determine-diagnosis',
|
|
1640
1640
|
label='Diagnosis',
|
|
1641
1641
|
root=start,
|
|
@@ -1647,7 +1647,7 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1647
1647
|
diags_conf = []
|
|
1648
1648
|
r_diags_conf = []
|
|
1649
1649
|
end = TriccNodeActivityEnd(
|
|
1650
|
-
id=generate_id(),
|
|
1650
|
+
id=generate_id("end.determine-diagnosis"),
|
|
1651
1651
|
name="end.determine-diagnosis",
|
|
1652
1652
|
activity=activity,
|
|
1653
1653
|
group=activity,
|
|
@@ -1657,7 +1657,7 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1657
1657
|
d = get_diagnostic_node(proposed.name, proposed.label, proposed.severity, activity)
|
|
1658
1658
|
diags_conf.append(d)
|
|
1659
1659
|
r = TriccNodeRhombus(
|
|
1660
|
-
id=generate_id(),
|
|
1660
|
+
id=generate_id(f"proposed-rhombus{proposed.id}"),
|
|
1661
1661
|
expression_reference=TriccOperation(
|
|
1662
1662
|
TriccOperator.ISTRUE,
|
|
1663
1663
|
[TriccReference(proposed.name)]
|
|
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
|