tricc-oo 1.5.9__py3-none-any.whl → 1.5.10__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 +81 -58
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.10.dist-info}/METADATA +1 -1
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.10.dist-info}/RECORD +10 -10
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.10.dist-info}/WHEEL +0 -0
- {tricc_oo-1.5.9.dist-info → tricc_oo-1.5.10.dist-info}/top_level.txt +0 -0
tricc_oo/visitors/tricc.py
CHANGED
|
@@ -809,8 +809,6 @@ def walktrhough_tricc_node_processed_stached(node, callback, processed_nodes, st
|
|
|
809
809
|
# put the stached node from that group first
|
|
810
810
|
# if has next, walkthrough them (support options)
|
|
811
811
|
# if len(stashed_nodes)>1:
|
|
812
|
-
if not recursive:
|
|
813
|
-
reorder_node_list(stashed_nodes, node.group, processed_nodes)
|
|
814
812
|
if isinstance(node, (TriccNodeActivityStart, TriccNodeMainStart)):
|
|
815
813
|
if recursive:
|
|
816
814
|
for gp in node.activity.groups.values():
|
|
@@ -894,6 +892,9 @@ def walktrhough_tricc_node_processed_stached(node, callback, processed_nodes, st
|
|
|
894
892
|
for nn in node.next_nodes:
|
|
895
893
|
if nn not in stashed_nodes:
|
|
896
894
|
stashed_nodes.insert_at_top(nn)
|
|
895
|
+
if not recursive:
|
|
896
|
+
reorder_node_list(stashed_nodes, node.group, processed_nodes)
|
|
897
|
+
|
|
897
898
|
|
|
898
899
|
|
|
899
900
|
else:
|
|
@@ -1403,37 +1404,52 @@ def replace_next_node(prev_node,next_node,old_node):
|
|
|
1403
1404
|
for n_p_node in list_nodes:
|
|
1404
1405
|
if n_p_node == old_node :
|
|
1405
1406
|
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 +=
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
# Priority constants
|
|
1410
|
+
SAME_GROUP_PRIORITY = 7000
|
|
1411
|
+
PARENT_GROUP_PRIORITY = 6000
|
|
1412
|
+
ACTIVE_ACTIVITY_PRIORITY = 5000
|
|
1413
|
+
NON_START_ACTIVITY_PRIORITY = 4000
|
|
1414
|
+
ACTIVE_ACTIVITY_LOWER_PRIORITY = 3000
|
|
1415
|
+
RHOMBUS_PRIORITY = 1000
|
|
1416
|
+
DEFAULT_PRIORITY = 2000
|
|
1417
|
+
|
|
1418
|
+
def reorder_node_list(node_list, group, processed_nodes):
|
|
1419
|
+
# Cache active activities for O(1) lookup
|
|
1420
|
+
active_activities = {n.activity for n in processed_nodes}
|
|
1421
|
+
|
|
1422
|
+
def get_priority(node):
|
|
1423
|
+
# Cache attributes to avoid repeated getattr calls
|
|
1424
|
+
priority = int(getattr(node, "priority", 0) or 0)
|
|
1425
|
+
node_group = getattr(node, "group", None)
|
|
1426
|
+
activity = getattr(node, "activity", None)
|
|
1427
|
+
|
|
1428
|
+
# Check for same group
|
|
1429
|
+
if group is not None and node_group and node_group.id == group.id:
|
|
1430
|
+
priority += SAME_GROUP_PRIORITY
|
|
1431
|
+
# Check for parent group
|
|
1432
|
+
elif hasattr(group, "group") and group.group and node_group and node_group.id == group.group.id:
|
|
1433
|
+
priority += PARENT_GROUP_PRIORITY
|
|
1434
|
+
# Check for active activities (not start nodes)
|
|
1435
|
+
elif activity and not isinstance(activity.root, TriccNodeActivityStart) and activity in active_activities:
|
|
1436
|
+
priority += ACTIVE_ACTIVITY_PRIORITY
|
|
1437
|
+
# Check for non-start activities
|
|
1438
|
+
elif activity and not isinstance(activity.root, TriccNodeActivityStart):
|
|
1439
|
+
priority += NON_START_ACTIVITY_PRIORITY
|
|
1440
|
+
# Check for active activities (lower priority)
|
|
1441
|
+
elif activity and activity in active_activities:
|
|
1442
|
+
priority += ACTIVE_ACTIVITY_LOWER_PRIORITY
|
|
1443
|
+
# Check for rhombus nodes
|
|
1444
|
+
elif issubclass(node.__class__, TriccRhombusMixIn):
|
|
1445
|
+
priority += RHOMBUS_PRIORITY
|
|
1430
1446
|
else:
|
|
1431
|
-
priority +=
|
|
1447
|
+
priority += DEFAULT_PRIORITY
|
|
1448
|
+
|
|
1432
1449
|
return priority
|
|
1433
|
-
|
|
1434
|
-
# Sort
|
|
1435
|
-
|
|
1436
|
-
return None
|
|
1450
|
+
|
|
1451
|
+
# Sort in place, highest priority first
|
|
1452
|
+
node_list.sort(key=get_priority, reverse=True)
|
|
1437
1453
|
|
|
1438
1454
|
def loop_info(loop, **kwargs):
|
|
1439
1455
|
logger.critical("dependency details")
|
|
@@ -1677,7 +1693,7 @@ def export_proposed_diags(activity, diags=None, **kwargs):
|
|
|
1677
1693
|
return diags
|
|
1678
1694
|
|
|
1679
1695
|
|
|
1680
|
-
def get_accept_diagnostic_node(code, display, severity, activity):
|
|
1696
|
+
def get_accept_diagnostic_node(code, display, severity, priority, activity):
|
|
1681
1697
|
node = TriccNodeAcceptDiagnostic(
|
|
1682
1698
|
id=generate_id("pre_final." + code),
|
|
1683
1699
|
name="pre_final." + code,
|
|
@@ -1685,24 +1701,28 @@ def get_accept_diagnostic_node(code, display, severity, activity):
|
|
|
1685
1701
|
list_name="acc_rej",
|
|
1686
1702
|
activity=activity,
|
|
1687
1703
|
group=activity,
|
|
1688
|
-
severity=severity
|
|
1704
|
+
severity=severity,
|
|
1705
|
+
priority=priority
|
|
1689
1706
|
)
|
|
1690
1707
|
node.options = get_select_accept_reject_options(node, node.activity)
|
|
1691
1708
|
return node
|
|
1692
1709
|
|
|
1693
1710
|
def get_diagnostic_node(code, display, severity, priority, activity):
|
|
1694
|
-
node =
|
|
1711
|
+
node = TriccNodeCalculate(
|
|
1695
1712
|
id=generate_id("final." + code),
|
|
1696
1713
|
name="final." + code,
|
|
1697
1714
|
label=display,
|
|
1698
|
-
list_name="acc_rej",
|
|
1699
1715
|
activity=activity,
|
|
1700
1716
|
group=activity,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1717
|
+
priority=priority,
|
|
1718
|
+
expression_reference=or_join([
|
|
1719
|
+
TriccOperation(TriccOperator.ISTRUE, [TriccReference("pre_final." + code)]),
|
|
1720
|
+
TriccOperation(
|
|
1721
|
+
TriccOperator.SELECTED,
|
|
1722
|
+
[TriccReference('tricc.manual.diag'), TriccStatic(code)]
|
|
1723
|
+
)
|
|
1724
|
+
])
|
|
1704
1725
|
)
|
|
1705
|
-
node.options = get_select_accept_reject_options(node, node.activity)
|
|
1706
1726
|
return node
|
|
1707
1727
|
|
|
1708
1728
|
def get_select_accept_reject_options(node, group):
|
|
@@ -1743,7 +1763,6 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1743
1763
|
start.activity = activity
|
|
1744
1764
|
start.group = activity
|
|
1745
1765
|
diags_conf = []
|
|
1746
|
-
r_diags_conf = []
|
|
1747
1766
|
end = TriccNodeActivityEnd(
|
|
1748
1767
|
id=generate_id("end.determine-diagnosis"),
|
|
1749
1768
|
name="end.determine-diagnosis",
|
|
@@ -1751,10 +1770,23 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1751
1770
|
group=activity,
|
|
1752
1771
|
)
|
|
1753
1772
|
activity.nodes[end.id]=end
|
|
1773
|
+
|
|
1774
|
+
f = TriccNodeSelectMultiple(
|
|
1775
|
+
name="tricc.manual.diag",
|
|
1776
|
+
label="Add diagnosis",
|
|
1777
|
+
list_name='manual_diag',
|
|
1778
|
+
id=generate_id("tricc.manual.diag"),
|
|
1779
|
+
activity=activity,
|
|
1780
|
+
group=activity,
|
|
1781
|
+
required=TriccStatic(False),
|
|
1782
|
+
|
|
1783
|
+
)
|
|
1754
1784
|
for proposed in diags:
|
|
1755
|
-
d =
|
|
1785
|
+
d = get_accept_diagnostic_node(proposed.name, proposed.label, proposed.severity, proposed.priority, activity)
|
|
1786
|
+
c = get_diagnostic_node(proposed.name, proposed.label, proposed.severity, proposed.priority, activity)
|
|
1756
1787
|
diags_conf.append(d)
|
|
1757
1788
|
r = TriccNodeRhombus(
|
|
1789
|
+
path=start,
|
|
1758
1790
|
id=generate_id(f"proposed-rhombus{proposed.id}"),
|
|
1759
1791
|
expression_reference=TriccOperation(
|
|
1760
1792
|
TriccOperator.ISTRUE,
|
|
@@ -1762,26 +1794,19 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1762
1794
|
),
|
|
1763
1795
|
reference=[TriccReference(proposed.name)],
|
|
1764
1796
|
activity=activity,
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1797
|
+
priority=proposed.priority,
|
|
1798
|
+
group=activity)
|
|
1799
|
+
activity.calculates.append(r)
|
|
1800
|
+
activity.calculates.append(c)
|
|
1768
1801
|
set_prev_next_node(r, d, edge_only=False)
|
|
1769
|
-
set_prev_next_node(d,
|
|
1802
|
+
set_prev_next_node(d, f, edge_only=False)
|
|
1770
1803
|
activity.nodes[d.options[0].id] = d.options[0]
|
|
1771
1804
|
activity.nodes[d.options[1].id] = d.options[1]
|
|
1772
1805
|
activity.nodes[d.id]=d
|
|
1773
1806
|
activity.nodes[r.id]=r
|
|
1807
|
+
activity.nodes[c.id]=c
|
|
1774
1808
|
# 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
|
-
)
|
|
1809
|
+
|
|
1785
1810
|
options = [
|
|
1786
1811
|
TriccNodeSelectOption(
|
|
1787
1812
|
id=generate_id(d.name),
|
|
@@ -1793,10 +1818,8 @@ def create_determine_diagnosis_activity(diags):
|
|
|
1793
1818
|
) for d in diags
|
|
1794
1819
|
]
|
|
1795
1820
|
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
1821
|
activity.nodes[f.id]=f
|
|
1799
|
-
|
|
1822
|
+
set_prev_next_node(f, end, edge_only=False)
|
|
1800
1823
|
|
|
1801
1824
|
return activity
|
|
1802
1825
|
|
|
@@ -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=LSRMeEzrDfUSxJ_TXKpmK0Yv04ay_eZzdTVorYrEJOo,99465
|
|
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.10.dist-info/METADATA,sha256=hJqShfaDh9YStARMPOS6TywQa44RE930nUqBuda2A1I,7878
|
|
44
|
+
tricc_oo-1.5.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
45
|
+
tricc_oo-1.5.10.dist-info/top_level.txt,sha256=NvbfMNAiy9m4b1unBsqpeOQWh4IgA1Xa33BtKA4abxk,15
|
|
46
|
+
tricc_oo-1.5.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|