fhirpathpy 3.0.0__tar.gz → 3.0.1__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. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/PKG-INFO +1 -1
  2. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/__init__.py +19 -6
  3. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/__init__.py +4 -1
  4. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/LICENSE.md +0 -0
  5. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/README.md +0 -0
  6. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/__init__.py +0 -0
  7. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/evaluators/__init__.py +0 -0
  8. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/__init__.py +0 -0
  9. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/aggregate.py +0 -0
  10. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/collections.py +0 -0
  11. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/combining.py +0 -0
  12. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/constants.py +0 -0
  13. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/datetime.py +0 -0
  14. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/equality.py +0 -0
  15. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/existence.py +0 -0
  16. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/filtering.py +0 -0
  17. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/logic.py +0 -0
  18. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/math.py +0 -0
  19. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/misc.py +0 -0
  20. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/navigation.py +0 -0
  21. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/strings.py +0 -0
  22. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/subsetting.py +0 -0
  23. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/invocations/types.py +0 -0
  24. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/nodes.py +0 -0
  25. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/engine/util.py +0 -0
  26. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/dstu2/choiceTypePaths.json +0 -0
  27. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/dstu2/path2Type.json +0 -0
  28. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/dstu2/pathsDefinedElsewhere.json +0 -0
  29. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/dstu2/type2Parent.json +0 -0
  30. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r4/choiceTypePaths.json +0 -0
  31. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r4/path2Type.json +0 -0
  32. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r4/pathsDefinedElsewhere.json +0 -0
  33. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r4/type2Parent.json +0 -0
  34. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r5/choiceTypePaths.json +0 -0
  35. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r5/path2Type.json +0 -0
  36. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r5/pathsDefinedElsewhere.json +0 -0
  37. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/r5/type2Parent.json +0 -0
  38. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/stu3/choiceTypePaths.json +0 -0
  39. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/stu3/path2Type.json +0 -0
  40. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/stu3/pathsDefinedElsewhere.json +0 -0
  41. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/models/stu3/type2Parent.json +0 -0
  42. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/ASTPathListener.py +0 -0
  43. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/FHIRPath.g4 +0 -0
  44. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/README.md +0 -0
  45. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/__init__.py +0 -0
  46. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPath.interp +0 -0
  47. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPath.tokens +0 -0
  48. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPathLexer.interp +0 -0
  49. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPathLexer.py +0 -0
  50. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPathLexer.tokens +0 -0
  51. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPathListener.py +0 -0
  52. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/FHIRPathParser.py +0 -0
  53. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/parser/generated/__init__.py +0 -0
  54. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/fhirpathpy/py.typed +0 -0
  55. {fhirpathpy-3.0.0 → fhirpathpy-3.0.1}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fhirpathpy
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Summary: FHIRPath implementation in Python
5
5
  Keywords: fhir,fhirpath
6
6
  Author-email: "beda.software" <fhirpath@beda.software>
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from collections.abc import Callable, Mapping, Sequence
4
- from typing import Any, Protocol, TypeVar, cast
4
+ from typing import Any, Protocol, TypedDict, TypeVar, cast
5
5
 
6
6
  from fhirpathpy.engine import do_eval
7
7
  from fhirpathpy.engine.invocations.constants import constants
@@ -16,7 +16,7 @@ from fhirpathpy.engine.util import (
16
16
  from fhirpathpy.parser import parse
17
17
 
18
18
  __title__ = "fhirpathpy"
19
- __version__ = "3.0.0"
19
+ __version__ = "3.0.1"
20
20
  __author__ = "beda.software"
21
21
  __license__ = "MIT"
22
22
  __copyright__ = "Copyright 2026 beda.software"
@@ -28,6 +28,19 @@ ResourceType = Mapping[str, Any]
28
28
  ContextType = Mapping[str, Any] | None
29
29
 
30
30
 
31
+ class Model(TypedDict):
32
+ choiceTypePaths: dict[str, list[str]]
33
+ pathsDefinedElsewhere: dict[str, str]
34
+ type2Parent: dict[str, str]
35
+ path2Type: dict[str, str]
36
+
37
+
38
+ class Options(TypedDict, total=False):
39
+ userInvocationTable: dict[str, Any]
40
+ traceFn: Callable[[str, list], Any]
41
+ returnRawData: bool
42
+
43
+
31
44
  def apply_parsed_path(resource, parsedPath, context=None, model=None, options=None):
32
45
  constants.reset()
33
46
  dataRoot = arraify(resource)
@@ -107,9 +120,9 @@ def apply_parsed_path(resource, parsedPath, context=None, model=None, options=No
107
120
  def evaluate(
108
121
  resource: ResourceType | list,
109
122
  path: str | dict,
110
- context: dict | None = None,
111
- model: dict | None = None,
112
- options: dict | None = None,
123
+ context: ContextType = None,
124
+ model: Model | None = None,
125
+ options: Options | None = None,
113
126
  ) -> list:
114
127
  """
115
128
  Evaluates the "path" FHIRPath expression on the given resource, using data
@@ -136,7 +149,7 @@ def evaluate(
136
149
 
137
150
 
138
151
  def compile(
139
- path: str, model: dict | None = None, options: dict | None = None
152
+ path: str, model: Model | None = None, options: Options | None = None
140
153
  ) -> Callable[[ResourceType, ContextType], list]:
141
154
  """
142
155
  Returns a function that takes a resource and an optional context hash (see
@@ -2,10 +2,13 @@ import json
2
2
  import os
3
3
  import pathlib
4
4
  from collections import defaultdict
5
+ from typing import cast
6
+
7
+ from fhirpathpy import Model
5
8
 
6
9
  current_dir = pathlib.Path(__file__).parent.resolve()
7
10
 
8
- models = defaultdict(dict)
11
+ models = cast("defaultdict[str, Model]", defaultdict(dict))
9
12
 
10
13
  dirs = [f for f in os.listdir(current_dir)]
11
14
 
File without changes
File without changes
File without changes