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.
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/PKG-INFO +1 -1
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/_version.py +2 -2
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/context.py +29 -8
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/datasource.py +3 -3
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pyproject.toml +1 -1
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/.gitignore +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/LICENSE +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/README.md +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/bulk.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/bundles/Bennett146_Swaniawski813_704c9750-f6e6-473b-ee83-fbd48e07fe3f.json +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/bundles/Dino214_Parisian75_40d82b80-b682-cd8b-da6d-396809878641.json +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/csv/conditions.csv +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/resources/Condition.ndjson +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/data/resources/Patient.ndjson +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/designation.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/display.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/encode_bundles.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/encode_resources.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/fhir_search.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/fhir_view.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/member_of.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/property_of.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/subsumes.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/examples/translate.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/__init__.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/bulk.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/coding.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/core.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/datasink.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/fhir.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/functions.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/spark.py +0 -0
- {pathling-9.5.0.dev0 → pathling-9.6.0.dev0}/pathling/udfs.py +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# Auto generated from POM project version.
|
|
3
3
|
# Please do not modify.
|
|
4
4
|
#
|
|
5
|
-
__version__="9.
|
|
6
|
-
__java_version__="9.
|
|
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)
|
|
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
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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
|
-
|
|
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
|
|
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", "
|
|
99
|
+
for key in ["resource", "select", "constant", "where"]
|
|
100
100
|
if args[key] is not None
|
|
101
101
|
}
|
|
102
102
|
query_json = dumps(query)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|