tricc-oo 1.4.2__tar.gz → 1.4.4__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.
Files changed (51) hide show
  1. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/PKG-INFO +2 -2
  2. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/pyproject.toml +1 -1
  3. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/cql_to_operation.py +2 -2
  4. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/drawio_type_map.py +9 -3
  5. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/xml_to_tricc.py +4 -2
  6. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/input/base_input_strategy.py +2 -1
  7. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/xls_form.py +1 -1
  8. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/visitors/tricc.py +5 -5
  9. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo.egg-info/PKG-INFO +1 -1
  10. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/LICENSE.md +0 -0
  11. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/README.md +0 -0
  12. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/setup.cfg +0 -0
  13. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tests/build.py +0 -0
  14. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tests/test_cql.py +0 -0
  15. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tests/to_ocl.py +0 -0
  16. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/__init__.py +0 -0
  17. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/__init__.py +0 -0
  18. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
  19. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/cql/cqlLexer.py +0 -0
  20. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/cql/cqlListener.py +0 -0
  21. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/cql/cqlParser.py +0 -0
  22. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
  23. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/datadictionnary.py +0 -0
  24. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/tricc_to_xls_form.py +0 -0
  25. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/converters/utils.py +0 -0
  26. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/__init__.py +0 -0
  27. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/base.py +0 -0
  28. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/calculate.py +0 -0
  29. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/lang.py +0 -0
  30. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/ocl.py +0 -0
  31. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/ordered_set.py +0 -0
  32. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/models/tricc.py +0 -0
  33. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/parsers/__init__.py +0 -0
  34. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/parsers/xml.py +0 -0
  35. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/serializers/__init__.py +0 -0
  36. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/serializers/planuml.py +0 -0
  37. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/serializers/xls_form.py +0 -0
  38. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/__init__.py +0 -0
  39. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/input/__init__.py +0 -0
  40. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/input/drawio.py +0 -0
  41. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
  42. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/spice.py +0 -0
  43. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
  44. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
  45. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
  46. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/visitors/__init__.py +0 -0
  47. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo/visitors/xform_pd.py +0 -0
  48. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo.egg-info/SOURCES.txt +0 -0
  49. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo.egg-info/dependency_links.txt +0 -0
  50. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo.egg-info/requires.txt +0 -0
  51. {tricc_oo-1.4.2 → tricc_oo-1.4.4}/tricc_oo.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Python library that converts CDSS L2 in L3
5
5
  Project-URL: Homepage, https://github.com/SwissTPH/tricc
6
6
  Project-URL: Issues, https://github.com/SwissTPH/tricc/issues
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tricc-oo"
7
- version = "1.4.2"
7
+ version = "1.4.4"
8
8
  description = "Python library that converts CDSS L2 in L3"
9
9
  readme = "README.md"
10
10
 
@@ -85,9 +85,9 @@ class cqlToXlsFormVisitor(cqlVisitor):
85
85
  def visitBooleanLiteral(self, ctx):
86
86
  literal = ctx.getChild(0).getText()
87
87
  if literal == 'true':
88
- return True
88
+ return TriccStatic(True)
89
89
  elif literal == 'false':
90
- return False
90
+ return TriccStatic(False)
91
91
  else:
92
92
  return None
93
93
 
@@ -18,7 +18,7 @@ TYPE_MAP = {
18
18
  },
19
19
  TriccNodeType.note: {
20
20
  "objects": ["UserObject", "object"],
21
- "attributes": [],
21
+ "attributes": ['relevance'],
22
22
  "mandatory_attributes": ["label", "name"],
23
23
  "model": TriccNodeNote
24
24
  },
@@ -43,6 +43,8 @@ TYPE_MAP = {
43
43
  "filter",
44
44
  "constraint",
45
45
  "constraint_message",
46
+ "relevance",
47
+
46
48
  ],
47
49
  "mandatory_attributes": ["label", "name", "list_name"],
48
50
  "model": TriccNodeSelectOne
@@ -56,6 +58,7 @@ TYPE_MAP = {
56
58
  "filter",
57
59
  "constraint",
58
60
  "constraint_message",
61
+ "relevance",
59
62
  ],
60
63
  "mandatory_attributes": ["label", "name", "list_name"],
61
64
  "model": TriccNodeSelectMultiple
@@ -69,6 +72,7 @@ TYPE_MAP = {
69
72
  "save",
70
73
  "constraint_message",
71
74
  "required",
75
+ "relevance",
72
76
  ],
73
77
  "mandatory_attributes": ["label", "name"],
74
78
  "model": TriccNodeDecimal
@@ -82,6 +86,7 @@ TYPE_MAP = {
82
86
  "save",
83
87
  "constraint_message",
84
88
  "required",
89
+ "relevance",
85
90
  ],
86
91
  "mandatory_attributes": ["label", "name"],
87
92
  "model": TriccNodeInteger
@@ -89,13 +94,13 @@ TYPE_MAP = {
89
94
 
90
95
  TriccNodeType.text: {
91
96
  "objects": ["UserObject", "object"],
92
- "attributes": [],
97
+ "attributes": ["relevance"],
93
98
  "mandatory_attributes": ["label", 'name'],
94
99
  "model": TriccNodeText
95
100
  },
96
101
  TriccNodeType.date: {
97
102
  "objects": ["UserObject", "object"],
98
- "attributes": [],
103
+ "attributes": ["relevance"],
99
104
  "mandatory_attributes": ["label", "name"],
100
105
  "model": TriccNodeDate
101
106
  },
@@ -149,6 +154,7 @@ TYPE_MAP = {
149
154
  "filter",
150
155
  "constraint",
151
156
  "constraint_message",
157
+ "relevance",
152
158
  ],
153
159
  "mandatory_attributes": ["label", "name", "list_name"],
154
160
  "model": TriccNodeSelectYesNo
@@ -67,6 +67,8 @@ def create_activity(diagram, media_path, project):
67
67
  label=name,
68
68
  form_id=form_id,
69
69
  )
70
+ if root.relevance is not None:
71
+ activity.applicability=root.relevance
70
72
  # activity definition is never instanciated
71
73
  if isinstance(root, TriccNodeActivityStart):
72
74
  activity.instance = 0
@@ -334,9 +336,9 @@ def get_nodes(diagram, activity):
334
336
  elif (
335
337
  issubclass(node.__class__, TriccNodeDisplayCalculateBase)
336
338
  and not getattr(node, 'relevance', None)
337
- and node.activity.root.relevance
339
+ and node.activity.applicability
338
340
  ):
339
- node.applicability = node.activity.root.relevance
341
+ node.applicability = node.activity.applicability
340
342
 
341
343
 
342
344
  nodes.update(new_nodes)
@@ -38,7 +38,8 @@ class BaseInputStrategy:
38
38
  if diag.name not in seen_diags:
39
39
  unique_diags.append(diag)
40
40
  seen_diags.add(diag.name)
41
-
41
+ severity_order = { "severe": 3, "moderate": 2, "mild":1, 'light': 0}
42
+ unique_diags = sorted(unique_diags, key=lambda x: (-getattr(severity_order, x.severity or 'light', 0), x.label))
42
43
  for process in self.processes:
43
44
  if process in [p[0] for p in page_processes]:
44
45
  sorted_pages[process] = [
@@ -464,7 +464,7 @@ class XLSFormStrategy(BaseOutPutStrategy):
464
464
  else_found = True
465
465
  parts.append(ref_expressions[i])
466
466
  #join the if
467
- exp = ','.join(parts)
467
+ exp = ','.join(map(str,parts))
468
468
  # in case there is no default put ''
469
469
  if not else_found:
470
470
  exp += ",''"
@@ -1521,11 +1521,11 @@ def get_node_expression( in_node, processed_nodes, is_calculate=False, is_prev=F
1521
1521
  for past_instance in past_instances:
1522
1522
  add_sub_expression(expression_inputs, get_node_expression(past_instance, processed_nodes=processed_nodes, is_calculate=False, is_prev=True))
1523
1523
 
1524
- if isinstance(node.root.relevance,(TriccStatic,TriccOperation, TriccReference)):
1524
+ if isinstance(node.applicability,(TriccStatic,TriccOperation, TriccReference)):
1525
1525
  if expression:
1526
- expression = and_join([node.root.relevance, expression])
1526
+ expression = and_join([node.applicability, expression])
1527
1527
  else:
1528
- expression = node.root.relevance
1528
+ expression = node.applicability
1529
1529
  if expression and expression_inputs:
1530
1530
  add_sub_expression(expression_inputs, expression)
1531
1531
  expression = nand_join(expression, or_join(expression_inputs))
@@ -1553,8 +1553,8 @@ def get_node_expression( in_node, processed_nodes, is_calculate=False, is_prev=F
1553
1553
  else:
1554
1554
  expression = end_operation
1555
1555
 
1556
- elif node.root.relevance:
1557
- expression = and_join([expression, node.root.relevance])
1556
+ elif node.applicability:
1557
+ expression = and_join([expression, node.applicability])
1558
1558
 
1559
1559
  if negate:
1560
1560
  if negate_expression is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Python library that converts CDSS L2 in L3
5
5
  Project-URL: Homepage, https://github.com/SwissTPH/tricc
6
6
  Project-URL: Issues, https://github.com/SwissTPH/tricc/issues
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes