@healthcloudai/hc-sdk 0.1.2

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.js ADDED
@@ -0,0 +1,733 @@
1
+ // src/config/SDKConfig.ts
2
+ var SERVICES = [
3
+ "patient",
4
+ "vitals",
5
+ "diagnostics",
6
+ "provider",
7
+ "ehr",
8
+ "appointments",
9
+ "rppg",
10
+ "session",
11
+ "telehealth"
12
+ ];
13
+ function isServiceName(value) {
14
+ return SERVICES.includes(value);
15
+ }
16
+ function resolveBaseUrl(environment, service) {
17
+ const prefix = environment === "prod" ? "" : `${environment}-`;
18
+ return `https://${prefix}api-${service}.health.cloud`;
19
+ }
20
+ function assertEnvironment(environment) {
21
+ if (environment !== "dev" && environment !== "uat" && environment !== "prod") {
22
+ throw new Error(`Unsupported HealthCloud environment: "${environment}"`);
23
+ }
24
+ }
25
+
26
+ // src/errors/SDKError.ts
27
+ var SDKError = class extends Error {
28
+ constructor(options) {
29
+ super(options.message, { cause: options.cause });
30
+ this.name = "SDKError";
31
+ this.statusCode = options.statusCode;
32
+ this.response = options.response;
33
+ Object.setPrototypeOf(this, new.target.prototype);
34
+ }
35
+ };
36
+
37
+ // src/http/HttpClient.ts
38
+ var HttpClient = class {
39
+ constructor(state) {
40
+ this.state = state;
41
+ }
42
+ async request(service, method, path, options = {}) {
43
+ const url = this.buildUrl(service, path, options);
44
+ const headers = this.buildHeaders(options);
45
+ const init = { method, headers };
46
+ if (method !== "GET" && method !== "DELETE" && options.body !== void 0) {
47
+ init.body = this.serializeBody(options.body, headers);
48
+ }
49
+ let response;
50
+ try {
51
+ response = await fetch(url, init);
52
+ } catch (error) {
53
+ throw new SDKError({
54
+ message: error instanceof Error ? error.message : "Network request failed.",
55
+ statusCode: 0,
56
+ cause: error
57
+ });
58
+ }
59
+ const payload = await this.parseResponse(response);
60
+ if (!response.ok) {
61
+ throw new SDKError({
62
+ message: this.resolveErrorMessage(response, payload),
63
+ statusCode: response.status,
64
+ response: payload
65
+ });
66
+ }
67
+ return payload;
68
+ }
69
+ buildHeaders(options) {
70
+ var _a;
71
+ const headers = {
72
+ Accept: "application/json",
73
+ ...(_a = options.headers) != null ? _a : {}
74
+ };
75
+ if (this.state.tenantId) {
76
+ headers["X-Tenant-ID"] = this.state.tenantId;
77
+ }
78
+ if (options.auth !== false) {
79
+ if (!this.state.accessToken) {
80
+ throw new SDKError({
81
+ message: "Access token is required. Call sdk.auth.login(...) or sdk.setAccessToken(...).",
82
+ statusCode: 401
83
+ });
84
+ }
85
+ headers.Authorization = `Bearer ${this.state.accessToken}`;
86
+ }
87
+ return headers;
88
+ }
89
+ buildUrl(service, path, options) {
90
+ var _a;
91
+ const normalizedPath = this.resolvePath(path, (_a = options.pathParams) != null ? _a : {});
92
+ const url = new URL(`${resolveBaseUrl(this.state.environment, service)}${normalizedPath}`);
93
+ if (options.query) {
94
+ for (const [key, value] of Object.entries(options.query)) {
95
+ this.appendQuery(url, key, value);
96
+ }
97
+ }
98
+ return url.toString();
99
+ }
100
+ resolvePath(path, pathParams) {
101
+ const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
102
+ return withLeadingSlash.replace(/\{([^}]+)\}/g, (_match, rawKey) => {
103
+ const value = pathParams[rawKey];
104
+ if (value === void 0 || value === null || value === "") {
105
+ throw new SDKError({
106
+ message: `Path parameter "${rawKey}" is required.`,
107
+ statusCode: 0
108
+ });
109
+ }
110
+ return encodeURIComponent(String(value));
111
+ });
112
+ }
113
+ appendQuery(url, key, value) {
114
+ if (Array.isArray(value)) {
115
+ for (const item of value) {
116
+ this.appendQuery(url, key, item);
117
+ }
118
+ return;
119
+ }
120
+ if (value !== void 0 && value !== null && value !== "") {
121
+ url.searchParams.append(key, String(value));
122
+ }
123
+ }
124
+ serializeBody(body, headers) {
125
+ if (typeof body === "string") {
126
+ return body;
127
+ }
128
+ if (typeof URLSearchParams !== "undefined" && body instanceof URLSearchParams) {
129
+ return body;
130
+ }
131
+ if (typeof FormData !== "undefined" && body instanceof FormData) {
132
+ return body;
133
+ }
134
+ if (typeof Blob !== "undefined" && body instanceof Blob) {
135
+ return body;
136
+ }
137
+ if (typeof ArrayBuffer !== "undefined" && body instanceof ArrayBuffer) {
138
+ return body;
139
+ }
140
+ if (!this.hasHeader(headers, "Content-Type")) {
141
+ headers["Content-Type"] = "application/json";
142
+ }
143
+ return JSON.stringify(body);
144
+ }
145
+ async parseResponse(response) {
146
+ var _a;
147
+ if (response.status === 204) {
148
+ return void 0;
149
+ }
150
+ const text = await response.text();
151
+ if (!text) {
152
+ return void 0;
153
+ }
154
+ const contentType = (_a = response.headers.get("content-type")) != null ? _a : "";
155
+ if (contentType.includes("application/json") || text.startsWith("{") || text.startsWith("[")) {
156
+ try {
157
+ return JSON.parse(text);
158
+ } catch {
159
+ return text;
160
+ }
161
+ }
162
+ return text;
163
+ }
164
+ resolveErrorMessage(response, payload) {
165
+ const backendMessage = this.readMessage(payload);
166
+ if (backendMessage) {
167
+ return backendMessage;
168
+ }
169
+ return response.statusText || `HealthCloud API request failed with HTTP ${response.status}.`;
170
+ }
171
+ readMessage(payload) {
172
+ if (typeof payload !== "object" || payload === null) {
173
+ return void 0;
174
+ }
175
+ const record = payload;
176
+ for (const key of ["message", "error", "ErrorMessage", "Message", "detail"]) {
177
+ const value = record[key];
178
+ if (typeof value === "string" && value.trim()) {
179
+ return value;
180
+ }
181
+ }
182
+ return void 0;
183
+ }
184
+ hasHeader(headers, headerName) {
185
+ const normalized = headerName.toLowerCase();
186
+ return Object.keys(headers).some((key) => key.toLowerCase() === normalized);
187
+ }
188
+ };
189
+
190
+ // src/clients/BaseServiceClient.ts
191
+ var BaseServiceClient = class {
192
+ constructor(http, service) {
193
+ this.http = http;
194
+ this.service = service;
195
+ }
196
+ /**
197
+ * Low-level escape hatch — allows consumers to call any path on this service
198
+ * without waiting for a typed SDK method to be added.
199
+ */
200
+ request(method, path, options = {}) {
201
+ return this.send(method, path, options);
202
+ }
203
+ connectService() {
204
+ return this.send("GET", "/connect", { auth: false });
205
+ }
206
+ send(method, path, options = {}) {
207
+ return this.http.request(this.service, method, path, options);
208
+ }
209
+ };
210
+
211
+ // src/clients/AppointmentsClient.ts
212
+ var AppointmentsClient = class extends BaseServiceClient {
213
+ constructor(http) {
214
+ super(http, "appointments");
215
+ }
216
+ connect() {
217
+ return this.connectService();
218
+ }
219
+ };
220
+
221
+ // src/clients/AuthClient.ts
222
+ var AuthClient = class extends BaseServiceClient {
223
+ constructor(http, setAccessToken, getTenantId) {
224
+ super(http, "patient");
225
+ this.setAccessToken = setAccessToken;
226
+ this.getTenantId = getTenantId;
227
+ }
228
+ async register(request) {
229
+ return this.send("POST", "/auth/register", {
230
+ body: this.withTenantId(request),
231
+ auth: false
232
+ });
233
+ }
234
+ async login(request) {
235
+ const response = await this.send("POST", "/auth/login", {
236
+ body: this.withTenantId(request),
237
+ auth: false
238
+ });
239
+ const accessToken = this.extractAccessToken(response);
240
+ if (!accessToken) {
241
+ throw new SDKError({
242
+ message: "Login response did not include an access token.",
243
+ statusCode: 0,
244
+ response
245
+ });
246
+ }
247
+ this.setAccessToken(accessToken);
248
+ return response;
249
+ }
250
+ async verifyEmail(request) {
251
+ return this.send("POST", "/auth/verify-email", {
252
+ body: this.withTenantId(request),
253
+ auth: false
254
+ });
255
+ }
256
+ withTenantId(request) {
257
+ const tenantId = this.getTenantId();
258
+ if (!tenantId || request["tenant_id"]) {
259
+ return request;
260
+ }
261
+ return {
262
+ tenant_id: tenantId,
263
+ ...request
264
+ };
265
+ }
266
+ extractAccessToken(response) {
267
+ if (typeof response !== "object" || response === null) {
268
+ return void 0;
269
+ }
270
+ const record = response;
271
+ for (const key of ["token", "access_token", "accessToken", "AccessToken", "idToken", "IDToken"]) {
272
+ const value = record[key];
273
+ if (typeof value === "string" && value.trim()) {
274
+ return value;
275
+ }
276
+ }
277
+ for (const key of ["data", "Data", "result", "Result"]) {
278
+ const nested = record[key];
279
+ const token = this.extractAccessToken(nested);
280
+ if (token) {
281
+ return token;
282
+ }
283
+ }
284
+ return void 0;
285
+ }
286
+ };
287
+
288
+ // src/clients/DiagnosticsClient.ts
289
+ var DiagnosticsClient = class extends BaseServiceClient {
290
+ constructor(http) {
291
+ super(http, "diagnostics");
292
+ }
293
+ connect() {
294
+ return this.connectService();
295
+ }
296
+ createRapidTest(patientId, request) {
297
+ return this.send("POST", "/patients/{patient_id}/diagnostics/rapid-tests", {
298
+ pathParams: { patient_id: patientId },
299
+ body: request
300
+ });
301
+ }
302
+ list(patientId, query) {
303
+ return this.send("GET", "/patients/{patient_id}/diagnostics", {
304
+ pathParams: { patient_id: patientId },
305
+ query
306
+ });
307
+ }
308
+ };
309
+
310
+ // src/clients/EhrClient.ts
311
+ var EhrClient = class extends BaseServiceClient {
312
+ constructor(http) {
313
+ super(http, "ehr");
314
+ }
315
+ connect() {
316
+ return this.connectService();
317
+ }
318
+ };
319
+
320
+ // src/clients/PatientClient.ts
321
+ var PatientClient = class extends BaseServiceClient {
322
+ constructor(http) {
323
+ super(http, "patient");
324
+ }
325
+ connect() {
326
+ return this.connectService();
327
+ }
328
+ updatePhone(patientId, request) {
329
+ return this.send("POST", "/patients/{id}/phone", {
330
+ pathParams: { id: patientId },
331
+ body: request
332
+ });
333
+ }
334
+ verifySms(patientId, request) {
335
+ return this.send("POST", "/patients/{id}/verify-sms", {
336
+ pathParams: { id: patientId },
337
+ body: request
338
+ });
339
+ }
340
+ updateAddress(patientId, request) {
341
+ return this.send("PUT", "/patients/{id}/address", {
342
+ pathParams: { id: patientId },
343
+ body: request
344
+ });
345
+ }
346
+ updateRace(patientId, request) {
347
+ return this.send("PUT", "/patients/{id}/race", {
348
+ pathParams: { id: patientId },
349
+ body: request
350
+ });
351
+ }
352
+ getProfile(patientId) {
353
+ return this.send("GET", "/patients/{id}", {
354
+ pathParams: { id: patientId }
355
+ });
356
+ }
357
+ uploadPhoto(patientId, request) {
358
+ return this.send("POST", "/patients/{id}/photo", {
359
+ pathParams: { id: patientId },
360
+ body: request
361
+ });
362
+ }
363
+ getPhoto(patientId, query) {
364
+ return this.send("GET", "/patients/{id}/photo", {
365
+ pathParams: { id: patientId },
366
+ query
367
+ });
368
+ }
369
+ getPhotoUploadUrl(patientId) {
370
+ return this.send("GET", "/patients/{id}/photo/upload-url", {
371
+ pathParams: { id: patientId }
372
+ });
373
+ }
374
+ compareFaceMatch(patientId, request) {
375
+ return this.send("POST", "/patients/{id}/face-match", {
376
+ pathParams: { id: patientId },
377
+ body: request
378
+ });
379
+ }
380
+ scanIdentityDocument(patientId, request) {
381
+ return this.send("POST", "/patients/{id}/identity-document", {
382
+ pathParams: { id: patientId },
383
+ body: request
384
+ });
385
+ }
386
+ updateDemographics(patientId, request) {
387
+ return this.send("PUT", "/patients/{id}/demographics", {
388
+ pathParams: { id: patientId },
389
+ body: request
390
+ });
391
+ }
392
+ createInsurance(patientId, request) {
393
+ return this.send("POST", "/patients/{id}/insurance", {
394
+ pathParams: { id: patientId },
395
+ body: request
396
+ });
397
+ }
398
+ createMedication(patientId, request) {
399
+ return this.send("POST", "/patients/{id}/medications", {
400
+ pathParams: { id: patientId },
401
+ body: request
402
+ });
403
+ }
404
+ listMedications(patientId) {
405
+ return this.send("GET", "/patients/{id}/medications", {
406
+ pathParams: { id: patientId }
407
+ });
408
+ }
409
+ getMedication(patientId, medicationId) {
410
+ return this.send("GET", "/patients/{id}/medications/{med_id}", {
411
+ pathParams: { id: patientId, med_id: medicationId }
412
+ });
413
+ }
414
+ updateMedicationStatus(patientId, medicationId, request) {
415
+ return this.send("PUT", "/patients/{id}/medications/{med_id}", {
416
+ pathParams: { id: patientId, med_id: medicationId },
417
+ body: request
418
+ });
419
+ }
420
+ listNearestLocations(query) {
421
+ return this.send("GET", "/locations/nearest", {
422
+ query
423
+ });
424
+ }
425
+ createEncounter(request) {
426
+ return this.send("POST", "/encounters", {
427
+ body: request
428
+ });
429
+ }
430
+ listEncounters(query) {
431
+ return this.send("GET", "/encounters", {
432
+ query
433
+ });
434
+ }
435
+ getEncounter(encounterId) {
436
+ return this.send("GET", "/encounters/{id}", {
437
+ pathParams: { id: encounterId }
438
+ });
439
+ }
440
+ createQuestionnaire(request) {
441
+ return this.send("POST", "/questionnaires", {
442
+ body: request
443
+ });
444
+ }
445
+ createQuestionnaireResponse(questionnaireId, request) {
446
+ return this.send("POST", "/questionnaires/{id}/responses", {
447
+ pathParams: { id: questionnaireId },
448
+ body: request
449
+ });
450
+ }
451
+ checkInsuranceEligibility(request) {
452
+ return this.send("POST", "/insurance/eligibility", {
453
+ body: request
454
+ });
455
+ }
456
+ // ── Assistant API — classify/ocr/chat are public (auth: false); the 3
457
+ // knowledge/action routes require a bearer token (default auth behaviour). ──
458
+ classifyVoiceCommand(request) {
459
+ return this.send("POST", "/assistant/classify", {
460
+ body: request,
461
+ auth: false
462
+ });
463
+ }
464
+ ocrIdentityDocument(request) {
465
+ return this.send("POST", "/assistant/ocr", {
466
+ body: request,
467
+ auth: false
468
+ });
469
+ }
470
+ askAssistant(request) {
471
+ return this.send("POST", "/assistant/chat", {
472
+ body: request,
473
+ auth: false
474
+ });
475
+ }
476
+ listKnowledge(query) {
477
+ return this.send("GET", "/assistant/knowledge", { query });
478
+ }
479
+ searchKnowledge(query) {
480
+ return this.send("GET", "/assistant/knowledge/search", { query });
481
+ }
482
+ listAssistantActions() {
483
+ return this.send("GET", "/assistant/actions", {});
484
+ }
485
+ // ── Vision API ──────────────────────────────────────────────────────────
486
+ compareFacesByUrl(request) {
487
+ return this.send("POST", "/vision/face-compare", {
488
+ body: request
489
+ });
490
+ }
491
+ // ── CareConnect Communications API — every route except rtc-token
492
+ // requires a bearer token; tenant_id is resolved server-side from the JWT. ──
493
+ getCommunicationsState() {
494
+ return this.send("GET", "/communications/state", {});
495
+ }
496
+ listPresence() {
497
+ return this.send("GET", "/communications/presence", {});
498
+ }
499
+ upsertPresence(request) {
500
+ return this.send("POST", "/communications/presence", {
501
+ body: request
502
+ });
503
+ }
504
+ listGroups() {
505
+ return this.send("GET", "/communications/groups", {});
506
+ }
507
+ upsertGroup(request) {
508
+ return this.send("POST", "/communications/groups", {
509
+ body: request
510
+ });
511
+ }
512
+ listConversations() {
513
+ return this.send("GET", "/communications/conversations", {});
514
+ }
515
+ upsertConversation(request) {
516
+ return this.send("POST", "/communications/conversations", {
517
+ body: request
518
+ });
519
+ }
520
+ listMessages(query) {
521
+ return this.send("GET", "/communications/messages", { query });
522
+ }
523
+ upsertMessage(request) {
524
+ return this.send("POST", "/communications/messages", {
525
+ body: request
526
+ });
527
+ }
528
+ listInvites() {
529
+ return this.send("GET", "/communications/invites", {});
530
+ }
531
+ upsertInvite(request) {
532
+ return this.send("POST", "/communications/invites", {
533
+ body: request
534
+ });
535
+ }
536
+ mintRtcToken(request) {
537
+ return this.send("POST", "/communications/rtc-token", {
538
+ body: request,
539
+ auth: false
540
+ });
541
+ }
542
+ };
543
+
544
+ // src/clients/ProviderClient.ts
545
+ var ProviderClient = class extends BaseServiceClient {
546
+ constructor(http) {
547
+ super(http, "provider");
548
+ }
549
+ connect() {
550
+ return this.connectService();
551
+ }
552
+ };
553
+
554
+ // src/clients/RppgClient.ts
555
+ var RppgClient = class extends BaseServiceClient {
556
+ constructor(http) {
557
+ super(http, "rppg");
558
+ }
559
+ connect() {
560
+ return this.connectService();
561
+ }
562
+ };
563
+
564
+ // src/clients/SessionClient.ts
565
+ var SessionClient = class extends BaseServiceClient {
566
+ constructor(http) {
567
+ super(http, "session");
568
+ }
569
+ connect() {
570
+ return this.connectService();
571
+ }
572
+ };
573
+
574
+ // src/clients/TelehealthClient.ts
575
+ var TelehealthClient = class extends BaseServiceClient {
576
+ constructor(http) {
577
+ super(http, "telehealth");
578
+ }
579
+ connect() {
580
+ return this.connectService();
581
+ }
582
+ };
583
+
584
+ // src/clients/VitalsClient.ts
585
+ var VitalsClient = class extends BaseServiceClient {
586
+ constructor(http) {
587
+ super(http, "vitals");
588
+ }
589
+ connect() {
590
+ return this.connectService();
591
+ }
592
+ record(patientId, request) {
593
+ return this.send("POST", "/patients/{patient_id}/vitals", {
594
+ pathParams: { patient_id: patientId },
595
+ body: request
596
+ });
597
+ }
598
+ list(patientId, query) {
599
+ return this.send("GET", "/patients/{patient_id}/vitals", {
600
+ pathParams: { patient_id: patientId },
601
+ query
602
+ });
603
+ }
604
+ };
605
+
606
+ // src/HCSDK.ts
607
+ var HCSDK = class {
608
+ constructor(config) {
609
+ assertEnvironment(config.environment);
610
+ this.state = {
611
+ environment: config.environment,
612
+ tenantId: config.tenantId,
613
+ accessToken: config.accessToken
614
+ };
615
+ this.http = new HttpClient(this.state);
616
+ this.auth = new AuthClient(
617
+ this.http,
618
+ (token) => this.setAccessToken(token),
619
+ () => this.state.tenantId
620
+ );
621
+ this.patient = new PatientClient(this.http);
622
+ this.vitals = new VitalsClient(this.http);
623
+ this.diagnostics = new DiagnosticsClient(this.http);
624
+ this.provider = new ProviderClient(this.http);
625
+ this.ehr = new EhrClient(this.http);
626
+ this.appointments = new AppointmentsClient(this.http);
627
+ this.rppg = new RppgClient(this.http);
628
+ this.session = new SessionClient(this.http);
629
+ this.telehealth = new TelehealthClient(this.http);
630
+ }
631
+ setAccessToken(token) {
632
+ this.state.accessToken = token;
633
+ }
634
+ getAccessToken() {
635
+ return this.state.accessToken;
636
+ }
637
+ };
638
+
639
+ // src/models/generated/operations.ts
640
+ var HCSDK_OPERATION_SUMMARY = [
641
+ { service: "patient", method: "GET", path: "/connect", sdkMethod: "patient.connect", summary: "Lambda warm-up / connectivity check" },
642
+ { service: "auth", method: "POST", path: "/auth/register", sdkMethod: "auth.register", summary: "Register patient" },
643
+ { service: "auth", method: "POST", path: "/auth/login", sdkMethod: "auth.login", summary: "Login" },
644
+ { service: "auth", method: "POST", path: "/auth/verify-email", sdkMethod: "auth.verifyEmail", summary: "Verify email OTP" },
645
+ { service: "patient", method: "POST", path: "/patients/{id}/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
646
+ { service: "patient", method: "POST", path: "/patients/{id}/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
647
+ { service: "patient", method: "PUT", path: "/patients/{id}/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
648
+ { service: "patient", method: "PUT", path: "/patients/{id}/race", sdkMethod: "patient.updateRace", summary: "Update race" },
649
+ { service: "patient", method: "GET", path: "/patients/{id}", sdkMethod: "patient.getProfile", summary: "Get patient" },
650
+ { service: "patient", method: "POST", path: "/patients/{id}/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
651
+ { service: "patient", method: "GET", path: "/patients/{id}/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
652
+ { service: "patient", method: "GET", path: "/patients/{id}/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
653
+ { service: "patient", method: "POST", path: "/patients/{id}/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
654
+ { service: "patient", method: "POST", path: "/patients/{id}/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
655
+ { service: "patient", method: "PUT", path: "/patients/{id}/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
656
+ { service: "patient", method: "POST", path: "/patients/{id}/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
657
+ { service: "patient", method: "POST", path: "/patients/{id}/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
658
+ { service: "patient", method: "GET", path: "/patients/{id}/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
659
+ { service: "patient", method: "GET", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
660
+ { service: "patient", method: "PUT", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
661
+ { service: "patient", method: "GET", path: "/locations/nearest", sdkMethod: "patient.listNearestLocations", summary: "Nearest clinics/providers" },
662
+ { service: "patient", method: "POST", path: "/encounters", sdkMethod: "patient.createEncounter", summary: "Create encounter" },
663
+ { service: "patient", method: "GET", path: "/encounters", sdkMethod: "patient.listEncounters", summary: "List encounters" },
664
+ { service: "patient", method: "GET", path: "/encounters/{id}", sdkMethod: "patient.getEncounter", summary: "Get encounter" },
665
+ { service: "patient", method: "POST", path: "/questionnaires", sdkMethod: "patient.createQuestionnaire", summary: "Create questionnaire" },
666
+ { service: "patient", method: "POST", path: "/questionnaires/{id}/responses", sdkMethod: "patient.createQuestionnaireResponse", summary: "Create questionnaire response" },
667
+ { service: "patient", method: "POST", path: "/insurance/eligibility", sdkMethod: "patient.checkInsuranceEligibility", summary: "Check insurance eligibility" },
668
+ { service: "patient", method: "POST", path: "/assistant/classify", sdkMethod: "patient.classifyVoiceCommand", summary: "Voice command classification (public)" },
669
+ { service: "patient", method: "POST", path: "/assistant/ocr", sdkMethod: "patient.ocrIdentityDocument", summary: "ID document OCR via vision LLM (public)" },
670
+ { service: "patient", method: "POST", path: "/assistant/chat", sdkMethod: "patient.askAssistant", summary: "Grounded RAG field-guide chat (public)" },
671
+ { service: "patient", method: "GET", path: "/assistant/knowledge", sdkMethod: "patient.listKnowledge", summary: "List knowledge base collections/entries" },
672
+ { service: "patient", method: "GET", path: "/assistant/knowledge/search", sdkMethod: "patient.searchKnowledge", summary: "Lexical search over knowledge base" },
673
+ { service: "patient", method: "GET", path: "/assistant/actions", sdkMethod: "patient.listAssistantActions", summary: "List suggested-action catalog" },
674
+ { service: "patient", method: "POST", path: "/vision/face-compare", sdkMethod: "patient.compareFacesByUrl", summary: "URL-based face comparison (Rekognition)" },
675
+ { service: "patient", method: "GET", path: "/communications/state", sdkMethod: "patient.getCommunicationsState", summary: "CareConnect initial state snapshot" },
676
+ { service: "patient", method: "GET", path: "/communications/presence", sdkMethod: "patient.listPresence", summary: "List presence records" },
677
+ { service: "patient", method: "POST", path: "/communications/presence", sdkMethod: "patient.upsertPresence", summary: "Upsert presence record" },
678
+ { service: "patient", method: "GET", path: "/communications/groups", sdkMethod: "patient.listGroups", summary: "List groups" },
679
+ { service: "patient", method: "POST", path: "/communications/groups", sdkMethod: "patient.upsertGroup", summary: "Upsert group" },
680
+ { service: "patient", method: "GET", path: "/communications/conversations", sdkMethod: "patient.listConversations", summary: "List conversations" },
681
+ { service: "patient", method: "POST", path: "/communications/conversations", sdkMethod: "patient.upsertConversation", summary: "Upsert conversation" },
682
+ { service: "patient", method: "GET", path: "/communications/messages", sdkMethod: "patient.listMessages", summary: "List messages" },
683
+ { service: "patient", method: "POST", path: "/communications/messages", sdkMethod: "patient.upsertMessage", summary: "Upsert message" },
684
+ { service: "patient", method: "GET", path: "/communications/invites", sdkMethod: "patient.listInvites", summary: "List invites" },
685
+ { service: "patient", method: "POST", path: "/communications/invites", sdkMethod: "patient.upsertInvite", summary: "Upsert invite" },
686
+ { service: "patient", method: "POST", path: "/communications/rtc-token", sdkMethod: "patient.mintRtcToken", summary: "Mint Agora RTC token (public)" },
687
+ { service: "vitals", method: "GET", path: "/connect", sdkMethod: "vitals.connect", summary: "Lambda warm-up / connectivity check" },
688
+ { service: "vitals", method: "POST", path: "/patients/{patient_id}/vitals", sdkMethod: "vitals.record", summary: "Record patient vitals" },
689
+ { service: "vitals", method: "GET", path: "/patients/{patient_id}/vitals", sdkMethod: "vitals.list", summary: "List patient vitals" },
690
+ { service: "diagnostics", method: "GET", path: "/connect", sdkMethod: "diagnostics.connect", summary: "Lambda warm-up / connectivity check" },
691
+ { service: "diagnostics", method: "POST", path: "/patients/{patient_id}/diagnostics/rapid-tests", sdkMethod: "diagnostics.createRapidTest", summary: "Create rapid test result (confirmed against live swagger; health_cloud_api.md documents this incorrectly as /rapid-test)" },
692
+ { service: "diagnostics", method: "GET", path: "/patients/{patient_id}/diagnostics", sdkMethod: "diagnostics.list", summary: "List diagnostics" },
693
+ { service: "provider", method: "GET", path: "/connect", sdkMethod: "provider.connect", summary: "Lambda warm-up / connectivity check" },
694
+ { service: "ehr", method: "GET", path: "/connect", sdkMethod: "ehr.connect", summary: "Lambda warm-up / connectivity check" },
695
+ { service: "appointments", method: "GET", path: "/connect", sdkMethod: "appointments.connect", summary: "Lambda warm-up / connectivity check" },
696
+ { service: "rppg", method: "GET", path: "/connect", sdkMethod: "rppg.connect", summary: "Lambda warm-up / connectivity check" },
697
+ { service: "session", method: "GET", path: "/connect", sdkMethod: "session.connect", summary: "Lambda warm-up / connectivity check" },
698
+ { service: "telehealth", method: "GET", path: "/connect", sdkMethod: "telehealth.connect", summary: "Lambda warm-up / connectivity check" }
699
+ ];
700
+ var HCSDK_TOTAL_OPERATION_COUNT = HCSDK_OPERATION_SUMMARY.length;
701
+ var HCSDK_SWAGGER_PATH_COUNTS = {
702
+ patient: 51,
703
+ vitals: 2,
704
+ diagnostics: 3,
705
+ provider: 1,
706
+ ehr: 1,
707
+ appointments: 1,
708
+ rppg: 1,
709
+ session: 1,
710
+ telehealth: 1
711
+ };
712
+ var HCSDK_SWAGGER_OPERATION_COUNTS = {
713
+ patient: 46,
714
+ vitals: 3,
715
+ diagnostics: 3,
716
+ provider: 1,
717
+ ehr: 1,
718
+ appointments: 1,
719
+ rppg: 1,
720
+ session: 1,
721
+ telehealth: 1
722
+ };
723
+ export {
724
+ HCSDK,
725
+ HCSDK_OPERATION_SUMMARY,
726
+ HCSDK_SWAGGER_OPERATION_COUNTS,
727
+ HCSDK_SWAGGER_PATH_COUNTS,
728
+ HCSDK_TOTAL_OPERATION_COUNT,
729
+ SDKError,
730
+ assertEnvironment,
731
+ isServiceName,
732
+ resolveBaseUrl
733
+ };