phactor 0.3.1__tar.gz → 0.3.2__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 (26) hide show
  1. {phactor-0.3.1 → phactor-0.3.2}/CHANGELOG.md +22 -0
  2. {phactor-0.3.1 → phactor-0.3.2}/PKG-INFO +1 -1
  3. phactor-0.3.2/src/phactor/_version.py +1 -0
  4. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/cohorts/models.py +18 -4
  5. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/sites/models.py +3 -2
  6. phactor-0.3.1/src/phactor/_version.py +0 -1
  7. {phactor-0.3.1 → phactor-0.3.2}/.gitignore +0 -0
  8. {phactor-0.3.1 → phactor-0.3.2}/LICENSE +0 -0
  9. {phactor-0.3.1 → phactor-0.3.2}/README.md +0 -0
  10. {phactor-0.3.1 → phactor-0.3.2}/pyproject.toml +0 -0
  11. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/__init__.py +0 -0
  12. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/_graphql.py +0 -0
  13. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/_http.py +0 -0
  14. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/auth.py +0 -0
  15. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/client.py +0 -0
  16. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/cohorts/__init__.py +0 -0
  17. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/cohorts/builder.py +0 -0
  18. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/cohorts/client.py +0 -0
  19. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/cohorts/query.py +0 -0
  20. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/config.py +0 -0
  21. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/exceptions.py +0 -0
  22. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/pandas.py +0 -0
  23. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/py.typed +0 -0
  24. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/sites/__init__.py +0 -0
  25. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/sites/client.py +0 -0
  26. {phactor-0.3.1 → phactor-0.3.2}/src/phactor/sites/query.py +0 -0
@@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  While the SDK is pre-1.0 (`0.x`), breaking changes may accompany a minor version bump.
8
8
 
9
+ ## [0.3.2] - 2026-09-24
10
+
11
+ ### Fixed
12
+
13
+ - `client.cohorts.analyze` no longer fails when a provider reports a criterion
14
+ error reason other than `NO_TRANSLATION` / `NO_PATH`. 0.3.1 raised a pydantic
15
+ `ValidationError` for `UNSUPPORTED_SEMANTICS` (returned today, for example,
16
+ for exact product codes a provider cannot match), so one unevaluated criterion
17
+ made the whole result unreadable.
18
+
19
+ ### Added
20
+
21
+ - `CriterionErrorReason.UNSUPPORTED_SEMANTICS`, `INSUFFICIENT_DATA`,
22
+ `MATERIALIZATION_NOT_READY` and `CriterionErrorDomain.AGE`, `MEASUREMENT`,
23
+ `ENCOUNTER`, matching the API.
24
+
25
+ ### Changed
26
+
27
+ - Response values this SDK version does not know yet (`CriterionError.reason`,
28
+ `CriterionError.domain`, `Site.access`) are kept as plain strings instead of
29
+ failing validation, so a value the API adds later cannot break parsing.
30
+
9
31
  ## [0.3.1] - 2026-09-24
10
32
 
11
33
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: phactor
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Python SDK for the Phactor clinical trial feasibility platform
5
5
  Project-URL: Homepage, https://phactor.ai
6
6
  Project-URL: Documentation, https://docs.phactor.ai
@@ -0,0 +1 @@
1
+ __version__ = "0.3.2"
@@ -233,11 +233,23 @@ class CohortGroupOperator(str, Enum):
233
233
 
234
234
 
235
235
  class CriterionErrorReason(str, Enum):
236
- NO_TRANSLATION = "NO_TRANSLATION"
237
- NO_PATH = "NO_PATH"
236
+ """Why a provider could not evaluate a criterion. Values the server adds
237
+ later reach ``CriterionError.reason`` as plain strings instead of failing."""
238
+
239
+ UNSUPPORTED_SEMANTICS = "UNSUPPORTED_SEMANTICS"
240
+ INSUFFICIENT_DATA = "INSUFFICIENT_DATA"
241
+ MATERIALIZATION_NOT_READY = "MATERIALIZATION_NOT_READY"
242
+ NO_TRANSLATION = "NO_TRANSLATION" # a crosswalk route exists but this code has no entry
243
+ NO_PATH = "NO_PATH" # no translation route from the source system to the provider's
238
244
 
239
245
 
240
246
  class CriterionErrorDomain(str, Enum):
247
+ """The criterion type a ``CriterionError`` is about. Values the server adds
248
+ later reach ``CriterionError.domain`` as plain strings instead of failing."""
249
+
250
+ AGE = "AGE"
251
+ MEASUREMENT = "MEASUREMENT"
252
+ ENCOUNTER = "ENCOUNTER"
241
253
  CONDITION = "CONDITION"
242
254
  PROCEDURE = "PROCEDURE"
243
255
  ALLERGY = "ALLERGY"
@@ -677,10 +689,12 @@ class DemographicBreakdown(BaseModel):
677
689
  class CriterionError(BaseModel):
678
690
  model_config = _MODEL_CONFIG
679
691
 
680
- domain: CriterionErrorDomain
692
+ # Response enums fall back to the raw string for values this SDK version
693
+ # does not know yet, so a new server value never breaks parsing a result.
694
+ domain: CriterionErrorDomain | str = Field(union_mode="left_to_right")
681
695
  source_type: str
682
696
  source_value: str
683
- reason: CriterionErrorReason
697
+ reason: CriterionErrorReason | str = Field(union_mode="left_to_right")
684
698
  message: str | None = None
685
699
 
686
700
 
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from enum import Enum
6
6
 
7
- from pydantic import BaseModel, ConfigDict
7
+ from pydantic import BaseModel, ConfigDict, Field
8
8
  from pydantic.alias_generators import to_camel
9
9
 
10
10
  from phactor.cohorts.models import LocationTypeEnum, LocationValueInput
@@ -34,7 +34,8 @@ class Site(BaseModel):
34
34
  country: str | None = None
35
35
  latitude: float
36
36
  longitude: float
37
- access: SiteAccess
37
+ # A value this SDK version does not know yet stays a plain string.
38
+ access: SiteAccess | str = Field(union_mode="left_to_right")
38
39
 
39
40
  def as_location(self, *, radius: int = 10) -> LocationValueInput:
40
41
  """A SITE location value matching patients within ``radius`` miles of this site.
@@ -1 +0,0 @@
1
- __version__ = "0.3.1"
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