tricc-oo 1.5.25__tar.gz → 1.5.27__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 (55) hide show
  1. {tricc_oo-1.5.25/tricc_oo.egg-info → tricc_oo-1.5.27}/PKG-INFO +1 -1
  2. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/pyproject.toml +1 -1
  3. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/tricc_to_xls_form.py +2 -0
  4. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/serializers/xls_form.py +1 -1
  5. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/xls_form.py +6 -14
  6. {tricc_oo-1.5.25 → tricc_oo-1.5.27/tricc_oo.egg-info}/PKG-INFO +1 -1
  7. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/LICENSE +0 -0
  8. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/README.md +0 -0
  9. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/setup.cfg +0 -0
  10. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tests/build.py +0 -0
  11. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tests/test_cql.py +0 -0
  12. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tests/to_ocl.py +0 -0
  13. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/__init__.py +0 -0
  14. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/__init__.py +0 -0
  15. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
  16. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/cql/cqlLexer.py +0 -0
  17. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/cql/cqlListener.py +0 -0
  18. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/cql/cqlParser.py +0 -0
  19. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
  20. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/cql_to_operation.py +0 -0
  21. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/datadictionnary.py +0 -0
  22. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/drawio_type_map.py +0 -0
  23. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/utils.py +0 -0
  24. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/converters/xml_to_tricc.py +0 -0
  25. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/__init__.py +0 -0
  26. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/base.py +0 -0
  27. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/calculate.py +0 -0
  28. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/lang.py +0 -0
  29. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/ocl.py +0 -0
  30. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/ordered_set.py +0 -0
  31. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/models/tricc.py +0 -0
  32. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/parsers/__init__.py +0 -0
  33. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/parsers/xml.py +0 -0
  34. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/serializers/__init__.py +0 -0
  35. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/serializers/planuml.py +0 -0
  36. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/__init__.py +0 -0
  37. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/input/__init__.py +0 -0
  38. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
  39. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/input/drawio.py +0 -0
  40. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/base_output_strategy.py +0 -0
  41. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/fhir_form.py +0 -0
  42. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/html_form.py +0 -0
  43. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/openmrs_form.py +0 -0
  44. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/spice.py +0 -0
  45. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
  46. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/xlsform_cht.py +0 -0
  47. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
  48. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/visitors/__init__.py +0 -0
  49. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/visitors/tricc.py +0 -0
  50. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/visitors/utils.py +0 -0
  51. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo/visitors/xform_pd.py +0 -0
  52. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo.egg-info/SOURCES.txt +0 -0
  53. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo.egg-info/dependency_links.txt +0 -0
  54. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/tricc_oo.egg-info/requires.txt +0 -0
  55. {tricc_oo-1.5.25 → tricc_oo-1.5.27}/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.25
3
+ Version: 1.5.27
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.25"
7
+ version = "1.5.27"
8
8
  description = "Python library that converts CDSS L2 in L3"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -51,6 +51,8 @@ def get_export_name(node, replace_dots=True):
51
51
  export_name = BOOLEAN_MAP[str(TRICC_TRUE_VALUE)]
52
52
  elif value == TRICC_FALSE_VALUE:
53
53
  export_name = BOOLEAN_MAP[str(TRICC_FALSE_VALUE)]
54
+ elif value == '$this':
55
+ export_name = '.'
54
56
  elif isinstance(value, str):
55
57
  export_name = f"'{clean_str(value, replace_dots=replace_dots)}'"
56
58
  else:
@@ -376,7 +376,7 @@ def get_attr_if_exists(strategy, node, column, map_array):
376
376
 
377
377
  elif isinstance(value, (TriccOperation, TriccStatic, TriccReference)):
378
378
  expression = strategy.get_tricc_operation_expression(value)
379
- return expression.replace("$this", ".") if isinstance(expression, str) else expression
379
+ return expression
380
380
  elif value is not None:
381
381
  return str(value) if not isinstance(value, dict) else value
382
382
  else:
@@ -131,7 +131,7 @@ class XLSFormStrategy(BaseOutPutStrategy):
131
131
  return generate_xls_form_export(self, node, **kwargs)
132
132
 
133
133
  def inject_version(self):
134
- # Add hidden version field using ODK's jr:version()
134
+ # Add hidden version field using ODK's version()
135
135
  empty = langs.get_trads("", force_dict=True)
136
136
  self.df_survey.loc[len(self.df_survey)] = [
137
137
  "hidden",
@@ -148,7 +148,7 @@ class XLSFormStrategy(BaseOutPutStrategy):
148
148
  "", # required
149
149
  *list(empty.values()), # required_message
150
150
  "", # read only
151
- "jr:version()", # calculation
151
+ "version()", # calculation
152
152
  "", # trigger
153
153
  "", # repeat_count
154
154
  "", # image
@@ -460,7 +460,10 @@ class XLSFormStrategy(BaseOutPutStrategy):
460
460
  return "1"
461
461
 
462
462
  def tricc_operation_native(self, ref_expressions):
463
+
463
464
  if len(ref_expressions) > 0:
465
+ if ref_expressions[0].startswith(("'","`",)):
466
+ ref_expressions[0] = ref_expressions[0][1:-1]
464
467
  if ref_expressions[0] == "GetChoiceName":
465
468
  return f"""jr:choice-name({
466
469
  self.clean_coalesce(ref_expressions[1])
@@ -720,19 +723,8 @@ class XLSFormStrategy(BaseOutPutStrategy):
720
723
  elif isinstance(r, TriccReference):
721
724
  logger.warning(f"reference `{r.value}` still used in a calculate")
722
725
  return f"${{{get_export_name(r.value)}}}"
723
- elif isinstance(r, TriccStatic):
726
+ elif isinstance(r, (TriccStatic, str, int, float)):
724
727
  return get_export_name(r)
725
- elif isinstance(r, str):
726
- if r == TRICC_TRUE_VALUE:
727
- return BOOLEAN_MAP[str(TRICC_TRUE_VALUE)]
728
- elif r == TRICC_FALSE_VALUE:
729
- return BOOLEAN_MAP[str(TRICC_FALSE_VALUE)]
730
- elif isinstance(r, str):
731
- return f"'{r}'"
732
- else:
733
- return str(r)
734
- elif isinstance(r, (int, float)):
735
- return str(r)
736
728
  elif isinstance(r, TriccNodeSelectOption):
737
729
  logger.debug(f"select option {r.get_name()} from {r.select.get_name()} was used as a reference")
738
730
  return get_export_name(r)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.5.25
3
+ Version: 1.5.27
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