@healthcloudai/hc-sdk 0.7.1 → 0.7.3
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.cjs +233 -7
- package/dist/index.d.cts +414 -28
- package/dist/index.d.ts +414 -28
- package/dist/index.js +233 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,8 @@ var SERVICES = [
|
|
|
11
11
|
"telehealth",
|
|
12
12
|
"fieldagent",
|
|
13
13
|
"mcp",
|
|
14
|
-
"connectors"
|
|
14
|
+
"connectors",
|
|
15
|
+
"person"
|
|
15
16
|
];
|
|
16
17
|
function isServiceName(value) {
|
|
17
18
|
return SERVICES.includes(value);
|
|
@@ -223,9 +224,60 @@ var AppointmentsClient = class extends BaseServiceClient {
|
|
|
223
224
|
constructor(http) {
|
|
224
225
|
super(http, "appointments");
|
|
225
226
|
}
|
|
227
|
+
// ─── Connectivity ────────────────────────────────────────────────────
|
|
226
228
|
connect() {
|
|
227
229
|
return this.connectService();
|
|
228
230
|
}
|
|
231
|
+
// ─── Slots ───────────────────────────────────────────────────────────
|
|
232
|
+
/**
|
|
233
|
+
* List available time slots.
|
|
234
|
+
* GET /slots?provider_id=&specialty_code=&date_from=&date_to=
|
|
235
|
+
*/
|
|
236
|
+
listSlots(query) {
|
|
237
|
+
return this.send("GET", "/slots", {
|
|
238
|
+
query
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
// ─── Appointments ────────────────────────────────────────────────────
|
|
242
|
+
/**
|
|
243
|
+
* Book an appointment for a specific slot.
|
|
244
|
+
* POST /appointments/book
|
|
245
|
+
*/
|
|
246
|
+
book(request) {
|
|
247
|
+
return this.send("POST", "/appointments/book", {
|
|
248
|
+
body: request
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Cancel an appointment.
|
|
253
|
+
* POST /appointments/{appointment_id}/cancel
|
|
254
|
+
*/
|
|
255
|
+
cancel(appointmentId) {
|
|
256
|
+
return this.send("POST", "/appointments/{appointment_id}/cancel", {
|
|
257
|
+
pathParams: { appointment_id: appointmentId }
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Reschedule an appointment to a new slot.
|
|
262
|
+
* POST /appointments/{appointment_id}/reschedule
|
|
263
|
+
*/
|
|
264
|
+
reschedule(appointmentId, request) {
|
|
265
|
+
return this.send("POST", "/appointments/{appointment_id}/reschedule", {
|
|
266
|
+
pathParams: { appointment_id: appointmentId },
|
|
267
|
+
body: request
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
// ─── Patient Appointments ────────────────────────────────────────────
|
|
271
|
+
/**
|
|
272
|
+
* List all appointments for a patient.
|
|
273
|
+
* GET /patients/{patient_id}/appointments?status=
|
|
274
|
+
*/
|
|
275
|
+
listPatientAppointments(patientId, query) {
|
|
276
|
+
return this.send("GET", "/patients/{patient_id}/appointments", {
|
|
277
|
+
pathParams: { patient_id: patientId },
|
|
278
|
+
query
|
|
279
|
+
});
|
|
280
|
+
}
|
|
229
281
|
};
|
|
230
282
|
|
|
231
283
|
// src/clients/AuthClient.ts
|
|
@@ -271,16 +323,57 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
271
323
|
connect() {
|
|
272
324
|
return this.connectService();
|
|
273
325
|
}
|
|
274
|
-
|
|
275
|
-
|
|
326
|
+
// ─── Diagnostics ─────────────────────────────────────────────────────
|
|
327
|
+
/**
|
|
328
|
+
* List all diagnostics/observations for a patient.
|
|
329
|
+
* GET /patients/{patient_id}/diagnostics
|
|
330
|
+
*/
|
|
331
|
+
list(patientId) {
|
|
332
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics", {
|
|
333
|
+
pathParams: { patient_id: patientId }
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
// ─── GS1 Lookup ──────────────────────────────────────────────────────
|
|
337
|
+
/**
|
|
338
|
+
* Look up test information by GS1 barcode.
|
|
339
|
+
* GET /patients/{patient_id}/diagnostics/lookup?gs1=...
|
|
340
|
+
*/
|
|
341
|
+
lookupByGs1(patientId, query) {
|
|
342
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics/lookup", {
|
|
343
|
+
pathParams: { patient_id: patientId },
|
|
344
|
+
query
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
// ─── Scan Upload URL ─────────────────────────────────────────────────
|
|
348
|
+
/**
|
|
349
|
+
* Get a presigned S3/Wasabi upload URL for a diagnostic scan.
|
|
350
|
+
* POST /patients/{patient_id}/diagnostics/scan-upload-url
|
|
351
|
+
*/
|
|
352
|
+
getScanUploadUrl(patientId, request) {
|
|
353
|
+
return this.send("POST", "/patients/{patient_id}/diagnostics/scan-upload-url", {
|
|
276
354
|
pathParams: { patient_id: patientId },
|
|
277
355
|
body: request
|
|
278
356
|
});
|
|
279
357
|
}
|
|
280
|
-
//
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
358
|
+
// ─── Test Result ─────────────────────────────────────────────────────
|
|
359
|
+
/**
|
|
360
|
+
* Get a specific diagnostic test result by ID.
|
|
361
|
+
* GET /patients/{patient_id}/diagnostics/{test_id}
|
|
362
|
+
*/
|
|
363
|
+
getTestResult(patientId, testId) {
|
|
364
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics/{test_id}", {
|
|
365
|
+
pathParams: { patient_id: patientId, test_id: testId }
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
// ─── Rapid Test (legacy) ─────────────────────────────────────────────
|
|
369
|
+
/**
|
|
370
|
+
* Create/record a rapid test result.
|
|
371
|
+
* POST /patients/{patient_id}/diagnostics/rapid-tests
|
|
372
|
+
*/
|
|
373
|
+
createRapidTest(patientId, request) {
|
|
374
|
+
return this.send("POST", "/patients/{patient_id}/diagnostics/rapid-tests", {
|
|
375
|
+
pathParams: { patient_id: patientId },
|
|
376
|
+
body: request
|
|
284
377
|
});
|
|
285
378
|
}
|
|
286
379
|
};
|
|
@@ -635,6 +728,108 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
635
728
|
}
|
|
636
729
|
};
|
|
637
730
|
|
|
731
|
+
// src/clients/PersonClient.ts
|
|
732
|
+
var PersonClient = class extends BaseServiceClient {
|
|
733
|
+
constructor(http) {
|
|
734
|
+
super(http, "person");
|
|
735
|
+
}
|
|
736
|
+
// ─── Connectivity ────────────────────────────────────────────────────
|
|
737
|
+
connect() {
|
|
738
|
+
return this.connectService();
|
|
739
|
+
}
|
|
740
|
+
// ─── Auth (public, no Bearer token) ──────────────────────────────────
|
|
741
|
+
/**
|
|
742
|
+
* Register a new person.
|
|
743
|
+
* POST /auth/register (public)
|
|
744
|
+
*/
|
|
745
|
+
register(request) {
|
|
746
|
+
return this.send("POST", "/auth/register", {
|
|
747
|
+
body: request,
|
|
748
|
+
auth: false
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Log in an existing person.
|
|
753
|
+
* POST /auth/login (public)
|
|
754
|
+
*/
|
|
755
|
+
login(request) {
|
|
756
|
+
return this.send("POST", "/auth/login", {
|
|
757
|
+
body: request,
|
|
758
|
+
auth: false
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Verify a person's email address with OTP.
|
|
763
|
+
* POST /auth/verify-email (public)
|
|
764
|
+
*/
|
|
765
|
+
verifyEmail(request) {
|
|
766
|
+
return this.send("POST", "/auth/verify-email", {
|
|
767
|
+
body: request,
|
|
768
|
+
auth: false
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Initiate password reset flow (sends code to email).
|
|
773
|
+
* POST /auth/reset-password (public)
|
|
774
|
+
*/
|
|
775
|
+
resetPassword(request) {
|
|
776
|
+
return this.send("POST", "/auth/reset-password", {
|
|
777
|
+
body: request,
|
|
778
|
+
auth: false
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
// ─── Person CRUD (authenticated) ─────────────────────────────────────
|
|
782
|
+
/**
|
|
783
|
+
* Get a person by ID.
|
|
784
|
+
* GET /persons/{person_id}
|
|
785
|
+
*/
|
|
786
|
+
get(personId) {
|
|
787
|
+
return this.send("GET", "/persons/{person_id}", {
|
|
788
|
+
pathParams: { person_id: personId }
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Update a person's fields.
|
|
793
|
+
* PATCH /persons/{person_id}
|
|
794
|
+
*/
|
|
795
|
+
update(personId, request) {
|
|
796
|
+
return this.send("PATCH", "/persons/{person_id}", {
|
|
797
|
+
pathParams: { person_id: personId },
|
|
798
|
+
body: request
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
// ─── Photo ───────────────────────────────────────────────────────────
|
|
802
|
+
/**
|
|
803
|
+
* Get a presigned upload URL for a person's photo.
|
|
804
|
+
* GET /persons/{person_id}/photo/upload-url
|
|
805
|
+
*/
|
|
806
|
+
getPhotoUploadUrl(personId) {
|
|
807
|
+
return this.send("GET", "/persons/{person_id}/photo/upload-url", {
|
|
808
|
+
pathParams: { person_id: personId }
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Upload a person's photo (base64).
|
|
813
|
+
* POST /persons/{person_id}/photo
|
|
814
|
+
*/
|
|
815
|
+
uploadPhoto(personId, request) {
|
|
816
|
+
return this.send("POST", "/persons/{person_id}/photo", {
|
|
817
|
+
pathParams: { person_id: personId },
|
|
818
|
+
body: request
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Get a person's photo by binary_id.
|
|
823
|
+
* GET /persons/{person_id}/photo?binary_id=...
|
|
824
|
+
*/
|
|
825
|
+
getPhoto(personId, query) {
|
|
826
|
+
return this.send("GET", "/persons/{person_id}/photo", {
|
|
827
|
+
pathParams: { person_id: personId },
|
|
828
|
+
query
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
|
|
638
833
|
// src/clients/ProviderClient.ts
|
|
639
834
|
var ProviderClient = class extends BaseServiceClient {
|
|
640
835
|
constructor(http) {
|
|
@@ -643,6 +838,36 @@ var ProviderClient = class extends BaseServiceClient {
|
|
|
643
838
|
connect() {
|
|
644
839
|
return this.connectService();
|
|
645
840
|
}
|
|
841
|
+
// ─── Auth (public, no Bearer) ──────────────────────────────────────
|
|
842
|
+
register(request) {
|
|
843
|
+
return this.send("POST", "/auth/register", { body: request, auth: false });
|
|
844
|
+
}
|
|
845
|
+
login(request) {
|
|
846
|
+
return this.send("POST", "/auth/login", { body: request, auth: false });
|
|
847
|
+
}
|
|
848
|
+
verifyEmail(request) {
|
|
849
|
+
return this.send("POST", "/auth/verify-email", { body: request, auth: false });
|
|
850
|
+
}
|
|
851
|
+
resetPassword(request) {
|
|
852
|
+
return this.send("POST", "/auth/reset-password", { body: request, auth: false });
|
|
853
|
+
}
|
|
854
|
+
// ─── Practitioner CRUD ─────────────────────────────────────────────
|
|
855
|
+
get(practitionerId) {
|
|
856
|
+
return this.send("GET", "/practitioners/{practitioner_id}", { pathParams: { practitioner_id: practitionerId } });
|
|
857
|
+
}
|
|
858
|
+
update(practitionerId, request) {
|
|
859
|
+
return this.send("PATCH", "/practitioners/{practitioner_id}", { pathParams: { practitioner_id: practitionerId }, body: request });
|
|
860
|
+
}
|
|
861
|
+
// ─── Photo ─────────────────────────────────────────────────────────
|
|
862
|
+
getPhotoUploadUrl(practitionerId) {
|
|
863
|
+
return this.send("GET", "/practitioners/{practitioner_id}/photo/upload-url", { pathParams: { practitioner_id: practitionerId } });
|
|
864
|
+
}
|
|
865
|
+
uploadPhoto(practitionerId, request) {
|
|
866
|
+
return this.send("POST", "/practitioners/{practitioner_id}/photo", { pathParams: { practitioner_id: practitionerId }, body: request });
|
|
867
|
+
}
|
|
868
|
+
getPhoto(practitionerId, query) {
|
|
869
|
+
return this.send("GET", "/practitioners/{practitioner_id}/photo", { pathParams: { practitioner_id: practitionerId }, query });
|
|
870
|
+
}
|
|
646
871
|
};
|
|
647
872
|
|
|
648
873
|
// src/clients/RppgClient.ts
|
|
@@ -3681,6 +3906,7 @@ var HCSDK = class {
|
|
|
3681
3906
|
() => this.state.tenantId
|
|
3682
3907
|
);
|
|
3683
3908
|
this.patient = new PatientClient(this.http);
|
|
3909
|
+
this.person = new PersonClient(this.http);
|
|
3684
3910
|
this.vitals = new VitalsClient(this.http);
|
|
3685
3911
|
this.diagnostics = new DiagnosticsClient(this.http);
|
|
3686
3912
|
this.provider = new ProviderClient(this.http);
|
package/package.json
CHANGED