tricc-oo 1.5.9__py3-none-any.whl → 1.5.11__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/drawio_type_map.py +1 -1
- tricc_oo/models/calculate.py +1 -2
- tricc_oo/models/tricc.py +1 -0
- tricc_oo/serializers/xls_form.py +2 -2
- tricc_oo/strategies/output/xlsform_cht.py +478 -306
- tricc_oo/visitors/tricc.py +89 -58
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.11.dist-info}/METADATA +1 -1
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.11.dist-info}/RECORD +10 -10
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.11.dist-info}/WHEEL +0 -0
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.11.dist-info}/top_level.txt +0 -0
tricc_oo/visitors/tricc.py
CHANGED
|
@@ -94,6 +94,8 @@ def get_node_expressions(node, processed_nodes, process=None):
|
|
|
94
94
|
return expression
|
|
95
95
|
|
|
96
96
|
def set_last_version_false(node, processed_nodes):
|
|
97
|
+
if isinstance(node, (TriccNodeDiagnosis, TriccNodeSelectOption)):
|
|
98
|
+
return
|
|
97
99
|
node_name = node.name if not isinstance(node, TriccNodeEnd) else node.get_reference()
|
|
98
100
|
#last_version = get_last_version(node_name, processed_nodes) if issubclass(node.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase, TriccNodeEnd)) and not isinstance(node, TriccNodeSelectOption) else None
|
|
99
101
|
last_version = processed_nodes.find_prev(node, version_filter(node_name))
|
|
@@ -191,9 +193,12 @@ def process_calculate(node,processed_nodes, stashed_nodes, calculates, used_calc
|
|
|
191
193
|
):
|
|
192
194
|
if kwargs.get('warn', True):
|
|
193
195
|
logger.debug('Processing relevance for node {0}'.format(node.get_name()))
|
|
196
|
+
# tricc diagnostic have the same name as proposed diag but will be serialised with different names
|
|
197
|
+
|
|
194
198
|
last_version = set_last_version_false(node, processed_nodes)
|
|
195
199
|
if last_version:
|
|
196
200
|
last_version = get_version_inheritance(node, last_version, processed_nodes)
|
|
201
|
+
|
|
197
202
|
generate_calculates(node,calculates, used_calculates,processed_nodes=processed_nodes, process=process)
|
|
198
203
|
|
|
199
204
|
|
|
@@ -809,8 +814,6 @@ def walktrhough_tricc_node_processed_stached(node, callback, processed_nodes, st
|
|
|
809
814
|
# put the stached node from that group first
|
|
810
815
|
# if has next, walkthrough them (support options)
|
|
811
816
|
# if len(stashed_nodes)>1:
|
|
812
|
-
if not recursive:
|
|
813
|
-
reorder_node_list(stashed_nodes, node.group, processed_nodes)
|
|
814
817
|
if isinstance(node, (TriccNodeActivityStart, TriccNodeMainStart)):
|
|
815
818
|
if recursive:
|
|
816
819
|
for gp in node.activity.groups.values():
|
|
@@ -894,6 +897,9 @@ def walktrhough_tricc_node_processed_stached(node, callback, processed_nodes, st
|
|
|
894
897
|
for nn in node.next_nodes:
|
|
895
898
|
if nn not in stashed_nodes:
|
|
896
899
|
stashed_nodes.insert_at_top(nn)
|
|
900
|
+
if not recursive:
|
|
901
|
+
reorder_node_list(stashed_nodes, node.group, processed_nodes)
|
|
902
|
+
|
|
897
903
|
|
|
898
904
|
|
|
899
905
|
else:
|
|
@@ -1269,7 +1275,7 @@ def set_prev_next_node(source_node, target_node, replaced_node=None, edge_only =
|
|
|
1269
1275
|
set_next_node(source_node, target_node, replaced_node, edge_only)
|
|
1270
1276
|
|
|
1271
1277
|
if activity and not any([(e.source == source_id) and ( e.target == target_id) for e in activity.edges]):
|
|
1272
|
-
label = "continue" if issubclass(source_node.__class__,
|
|
1278
|
+
label = "continue" if issubclass(source_node.__class__, TriccNodeSelect) else None
|
|
1273
1279
|
activity.edges.append(TriccEdge(id = generate_id(), source = source_id, target = target_id, value = label))
|
|
1274
1280
|
|
|
1275
1281
|
def remove_prev_next(prev_node, next_node, activity=None):
|
|
@@ -1403,37 +1409,52 @@ def replace_next_node(prev_node,next_node,old_node):
|
|
|
1403
1409
|
for n_p_node in list_nodes:
|
|
1404
1410
|
if n_p_node == old_node :
|
|
1405
1411
|
set_prev_next_node(prev_node, next_node, old_node)
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
priority +=
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
# Priority constants
|
|
1415
|
+
SAME_GROUP_PRIORITY = 7000
|
|
1416
|
+
PARENT_GROUP_PRIORITY = 6000
|
|
1417
|
+
ACTIVE_ACTIVITY_PRIORITY = 5000
|
|
1418
|
+
NON_START_ACTIVITY_PRIORITY = 4000
|
|
1419
|
+
ACTIVE_ACTIVITY_LOWER_PRIORITY = 3000
|
|
1420
|
+
RHOMBUS_PRIORITY = 1000
|
|
1421
|
+
DEFAULT_PRIORITY = 2000
|
|
1422
|
+
|
|
1423
|
+
def reorder_node_list(node_list, group, processed_nodes):
|
|
1424
|
+
# Cache active activities for O(1) lookup
|
|
1425
|
+
active_activities = {n.activity for n in processed_nodes}
|
|
1426
|
+
|
|
1427
|
+
def get_priority(node):
|
|
1428
|
+
# Cache attributes to avoid repeated getattr calls
|
|
1429
|
+
priority = int(getattr(node, "priority", 0) or 0)
|
|
1430
|
+
node_group = getattr(node, "group", None)
|
|
1431
|
+
activity = getattr(node, "activity", None)
|
|
1432
|
+
|
|
1433
|
+
# Check for same group
|
|
1434
|
+
if group is not None and node_group and node_group.id == group.id:
|
|
1435
|
+
priority += SAME_GROUP_PRIORITY
|
|
1436
|
+
# Check for parent group
|
|
1437
|
+
elif hasattr(group, "group") and group.group and node_group and node_group.id == group.group.id:
|
|
1438
|
+
priority += PARENT_GROUP_PRIORITY
|
|
1439
|
+
# Check for active activities (not main)
|
|
1440
|
+
elif activity and isinstance(activity.root, TriccNodeActivityStart) and activity in active_activities:
|
|
1441
|
+
priority += ACTIVE_ACTIVITY_PRIORITY
|
|
1442
|
+
# Check for non main activities
|
|
1443
|
+
elif activity and isinstance(activity.root, TriccNodeActivityStart):
|
|
1444
|
+
priority += NON_START_ACTIVITY_PRIORITY
|
|
1445
|
+
# Check for active activities (lower priority)
|
|
1446
|
+
elif activity and activity in active_activities:
|
|
1447
|
+
priority += ACTIVE_ACTIVITY_LOWER_PRIORITY
|
|
1448
|
+
# Check for rhombus nodes
|
|
1449
|
+
elif issubclass(node.__class__, TriccRhombusMixIn):
|
|
1450
|
+
priority += RHOMBUS_PRIORITY
|
|
1430
1451
|
else:
|
|
1431
|
-
priority +=
|
|
1452
|
+
priority += DEFAULT_PRIORITY
|
|
1453
|
+
|
|
1432
1454
|
return priority
|
|
1433
|
-
|
|
1434
|
-
# Sort
|
|
1435
|
-
|
|
1436
|
-
return None
|
|
1455
|
+
|
|
1456
|
+
# Sort in place, highest priority first
|
|
1457
|
+
node_list.sort(key=get_priority, reverse=True)
|
|
1437
1458
|
|
|
1438
1459
|
def loop_info(loop, **kwargs):
|
|
1439
1460
|
logger.critical("dependency details")
|
|
@@ -1677,7 +1698,7 @@ def export_proposed_diags(activity, diags=None, **kwargs):
|
|
|
1677
1698
|
return diags
|
|
1678
1699
|
|
|
1679
1700
|
|
|
1680
|
-
def get_accept_diagnostic_node(code, display, severity, activity):
|
|
1701
|
+
def get_accept_diagnostic_node(code, display, severity, priority, activity):
|
|
1681
1702
|
node = TriccNodeAcceptDiagnostic(
|
|
1682
1703
|
id=generate_id("pre_final." + code),
|
|
1683
1704
|
name="pre_final." + code,
|
|
@@ -1685,24 +1706,28 @@ def get_accept_diagnostic_node(code, display, severity, activity):
|
|
|
1685
1706
|
list_name="acc_rej",
|
|
1686
1707
|
activity=activity,
|
|
1687
1708
|
group=activity,
|
|
1688
|
-
severity=severity
|
|
1709
|
+
severity=severity,
|
|
1710
|
+
priority=priority
|
|
1689
1711
|
)
|
|
1690
1712
|
node.options = get_select_accept_reject_options(node, node.activity)
|
|
1691
1713
|
return node
|
|
1692
1714
|
|
|
1693
1715
|
def get_diagnostic_node(code, display, severity, priority, activity):
|
|
1694
|
-
node =
|
|
1716
|
+
node = TriccNodeCalculate(
|
|
1695
1717
|
id=generate_id("final." + code),
|
|
1696
1718
|
name="final." + code,
|
|
1697
1719
|
label=display,
|
|
1698
|
-
list_name="acc_rej",
|
|
1699
1720
|
activity=activity,
|
|
1700
1721
|
group=activity,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1722
|
+
priority=priority,
|
|
1723
|
+
expression_reference=or_join([
|
|
1724
|
+
TriccOperation(TriccOperator.ISTRUE, [TriccReference("pre_final." + code)]),
|
|
1725
|
+
TriccOperation(
|
|
1726
|
+
TriccOperator.SELECTED,
|
|
1727
|
+
[TriccReference('tricc.manual.diag'), TriccStatic(code)]
|
|
1728
|
+
)
|
|
1729
|
+
])
|
|
1704
1730
|
)
|
|
1705
|
-
node.options = get_select_accept_reject_options(node, node.activity)
|
|
1706
1731
|
return node
|
|
1707
1732
|
|
|
1708
1733
|
def get_select_accept_reject_options(node, group):
|
|
@@ -1743,7 +1768,6 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1743
1768
|
start.activity = activity
|
|
1744
1769
|
start.group = activity
|
|
1745
1770
|
diags_conf = []
|
|
1746
|
-
r_diags_conf = []
|
|
1747
1771
|
end = TriccNodeActivityEnd(
|
|
1748
1772
|
id=generate_id("end.determine-diagnosis"),
|
|
1749
1773
|
name="end.determine-diagnosis",
|
|
@@ -1751,10 +1775,23 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1751
1775
|
group=activity,
|
|
1752
1776
|
)
|
|
1753
1777
|
activity.nodes[end.id]=end
|
|
1778
|
+
|
|
1779
|
+
f = TriccNodeSelectMultiple(
|
|
1780
|
+
name="tricc.manual.diag",
|
|
1781
|
+
label="Add diagnosis",
|
|
1782
|
+
list_name='manual_diag',
|
|
1783
|
+
id=generate_id("tricc.manual.diag"),
|
|
1784
|
+
activity=activity,
|
|
1785
|
+
group=activity,
|
|
1786
|
+
required=TriccStatic(False),
|
|
1787
|
+
|
|
1788
|
+
)
|
|
1754
1789
|
for proposed in diags:
|
|
1755
|
-
d =
|
|
1790
|
+
d = get_accept_diagnostic_node(proposed.name, proposed.label, proposed.severity, proposed.priority, activity)
|
|
1791
|
+
c = get_diagnostic_node(proposed.name, proposed.label, proposed.severity, proposed.priority, activity)
|
|
1756
1792
|
diags_conf.append(d)
|
|
1757
1793
|
r = TriccNodeRhombus(
|
|
1794
|
+
path=start,
|
|
1758
1795
|
id=generate_id(f"proposed-rhombus{proposed.id}"),
|
|
1759
1796
|
expression_reference=TriccOperation(
|
|
1760
1797
|
TriccOperator.ISTRUE,
|
|
@@ -1762,26 +1799,22 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1762
1799
|
),
|
|
1763
1800
|
reference=[TriccReference(proposed.name)],
|
|
1764
1801
|
activity=activity,
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1802
|
+
priority=proposed.priority,
|
|
1803
|
+
group=activity)
|
|
1804
|
+
activity.calculates.append(r)
|
|
1805
|
+
activity.calculates.append(c)
|
|
1768
1806
|
set_prev_next_node(r, d, edge_only=False)
|
|
1769
1807
|
set_prev_next_node(d, end, edge_only=False)
|
|
1808
|
+
wait2 = get_activity_wait([activity.root], diags_conf, [f], edge_only=False)
|
|
1770
1809
|
activity.nodes[d.options[0].id] = d.options[0]
|
|
1771
1810
|
activity.nodes[d.options[1].id] = d.options[1]
|
|
1772
1811
|
activity.nodes[d.id]=d
|
|
1773
1812
|
activity.nodes[r.id]=r
|
|
1813
|
+
activity.nodes[c.id]=c
|
|
1814
|
+
activity.nodes[f.id]=f
|
|
1815
|
+
activity.nodes[wait2.id]=wait2
|
|
1774
1816
|
# fallback
|
|
1775
|
-
|
|
1776
|
-
name="tricc.manual.diag",
|
|
1777
|
-
label="Add diagnosis",
|
|
1778
|
-
list_name='manual_diag',
|
|
1779
|
-
id=generate_id("tricc.manual.diag"),
|
|
1780
|
-
activity=activity,
|
|
1781
|
-
group=activity,
|
|
1782
|
-
required=TriccStatic(False),
|
|
1783
|
-
|
|
1784
|
-
)
|
|
1817
|
+
|
|
1785
1818
|
options = [
|
|
1786
1819
|
TriccNodeSelectOption(
|
|
1787
1820
|
id=generate_id(d.name),
|
|
@@ -1793,10 +1826,8 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1793
1826
|
) for d in diags
|
|
1794
1827
|
]
|
|
1795
1828
|
f.options=dict(zip(range(0, len(options)), options))
|
|
1796
|
-
wait2 = get_activity_wait([activity.root], diags_conf, [f], edge_only=False)
|
|
1797
|
-
activity.nodes[wait2.id]=wait2
|
|
1798
1829
|
activity.nodes[f.id]=f
|
|
1799
|
-
|
|
1830
|
+
set_prev_next_node(f, end, edge_only=False)
|
|
1800
1831
|
|
|
1801
1832
|
return activity
|
|
1802
1833
|
|
|
@@ -6,7 +6,7 @@ tricc_oo/converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
6
6
|
tricc_oo/converters/codesystem_to_ocl.py,sha256=-ZKMBeIvzgqmhJfnn6ptuwpnHQtuE-fCDDfKpfGvUSU,6066
|
|
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
|
-
tricc_oo/converters/drawio_type_map.py,sha256=
|
|
9
|
+
tricc_oo/converters/drawio_type_map.py,sha256=VsiKJuAcM_kaSacxZgMaMEfEMVwVAbJjxrRj4TDMIxc,7254
|
|
10
10
|
tricc_oo/converters/tricc_to_xls_form.py,sha256=bJVd-FLrivrCxGI6mO2i0V7GVVuJZdaDuwcEf3gHNR8,2327
|
|
11
11
|
tricc_oo/converters/utils.py,sha256=UyndDORsDbRV5-gYW-yInK5ztjtYdeCw6K-mrYr1Emk,1688
|
|
12
12
|
tricc_oo/converters/xml_to_tricc.py,sha256=pJpDLAsDX9dAhmviR6AtZRnPPlK6ajmPBoSp7TfAlhs,37117
|
|
@@ -16,16 +16,16 @@ tricc_oo/converters/cql/cqlParser.py,sha256=hIUdR907WX24P2Jlrxk-H0IT94n51yh_ZsCm
|
|
|
16
16
|
tricc_oo/converters/cql/cqlVisitor.py,sha256=SWSDIqVYBhucR4VgLn_EPNs7LV9yCqsOmzFZ0bmRSGc,33865
|
|
17
17
|
tricc_oo/models/__init__.py,sha256=Rdk1fsNXHrbmXTQD1O7i0NC_A6os648Ap6CtWRliOg8,92
|
|
18
18
|
tricc_oo/models/base.py,sha256=mqeAnC1mfZkdEm49dFiYoGImC5CWHG2Rl7frG1pE8sk,24547
|
|
19
|
-
tricc_oo/models/calculate.py,sha256=
|
|
19
|
+
tricc_oo/models/calculate.py,sha256=sHuUEFc88yUZMtYWIG09wNOiOsbemj8wEoulVPXwcys,7486
|
|
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=wbbmppjgKy0xcKD9kIAbT4kgNkuwTILPxRw_KAAoPEY,4178
|
|
23
|
-
tricc_oo/models/tricc.py,sha256=
|
|
23
|
+
tricc_oo/models/tricc.py,sha256=sds17Ea4Hj-tibtI_DYKkqrN8QSCvo98L09SovcsL84,16669
|
|
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=p1nNFMBHretUc2z773DBUatSNjrCLL8FHi3BYP6Di1s,22784
|
|
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
|
|
@@ -34,13 +34,13 @@ tricc_oo/strategies/output/base_output_strategy.py,sha256=WiJwqm4g_x-rbksrjoE0AB
|
|
|
34
34
|
tricc_oo/strategies/output/spice.py,sha256=s_COahyYCoc4Xv5TGh_AW9evDOW6GOex0Xwa_JWeLsI,11280
|
|
35
35
|
tricc_oo/strategies/output/xls_form.py,sha256=1jNkF8qZXonDh-aOKpVN7HEBrRufKn_7ECvpNnQC73g,31037
|
|
36
36
|
tricc_oo/strategies/output/xlsform_cdss.py,sha256=8oLlgS1Hr6IVvI0O71kIk5oIKXbt2lPVc1SZIjzcSTc,9452
|
|
37
|
-
tricc_oo/strategies/output/xlsform_cht.py,sha256=
|
|
37
|
+
tricc_oo/strategies/output/xlsform_cht.py,sha256=YCL7gQlq9CU1GQxPSy5C8fYfPTI1XDPx9G9sr2RZFWM,22359
|
|
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=jJd_yNWsnums4rRA5acVVPRUCmuowsY1xxlpenhLY0U,99799
|
|
41
41
|
tricc_oo/visitors/utils.py,sha256=Gol4JNozPEd30Q1l8IPIPhx5fqVyy9R81GofGVebgD8,484
|
|
42
42
|
tricc_oo/visitors/xform_pd.py,sha256=jgjBLbfElVdi0NmClhw6NK6qNcIgWYm4KMXfVwiQwXM,9705
|
|
43
|
-
tricc_oo-1.5.
|
|
44
|
-
tricc_oo-1.5.
|
|
45
|
-
tricc_oo-1.5.
|
|
46
|
-
tricc_oo-1.5.
|
|
43
|
+
tricc_oo-1.5.11.dist-info/METADATA,sha256=iHk1h8ukZJJ1_qpP1O5jmYiDRSk3l4eeVUuICpWH1jE,7878
|
|
44
|
+
tricc_oo-1.5.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
45
|
+
tricc_oo-1.5.11.dist-info/top_level.txt,sha256=NvbfMNAiy9m4b1unBsqpeOQWh4IgA1Xa33BtKA4abxk,15
|
|
46
|
+
tricc_oo-1.5.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|