@healthcloudai/hc-sdk 0.7.1 → 0.7.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.cjs +203 -7
- package/dist/index.d.cts +325 -17
- package/dist/index.d.ts +325 -17
- package/dist/index.js +203 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -82,7 +82,8 @@ var SERVICES = [
|
|
|
82
82
|
"telehealth",
|
|
83
83
|
"fieldagent",
|
|
84
84
|
"mcp",
|
|
85
|
-
"connectors"
|
|
85
|
+
"connectors",
|
|
86
|
+
"person"
|
|
86
87
|
];
|
|
87
88
|
function isServiceName(value) {
|
|
88
89
|
return SERVICES.includes(value);
|
|
@@ -294,9 +295,60 @@ var AppointmentsClient = class extends BaseServiceClient {
|
|
|
294
295
|
constructor(http) {
|
|
295
296
|
super(http, "appointments");
|
|
296
297
|
}
|
|
298
|
+
// ─── Connectivity ────────────────────────────────────────────────────
|
|
297
299
|
connect() {
|
|
298
300
|
return this.connectService();
|
|
299
301
|
}
|
|
302
|
+
// ─── Slots ───────────────────────────────────────────────────────────
|
|
303
|
+
/**
|
|
304
|
+
* List available time slots.
|
|
305
|
+
* GET /slots?provider_id=&specialty_code=&date_from=&date_to=
|
|
306
|
+
*/
|
|
307
|
+
listSlots(query) {
|
|
308
|
+
return this.send("GET", "/slots", {
|
|
309
|
+
query
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
// ─── Appointments ────────────────────────────────────────────────────
|
|
313
|
+
/**
|
|
314
|
+
* Book an appointment for a specific slot.
|
|
315
|
+
* POST /appointments/book
|
|
316
|
+
*/
|
|
317
|
+
book(request) {
|
|
318
|
+
return this.send("POST", "/appointments/book", {
|
|
319
|
+
body: request
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Cancel an appointment.
|
|
324
|
+
* POST /appointments/{appointment_id}/cancel
|
|
325
|
+
*/
|
|
326
|
+
cancel(appointmentId) {
|
|
327
|
+
return this.send("POST", "/appointments/{appointment_id}/cancel", {
|
|
328
|
+
pathParams: { appointment_id: appointmentId }
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Reschedule an appointment to a new slot.
|
|
333
|
+
* POST /appointments/{appointment_id}/reschedule
|
|
334
|
+
*/
|
|
335
|
+
reschedule(appointmentId, request) {
|
|
336
|
+
return this.send("POST", "/appointments/{appointment_id}/reschedule", {
|
|
337
|
+
pathParams: { appointment_id: appointmentId },
|
|
338
|
+
body: request
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
// ─── Patient Appointments ────────────────────────────────────────────
|
|
342
|
+
/**
|
|
343
|
+
* List all appointments for a patient.
|
|
344
|
+
* GET /patients/{patient_id}/appointments?status=
|
|
345
|
+
*/
|
|
346
|
+
listPatientAppointments(patientId, query) {
|
|
347
|
+
return this.send("GET", "/patients/{patient_id}/appointments", {
|
|
348
|
+
pathParams: { patient_id: patientId },
|
|
349
|
+
query
|
|
350
|
+
});
|
|
351
|
+
}
|
|
300
352
|
};
|
|
301
353
|
|
|
302
354
|
// src/clients/AuthClient.ts
|
|
@@ -342,16 +394,57 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
342
394
|
connect() {
|
|
343
395
|
return this.connectService();
|
|
344
396
|
}
|
|
345
|
-
|
|
346
|
-
|
|
397
|
+
// ─── Diagnostics ─────────────────────────────────────────────────────
|
|
398
|
+
/**
|
|
399
|
+
* List all diagnostics/observations for a patient.
|
|
400
|
+
* GET /patients/{patient_id}/diagnostics
|
|
401
|
+
*/
|
|
402
|
+
list(patientId) {
|
|
403
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics", {
|
|
404
|
+
pathParams: { patient_id: patientId }
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
// ─── GS1 Lookup ──────────────────────────────────────────────────────
|
|
408
|
+
/**
|
|
409
|
+
* Look up test information by GS1 barcode.
|
|
410
|
+
* GET /patients/{patient_id}/diagnostics/lookup?gs1=...
|
|
411
|
+
*/
|
|
412
|
+
lookupByGs1(patientId, query) {
|
|
413
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics/lookup", {
|
|
414
|
+
pathParams: { patient_id: patientId },
|
|
415
|
+
query
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
// ─── Scan Upload URL ─────────────────────────────────────────────────
|
|
419
|
+
/**
|
|
420
|
+
* Get a presigned S3/Wasabi upload URL for a diagnostic scan.
|
|
421
|
+
* POST /patients/{patient_id}/diagnostics/scan-upload-url
|
|
422
|
+
*/
|
|
423
|
+
getScanUploadUrl(patientId, request) {
|
|
424
|
+
return this.send("POST", "/patients/{patient_id}/diagnostics/scan-upload-url", {
|
|
347
425
|
pathParams: { patient_id: patientId },
|
|
348
426
|
body: request
|
|
349
427
|
});
|
|
350
428
|
}
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
429
|
+
// ─── Test Result ─────────────────────────────────────────────────────
|
|
430
|
+
/**
|
|
431
|
+
* Get a specific diagnostic test result by ID.
|
|
432
|
+
* GET /patients/{patient_id}/diagnostics/{test_id}
|
|
433
|
+
*/
|
|
434
|
+
getTestResult(patientId, testId) {
|
|
435
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics/{test_id}", {
|
|
436
|
+
pathParams: { patient_id: patientId, test_id: testId }
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
// ─── Rapid Test (legacy) ─────────────────────────────────────────────
|
|
440
|
+
/**
|
|
441
|
+
* Create/record a rapid test result.
|
|
442
|
+
* POST /patients/{patient_id}/diagnostics/rapid-tests
|
|
443
|
+
*/
|
|
444
|
+
createRapidTest(patientId, request) {
|
|
445
|
+
return this.send("POST", "/patients/{patient_id}/diagnostics/rapid-tests", {
|
|
446
|
+
pathParams: { patient_id: patientId },
|
|
447
|
+
body: request
|
|
355
448
|
});
|
|
356
449
|
}
|
|
357
450
|
};
|
|
@@ -706,6 +799,108 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
706
799
|
}
|
|
707
800
|
};
|
|
708
801
|
|
|
802
|
+
// src/clients/PersonClient.ts
|
|
803
|
+
var PersonClient = class extends BaseServiceClient {
|
|
804
|
+
constructor(http) {
|
|
805
|
+
super(http, "person");
|
|
806
|
+
}
|
|
807
|
+
// ─── Connectivity ────────────────────────────────────────────────────
|
|
808
|
+
connect() {
|
|
809
|
+
return this.connectService();
|
|
810
|
+
}
|
|
811
|
+
// ─── Auth (public, no Bearer token) ──────────────────────────────────
|
|
812
|
+
/**
|
|
813
|
+
* Register a new person.
|
|
814
|
+
* POST /auth/register (public)
|
|
815
|
+
*/
|
|
816
|
+
register(request) {
|
|
817
|
+
return this.send("POST", "/auth/register", {
|
|
818
|
+
body: request,
|
|
819
|
+
auth: false
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Log in an existing person.
|
|
824
|
+
* POST /auth/login (public)
|
|
825
|
+
*/
|
|
826
|
+
login(request) {
|
|
827
|
+
return this.send("POST", "/auth/login", {
|
|
828
|
+
body: request,
|
|
829
|
+
auth: false
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Verify a person's email address with OTP.
|
|
834
|
+
* POST /auth/verify-email (public)
|
|
835
|
+
*/
|
|
836
|
+
verifyEmail(request) {
|
|
837
|
+
return this.send("POST", "/auth/verify-email", {
|
|
838
|
+
body: request,
|
|
839
|
+
auth: false
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Initiate password reset flow (sends code to email).
|
|
844
|
+
* POST /auth/reset-password (public)
|
|
845
|
+
*/
|
|
846
|
+
resetPassword(request) {
|
|
847
|
+
return this.send("POST", "/auth/reset-password", {
|
|
848
|
+
body: request,
|
|
849
|
+
auth: false
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
// ─── Person CRUD (authenticated) ─────────────────────────────────────
|
|
853
|
+
/**
|
|
854
|
+
* Get a person by ID.
|
|
855
|
+
* GET /persons/{person_id}
|
|
856
|
+
*/
|
|
857
|
+
get(personId) {
|
|
858
|
+
return this.send("GET", "/persons/{person_id}", {
|
|
859
|
+
pathParams: { person_id: personId }
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Update a person's fields.
|
|
864
|
+
* PATCH /persons/{person_id}
|
|
865
|
+
*/
|
|
866
|
+
update(personId, request) {
|
|
867
|
+
return this.send("PATCH", "/persons/{person_id}", {
|
|
868
|
+
pathParams: { person_id: personId },
|
|
869
|
+
body: request
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
// ─── Photo ───────────────────────────────────────────────────────────
|
|
873
|
+
/**
|
|
874
|
+
* Get a presigned upload URL for a person's photo.
|
|
875
|
+
* GET /persons/{person_id}/photo/upload-url
|
|
876
|
+
*/
|
|
877
|
+
getPhotoUploadUrl(personId) {
|
|
878
|
+
return this.send("GET", "/persons/{person_id}/photo/upload-url", {
|
|
879
|
+
pathParams: { person_id: personId }
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Upload a person's photo (base64).
|
|
884
|
+
* POST /persons/{person_id}/photo
|
|
885
|
+
*/
|
|
886
|
+
uploadPhoto(personId, request) {
|
|
887
|
+
return this.send("POST", "/persons/{person_id}/photo", {
|
|
888
|
+
pathParams: { person_id: personId },
|
|
889
|
+
body: request
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Get a person's photo by binary_id.
|
|
894
|
+
* GET /persons/{person_id}/photo?binary_id=...
|
|
895
|
+
*/
|
|
896
|
+
getPhoto(personId, query) {
|
|
897
|
+
return this.send("GET", "/persons/{person_id}/photo", {
|
|
898
|
+
pathParams: { person_id: personId },
|
|
899
|
+
query
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
|
|
709
904
|
// src/clients/ProviderClient.ts
|
|
710
905
|
var ProviderClient = class extends BaseServiceClient {
|
|
711
906
|
constructor(http) {
|
|
@@ -3752,6 +3947,7 @@ var HCSDK = class {
|
|
|
3752
3947
|
() => this.state.tenantId
|
|
3753
3948
|
);
|
|
3754
3949
|
this.patient = new PatientClient(this.http);
|
|
3950
|
+
this.person = new PersonClient(this.http);
|
|
3755
3951
|
this.vitals = new VitalsClient(this.http);
|
|
3756
3952
|
this.diagnostics = new DiagnosticsClient(this.http);
|
|
3757
3953
|
this.provider = new ProviderClient(this.http);
|