phactor 0.2.0__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.
@@ -0,0 +1,11 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .codex
11
+ .env
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Phactor Python SDK are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ While the SDK is pre-1.0 (`0.x`), breaking changes may accompany a minor version bump.
8
+
9
+ ## [0.2.0] - 2026-07-04
10
+
11
+ ### Breaking
12
+
13
+ - **`ConditionInput.value` (a single `str`) is now `ConditionInput.values` (a
14
+ `list[str]`).** This matches the current Query API schema;
15
+ the previous singular field produced GraphQL-invalid queries against any
16
+ environment running that schema. Wrap each code in a list:
17
+
18
+ ```python
19
+ # Before (0.1.x)
20
+ {"conditions": {"values": [{"type": "ICD10", "value": "E11"}]}}
21
+
22
+ # After (0.2.0)
23
+ {"conditions": {"values": [{"type": "ICD10", "values": ["E11"]}]}}
24
+ ```
25
+
26
+ A single condition input can now carry multiple codes:
27
+ `{"type": "ICD10", "values": ["E11", "E10"]}`.
28
+
29
+ - **`LabValueInput` and `ClinicalMeasurementInput` now validate cross-field and
30
+ raise on under-specified criteria.** Previously the connector silently skipped
31
+ a lab/measurement criterion that carried neither a numeric comparison nor an
32
+ interpretation, inflating cohort counts. The SDK now fails fast at construction
33
+ time:
34
+ - `LabValueInput` requires **either** a complete numeric comparison (`operator`
35
+ **and** `value` **and** `unit`) **or** a non-empty `interpretation`, and at
36
+ least one of `test_code` / `test_name`.
37
+ - `ClinicalMeasurementInput` requires **either** a numeric comparison
38
+ (`operator` **and** `value`) **or** a non-empty `interpretation`. Note the
39
+ asymmetry: `unit` is **not** part of the measurement numeric pair.
40
+
41
+ To support categorical-only queries, `operator` / `value` / `unit` on
42
+ `LabValueInput` and `operator` / `value` on `ClinicalMeasurementInput` are now
43
+ optional. Existing fully-specified numeric criteria are unaffected.
44
+
45
+ ### Changed
46
+
47
+ - **The request timeout now defaults to 600 seconds (previously 30).** The
48
+ default sits deliberately above the platform's own deadlines (connector
49
+ `statement_timeout` 420s < query-api fan-out 540s), so a slow cohort returns a
50
+ server error naming the provider rather than a client-side `TimeoutError` that
51
+ is then retried. `PhactorClient(timeout=...)` and `AsyncPhactorClient(timeout=...)`
52
+ take `float | None` instead of `float`; passing `None` (the new default) resolves
53
+ the value from `PHACTOR_TIMEOUT`, then falls back to 600. Set either to fail faster.
54
+
55
+ ### Added
56
+
57
+ - Typed inputs for procedures, allergies, and immunizations — previously
58
+ raw-dict passthrough, now first-class validated models: `ProcedureInput` /
59
+ `ProceduresInput`, `AllergyInput` / `AllergiesInput`, `ImmunizationInput` /
60
+ `ImmunizationsInput`, wired into `PropositionInput.procedures` / `.allergies` /
61
+ `.immunizations`. The wrapper models omit the internal `criteriaErrors`
62
+ forwarding field.
63
+ - Clinical qualifier filters on existing criteria: `ConditionInput.status` /
64
+ `.severity` / `.stage` (with a new `ConditionStageInput`),
65
+ `MedicationInput.status`, and `.interpretation` on both `LabValueInput` and
66
+ `ClinicalMeasurementInput`.
67
+ - Nine new enums mirroring the query-api schema: `ConditionClinicalStatus`,
68
+ `ConditionSeverity`, `MedicationStatus`, `ProcedureTypeEnum`,
69
+ `ProcedureOutcome`, `AllergyTypeEnum`, `AllergyCriticality`,
70
+ `ImmunizationTypeEnum`, and `InterpretationCode`.
71
+ - The full criteria-building surface (enums and input models) is now exported
72
+ from `phactor` and `phactor.cohorts`, backfilling previously unexported input
73
+ models alongside the new ones.
74
+
75
+ ## [0.1.0] - 2026-03-11
76
+
77
+ - Initial release: authenticated GraphQL client (`PhactorClient` /
78
+ `AsyncPhactorClient`), typed cohort-analysis models, the fluent
79
+ `CohortBuilder`, and pandas result helpers.
80
+
phactor-0.2.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Janeiro Digital, Inc.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
phactor-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.5
2
+ Name: phactor
3
+ Version: 0.2.0
4
+ Summary: Python SDK for the Phactor clinical trial feasibility platform
5
+ Project-URL: Homepage, https://phactor.ai
6
+ Project-URL: Documentation, https://docs.phactor.ai
7
+ Author: Janeiro Digital
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: clinical-trials,cohort,feasibility,graphql,healthcare,real-world-data,sdk
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Healthcare Industry
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: httpx<1,>=0.27
26
+ Requires-Dist: pydantic<3,>=2.0
27
+ Requires-Dist: pyjwt<3,>=2.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: mypy>=1.10; extra == 'dev'
30
+ Requires-Dist: pandas-stubs>=2.0; extra == 'dev'
31
+ Requires-Dist: pandas>=1.5; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
33
+ Requires-Dist: pytest>=8.0; extra == 'dev'
34
+ Requires-Dist: respx>=0.22; extra == 'dev'
35
+ Requires-Dist: ruff>=0.8; extra == 'dev'
36
+ Provides-Extra: pandas
37
+ Requires-Dist: pandas>=1.5; extra == 'pandas'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # Phactor Python SDK
41
+
42
+ Python SDK for the Phactor clinical trial feasibility platform. Authenticate via OAuth2 client credentials and run cohort feasibility queries programmatically.
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pip install phactor
48
+ ```
49
+
50
+ ## Quick Start
51
+
52
+ ### Async
53
+
54
+ ```python
55
+ import asyncio
56
+
57
+ from phactor import AsyncPhactorClient
58
+
59
+
60
+ async def main() -> None:
61
+ async with AsyncPhactorClient(verify="/etc/ssl/certs/zscaler-ca.pem") as client:
62
+ result = await client.cohorts.analyze(
63
+ providers=["provider-uuid"],
64
+ cohort_groups=[
65
+ {
66
+ "inclusionGroupOperator": "AND",
67
+ "inclusionGroups": [
68
+ {
69
+ "name": "Adults",
70
+ "operator": "AND",
71
+ "propositions": [{"age": {"from": 18, "to": 65}}],
72
+ }
73
+ ],
74
+ }
75
+ ],
76
+ include_impact_analysis=True,
77
+ )
78
+
79
+ for analysis in result.analyses:
80
+ print(f"{analysis.provider.name}: {analysis.total_patients} patients")
81
+
82
+
83
+ asyncio.run(main())
84
+ ```
85
+
86
+ ### Sync
87
+
88
+ ```python
89
+ from phactor import PhactorClient
90
+
91
+ with PhactorClient(verify="/etc/ssl/certs/zscaler-ca.pem") as client:
92
+ result = client.cohorts.analyze(
93
+ providers=["provider-uuid"],
94
+ cohort_groups=[
95
+ {
96
+ "inclusionGroupOperator": "AND",
97
+ "inclusionGroups": [
98
+ {
99
+ "name": "Adults",
100
+ "operator": "AND",
101
+ "propositions": [{"age": {"from": 18, "to": 65}}],
102
+ }
103
+ ],
104
+ }
105
+ ],
106
+ )
107
+
108
+ for analysis in result.analyses:
109
+ print(f"{analysis.provider.name}: {analysis.total_patients} patients")
110
+ ```
111
+
112
+ ## Configuration
113
+
114
+ Pass credentials directly or use environment variables:
115
+
116
+ | Parameter | Environment Variable |
117
+ |-----------|---------------------|
118
+ | `client_id` | `PHACTOR_CLIENT_ID` |
119
+ | `client_secret` | `PHACTOR_CLIENT_SECRET` |
120
+ | `entity_id` | `PHACTOR_ENTITY_ID` |
121
+ | `fusionauth_url` | `PHACTOR_FUSIONAUTH_URL` |
122
+ | `gateway_url` | `PHACTOR_GATEWAY_URL` |
123
+ | `verify` | `PHACTOR_CA_BUNDLE` |
124
+ | `timeout` | `PHACTOR_TIMEOUT` |
125
+
126
+ ```bash
127
+ export PHACTOR_CLIENT_ID="your-client-id"
128
+ export PHACTOR_CLIENT_SECRET="your-client-secret"
129
+ export PHACTOR_ENTITY_ID="your-entity-id"
130
+ export PHACTOR_FUSIONAUTH_URL="https://auth.phactor.ai"
131
+ export PHACTOR_GATEWAY_URL="https://federated-gateway.phactor.ai/graphql"
132
+ export PHACTOR_CA_BUNDLE="/etc/ssl/certs/zscaler-ca.pem"
133
+ export PHACTOR_TIMEOUT="600" # seconds; optional, this is the default
134
+ ```
135
+
136
+ If you prefer explicit configuration, pass the same values into `PhactorClient(...)` or `AsyncPhactorClient(...)`.
137
+
138
+ If `verify` is not passed explicitly, the SDK will use `PHACTOR_CA_BUNDLE` when present and otherwise default to standard TLS verification. The same setting is used for both FusionAuth token requests and Phactor gateway API requests.
139
+
140
+ ```python
141
+ from phactor import PhactorClient
142
+
143
+ client = PhactorClient(
144
+ client_id="your-client-id",
145
+ client_secret="your-client-secret",
146
+ fusionauth_url="https://auth.phactor.ai",
147
+ gateway_url="https://federated-gateway.phactor.ai/graphql",
148
+ verify="/etc/ssl/certs/zscaler-ca.pem",
149
+ )
150
+ ```
151
+
152
+ ## Reliability Notes
153
+
154
+ - The SDK caches OAuth tokens and refreshes them automatically when needed.
155
+ - API requests retry on transient failures such as `429`, `502`, `503`, `504`, timeouts, and temporary connection errors.
156
+ - The request timeout defaults to **600 seconds**, deliberately above the platform's own deadlines (connector 420s < query fan-out 540s), so a slow cohort returns a server error naming the provider rather than a client-side `TimeoutError` that is then retried three times. Lower it with `PHACTOR_TIMEOUT` or `timeout=` if you want to fail faster.
157
+ - If an API request returns `401`, the SDK invalidates the cached token, fetches a fresh token, and retries once before raising `AuthenticationError`.
158
+ - `AsyncPhactorClient` should be used through `async with` or closed explicitly with `await client.close()`. Once closed, further use raises `PhactorError`.
159
+
160
+ ## Fluent Cohort Builder
161
+
162
+ ```python
163
+ from phactor.cohorts import CohortBuilder, Proposition
164
+
165
+ cohort = (
166
+ CohortBuilder(inclusion_operator="OR")
167
+ .include("Core criteria", operator="AND")
168
+ .add(Proposition(age={"from": 18}))
169
+ .add(
170
+ Proposition(
171
+ conditions={
172
+ "values": [
173
+ {"type": "ICD10", "values": ["E11"]} # Type 2 Diabetes
174
+ ]
175
+ }
176
+ )
177
+ )
178
+ .done()
179
+ .exclude("Recent CV events", operator="OR")
180
+ .add(
181
+ Proposition(
182
+ conditions={
183
+ "values": [
184
+ {
185
+ "type": "ICD10",
186
+ "values": ["I21"], # myocardial infarction
187
+ "timing": {
188
+ "operator": "LESS_THAN_OR_EQUALS",
189
+ "value": 180,
190
+ "unit": "DAYS",
191
+ "reference": "SCREENING",
192
+ },
193
+ }
194
+ ]
195
+ }
196
+ )
197
+ )
198
+ .done()
199
+ .build()
200
+ )
201
+
202
+ async with AsyncPhactorClient() as client:
203
+ result = await client.cohorts.analyze(
204
+ providers=["provider-1"],
205
+ cohort_groups=[cohort],
206
+ include_impact_analysis=True,
207
+ )
208
+ ```
209
+
210
+ You can also pass typed models directly instead of raw dictionaries:
211
+
212
+ ```python
213
+ from phactor import CohortGroupInput, CriteriaGroupInput, PropositionInput
214
+
215
+ cohort = CohortGroupInput(
216
+ inclusion_group_operator="AND",
217
+ inclusion_groups=[
218
+ CriteriaGroupInput(
219
+ name="Adults",
220
+ operator="AND",
221
+ propositions=[PropositionInput(age={"from": 18, "to": 65})],
222
+ )
223
+ ],
224
+ )
225
+ ```
226
+
227
+ There are three independent operator levels:
228
+
229
+ - `cohort_group_operator` combines complete pathways when a request intentionally
230
+ contains more than one `CohortGroupInput`.
231
+ - `inclusion_group_operator` combines the inclusion groups inside one pathway.
232
+ - `CriteriaGroupInput.operator` (`AND`, `OR`, or `SOME`) combines propositions
233
+ inside one named criteria group.
234
+
235
+ Exclusion groups are always unioned and subtracted from the pathway's combined
236
+ inclusion result. For example, an `OR` pathway with inclusion groups `A` and `B`
237
+ and exclusion group `E` evaluates as `(A OR B) EXCEPT E`.