tricc-oo 1.5.28__tar.gz → 1.6.0__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 (56) hide show
  1. {tricc_oo-1.5.28/tricc_oo.egg-info → tricc_oo-1.6.0}/PKG-INFO +1 -1
  2. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/pyproject.toml +1 -1
  3. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tests/build.py +1 -0
  4. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/tricc_to_xls_form.py +2 -2
  5. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/xml_to_tricc.py +8 -7
  6. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/base.py +2 -0
  7. tricc_oo-1.6.0/tricc_oo/strategies/output/dhis2_form.py +859 -0
  8. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/openmrs_form.py +51 -4
  9. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/visitors/tricc.py +38 -28
  10. {tricc_oo-1.5.28 → tricc_oo-1.6.0/tricc_oo.egg-info}/PKG-INFO +1 -1
  11. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo.egg-info/SOURCES.txt +1 -0
  12. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/LICENSE +0 -0
  13. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/README.md +0 -0
  14. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/setup.cfg +0 -0
  15. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tests/test_cql.py +0 -0
  16. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tests/to_ocl.py +0 -0
  17. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/__init__.py +0 -0
  18. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/__init__.py +0 -0
  19. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
  20. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/cql/cqlLexer.py +0 -0
  21. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/cql/cqlListener.py +0 -0
  22. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/cql/cqlParser.py +0 -0
  23. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
  24. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/cql_to_operation.py +0 -0
  25. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/datadictionnary.py +0 -0
  26. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/drawio_type_map.py +0 -0
  27. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/converters/utils.py +0 -0
  28. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/__init__.py +0 -0
  29. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/calculate.py +0 -0
  30. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/lang.py +0 -0
  31. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/ocl.py +0 -0
  32. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/ordered_set.py +0 -0
  33. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/models/tricc.py +0 -0
  34. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/parsers/__init__.py +0 -0
  35. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/parsers/xml.py +0 -0
  36. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/serializers/__init__.py +0 -0
  37. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/serializers/planuml.py +0 -0
  38. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/serializers/xls_form.py +0 -0
  39. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/__init__.py +0 -0
  40. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/input/__init__.py +0 -0
  41. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
  42. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/input/drawio.py +0 -0
  43. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
  44. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/fhir_form.py +0 -0
  45. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/html_form.py +0 -0
  46. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/spice.py +0 -0
  47. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/xls_form.py +0 -0
  48. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
  49. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
  50. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
  51. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/visitors/__init__.py +0 -0
  52. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/visitors/utils.py +0 -0
  53. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo/visitors/xform_pd.py +0 -0
  54. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo.egg-info/dependency_links.txt +0 -0
  55. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo.egg-info/requires.txt +0 -0
  56. {tricc_oo-1.5.28 → tricc_oo-1.6.0}/tricc_oo.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.5.28
3
+ Version: 1.6.0
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.28"
7
+ version = "1.6.0"
8
8
  description = "Python library that converts CDSS L2 in L3"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -6,6 +6,7 @@ from tricc_oo.strategies.output.xls_form import XLSFormStrategy # noqa: F401
6
6
  from tricc_oo.strategies.output.openmrs_form import OpenMRSStrategy # noqa: F401
7
7
  from tricc_oo.strategies.output.fhir_form import FHIRStrategy # noqa: F401
8
8
  from tricc_oo.strategies.output.html_form import HTMLStrategy # noqa: F401
9
+ from tricc_oo.strategies.output.dhis2_form import DHIS2Strategy # noqa: F401
9
10
  from tricc_oo.strategies.input.drawio import DrawioStrategy # noqa: F401
10
11
  import getopt
11
12
  import logging
@@ -53,8 +53,8 @@ def get_export_name(node, replace_dots=True):
53
53
  export_name = BOOLEAN_MAP[str(TRICC_FALSE_VALUE)]
54
54
  elif value == '$this':
55
55
  export_name = '.'
56
- elif isinstance(value, str):
57
- export_name = f"'{clean_str(value, replace_dots=replace_dots)}'"
56
+ elif isinstance(value, str) and not isinstance(node, str):
57
+ export_name = f"'{value}'"
58
58
  else:
59
59
  export_name = value
60
60
  if hasattr(node, 'export_name'):
@@ -101,16 +101,16 @@ def create_activity(diagram, media_path, project):
101
101
 
102
102
  external_id = diagram.attrib.get("id")
103
103
  id = get_id(external_id, diagram.attrib.get("id"))
104
- root = create_root_node(diagram)
105
- name = diagram.attrib.get("name")
104
+ root, name = create_root_node(diagram)
105
+ label = diagram.attrib.get("name")
106
106
  form_id = diagram.attrib.get("name", None)
107
107
  if root is not None:
108
108
  activity = TriccNodeActivity(
109
109
  root=root,
110
- name=get_rand_name(f"a{id}"),
110
+ name=name, # start node 'name' is saved in label
111
111
  id=id,
112
112
  external_id=external_id,
113
- label=name,
113
+ label=label,
114
114
  form_id=form_id,
115
115
  )
116
116
  if root.relevance is not None:
@@ -130,7 +130,7 @@ def create_activity(diagram, media_path, project):
130
130
  if (
131
131
  issubclass(n.__class__, (TriccNodeDisplayModel, TriccNodeDisplayCalculateBase))
132
132
  and not isinstance(n, (TriccRhombusMixIn, TriccNodeRhombus, TriccNodeDisplayBridge))
133
- and not n.name.startswith("label_")
133
+ and not n.name.startswith("label_") # FIXME
134
134
  ):
135
135
  system = n.name.split(".")[0] if "." in n.name else "tricc"
136
136
  if isinstance(n, TriccNodeSelectOption) and isinstance(n.select, TriccNodeSelectNotAvailable):
@@ -444,17 +444,18 @@ def create_root_node(diagram):
444
444
  if elm is not None:
445
445
  external_id = elm.attrib.get("id")
446
446
  id = get_id(external_id, diagram.attrib.get("id"))
447
+ name = generate_id("start"+external_id)
447
448
  node = TriccNodeActivityStart(
448
449
  id=id,
449
450
  external_id=external_id,
450
451
  # parent=elm.attrib.get("parent"),
451
- name="ma" + id,
452
+ name=name,
452
453
  label=diagram.attrib.get("name"),
453
454
  relevance=elm.attrib.get("relevance"),
454
455
  instance=int(elm.attrib.get("instance") if elm.attrib.get("instance") is not None else 1),
455
456
  )
456
457
  load_expressions(node)
457
- return node
458
+ return node, elm.attrib.get("name", generate_id("act"+external_id))
458
459
 
459
460
 
460
461
  # converter XML item to object
@@ -494,6 +494,8 @@ class TriccOperation(BaseModel):
494
494
  return "mixed"
495
495
  else:
496
496
  return rtype.pop()
497
+ else:
498
+ return self.get_reference_datatype(self.reference)
497
499
 
498
500
  def get_reference_datatype(self, references):
499
501
  rtype = set()