@healthcloudai/hc-sdk 0.2.0 → 0.4.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type Environment = "dev" | "uat" | "prod";
2
- type ServiceName = "patient" | "vitals" | "diagnostics" | "provider" | "ehr" | "appointments" | "rppg" | "session" | "telehealth";
2
+ type ServiceName = "patient" | "vitals" | "diagnostics" | "provider" | "ehr" | "appointments" | "rppg" | "session" | "telehealth" | "fieldagent" | "mcp";
3
3
  interface HCSDKConfig {
4
4
  environment: Environment;
5
5
  tenantId?: string;
@@ -10,18 +10,44 @@ interface SDKRuntimeState {
10
10
  tenantId?: string;
11
11
  accessToken?: string;
12
12
  }
13
+ /**
14
+ * Every HealthCloud service publishes an identical `GET /connect` shape —
15
+ * confirmed across patient/vitals/diagnostics/provider/ehr/appointments/
16
+ * rppg/session/telehealth. `environment` is only present on patient/vitals/
17
+ * diagnostics responses (the stub services omit it).
18
+ */
19
+ interface ConnectResponse {
20
+ status: "connected";
21
+ service: string;
22
+ environment?: Environment;
23
+ }
13
24
  declare function isServiceName(value: string): value is ServiceName;
14
25
  declare function resolveBaseUrl(environment: Environment, service: ServiceName): string;
15
26
  declare function assertEnvironment(environment: Environment): void;
27
+ /**
28
+ * Always enforces the SDK-configured tenant on auth request bodies — never
29
+ * lets a caller-supplied `tenant_id` override it (prevents cross-tenant
30
+ * register/login/verify calls). Shared by AuthClient (patient host) and
31
+ * FieldAgentClient (field agent host).
32
+ */
33
+ declare function withTenantId<TRequest extends {
34
+ tenant_id?: string;
35
+ }>(request: TRequest, tenantId: string | undefined): TRequest;
16
36
 
17
37
  type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
18
38
  type QueryParamPrimitive = string | number | boolean | null | undefined;
19
39
  type QueryParamValue = QueryParamPrimitive | QueryParamPrimitive[];
20
40
  type QueryParams = Record<string, QueryParamValue>;
41
+ type JsonPrimitive = string | number | boolean | null;
42
+ type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
43
+ interface JsonObject {
44
+ [key: string]: JsonValue;
45
+ }
46
+ type HttpRequestBody = JsonPrimitive | object | FormData | Blob | ArrayBuffer | URLSearchParams;
21
47
  interface HttpRequestOptions {
22
48
  pathParams?: Record<string, string | number>;
23
49
  query?: QueryParams;
24
- body?: unknown;
50
+ body?: HttpRequestBody;
25
51
  headers?: Record<string, string>;
26
52
  auth?: boolean;
27
53
  }
@@ -50,10 +76,12 @@ declare abstract class BaseServiceClient {
50
76
  constructor(http: HttpClient, service: ServiceName);
51
77
  /**
52
78
  * Low-level escape hatch — allows consumers to call any path on this service
53
- * without waiting for a typed SDK method to be added.
79
+ * without waiting for a typed SDK method to be added. The response shape is
80
+ * intentionally generic since this targets undocumented/future paths; the
81
+ * caller must supply `TResponse` once the path's contract is known.
54
82
  */
55
- request<TResponse = unknown>(method: HttpMethod, path: string, options?: HttpRequestOptions): Promise<TResponse>;
56
- protected connectService<TResponse = unknown>(): Promise<TResponse>;
83
+ request<TResponse = JsonValue | undefined>(method: HttpMethod, path: string, options?: HttpRequestOptions): Promise<TResponse>;
84
+ protected connectService<TResponse = ConnectResponse>(): Promise<TResponse>;
57
85
  protected send<TResponse>(method: HttpMethod, path: string, options?: HttpRequestOptions): Promise<TResponse>;
58
86
  }
59
87
 
@@ -70,292 +98,777 @@ declare abstract class BaseServiceClient {
70
98
  */
71
99
  declare class AppointmentsClient extends BaseServiceClient {
72
100
  constructor(http: HttpClient);
73
- connect<TResponse = unknown>(): Promise<TResponse>;
101
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
74
102
  }
75
103
 
76
- type JsonPrimitive = string | number | boolean | null;
77
- type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
78
- interface JsonObject {
79
- [key: string]: JsonValue;
104
+ interface ClassifyRequest {
105
+ text: string;
80
106
  }
81
- type UnknownRecord = Record<string, unknown>;
82
- type SDKResponse<T = unknown> = T;
83
-
84
- interface ClassifyOption extends UnknownRecord {
85
- code?: string;
86
- label?: string;
87
- examples?: string[];
88
- }
89
- interface ClassifyRequest extends UnknownRecord {
90
- text?: string;
91
- options?: ClassifyOption[];
92
- }
93
- interface ClassifyResponse extends UnknownRecord {
94
- Action?: string;
95
- }
96
- interface OcrRequest extends UnknownRecord {
97
- image?: string;
98
- }
99
- interface OcrFields extends UnknownRecord {
100
- name?: string;
101
- documentType?: string;
102
- documentNumber?: string;
103
- dateOfBirth?: string;
104
- sex?: "M" | "F" | "X" | "";
105
- nationality?: string;
107
+ interface ClassifyResponse {
108
+ Action: string;
106
109
  }
107
- interface OcrResponse extends UnknownRecord {
108
- type?: "ocr_result" | "ocr_error";
109
- ok?: boolean;
110
- fields?: OcrFields;
111
- error?: string;
110
+ interface OcrRequest {
111
+ image: string;
112
112
  }
113
- interface ChatRequest extends UnknownRecord {
114
- message?: string;
113
+ type OcrFields = Record<string, string>;
114
+ interface OcrResultResponse {
115
+ type: "ocr_result";
116
+ ok: true;
117
+ fields: OcrFields;
115
118
  }
116
- interface ChatCitation extends UnknownRecord {
117
- id?: string;
118
- title?: string;
119
- collection?: string;
119
+ interface OcrErrorResponse {
120
+ type: "ocr_error";
121
+ ok: false;
122
+ error: string;
123
+ }
124
+ type OcrResponse = OcrResultResponse | OcrErrorResponse;
125
+ interface ChatRequest {
126
+ message: string;
127
+ }
128
+ interface ChatCitation {
129
+ id: string;
130
+ title: string;
131
+ collection: string;
120
132
  }
121
- interface ChatSuggestedAction extends UnknownRecord {
122
- id?: string;
123
- label?: string;
133
+ interface ChatSuggestedAction {
134
+ id: string;
135
+ label: string;
124
136
  }
125
- interface ChatResponse extends UnknownRecord {
126
- answer?: string;
127
- citations?: ChatCitation[];
128
- suggestedActions?: ChatSuggestedAction[];
129
- disclaimer?: string;
130
- error?: "message is required" | "assistant_not_configured" | "assistant_call_failed" | string;
137
+ interface ChatResponse {
138
+ answer: string;
139
+ citations: ChatCitation[];
140
+ suggestedActions: ChatSuggestedAction[];
141
+ disclaimer: string;
131
142
  }
132
143
  type KnowledgeCollection = "screening" | "ppe" | "sample_collection" | "field_ops";
133
144
  interface ListKnowledgeQuery extends QueryParams {
134
145
  collection?: KnowledgeCollection;
135
146
  }
136
- interface KnowledgeCollectionSummary extends UnknownRecord {
137
- id?: string;
138
- name?: string;
147
+ interface KnowledgeCollectionSummary {
148
+ id: string;
149
+ name: string;
139
150
  }
140
- interface KnowledgeEntrySummary extends UnknownRecord {
141
- id?: string;
142
- collection?: string;
143
- title?: string;
144
- tags?: string[];
151
+ interface KnowledgeEntrySummary {
152
+ id: string;
153
+ collection: string;
154
+ title: string;
155
+ tags: string[];
145
156
  }
146
- interface ListKnowledgeResponse extends UnknownRecord {
147
- collections?: KnowledgeCollectionSummary[];
148
- entries?: KnowledgeEntrySummary[];
149
- total?: number;
157
+ interface ListKnowledgeResponse {
158
+ collections: KnowledgeCollectionSummary[];
159
+ entries: KnowledgeEntrySummary[];
160
+ total: number;
150
161
  }
151
162
  interface SearchKnowledgeQuery extends QueryParams {
152
- q?: string;
163
+ q: string;
153
164
  collection?: KnowledgeCollection;
154
165
  limit?: number;
155
166
  }
156
- interface KnowledgeSearchResult extends UnknownRecord {
157
- id?: string;
158
- collection?: string;
159
- title?: string;
160
- body?: string;
161
- tags?: string[];
167
+ interface KnowledgeSearchResult {
168
+ id: string;
169
+ collection: string;
170
+ title: string;
171
+ body: string;
172
+ tags: string[];
162
173
  }
163
- interface SearchKnowledgeResponse extends UnknownRecord {
164
- query?: string;
165
- results?: KnowledgeSearchResult[];
166
- total?: number;
174
+ interface SearchKnowledgeResponse {
175
+ query: string;
176
+ results: KnowledgeSearchResult[];
177
+ total: number;
167
178
  }
168
- interface AssistantAction extends UnknownRecord {
169
- id?: string;
170
- label?: string;
179
+ interface AssistantAction {
180
+ id: string;
181
+ label: string;
171
182
  }
172
- interface ListAssistantActionsResponse extends UnknownRecord {
173
- actions?: AssistantAction[];
174
- total?: number;
183
+ interface ListAssistantActionsResponse {
184
+ actions: AssistantAction[];
185
+ total: number;
175
186
  }
176
187
 
177
- interface RegisterPatientRequest extends UnknownRecord {
178
- email?: string;
179
- password?: string;
188
+ type SexAtBirth = "male" | "female" | "unknown";
189
+ interface RegisterPatientRequest {
180
190
  tenant_id?: string;
181
- first_name?: string;
182
- last_name?: string;
183
- date_of_birth?: string;
184
- sex_at_birth?: "male" | "female" | "unknown";
185
- }
186
- interface LoginRequest extends UnknownRecord {
187
- email?: string;
188
- password?: string;
191
+ first_name: string;
192
+ last_name: string;
193
+ email: string;
194
+ password: string;
195
+ date_of_birth: string;
196
+ sex_at_birth: SexAtBirth;
197
+ created_by?: string;
198
+ }
199
+ interface RegisterPatientResponse {
200
+ cognito_sub: string;
201
+ fhir_patient_id: string;
202
+ email_otp_sent: boolean;
203
+ email_verified: boolean;
204
+ access_token: string;
205
+ id_token: string;
206
+ expires_in: number;
207
+ }
208
+ interface LoginRequest {
209
+ email: string;
210
+ password: string;
189
211
  tenant_id?: string;
190
212
  }
191
- interface VerifyEmailRequest extends UnknownRecord {
192
- user_id?: string;
213
+ interface LoginResponse {
214
+ access_token: string;
215
+ id_token: string;
216
+ expires_in: number;
217
+ }
218
+ interface VerifyEmailRequest {
219
+ user_id: string;
220
+ otp: string;
193
221
  tenant_id?: string;
194
- otp?: string;
195
- }
196
- interface AuthResponse extends UnknownRecord {
197
- cognito_sub?: string;
198
- fhir_patient_id?: string;
199
- email_otp_sent?: boolean;
200
- email_verified?: boolean;
201
- token?: string;
202
- access_token?: string;
203
- accessToken?: string;
204
- id_token?: string;
205
- expires_in?: number;
222
+ }
223
+ interface VerifiedResponse {
224
+ verified: boolean;
206
225
  }
207
226
 
208
227
  type PresenceState = "online" | "away" | "offline" | "in_call" | "do_not_disturb";
209
- interface PresenceRecord extends UnknownRecord {
210
- id?: string;
211
- contactId?: string;
212
- presence?: PresenceState;
228
+ interface PresenceRecord {
229
+ id: string;
230
+ contactId: string;
231
+ presence: PresenceState;
232
+ lastActiveAt: string;
233
+ }
234
+ interface UpsertPresenceRequest {
235
+ contactId: string;
236
+ presence: PresenceState;
213
237
  lastActiveAt?: string;
214
238
  }
215
- interface UpsertPresenceRequest extends UnknownRecord {
216
- contactId?: string;
217
- presence?: PresenceState;
218
- lastActiveAt?: string;
219
- }
220
- interface ListPresenceResponse extends UnknownRecord {
221
- presence?: PresenceRecord[];
222
- total?: number;
239
+ interface ListPresenceResponse {
240
+ presence: PresenceRecord[];
241
+ total: number;
223
242
  }
224
243
  type GroupKind = "team" | "case" | "broadcast";
225
- interface GroupRecord extends UnknownRecord {
226
- id?: string;
227
- name?: string;
228
- groupKind?: GroupKind;
244
+ interface GroupRecord {
245
+ id: string;
246
+ name: string;
247
+ groupKind: GroupKind;
229
248
  description?: string;
230
- memberIds?: string[];
249
+ memberIds: string[];
231
250
  createdBy?: string;
232
251
  callEnabled?: boolean;
233
- createdAt?: string;
234
- updatedAt?: string;
252
+ createdAt: string;
253
+ updatedAt: string;
235
254
  }
236
- interface UpsertGroupRequest extends UnknownRecord {
237
- id?: string;
238
- name?: string;
239
- groupKind?: GroupKind;
255
+ interface UpsertGroupRequest {
256
+ id: string;
257
+ name: string;
258
+ groupKind: GroupKind;
240
259
  description?: string;
241
- memberIds?: string[];
260
+ memberIds: string[];
242
261
  createdBy?: string;
243
262
  callEnabled?: boolean;
244
263
  }
245
- interface ListGroupsResponse extends UnknownRecord {
246
- groups?: GroupRecord[];
247
- total?: number;
264
+ interface ListGroupsResponse {
265
+ groups: GroupRecord[];
266
+ total: number;
248
267
  }
249
268
  type ConversationKind = "direct" | "group";
250
- interface ConversationRecord extends UnknownRecord {
251
- id?: string;
252
- kind?: ConversationKind;
269
+ interface ConversationRecord {
270
+ id: string;
271
+ kind: ConversationKind;
253
272
  participantIds?: string[];
254
273
  groupId?: string;
255
274
  title?: string;
256
275
  lastMessagePreview?: string;
257
276
  unreadCount?: number;
258
- createdAt?: string;
259
- updatedAt?: string;
277
+ createdAt: string;
278
+ updatedAt: string;
260
279
  }
261
- interface UpsertConversationRequest extends UnknownRecord {
262
- id?: string;
263
- kind?: ConversationKind;
280
+ interface UpsertConversationRequest {
281
+ id: string;
282
+ kind: ConversationKind;
264
283
  participantIds?: string[];
265
284
  groupId?: string;
266
285
  title?: string;
267
286
  lastMessagePreview?: string;
268
287
  unreadCount?: number;
269
288
  }
270
- interface ListConversationsResponse extends UnknownRecord {
271
- conversations?: ConversationRecord[];
272
- total?: number;
289
+ interface ListConversationsResponse {
290
+ conversations: ConversationRecord[];
291
+ total: number;
273
292
  }
274
293
  type MessageKind = "text" | "system" | "voice_note" | "lab";
275
- interface MessageRecord extends UnknownRecord {
276
- id?: string;
277
- conversationId?: string;
278
- senderId?: string;
279
- kind?: MessageKind;
280
- body?: string;
281
- status?: "sent";
282
- createdAt?: string;
283
- }
284
- interface UpsertMessageRequest extends UnknownRecord {
285
- id?: string;
286
- conversationId?: string;
287
- senderId?: string;
288
- kind?: MessageKind;
289
- body?: string;
290
- status?: string;
294
+ interface MessageRecord {
295
+ id: string;
296
+ conversationId: string;
297
+ senderId: string;
298
+ kind: MessageKind;
299
+ body: string;
300
+ status: "sent";
301
+ createdAt: string;
302
+ }
303
+ interface UpsertMessageRequest {
304
+ id: string;
305
+ conversationId: string;
306
+ senderId: string;
307
+ kind: MessageKind;
308
+ body: string;
291
309
  }
292
310
  interface ListMessagesQuery extends QueryParams {
293
311
  conversationId?: string;
294
312
  }
295
- interface ListMessagesResponse extends UnknownRecord {
296
- messages?: MessageRecord[];
297
- total?: number;
313
+ interface ListMessagesResponse {
314
+ messages: MessageRecord[];
315
+ total: number;
298
316
  }
299
317
  type InviteChannel = "sms" | "email" | "link";
300
318
  type InviteStatus = "draft" | "queued" | "sent" | "accepted" | "expired";
301
- interface InviteRecord extends UnknownRecord {
302
- id?: string;
303
- name?: string;
304
- destination?: string;
305
- channel?: InviteChannel;
319
+ interface InviteRecord {
320
+ id: string;
321
+ name: string;
322
+ destination: string;
323
+ channel: InviteChannel;
306
324
  role?: string;
307
- status?: InviteStatus;
308
- inviteCode?: string;
309
- createdAt?: string;
310
- }
311
- interface UpsertInviteRequest extends UnknownRecord {
312
- id?: string;
313
- name?: string;
314
- destination?: string;
315
- channel?: InviteChannel;
325
+ status: InviteStatus;
326
+ inviteCode: string;
327
+ createdAt: string;
328
+ }
329
+ interface UpsertInviteRequest {
330
+ id: string;
331
+ name: string;
332
+ destination: string;
333
+ channel: InviteChannel;
316
334
  role?: string;
317
- status?: InviteStatus;
318
- }
319
- interface ListInvitesResponse extends UnknownRecord {
320
- invites?: InviteRecord[];
321
- total?: number;
322
- }
323
- interface CommunicationsStateResponse extends UnknownRecord {
324
- presence?: PresenceRecord[];
325
- groups?: GroupRecord[];
326
- conversations?: ConversationRecord[];
327
- messages?: MessageRecord[];
328
- invites?: InviteRecord[];
329
- }
330
- interface RtcTokenRequest extends UnknownRecord {
331
- channelName?: string;
332
- uid?: string;
335
+ }
336
+ interface ListInvitesResponse {
337
+ invites: InviteRecord[];
338
+ total: number;
339
+ }
340
+ interface CommunicationsStateResponse {
341
+ presence: PresenceRecord[];
342
+ groups: GroupRecord[];
343
+ conversations: ConversationRecord[];
344
+ messages: MessageRecord[];
345
+ invites: InviteRecord[];
346
+ }
347
+ interface RtcTokenRequest {
348
+ channelName: string;
349
+ uid: string;
333
350
  role?: "publisher" | "subscriber";
334
351
  }
335
- interface RtcTokenResponse extends UnknownRecord {
336
- appId?: string;
337
- channelName?: string;
338
- uid?: string;
339
- rtcToken?: string;
340
- role?: string;
341
- ttlSeconds?: number;
342
- expiresAt?: string;
343
- error?: string;
344
- configured?: boolean;
352
+ interface RtcTokenSuccessResponse {
353
+ appId: string;
354
+ channelName: string;
355
+ uid: string;
356
+ rtcToken: string;
357
+ role: string;
358
+ ttlSeconds: number;
359
+ expiresAt: string;
360
+ }
361
+ interface RtcTokenUnavailableResponse {
362
+ error: string;
363
+ configured: false;
345
364
  }
365
+ type RtcTokenResponse = RtcTokenSuccessResponse | RtcTokenUnavailableResponse;
346
366
 
347
- interface DiagnosticsResponse extends UnknownRecord {
367
+ type RapidTestType = "covid19" | "influenza_a" | "influenza_b" | "rsv" | "strep" | "hiv" | "pregnancy" | "mono" | "uti_dipstick" | "blood_glucose" | "other";
368
+ type RapidTestResult = "positive" | "negative" | "invalid" | "inconclusive" | "not_detected" | "detected";
369
+ interface RapidTestRequest {
370
+ type: RapidTestType;
371
+ result: RapidTestResult;
372
+ encounter_id?: string;
373
+ }
374
+ interface RapidTestResponse {
375
+ test_id: string;
376
+ fhir_id: string;
377
+ type: RapidTestType;
378
+ result: RapidTestResult;
379
+ status: string;
380
+ specimen_type: string;
381
+ encounter_id: string;
382
+ }
383
+ interface DiagnosticObservation {
384
+ observation_id: string;
385
+ loinc_code: string;
386
+ display: string;
387
+ status: string;
388
+ }
389
+ interface ListDiagnosticsResponse {
390
+ observations: DiagnosticObservation[];
391
+ total: number;
392
+ }
393
+
394
+ interface VitalsRecordRequest {
395
+ temperature?: number;
396
+ weight_kg?: number;
397
+ height_cm?: number;
398
+ heart_rate?: number;
399
+ systolic?: number;
400
+ diastolic?: number;
401
+ oxygen_saturation?: number;
402
+ encounter_id?: string;
403
+ }
404
+ interface SubmitVitalsResponse {
405
+ observations: number;
406
+ patient_id: string;
348
407
  }
349
- interface RapidTestRequest extends UnknownRecord {
408
+ interface BloodPressureVital {
409
+ systolic: number;
410
+ diastolic: number;
411
+ }
412
+ interface HeartRateVital {
413
+ rate: number;
414
+ }
415
+ interface TemperatureVital {
416
+ value: number;
417
+ route?: string;
418
+ }
419
+ interface WeightVital {
420
+ value: number;
421
+ clothed?: boolean;
422
+ }
423
+ interface HeightVital {
424
+ value: number;
425
+ }
426
+ interface PulseOximetryVital {
427
+ spo2: number;
428
+ on_supplemental_oxygen?: boolean;
429
+ }
430
+ interface GetVitalsResponse {
431
+ vitals_id: string;
432
+ patient_id: string;
433
+ blood_pressure?: BloodPressureVital;
434
+ heart_rate?: HeartRateVital;
435
+ temperature?: TemperatureVital;
436
+ weight?: WeightVital;
437
+ height?: HeightVital;
438
+ pulse_oximetry?: PulseOximetryVital;
439
+ status: string;
440
+ }
441
+ interface ListVitalsQuery extends QueryParams {
442
+ type?: string;
443
+ }
444
+
445
+ interface PatientName {
446
+ use?: string;
447
+ first_name: string;
448
+ last_name: string;
449
+ }
450
+ interface CommunicationPreference {
451
+ language: string;
452
+ preferred: boolean;
453
+ }
454
+ interface PatientResponse {
455
+ patient_id: string;
456
+ fhir_id: string;
457
+ mrn: string;
458
+ name: PatientName;
459
+ date_of_birth: string;
460
+ gender: string;
461
+ sex_at_birth: string;
462
+ preferred_language: string;
463
+ communications: CommunicationPreference[];
464
+ email: string;
465
+ active: boolean;
466
+ created_by: string;
467
+ created_date: string;
468
+ }
469
+ interface PatientDashboardResponse {
470
+ patient_id: string;
471
+ summary: JsonObject;
472
+ recent_encounters: EncounterResponse[];
473
+ active_medications: MedicationResponse[];
474
+ upcoming_appointments: JsonValue[];
475
+ latest_vitals: GetVitalsResponse | null;
476
+ alerts: JsonValue[];
477
+ }
478
+ interface PatientPhoneUpdateRequest {
479
+ phone: string;
480
+ }
481
+ interface PhoneUpdateResponse {
482
+ sms_otp_sent: boolean;
483
+ }
484
+ interface PatientSmsVerificationRequest {
485
+ otp: string;
486
+ }
487
+ interface PatientAddressUpdateRequest {
488
+ street: string;
489
+ city: string;
490
+ state: string;
491
+ zip: string;
492
+ country?: string;
493
+ }
494
+ interface UpdatedResponse {
495
+ updated: boolean;
496
+ }
497
+ interface PatientRaceUpdateRequest {
498
+ races: string[];
499
+ }
500
+ interface PhotoUploadRequest {
501
+ data: string;
502
+ content_type: string;
503
+ }
504
+ interface PhotoUploadResponse {
505
+ binary_id: string;
506
+ }
507
+ interface GetPhotoQuery extends QueryParams {
508
+ binary_id: string;
509
+ }
510
+ interface GetPhotoResponse {
511
+ binary_id: string;
512
+ content_type: string;
513
+ data: string;
514
+ }
515
+ interface PhotoUploadUrlResponse {
516
+ url: string;
517
+ key: string;
518
+ }
519
+ interface FaceMatchRequest {
520
+ selfie_data: string;
521
+ reference_binary_id: string;
522
+ similarity_threshold?: number;
523
+ }
524
+ interface FaceMatchResponse {
525
+ match: boolean;
526
+ confidence: number;
527
+ similarity_threshold: number;
528
+ face_detected_in_selfie: boolean;
529
+ }
530
+ interface IdentityDocumentRequest {
531
+ document_data: string;
532
+ verify_against_demographics?: boolean;
533
+ }
534
+ interface IdentityDocumentResponse {
535
+ first_name: string;
536
+ last_name: string;
537
+ date_of_birth: string;
538
+ document_number: string;
539
+ verified: boolean;
540
+ }
541
+ type GenderIdentity = "man" | "woman" | "non_binary" | "transgender_man" | "transgender_woman" | "genderqueer" | "other" | "choose_not_to_disclose" | "unknown";
542
+ type Ethnicity = "hispanic_or_latino" | "not_hispanic_or_latino" | "unknown" | "declined_to_specify";
543
+ type MaritalStatus = "single" | "married" | "divorced" | "widowed" | "separated" | "domestic_partner";
544
+ interface DemographicsUpdateRequest {
545
+ date_of_birth?: string;
546
+ sex_at_birth?: "male" | "female" | "intersex" | "unknown";
547
+ gender_identity?: GenderIdentity;
548
+ ethnicity?: Ethnicity;
549
+ marital_status?: MaritalStatus;
550
+ nationality?: string;
551
+ preferred_language?: string;
552
+ communications?: CommunicationPreference[];
553
+ }
554
+ interface CreateInsuranceRequest {
555
+ payer_name: string;
556
+ member_id: string;
557
+ priority?: "primary" | "secondary" | "tertiary";
558
+ relationship?: string;
559
+ payer_id?: string;
560
+ }
561
+ interface CreateInsuranceResponse {
562
+ coverages_created: number;
563
+ patient_id: string;
564
+ }
565
+ type MedicationFrequency = "once" | "once_daily" | "twice_daily" | "three_times_daily" | "four_times_daily" | "every_4_hours" | "every_6_hours" | "every_8_hours" | "every_12_hours" | "every_48_hours" | "weekly" | "biweekly" | "monthly" | "as_needed" | "other";
566
+ type MedicationRoute = "oral" | "intravenous" | "intramuscular" | "subcutaneous" | "topical" | "inhaled" | "sublingual" | "intranasal" | "ophthalmic" | "otic" | "rectal" | "transdermal" | "other";
567
+ type MedicationStatus = "active" | "on-hold" | "completed" | "stopped" | "entered-in-error";
568
+ interface MedicationDosage {
569
+ value: number;
570
+ unit: string;
571
+ frequency: MedicationFrequency;
572
+ }
573
+ interface CreateMedicationRequest {
574
+ name: string;
575
+ route: MedicationRoute;
576
+ dosage: MedicationDosage;
577
+ status: MedicationStatus;
578
+ }
579
+ interface MedicationResponse {
580
+ medication_id: string;
581
+ fhir_id: string;
582
+ resource_type: "MedicationRequest" | "MedicationStatement";
583
+ name: string;
584
+ route: MedicationRoute;
585
+ dosage: MedicationDosage;
586
+ status: MedicationStatus;
587
+ intent: string;
588
+ }
589
+ interface ListMedicationsQuery extends QueryParams {
590
+ resource_type?: "MedicationRequest" | "MedicationStatement";
591
+ }
592
+ interface ListMedicationsResponse {
593
+ medications: MedicationResponse[];
594
+ total: number;
595
+ }
596
+ interface MedicationStatusUpdateRequest {
597
+ status: MedicationStatus;
598
+ notes?: string;
599
+ }
600
+ interface MedicationUpdateResponse {
601
+ updated: boolean;
602
+ fhir_id: string;
603
+ }
604
+ interface NearestLocationsQuery extends QueryParams {
605
+ lat: number;
606
+ lon: number;
607
+ radius_km?: number;
350
608
  type?: string;
351
- result?: string;
352
- lot_number?: string;
353
- administered_date?: string;
354
609
  }
355
- interface DiagnosticsListQuery extends QueryParams {
356
- from?: string;
357
- to?: string;
610
+ interface LocationCoordinates {
611
+ lat: number;
612
+ lng: number;
613
+ }
614
+ interface LocationGeometry {
615
+ location: LocationCoordinates;
616
+ }
617
+ interface NearestLocation {
618
+ place_id: string;
619
+ name: string;
620
+ vicinity: string;
621
+ types: string[];
622
+ geometry: LocationGeometry;
623
+ rating?: number;
624
+ open_now?: boolean;
625
+ phone?: string;
626
+ distance_km: number;
627
+ }
628
+ interface ListNearestLocationsResponse {
629
+ locations: NearestLocation[];
630
+ total: number;
631
+ radius_km: number;
632
+ source: "hardcoded" | "google_places";
633
+ note?: string;
634
+ }
635
+ type EncounterStatus = string;
636
+ interface CreateEncounterRequest {
637
+ patient_id: string;
638
+ status: EncounterStatus;
639
+ encounter_class: string;
640
+ }
641
+ interface EncounterResponse {
642
+ encounter_id: string;
643
+ fhir_id: string;
644
+ status: EncounterStatus;
645
+ encounter_class: string;
646
+ patient_id: string;
647
+ participants: JsonValue[];
648
+ diagnoses: JsonValue[];
649
+ locations: JsonValue[];
650
+ created_by: string;
651
+ created_date: string;
652
+ }
653
+ interface ListEncountersQuery extends QueryParams {
654
+ patient_id?: string;
655
+ status?: EncounterStatus;
656
+ date_start?: string;
657
+ date_end?: string;
658
+ }
659
+ interface ListEncountersResponse {
660
+ encounters: EncounterResponse[];
661
+ total: number;
662
+ }
663
+ type QuestionnaireItemType = string;
664
+ interface QuestionnaireItem {
665
+ link_id: string;
666
+ text: string;
667
+ type: QuestionnaireItemType;
668
+ }
669
+ interface CreateQuestionnaireRequest {
670
+ name: string;
671
+ title: string;
672
+ status: string;
673
+ items: QuestionnaireItem[];
674
+ }
675
+ interface FhirIdResponse {
676
+ fhir_id: string;
677
+ }
678
+ interface QuestionnaireResponseAnswer {
679
+ value_boolean?: boolean;
680
+ value_string?: string;
681
+ value_integer?: number;
682
+ }
683
+ interface QuestionnaireResponseItem {
684
+ link_id: string;
685
+ answers: QuestionnaireResponseAnswer[];
686
+ }
687
+ interface CreateQuestionnaireResponseRequest {
688
+ patient_id: string;
689
+ encounter_id?: string;
690
+ status: string;
691
+ items: QuestionnaireResponseItem[];
358
692
  }
693
+ interface InsuranceEligibilityRequest {
694
+ payer_id: string;
695
+ member_id: string;
696
+ first_name: string;
697
+ last_name: string;
698
+ date_of_birth: string;
699
+ }
700
+ type InsuranceEligibilityResponse = JsonValue;
701
+
702
+ interface RegisterFieldAgentRequest {
703
+ tenant_id?: string;
704
+ first_name: string;
705
+ last_name: string;
706
+ email: string;
707
+ password: string;
708
+ badge_number?: string;
709
+ department?: string;
710
+ }
711
+ interface RegisterFieldAgentResponse {
712
+ cognito_sub: string;
713
+ email_otp_sent: boolean;
714
+ email_verified: boolean;
715
+ access_token: string;
716
+ id_token: string;
717
+ expires_in: number;
718
+ }
719
+ interface ResetFieldAgentPasswordRequest {
720
+ email: string;
721
+ tenant_id?: string;
722
+ }
723
+ interface ResetPasswordResponse {
724
+ reset_initiated: boolean;
725
+ message: string;
726
+ }
727
+ interface FieldAgentLoginRequest {
728
+ email: string;
729
+ password: string;
730
+ tenant_id?: string;
731
+ }
732
+ interface VerifyFieldAgentSmsRequest {
733
+ user_id: string;
734
+ otp: string;
735
+ tenant_id?: string;
736
+ }
737
+ interface FieldAgentResponse {
738
+ agent_id: string;
739
+ fhir_person_id: string;
740
+ cognito_sub: string;
741
+ tenant_id: string;
742
+ email: string;
743
+ first_name: string;
744
+ last_name: string;
745
+ title: string | null;
746
+ phone: string | null;
747
+ badge_number: string | null;
748
+ license_number: string | null;
749
+ department: string | null;
750
+ organization: string | null;
751
+ address_street1: string | null;
752
+ address_state: string | null;
753
+ status: string;
754
+ }
755
+ interface UpdateFieldAgentRequest {
756
+ first_name?: string;
757
+ last_name?: string;
758
+ title?: string;
759
+ phone?: string;
760
+ address_street1?: string;
761
+ address_street2?: string;
762
+ address_city?: string;
763
+ address_state?: string;
764
+ address_zip?: string;
765
+ address_country?: string;
766
+ organization?: string;
767
+ department?: string;
768
+ badge_number?: string;
769
+ license_number?: string;
770
+ }
771
+ interface FieldAgentDashboardCounts {
772
+ patients: number;
773
+ tests: number;
774
+ test_results: number;
775
+ }
776
+ interface GetFieldAgentDashboardQuery extends QueryParams {
777
+ date?: string;
778
+ }
779
+ interface FieldAgentDashboardResponse {
780
+ agent_id: string;
781
+ date: string;
782
+ counts: FieldAgentDashboardCounts;
783
+ assigned_patients: JsonValue[];
784
+ recent_encounters: JsonValue[];
785
+ pending_tasks: JsonValue[];
786
+ alerts: JsonValue[];
787
+ summary: FieldAgentDashboardCounts;
788
+ }
789
+ interface ListAgentPatientsQuery extends QueryParams {
790
+ created_by?: string;
791
+ limit?: number;
792
+ family?: string;
793
+ given?: string;
794
+ page_token?: string;
795
+ }
796
+ interface AgentPatientSummary {
797
+ patient_id: string;
798
+ fhir_id: string;
799
+ mrn: string;
800
+ name: PatientName;
801
+ created_by: string;
802
+ }
803
+ interface ListAgentPatientsResponse {
804
+ patients: AgentPatientSummary[];
805
+ total: number;
806
+ next_page_token: string | null;
807
+ created_by: string;
808
+ }
809
+ interface ListAgentEncountersQuery extends QueryParams {
810
+ limit?: number;
811
+ patient_id?: string;
812
+ status?: string;
813
+ created_by?: string;
814
+ }
815
+ interface AgentEncounterSummary {
816
+ fhir_id: string;
817
+ patient_id: string;
818
+ status: string;
819
+ encounter_class: string;
820
+ }
821
+ interface ListAgentEncountersResponse {
822
+ encounters: AgentEncounterSummary[];
823
+ total: number;
824
+ }
825
+
826
+ type JsonRpcId = number | string;
827
+ interface JsonRpcRequest<TParams = JsonValue> {
828
+ jsonrpc: "2.0";
829
+ id: JsonRpcId;
830
+ method: string;
831
+ params: TParams;
832
+ }
833
+ interface JsonRpcSuccess<TResult = JsonValue> {
834
+ jsonrpc: "2.0";
835
+ id: JsonRpcId;
836
+ result: TResult;
837
+ }
838
+ interface McpServerInfo {
839
+ name: string;
840
+ version: string;
841
+ }
842
+ interface McpInitializeResult {
843
+ protocolVersion: string;
844
+ serverInfo: McpServerInfo;
845
+ }
846
+ type McpListToolsResult = JsonValue;
847
+ interface McpToolCallParams {
848
+ name: string;
849
+ arguments: Record<string, JsonValue>;
850
+ }
851
+ interface McpContentBlock {
852
+ type: "text";
853
+ text: string;
854
+ }
855
+ interface McpToolCallResult {
856
+ content: McpContentBlock[];
857
+ isError: boolean;
858
+ }
859
+ /**
860
+ * Patient API tools exposed via `POST /patient` (confirmed by the curl
861
+ * reference's tool catalog, not individually schema'd):
862
+ * get_patient, get_patient_dashboard, update_demographics, update_address,
863
+ * list_encounters, create_encounter, get_encounter, list_medications,
864
+ * create_medication, add_insurance, check_insurance_eligibility,
865
+ * find_nearest_locations, ask_assistant, classify_voice_command.
866
+ */
867
+ type McpPatientToolName = "get_patient" | "get_patient_dashboard" | "update_demographics" | "update_address" | "list_encounters" | "create_encounter" | "get_encounter" | "list_medications" | "create_medication" | "add_insurance" | "check_insurance_eligibility" | "find_nearest_locations" | "ask_assistant" | "classify_voice_command";
868
+ /**
869
+ * Field Agent API tools exposed via `POST /fieldagent`.
870
+ */
871
+ type McpFieldAgentToolName = "get_agent" | "get_agent_dashboard" | "update_agent" | "list_patients" | "list_encounters" | "get_agent_photo_upload_url" | "upload_agent_photo" | "get_agent_photo";
359
872
 
360
873
  /**
361
874
  * Machine-readable operation registry.
@@ -744,174 +1257,35 @@ declare const HCSDK_SWAGGER_OPERATION_COUNTS: {
744
1257
  readonly telehealth: 1;
745
1258
  };
746
1259
 
747
- interface PatientResponse extends UnknownRecord {
748
- }
749
- interface PatientPhoneUpdateRequest extends UnknownRecord {
750
- phone?: string;
751
- }
752
- interface PatientSmsVerificationRequest extends UnknownRecord {
753
- otp?: string;
754
- }
755
- interface PatientAddressUpdateRequest extends UnknownRecord {
756
- street?: string;
757
- city?: string;
758
- state?: string;
759
- zip?: string;
760
- }
761
- interface PatientRaceUpdateRequest extends UnknownRecord {
762
- races?: string[];
763
- }
764
- type PhotoUploadRequest = UnknownRecord | FormData | Blob | ArrayBuffer;
765
- interface GetPhotoQuery extends QueryParams {
766
- binary_id?: string;
767
- }
768
- interface FaceMatchRequest extends UnknownRecord {
769
- selfie_data?: string;
770
- reference_binary_id?: string;
771
- similarity_threshold?: number;
772
- }
773
- interface IdentityDocumentRequest extends UnknownRecord {
774
- document_data?: string;
775
- verify_against_demographics?: boolean;
776
- }
777
- interface CommunicationPreference extends UnknownRecord {
778
- language?: string;
779
- preferred?: boolean;
780
- }
781
- interface DemographicsUpdateRequest extends UnknownRecord {
782
- date_of_birth?: string;
783
- sex_at_birth?: "male" | "female" | "intersex" | "unknown";
784
- gender_identity?: "man" | "woman" | "non_binary" | "transgender_man" | "transgender_woman" | "genderqueer" | "other" | "choose_not_to_disclose" | "unknown";
785
- ethnicity?: "hispanic_or_latino" | "not_hispanic_or_latino" | "unknown" | "declined_to_specify";
786
- marital_status?: "single" | "married" | "divorced" | "widowed" | "separated" | "domestic_partner";
787
- nationality?: string;
788
- preferred_language?: string;
789
- communications?: CommunicationPreference[];
790
- }
791
- interface CreateInsuranceRequest extends UnknownRecord {
792
- priority?: "primary" | "secondary" | "tertiary";
793
- payer_name?: string;
794
- member_id?: string;
795
- relationship?: string;
796
- }
797
- interface MedicationDosage extends UnknownRecord {
798
- value?: number;
799
- unit?: string;
800
- frequency?: "once" | "once_daily" | "twice_daily" | "three_times_daily" | "four_times_daily" | "every_4_hours" | "every_6_hours" | "every_8_hours" | "every_12_hours" | "every_48_hours" | "weekly" | "biweekly" | "monthly" | "as_needed" | "other";
801
- instructions?: string;
802
- }
803
- interface CreateMedicationRequest extends UnknownRecord {
804
- name?: string;
805
- rxnorm_code?: string;
806
- route?: "oral" | "intravenous" | "intramuscular" | "subcutaneous" | "topical" | "inhaled" | "sublingual" | "intranasal" | "ophthalmic" | "otic" | "rectal" | "transdermal" | "other";
807
- dosage?: MedicationDosage;
808
- status?: "active" | "on-hold" | "completed" | "stopped" | "entered-in-error";
809
- intent?: string;
810
- indication?: string;
811
- prescriber_name?: string;
812
- refills_authorized?: number;
813
- start_date?: string;
814
- end_date?: string;
815
- notes?: string;
816
- }
817
- interface MedicationStatusUpdateRequest extends UnknownRecord {
818
- status?: "active" | "on-hold" | "completed" | "stopped" | "entered-in-error";
819
- discontinued_reason?: string;
820
- notes?: string;
821
- }
822
- interface NearestLocationsQuery extends QueryParams {
823
- lat?: number;
824
- lon?: number;
825
- radius_km?: number;
826
- type?: string;
827
- }
828
- interface CreateEncounterRequest extends UnknownRecord {
829
- patient_id?: string;
830
- reason?: string;
831
- encounter_type?: string;
832
- }
833
- interface ListEncountersQuery extends QueryParams {
834
- patient_id?: string;
835
- }
836
- interface QuestionnaireItem extends UnknownRecord {
837
- link_id?: string;
838
- text?: string;
839
- type?: string;
840
- }
841
- interface CreateQuestionnaireRequest extends UnknownRecord {
842
- name?: string;
843
- title?: string;
844
- items?: QuestionnaireItem[];
845
- }
846
- interface QuestionnaireResponseAnswer extends UnknownRecord {
847
- value_integer?: number;
848
- value_string?: string;
849
- value_boolean?: boolean;
850
- }
851
- interface QuestionnaireResponseItem extends UnknownRecord {
852
- link_id?: string;
853
- answers?: QuestionnaireResponseAnswer[];
854
- }
855
- interface CreateQuestionnaireResponseRequest extends UnknownRecord {
856
- patient_id?: string;
857
- items?: QuestionnaireResponseItem[];
858
- }
859
- interface InsuranceEligibilityRequest extends UnknownRecord {
860
- payer_id?: string;
861
- member_id?: string;
862
- first_name?: string;
863
- last_name?: string;
864
- date_of_birth?: string;
865
- }
866
-
867
- interface FaceCompareRequest extends UnknownRecord {
868
- imageUrl1?: string;
869
- imageUrl2?: string;
870
- similarityThreshold?: number;
871
- }
872
- interface FaceCompareResponse extends UnknownRecord {
873
- samePerson?: boolean;
874
- confidence?: number;
1260
+ interface FaceCompareRequest {
1261
+ imageUrl1: string;
1262
+ imageUrl2: string;
875
1263
  similarityThreshold?: number;
876
- faceDetectedInImage1?: boolean;
877
- faceDetectedInImage2?: boolean;
878
- }
879
-
880
- interface VitalsResponse extends UnknownRecord {
881
1264
  }
882
- interface VitalsRecordRequest extends UnknownRecord {
883
- heart_rate?: number;
884
- temperature?: number;
885
- systolic?: number;
886
- diastolic?: number;
887
- oxygen_saturation?: number;
888
- weight_kg?: number;
889
- height_cm?: number;
890
- encounter_id?: string;
891
- }
892
- interface ListVitalsQuery extends QueryParams {
893
- from?: string;
894
- to?: string;
1265
+ interface FaceCompareResponse {
1266
+ samePerson: boolean;
1267
+ confidence: number;
1268
+ similarityThreshold: number;
1269
+ faceDetectedInImage1: boolean;
1270
+ faceDetectedInImage2: boolean;
895
1271
  }
896
1272
 
897
- type AccessTokenWriter = (token: string) => void;
898
- type TenantIdReader = () => string | undefined;
1273
+ type AccessTokenWriter$1 = (token: string) => void;
1274
+ type TenantIdReader$1 = () => string | undefined;
899
1275
  declare class AuthClient extends BaseServiceClient {
900
1276
  private readonly setAccessToken;
901
1277
  private readonly getTenantId;
902
- constructor(http: HttpClient, setAccessToken: AccessTokenWriter, getTenantId: TenantIdReader);
903
- register<TResponse = AuthResponse>(request: RegisterPatientRequest): Promise<TResponse>;
904
- login<TResponse = AuthResponse>(request: LoginRequest): Promise<TResponse>;
905
- verifyEmail<TResponse = AuthResponse>(request: VerifyEmailRequest): Promise<TResponse>;
906
- private withTenantId;
907
- private extractAccessToken;
1278
+ constructor(http: HttpClient, setAccessToken: AccessTokenWriter$1, getTenantId: TenantIdReader$1);
1279
+ register<TResponse = RegisterPatientResponse>(request: RegisterPatientRequest): Promise<TResponse>;
1280
+ login<TResponse extends LoginResponse = LoginResponse>(request: LoginRequest): Promise<TResponse>;
1281
+ verifyEmail<TResponse = VerifiedResponse>(request: VerifyEmailRequest): Promise<TResponse>;
908
1282
  }
909
1283
 
910
1284
  declare class DiagnosticsClient extends BaseServiceClient {
911
1285
  constructor(http: HttpClient);
912
- connect<TResponse = unknown>(): Promise<TResponse>;
913
- createRapidTest<TResponse = DiagnosticsResponse>(patientId: string, request: RapidTestRequest): Promise<TResponse>;
914
- list<TResponse = DiagnosticsResponse>(patientId: string, query?: DiagnosticsListQuery): Promise<TResponse>;
1286
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1287
+ createRapidTest<TResponse = RapidTestResponse>(patientId: string, request: RapidTestRequest): Promise<TResponse>;
1288
+ list<TResponse = ListDiagnosticsResponse>(patientId: string): Promise<TResponse>;
915
1289
  }
916
1290
 
917
1291
  /**
@@ -927,40 +1301,81 @@ declare class DiagnosticsClient extends BaseServiceClient {
927
1301
  */
928
1302
  declare class EhrClient extends BaseServiceClient {
929
1303
  constructor(http: HttpClient);
930
- connect<TResponse = unknown>(): Promise<TResponse>;
1304
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1305
+ }
1306
+
1307
+ type AccessTokenWriter = (token: string) => void;
1308
+ type TenantIdReader = () => string | undefined;
1309
+ declare class FieldAgentClient extends BaseServiceClient {
1310
+ private readonly setAccessToken;
1311
+ private readonly getTenantId;
1312
+ constructor(http: HttpClient, setAccessToken: AccessTokenWriter, getTenantId: TenantIdReader);
1313
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1314
+ register<TResponse = RegisterFieldAgentResponse>(request: RegisterFieldAgentRequest): Promise<TResponse>;
1315
+ resetPassword<TResponse = ResetPasswordResponse>(request: ResetFieldAgentPasswordRequest): Promise<TResponse>;
1316
+ login<TResponse extends LoginResponse = LoginResponse>(request: FieldAgentLoginRequest): Promise<TResponse>;
1317
+ verifyEmail<TResponse = VerifiedResponse>(request: VerifyEmailRequest): Promise<TResponse>;
1318
+ verifySms<TResponse = VerifiedResponse>(request: VerifyFieldAgentSmsRequest): Promise<TResponse>;
1319
+ getAgent<TResponse = FieldAgentResponse>(agentSub: string): Promise<TResponse>;
1320
+ updateAgent<TResponse = FieldAgentResponse>(agentSub: string, request: UpdateFieldAgentRequest): Promise<TResponse>;
1321
+ getDashboard<TResponse = FieldAgentDashboardResponse>(agentSub: string, query?: GetFieldAgentDashboardQuery): Promise<TResponse>;
1322
+ getPhotoUploadUrl<TResponse = PhotoUploadUrlResponse>(agentSub: string): Promise<TResponse>;
1323
+ uploadPhoto<TResponse = PhotoUploadResponse>(agentSub: string, request: PhotoUploadRequest): Promise<TResponse>;
1324
+ getPhoto<TResponse = GetPhotoResponse>(agentSub: string, query: GetPhotoQuery): Promise<TResponse>;
1325
+ listPatients<TResponse = ListAgentPatientsResponse>(query?: ListAgentPatientsQuery): Promise<TResponse>;
1326
+ listEncounters<TResponse = ListAgentEncountersResponse>(query?: ListAgentEncountersQuery): Promise<TResponse>;
1327
+ }
1328
+
1329
+ /**
1330
+ * MCPClient — JSON-RPC 2.0 proxy for the HC MCP API. Forwards to the Patient
1331
+ * or Field Agent API tool catalog using the caller's bearer token (the same
1332
+ * token already configured on this SDK instance via `setAccessToken`/login).
1333
+ *
1334
+ * The result type is generic per call (`initialize` → `McpInitializeResult`,
1335
+ * `tools/call` → `McpToolCallResult`, etc.) since a single JSON-RPC envelope
1336
+ * carries different result shapes per `method` — see `models/generated/mcp.ts`.
1337
+ */
1338
+ declare class MCPClient extends BaseServiceClient {
1339
+ constructor(http: HttpClient);
1340
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1341
+ /** Calls one of the 14 Patient API tools via `POST /patient`. */
1342
+ patient<TParams = JsonValue, TResult = JsonValue>(request: JsonRpcRequest<TParams>): Promise<JsonRpcSuccess<TResult>>;
1343
+ /** Calls one of the 8 Field Agent API tools via `POST /fieldagent`. */
1344
+ fieldAgent<TParams = JsonValue, TResult = JsonValue>(request: JsonRpcRequest<TParams>): Promise<JsonRpcSuccess<TResult>>;
931
1345
  }
932
1346
 
933
1347
  declare class PatientClient extends BaseServiceClient {
934
1348
  constructor(http: HttpClient);
935
- connect<TResponse = unknown>(): Promise<TResponse>;
936
- updatePhone<TResponse = PatientResponse>(patientId: string, request: PatientPhoneUpdateRequest): Promise<TResponse>;
937
- verifySms<TResponse = PatientResponse>(patientId: string, request: PatientSmsVerificationRequest): Promise<TResponse>;
938
- updateAddress<TResponse = PatientResponse>(patientId: string, request: PatientAddressUpdateRequest): Promise<TResponse>;
939
- updateRace<TResponse = PatientResponse>(patientId: string, request: PatientRaceUpdateRequest): Promise<TResponse>;
1349
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1350
+ updatePhone<TResponse = PhoneUpdateResponse>(patientId: string, request: PatientPhoneUpdateRequest): Promise<TResponse>;
1351
+ verifySms<TResponse = VerifiedResponse>(patientId: string, request: PatientSmsVerificationRequest): Promise<TResponse>;
1352
+ updateAddress<TResponse = UpdatedResponse>(patientId: string, request: PatientAddressUpdateRequest): Promise<TResponse>;
1353
+ updateRace<TResponse = UpdatedResponse>(patientId: string, request: PatientRaceUpdateRequest): Promise<TResponse>;
940
1354
  getProfile<TResponse = PatientResponse>(patientId: string): Promise<TResponse>;
941
- uploadPhoto<TResponse = PatientResponse>(patientId: string, request: PhotoUploadRequest): Promise<TResponse>;
942
- getPhoto<TResponse = PatientResponse>(patientId: string, query?: GetPhotoQuery): Promise<TResponse>;
943
- getPhotoUploadUrl<TResponse = PatientResponse>(patientId: string): Promise<TResponse>;
944
- compareFaceMatch<TResponse = PatientResponse>(patientId: string, request: FaceMatchRequest): Promise<TResponse>;
945
- scanIdentityDocument<TResponse = PatientResponse>(patientId: string, request: IdentityDocumentRequest): Promise<TResponse>;
946
- updateDemographics<TResponse = PatientResponse>(patientId: string, request: DemographicsUpdateRequest): Promise<TResponse>;
947
- createInsurance<TResponse = PatientResponse>(patientId: string, request: CreateInsuranceRequest): Promise<TResponse>;
948
- createMedication<TResponse = PatientResponse>(patientId: string, request: CreateMedicationRequest): Promise<TResponse>;
949
- listMedications<TResponse = PatientResponse>(patientId: string): Promise<TResponse>;
950
- getMedication<TResponse = PatientResponse>(patientId: string, medicationId: string): Promise<TResponse>;
951
- updateMedicationStatus<TResponse = PatientResponse>(patientId: string, medicationId: string, request: MedicationStatusUpdateRequest): Promise<TResponse>;
952
- listNearestLocations<TResponse = PatientResponse>(query?: NearestLocationsQuery): Promise<TResponse>;
953
- createEncounter<TResponse = PatientResponse>(request: CreateEncounterRequest): Promise<TResponse>;
954
- listEncounters<TResponse = PatientResponse>(query?: ListEncountersQuery): Promise<TResponse>;
955
- getEncounter<TResponse = PatientResponse>(encounterId: string): Promise<TResponse>;
956
- createQuestionnaire<TResponse = PatientResponse>(request: CreateQuestionnaireRequest): Promise<TResponse>;
957
- createQuestionnaireResponse<TResponse = PatientResponse>(questionnaireId: string, request: CreateQuestionnaireResponseRequest): Promise<TResponse>;
958
- checkInsuranceEligibility<TResponse = PatientResponse>(request: InsuranceEligibilityRequest): Promise<TResponse>;
1355
+ getDashboard<TResponse = PatientDashboardResponse>(patientId: string): Promise<TResponse>;
1356
+ uploadPhoto<TResponse = PhotoUploadResponse>(patientId: string, request: PhotoUploadRequest): Promise<TResponse>;
1357
+ getPhoto<TResponse = GetPhotoResponse>(patientId: string, query: GetPhotoQuery): Promise<TResponse>;
1358
+ getPhotoUploadUrl<TResponse = PhotoUploadUrlResponse>(patientId: string): Promise<TResponse>;
1359
+ compareFaceMatch<TResponse = FaceMatchResponse>(patientId: string, request: FaceMatchRequest): Promise<TResponse>;
1360
+ scanIdentityDocument<TResponse = IdentityDocumentResponse>(patientId: string, request: IdentityDocumentRequest): Promise<TResponse>;
1361
+ updateDemographics<TResponse = UpdatedResponse>(patientId: string, request: DemographicsUpdateRequest): Promise<TResponse>;
1362
+ createInsurance<TResponse = CreateInsuranceResponse>(patientId: string, request: CreateInsuranceRequest): Promise<TResponse>;
1363
+ createMedication<TResponse = MedicationResponse>(patientId: string, request: CreateMedicationRequest): Promise<TResponse>;
1364
+ listMedications<TResponse = ListMedicationsResponse>(patientId: string, query?: ListMedicationsQuery): Promise<TResponse>;
1365
+ getMedication<TResponse = MedicationResponse>(patientId: string, medicationId: string): Promise<TResponse>;
1366
+ updateMedicationStatus<TResponse = MedicationUpdateResponse>(patientId: string, medicationId: string, request: MedicationStatusUpdateRequest): Promise<TResponse>;
1367
+ listNearestLocations<TResponse = ListNearestLocationsResponse>(query: NearestLocationsQuery): Promise<TResponse>;
1368
+ createEncounter<TResponse = EncounterResponse>(request: CreateEncounterRequest): Promise<TResponse>;
1369
+ listEncounters<TResponse = ListEncountersResponse>(query?: ListEncountersQuery): Promise<TResponse>;
1370
+ getEncounter<TResponse = EncounterResponse>(encounterId: string): Promise<TResponse>;
1371
+ createQuestionnaire<TResponse = FhirIdResponse>(request: CreateQuestionnaireRequest): Promise<TResponse>;
1372
+ createQuestionnaireResponse<TResponse = FhirIdResponse>(questionnaireId: string, request: CreateQuestionnaireResponseRequest): Promise<TResponse>;
1373
+ checkInsuranceEligibility<TResponse = InsuranceEligibilityResponse>(request: InsuranceEligibilityRequest): Promise<TResponse>;
959
1374
  classifyVoiceCommand<TResponse = ClassifyResponse>(request: ClassifyRequest): Promise<TResponse>;
960
1375
  ocrIdentityDocument<TResponse = OcrResponse>(request: OcrRequest): Promise<TResponse>;
961
1376
  askAssistant<TResponse = ChatResponse>(request: ChatRequest): Promise<TResponse>;
962
1377
  listKnowledge<TResponse = ListKnowledgeResponse>(query?: ListKnowledgeQuery): Promise<TResponse>;
963
- searchKnowledge<TResponse = SearchKnowledgeResponse>(query?: SearchKnowledgeQuery): Promise<TResponse>;
1378
+ searchKnowledge<TResponse = SearchKnowledgeResponse>(query: SearchKnowledgeQuery): Promise<TResponse>;
964
1379
  listAssistantActions<TResponse = ListAssistantActionsResponse>(): Promise<TResponse>;
965
1380
  compareFacesByUrl<TResponse = FaceCompareResponse>(request: FaceCompareRequest): Promise<TResponse>;
966
1381
  getCommunicationsState<TResponse = CommunicationsStateResponse>(): Promise<TResponse>;
@@ -994,7 +1409,7 @@ declare class PatientClient extends BaseServiceClient {
994
1409
  */
995
1410
  declare class ProviderClient extends BaseServiceClient {
996
1411
  constructor(http: HttpClient);
997
- connect<TResponse = unknown>(): Promise<TResponse>;
1412
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
998
1413
  }
999
1414
 
1000
1415
  /**
@@ -1010,7 +1425,7 @@ declare class ProviderClient extends BaseServiceClient {
1010
1425
  */
1011
1426
  declare class RppgClient extends BaseServiceClient {
1012
1427
  constructor(http: HttpClient);
1013
- connect<TResponse = unknown>(): Promise<TResponse>;
1428
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1014
1429
  }
1015
1430
 
1016
1431
  /**
@@ -1026,7 +1441,7 @@ declare class RppgClient extends BaseServiceClient {
1026
1441
  */
1027
1442
  declare class SessionClient extends BaseServiceClient {
1028
1443
  constructor(http: HttpClient);
1029
- connect<TResponse = unknown>(): Promise<TResponse>;
1444
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1030
1445
  }
1031
1446
 
1032
1447
  /**
@@ -1042,14 +1457,14 @@ declare class SessionClient extends BaseServiceClient {
1042
1457
  */
1043
1458
  declare class TelehealthClient extends BaseServiceClient {
1044
1459
  constructor(http: HttpClient);
1045
- connect<TResponse = unknown>(): Promise<TResponse>;
1460
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1046
1461
  }
1047
1462
 
1048
1463
  declare class VitalsClient extends BaseServiceClient {
1049
1464
  constructor(http: HttpClient);
1050
- connect<TResponse = unknown>(): Promise<TResponse>;
1051
- record<TResponse = VitalsResponse>(patientId: string, request: VitalsRecordRequest): Promise<TResponse>;
1052
- list<TResponse = VitalsResponse>(patientId: string, query?: ListVitalsQuery): Promise<TResponse>;
1465
+ connect<TResponse = ConnectResponse>(): Promise<TResponse>;
1466
+ record<TResponse = SubmitVitalsResponse>(patientId: string, request: VitalsRecordRequest): Promise<TResponse>;
1467
+ list<TResponse = GetVitalsResponse>(patientId: string, query?: ListVitalsQuery): Promise<TResponse>;
1053
1468
  }
1054
1469
 
1055
1470
  declare class HCSDK {
@@ -1065,6 +1480,8 @@ declare class HCSDK {
1065
1480
  readonly rppg: RppgClient;
1066
1481
  readonly session: SessionClient;
1067
1482
  readonly telehealth: TelehealthClient;
1483
+ readonly fieldAgent: FieldAgentClient;
1484
+ readonly mcp: MCPClient;
1068
1485
  constructor(config: HCSDKConfig);
1069
1486
  setAccessToken(token: string): void;
1070
1487
  getAccessToken(): string | undefined;
@@ -1073,13 +1490,13 @@ declare class HCSDK {
1073
1490
  interface SDKErrorOptions {
1074
1491
  message: string;
1075
1492
  statusCode: number;
1076
- response?: unknown;
1493
+ response?: JsonValue;
1077
1494
  cause?: unknown;
1078
1495
  }
1079
1496
  declare class SDKError extends Error {
1080
1497
  readonly statusCode: number;
1081
- readonly response?: unknown;
1498
+ readonly response?: JsonValue;
1082
1499
  constructor(options: SDKErrorOptions);
1083
1500
  }
1084
1501
 
1085
- export { type AssistantAction, type AuthResponse, type ChatCitation, type ChatRequest, type ChatResponse, type ChatSuggestedAction, type ClassifyOption, type ClassifyRequest, type ClassifyResponse, type CommunicationPreference, type CommunicationsStateResponse, type ConversationKind, type ConversationRecord, type CreateEncounterRequest, type CreateInsuranceRequest, type CreateMedicationRequest, type CreateQuestionnaireRequest, type CreateQuestionnaireResponseRequest, type DemographicsUpdateRequest, type DiagnosticsListQuery, type DiagnosticsResponse, type Environment, type FaceCompareRequest, type FaceCompareResponse, type FaceMatchRequest, type GetPhotoQuery, type GroupKind, type GroupRecord, HCSDK, type HCSDKConfig, HCSDK_OPERATION_SUMMARY, HCSDK_SWAGGER_OPERATION_COUNTS, HCSDK_SWAGGER_PATH_COUNTS, HCSDK_TOTAL_OPERATION_COUNT, type HttpMethod, type HttpRequestOptions, type IdentityDocumentRequest, type InsuranceEligibilityRequest, type InviteChannel, type InviteRecord, type InviteStatus, type JsonObject, type JsonPrimitive, type JsonValue, type KnowledgeCollection, type KnowledgeCollectionSummary, type KnowledgeEntrySummary, type KnowledgeSearchResult, type ListAssistantActionsResponse, type ListConversationsResponse, type ListEncountersQuery, type ListGroupsResponse, type ListInvitesResponse, type ListKnowledgeQuery, type ListKnowledgeResponse, type ListMessagesQuery, type ListMessagesResponse, type ListPresenceResponse, type ListVitalsQuery, type LoginRequest, type MedicationDosage, type MedicationStatusUpdateRequest, type MessageKind, type MessageRecord, type NearestLocationsQuery, type OcrFields, type OcrRequest, type OcrResponse, type PatientAddressUpdateRequest, type PatientPhoneUpdateRequest, type PatientRaceUpdateRequest, type PatientResponse, type PatientSmsVerificationRequest, type PhotoUploadRequest, type PresenceRecord, type PresenceState, type PublicRequestOptions, type QueryParamPrimitive, type QueryParamValue, type QueryParams, type QuestionnaireItem, type QuestionnaireResponseAnswer, type QuestionnaireResponseItem, type RapidTestRequest, type RegisterPatientRequest, type RtcTokenRequest, type RtcTokenResponse, SDKError, type SDKResponse, type SDKRuntimeState, type SearchKnowledgeQuery, type SearchKnowledgeResponse, type ServiceName, type UnknownRecord, type UpsertConversationRequest, type UpsertGroupRequest, type UpsertInviteRequest, type UpsertMessageRequest, type UpsertPresenceRequest, type VerifyEmailRequest, type VitalsRecordRequest, type VitalsResponse, assertEnvironment, isServiceName, resolveBaseUrl };
1502
+ export { type AgentEncounterSummary, type AgentPatientSummary, type AssistantAction, type BloodPressureVital, type ChatCitation, type ChatRequest, type ChatResponse, type ChatSuggestedAction, type ClassifyRequest, type ClassifyResponse, type CommunicationPreference, type CommunicationsStateResponse, type ConnectResponse, type ConversationKind, type ConversationRecord, type CreateEncounterRequest, type CreateInsuranceRequest, type CreateInsuranceResponse, type CreateMedicationRequest, type CreateQuestionnaireRequest, type CreateQuestionnaireResponseRequest, type DemographicsUpdateRequest, type DiagnosticObservation, type EncounterResponse, type EncounterStatus, type Environment, type Ethnicity, type FaceCompareRequest, type FaceCompareResponse, type FaceMatchRequest, type FaceMatchResponse, type FhirIdResponse, type FieldAgentDashboardCounts, type FieldAgentDashboardResponse, type FieldAgentLoginRequest, type FieldAgentResponse, type GenderIdentity, type GetFieldAgentDashboardQuery, type GetPhotoQuery, type GetPhotoResponse, type GetVitalsResponse, type GroupKind, type GroupRecord, HCSDK, type HCSDKConfig, HCSDK_OPERATION_SUMMARY, HCSDK_SWAGGER_OPERATION_COUNTS, HCSDK_SWAGGER_PATH_COUNTS, HCSDK_TOTAL_OPERATION_COUNT, type HeartRateVital, type HeightVital, type HttpMethod, type HttpRequestBody, type HttpRequestOptions, type IdentityDocumentRequest, type IdentityDocumentResponse, type InsuranceEligibilityRequest, type InsuranceEligibilityResponse, type InviteChannel, type InviteRecord, type InviteStatus, type JsonObject, type JsonPrimitive, type JsonRpcId, type JsonRpcRequest, type JsonRpcSuccess, type JsonValue, type KnowledgeCollection, type KnowledgeCollectionSummary, type KnowledgeEntrySummary, type KnowledgeSearchResult, type ListAgentEncountersQuery, type ListAgentEncountersResponse, type ListAgentPatientsQuery, type ListAgentPatientsResponse, type ListAssistantActionsResponse, type ListConversationsResponse, type ListDiagnosticsResponse, type ListEncountersQuery, type ListEncountersResponse, type ListGroupsResponse, type ListInvitesResponse, type ListKnowledgeQuery, type ListKnowledgeResponse, type ListMedicationsQuery, type ListMedicationsResponse, type ListMessagesQuery, type ListMessagesResponse, type ListNearestLocationsResponse, type ListPresenceResponse, type ListVitalsQuery, type LocationCoordinates, type LocationGeometry, type LoginRequest, type LoginResponse, type MaritalStatus, type McpContentBlock, type McpFieldAgentToolName, type McpInitializeResult, type McpListToolsResult, type McpPatientToolName, type McpServerInfo, type McpToolCallParams, type McpToolCallResult, type MedicationDosage, type MedicationFrequency, type MedicationResponse, type MedicationRoute, type MedicationStatus, type MedicationStatusUpdateRequest, type MedicationUpdateResponse, type MessageKind, type MessageRecord, type NearestLocation, type NearestLocationsQuery, type OcrErrorResponse, type OcrFields, type OcrRequest, type OcrResponse, type OcrResultResponse, type PatientAddressUpdateRequest, type PatientDashboardResponse, type PatientName, type PatientPhoneUpdateRequest, type PatientRaceUpdateRequest, type PatientResponse, type PatientSmsVerificationRequest, type PhoneUpdateResponse, type PhotoUploadRequest, type PhotoUploadResponse, type PhotoUploadUrlResponse, type PresenceRecord, type PresenceState, type PublicRequestOptions, type PulseOximetryVital, type QueryParamPrimitive, type QueryParamValue, type QueryParams, type QuestionnaireItem, type QuestionnaireItemType, type QuestionnaireResponseAnswer, type QuestionnaireResponseItem, type RapidTestRequest, type RapidTestResponse, type RapidTestResult, type RapidTestType, type RegisterFieldAgentRequest, type RegisterFieldAgentResponse, type RegisterPatientRequest, type RegisterPatientResponse, type ResetFieldAgentPasswordRequest, type ResetPasswordResponse, type RtcTokenRequest, type RtcTokenResponse, type RtcTokenSuccessResponse, type RtcTokenUnavailableResponse, SDKError, type SDKRuntimeState, type SearchKnowledgeQuery, type SearchKnowledgeResponse, type ServiceName, type SexAtBirth, type SubmitVitalsResponse, type TemperatureVital, type UpdateFieldAgentRequest, type UpdatedResponse, type UpsertConversationRequest, type UpsertGroupRequest, type UpsertInviteRequest, type UpsertMessageRequest, type UpsertPresenceRequest, type VerifiedResponse, type VerifyEmailRequest, type VerifyFieldAgentSmsRequest, type VitalsRecordRequest, type WeightVital, assertEnvironment, isServiceName, resolveBaseUrl, withTenantId };