@gpt-platform/client 0.10.4 → 0.11.0
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.
- package/dist/_internal/client/client.gen.d.ts +3 -0
- package/dist/_internal/client/client.gen.d.ts.map +1 -0
- package/dist/_internal/client/index.d.ts +9 -0
- package/dist/_internal/client/index.d.ts.map +1 -0
- package/dist/_internal/client/types.gen.d.ts +118 -0
- package/dist/_internal/client/types.gen.d.ts.map +1 -0
- package/dist/_internal/client/utils.gen.d.ts +34 -0
- package/dist/_internal/client/utils.gen.d.ts.map +1 -0
- package/dist/_internal/client.gen.d.ts +13 -0
- package/dist/_internal/client.gen.d.ts.map +1 -0
- package/dist/_internal/core/auth.gen.d.ts +19 -0
- package/dist/_internal/core/auth.gen.d.ts.map +1 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts +26 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/params.gen.d.ts +44 -0
- package/dist/_internal/core/params.gen.d.ts.map +1 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts +34 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/_internal/core/types.gen.d.ts +79 -0
- package/dist/_internal/core/types.gen.d.ts.map +1 -0
- package/dist/_internal/core/utils.gen.d.ts +20 -0
- package/dist/_internal/core/utils.gen.d.ts.map +1 -0
- package/dist/_internal/index.d.ts +3 -0
- package/dist/_internal/index.d.ts.map +1 -0
- package/dist/_internal/sdk.gen.d.ts +7053 -0
- package/dist/_internal/sdk.gen.d.ts.map +1 -0
- package/dist/_internal/types.gen.d.ts +146633 -0
- package/dist/_internal/types.gen.d.ts.map +1 -0
- package/dist/base-client.d.ts +199 -0
- package/dist/base-client.d.ts.map +1 -0
- package/dist/errors/index.d.ts +128 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/execution-events.d.ts +95 -0
- package/dist/execution-events.d.ts.map +1 -0
- package/dist/gpt-client.d.ts +2175 -0
- package/dist/gpt-client.d.ts.map +1 -0
- package/dist/index.d.ts +51 -30308
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +775 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +775 -14
- package/dist/index.mjs.map +1 -1
- package/dist/json-api.d.ts +26 -0
- package/dist/json-api.d.ts.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/namespace-types.d.ts +79 -0
- package/dist/namespace-types.d.ts.map +1 -0
- package/dist/namespaces/access-grants.d.ts +71 -0
- package/dist/namespaces/access-grants.d.ts.map +1 -0
- package/dist/namespaces/agents.d.ts +1406 -0
- package/dist/namespaces/agents.d.ts.map +1 -0
- package/dist/namespaces/ai.d.ts +407 -0
- package/dist/namespaces/ai.d.ts.map +1 -0
- package/dist/namespaces/audit.d.ts +83 -0
- package/dist/namespaces/audit.d.ts.map +1 -0
- package/dist/namespaces/billing.d.ts +854 -0
- package/dist/namespaces/billing.d.ts.map +1 -0
- package/dist/namespaces/campaigns.d.ts +973 -0
- package/dist/namespaces/campaigns.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +964 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/channels.d.ts +162 -0
- package/dist/namespaces/channels.d.ts.map +1 -0
- package/dist/namespaces/clinical.d.ts +2443 -0
- package/dist/namespaces/clinical.d.ts.map +1 -0
- package/dist/namespaces/communication.d.ts +439 -0
- package/dist/namespaces/communication.d.ts.map +1 -0
- package/dist/namespaces/compliance.d.ts +2310 -0
- package/dist/namespaces/compliance.d.ts.map +1 -0
- package/dist/namespaces/connectors.d.ts +1368 -0
- package/dist/namespaces/connectors.d.ts.map +1 -0
- package/dist/namespaces/content.d.ts +188 -0
- package/dist/namespaces/content.d.ts.map +1 -0
- package/dist/namespaces/crawler.d.ts +408 -0
- package/dist/namespaces/crawler.d.ts.map +1 -0
- package/dist/namespaces/crm-clusters.d.ts +31 -0
- package/dist/namespaces/crm-clusters.d.ts.map +1 -0
- package/dist/namespaces/crm.d.ts +1539 -0
- package/dist/namespaces/crm.d.ts.map +1 -0
- package/dist/namespaces/documents.d.ts +136 -0
- package/dist/namespaces/documents.d.ts.map +1 -0
- package/dist/namespaces/email.d.ts +550 -0
- package/dist/namespaces/email.d.ts.map +1 -0
- package/dist/namespaces/extraction.d.ts +1249 -0
- package/dist/namespaces/extraction.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +411 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/imports.d.ts +177 -0
- package/dist/namespaces/imports.d.ts.map +1 -0
- package/dist/namespaces/index.d.ts +119 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/memory.d.ts +105 -0
- package/dist/namespaces/memory.d.ts.map +1 -0
- package/dist/namespaces/models.d.ts +75 -0
- package/dist/namespaces/models.d.ts.map +1 -0
- package/dist/namespaces/permissions.d.ts +75 -0
- package/dist/namespaces/permissions.d.ts.map +1 -0
- package/dist/namespaces/pipeline-executions.d.ts +130 -0
- package/dist/namespaces/pipeline-executions.d.ts.map +1 -0
- package/dist/namespaces/pipelines.d.ts +120 -0
- package/dist/namespaces/pipelines.d.ts.map +1 -0
- package/dist/namespaces/platform.d.ts +1430 -0
- package/dist/namespaces/platform.d.ts.map +1 -0
- package/dist/namespaces/portal.d.ts +198 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/projects.d.ts +553 -0
- package/dist/namespaces/projects.d.ts.map +1 -0
- package/dist/namespaces/roles.d.ts +65 -0
- package/dist/namespaces/roles.d.ts.map +1 -0
- package/dist/namespaces/scheduling.d.ts +944 -0
- package/dist/namespaces/scheduling.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +224 -0
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/session-notes.d.ts +67 -0
- package/dist/namespaces/session-notes.d.ts.map +1 -0
- package/dist/namespaces/social.d.ts +330 -0
- package/dist/namespaces/social.d.ts.map +1 -0
- package/dist/namespaces/storage.d.ts +378 -0
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/support.d.ts +427 -0
- package/dist/namespaces/support.d.ts.map +1 -0
- package/dist/namespaces/threads.d.ts +596 -0
- package/dist/namespaces/threads.d.ts.map +1 -0
- package/dist/namespaces/training.d.ts +358 -0
- package/dist/namespaces/training.d.ts.map +1 -0
- package/dist/namespaces/voice.d.ts +752 -0
- package/dist/namespaces/voice.d.ts.map +1 -0
- package/dist/namespaces/watcher.d.ts +425 -0
- package/dist/namespaces/watcher.d.ts.map +1 -0
- package/dist/namespaces/webhooks-ns.d.ts +3 -0
- package/dist/namespaces/webhooks-ns.d.ts.map +1 -0
- package/dist/pagination.d.ts +57 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/request-builder.d.ts +95 -0
- package/dist/request-builder.d.ts.map +1 -0
- package/dist/security.d.ts +32 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/streaming.d.ts +135 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +63 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webhook-signature.d.ts +109 -0
- package/dist/webhook-signature.d.ts.map +1 -0
- package/llms.txt +40 -1
- package/package.json +286 -36
- package/dist/index.d.mts +0 -30308
|
@@ -0,0 +1,2443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clinical namespace for the GPT Platform Client SDK.
|
|
3
|
+
* Covers patients, sessions, notes, health metrics, meal plans,
|
|
4
|
+
* goals, supplements, deliveries, note versions, practice resources,
|
|
5
|
+
* practice tools, client resource assignments, and supplement caches.
|
|
6
|
+
*/
|
|
7
|
+
import type { ClinicalClientGoal as RawClinicalClientGoal, ClinicalClientMedication as RawClinicalClientMedication, ClinicalClientResourceAssignment as RawClinicalClientResourceAssignment, ClinicalClientSupplement as RawClinicalClientSupplement, ClinicalDelivery as RawClinicalDelivery, ClinicalGoalTemplate as RawClinicalGoalTemplate, ClinicalGoalTemplateCategory as RawClinicalGoalTemplateCategory, ClinicalHealthMetric as RawClinicalHealthMetric, ClinicalMealPlan as RawClinicalMealPlan, ClinicalNote as RawClinicalNote, ClinicalNoteVersion as RawClinicalNoteVersion, ClinicalPatient as RawClinicalPatient, ClinicalPracticeResource as RawClinicalPracticeResource, ClinicalPracticeTool as RawClinicalPracticeTool, ClinicalSession as RawClinicalSession, ClinicalSupplementRecCache as RawClinicalSupplementRecCache } from "../_internal/types.gen";
|
|
8
|
+
import type { FlatResource } from "../json-api";
|
|
9
|
+
import type { RequestOptions } from "../base-client";
|
|
10
|
+
import { RequestBuilder } from "../request-builder";
|
|
11
|
+
export type ClinicalClientGoal = FlatResource<RawClinicalClientGoal>;
|
|
12
|
+
export type ClinicalClientResourceAssignment = FlatResource<RawClinicalClientResourceAssignment>;
|
|
13
|
+
export type ClinicalClientMedication = FlatResource<RawClinicalClientMedication>;
|
|
14
|
+
export type ClinicalClientSupplement = FlatResource<RawClinicalClientSupplement>;
|
|
15
|
+
export type ClinicalDelivery = FlatResource<RawClinicalDelivery>;
|
|
16
|
+
export type ClinicalGoalTemplate = FlatResource<RawClinicalGoalTemplate>;
|
|
17
|
+
export type ClinicalGoalTemplateCategory = FlatResource<RawClinicalGoalTemplateCategory>;
|
|
18
|
+
export type ClinicalHealthMetric = FlatResource<RawClinicalHealthMetric>;
|
|
19
|
+
export type ClinicalMealPlan = FlatResource<RawClinicalMealPlan>;
|
|
20
|
+
export type ClinicalNote = FlatResource<RawClinicalNote>;
|
|
21
|
+
export type ClinicalNoteVersion = FlatResource<RawClinicalNoteVersion>;
|
|
22
|
+
export type ClinicalPatient = FlatResource<RawClinicalPatient>;
|
|
23
|
+
export type ClinicalPracticeResource = FlatResource<RawClinicalPracticeResource>;
|
|
24
|
+
export type ClinicalPracticeTool = FlatResource<RawClinicalPracticeTool>;
|
|
25
|
+
export type ClinicalSession = FlatResource<RawClinicalSession>;
|
|
26
|
+
export type ClinicalSupplementRecCache = FlatResource<RawClinicalSupplementRecCache>;
|
|
27
|
+
export interface CreateClinicalPatientAttributes {
|
|
28
|
+
workspace_id: string;
|
|
29
|
+
contact_id?: string;
|
|
30
|
+
assigned_user_id?: string;
|
|
31
|
+
status?: string;
|
|
32
|
+
timezone?: string;
|
|
33
|
+
state?: string;
|
|
34
|
+
tags?: string[];
|
|
35
|
+
date_of_birth?: string;
|
|
36
|
+
sex?: string;
|
|
37
|
+
height_inches?: number;
|
|
38
|
+
weight_lbs?: number;
|
|
39
|
+
goal_weight_lbs?: number;
|
|
40
|
+
activity_level?: string;
|
|
41
|
+
eating_style?: string[];
|
|
42
|
+
meals_per_day?: number;
|
|
43
|
+
snacks_per_day?: number;
|
|
44
|
+
conditions?: string[];
|
|
45
|
+
food_aversions?: string[];
|
|
46
|
+
food_allergies?: string[];
|
|
47
|
+
food_preferences?: string[];
|
|
48
|
+
target_calories_override?: number;
|
|
49
|
+
protein_pct?: number;
|
|
50
|
+
carbs_pct?: number;
|
|
51
|
+
fat_pct?: number;
|
|
52
|
+
protein_unit?: string;
|
|
53
|
+
protein_per_weight?: number;
|
|
54
|
+
followup_interval_value?: number;
|
|
55
|
+
followup_interval_unit?: string;
|
|
56
|
+
primary_insurance?: string;
|
|
57
|
+
diagnosis_codes?: string[];
|
|
58
|
+
referring_physician_name?: string;
|
|
59
|
+
referring_physician_phone?: string;
|
|
60
|
+
referring_physician_fax?: string;
|
|
61
|
+
profile_data?: Record<string, unknown>;
|
|
62
|
+
external_ids?: Record<string, string>;
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
export interface UpdateClinicalPatientAttributes {
|
|
66
|
+
contact_id?: string;
|
|
67
|
+
assigned_user_id?: string;
|
|
68
|
+
status?: string;
|
|
69
|
+
timezone?: string;
|
|
70
|
+
state?: string;
|
|
71
|
+
tags?: string[];
|
|
72
|
+
date_of_birth?: string;
|
|
73
|
+
sex?: string;
|
|
74
|
+
height_inches?: number;
|
|
75
|
+
weight_lbs?: number;
|
|
76
|
+
goal_weight_lbs?: number;
|
|
77
|
+
activity_level?: string;
|
|
78
|
+
eating_style?: string[];
|
|
79
|
+
meals_per_day?: number;
|
|
80
|
+
snacks_per_day?: number;
|
|
81
|
+
conditions?: string[];
|
|
82
|
+
food_aversions?: string[];
|
|
83
|
+
food_allergies?: string[];
|
|
84
|
+
food_preferences?: string[];
|
|
85
|
+
target_calories_override?: number;
|
|
86
|
+
protein_pct?: number;
|
|
87
|
+
carbs_pct?: number;
|
|
88
|
+
fat_pct?: number;
|
|
89
|
+
protein_unit?: string;
|
|
90
|
+
protein_per_weight?: number;
|
|
91
|
+
followup_interval_value?: number;
|
|
92
|
+
followup_interval_unit?: string;
|
|
93
|
+
primary_insurance?: string;
|
|
94
|
+
diagnosis_codes?: string[];
|
|
95
|
+
referring_physician_name?: string;
|
|
96
|
+
referring_physician_phone?: string;
|
|
97
|
+
referring_physician_fax?: string;
|
|
98
|
+
profile_data?: Record<string, unknown>;
|
|
99
|
+
external_ids?: Record<string, string>;
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
export interface CreateClinicalSessionAttributes {
|
|
103
|
+
workspace_id: string;
|
|
104
|
+
patient_id: string;
|
|
105
|
+
practitioner_id?: string;
|
|
106
|
+
event_id?: string;
|
|
107
|
+
session_type?: string;
|
|
108
|
+
session_status?: string;
|
|
109
|
+
session_format?: string;
|
|
110
|
+
session_date?: string;
|
|
111
|
+
duration_minutes?: number;
|
|
112
|
+
transcript_storage_key?: string;
|
|
113
|
+
transcript?: string;
|
|
114
|
+
session_summary?: string;
|
|
115
|
+
notes?: string;
|
|
116
|
+
external_ids?: Record<string, string>;
|
|
117
|
+
prep_execution_id?: string;
|
|
118
|
+
metadata?: Record<string, unknown>;
|
|
119
|
+
}
|
|
120
|
+
export interface UpdateClinicalSessionAttributes {
|
|
121
|
+
practitioner_id?: string;
|
|
122
|
+
event_id?: string;
|
|
123
|
+
pipeline_execution_id?: string;
|
|
124
|
+
session_type?: string;
|
|
125
|
+
session_status?: string;
|
|
126
|
+
session_format?: string;
|
|
127
|
+
session_date?: string;
|
|
128
|
+
duration_minutes?: number;
|
|
129
|
+
transcript_storage_key?: string;
|
|
130
|
+
transcript?: string;
|
|
131
|
+
session_summary?: string;
|
|
132
|
+
notes?: string;
|
|
133
|
+
external_ids?: Record<string, string>;
|
|
134
|
+
prep_execution_id?: string;
|
|
135
|
+
metadata?: Record<string, unknown>;
|
|
136
|
+
}
|
|
137
|
+
export interface CreateClinicalNoteAttributes {
|
|
138
|
+
workspace_id: string;
|
|
139
|
+
session_id: string;
|
|
140
|
+
pipeline_execution_id?: string;
|
|
141
|
+
note_type?: string;
|
|
142
|
+
note_content?: string;
|
|
143
|
+
amends_note_id?: string;
|
|
144
|
+
metadata?: Record<string, unknown>;
|
|
145
|
+
}
|
|
146
|
+
export interface UpdateClinicalNoteAttributes {
|
|
147
|
+
pipeline_execution_id?: string;
|
|
148
|
+
note_type?: string;
|
|
149
|
+
note_content?: string;
|
|
150
|
+
metadata?: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
export interface CreateHealthMetricAttributes {
|
|
153
|
+
workspace_id: string;
|
|
154
|
+
patient_id: string;
|
|
155
|
+
session_id?: string;
|
|
156
|
+
pipeline_execution_id?: string;
|
|
157
|
+
metric_type: string;
|
|
158
|
+
metric_category?: string;
|
|
159
|
+
value_numeric?: number;
|
|
160
|
+
value_text?: string;
|
|
161
|
+
unit?: string;
|
|
162
|
+
measured_at?: string;
|
|
163
|
+
source?: string;
|
|
164
|
+
extracted_from?: string;
|
|
165
|
+
confidence?: number;
|
|
166
|
+
raw_extract?: string;
|
|
167
|
+
metadata?: Record<string, unknown>;
|
|
168
|
+
}
|
|
169
|
+
export interface UpdateHealthMetricAttributes {
|
|
170
|
+
metric_type?: string;
|
|
171
|
+
metric_category?: string;
|
|
172
|
+
value_numeric?: number;
|
|
173
|
+
value_text?: string;
|
|
174
|
+
unit?: string;
|
|
175
|
+
measured_at?: string;
|
|
176
|
+
source?: string;
|
|
177
|
+
confidence?: number;
|
|
178
|
+
metadata?: Record<string, unknown>;
|
|
179
|
+
}
|
|
180
|
+
export interface CreateMealPlanAttributes {
|
|
181
|
+
workspace_id: string;
|
|
182
|
+
/** Patient UUID. Optional if `session_id` is provided — auto-populated from the session's patient. Required when creating a meal plan without a session. */
|
|
183
|
+
patient_id?: string;
|
|
184
|
+
session_id?: string;
|
|
185
|
+
pipeline_execution_id?: string;
|
|
186
|
+
status?: string;
|
|
187
|
+
plan_type?: string;
|
|
188
|
+
goal_calories?: number;
|
|
189
|
+
macro_targets?: Record<string, unknown>;
|
|
190
|
+
plan_content?: string;
|
|
191
|
+
patient_notes?: string;
|
|
192
|
+
parent_plan_id?: string;
|
|
193
|
+
metadata?: Record<string, unknown>;
|
|
194
|
+
}
|
|
195
|
+
export interface UpdateMealPlanAttributes {
|
|
196
|
+
status?: string;
|
|
197
|
+
plan_type?: string;
|
|
198
|
+
goal_calories?: number;
|
|
199
|
+
macro_targets?: Record<string, unknown>;
|
|
200
|
+
plan_content?: string;
|
|
201
|
+
patient_notes?: string;
|
|
202
|
+
metadata?: Record<string, unknown>;
|
|
203
|
+
}
|
|
204
|
+
export interface CreateClientGoalAttributes {
|
|
205
|
+
workspace_id: string;
|
|
206
|
+
patient_id: string;
|
|
207
|
+
status?: "active" | "completed" | "abandoned" | "paused" | "achieved" | "discontinued";
|
|
208
|
+
goal_type: string;
|
|
209
|
+
title: string;
|
|
210
|
+
description?: string;
|
|
211
|
+
target_value?: number;
|
|
212
|
+
current_value?: number;
|
|
213
|
+
unit?: string;
|
|
214
|
+
target_date?: string;
|
|
215
|
+
linked_metric_type?: string;
|
|
216
|
+
tool_ids?: string[];
|
|
217
|
+
action_steps?: string[];
|
|
218
|
+
priority?: "high" | "medium" | "low";
|
|
219
|
+
category?: string;
|
|
220
|
+
timeframe?: string;
|
|
221
|
+
position?: number;
|
|
222
|
+
source?: "manual" | "session" | "template";
|
|
223
|
+
session_id?: string;
|
|
224
|
+
template_id?: string;
|
|
225
|
+
email_sent_at?: string;
|
|
226
|
+
metadata?: Record<string, unknown>;
|
|
227
|
+
progress_notes?: string;
|
|
228
|
+
achieved_at?: string;
|
|
229
|
+
}
|
|
230
|
+
export interface UpdateClientGoalAttributes {
|
|
231
|
+
status?: "active" | "completed" | "abandoned" | "paused" | "achieved" | "discontinued";
|
|
232
|
+
goal_type?: string;
|
|
233
|
+
title?: string;
|
|
234
|
+
description?: string;
|
|
235
|
+
target_value?: number;
|
|
236
|
+
current_value?: number;
|
|
237
|
+
unit?: string;
|
|
238
|
+
target_date?: string;
|
|
239
|
+
linked_metric_type?: string;
|
|
240
|
+
tool_ids?: string[];
|
|
241
|
+
action_steps?: string[];
|
|
242
|
+
priority?: "high" | "medium" | "low";
|
|
243
|
+
category?: string;
|
|
244
|
+
timeframe?: string;
|
|
245
|
+
position?: number;
|
|
246
|
+
source?: "manual" | "session" | "template";
|
|
247
|
+
session_id?: string;
|
|
248
|
+
template_id?: string;
|
|
249
|
+
email_sent_at?: string;
|
|
250
|
+
metadata?: Record<string, unknown>;
|
|
251
|
+
progress_notes?: string;
|
|
252
|
+
achieved_at?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface CreateClientSupplementAttributes {
|
|
255
|
+
workspace_id: string;
|
|
256
|
+
patient_id: string;
|
|
257
|
+
status?: string;
|
|
258
|
+
name: string;
|
|
259
|
+
dosage?: string;
|
|
260
|
+
frequency?: string;
|
|
261
|
+
instructions?: string;
|
|
262
|
+
rationale_client?: string;
|
|
263
|
+
rationale_clinical?: string;
|
|
264
|
+
fullscript_product_id?: string;
|
|
265
|
+
fullscript_variant_id?: string;
|
|
266
|
+
prescribed_at?: string;
|
|
267
|
+
discontinued_at?: string;
|
|
268
|
+
metadata?: Record<string, unknown>;
|
|
269
|
+
route?: string;
|
|
270
|
+
source?: string;
|
|
271
|
+
fullscript_treatment_plan_id?: string;
|
|
272
|
+
}
|
|
273
|
+
export interface UpdateClientSupplementAttributes {
|
|
274
|
+
status?: string;
|
|
275
|
+
name?: string;
|
|
276
|
+
dosage?: string;
|
|
277
|
+
frequency?: string;
|
|
278
|
+
instructions?: string;
|
|
279
|
+
rationale_client?: string;
|
|
280
|
+
rationale_clinical?: string;
|
|
281
|
+
fullscript_product_id?: string;
|
|
282
|
+
fullscript_variant_id?: string;
|
|
283
|
+
prescribed_at?: string;
|
|
284
|
+
discontinued_at?: string;
|
|
285
|
+
metadata?: Record<string, unknown>;
|
|
286
|
+
route?: string;
|
|
287
|
+
source?: string;
|
|
288
|
+
fullscript_treatment_plan_id?: string;
|
|
289
|
+
}
|
|
290
|
+
export interface CreateClientMedicationAttributes {
|
|
291
|
+
workspace_id: string;
|
|
292
|
+
patient_id: string;
|
|
293
|
+
status?: "active" | "discontinued" | "on_hold" | "pending_review";
|
|
294
|
+
name: string;
|
|
295
|
+
generic_name?: string;
|
|
296
|
+
ndc_code?: string;
|
|
297
|
+
dosage?: string;
|
|
298
|
+
frequency?: string;
|
|
299
|
+
instructions?: string;
|
|
300
|
+
route?: string;
|
|
301
|
+
prescriber_name?: string;
|
|
302
|
+
prescriber_npi?: string;
|
|
303
|
+
pharmacy_name?: string;
|
|
304
|
+
pharmacy_phone?: string;
|
|
305
|
+
prescribed_at?: string;
|
|
306
|
+
start_date?: string;
|
|
307
|
+
end_date?: string;
|
|
308
|
+
refill_date?: string;
|
|
309
|
+
refills_remaining?: number;
|
|
310
|
+
indication?: string;
|
|
311
|
+
clinical_notes?: string;
|
|
312
|
+
source?: string;
|
|
313
|
+
interaction_flags?: string[];
|
|
314
|
+
external_ids?: Record<string, string>;
|
|
315
|
+
metadata?: Record<string, unknown>;
|
|
316
|
+
}
|
|
317
|
+
export interface UpdateClientMedicationAttributes {
|
|
318
|
+
status?: "active" | "discontinued" | "on_hold" | "pending_review";
|
|
319
|
+
name?: string;
|
|
320
|
+
generic_name?: string;
|
|
321
|
+
ndc_code?: string;
|
|
322
|
+
dosage?: string;
|
|
323
|
+
frequency?: string;
|
|
324
|
+
instructions?: string;
|
|
325
|
+
route?: string;
|
|
326
|
+
prescriber_name?: string;
|
|
327
|
+
prescriber_npi?: string;
|
|
328
|
+
pharmacy_name?: string;
|
|
329
|
+
pharmacy_phone?: string;
|
|
330
|
+
prescribed_at?: string;
|
|
331
|
+
start_date?: string;
|
|
332
|
+
end_date?: string;
|
|
333
|
+
refill_date?: string;
|
|
334
|
+
refills_remaining?: number;
|
|
335
|
+
indication?: string;
|
|
336
|
+
clinical_notes?: string;
|
|
337
|
+
source?: string;
|
|
338
|
+
interaction_flags?: string[];
|
|
339
|
+
external_ids?: Record<string, string>;
|
|
340
|
+
metadata?: Record<string, unknown>;
|
|
341
|
+
}
|
|
342
|
+
export interface CreateDeliveryAttributes {
|
|
343
|
+
workspace_id: string;
|
|
344
|
+
patient_id: string;
|
|
345
|
+
session_id?: string;
|
|
346
|
+
delivery_type?: string;
|
|
347
|
+
status?: string;
|
|
348
|
+
email_message_id?: string;
|
|
349
|
+
included_goal_ids?: string[];
|
|
350
|
+
included_supplement_ids?: string[];
|
|
351
|
+
included_resource_ids?: string[];
|
|
352
|
+
delivered_at?: string;
|
|
353
|
+
metadata?: Record<string, unknown>;
|
|
354
|
+
}
|
|
355
|
+
export interface UpdateDeliveryAttributes {
|
|
356
|
+
status?: string;
|
|
357
|
+
delivered_at?: string;
|
|
358
|
+
email_message_id?: string;
|
|
359
|
+
metadata?: Record<string, unknown>;
|
|
360
|
+
}
|
|
361
|
+
export interface CreatePracticeResourceAttributes {
|
|
362
|
+
workspace_id: string;
|
|
363
|
+
title: string;
|
|
364
|
+
description?: string;
|
|
365
|
+
resource_type?: "article" | "video" | "handout" | "worksheet" | "tool_link" | "infographic" | "audio" | "recipe" | "checklist" | "protocol" | "assessment" | "exercise" | "template" | "presentation" | "ebook" | "other";
|
|
366
|
+
storage_key?: string;
|
|
367
|
+
url?: string;
|
|
368
|
+
tags?: string[];
|
|
369
|
+
is_active?: boolean;
|
|
370
|
+
content_format?: "pdf" | "html" | "video_embed" | "external_link" | "interactive";
|
|
371
|
+
preview_url?: string;
|
|
372
|
+
language?: string;
|
|
373
|
+
reading_level?: "basic" | "intermediate" | "advanced" | "clinical";
|
|
374
|
+
audience?: "patient" | "practitioner" | "both";
|
|
375
|
+
author?: string;
|
|
376
|
+
license?: string;
|
|
377
|
+
estimated_duration_minutes?: number;
|
|
378
|
+
applicable_conditions?: string[];
|
|
379
|
+
related_goal_types?: string[];
|
|
380
|
+
icon_url?: string;
|
|
381
|
+
category?: string;
|
|
382
|
+
condition_tags?: string[];
|
|
383
|
+
metadata?: Record<string, unknown>;
|
|
384
|
+
}
|
|
385
|
+
export interface UpdatePracticeResourceAttributes {
|
|
386
|
+
title?: string;
|
|
387
|
+
description?: string;
|
|
388
|
+
resource_type?: "article" | "video" | "handout" | "worksheet" | "tool_link" | "infographic" | "audio" | "recipe" | "checklist" | "protocol" | "assessment" | "exercise" | "template" | "presentation" | "ebook" | "other";
|
|
389
|
+
storage_key?: string;
|
|
390
|
+
url?: string;
|
|
391
|
+
tags?: string[];
|
|
392
|
+
is_active?: boolean;
|
|
393
|
+
content_format?: "pdf" | "html" | "video_embed" | "external_link" | "interactive";
|
|
394
|
+
preview_url?: string;
|
|
395
|
+
language?: string;
|
|
396
|
+
reading_level?: "basic" | "intermediate" | "advanced" | "clinical";
|
|
397
|
+
audience?: "patient" | "practitioner" | "both";
|
|
398
|
+
author?: string;
|
|
399
|
+
license?: string;
|
|
400
|
+
estimated_duration_minutes?: number;
|
|
401
|
+
applicable_conditions?: string[];
|
|
402
|
+
related_goal_types?: string[];
|
|
403
|
+
icon_url?: string;
|
|
404
|
+
category?: string;
|
|
405
|
+
condition_tags?: string[];
|
|
406
|
+
metadata?: Record<string, unknown>;
|
|
407
|
+
}
|
|
408
|
+
export interface CreatePracticeToolAttributes {
|
|
409
|
+
workspace_id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
description?: string;
|
|
412
|
+
tool_type?: string;
|
|
413
|
+
url?: string;
|
|
414
|
+
platform?: string;
|
|
415
|
+
is_active?: boolean;
|
|
416
|
+
category?: string;
|
|
417
|
+
pricing_model?: "free" | "freemium" | "paid" | "prescription";
|
|
418
|
+
supported_platforms?: string[];
|
|
419
|
+
integrations?: string[];
|
|
420
|
+
website_url?: string;
|
|
421
|
+
app_store_url?: string;
|
|
422
|
+
play_store_url?: string;
|
|
423
|
+
icon_url?: string;
|
|
424
|
+
logo_url?: string;
|
|
425
|
+
rating?: string;
|
|
426
|
+
privacy_rating?: "hipaa_compliant" | "hipaa_partial" | "standard" | "unknown";
|
|
427
|
+
tags?: string[];
|
|
428
|
+
metadata?: Record<string, unknown>;
|
|
429
|
+
}
|
|
430
|
+
export interface UpdatePracticeToolAttributes {
|
|
431
|
+
name?: string;
|
|
432
|
+
description?: string;
|
|
433
|
+
tool_type?: string;
|
|
434
|
+
url?: string;
|
|
435
|
+
platform?: string;
|
|
436
|
+
is_active?: boolean;
|
|
437
|
+
category?: string;
|
|
438
|
+
pricing_model?: "free" | "freemium" | "paid" | "prescription";
|
|
439
|
+
supported_platforms?: string[];
|
|
440
|
+
integrations?: string[];
|
|
441
|
+
website_url?: string;
|
|
442
|
+
app_store_url?: string;
|
|
443
|
+
play_store_url?: string;
|
|
444
|
+
icon_url?: string;
|
|
445
|
+
logo_url?: string;
|
|
446
|
+
rating?: string;
|
|
447
|
+
privacy_rating?: "hipaa_compliant" | "hipaa_partial" | "standard" | "unknown";
|
|
448
|
+
tags?: string[];
|
|
449
|
+
metadata?: Record<string, unknown>;
|
|
450
|
+
}
|
|
451
|
+
/** Parameters for listing practice tools. */
|
|
452
|
+
export interface ListPracticeToolsParams {
|
|
453
|
+
workspace_id: string;
|
|
454
|
+
filter?: Record<string, unknown>;
|
|
455
|
+
sort?: string;
|
|
456
|
+
page?: {
|
|
457
|
+
offset?: number;
|
|
458
|
+
limit?: number;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
/** A practice tool category with usage count. */
|
|
462
|
+
export interface PracticeToolCategory {
|
|
463
|
+
category: string;
|
|
464
|
+
tool_count: number;
|
|
465
|
+
}
|
|
466
|
+
/** A practice resource category with usage count. */
|
|
467
|
+
export interface PracticeResourceCategory {
|
|
468
|
+
category: string;
|
|
469
|
+
resource_count: number;
|
|
470
|
+
}
|
|
471
|
+
export interface CreateClientResourceAssignmentAttributes {
|
|
472
|
+
workspace_id: string;
|
|
473
|
+
patient_id: string;
|
|
474
|
+
resource_id: string;
|
|
475
|
+
assigned_by_id?: string;
|
|
476
|
+
status?: string;
|
|
477
|
+
assigned_at?: string;
|
|
478
|
+
notes?: string;
|
|
479
|
+
metadata?: Record<string, unknown>;
|
|
480
|
+
}
|
|
481
|
+
export interface UpdateClientResourceAssignmentAttributes {
|
|
482
|
+
status?: string;
|
|
483
|
+
completed_at?: string;
|
|
484
|
+
notes?: string;
|
|
485
|
+
metadata?: Record<string, unknown>;
|
|
486
|
+
}
|
|
487
|
+
export interface TriggerPipelineResponse {
|
|
488
|
+
execution_id: string | null;
|
|
489
|
+
}
|
|
490
|
+
/** Options for triggering a pipeline on a clinical session. */
|
|
491
|
+
export interface TriggerPipelineOptions {
|
|
492
|
+
/** Slug of a specific pipeline to trigger. Defaults to "post-session-documentation". */
|
|
493
|
+
pipeline_slug?: string;
|
|
494
|
+
}
|
|
495
|
+
export interface PatientAdherenceGoals {
|
|
496
|
+
total: number;
|
|
497
|
+
completed: number;
|
|
498
|
+
in_progress: number;
|
|
499
|
+
completion_rate: number;
|
|
500
|
+
}
|
|
501
|
+
export interface PatientAdherenceHealthMetrics {
|
|
502
|
+
entries_recorded: number;
|
|
503
|
+
days_with_data: number;
|
|
504
|
+
by_category: Record<string, number>;
|
|
505
|
+
}
|
|
506
|
+
export interface PatientAdherenceResponse {
|
|
507
|
+
patient_id: string;
|
|
508
|
+
period_days: number;
|
|
509
|
+
goals: PatientAdherenceGoals;
|
|
510
|
+
health_metrics: PatientAdherenceHealthMetrics;
|
|
511
|
+
}
|
|
512
|
+
/** Item in a batch reorder request. */
|
|
513
|
+
export interface ReorderGoalItem {
|
|
514
|
+
id: string;
|
|
515
|
+
position: number;
|
|
516
|
+
}
|
|
517
|
+
/** Server response from a batch reorder operation. */
|
|
518
|
+
export interface ReorderGoalsResponse {
|
|
519
|
+
reordered: number;
|
|
520
|
+
}
|
|
521
|
+
export interface CreateGoalTemplateAttributes {
|
|
522
|
+
workspace_id: string;
|
|
523
|
+
goal_type: string;
|
|
524
|
+
title: string;
|
|
525
|
+
description?: string;
|
|
526
|
+
action_steps?: string[];
|
|
527
|
+
priority?: "high" | "medium" | "low";
|
|
528
|
+
category?: string;
|
|
529
|
+
timeframe?: string;
|
|
530
|
+
tool_ids?: string[];
|
|
531
|
+
metadata?: Record<string, unknown>;
|
|
532
|
+
tags?: string[];
|
|
533
|
+
target_value?: string;
|
|
534
|
+
unit?: string;
|
|
535
|
+
linked_metric_type?: string;
|
|
536
|
+
difficulty?: "beginner" | "intermediate" | "advanced";
|
|
537
|
+
evidence_base?: string;
|
|
538
|
+
instructions?: string;
|
|
539
|
+
suggested_duration_days?: number;
|
|
540
|
+
applicable_conditions?: string[];
|
|
541
|
+
age_groups?: string[];
|
|
542
|
+
source_reference?: string;
|
|
543
|
+
}
|
|
544
|
+
export interface UpdateGoalTemplateAttributes {
|
|
545
|
+
goal_type?: string;
|
|
546
|
+
title?: string;
|
|
547
|
+
description?: string;
|
|
548
|
+
action_steps?: string[];
|
|
549
|
+
priority?: "high" | "medium" | "low";
|
|
550
|
+
category?: string;
|
|
551
|
+
timeframe?: string;
|
|
552
|
+
tool_ids?: string[];
|
|
553
|
+
metadata?: Record<string, unknown>;
|
|
554
|
+
is_active?: boolean;
|
|
555
|
+
tags?: string[];
|
|
556
|
+
target_value?: string;
|
|
557
|
+
unit?: string;
|
|
558
|
+
linked_metric_type?: string;
|
|
559
|
+
difficulty?: "beginner" | "intermediate" | "advanced";
|
|
560
|
+
evidence_base?: string;
|
|
561
|
+
instructions?: string;
|
|
562
|
+
suggested_duration_days?: number;
|
|
563
|
+
applicable_conditions?: string[];
|
|
564
|
+
age_groups?: string[];
|
|
565
|
+
source_reference?: string;
|
|
566
|
+
}
|
|
567
|
+
export interface CreateGoalFromExistingAttributes {
|
|
568
|
+
workspace_id: string;
|
|
569
|
+
source_template_id: string;
|
|
570
|
+
}
|
|
571
|
+
export interface ListGoalTemplatesParams {
|
|
572
|
+
workspace_id: string;
|
|
573
|
+
filter?: Record<string, unknown>;
|
|
574
|
+
sort?: string;
|
|
575
|
+
page?: {
|
|
576
|
+
offset?: number;
|
|
577
|
+
limit?: number;
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
export interface RecipeSearchParams {
|
|
581
|
+
query: string;
|
|
582
|
+
connector_id: string;
|
|
583
|
+
workspace_id: string;
|
|
584
|
+
meal_type?: string;
|
|
585
|
+
diet?: string;
|
|
586
|
+
health?: string;
|
|
587
|
+
from?: number;
|
|
588
|
+
to?: number;
|
|
589
|
+
}
|
|
590
|
+
/** Recipe object returned by Edamam via the platform proxy. */
|
|
591
|
+
export interface RecipeHit {
|
|
592
|
+
recipe: {
|
|
593
|
+
uri: string;
|
|
594
|
+
label: string;
|
|
595
|
+
image?: string;
|
|
596
|
+
source?: string;
|
|
597
|
+
url?: string;
|
|
598
|
+
yield?: number;
|
|
599
|
+
dietLabels?: string[];
|
|
600
|
+
healthLabels?: string[];
|
|
601
|
+
ingredientLines?: string[];
|
|
602
|
+
calories?: number;
|
|
603
|
+
totalTime?: number;
|
|
604
|
+
cuisineType?: string[];
|
|
605
|
+
mealType?: string[];
|
|
606
|
+
dishType?: string[];
|
|
607
|
+
[key: string]: unknown;
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
/** Result shape returned by `clinical.recipes.search()`. */
|
|
611
|
+
export interface RecipeSearchResult {
|
|
612
|
+
hits: RecipeHit[];
|
|
613
|
+
count: number;
|
|
614
|
+
next_page?: string;
|
|
615
|
+
}
|
|
616
|
+
export interface GenerateSupplementRecsResponse {
|
|
617
|
+
execution_id: string | null;
|
|
618
|
+
}
|
|
619
|
+
/** Result of a tag rename operation. */
|
|
620
|
+
export interface TagRenameResult {
|
|
621
|
+
updated_count: number;
|
|
622
|
+
}
|
|
623
|
+
/** Result of a tag delete operation. */
|
|
624
|
+
export interface TagDeleteResult {
|
|
625
|
+
updated_count: number;
|
|
626
|
+
}
|
|
627
|
+
/** Result of a tag merge operation. */
|
|
628
|
+
export interface TagMergeResult {
|
|
629
|
+
updated_count: number;
|
|
630
|
+
}
|
|
631
|
+
/** Parameters for importing resources from a URL. */
|
|
632
|
+
export interface ImportFromUrlParams {
|
|
633
|
+
url: string;
|
|
634
|
+
workspace_id: string;
|
|
635
|
+
}
|
|
636
|
+
/** Duplicate detection statistics for a resource type in a workspace. */
|
|
637
|
+
export interface DuplicateStats {
|
|
638
|
+
total_resources: number;
|
|
639
|
+
duplicate_groups: number;
|
|
640
|
+
affected_resources: number;
|
|
641
|
+
}
|
|
642
|
+
/** A group of duplicate resources identified by similarity. */
|
|
643
|
+
export interface DuplicateGroup {
|
|
644
|
+
group_id: string;
|
|
645
|
+
resource_ids: string[];
|
|
646
|
+
match_type: string;
|
|
647
|
+
confidence: number;
|
|
648
|
+
sample_title: string;
|
|
649
|
+
count: number;
|
|
650
|
+
}
|
|
651
|
+
/** Result of resolving a duplicate group. */
|
|
652
|
+
export interface DuplicateResolveResult {
|
|
653
|
+
kept: string;
|
|
654
|
+
archived: string[];
|
|
655
|
+
}
|
|
656
|
+
export interface ClinicalSearchResult {
|
|
657
|
+
type: string;
|
|
658
|
+
id: string;
|
|
659
|
+
attributes: Record<string, unknown>;
|
|
660
|
+
meta: {
|
|
661
|
+
similarity: number;
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
/** Standard JSON:API list parameters for clinical resources. */
|
|
665
|
+
export interface ClinicalListParams {
|
|
666
|
+
/** Filter results. */
|
|
667
|
+
filter?: Record<string, unknown>;
|
|
668
|
+
/** Sort by field(s). Prefix with '-' for descending. */
|
|
669
|
+
sort?: string;
|
|
670
|
+
/** Pagination parameters. */
|
|
671
|
+
page?: {
|
|
672
|
+
count?: boolean;
|
|
673
|
+
limit?: number;
|
|
674
|
+
offset?: number;
|
|
675
|
+
};
|
|
676
|
+
/** Include related resources (comma-separated). */
|
|
677
|
+
include?: string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Clinical namespace — patient management, sessions, notes, health data, and care plans.
|
|
681
|
+
*
|
|
682
|
+
* Provides sub-namespaces for the full clinical workflow: patients, sessions,
|
|
683
|
+
* notes (with HITL approve/reject), health metrics, meal plans, client goals,
|
|
684
|
+
* supplements, deliveries, note versions, practice resources, practice tools,
|
|
685
|
+
* client resource assignments, and supplement recommendation cache.
|
|
686
|
+
*
|
|
687
|
+
* Custom controller endpoints are also exposed for pipeline triggering,
|
|
688
|
+
* adherence reporting, recipe search, and AI supplement recommendations.
|
|
689
|
+
*
|
|
690
|
+
* @example
|
|
691
|
+
* ```typescript
|
|
692
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
693
|
+
*
|
|
694
|
+
* // List patients in a workspace
|
|
695
|
+
* const patients = await client.clinical.patients.list({
|
|
696
|
+
* filter: { workspace_id: 'ws_123' },
|
|
697
|
+
* });
|
|
698
|
+
*
|
|
699
|
+
* // Trigger AI session pipeline
|
|
700
|
+
* const { execution_id } = await client.clinical.sessions.triggerPipeline(
|
|
701
|
+
* 'sess_xyz',
|
|
702
|
+
* 'ws_123',
|
|
703
|
+
* );
|
|
704
|
+
*
|
|
705
|
+
* // Approve a generated clinical note
|
|
706
|
+
* const note = await client.clinical.notes.approve('note_abc', 'user_xyz');
|
|
707
|
+
* ```
|
|
708
|
+
*/
|
|
709
|
+
export declare function createClinicalNamespace(rb: RequestBuilder): {
|
|
710
|
+
/**
|
|
711
|
+
* Manage clinical patients (end users of the platform's health service).
|
|
712
|
+
*/
|
|
713
|
+
patients: {
|
|
714
|
+
/**
|
|
715
|
+
* List patients in a workspace.
|
|
716
|
+
*
|
|
717
|
+
* @param params - Filter/pagination parameters (must include `filter[workspace_id]`)
|
|
718
|
+
* @param options - Request options
|
|
719
|
+
* @returns Array of {@link ClinicalPatient} records
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* const patients = await client.clinical.patients.list({
|
|
724
|
+
* filter: { workspace_id: 'ws_123' },
|
|
725
|
+
* });
|
|
726
|
+
* ```
|
|
727
|
+
*/
|
|
728
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPatient[]>;
|
|
729
|
+
/**
|
|
730
|
+
* Get a single patient by ID.
|
|
731
|
+
*
|
|
732
|
+
* @param id - Patient UUID
|
|
733
|
+
* @param options - Request options
|
|
734
|
+
* @returns {@link ClinicalPatient} record
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* ```typescript
|
|
738
|
+
* const patient = await client.clinical.patients.get('pat_abc123');
|
|
739
|
+
* ```
|
|
740
|
+
*/
|
|
741
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalPatient>;
|
|
742
|
+
/**
|
|
743
|
+
* Create a new clinical patient.
|
|
744
|
+
*
|
|
745
|
+
* @param attributes - Patient creation attributes. Must include `workspace_id`.
|
|
746
|
+
* @param options - Request options
|
|
747
|
+
* @returns Created {@link ClinicalPatient} record
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* ```typescript
|
|
751
|
+
* const patient = await client.clinical.patients.create({
|
|
752
|
+
* workspace_id: 'ws_123',
|
|
753
|
+
* contact_id: 'contact_abc',
|
|
754
|
+
* status: 'active',
|
|
755
|
+
* });
|
|
756
|
+
* ```
|
|
757
|
+
*/
|
|
758
|
+
create: (attributes: CreateClinicalPatientAttributes, options?: RequestOptions) => Promise<ClinicalPatient>;
|
|
759
|
+
/**
|
|
760
|
+
* Update a clinical patient.
|
|
761
|
+
*
|
|
762
|
+
* @param id - Patient UUID
|
|
763
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
764
|
+
* @param options - Request options
|
|
765
|
+
* @returns Updated {@link ClinicalPatient} record
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
* ```typescript
|
|
769
|
+
* const updated = await client.clinical.patients.update('pat_abc123', {
|
|
770
|
+
* status: 'inactive',
|
|
771
|
+
* });
|
|
772
|
+
* ```
|
|
773
|
+
*/
|
|
774
|
+
update: (id: string, attributes: UpdateClinicalPatientAttributes, options?: RequestOptions) => Promise<ClinicalPatient>;
|
|
775
|
+
/**
|
|
776
|
+
* Delete a clinical patient.
|
|
777
|
+
*
|
|
778
|
+
* @param id - Patient UUID
|
|
779
|
+
* @param options - Request options
|
|
780
|
+
* @returns `true` on successful deletion
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* ```typescript
|
|
784
|
+
* await client.clinical.patients.delete('pat_abc123');
|
|
785
|
+
* ```
|
|
786
|
+
*/
|
|
787
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
788
|
+
/**
|
|
789
|
+
* Look up a patient by their CRM Contact ID.
|
|
790
|
+
*
|
|
791
|
+
* Most ISV apps work with CRM Contact IDs, not Clinical Patient UUIDs.
|
|
792
|
+
* Use this to resolve the patient record for a given contact.
|
|
793
|
+
*
|
|
794
|
+
* @param contactId - CRM Contact UUID
|
|
795
|
+
* @param options - Request options
|
|
796
|
+
* @returns {@link ClinicalPatient} record linked to the contact
|
|
797
|
+
* @throws {@link NotFoundError} if no patient exists for the contact
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* ```typescript
|
|
801
|
+
* const patient = await client.clinical.patients.getByContact('c7da2056-...');
|
|
802
|
+
* console.log(patient.id); // Clinical Patient UUID
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
805
|
+
getByContact: (contactId: string, options?: RequestOptions) => Promise<ClinicalPatient>;
|
|
806
|
+
/**
|
|
807
|
+
* List health metrics for a patient (related resource).
|
|
808
|
+
*
|
|
809
|
+
* @param patientId - Patient UUID
|
|
810
|
+
* @param options - Request options
|
|
811
|
+
* @returns Array of {@link ClinicalHealthMetric} records
|
|
812
|
+
*/
|
|
813
|
+
healthMetrics: (patientId: string, options?: RequestOptions) => Promise<ClinicalHealthMetric[]>;
|
|
814
|
+
/**
|
|
815
|
+
* List goals for a patient (related resource).
|
|
816
|
+
*
|
|
817
|
+
* @param patientId - Patient UUID
|
|
818
|
+
* @param options - Request options
|
|
819
|
+
* @returns Array of {@link ClinicalClientGoal} records
|
|
820
|
+
*/
|
|
821
|
+
goals: (patientId: string, options?: RequestOptions) => Promise<ClinicalClientGoal[]>;
|
|
822
|
+
/**
|
|
823
|
+
* List supplements for a patient (related resource).
|
|
824
|
+
*
|
|
825
|
+
* @param patientId - Patient UUID
|
|
826
|
+
* @param options - Request options
|
|
827
|
+
* @returns Array of {@link ClinicalClientSupplement} records
|
|
828
|
+
*/
|
|
829
|
+
supplements: (patientId: string, options?: RequestOptions) => Promise<ClinicalClientSupplement[]>;
|
|
830
|
+
/**
|
|
831
|
+
* List medications for a patient (related resource).
|
|
832
|
+
*
|
|
833
|
+
* @param patientId - Patient UUID or CRM Contact UUID
|
|
834
|
+
* @param options - Request options
|
|
835
|
+
* @returns Array of {@link ClinicalClientMedication} records
|
|
836
|
+
*/
|
|
837
|
+
medications: (patientId: string, options?: RequestOptions) => Promise<ClinicalClientMedication[]>;
|
|
838
|
+
/**
|
|
839
|
+
* List resource assignments for a patient (related resource).
|
|
840
|
+
*
|
|
841
|
+
* @param patientId - Patient UUID
|
|
842
|
+
* @param options - Request options
|
|
843
|
+
* @returns Array of {@link ClinicalClientResourceAssignment} records
|
|
844
|
+
*/
|
|
845
|
+
resourceAssignments: (patientId: string, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment[]>;
|
|
846
|
+
/**
|
|
847
|
+
* Get patient adherence summary for a given period.
|
|
848
|
+
*
|
|
849
|
+
* Returns goal completion rates and health metric tracking stats.
|
|
850
|
+
*
|
|
851
|
+
* @param patientId - Patient UUID
|
|
852
|
+
* @param workspaceId - Workspace UUID (required)
|
|
853
|
+
* @param days - Number of days to look back (default: 30, max: 365)
|
|
854
|
+
* @param options - Request options
|
|
855
|
+
* @returns {@link PatientAdherenceResponse} with goal and metric breakdowns
|
|
856
|
+
*
|
|
857
|
+
* @example
|
|
858
|
+
* ```typescript
|
|
859
|
+
* const adherence = await client.clinical.patients.getAdherence(
|
|
860
|
+
* 'pat_abc123',
|
|
861
|
+
* 'ws_123',
|
|
862
|
+
* 30,
|
|
863
|
+
* );
|
|
864
|
+
* console.log(adherence.goals.completion_rate); // 0.75
|
|
865
|
+
* ```
|
|
866
|
+
*/
|
|
867
|
+
getAdherence: (patientId: string, workspaceId: string, days?: number, options?: RequestOptions) => Promise<PatientAdherenceResponse>;
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* Manage clinical sessions (practitioner-patient encounters).
|
|
871
|
+
*/
|
|
872
|
+
sessions: {
|
|
873
|
+
/**
|
|
874
|
+
* List sessions in a workspace.
|
|
875
|
+
*
|
|
876
|
+
* @param params - Filter/pagination parameters
|
|
877
|
+
* @param options - Request options
|
|
878
|
+
* @returns Array of {@link ClinicalSession} records
|
|
879
|
+
*/
|
|
880
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalSession[]>;
|
|
881
|
+
/**
|
|
882
|
+
* List sessions for a specific patient.
|
|
883
|
+
*
|
|
884
|
+
* @param params - Must include `patient_id`. Optional filter/pagination parameters.
|
|
885
|
+
* @param options - Request options
|
|
886
|
+
* @returns Array of {@link ClinicalSession} records
|
|
887
|
+
*/
|
|
888
|
+
listByPatient: (params: {
|
|
889
|
+
patient_id: string;
|
|
890
|
+
filter?: Record<string, unknown>;
|
|
891
|
+
}, options?: RequestOptions) => Promise<ClinicalSession[]>;
|
|
892
|
+
/**
|
|
893
|
+
* Get a single session by ID.
|
|
894
|
+
*
|
|
895
|
+
* @param id - Session UUID
|
|
896
|
+
* @param options - Request options
|
|
897
|
+
* @returns {@link ClinicalSession} record
|
|
898
|
+
*/
|
|
899
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalSession>;
|
|
900
|
+
/**
|
|
901
|
+
* Create a new clinical session.
|
|
902
|
+
*
|
|
903
|
+
* @param attributes - Session creation attributes. Must include `workspace_id` and `patient_id`.
|
|
904
|
+
* @param options - Request options
|
|
905
|
+
* @returns Created {@link ClinicalSession} record
|
|
906
|
+
*/
|
|
907
|
+
create: (attributes: CreateClinicalSessionAttributes, options?: RequestOptions) => Promise<ClinicalSession>;
|
|
908
|
+
/**
|
|
909
|
+
* Update a clinical session.
|
|
910
|
+
*
|
|
911
|
+
* @param id - Session UUID
|
|
912
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
913
|
+
* @param options - Request options
|
|
914
|
+
* @returns Updated {@link ClinicalSession} record
|
|
915
|
+
*/
|
|
916
|
+
update: (id: string, attributes: UpdateClinicalSessionAttributes, options?: RequestOptions) => Promise<ClinicalSession>;
|
|
917
|
+
/**
|
|
918
|
+
* Delete a clinical session.
|
|
919
|
+
*
|
|
920
|
+
* @param id - Session UUID
|
|
921
|
+
* @param options - Request options
|
|
922
|
+
* @returns `true` on successful deletion
|
|
923
|
+
*/
|
|
924
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
925
|
+
/**
|
|
926
|
+
* List notes for a session (related resource).
|
|
927
|
+
*
|
|
928
|
+
* @param sessionId - Session UUID
|
|
929
|
+
* @param options - Request options
|
|
930
|
+
* @returns Array of {@link ClinicalNote} records
|
|
931
|
+
*/
|
|
932
|
+
notes: (sessionId: string, options?: RequestOptions) => Promise<ClinicalNote[]>;
|
|
933
|
+
/**
|
|
934
|
+
* List meal plans for a session (related resource).
|
|
935
|
+
*
|
|
936
|
+
* @param sessionId - Session UUID
|
|
937
|
+
* @param options - Request options
|
|
938
|
+
* @returns Array of {@link ClinicalMealPlan} records
|
|
939
|
+
*/
|
|
940
|
+
mealPlans: (sessionId: string, options?: RequestOptions) => Promise<ClinicalMealPlan[]>;
|
|
941
|
+
/**
|
|
942
|
+
* Trigger the AI processing pipeline for a session.
|
|
943
|
+
*
|
|
944
|
+
* Processes the session transcript to extract clinical insights and generate notes.
|
|
945
|
+
* Returns immediately with an execution ID; poll `client.agents.executions.get(id)` for results.
|
|
946
|
+
*
|
|
947
|
+
* @param sessionId - Session UUID
|
|
948
|
+
* @param workspaceId - Workspace UUID
|
|
949
|
+
* @param triggerOptions - Optional pipeline targeting (pipeline_slug)
|
|
950
|
+
* @param options - Request options
|
|
951
|
+
* @returns {@link TriggerPipelineResponse} with execution_id (may be null if pipeline not configured)
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* ```typescript
|
|
955
|
+
* // Default pipeline (post-session-documentation)
|
|
956
|
+
* const { execution_id } = await client.clinical.sessions.triggerPipeline(
|
|
957
|
+
* 'sess_xyz',
|
|
958
|
+
* 'ws_123',
|
|
959
|
+
* );
|
|
960
|
+
*
|
|
961
|
+
* // Specific pipeline by slug
|
|
962
|
+
* const { execution_id: eid } = await client.clinical.sessions.triggerPipeline(
|
|
963
|
+
* 'sess_xyz',
|
|
964
|
+
* 'ws_123',
|
|
965
|
+
* { pipeline_slug: 'chartless-quick-goals-update' },
|
|
966
|
+
* );
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
triggerPipeline: (sessionId: string, workspaceId: string, triggerOptions?: TriggerPipelineOptions, options?: RequestOptions) => Promise<TriggerPipelineResponse>;
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* Manage clinical notes (SOAP notes, progress notes, AI-generated summaries).
|
|
973
|
+
*
|
|
974
|
+
* Notes support a HITL (Human-In-The-Loop) approval workflow: AI-generated
|
|
975
|
+
* notes start with `status: "draft"` and must be approved or rejected
|
|
976
|
+
* by a clinician before they are finalized.
|
|
977
|
+
*/
|
|
978
|
+
notes: {
|
|
979
|
+
/**
|
|
980
|
+
* List notes, optionally filtered by patient or session.
|
|
981
|
+
*
|
|
982
|
+
* @param params - Filter/pagination parameters
|
|
983
|
+
* @param options - Request options
|
|
984
|
+
* @returns Array of {@link ClinicalNote} records
|
|
985
|
+
*/
|
|
986
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalNote[]>;
|
|
987
|
+
/**
|
|
988
|
+
* List all notes for a patient across all sessions.
|
|
989
|
+
*
|
|
990
|
+
* @param patientId - Patient UUID
|
|
991
|
+
* @param params - Filter/pagination parameters
|
|
992
|
+
* @param options - Request options
|
|
993
|
+
* @returns Array of {@link ClinicalNote} records
|
|
994
|
+
*/
|
|
995
|
+
listByPatient: (patientId: string, params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalNote[]>;
|
|
996
|
+
/**
|
|
997
|
+
* List all notes in a workspace.
|
|
998
|
+
*
|
|
999
|
+
* @param workspaceId - Workspace UUID
|
|
1000
|
+
* @param params - Filter/pagination parameters
|
|
1001
|
+
* @param options - Request options
|
|
1002
|
+
* @returns Array of {@link ClinicalNote} records
|
|
1003
|
+
*/
|
|
1004
|
+
listByWorkspace: (workspaceId: string, params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalNote[]>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Get a single note by ID.
|
|
1007
|
+
*
|
|
1008
|
+
* @param id - Note UUID
|
|
1009
|
+
* @param options - Request options
|
|
1010
|
+
* @returns {@link ClinicalNote} record
|
|
1011
|
+
*/
|
|
1012
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create a new clinical note.
|
|
1015
|
+
*
|
|
1016
|
+
* @param attributes - Note creation attributes. Must include `workspace_id` and `session_id`.
|
|
1017
|
+
* @param options - Request options
|
|
1018
|
+
* @returns Created {@link ClinicalNote} record
|
|
1019
|
+
*/
|
|
1020
|
+
create: (attributes: CreateClinicalNoteAttributes, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1021
|
+
/**
|
|
1022
|
+
* Update a clinical note.
|
|
1023
|
+
*
|
|
1024
|
+
* @param id - Note UUID
|
|
1025
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1026
|
+
* @param options - Request options
|
|
1027
|
+
* @returns Updated {@link ClinicalNote} record
|
|
1028
|
+
*/
|
|
1029
|
+
update: (id: string, attributes: UpdateClinicalNoteAttributes, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Archive (soft-delete) a note.
|
|
1032
|
+
*
|
|
1033
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1034
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1035
|
+
* @param id - Note UUID
|
|
1036
|
+
* @param options - Request options
|
|
1037
|
+
* @returns Archived {@link ClinicalNote} record
|
|
1038
|
+
*/
|
|
1039
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Archive (soft-delete) a note.
|
|
1042
|
+
*
|
|
1043
|
+
* @param id - Note UUID
|
|
1044
|
+
* @param options - Request options
|
|
1045
|
+
* @returns Archived {@link ClinicalNote} record
|
|
1046
|
+
*/
|
|
1047
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Restore an archived note.
|
|
1050
|
+
*
|
|
1051
|
+
* @param id - Note UUID
|
|
1052
|
+
* @param options - Request options
|
|
1053
|
+
* @returns Restored {@link ClinicalNote} record
|
|
1054
|
+
*/
|
|
1055
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Permanently delete a note. Irreversible.
|
|
1058
|
+
*
|
|
1059
|
+
* @param id - Note UUID
|
|
1060
|
+
* @param options - Request options
|
|
1061
|
+
* @returns `true` on success
|
|
1062
|
+
*/
|
|
1063
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1064
|
+
/**
|
|
1065
|
+
* List archived (soft-deleted) notes.
|
|
1066
|
+
*
|
|
1067
|
+
* @param params - Filter/pagination parameters
|
|
1068
|
+
* @param options - Request options
|
|
1069
|
+
* @returns Array of archived {@link ClinicalNote} records
|
|
1070
|
+
*/
|
|
1071
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalNote[]>;
|
|
1072
|
+
/**
|
|
1073
|
+
* Approve a clinical note (HITL workflow).
|
|
1074
|
+
*
|
|
1075
|
+
* Marks the note as clinician-reviewed and approved, transitioning it
|
|
1076
|
+
* to `status: "approved"`. Only notes in `draft` status can be approved.
|
|
1077
|
+
* Creates an immutable NoteVersion snapshot.
|
|
1078
|
+
*
|
|
1079
|
+
* @param id - Note UUID
|
|
1080
|
+
* @param reviewedById - UUID of the reviewer (required)
|
|
1081
|
+
* @param options - Request options
|
|
1082
|
+
* @returns Updated {@link ClinicalNote} record
|
|
1083
|
+
*
|
|
1084
|
+
* @example
|
|
1085
|
+
* ```typescript
|
|
1086
|
+
* const approved = await client.clinical.notes.approve('note_abc', 'user_xyz');
|
|
1087
|
+
* console.log(approved.attributes.status); // 'approved'
|
|
1088
|
+
* ```
|
|
1089
|
+
*/
|
|
1090
|
+
approve: (id: string, reviewedById: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Reject a clinical note (HITL workflow).
|
|
1093
|
+
*
|
|
1094
|
+
* Marks the note as rejected, transitioning it to `status: "rejected"`.
|
|
1095
|
+
* Only notes in `draft` status can be rejected.
|
|
1096
|
+
*
|
|
1097
|
+
* @param id - Note UUID
|
|
1098
|
+
* @param reviewedById - UUID of the reviewer (required)
|
|
1099
|
+
* @param options - Request options
|
|
1100
|
+
* @returns Updated {@link ClinicalNote} record
|
|
1101
|
+
*
|
|
1102
|
+
* @example
|
|
1103
|
+
* ```typescript
|
|
1104
|
+
* const rejected = await client.clinical.notes.reject('note_abc', 'user_xyz');
|
|
1105
|
+
* console.log(rejected.attributes.status); // 'rejected'
|
|
1106
|
+
* ```
|
|
1107
|
+
*/
|
|
1108
|
+
reject: (id: string, reviewedById: string, options?: RequestOptions) => Promise<ClinicalNote>;
|
|
1109
|
+
/**
|
|
1110
|
+
* List versions for a note (related resource).
|
|
1111
|
+
*
|
|
1112
|
+
* Each edit to an approved note creates a version record for audit purposes.
|
|
1113
|
+
*
|
|
1114
|
+
* @param noteId - Note UUID
|
|
1115
|
+
* @param options - Request options
|
|
1116
|
+
* @returns Array of {@link ClinicalNoteVersion} records
|
|
1117
|
+
*/
|
|
1118
|
+
versions: (noteId: string, options?: RequestOptions) => Promise<ClinicalNoteVersion[]>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Get a specific note version.
|
|
1121
|
+
*
|
|
1122
|
+
* @param noteId - Note UUID
|
|
1123
|
+
* @param versionId - NoteVersion UUID
|
|
1124
|
+
* @param options - Request options
|
|
1125
|
+
* @returns {@link ClinicalNoteVersion} record
|
|
1126
|
+
*/
|
|
1127
|
+
getVersion: (noteId: string, versionId: string, options?: RequestOptions) => Promise<ClinicalNoteVersion>;
|
|
1128
|
+
};
|
|
1129
|
+
/**
|
|
1130
|
+
* Manage clinical health metrics (weight, blood pressure, glucose, etc.).
|
|
1131
|
+
*/
|
|
1132
|
+
healthMetrics: {
|
|
1133
|
+
/**
|
|
1134
|
+
* List health metrics, filtered by patient/workspace/date range.
|
|
1135
|
+
*
|
|
1136
|
+
* @param params - Filter/pagination parameters
|
|
1137
|
+
* @param options - Request options
|
|
1138
|
+
* @returns Array of {@link ClinicalHealthMetric} records
|
|
1139
|
+
*/
|
|
1140
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalHealthMetric[]>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Get a single health metric by ID.
|
|
1143
|
+
*
|
|
1144
|
+
* @param id - HealthMetric UUID
|
|
1145
|
+
* @param options - Request options
|
|
1146
|
+
* @returns {@link ClinicalHealthMetric} record
|
|
1147
|
+
*/
|
|
1148
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Record a new health metric entry.
|
|
1151
|
+
*
|
|
1152
|
+
* @param attributes - Metric creation attributes. Must include `workspace_id`, `patient_id`,
|
|
1153
|
+
* and `metric_type`.
|
|
1154
|
+
* @param options - Request options
|
|
1155
|
+
* @returns Created {@link ClinicalHealthMetric} record
|
|
1156
|
+
*
|
|
1157
|
+
* @example
|
|
1158
|
+
* ```typescript
|
|
1159
|
+
* const metric = await client.clinical.healthMetrics.create({
|
|
1160
|
+
* workspace_id: 'ws_123',
|
|
1161
|
+
* patient_id: 'pat_abc',
|
|
1162
|
+
* metric_type: 'weight_kg',
|
|
1163
|
+
* metric_category: 'vitals',
|
|
1164
|
+
* value_numeric: 82.5,
|
|
1165
|
+
* unit: 'kg',
|
|
1166
|
+
* });
|
|
1167
|
+
* ```
|
|
1168
|
+
*/
|
|
1169
|
+
create: (attributes: CreateHealthMetricAttributes, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Update a health metric entry.
|
|
1172
|
+
*
|
|
1173
|
+
* @param id - HealthMetric UUID
|
|
1174
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1175
|
+
* @param options - Request options
|
|
1176
|
+
* @returns Updated {@link ClinicalHealthMetric} record
|
|
1177
|
+
*/
|
|
1178
|
+
update: (id: string, attributes: UpdateHealthMetricAttributes, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1179
|
+
/**
|
|
1180
|
+
* Archive (soft-delete) a health metric.
|
|
1181
|
+
*
|
|
1182
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1183
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1184
|
+
* @param id - HealthMetric UUID
|
|
1185
|
+
* @param options - Request options
|
|
1186
|
+
* @returns Archived {@link ClinicalHealthMetric} record
|
|
1187
|
+
*/
|
|
1188
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Archive (soft-delete) a health metric.
|
|
1191
|
+
*
|
|
1192
|
+
* @param id - HealthMetric UUID
|
|
1193
|
+
* @param options - Request options
|
|
1194
|
+
* @returns Archived {@link ClinicalHealthMetric} record
|
|
1195
|
+
*/
|
|
1196
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Restore an archived health metric.
|
|
1199
|
+
*
|
|
1200
|
+
* @param id - HealthMetric UUID
|
|
1201
|
+
* @param options - Request options
|
|
1202
|
+
* @returns Restored {@link ClinicalHealthMetric} record
|
|
1203
|
+
*/
|
|
1204
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalHealthMetric>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Permanently delete a health metric. Irreversible.
|
|
1207
|
+
*
|
|
1208
|
+
* @param id - HealthMetric UUID
|
|
1209
|
+
* @param options - Request options
|
|
1210
|
+
* @returns `true` on success
|
|
1211
|
+
*/
|
|
1212
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1213
|
+
/**
|
|
1214
|
+
* List archived (soft-deleted) health metrics.
|
|
1215
|
+
*
|
|
1216
|
+
* @param params - Filter/pagination parameters
|
|
1217
|
+
* @param options - Request options
|
|
1218
|
+
* @returns Array of archived {@link ClinicalHealthMetric} records
|
|
1219
|
+
*/
|
|
1220
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalHealthMetric[]>;
|
|
1221
|
+
};
|
|
1222
|
+
/**
|
|
1223
|
+
* Manage meal plans for clinical patients.
|
|
1224
|
+
*/
|
|
1225
|
+
mealPlans: {
|
|
1226
|
+
/**
|
|
1227
|
+
* List meal plans, filtered by patient/workspace.
|
|
1228
|
+
*
|
|
1229
|
+
* @param params - Filter/pagination parameters
|
|
1230
|
+
* @param options - Request options
|
|
1231
|
+
* @returns Array of {@link ClinicalMealPlan} records
|
|
1232
|
+
*/
|
|
1233
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalMealPlan[]>;
|
|
1234
|
+
/**
|
|
1235
|
+
* List all meal plans for a patient across all sessions.
|
|
1236
|
+
*
|
|
1237
|
+
* @param patientId - Patient UUID
|
|
1238
|
+
* @param params - Filter/pagination parameters
|
|
1239
|
+
* @param options - Request options
|
|
1240
|
+
* @returns Array of {@link ClinicalMealPlan} records
|
|
1241
|
+
*/
|
|
1242
|
+
listByPatient: (patientId: string, params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalMealPlan[]>;
|
|
1243
|
+
/**
|
|
1244
|
+
* Get a single meal plan by ID.
|
|
1245
|
+
*
|
|
1246
|
+
* @param id - MealPlan UUID
|
|
1247
|
+
* @param options - Request options
|
|
1248
|
+
* @returns {@link ClinicalMealPlan} record
|
|
1249
|
+
*/
|
|
1250
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Create a new meal plan.
|
|
1253
|
+
*
|
|
1254
|
+
* @param attributes - Meal plan creation attributes. Must include `workspace_id`.
|
|
1255
|
+
* Provide `patient_id` directly, or `session_id` to auto-populate
|
|
1256
|
+
* `patient_id` from the session's patient.
|
|
1257
|
+
* @param options - Request options
|
|
1258
|
+
* @returns Created {@link ClinicalMealPlan} record
|
|
1259
|
+
*/
|
|
1260
|
+
create: (attributes: CreateMealPlanAttributes, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1261
|
+
/**
|
|
1262
|
+
* Update a meal plan.
|
|
1263
|
+
*
|
|
1264
|
+
* @param id - MealPlan UUID
|
|
1265
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1266
|
+
* @param options - Request options
|
|
1267
|
+
* @returns Updated {@link ClinicalMealPlan} record
|
|
1268
|
+
*/
|
|
1269
|
+
update: (id: string, attributes: UpdateMealPlanAttributes, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Archive (soft-delete) a meal plan.
|
|
1272
|
+
*
|
|
1273
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1274
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1275
|
+
* @param id - MealPlan UUID
|
|
1276
|
+
* @param options - Request options
|
|
1277
|
+
* @returns Archived {@link ClinicalMealPlan} record
|
|
1278
|
+
*/
|
|
1279
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Archive (soft-delete) a meal plan.
|
|
1282
|
+
*
|
|
1283
|
+
* @param id - MealPlan UUID
|
|
1284
|
+
* @param options - Request options
|
|
1285
|
+
* @returns Archived {@link ClinicalMealPlan} record
|
|
1286
|
+
*/
|
|
1287
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1288
|
+
/**
|
|
1289
|
+
* Restore an archived meal plan.
|
|
1290
|
+
*
|
|
1291
|
+
* @param id - MealPlan UUID
|
|
1292
|
+
* @param options - Request options
|
|
1293
|
+
* @returns Restored {@link ClinicalMealPlan} record
|
|
1294
|
+
*/
|
|
1295
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalMealPlan>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Permanently delete a meal plan. Irreversible.
|
|
1298
|
+
*
|
|
1299
|
+
* @param id - MealPlan UUID
|
|
1300
|
+
* @param options - Request options
|
|
1301
|
+
* @returns `true` on success
|
|
1302
|
+
*/
|
|
1303
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1304
|
+
/**
|
|
1305
|
+
* List archived (soft-deleted) meal plans.
|
|
1306
|
+
*
|
|
1307
|
+
* @param params - Filter/pagination parameters
|
|
1308
|
+
* @param options - Request options
|
|
1309
|
+
* @returns Array of archived {@link ClinicalMealPlan} records
|
|
1310
|
+
*/
|
|
1311
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalMealPlan[]>;
|
|
1312
|
+
};
|
|
1313
|
+
/**
|
|
1314
|
+
* Manage client goals (therapeutic targets and wellness milestones).
|
|
1315
|
+
*/
|
|
1316
|
+
clientGoals: {
|
|
1317
|
+
/**
|
|
1318
|
+
* List client goals, filtered by patient/workspace.
|
|
1319
|
+
*
|
|
1320
|
+
* @param params - Filter/pagination parameters
|
|
1321
|
+
* @param options - Request options
|
|
1322
|
+
* @returns Array of {@link ClinicalClientGoal} records
|
|
1323
|
+
*/
|
|
1324
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientGoal[]>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Get a single client goal by ID.
|
|
1327
|
+
*
|
|
1328
|
+
* @param id - ClientGoal UUID
|
|
1329
|
+
* @param options - Request options
|
|
1330
|
+
* @returns {@link ClinicalClientGoal} record
|
|
1331
|
+
*/
|
|
1332
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Create a new client goal.
|
|
1335
|
+
*
|
|
1336
|
+
* @param attributes - Goal creation attributes. Must include `workspace_id`, `patient_id`, `goal_type`, and `title`.
|
|
1337
|
+
* @param options - Request options
|
|
1338
|
+
* @returns Created {@link ClinicalClientGoal} record
|
|
1339
|
+
*/
|
|
1340
|
+
create: (attributes: CreateClientGoalAttributes, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Update a client goal.
|
|
1343
|
+
*
|
|
1344
|
+
* @param id - ClientGoal UUID
|
|
1345
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1346
|
+
* @param options - Request options
|
|
1347
|
+
* @returns Updated {@link ClinicalClientGoal} record
|
|
1348
|
+
*/
|
|
1349
|
+
update: (id: string, attributes: UpdateClientGoalAttributes, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1350
|
+
/**
|
|
1351
|
+
* Archive (soft-delete) a client goal.
|
|
1352
|
+
*
|
|
1353
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1354
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1355
|
+
* @param id - ClientGoal UUID
|
|
1356
|
+
* @param options - Request options
|
|
1357
|
+
* @returns Archived {@link ClinicalClientGoal} record
|
|
1358
|
+
*/
|
|
1359
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Archive (soft-delete) a client goal.
|
|
1362
|
+
*
|
|
1363
|
+
* @param id - ClientGoal UUID
|
|
1364
|
+
* @param options - Request options
|
|
1365
|
+
* @returns Archived {@link ClinicalClientGoal} record
|
|
1366
|
+
*/
|
|
1367
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Restore an archived client goal.
|
|
1370
|
+
*
|
|
1371
|
+
* @param id - ClientGoal UUID
|
|
1372
|
+
* @param options - Request options
|
|
1373
|
+
* @returns Restored {@link ClinicalClientGoal} record
|
|
1374
|
+
*/
|
|
1375
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalClientGoal>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Permanently delete a client goal. Irreversible.
|
|
1378
|
+
*
|
|
1379
|
+
* @param id - ClientGoal UUID
|
|
1380
|
+
* @param options - Request options
|
|
1381
|
+
* @returns `true` on success
|
|
1382
|
+
*/
|
|
1383
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1384
|
+
/**
|
|
1385
|
+
* List archived (soft-deleted) client goals.
|
|
1386
|
+
*
|
|
1387
|
+
* @param params - Filter/pagination parameters
|
|
1388
|
+
* @param options - Request options
|
|
1389
|
+
* @returns Array of archived {@link ClinicalClientGoal} records
|
|
1390
|
+
*/
|
|
1391
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientGoal[]>;
|
|
1392
|
+
/**
|
|
1393
|
+
* Batch reorder client goals by updating their positions.
|
|
1394
|
+
*
|
|
1395
|
+
* @param items - Array of `{ id, position }` pairs specifying new order
|
|
1396
|
+
* @param options - Request options
|
|
1397
|
+
* @returns `{ reordered: number }` — count of updated goals
|
|
1398
|
+
*
|
|
1399
|
+
* @example
|
|
1400
|
+
* ```typescript
|
|
1401
|
+
* await client.clinical.clientGoals.reorder([
|
|
1402
|
+
* { id: "goal-uuid-1", position: 0 },
|
|
1403
|
+
* { id: "goal-uuid-2", position: 1 },
|
|
1404
|
+
* { id: "goal-uuid-3", position: 2 },
|
|
1405
|
+
* ]);
|
|
1406
|
+
* ```
|
|
1407
|
+
*/
|
|
1408
|
+
reorder: (items: ReorderGoalItem[], options?: RequestOptions) => Promise<ReorderGoalsResponse>;
|
|
1409
|
+
};
|
|
1410
|
+
/**
|
|
1411
|
+
* Manage supplement prescriptions for clinical patients.
|
|
1412
|
+
*/
|
|
1413
|
+
clientSupplements: {
|
|
1414
|
+
/**
|
|
1415
|
+
* List supplement prescriptions, filtered by patient/workspace.
|
|
1416
|
+
*
|
|
1417
|
+
* @param params - Filter/pagination parameters
|
|
1418
|
+
* @param options - Request options
|
|
1419
|
+
* @returns Array of {@link ClinicalClientSupplement} records
|
|
1420
|
+
*/
|
|
1421
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientSupplement[]>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Get a single supplement prescription by ID.
|
|
1424
|
+
*
|
|
1425
|
+
* @param id - ClientSupplement UUID
|
|
1426
|
+
* @param options - Request options
|
|
1427
|
+
* @returns {@link ClinicalClientSupplement} record
|
|
1428
|
+
*/
|
|
1429
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1430
|
+
/**
|
|
1431
|
+
* Create a new supplement prescription.
|
|
1432
|
+
*
|
|
1433
|
+
* @param attributes - Supplement creation attributes. Must include `workspace_id`,
|
|
1434
|
+
* `patient_id`, and `name`.
|
|
1435
|
+
* @param options - Request options
|
|
1436
|
+
* @returns Created {@link ClinicalClientSupplement} record
|
|
1437
|
+
*/
|
|
1438
|
+
create: (attributes: CreateClientSupplementAttributes, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1439
|
+
/**
|
|
1440
|
+
* Update a supplement prescription.
|
|
1441
|
+
*
|
|
1442
|
+
* @param id - ClientSupplement UUID
|
|
1443
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1444
|
+
* @param options - Request options
|
|
1445
|
+
* @returns Updated {@link ClinicalClientSupplement} record
|
|
1446
|
+
*/
|
|
1447
|
+
update: (id: string, attributes: UpdateClientSupplementAttributes, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Archive (soft-delete) a supplement prescription.
|
|
1450
|
+
*
|
|
1451
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1452
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1453
|
+
* @param id - ClientSupplement UUID
|
|
1454
|
+
* @param options - Request options
|
|
1455
|
+
* @returns Archived {@link ClinicalClientSupplement} record
|
|
1456
|
+
*/
|
|
1457
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Archive (soft-delete) a supplement prescription.
|
|
1460
|
+
*
|
|
1461
|
+
* @param id - ClientSupplement UUID
|
|
1462
|
+
* @param options - Request options
|
|
1463
|
+
* @returns Archived {@link ClinicalClientSupplement} record
|
|
1464
|
+
*/
|
|
1465
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1466
|
+
/**
|
|
1467
|
+
* Restore an archived supplement prescription.
|
|
1468
|
+
*
|
|
1469
|
+
* @param id - ClientSupplement UUID
|
|
1470
|
+
* @param options - Request options
|
|
1471
|
+
* @returns Restored {@link ClinicalClientSupplement} record
|
|
1472
|
+
*/
|
|
1473
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalClientSupplement>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Permanently delete a supplement prescription. Irreversible.
|
|
1476
|
+
*
|
|
1477
|
+
* @param id - ClientSupplement UUID
|
|
1478
|
+
* @param options - Request options
|
|
1479
|
+
* @returns `true` on success
|
|
1480
|
+
*/
|
|
1481
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1482
|
+
/**
|
|
1483
|
+
* List archived (soft-deleted) supplement prescriptions.
|
|
1484
|
+
*
|
|
1485
|
+
* @param params - Filter/pagination parameters
|
|
1486
|
+
* @param options - Request options
|
|
1487
|
+
* @returns Array of archived {@link ClinicalClientSupplement} records
|
|
1488
|
+
*/
|
|
1489
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientSupplement[]>;
|
|
1490
|
+
/**
|
|
1491
|
+
* Create multiple supplements in a single request.
|
|
1492
|
+
*
|
|
1493
|
+
* @param attrs - Bulk creation attributes with workspace_id and supplements array
|
|
1494
|
+
* @param options - Request options
|
|
1495
|
+
* @returns Array of creation results with id and status per supplement
|
|
1496
|
+
*
|
|
1497
|
+
* @example
|
|
1498
|
+
* ```typescript
|
|
1499
|
+
* const results = await client.clinical.clientSupplements.bulkCreate({
|
|
1500
|
+
* workspace_id: 'ws_123',
|
|
1501
|
+
* supplements: [
|
|
1502
|
+
* { patient_id: 'pat_1', name: 'Vitamin D3', source: 'fullscript' },
|
|
1503
|
+
* { patient_id: 'pat_1', name: 'Omega-3', source: 'fullscript' },
|
|
1504
|
+
* ],
|
|
1505
|
+
* });
|
|
1506
|
+
* ```
|
|
1507
|
+
*/
|
|
1508
|
+
bulkCreate: (attrs: {
|
|
1509
|
+
workspace_id: string;
|
|
1510
|
+
supplements: Array<Omit<CreateClientSupplementAttributes, "workspace_id">>;
|
|
1511
|
+
}, options?: RequestOptions) => Promise<Array<{
|
|
1512
|
+
id?: string;
|
|
1513
|
+
status: string;
|
|
1514
|
+
error?: string;
|
|
1515
|
+
}>>;
|
|
1516
|
+
};
|
|
1517
|
+
/**
|
|
1518
|
+
* Manage medication prescriptions for clinical patients.
|
|
1519
|
+
*/
|
|
1520
|
+
clientMedications: {
|
|
1521
|
+
/**
|
|
1522
|
+
* List medication prescriptions, filtered by patient/workspace.
|
|
1523
|
+
*
|
|
1524
|
+
* @param params - Filter/pagination parameters
|
|
1525
|
+
* @param options - Request options
|
|
1526
|
+
* @returns Array of {@link ClinicalClientMedication} records
|
|
1527
|
+
*/
|
|
1528
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientMedication[]>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Get a single medication prescription by ID.
|
|
1531
|
+
*
|
|
1532
|
+
* @param id - ClientMedication UUID
|
|
1533
|
+
* @param options - Request options
|
|
1534
|
+
* @returns {@link ClinicalClientMedication} record
|
|
1535
|
+
*/
|
|
1536
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1537
|
+
/**
|
|
1538
|
+
* Create a new medication prescription.
|
|
1539
|
+
*
|
|
1540
|
+
* @param attributes - Medication creation attributes. Must include `workspace_id`,
|
|
1541
|
+
* `patient_id`, and `name`.
|
|
1542
|
+
* @param options - Request options
|
|
1543
|
+
* @returns Created {@link ClinicalClientMedication} record
|
|
1544
|
+
*/
|
|
1545
|
+
create: (attributes: CreateClientMedicationAttributes, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1546
|
+
/**
|
|
1547
|
+
* Update a medication prescription.
|
|
1548
|
+
*
|
|
1549
|
+
* @param id - ClientMedication UUID
|
|
1550
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1551
|
+
* @param options - Request options
|
|
1552
|
+
* @returns Updated {@link ClinicalClientMedication} record
|
|
1553
|
+
*/
|
|
1554
|
+
update: (id: string, attributes: UpdateClientMedicationAttributes, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Delete (archive) a medication prescription.
|
|
1557
|
+
*
|
|
1558
|
+
* @deprecated Use {@link archive} instead.
|
|
1559
|
+
* @param id - ClientMedication UUID
|
|
1560
|
+
* @param options - Request options
|
|
1561
|
+
* @returns Archived {@link ClinicalClientMedication} record
|
|
1562
|
+
*/
|
|
1563
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1564
|
+
/**
|
|
1565
|
+
* Archive (soft-delete) a medication prescription.
|
|
1566
|
+
*
|
|
1567
|
+
* @param id - ClientMedication UUID
|
|
1568
|
+
* @param options - Request options
|
|
1569
|
+
* @returns Archived {@link ClinicalClientMedication} record
|
|
1570
|
+
*/
|
|
1571
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1572
|
+
/**
|
|
1573
|
+
* Restore an archived medication prescription.
|
|
1574
|
+
*
|
|
1575
|
+
* @param id - ClientMedication UUID
|
|
1576
|
+
* @param options - Request options
|
|
1577
|
+
* @returns Restored {@link ClinicalClientMedication} record
|
|
1578
|
+
*/
|
|
1579
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalClientMedication>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Permanently delete a medication prescription. Irreversible.
|
|
1582
|
+
*
|
|
1583
|
+
* @param id - ClientMedication UUID
|
|
1584
|
+
* @param options - Request options
|
|
1585
|
+
* @returns `true` on success
|
|
1586
|
+
*/
|
|
1587
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1588
|
+
/**
|
|
1589
|
+
* List archived (soft-deleted) medication prescriptions.
|
|
1590
|
+
*
|
|
1591
|
+
* @param params - Filter/pagination parameters
|
|
1592
|
+
* @param options - Request options
|
|
1593
|
+
* @returns Array of archived {@link ClinicalClientMedication} records
|
|
1594
|
+
*/
|
|
1595
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientMedication[]>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Create multiple medications in a single request.
|
|
1598
|
+
*
|
|
1599
|
+
* @param attrs - Bulk creation attributes with workspace_id and medications array
|
|
1600
|
+
* @param options - Request options
|
|
1601
|
+
* @returns Array of creation results with id and status per medication
|
|
1602
|
+
*
|
|
1603
|
+
* @example
|
|
1604
|
+
* ```typescript
|
|
1605
|
+
* const results = await client.clinical.clientMedications.bulkCreate({
|
|
1606
|
+
* workspace_id: 'ws_123',
|
|
1607
|
+
* medications: [
|
|
1608
|
+
* { patient_id: 'pat_1', name: 'Metformin', source: 'ehr_import' },
|
|
1609
|
+
* { patient_id: 'pat_1', name: 'Lisinopril', source: 'ehr_import' },
|
|
1610
|
+
* ],
|
|
1611
|
+
* });
|
|
1612
|
+
* ```
|
|
1613
|
+
*/
|
|
1614
|
+
bulkCreate: (attrs: {
|
|
1615
|
+
workspace_id: string;
|
|
1616
|
+
medications: Array<Omit<CreateClientMedicationAttributes, "workspace_id">>;
|
|
1617
|
+
}, options?: RequestOptions) => Promise<Array<{
|
|
1618
|
+
id?: string;
|
|
1619
|
+
status: string;
|
|
1620
|
+
error?: string;
|
|
1621
|
+
}>>;
|
|
1622
|
+
};
|
|
1623
|
+
/**
|
|
1624
|
+
* Manage clinical deliveries (care plan items sent to patients).
|
|
1625
|
+
*/
|
|
1626
|
+
deliveries: {
|
|
1627
|
+
/**
|
|
1628
|
+
* List deliveries, filtered by patient/workspace.
|
|
1629
|
+
*
|
|
1630
|
+
* @param params - Filter/pagination parameters
|
|
1631
|
+
* @param options - Request options
|
|
1632
|
+
* @returns Array of {@link ClinicalDelivery} records
|
|
1633
|
+
*/
|
|
1634
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalDelivery[]>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Get a single delivery by ID.
|
|
1637
|
+
*
|
|
1638
|
+
* @param id - Delivery UUID
|
|
1639
|
+
* @param options - Request options
|
|
1640
|
+
* @returns {@link ClinicalDelivery} record
|
|
1641
|
+
*/
|
|
1642
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalDelivery>;
|
|
1643
|
+
/**
|
|
1644
|
+
* Create a new delivery.
|
|
1645
|
+
*
|
|
1646
|
+
* @param attributes - Delivery creation attributes. Must include `workspace_id`,
|
|
1647
|
+
* `patient_id`, and `delivery_type`.
|
|
1648
|
+
* @param options - Request options
|
|
1649
|
+
* @returns Created {@link ClinicalDelivery} record
|
|
1650
|
+
*/
|
|
1651
|
+
create: (attributes: CreateDeliveryAttributes, options?: RequestOptions) => Promise<ClinicalDelivery>;
|
|
1652
|
+
/**
|
|
1653
|
+
* Update a delivery (e.g., change status to `delivered`).
|
|
1654
|
+
*
|
|
1655
|
+
* @param id - Delivery UUID
|
|
1656
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1657
|
+
* @param options - Request options
|
|
1658
|
+
* @returns Updated {@link ClinicalDelivery} record
|
|
1659
|
+
*/
|
|
1660
|
+
update: (id: string, attributes: UpdateDeliveryAttributes, options?: RequestOptions) => Promise<ClinicalDelivery>;
|
|
1661
|
+
};
|
|
1662
|
+
/**
|
|
1663
|
+
* Manage practice-level educational resources.
|
|
1664
|
+
*/
|
|
1665
|
+
practiceResources: {
|
|
1666
|
+
/**
|
|
1667
|
+
* List practice resources in a workspace.
|
|
1668
|
+
*
|
|
1669
|
+
* @param params - Filter/pagination parameters
|
|
1670
|
+
* @param options - Request options
|
|
1671
|
+
* @returns Array of {@link ClinicalPracticeResource} records
|
|
1672
|
+
*/
|
|
1673
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPracticeResource[]>;
|
|
1674
|
+
/**
|
|
1675
|
+
* Get a single practice resource by ID.
|
|
1676
|
+
*
|
|
1677
|
+
* @param id - PracticeResource UUID
|
|
1678
|
+
* @param options - Request options
|
|
1679
|
+
* @returns {@link ClinicalPracticeResource} record
|
|
1680
|
+
*/
|
|
1681
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1682
|
+
/**
|
|
1683
|
+
* Create a new practice resource.
|
|
1684
|
+
*
|
|
1685
|
+
* @param attributes - Resource creation attributes. Must include `workspace_id` and `title`.
|
|
1686
|
+
* @param options - Request options
|
|
1687
|
+
* @returns Created {@link ClinicalPracticeResource} record
|
|
1688
|
+
*/
|
|
1689
|
+
create: (attributes: CreatePracticeResourceAttributes, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1690
|
+
/**
|
|
1691
|
+
* Update a practice resource.
|
|
1692
|
+
*
|
|
1693
|
+
* @param id - PracticeResource UUID
|
|
1694
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1695
|
+
* @param options - Request options
|
|
1696
|
+
* @returns Updated {@link ClinicalPracticeResource} record
|
|
1697
|
+
*/
|
|
1698
|
+
update: (id: string, attributes: UpdatePracticeResourceAttributes, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1699
|
+
/**
|
|
1700
|
+
* Archive (soft-delete) a practice resource.
|
|
1701
|
+
*
|
|
1702
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1703
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1704
|
+
* @param id - PracticeResource UUID
|
|
1705
|
+
* @param options - Request options
|
|
1706
|
+
* @returns Archived {@link ClinicalPracticeResource} record
|
|
1707
|
+
*/
|
|
1708
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1709
|
+
/**
|
|
1710
|
+
* Archive (soft-delete) a practice resource.
|
|
1711
|
+
*
|
|
1712
|
+
* @param id - PracticeResource UUID
|
|
1713
|
+
* @param options - Request options
|
|
1714
|
+
* @returns Archived {@link ClinicalPracticeResource} record
|
|
1715
|
+
*/
|
|
1716
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1717
|
+
/**
|
|
1718
|
+
* Restore an archived practice resource.
|
|
1719
|
+
*
|
|
1720
|
+
* @param id - PracticeResource UUID
|
|
1721
|
+
* @param options - Request options
|
|
1722
|
+
* @returns Restored {@link ClinicalPracticeResource} record
|
|
1723
|
+
*/
|
|
1724
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Permanently delete a practice resource. Irreversible.
|
|
1727
|
+
*
|
|
1728
|
+
* @param id - PracticeResource UUID
|
|
1729
|
+
* @param options - Request options
|
|
1730
|
+
* @returns `true` on success
|
|
1731
|
+
*/
|
|
1732
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1733
|
+
/**
|
|
1734
|
+
* List archived (soft-deleted) practice resources.
|
|
1735
|
+
*
|
|
1736
|
+
* @param params - Filter/pagination parameters
|
|
1737
|
+
* @param options - Request options
|
|
1738
|
+
* @returns Array of archived {@link ClinicalPracticeResource} records
|
|
1739
|
+
*/
|
|
1740
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPracticeResource[]>;
|
|
1741
|
+
/**
|
|
1742
|
+
* List application-level catalog practice resources.
|
|
1743
|
+
*
|
|
1744
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
1745
|
+
* @param options - Request options
|
|
1746
|
+
* @returns Array of {@link ClinicalPracticeResource} catalog records
|
|
1747
|
+
*/
|
|
1748
|
+
listCatalog: (params?: {
|
|
1749
|
+
filter?: Record<string, unknown>;
|
|
1750
|
+
sort?: string;
|
|
1751
|
+
}, options?: RequestOptions) => Promise<ClinicalPracticeResource[]>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Archive (soft-delete) a catalog practice resource.
|
|
1754
|
+
*
|
|
1755
|
+
* @param id - PracticeResource UUID
|
|
1756
|
+
* @param options - Request options
|
|
1757
|
+
* @returns Archived {@link ClinicalPracticeResource} record
|
|
1758
|
+
*/
|
|
1759
|
+
archiveCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1760
|
+
/**
|
|
1761
|
+
* Restore an archived catalog practice resource.
|
|
1762
|
+
*
|
|
1763
|
+
* @param id - PracticeResource UUID
|
|
1764
|
+
* @param options - Request options
|
|
1765
|
+
* @returns Restored {@link ClinicalPracticeResource} record
|
|
1766
|
+
*/
|
|
1767
|
+
restoreCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeResource>;
|
|
1768
|
+
/**
|
|
1769
|
+
* Permanently delete a catalog practice resource. Irreversible.
|
|
1770
|
+
*
|
|
1771
|
+
* @param id - PracticeResource UUID
|
|
1772
|
+
* @param options - Request options
|
|
1773
|
+
* @returns `true` on success
|
|
1774
|
+
*/
|
|
1775
|
+
permanentDeleteCatalog: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1776
|
+
/**
|
|
1777
|
+
* List archived (soft-deleted) catalog practice resources.
|
|
1778
|
+
*
|
|
1779
|
+
* @param params - Filter/pagination parameters
|
|
1780
|
+
* @param options - Request options
|
|
1781
|
+
* @returns Array of archived {@link ClinicalPracticeResource} catalog records
|
|
1782
|
+
*/
|
|
1783
|
+
listArchivedCatalog: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPracticeResource[]>;
|
|
1784
|
+
/**
|
|
1785
|
+
* List distinct practice resource categories in a workspace.
|
|
1786
|
+
*
|
|
1787
|
+
* Returns unique `resource_type` values with their active resource counts,
|
|
1788
|
+
* sorted by count descending.
|
|
1789
|
+
*
|
|
1790
|
+
* @param params - Must include `workspace_id`
|
|
1791
|
+
* @param options - Request options
|
|
1792
|
+
* @returns Array of {@link PracticeResourceCategory} records
|
|
1793
|
+
*
|
|
1794
|
+
* @example
|
|
1795
|
+
* ```typescript
|
|
1796
|
+
* const categories = await client.clinical.practiceResources.listCategories({
|
|
1797
|
+
* workspace_id: "..."
|
|
1798
|
+
* });
|
|
1799
|
+
* // [{ category: "article", resource_count: 5 }, { category: "video", resource_count: 3 }]
|
|
1800
|
+
* ```
|
|
1801
|
+
*/
|
|
1802
|
+
listCategories: (params: {
|
|
1803
|
+
workspace_id: string;
|
|
1804
|
+
}, options?: RequestOptions) => Promise<PracticeResourceCategory[]>;
|
|
1805
|
+
/**
|
|
1806
|
+
* List distinct catalog practice resource categories.
|
|
1807
|
+
*
|
|
1808
|
+
* Returns unique `resource_type` values from application-level catalog resources.
|
|
1809
|
+
* Application ID is resolved from the API key context.
|
|
1810
|
+
*
|
|
1811
|
+
* @param options - Request options
|
|
1812
|
+
* @returns Array of {@link PracticeResourceCategory} records
|
|
1813
|
+
*
|
|
1814
|
+
* @example
|
|
1815
|
+
* ```typescript
|
|
1816
|
+
* const cats = await client.clinical.practiceResources.listCatalogCategories();
|
|
1817
|
+
* ```
|
|
1818
|
+
*/
|
|
1819
|
+
listCatalogCategories: (options?: RequestOptions) => Promise<PracticeResourceCategory[]>;
|
|
1820
|
+
tags: {
|
|
1821
|
+
rename: (workspaceId: string, oldTag: string, newTag: string, options?: RequestOptions) => Promise<TagRenameResult>;
|
|
1822
|
+
delete: (workspaceId: string, tag: string, options?: RequestOptions) => Promise<TagDeleteResult>;
|
|
1823
|
+
merge: (workspaceId: string, sourceTags: string[], targetTag: string, options?: RequestOptions) => Promise<TagMergeResult>;
|
|
1824
|
+
};
|
|
1825
|
+
imports: {
|
|
1826
|
+
fromFile: (workspaceId: string, file: File | Blob, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
1827
|
+
fromUrl: (workspaceId: string, url: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
1828
|
+
};
|
|
1829
|
+
duplicates: {
|
|
1830
|
+
getStats: (workspaceId: string, options?: RequestOptions) => Promise<DuplicateStats>;
|
|
1831
|
+
listGroups: (workspaceId: string, opts?: {
|
|
1832
|
+
threshold?: number;
|
|
1833
|
+
limit?: number;
|
|
1834
|
+
}, options?: RequestOptions) => Promise<DuplicateGroup[]>;
|
|
1835
|
+
resolve: (workspaceId: string, groupId: string, keepId: string, options?: RequestOptions) => Promise<DuplicateResolveResult>;
|
|
1836
|
+
};
|
|
1837
|
+
/**
|
|
1838
|
+
* Search practice resources using semantic similarity.
|
|
1839
|
+
* Finds resources matching the query by meaning, not just keywords.
|
|
1840
|
+
*
|
|
1841
|
+
* @param workspaceId - The workspace to search in
|
|
1842
|
+
* @param params - Search parameters
|
|
1843
|
+
* @param params.query - Free-text search query
|
|
1844
|
+
* @param params.limit - Maximum results to return (default: 10)
|
|
1845
|
+
* @returns Array of matching practice resources with similarity scores
|
|
1846
|
+
*
|
|
1847
|
+
* @example
|
|
1848
|
+
* ```typescript
|
|
1849
|
+
* const results = await client.clinical.practiceResources.search(workspaceId, {
|
|
1850
|
+
* query: "diabetes management patient education",
|
|
1851
|
+
* limit: 5,
|
|
1852
|
+
* });
|
|
1853
|
+
* ```
|
|
1854
|
+
*/
|
|
1855
|
+
search: (workspaceId: string, params: {
|
|
1856
|
+
query: string;
|
|
1857
|
+
limit?: number;
|
|
1858
|
+
}, options?: RequestOptions) => Promise<ClinicalSearchResult[]>;
|
|
1859
|
+
};
|
|
1860
|
+
/**
|
|
1861
|
+
* Manage practice-level assessment and therapeutic tools.
|
|
1862
|
+
*/
|
|
1863
|
+
practiceTools: {
|
|
1864
|
+
/**
|
|
1865
|
+
* List practice tools in a workspace.
|
|
1866
|
+
*
|
|
1867
|
+
* @param params - Filter/pagination parameters
|
|
1868
|
+
* @param options - Request options
|
|
1869
|
+
* @returns Array of {@link ClinicalPracticeTool} records
|
|
1870
|
+
*/
|
|
1871
|
+
list: (params: ListPracticeToolsParams, options?: RequestOptions) => Promise<ClinicalPracticeTool[]>;
|
|
1872
|
+
/**
|
|
1873
|
+
* Get a single practice tool by ID.
|
|
1874
|
+
*
|
|
1875
|
+
* @param id - PracticeTool UUID
|
|
1876
|
+
* @param options - Request options
|
|
1877
|
+
* @returns {@link ClinicalPracticeTool} record
|
|
1878
|
+
*/
|
|
1879
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1880
|
+
/**
|
|
1881
|
+
* Create a new practice tool.
|
|
1882
|
+
*
|
|
1883
|
+
* @param attributes - Tool creation attributes. Must include `workspace_id` and `name`.
|
|
1884
|
+
* @param options - Request options
|
|
1885
|
+
* @returns Created {@link ClinicalPracticeTool} record
|
|
1886
|
+
*/
|
|
1887
|
+
create: (attributes: CreatePracticeToolAttributes, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Update a practice tool.
|
|
1890
|
+
*
|
|
1891
|
+
* @param id - PracticeTool UUID
|
|
1892
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
1893
|
+
* @param options - Request options
|
|
1894
|
+
* @returns Updated {@link ClinicalPracticeTool} record
|
|
1895
|
+
*/
|
|
1896
|
+
update: (id: string, attributes: UpdatePracticeToolAttributes, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1897
|
+
/**
|
|
1898
|
+
* Archive (soft-delete) a practice tool.
|
|
1899
|
+
*
|
|
1900
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
1901
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
1902
|
+
* @param id - PracticeTool UUID
|
|
1903
|
+
* @param options - Request options
|
|
1904
|
+
* @returns Archived {@link ClinicalPracticeTool} record
|
|
1905
|
+
*/
|
|
1906
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1907
|
+
/**
|
|
1908
|
+
* Archive (soft-delete) a practice tool.
|
|
1909
|
+
*
|
|
1910
|
+
* @param id - PracticeTool UUID
|
|
1911
|
+
* @param options - Request options
|
|
1912
|
+
* @returns Archived {@link ClinicalPracticeTool} record
|
|
1913
|
+
*/
|
|
1914
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1915
|
+
/**
|
|
1916
|
+
* Restore an archived practice tool.
|
|
1917
|
+
*
|
|
1918
|
+
* @param id - PracticeTool UUID
|
|
1919
|
+
* @param options - Request options
|
|
1920
|
+
* @returns Restored {@link ClinicalPracticeTool} record
|
|
1921
|
+
*/
|
|
1922
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1923
|
+
/**
|
|
1924
|
+
* Permanently delete a practice tool. Irreversible.
|
|
1925
|
+
*
|
|
1926
|
+
* @param id - PracticeTool UUID
|
|
1927
|
+
* @param options - Request options
|
|
1928
|
+
* @returns `true` on success
|
|
1929
|
+
*/
|
|
1930
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1931
|
+
/**
|
|
1932
|
+
* List archived (soft-deleted) practice tools.
|
|
1933
|
+
*
|
|
1934
|
+
* @param params - Filter/pagination parameters
|
|
1935
|
+
* @param options - Request options
|
|
1936
|
+
* @returns Array of archived {@link ClinicalPracticeTool} records
|
|
1937
|
+
*/
|
|
1938
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPracticeTool[]>;
|
|
1939
|
+
/**
|
|
1940
|
+
* List distinct practice tool categories in a workspace.
|
|
1941
|
+
*
|
|
1942
|
+
* Returns unique `tool_type` values with their active tool counts,
|
|
1943
|
+
* sorted by count descending.
|
|
1944
|
+
*
|
|
1945
|
+
* @param params - Must include `workspace_id`
|
|
1946
|
+
* @param options - Request options
|
|
1947
|
+
* @returns Array of {@link PracticeToolCategory} records
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* const categories = await client.clinical.practiceTools.listCategories({
|
|
1952
|
+
* workspace_id: "..."
|
|
1953
|
+
* });
|
|
1954
|
+
* // [{ category: "app", tool_count: 5 }, { category: "wearable", tool_count: 3 }]
|
|
1955
|
+
* ```
|
|
1956
|
+
*/
|
|
1957
|
+
listCategories: (params: {
|
|
1958
|
+
workspace_id: string;
|
|
1959
|
+
}, options?: RequestOptions) => Promise<PracticeToolCategory[]>;
|
|
1960
|
+
/**
|
|
1961
|
+
* List application-level catalog practice tools.
|
|
1962
|
+
*
|
|
1963
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
1964
|
+
* @param options - Request options
|
|
1965
|
+
* @returns Array of {@link ClinicalPracticeTool} catalog records
|
|
1966
|
+
*/
|
|
1967
|
+
listCatalog: (params?: {
|
|
1968
|
+
filter?: Record<string, unknown>;
|
|
1969
|
+
sort?: string;
|
|
1970
|
+
}, options?: RequestOptions) => Promise<ClinicalPracticeTool[]>;
|
|
1971
|
+
/**
|
|
1972
|
+
* Archive (soft-delete) a catalog practice tool.
|
|
1973
|
+
*
|
|
1974
|
+
* @param id - PracticeTool UUID
|
|
1975
|
+
* @param options - Request options
|
|
1976
|
+
* @returns Archived {@link ClinicalPracticeTool} record
|
|
1977
|
+
*/
|
|
1978
|
+
archiveCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1979
|
+
/**
|
|
1980
|
+
* Restore an archived catalog practice tool.
|
|
1981
|
+
*
|
|
1982
|
+
* @param id - PracticeTool UUID
|
|
1983
|
+
* @param options - Request options
|
|
1984
|
+
* @returns Restored {@link ClinicalPracticeTool} record
|
|
1985
|
+
*/
|
|
1986
|
+
restoreCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalPracticeTool>;
|
|
1987
|
+
/**
|
|
1988
|
+
* Permanently delete a catalog practice tool. Irreversible.
|
|
1989
|
+
*
|
|
1990
|
+
* @param id - PracticeTool UUID
|
|
1991
|
+
* @param options - Request options
|
|
1992
|
+
* @returns `true` on success
|
|
1993
|
+
*/
|
|
1994
|
+
permanentDeleteCatalog: (id: string, options?: RequestOptions) => Promise<true>;
|
|
1995
|
+
/**
|
|
1996
|
+
* List archived (soft-deleted) catalog practice tools.
|
|
1997
|
+
*
|
|
1998
|
+
* @param params - Filter/pagination parameters
|
|
1999
|
+
* @param options - Request options
|
|
2000
|
+
* @returns Array of archived {@link ClinicalPracticeTool} catalog records
|
|
2001
|
+
*/
|
|
2002
|
+
listArchivedCatalog: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalPracticeTool[]>;
|
|
2003
|
+
/**
|
|
2004
|
+
* List distinct catalog practice tool categories.
|
|
2005
|
+
*
|
|
2006
|
+
* Returns unique `tool_type` values from application-level catalog tools.
|
|
2007
|
+
* Application ID is resolved from the API key context.
|
|
2008
|
+
*
|
|
2009
|
+
* @param options - Request options
|
|
2010
|
+
* @returns Array of {@link PracticeToolCategory} records
|
|
2011
|
+
*
|
|
2012
|
+
* @example
|
|
2013
|
+
* ```typescript
|
|
2014
|
+
* const cats = await client.clinical.practiceTools.listCatalogCategories();
|
|
2015
|
+
* ```
|
|
2016
|
+
*/
|
|
2017
|
+
listCatalogCategories: (options?: RequestOptions) => Promise<PracticeToolCategory[]>;
|
|
2018
|
+
tags: {
|
|
2019
|
+
rename: (workspaceId: string, oldTag: string, newTag: string, options?: RequestOptions) => Promise<TagRenameResult>;
|
|
2020
|
+
delete: (workspaceId: string, tag: string, options?: RequestOptions) => Promise<TagDeleteResult>;
|
|
2021
|
+
merge: (workspaceId: string, sourceTags: string[], targetTag: string, options?: RequestOptions) => Promise<TagMergeResult>;
|
|
2022
|
+
};
|
|
2023
|
+
imports: {
|
|
2024
|
+
fromFile: (workspaceId: string, file: File | Blob, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
2025
|
+
fromUrl: (workspaceId: string, url: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
2026
|
+
};
|
|
2027
|
+
duplicates: {
|
|
2028
|
+
getStats: (workspaceId: string, options?: RequestOptions) => Promise<DuplicateStats>;
|
|
2029
|
+
listGroups: (workspaceId: string, opts?: {
|
|
2030
|
+
threshold?: number;
|
|
2031
|
+
limit?: number;
|
|
2032
|
+
}, options?: RequestOptions) => Promise<DuplicateGroup[]>;
|
|
2033
|
+
resolve: (workspaceId: string, groupId: string, keepId: string, options?: RequestOptions) => Promise<DuplicateResolveResult>;
|
|
2034
|
+
};
|
|
2035
|
+
/**
|
|
2036
|
+
* Search practice tools using semantic similarity.
|
|
2037
|
+
*
|
|
2038
|
+
* @param workspaceId - The workspace to search in
|
|
2039
|
+
* @param params - Search parameters
|
|
2040
|
+
* @param params.query - Free-text search query
|
|
2041
|
+
* @param params.limit - Maximum results to return (default: 10)
|
|
2042
|
+
* @returns Array of matching practice tools with similarity scores
|
|
2043
|
+
*
|
|
2044
|
+
* @example
|
|
2045
|
+
* ```typescript
|
|
2046
|
+
* const results = await client.clinical.practiceTools.search(workspaceId, {
|
|
2047
|
+
* query: "stress assessment screening tool",
|
|
2048
|
+
* limit: 5,
|
|
2049
|
+
* });
|
|
2050
|
+
* ```
|
|
2051
|
+
*/
|
|
2052
|
+
search: (workspaceId: string, params: {
|
|
2053
|
+
query: string;
|
|
2054
|
+
limit?: number;
|
|
2055
|
+
}, options?: RequestOptions) => Promise<ClinicalSearchResult[]>;
|
|
2056
|
+
};
|
|
2057
|
+
/**
|
|
2058
|
+
* Manage assignments of practice resources to patients.
|
|
2059
|
+
*/
|
|
2060
|
+
clientResourceAssignments: {
|
|
2061
|
+
/**
|
|
2062
|
+
* List resource assignments, filtered by patient/workspace.
|
|
2063
|
+
*
|
|
2064
|
+
* @param params - Filter/pagination parameters
|
|
2065
|
+
* @param options - Request options
|
|
2066
|
+
* @returns Array of {@link ClinicalClientResourceAssignment} records
|
|
2067
|
+
*/
|
|
2068
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment[]>;
|
|
2069
|
+
/**
|
|
2070
|
+
* Get a single resource assignment by ID.
|
|
2071
|
+
*
|
|
2072
|
+
* @param id - ClientResourceAssignment UUID
|
|
2073
|
+
* @param options - Request options
|
|
2074
|
+
* @returns {@link ClinicalClientResourceAssignment} record
|
|
2075
|
+
*/
|
|
2076
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Assign a practice resource to a patient.
|
|
2079
|
+
*
|
|
2080
|
+
* @param attributes - Assignment creation attributes. Must include `workspace_id`,
|
|
2081
|
+
* `patient_id`, and `resource_id`.
|
|
2082
|
+
* @param options - Request options
|
|
2083
|
+
* @returns Created {@link ClinicalClientResourceAssignment} record
|
|
2084
|
+
*/
|
|
2085
|
+
create: (attributes: CreateClientResourceAssignmentAttributes, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2086
|
+
/**
|
|
2087
|
+
* Update a resource assignment (e.g., mark as completed).
|
|
2088
|
+
*
|
|
2089
|
+
* @param id - ClientResourceAssignment UUID
|
|
2090
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
2091
|
+
* @param options - Request options
|
|
2092
|
+
* @returns Updated {@link ClinicalClientResourceAssignment} record
|
|
2093
|
+
*/
|
|
2094
|
+
update: (id: string, attributes: UpdateClientResourceAssignmentAttributes, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2095
|
+
/**
|
|
2096
|
+
* Archive (soft-delete) a resource assignment.
|
|
2097
|
+
*
|
|
2098
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
2099
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
2100
|
+
* @param id - ClientResourceAssignment UUID
|
|
2101
|
+
* @param options - Request options
|
|
2102
|
+
* @returns Archived {@link ClinicalClientResourceAssignment} record
|
|
2103
|
+
*/
|
|
2104
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2105
|
+
/**
|
|
2106
|
+
* Archive (soft-delete) a resource assignment.
|
|
2107
|
+
*
|
|
2108
|
+
* @param id - ClientResourceAssignment UUID
|
|
2109
|
+
* @param options - Request options
|
|
2110
|
+
* @returns Archived {@link ClinicalClientResourceAssignment} record
|
|
2111
|
+
*/
|
|
2112
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2113
|
+
/**
|
|
2114
|
+
* Restore an archived resource assignment.
|
|
2115
|
+
*
|
|
2116
|
+
* @param id - ClientResourceAssignment UUID
|
|
2117
|
+
* @param options - Request options
|
|
2118
|
+
* @returns Restored {@link ClinicalClientResourceAssignment} record
|
|
2119
|
+
*/
|
|
2120
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment>;
|
|
2121
|
+
/**
|
|
2122
|
+
* Permanently delete a resource assignment. Irreversible.
|
|
2123
|
+
*
|
|
2124
|
+
* @param id - ClientResourceAssignment UUID
|
|
2125
|
+
* @param options - Request options
|
|
2126
|
+
* @returns `true` on success
|
|
2127
|
+
*/
|
|
2128
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
2129
|
+
/**
|
|
2130
|
+
* List archived (soft-deleted) resource assignments.
|
|
2131
|
+
*
|
|
2132
|
+
* @param params - Filter/pagination parameters
|
|
2133
|
+
* @param options - Request options
|
|
2134
|
+
* @returns Array of archived {@link ClinicalClientResourceAssignment} records
|
|
2135
|
+
*/
|
|
2136
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalClientResourceAssignment[]>;
|
|
2137
|
+
};
|
|
2138
|
+
/**
|
|
2139
|
+
* Read-only access to the AI-generated supplement recommendation cache.
|
|
2140
|
+
*
|
|
2141
|
+
* This resource is server-managed — entries are created and updated
|
|
2142
|
+
* exclusively by the AI post-session pipeline. Direct create/update
|
|
2143
|
+
* operations are not supported.
|
|
2144
|
+
*/
|
|
2145
|
+
supplementRecCache: {
|
|
2146
|
+
/**
|
|
2147
|
+
* List supplement recommendation cache entries, filtered by patient/workspace.
|
|
2148
|
+
*
|
|
2149
|
+
* @param params - Filter/pagination parameters
|
|
2150
|
+
* @param options - Request options
|
|
2151
|
+
* @returns Array of {@link ClinicalSupplementRecCache} records
|
|
2152
|
+
*/
|
|
2153
|
+
list: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalSupplementRecCache[]>;
|
|
2154
|
+
/**
|
|
2155
|
+
* Get a single supplement recommendation cache entry by ID.
|
|
2156
|
+
*
|
|
2157
|
+
* @param id - SupplementRecCache UUID
|
|
2158
|
+
* @param options - Request options
|
|
2159
|
+
* @returns {@link ClinicalSupplementRecCache} record
|
|
2160
|
+
*/
|
|
2161
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalSupplementRecCache>;
|
|
2162
|
+
/**
|
|
2163
|
+
* Generate supplement recommendations for a patient via the AI pipeline.
|
|
2164
|
+
*
|
|
2165
|
+
* Returns immediately with an execution ID; poll executions for results.
|
|
2166
|
+
* The AI pipeline populates the supplement recommendation cache entries
|
|
2167
|
+
* once the execution completes.
|
|
2168
|
+
*
|
|
2169
|
+
* @param patientId - Patient UUID
|
|
2170
|
+
* @param sessionId - Session UUID to base recommendations on
|
|
2171
|
+
* @param workspaceId - Workspace UUID
|
|
2172
|
+
* @param options - Request options
|
|
2173
|
+
* @returns {@link GenerateSupplementRecsResponse} with execution_id
|
|
2174
|
+
*
|
|
2175
|
+
* @example
|
|
2176
|
+
* ```typescript
|
|
2177
|
+
* const { execution_id } = await client.clinical.supplementRecCache.generate(
|
|
2178
|
+
* 'pat_abc123',
|
|
2179
|
+
* 'sess_xyz',
|
|
2180
|
+
* 'ws_123',
|
|
2181
|
+
* );
|
|
2182
|
+
* ```
|
|
2183
|
+
*/
|
|
2184
|
+
generate: (patientId: string, sessionId: string, workspaceId: string, options?: RequestOptions) => Promise<GenerateSupplementRecsResponse>;
|
|
2185
|
+
};
|
|
2186
|
+
/**
|
|
2187
|
+
* Manage reusable clinical goal templates.
|
|
2188
|
+
*
|
|
2189
|
+
* Templates are workspace-scoped patterns that practitioners can personalize
|
|
2190
|
+
* and instantiate as ClientGoals.
|
|
2191
|
+
*/
|
|
2192
|
+
goalTemplates: {
|
|
2193
|
+
/**
|
|
2194
|
+
* List goal templates in a workspace.
|
|
2195
|
+
*
|
|
2196
|
+
* @param params - Must include `workspace_id`
|
|
2197
|
+
* @param options - Request options
|
|
2198
|
+
* @returns Array of {@link ClinicalGoalTemplate} records
|
|
2199
|
+
*
|
|
2200
|
+
* @example
|
|
2201
|
+
* ```typescript
|
|
2202
|
+
* const templates = await client.clinical.goalTemplates.list({
|
|
2203
|
+
* workspace_id: "ws_123",
|
|
2204
|
+
* filter: { category: "nutrition" },
|
|
2205
|
+
* });
|
|
2206
|
+
* ```
|
|
2207
|
+
*/
|
|
2208
|
+
list: (params: ListGoalTemplatesParams, options?: RequestOptions) => Promise<ClinicalGoalTemplate[]>;
|
|
2209
|
+
/**
|
|
2210
|
+
* List practitioner's personal templates.
|
|
2211
|
+
*
|
|
2212
|
+
* @param params - Must include `created_by_id`
|
|
2213
|
+
* @param options - Request options
|
|
2214
|
+
* @returns Array of {@link ClinicalGoalTemplate} records
|
|
2215
|
+
*/
|
|
2216
|
+
listMine: (params: {
|
|
2217
|
+
created_by_id: string;
|
|
2218
|
+
page?: {
|
|
2219
|
+
offset?: number;
|
|
2220
|
+
limit?: number;
|
|
2221
|
+
};
|
|
2222
|
+
}, options?: RequestOptions) => Promise<ClinicalGoalTemplate[]>;
|
|
2223
|
+
/**
|
|
2224
|
+
* List distinct goal template categories with counts.
|
|
2225
|
+
*
|
|
2226
|
+
* @param params - Must include `workspace_id`
|
|
2227
|
+
* @param options - Request options
|
|
2228
|
+
* @returns Array of {@link ClinicalGoalTemplateCategory} records
|
|
2229
|
+
*/
|
|
2230
|
+
listCategories: (params: {
|
|
2231
|
+
workspace_id: string;
|
|
2232
|
+
}, options?: RequestOptions) => Promise<ClinicalGoalTemplateCategory[]>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Get a single goal template by ID.
|
|
2235
|
+
*
|
|
2236
|
+
* @param id - GoalTemplate UUID
|
|
2237
|
+
* @param options - Request options
|
|
2238
|
+
* @returns {@link ClinicalGoalTemplate} record
|
|
2239
|
+
*/
|
|
2240
|
+
get: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2241
|
+
/**
|
|
2242
|
+
* Create a new goal template.
|
|
2243
|
+
*
|
|
2244
|
+
* @param attributes - Template creation attributes. Must include `workspace_id`, `goal_type`, and `title`.
|
|
2245
|
+
* @param options - Request options
|
|
2246
|
+
* @returns Created {@link ClinicalGoalTemplate} record
|
|
2247
|
+
*/
|
|
2248
|
+
create: (attributes: CreateGoalTemplateAttributes, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2249
|
+
/**
|
|
2250
|
+
* Create a personalized template from an existing one.
|
|
2251
|
+
*
|
|
2252
|
+
* Copies all fields from the source template, sets `created_by_id` to the
|
|
2253
|
+
* current actor, and sets `source_template_id` as a reference.
|
|
2254
|
+
*
|
|
2255
|
+
* @param attributes - Must include `workspace_id` and `source_template_id`
|
|
2256
|
+
* @param options - Request options
|
|
2257
|
+
* @returns Created {@link ClinicalGoalTemplate} record
|
|
2258
|
+
*
|
|
2259
|
+
* @example
|
|
2260
|
+
* ```typescript
|
|
2261
|
+
* const personal = await client.clinical.goalTemplates.createFromExisting({
|
|
2262
|
+
* workspace_id: "ws_123",
|
|
2263
|
+
* source_template_id: "tmpl_abc",
|
|
2264
|
+
* });
|
|
2265
|
+
* ```
|
|
2266
|
+
*/
|
|
2267
|
+
createFromExisting: (attributes: CreateGoalFromExistingAttributes, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2268
|
+
/**
|
|
2269
|
+
* Update a goal template.
|
|
2270
|
+
*
|
|
2271
|
+
* @param id - GoalTemplate UUID
|
|
2272
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
2273
|
+
* @param options - Request options
|
|
2274
|
+
* @returns Updated {@link ClinicalGoalTemplate} record
|
|
2275
|
+
*/
|
|
2276
|
+
update: (id: string, attributes: UpdateGoalTemplateAttributes, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2277
|
+
/**
|
|
2278
|
+
* Archive (soft-delete) a goal template.
|
|
2279
|
+
*
|
|
2280
|
+
* @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
|
|
2281
|
+
* Use `permanentDelete()` for irreversible removal.
|
|
2282
|
+
* @param id - GoalTemplate UUID
|
|
2283
|
+
* @param options - Request options
|
|
2284
|
+
* @returns Archived {@link ClinicalGoalTemplate} record
|
|
2285
|
+
*/
|
|
2286
|
+
delete: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2287
|
+
/**
|
|
2288
|
+
* Archive (soft-delete) a goal template.
|
|
2289
|
+
*
|
|
2290
|
+
* @param id - GoalTemplate UUID
|
|
2291
|
+
* @param options - Request options
|
|
2292
|
+
* @returns Archived {@link ClinicalGoalTemplate} record
|
|
2293
|
+
*/
|
|
2294
|
+
archive: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2295
|
+
/**
|
|
2296
|
+
* Restore an archived goal template.
|
|
2297
|
+
*
|
|
2298
|
+
* @param id - GoalTemplate UUID
|
|
2299
|
+
* @param options - Request options
|
|
2300
|
+
* @returns Restored {@link ClinicalGoalTemplate} record
|
|
2301
|
+
*/
|
|
2302
|
+
restore: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2303
|
+
/**
|
|
2304
|
+
* Permanently delete a goal template. Irreversible.
|
|
2305
|
+
*
|
|
2306
|
+
* @param id - GoalTemplate UUID
|
|
2307
|
+
* @param options - Request options
|
|
2308
|
+
* @returns `true` on success
|
|
2309
|
+
*/
|
|
2310
|
+
permanentDelete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
2311
|
+
/**
|
|
2312
|
+
* List archived (soft-deleted) goal templates.
|
|
2313
|
+
*
|
|
2314
|
+
* @param params - Filter/pagination parameters
|
|
2315
|
+
* @param options - Request options
|
|
2316
|
+
* @returns Array of archived {@link ClinicalGoalTemplate} records
|
|
2317
|
+
*/
|
|
2318
|
+
listArchived: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalGoalTemplate[]>;
|
|
2319
|
+
/**
|
|
2320
|
+
* List application-level catalog goal templates.
|
|
2321
|
+
*
|
|
2322
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
2323
|
+
* @param options - Request options
|
|
2324
|
+
* @returns Array of {@link ClinicalGoalTemplate} catalog records
|
|
2325
|
+
*/
|
|
2326
|
+
listCatalog: (params?: {
|
|
2327
|
+
filter?: Record<string, unknown>;
|
|
2328
|
+
sort?: string;
|
|
2329
|
+
}, options?: RequestOptions) => Promise<ClinicalGoalTemplate[]>;
|
|
2330
|
+
/**
|
|
2331
|
+
* Archive (soft-delete) a catalog goal template.
|
|
2332
|
+
*
|
|
2333
|
+
* @param id - GoalTemplate UUID
|
|
2334
|
+
* @param options - Request options
|
|
2335
|
+
* @returns Archived {@link ClinicalGoalTemplate} record
|
|
2336
|
+
*/
|
|
2337
|
+
archiveCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Restore an archived catalog goal template.
|
|
2340
|
+
*
|
|
2341
|
+
* @param id - GoalTemplate UUID
|
|
2342
|
+
* @param options - Request options
|
|
2343
|
+
* @returns Restored {@link ClinicalGoalTemplate} record
|
|
2344
|
+
*/
|
|
2345
|
+
restoreCatalog: (id: string, options?: RequestOptions) => Promise<ClinicalGoalTemplate>;
|
|
2346
|
+
/**
|
|
2347
|
+
* Permanently delete a catalog goal template. Irreversible.
|
|
2348
|
+
*
|
|
2349
|
+
* @param id - GoalTemplate UUID
|
|
2350
|
+
* @param options - Request options
|
|
2351
|
+
* @returns `true` on success
|
|
2352
|
+
*/
|
|
2353
|
+
permanentDeleteCatalog: (id: string, options?: RequestOptions) => Promise<true>;
|
|
2354
|
+
/**
|
|
2355
|
+
* List archived (soft-deleted) catalog goal templates.
|
|
2356
|
+
*
|
|
2357
|
+
* @param params - Filter/pagination parameters
|
|
2358
|
+
* @param options - Request options
|
|
2359
|
+
* @returns Array of archived {@link ClinicalGoalTemplate} catalog records
|
|
2360
|
+
*/
|
|
2361
|
+
listArchivedCatalog: (params?: ClinicalListParams, options?: RequestOptions) => Promise<ClinicalGoalTemplate[]>;
|
|
2362
|
+
/**
|
|
2363
|
+
* List distinct catalog goal template categories.
|
|
2364
|
+
*
|
|
2365
|
+
* Returns unique `category` values from application-level catalog templates.
|
|
2366
|
+
* Application ID is resolved from the API key context.
|
|
2367
|
+
*
|
|
2368
|
+
* @param options - Request options
|
|
2369
|
+
* @returns Array of {@link ClinicalGoalTemplateCategory} records
|
|
2370
|
+
*
|
|
2371
|
+
* @example
|
|
2372
|
+
* ```typescript
|
|
2373
|
+
* const cats = await client.clinical.goalTemplates.listCatalogCategories();
|
|
2374
|
+
* ```
|
|
2375
|
+
*/
|
|
2376
|
+
listCatalogCategories: (options?: RequestOptions) => Promise<ClinicalGoalTemplateCategory[]>;
|
|
2377
|
+
tags: {
|
|
2378
|
+
rename: (workspaceId: string, oldTag: string, newTag: string, options?: RequestOptions) => Promise<TagRenameResult>;
|
|
2379
|
+
delete: (workspaceId: string, tag: string, options?: RequestOptions) => Promise<TagDeleteResult>;
|
|
2380
|
+
merge: (workspaceId: string, sourceTags: string[], targetTag: string, options?: RequestOptions) => Promise<TagMergeResult>;
|
|
2381
|
+
};
|
|
2382
|
+
imports: {
|
|
2383
|
+
fromFile: (workspaceId: string, file: File | Blob, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
2384
|
+
fromUrl: (workspaceId: string, url: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
2385
|
+
};
|
|
2386
|
+
duplicates: {
|
|
2387
|
+
getStats: (workspaceId: string, options?: RequestOptions) => Promise<DuplicateStats>;
|
|
2388
|
+
listGroups: (workspaceId: string, opts?: {
|
|
2389
|
+
threshold?: number;
|
|
2390
|
+
limit?: number;
|
|
2391
|
+
}, options?: RequestOptions) => Promise<DuplicateGroup[]>;
|
|
2392
|
+
resolve: (workspaceId: string, groupId: string, keepId: string, options?: RequestOptions) => Promise<DuplicateResolveResult>;
|
|
2393
|
+
};
|
|
2394
|
+
/**
|
|
2395
|
+
* Search goal templates using semantic similarity.
|
|
2396
|
+
*
|
|
2397
|
+
* @param workspaceId - The workspace to search in
|
|
2398
|
+
* @param params - Search parameters
|
|
2399
|
+
* @param params.query - Free-text search query
|
|
2400
|
+
* @param params.limit - Maximum results to return (default: 10)
|
|
2401
|
+
* @returns Array of matching goal templates with similarity scores
|
|
2402
|
+
*
|
|
2403
|
+
* @example
|
|
2404
|
+
* ```typescript
|
|
2405
|
+
* const results = await client.clinical.goalTemplates.search(workspaceId, {
|
|
2406
|
+
* query: "improve sleep quality and duration",
|
|
2407
|
+
* limit: 5,
|
|
2408
|
+
* });
|
|
2409
|
+
* ```
|
|
2410
|
+
*/
|
|
2411
|
+
search: (workspaceId: string, params: {
|
|
2412
|
+
query: string;
|
|
2413
|
+
limit?: number;
|
|
2414
|
+
}, options?: RequestOptions) => Promise<ClinicalSearchResult[]>;
|
|
2415
|
+
};
|
|
2416
|
+
/**
|
|
2417
|
+
* Recipe search via configured Edamam connector.
|
|
2418
|
+
*/
|
|
2419
|
+
recipes: {
|
|
2420
|
+
/**
|
|
2421
|
+
* Search recipes using a connected Edamam API integration.
|
|
2422
|
+
*
|
|
2423
|
+
* Requires an Edamam connector to be configured in the workspace.
|
|
2424
|
+
* Returns raw Edamam API response data.
|
|
2425
|
+
*
|
|
2426
|
+
* @param params - Search parameters. Must include `query`, `connector_id`, and `workspace_id`.
|
|
2427
|
+
* @param options - Request options
|
|
2428
|
+
* @returns Edamam API search results
|
|
2429
|
+
*
|
|
2430
|
+
* @example
|
|
2431
|
+
* ```typescript
|
|
2432
|
+
* const results = await client.clinical.recipes.search({
|
|
2433
|
+
* query: 'high protein lunch',
|
|
2434
|
+
* connector_id: 'conn_edamam_123',
|
|
2435
|
+
* workspace_id: 'ws_123',
|
|
2436
|
+
* diet: 'high-protein',
|
|
2437
|
+
* });
|
|
2438
|
+
* ```
|
|
2439
|
+
*/
|
|
2440
|
+
search: (params: RecipeSearchParams, options?: RequestOptions) => Promise<RecipeSearchResult>;
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
//# sourceMappingURL=clinical.d.ts.map
|