@healthcloudai/hc-sdk 0.8.5 → 0.8.7

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/README.md CHANGED
@@ -125,7 +125,7 @@ sdk.ehr // connect + low-level request escape hatch
125
125
  sdk.appointments // connect + low-level request escape hatch
126
126
  sdk.rppg // connect + low-level request escape hatch
127
127
  sdk.session // connect + low-level request escape hatch
128
- sdk.telehealth // connect + low-level request escape hatch
128
+ sdk.telehealth // connect, createChannel, createPatientToken, createProviderToken, fetchRtcToken
129
129
  sdk.fieldAgent // connect, register/login/resetPassword/verifyEmail/verifySms,
130
130
  // getAgent/updateAgent, getDashboard, photo, listPatients, listEncounters
131
131
  sdk.mcp // connect + JSON-RPC proxy (patient/fieldAgent tool calls)
@@ -143,6 +143,35 @@ instances.
143
143
 
144
144
  All groups share one HTTP client, one token store, one error handler, the same URL resolver, query serialiser, and path-param interpolator.
145
145
 
146
+ ### Telehealth helpers
147
+
148
+ The telehealth client exposes the backend's channel and RTC-token routes:
149
+
150
+ ```ts
151
+ const sdk = new HCSDK({
152
+ environment: "dev",
153
+ accessToken: "patient-or-provider-token",
154
+ });
155
+
156
+ const channel = await sdk.telehealth.createChannel();
157
+
158
+ const patientToken = await sdk.telehealth.createPatientToken({
159
+ channel_id: channel.channel_id,
160
+ uid: 101,
161
+ });
162
+
163
+ const providerToken = await sdk.telehealth.createProviderToken({
164
+ channel_id: channel.channel_id,
165
+ uid: 202,
166
+ });
167
+ ```
168
+
169
+ Authentication notes:
170
+ - `createPatientToken()` requires a patient-scoped bearer token and is intended for patient-side video sessions.
171
+ - `createProviderToken()` requires a provider-scoped bearer token and is intended for clinician-side video sessions.
172
+ - `createChannel()` and `fetchRtcToken()` do not require the same role-specific token semantics as the minting methods, but they still use the shared SDK auth flow.
173
+ - If you are using a legacy integration, `fetchRtcToken()` accepts the older `{ channel_name, uid, role }` payload and returns the compatibility response.
174
+
146
175
  ---
147
176
 
148
177
  ## Connectors (`sdk.connectors`)
@@ -1217,7 +1246,8 @@ const agent = await sdk.fieldAgent.getAgent(cognitoSub);
1217
1246
  "tenant_id": "cdcprotect", "email": "agent@example.com",
1218
1247
  "first_name": "Field", "last_name": "Agent", "title": null, "phone": null,
1219
1248
  "badge_number": "FA-001", "license_number": null, "department": "QA",
1220
- "organization": null, "address_street1": null, "address_state": null,
1249
+ "organization": null,
1250
+ "addresses": [],
1221
1251
  "status": "active"
1222
1252
  }
1223
1253
  ```
package/dist/index.cjs CHANGED
@@ -484,7 +484,7 @@ var FieldAgentClient = class extends BaseServiceClient {
484
484
  }
485
485
  register(request) {
486
486
  return this.send("POST", "/auth/register", {
487
- body: withTenantId(request, this.getTenantId()),
487
+ body: withTenantId({ ...request, person_type: "field_agent" }, this.getTenantId()),
488
488
  auth: false
489
489
  });
490
490
  }
@@ -526,37 +526,37 @@ var FieldAgentClient = class extends BaseServiceClient {
526
526
  auth: false
527
527
  });
528
528
  }
529
- getAgent(agentSub) {
530
- return this.send("GET", "/agents/{sub}", {
531
- pathParams: { sub: agentSub }
529
+ getAgent(fhirPersonId) {
530
+ return this.send("GET", "/agents/{fhir_person_id}", {
531
+ pathParams: { fhir_person_id: fhirPersonId }
532
532
  });
533
533
  }
534
- updateAgent(agentSub, request) {
535
- return this.send("PATCH", "/agents/{sub}", {
536
- pathParams: { sub: agentSub },
534
+ updateAgent(fhirPersonId, request) {
535
+ return this.send("PATCH", "/agents/{fhir_person_id}", {
536
+ pathParams: { fhir_person_id: fhirPersonId },
537
537
  body: request
538
538
  });
539
539
  }
540
- getDashboard(agentSub, query) {
541
- return this.send("GET", "/agents/{sub}/dashboard", {
542
- pathParams: { sub: agentSub },
540
+ getDashboard(fhirPersonId, query) {
541
+ return this.send("GET", "/agents/{fhir_person_id}/dashboard", {
542
+ pathParams: { fhir_person_id: fhirPersonId },
543
543
  query
544
544
  });
545
545
  }
546
- getPhotoUploadUrl(agentSub) {
547
- return this.send("GET", "/agents/{sub}/photo/upload-url", {
548
- pathParams: { sub: agentSub }
546
+ getPhotoUploadUrl(fhirPersonId) {
547
+ return this.send("GET", "/agents/{fhir_person_id}/photo/upload-url", {
548
+ pathParams: { fhir_person_id: fhirPersonId }
549
549
  });
550
550
  }
551
- uploadPhoto(agentSub, request) {
552
- return this.send("POST", "/agents/{sub}/photo", {
553
- pathParams: { sub: agentSub },
551
+ uploadPhoto(fhirPersonId, request) {
552
+ return this.send("POST", "/agents/{fhir_person_id}/photo", {
553
+ pathParams: { fhir_person_id: fhirPersonId },
554
554
  body: request
555
555
  });
556
556
  }
557
- getPhoto(agentSub, query) {
558
- return this.send("GET", "/agents/{sub}/photo", {
559
- pathParams: { sub: agentSub },
557
+ getPhoto(fhirPersonId, query) {
558
+ return this.send("GET", "/agents/{fhir_person_id}/photo", {
559
+ pathParams: { fhir_person_id: fhirPersonId },
560
560
  query
561
561
  });
562
562
  }
@@ -1019,6 +1019,18 @@ var TelehealthClient = class extends BaseServiceClient {
1019
1019
  connect() {
1020
1020
  return this.connectService();
1021
1021
  }
1022
+ createChannel() {
1023
+ return this.send("POST", "/telehealth/channels");
1024
+ }
1025
+ createPatientToken(request) {
1026
+ return this.send("POST", "/telehealth/tokens/patient", { body: request });
1027
+ }
1028
+ createProviderToken(request) {
1029
+ return this.send("POST", "/telehealth/tokens/provider", { body: request });
1030
+ }
1031
+ fetchRtcToken(request) {
1032
+ return this.send("POST", "/fetch_rtc_token", { body: request });
1033
+ }
1022
1034
  };
1023
1035
 
1024
1036
  // src/clients/VitalsClient.ts