tricc-oo 1.5.27__py3-none-any.whl → 1.5.28__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.
@@ -56,7 +56,7 @@ def get_export_name(node, replace_dots=True):
56
56
  elif isinstance(value, str):
57
57
  export_name = f"'{clean_str(value, replace_dots=replace_dots)}'"
58
58
  else:
59
- export_name = str(value)
59
+ export_name = value
60
60
  if hasattr(node, 'export_name'):
61
61
  node.export_name = export_name
62
62
  return export_name
@@ -439,7 +439,7 @@ class OpenMRSStrategy(BaseOutPutStrategy):
439
439
  if len(ref_expressions) == 1:
440
440
  return ref_expressions[0]
441
441
  if len(ref_expressions) > 1:
442
- return " || ".join(ref_expressions)
442
+ return "(" + " || ".join(ref_expressions) + ")"
443
443
  else:
444
444
  return "true"
445
445
 
@@ -472,7 +472,7 @@ class OpenMRSStrategy(BaseOutPutStrategy):
472
472
  return f"({ref_expressions[0]}.includes({ref_expressions[1]}))"
473
473
 
474
474
  def tricc_operation_count(self, ref_expressions):
475
- return f"({ref_expressions[0]}.length)"
475
+ return f"({ref_expressions[0]}.length || 0)"
476
476
 
477
477
  def tricc_operation_multiplied(self, ref_expressions):
478
478
  return "*".join(ref_expressions)
@@ -399,7 +399,7 @@ class XLSFormStrategy(BaseOutPutStrategy):
399
399
  # build lower level
400
400
  if hasattr(self, f"tricc_operation_{operation.operator}"):
401
401
  callable = getattr(self, f"tricc_operation_{operation.operator}")
402
- return callable(ref_expressions)
402
+ return callable(list(map(str, ref_expressions)))
403
403
  else:
404
404
  raise NotImplementedError(
405
405
  f"This type of opreation '{operation.operator}' is not supported in this strategy"
@@ -460,9 +460,9 @@ class XLSFormStrategy(BaseOutPutStrategy):
460
460
  return "1"
461
461
 
462
462
  def tricc_operation_native(self, ref_expressions):
463
-
463
+
464
464
  if len(ref_expressions) > 0:
465
- if ref_expressions[0].startswith(("'","`",)):
465
+ if ref_expressions[0].startswith(("'", "`",)):
466
466
  ref_expressions[0] = ref_expressions[0][1:-1]
467
467
  if ref_expressions[0] == "GetChoiceName":
468
468
  return f"""jr:choice-name({
@@ -2613,10 +2613,16 @@ def generate_base(node, processed_nodes, **kwargs):
2613
2613
  constraints_min = ""
2614
2614
  constraints_max = ""
2615
2615
  if node.min is not None and node.min != "":
2616
- constraints.append(TriccOperation(TriccOperator.MORE_OR_EQUAL, ["$this", node.min]))
2616
+ node.min = float(node.min)
2617
+ if int(node.min) == node.min:
2618
+ node.min = int(node.min)
2619
+ constraints.append(TriccOperation(TriccOperator.MORE_OR_EQUAL, ["$this", TriccStatic(node.min)]))
2617
2620
  constraints_min = "The minimun value is {0}.".format(node.min)
2618
2621
  if node.max is not None and node.max != "":
2619
- constraints.append(TriccOperation(TriccOperator.LESS_OR_EQUAL, ["$this", node.max]))
2622
+ node.max = float(node.max)
2623
+ if int(node.max) == node.max:
2624
+ node.max = int(node.max)
2625
+ constraints.append(TriccOperation(TriccOperator.LESS_OR_EQUAL, ["$this", TriccStatic(node.max)]))
2620
2626
  constraints_max = "The maximum value is {0}.".format(node.max)
2621
2627
  if len(constraints) > 1:
2622
2628
  node.constraint = TriccOperation(TriccOperator.AND, constraints)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tricc-oo
3
- Version: 1.5.27
3
+ Version: 1.5.28
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
@@ -7,7 +7,7 @@ tricc_oo/converters/codesystem_to_ocl.py,sha256=Fh7Vk73OsxljZKu1k6H9uzYwz334tpQT
7
7
  tricc_oo/converters/cql_to_operation.py,sha256=PUyV_YpUY98Ox0H_F_CN3UUf_I-BhFZVOcWWKTtwecM,14492
8
8
  tricc_oo/converters/datadictionnary.py,sha256=T2HLCBo4Am1p0kFqSH1r0PqbD8AC2IGuWkbvMvSCru0,3658
9
9
  tricc_oo/converters/drawio_type_map.py,sha256=UCPiGs7Lw0bigKScmZUnmOhACBz-FiDq92jHkI7RTSQ,9113
10
- tricc_oo/converters/tricc_to_xls_form.py,sha256=LkgRn8gdX7C-xIRypqgMRs3afuMpigzFN1l5RD-Zyg4,3499
10
+ tricc_oo/converters/tricc_to_xls_form.py,sha256=C7oDi1_IA0FLjoK700G9bABQZrGEqJltvBD2rGVjkIA,3494
11
11
  tricc_oo/converters/utils.py,sha256=JZrtrvvOfXwdkw49pKauzinOcauWwsy-CVcw36TjyLo,1684
12
12
  tricc_oo/converters/xml_to_tricc.py,sha256=cDoLTwIMHIqyyNqZGwQte9YdX4y5j1Ac6r7M-zuKWZc,39403
13
13
  tricc_oo/converters/cql/cqlLexer.py,sha256=8HArbRphcrpnAG4uogJ2rHv4tc1WLzjN0B1uFeYILAc,49141
@@ -33,18 +33,18 @@ tricc_oo/strategies/input/drawio.py,sha256=uXAUPhXOeg0Uk_BNqlCqFBW4cWNox4VfH559b
33
33
  tricc_oo/strategies/output/base_output_strategy.py,sha256=M9UFR67-_CFoW681bPAeBS1OUGuFtmUbM_rltACI0hk,8798
34
34
  tricc_oo/strategies/output/fhir_form.py,sha256=hbL921pe1Doun4IQrJuZ_Sq2fCh98G3grYie5olC4uc,15740
35
35
  tricc_oo/strategies/output/html_form.py,sha256=qSleEZOMV_-Z04y-i-ucyd5rgAYWAyjPwMrw0IHtCRM,8604
36
- tricc_oo/strategies/output/openmrs_form.py,sha256=aiHUi_lDm48yaKqZGWyFMVPIj6OhQGcAADFDoYJteW0,27175
36
+ tricc_oo/strategies/output/openmrs_form.py,sha256=t2I2IKl98dbfTsJrJ4hnQbG8_qROpZmKtyE2M1hnyD4,27192
37
37
  tricc_oo/strategies/output/spice.py,sha256=QMeoismVC3PdbvwTK0PtUjWX9jl9780fbQIXn76fMXw,10761
38
- tricc_oo/strategies/output/xls_form.py,sha256=c4eaQn411W57mTvCH7delAoDrP0IsaCtp-_D25btXg4,29310
38
+ tricc_oo/strategies/output/xls_form.py,sha256=26pEea0I_owpsz9S8hoHJNzChA5b2Th8KPRIeTEMfqo,29323
39
39
  tricc_oo/strategies/output/xlsform_cdss.py,sha256=X00Lt5MzV8TX14dR4dFI1MqllI5S1e13bKbeysWM9uA,17435
40
40
  tricc_oo/strategies/output/xlsform_cht.py,sha256=RY_mre9j6w2vVnRFSGn5R3CuTWFjIbQyl1uWwz9Ay5E,22965
41
41
  tricc_oo/strategies/output/xlsform_cht_hf.py,sha256=xm6SKirV3nMZvM2w54_zJcXAeAgAkq-EEqGEjnOWv6c,988
42
42
  tricc_oo/visitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- tricc_oo/visitors/tricc.py,sha256=RtE1oY6pWBasOmx_njexBg4qlHwPZd08QR45St5fPW0,107095
43
+ tricc_oo/visitors/tricc.py,sha256=vmOQRocfzjr-MvLNflNxV51w0vhRO53fX8tTIqjNyOU,107437
44
44
  tricc_oo/visitors/utils.py,sha256=j83aAq5s5atXi3OC0jc_uJd54a8XrHHmizeeEbWZQJg,421
45
45
  tricc_oo/visitors/xform_pd.py,sha256=ryAnI3V9x3eTmJ2LNsUZfvl0_yfCqo6oBgeSu-WPqaE,9613
46
- tricc_oo-1.5.27.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
47
- tricc_oo-1.5.27.dist-info/METADATA,sha256=Ak89Fpv6LVki7GoZYYjwx4on0UB8LflW4QrcBcxjMjI,8577
48
- tricc_oo-1.5.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
- tricc_oo-1.5.27.dist-info/top_level.txt,sha256=NvbfMNAiy9m4b1unBsqpeOQWh4IgA1Xa33BtKA4abxk,15
50
- tricc_oo-1.5.27.dist-info/RECORD,,
46
+ tricc_oo-1.5.28.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
47
+ tricc_oo-1.5.28.dist-info/METADATA,sha256=bQmU_Wmm8ki1FHnl51N3l_5uBDUmWJxHo_paTGkYBks,8577
48
+ tricc_oo-1.5.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
+ tricc_oo-1.5.28.dist-info/top_level.txt,sha256=NvbfMNAiy9m4b1unBsqpeOQWh4IgA1Xa33BtKA4abxk,15
50
+ tricc_oo-1.5.28.dist-info/RECORD,,