tricc-oo 1.5.1__tar.gz → 1.5.2__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.5.1 → tricc_oo-1.5.2}/PKG-INFO +1 -1
  2. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/pyproject.toml +1 -1
  3. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/drawio_type_map.py +14 -9
  4. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/calculate.py +2 -0
  5. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/tricc.py +2 -1
  6. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/visitors/tricc.py +17 -16
  7. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/visitors/xform_pd.py +5 -1
  8. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo.egg-info/PKG-INFO +1 -1
  9. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/README.md +0 -0
  10. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/setup.cfg +0 -0
  11. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tests/build.py +0 -0
  12. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tests/test_cql.py +0 -0
  13. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tests/to_ocl.py +0 -0
  14. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/__init__.py +0 -0
  15. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/__init__.py +0 -0
  16. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
  17. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/cql/cqlLexer.py +0 -0
  18. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/cql/cqlListener.py +0 -0
  19. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/cql/cqlParser.py +0 -0
  20. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
  21. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/cql_to_operation.py +0 -0
  22. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/datadictionnary.py +0 -0
  23. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/tricc_to_xls_form.py +0 -0
  24. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/utils.py +0 -0
  25. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/converters/xml_to_tricc.py +0 -0
  26. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/__init__.py +0 -0
  27. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/base.py +0 -0
  28. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/lang.py +0 -0
  29. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/ocl.py +0 -0
  30. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/models/ordered_set.py +0 -0
  31. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/parsers/__init__.py +0 -0
  32. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/parsers/xml.py +0 -0
  33. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/serializers/__init__.py +0 -0
  34. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/serializers/planuml.py +0 -0
  35. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/serializers/xls_form.py +0 -0
  36. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/__init__.py +0 -0
  37. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/input/__init__.py +0 -0
  38. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
  39. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/input/drawio.py +0 -0
  40. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
  41. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/spice.py +0 -0
  42. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/xls_form.py +0 -0
  43. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
  44. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
  45. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
  46. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/visitors/__init__.py +0 -0
  47. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo/visitors/utils.py +0 -0
  48. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo.egg-info/SOURCES.txt +0 -0
  49. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo.egg-info/dependency_links.txt +0 -0
  50. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo.egg-info/requires.txt +0 -0
  51. {tricc_oo-1.5.1 → tricc_oo-1.5.2}/tricc_oo.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: tricc-oo
3
- Version: 1.5.1
3
+ Version: 1.5.2
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.5.1"
7
+ version = "1.5.2"
8
8
  description = "Python library that converts CDSS L2 in L3"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -6,19 +6,19 @@ from tricc_oo.models.calculate import *
6
6
  TYPE_MAP = {
7
7
  TriccNodeType.start: {
8
8
  "objects": ["UserObject", "object"],
9
- "attributes": ['process', 'parent', 'form_id','relevance'],
9
+ "attributes": ['process', 'parent', 'form_id','relevance',"priority"],
10
10
  "mandatory_attributes": ["label"],
11
11
  "model": TriccNodeMainStart
12
12
  },
13
13
  TriccNodeType.activity_start: {
14
14
  "objects": ["UserObject", "object"],
15
- "attributes": ['parent', 'parent', 'instance', 'relevance'],
15
+ "attributes": ['parent', 'parent', 'instance', 'relevance',"priority"],
16
16
  "mandatory_attributes": ["label", "name"],
17
17
  "model": TriccNodeActivityStart
18
18
  },
19
19
  TriccNodeType.note: {
20
20
  "objects": ["UserObject", "object"],
21
- "attributes": ['relevance'],
21
+ "attributes": ['relevance',"priority"],
22
22
  "mandatory_attributes": ["label", "name"],
23
23
  "model": TriccNodeNote
24
24
  },
@@ -44,6 +44,7 @@ TYPE_MAP = {
44
44
  "constraint",
45
45
  "constraint_message",
46
46
  "relevance",
47
+ "priority"
47
48
 
48
49
  ],
49
50
  "mandatory_attributes": ["label", "name", "list_name"],
@@ -59,6 +60,7 @@ TYPE_MAP = {
59
60
  "constraint",
60
61
  "constraint_message",
61
62
  "relevance",
63
+ "priority"
62
64
  ],
63
65
  "mandatory_attributes": ["label", "name", "list_name"],
64
66
  "model": TriccNodeSelectMultiple
@@ -73,6 +75,7 @@ TYPE_MAP = {
73
75
  "constraint_message",
74
76
  "required",
75
77
  "relevance",
78
+ "priority"
76
79
  ],
77
80
  "mandatory_attributes": ["label", "name"],
78
81
  "model": TriccNodeDecimal
@@ -87,6 +90,8 @@ TYPE_MAP = {
87
90
  "constraint_message",
88
91
  "required",
89
92
  "relevance",
93
+ "priority"
94
+
90
95
  ],
91
96
  "mandatory_attributes": ["label", "name"],
92
97
  "model": TriccNodeInteger
@@ -94,13 +99,13 @@ TYPE_MAP = {
94
99
 
95
100
  TriccNodeType.text: {
96
101
  "objects": ["UserObject", "object"],
97
- "attributes": ["save", "relevance"],
102
+ "attributes": ["save", "relevance","priority"],
98
103
  "mandatory_attributes": ["label", 'name'],
99
104
  "model": TriccNodeText
100
105
  },
101
106
  TriccNodeType.date: {
102
107
  "objects": ["UserObject", "object"],
103
- "attributes": ["save", "relevance"],
108
+ "attributes": ["save", "relevance","priority"],
104
109
  "mandatory_attributes": ["label", "name"],
105
110
  "model": TriccNodeDate
106
111
  },
@@ -154,7 +159,7 @@ TYPE_MAP = {
154
159
  "filter",
155
160
  "constraint",
156
161
  "constraint_message",
157
- "relevance",
162
+ "relevance","priority"
158
163
  ],
159
164
  "mandatory_attributes": ["label", "name", "list_name"],
160
165
  "model": TriccNodeSelectYesNo
@@ -173,7 +178,7 @@ TYPE_MAP = {
173
178
  },
174
179
  TriccNodeType.goto: {
175
180
  "objects": ["UserObject", "object"],
176
- "attributes": ["instance"],
181
+ "attributes": ["instance","priority"],
177
182
  "mandatory_attributes": ["link", "label", "name"],
178
183
  "model": TriccNodeGoTo
179
184
  },
@@ -191,13 +196,13 @@ TYPE_MAP = {
191
196
  },
192
197
  TriccNodeType.bridge: {
193
198
  "objects": ["UserObject", "object"],
194
- "attributes": ["label"],
199
+ "attributes": ["label","priority"],
195
200
  "mandatory_attributes": [],
196
201
  "model": TriccNodeBridge
197
202
  },
198
203
  TriccNodeType.diagnosis: {
199
204
  "objects": ["UserObject", "object"],
200
- "attributes": ["save", "reference"],
205
+ "attributes": ["save", "reference","priority"],
201
206
  "mandatory_attributes": [ "name", 'label'],
202
207
  "model": TriccNodeDiagnosis
203
208
  },
@@ -53,6 +53,7 @@ class TriccNodeCount(TriccNodeDisplayCalculateBase):
53
53
  class TriccNodeProposedDiagnosis(TriccNodeDisplayCalculateBase):
54
54
  tricc_type: TriccNodeType = TriccNodeType.proposed_diagnosis
55
55
  severity: str = None
56
+ priority: Union[float, int, None] = None
56
57
 
57
58
  class TriccNodeFakeCalculateBase(TriccNodeCalculateBase):
58
59
  ...
@@ -130,6 +131,7 @@ class TriccNodeRhombus(TriccNodeCalculateBase,TriccRhombusMixIn):
130
131
  class TriccNodeDiagnosis(TriccNodeDisplayCalculateBase):
131
132
  tricc_type: TriccNodeType = TriccNodeType.diagnosis
132
133
  severity: str = None
134
+ priority: Union[float, int, None] = None
133
135
  def __init__(self, **data):
134
136
  data['reference'] = f'"final.{data["name"]}" is true'
135
137
  super().__init__(**data)
@@ -237,7 +237,7 @@ class TriccNodeDisplayModel(TriccNodeBaseModel):
237
237
  help: Optional[Union[str, TriccNodeBaseModel]] = None
238
238
  group: Optional[Union[TriccGroup, TriccNodeActivity]] = None
239
239
  relevance: Optional[Union[Expression, TriccOperation]] = None
240
-
240
+ priority: Union[float, int, None] = None
241
241
 
242
242
  # to use the enum value of the TriccNodeType
243
243
 
@@ -348,6 +348,7 @@ class TriccNodeSelectYesNo(TriccNodeSelectOne):
348
348
 
349
349
  class TriccNodeAcceptDiagnostic(TriccNodeSelectOne):
350
350
  severity: Optional[str] = None
351
+ priority: Union[float, int, None] = None
351
352
 
352
353
 
353
354
  class TriccParentMixIn(BaseModel):
@@ -1416,31 +1416,30 @@ def reorder_node_list(list_node, group, processed_nodes):
1416
1416
 
1417
1417
  # Define a lambda to assign numeric priorities
1418
1418
  def filter_logic(l_node):
1419
-
1419
+ priority = (getattr(l_node, "priority", None) or 0) / 100
1420
1420
  if (
1421
1421
  isinstance(l_node, TriccNodeWait)
1422
1422
  and any(isinstance(rn, TriccNodeActivity) and any(sn.activity == rn for sn in list_node) for rn in l_node.reference)
1423
1423
  ):
1424
- return 7
1424
+ pass
1425
1425
  elif group is not None and hasattr(l_node, 'group') and l_node.group and l_node.group.id == group.id:
1426
- return 0 # Highest priority: Same group
1426
+ priority += 7 # Highest priority: Same group
1427
1427
  elif issubclass(l_node.__class__, TriccRhombusMixIn) :
1428
- return 6
1428
+ priority += 1
1429
1429
  elif hasattr(group, 'group') and group.group and l_node.group and l_node.group.id == group.group.id:
1430
- return 1 # Second priority: Parent group
1430
+ priority += 6 # Second priority: Parent group
1431
1431
  elif not isinstance(l_node.activity.root, TriccNodeActivityStart) and l_node.activity in active_activities:
1432
- return 2 # Third priority: Active activities
1432
+ priority += 5 # Third priority: Active activities
1433
1433
  elif not isinstance(l_node.activity.root, TriccNodeActivityStart):
1434
- return 3 # Third priority: Active activities
1434
+ priority += 4 # Third priority: Active activities
1435
1435
  elif l_node.activity in active_activities:
1436
- return 4 # Third priority: Active activities
1437
-
1438
-
1436
+ priority += 3 # Third priority: Active activities
1439
1437
  else:
1440
- return 5 # Lowest priority: Others
1438
+ priority += 2 # Lowest priority: Others
1439
+ return priority
1441
1440
 
1442
1441
  # Sort list_node in place using filter_logic as the key
1443
- list_node.sort(key=filter_logic, reverse=False)
1442
+ list_node.sort(key=filter_logic, reverse=True)
1444
1443
  return None
1445
1444
 
1446
1445
  def loop_info(loop, **kwargs):
@@ -1700,7 +1699,7 @@ def get_accept_diagnostic_node(code, display, severity, activity):
1700
1699
  node.options = get_select_accept_reject_options(node, node.activity)
1701
1700
  return node
1702
1701
 
1703
- def get_diagnostic_node(code, display, severity, activity):
1702
+ def get_diagnostic_node(code, display, severity, priority, activity):
1704
1703
  node = TriccNodeAcceptDiagnostic(
1705
1704
  id=generate_id("final." + code),
1706
1705
  name="final." + code,
@@ -1708,7 +1707,9 @@ def get_diagnostic_node(code, display, severity, activity):
1708
1707
  list_name="acc_rej",
1709
1708
  activity=activity,
1710
1709
  group=activity,
1711
- severity=severity
1710
+ severity=severity,
1711
+ priority=priority
1712
+
1712
1713
  )
1713
1714
  node.options = get_select_accept_reject_options(node, node.activity)
1714
1715
  return node
@@ -1760,7 +1761,7 @@ def create_determine_diagnosis_activity(diags):
1760
1761
  )
1761
1762
  activity.nodes[end.id]=end
1762
1763
  for proposed in diags:
1763
- d = get_diagnostic_node(proposed.name, proposed.label, proposed.severity, activity)
1764
+ d = get_diagnostic_node(proposed.name, proposed.label, proposed.severity, proposed.priority, activity)
1764
1765
  diags_conf.append(d)
1765
1766
  r = TriccNodeRhombus(
1766
1767
  id=generate_id(f"proposed-rhombus{proposed.id}"),
@@ -1782,7 +1783,7 @@ def create_determine_diagnosis_activity(diags):
1782
1783
  # fallback
1783
1784
  f = TriccNodeSelectMultiple(
1784
1785
  name="tricc.manual.diag",
1785
- label="Add a diagnostic",
1786
+ label="Add diagnosis",
1786
1787
  list_name='manual_diag',
1787
1788
  id=generate_id("tricc.manual.diag"),
1788
1789
  activity=activity,
@@ -182,6 +182,7 @@ def get_task_js(form_id, calculate_name, title, form_types, hidden_names, df_sur
182
182
  /* eslint-disable */
183
183
 
184
184
  const {{injectDataFromForm, isFormArrayHasSourceId}} = require('./stph-extras');
185
+ const {{getField}} = require("./nools-extras");
185
186
 
186
187
  const CASE_DATA = ['{"','".join(hidden_names)}'];
187
188
 
@@ -216,7 +217,9 @@ function {task_name}ResolveIf(contact, report, event, dueDate) {{
216
217
  }}
217
218
 
218
219
  function {task_name}AppliesIf(contact, report, event, dueDate) {{
219
- return report.{calculate_name} === '1';
220
+ return getField(report, "source_id") === "" &&
221
+ getField(report, "pause_test") === "1"
222
+
220
223
  }}
221
224
 
222
225
  module.exports = {{
@@ -247,6 +250,7 @@ module.exports = {{
247
250
  // appliesTo: 'reports',
248
251
  // appliesToType: {task_name_upper}_FORMS,
249
252
  // appliesIf: {task_name}AppliesIf,
253
+ // contactLabel: {task_name}ContactLabel,
250
254
  // actions: [
251
255
  // {{
252
256
  // type: 'report',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.5.1
3
+ Version: 1.5.2
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