pathling 9.5.0.dev0__tar.gz → 9.6.0.dev0__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 (33) hide show
  1. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/PKG-INFO +1 -1
  2. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/_version.py +2 -2
  3. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/context.py +29 -8
  4. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/datasource.py +3 -3
  5. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pyproject.toml +1 -1
  6. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/.gitignore +0 -0
  7. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/LICENSE +0 -0
  8. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/README.md +0 -0
  9. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/bulk.py +0 -0
  10. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/bundles/Bennett146_Swaniawski813_704c9750-f6e6-473b-ee83-fbd48e07fe3f.json +0 -0
  11. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/bundles/Dino214_Parisian75_40d82b80-b682-cd8b-da6d-396809878641.json +0 -0
  12. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/csv/conditions.csv +0 -0
  13. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/resources/Condition.ndjson +0 -0
  14. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/resources/Patient.ndjson +0 -0
  15. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/designation.py +0 -0
  16. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/display.py +0 -0
  17. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/encode_bundles.py +0 -0
  18. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/encode_resources.py +0 -0
  19. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/fhir_search.py +0 -0
  20. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/fhir_view.py +0 -0
  21. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/member_of.py +0 -0
  22. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/property_of.py +0 -0
  23. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/subsumes.py +0 -0
  24. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/translate.py +0 -0
  25. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/__init__.py +0 -0
  26. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/bulk.py +0 -0
  27. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/coding.py +0 -0
  28. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/core.py +0 -0
  29. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/datasink.py +0 -0
  30. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/fhir.py +0 -0
  31. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/functions.py +0 -0
  32. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/spark.py +0 -0
  33. {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/udfs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pathling
3
- Version: 9.5.0.dev0
3
+ Version: 9.6.0.dev0
4
4
  Summary: Python API for Pathling
5
5
  Project-URL: Homepage, https://github.com/aehrc/pathling
6
6
  Author-email: "Australian e-Health Research Centre, CSIRO" <pathling@csiro.au>
@@ -2,8 +2,8 @@
2
2
  # Auto generated from POM project version.
3
3
  # Please do not modify.
4
4
  #
5
- __version__="9.5.0.dev0"
6
- __java_version__="9.5.0-SNAPSHOT"
5
+ __version__="9.6.0.dev0"
6
+ __java_version__="9.6.0-SNAPSHOT"
7
7
  __scala_version__="2.13"
8
8
  __delta_version__="4.0.0"
9
9
  __hadoop_version__="3.4.1"
@@ -41,6 +41,21 @@ def _convert_java_value(value):
41
41
  return str(value)
42
42
 
43
43
 
44
+ def _convert_typed_values(jtyped_values) -> list:
45
+ """Converts a Java list of TypedValue objects to Python dicts.
46
+
47
+ :param jtyped_values: iterable of Java TypedValue objects with getType() and getValue()
48
+ :return: list of dicts with ``type`` and ``value`` keys
49
+ """
50
+ results = []
51
+ for jtyped_value in jtyped_values:
52
+ value = jtyped_value.getValue()
53
+ if value is not None:
54
+ value = _convert_java_value(value)
55
+ results.append({"type": jtyped_value.getType(), "value": value})
56
+ return results
57
+
58
+
44
59
  class StorageType:
45
60
  MEMORY: str = "memory"
46
61
  DISK: str = "disk"
@@ -453,7 +468,8 @@ class PathlingContext:
453
468
  expression is composed with the context expression
454
469
  :param variables: optional named variables available via %variable syntax, or None
455
470
  :return: a dict with ``results`` (list of dicts with ``type`` and ``value``
456
- keys) and ``expectedReturnType`` (string)
471
+ keys), ``expectedReturnType`` (string), and ``traces`` (list of
472
+ dicts with ``label`` and ``values`` keys)
457
473
  :raises: Exception if the expression is invalid or evaluation fails
458
474
  """
459
475
  jresult = self._jpc.evaluateFhirPath(
@@ -464,16 +480,21 @@ class PathlingContext:
464
480
  variables,
465
481
  )
466
482
  # Convert Java FhirPathResult to Python dict.
467
- results = []
468
- for jtyped_value in jresult.getResults():
469
- value = jtyped_value.getValue()
470
- # Convert Java types to Python types.
471
- if value is not None:
472
- value = _convert_java_value(value)
473
- results.append({"type": jtyped_value.getType(), "value": value})
483
+ results = _convert_typed_values(jresult.getResults())
484
+
485
+ # Convert trace results.
486
+ traces = [
487
+ {
488
+ "label": jtrace.getLabel(),
489
+ "values": _convert_typed_values(jtrace.getValues()),
490
+ }
491
+ for jtrace in jresult.getTraces()
492
+ ]
493
+
474
494
  return {
475
495
  "results": results,
476
496
  "expectedReturnType": jresult.getExpectedReturnType(),
497
+ "traces": traces,
477
498
  }
478
499
 
479
500
  def search_to_column(self, resource_type: str, search_expression: str) -> Column:
@@ -72,7 +72,7 @@ class DataSource(SparkConversionsMixin):
72
72
  self,
73
73
  resource: Optional[str] = None,
74
74
  select: Optional[Sequence[Dict]] = None,
75
- constants: Optional[Sequence[Dict]] = None,
75
+ constant: Optional[Sequence[Dict]] = None,
76
76
  where: Optional[Sequence[Dict]] = None,
77
77
  json: Optional[str] = None,
78
78
  ) -> DataFrame:
@@ -82,7 +82,7 @@ class DataSource(SparkConversionsMixin):
82
82
  :param resource: The FHIR resource that the view is based upon, e.g. 'Patient' or
83
83
  'Observation'.
84
84
  :param select: A list of columns and nested selects to include in the view.
85
- :param constants: A list of constants that can be used in FHIRPath expressions.
85
+ :param constant: A list of constants that can be used in FHIRPath expressions.
86
86
  :param where: A list of FHIRPath expressions that can be used to filter the view.
87
87
  :param json: A JSON string representing the view definition, as an alternative to providing
88
88
  the parameters as Python objects.
@@ -96,7 +96,7 @@ class DataSource(SparkConversionsMixin):
96
96
  args = locals()
97
97
  query = {
98
98
  key: args[key]
99
- for key in ["resource", "select", "constants", "where"]
99
+ for key in ["resource", "select", "constant", "where"]
100
100
  if args[key] is not None
101
101
  }
102
102
  query_json = dumps(query)
@@ -1,4 +1,4 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
1
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
2
2
  # Organisation (CSIRO) ABN 41 687 119 230.
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
File without changes
File without changes
File without changes