@healthcloudai/hc-sdk 0.11.0 → 2.0.1

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 CHANGED
@@ -609,69 +609,68 @@ var PatientClient = class extends BaseServiceClient {
609
609
  connect() {
610
610
  return this.connectService();
611
611
  }
612
- updatePhone(fhirPatientId, request) {
613
- return this.send("POST", "/patients/{id}/phone", {
614
- pathParams: { id: fhirPatientId },
612
+ /** POST /patients/phone — self-service; the patient is resolved from the caller's Bearer token. */
613
+ updatePhone(request) {
614
+ return this.send("POST", "/patients/phone", {
615
615
  body: request
616
616
  });
617
617
  }
618
- verifySms(fhirPatientId, request) {
619
- return this.send("POST", "/patients/{id}/verify-sms", {
620
- pathParams: { id: fhirPatientId },
618
+ /** POST /patients/verify-sms — self-service; the patient is resolved from the caller's Bearer token. */
619
+ verifySms(request) {
620
+ return this.send("POST", "/patients/verify-sms", {
621
621
  body: request
622
622
  });
623
623
  }
624
- updateAddress(fhirPatientId, request) {
625
- return this.send("PUT", "/patients/{id}/address", {
626
- pathParams: { id: fhirPatientId },
624
+ /** PUT /patients/address — self-service; the patient is resolved from the caller's Bearer token. */
625
+ updateAddress(request) {
626
+ return this.send("PUT", "/patients/address", {
627
627
  body: request
628
628
  });
629
629
  }
630
- updateRace(fhirPatientId, request) {
631
- return this.send("PUT", "/patients/{id}/race", {
632
- pathParams: { id: fhirPatientId },
630
+ /** PUT /patients/race — self-service; the patient is resolved from the caller's Bearer token. */
631
+ updateRace(request) {
632
+ return this.send("PUT", "/patients/race", {
633
633
  body: request
634
634
  });
635
635
  }
636
636
  /**
637
- * Get a patient's complete boolean flags dictionary, e.g. `{ imported_vitals: true }`.
638
- * GET /patients/{id}/flags
637
+ * Get the authenticated patient's complete boolean flags dictionary, e.g. `{ imported_vitals: true }`.
638
+ * GET /patients/flags
639
+ *
640
+ * Self-service: the patient is resolved from the caller's Bearer token —
641
+ * there is no patient id parameter.
639
642
  *
640
- * @param fhirPatientId - The FHIR Patient ID
641
643
  * @returns The complete flags dictionary; `{}` if the patient has no flags set.
642
644
  */
643
- getFlags(fhirPatientId) {
644
- return this.send("GET", "/patients/{id}/flags", {
645
- pathParams: { id: fhirPatientId }
646
- });
645
+ getFlags() {
646
+ return this.send("GET", "/patients/flags", {});
647
647
  }
648
648
  /**
649
- * Partially update a patient's boolean flags dictionary.
650
- * PATCH /patients/{id}/flags
649
+ * Partially update the authenticated patient's boolean flags dictionary.
650
+ * PATCH /patients/flags
651
651
  *
652
652
  * This is a merge, not a replace: only the flag names present in `request`
653
653
  * are changed, every other existing flag is left unchanged. Setting the
654
654
  * same value again is idempotent. Returns the complete flags dictionary
655
655
  * after the merge.
656
656
  *
657
- * @param fhirPatientId - The FHIR Patient ID
657
+ * Self-service: the patient is resolved from the caller's Bearer token —
658
+ * there is no patient id parameter.
659
+ *
658
660
  * @param request - One or more `{ flagName: boolean }` entries to merge in
659
661
  */
660
- updateFlags(fhirPatientId, request) {
661
- return this.send("PATCH", "/patients/{id}/flags", {
662
- pathParams: { id: fhirPatientId },
662
+ updateFlags(request) {
663
+ return this.send("PATCH", "/patients/flags", {
663
664
  body: request
664
665
  });
665
666
  }
666
- getProfile(fhirPatientId) {
667
- return this.send("GET", "/patients/{id}", {
668
- pathParams: { id: fhirPatientId }
669
- });
667
+ /** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
668
+ getProfile() {
669
+ return this.send("GET", "/patients", {});
670
670
  }
671
- getDashboard(fhirPatientId) {
672
- return this.send("GET", "/patients/{id}/dashboard", {
673
- pathParams: { id: fhirPatientId }
674
- });
671
+ /** GET /patients/dashboard — self-service; the patient is resolved from the caller's Bearer token. */
672
+ getDashboard() {
673
+ return this.send("GET", "/patients/dashboard", {});
675
674
  }
676
675
  getAgentConfiguration() {
677
676
  return this.send("GET", "/agentconfiguration", {});
@@ -693,68 +692,55 @@ var PatientClient = class extends BaseServiceClient {
693
692
  body: request
694
693
  });
695
694
  }
696
- uploadPhoto(fhirPatientId, request) {
697
- return this.send("POST", "/patients/{id}/photo", {
698
- pathParams: { id: fhirPatientId },
695
+ uploadPhoto(request) {
696
+ return this.send("POST", "/patients/photo", {
699
697
  body: request
700
698
  });
701
699
  }
702
700
  /**
703
- * Get a patient's photo by binary_id, or the stored photo if binary_id is omitted.
704
- * GET /patients/{id}/photo?binary_id=...
701
+ * Get the authenticated patient's photo by binary_id, or the stored photo if binary_id is omitted.
702
+ * GET /patients/photo?binary_id=...
705
703
  *
706
- * @param fhirPatientId - The FHIR Patient ID
707
704
  * @param query - Optional query parameters; if omitted, fetches the stored/default photo
708
705
  */
709
- getPhoto(fhirPatientId, query) {
710
- return this.send("GET", "/patients/{id}/photo", {
711
- pathParams: { id: fhirPatientId },
706
+ getPhoto(query) {
707
+ return this.send("GET", "/patients/photo", {
712
708
  query
713
709
  });
714
710
  }
715
- getPhotoUploadUrl(fhirPatientId) {
716
- return this.send("GET", "/patients/{id}/photo/upload-url", {
717
- pathParams: { id: fhirPatientId }
718
- });
711
+ getPhotoUploadUrl() {
712
+ return this.send("GET", "/patients/photo/upload-url", {});
719
713
  }
720
- compareFaceMatch(fhirPatientId, request) {
721
- return this.send("POST", "/patients/{id}/face-match", {
722
- pathParams: { id: fhirPatientId },
714
+ compareFaceMatch(request) {
715
+ return this.send("POST", "/patients/face-match", {
723
716
  body: request
724
717
  });
725
718
  }
726
- scanIdentityDocument(fhirPatientId, request) {
727
- return this.send("POST", "/patients/{id}/identity-document", {
728
- pathParams: { id: fhirPatientId },
719
+ scanIdentityDocument(request) {
720
+ return this.send("POST", "/patients/identity-document", {
729
721
  body: request
730
722
  });
731
723
  }
732
- updateDemographics(fhirPatientId, request) {
733
- return this.send("PUT", "/patients/{id}/demographics", {
734
- pathParams: { id: fhirPatientId },
724
+ updateDemographics(request) {
725
+ return this.send("PUT", "/patients/demographics", {
735
726
  body: request
736
727
  });
737
728
  }
738
- createInsurance(fhirPatientId, request) {
739
- return this.send("POST", "/patients/{id}/insurance", {
740
- pathParams: { id: fhirPatientId },
729
+ createInsurance(request) {
730
+ return this.send("POST", "/patients/insurance", {
741
731
  body: request
742
732
  });
743
733
  }
744
- listPatientInsurances(fhirPatientId) {
745
- return this.send("GET", "/patients/{id}/insurance", {
746
- pathParams: { id: fhirPatientId }
747
- });
734
+ listPatientInsurances() {
735
+ return this.send("GET", "/patients/insurance", {});
748
736
  }
749
- importHealthRecord(fhirPatientId, payload) {
750
- return this.send("POST", "/patients/{id}/health-record/import", {
751
- pathParams: { id: fhirPatientId },
737
+ importHealthRecord(payload) {
738
+ return this.send("POST", "/patients/health-record/import", {
752
739
  body: payload
753
740
  });
754
741
  }
755
- importCCDA(fhirPatientId, content) {
756
- return this.send("POST", "/patients/{id}/health-record/import", {
757
- pathParams: { id: fhirPatientId },
742
+ importCCDA(content) {
743
+ return this.send("POST", "/patients/health-record/import", {
758
744
  body: {
759
745
  resourceType: "Binary",
760
746
  contentType: "text/xml",
@@ -762,104 +748,90 @@ var PatientClient = class extends BaseServiceClient {
762
748
  }
763
749
  });
764
750
  }
765
- importVitals(fhirPatientId, source, payload) {
766
- return this.send("POST", "/patients/{id}/vitals/import", {
767
- pathParams: { id: fhirPatientId },
751
+ importVitals(source, payload) {
752
+ return this.send("POST", "/patients/vitals/import", {
768
753
  body: { source, payload }
769
754
  });
770
755
  }
771
- importActivity(fhirPatientId, source, payload) {
772
- return this.send("POST", "/patients/{id}/activity/import", {
773
- pathParams: { id: fhirPatientId },
756
+ importActivity(source, payload) {
757
+ return this.send("POST", "/patients/activity/import", {
774
758
  body: { source, payload }
775
759
  });
776
760
  }
777
- listActivity(fhirPatientId, type) {
778
- return this.send("GET", "/patients/{id}/activity", {
779
- pathParams: { id: fhirPatientId },
761
+ listActivity(type) {
762
+ return this.send("GET", "/patients/activity", {
780
763
  query: type ? { type } : void 0
781
764
  });
782
765
  }
783
- deleteActivity(fhirPatientId, activityId) {
784
- return this.send("DELETE", "/patients/{id}/activity/{activity_id}", {
785
- pathParams: { id: fhirPatientId, activity_id: activityId }
766
+ deleteActivity(activityId) {
767
+ return this.send("DELETE", "/patients/activity/{activity_id}", {
768
+ pathParams: { activity_id: activityId }
786
769
  });
787
770
  }
788
- getPreferredPharmacy(fhirPatientId) {
789
- return this.send("GET", "/patients/{id}/preferred-pharmacy", {
790
- pathParams: { id: fhirPatientId }
791
- });
771
+ getPreferredPharmacy() {
772
+ return this.send("GET", "/patients/preferred-pharmacy", {});
792
773
  }
793
- setPreferredPharmacy(fhirPatientId, data) {
794
- return this.send("PUT", "/patients/{id}/preferred-pharmacy", {
795
- pathParams: { id: fhirPatientId },
774
+ setPreferredPharmacy(data) {
775
+ return this.send("PUT", "/patients/preferred-pharmacy", {
796
776
  body: data
797
777
  });
798
778
  }
799
- listDependents(fhirPatientId) {
800
- return this.send("GET", "/patients/{id}/dependents", {
801
- pathParams: { id: fhirPatientId }
802
- });
779
+ listDependents() {
780
+ return this.send("GET", "/patients/dependents", {});
803
781
  }
804
- saveDependent(fhirPatientId, data, dependentId) {
782
+ saveDependent(data, dependentId) {
805
783
  if (dependentId) {
806
- return this.send("PUT", "/patients/{id}/dependents/{dependent_id}", {
807
- pathParams: { id: fhirPatientId, dependent_id: dependentId },
784
+ return this.send("PUT", "/patients/dependents/{dependent_id}", {
785
+ pathParams: { dependent_id: dependentId },
808
786
  body: data
809
787
  });
810
788
  }
811
- return this.send("POST", "/patients/{id}/dependents", {
812
- pathParams: { id: fhirPatientId },
789
+ return this.send("POST", "/patients/dependents", {
813
790
  body: data
814
791
  });
815
792
  }
816
- deleteDependent(fhirPatientId, dependentId) {
817
- return this.send("DELETE", "/patients/{id}/dependents/{dependent_id}", {
818
- pathParams: { id: fhirPatientId, dependent_id: dependentId }
793
+ deleteDependent(dependentId) {
794
+ return this.send("DELETE", "/patients/dependents/{dependent_id}", {
795
+ pathParams: { dependent_id: dependentId }
819
796
  });
820
797
  }
821
- listNotifications(fhirPatientId) {
822
- return this.send("GET", "/patients/{id}/notifications", {
823
- pathParams: { id: fhirPatientId }
824
- });
798
+ listNotifications() {
799
+ return this.send("GET", "/patients/notifications", {});
825
800
  }
826
- saveNotification(fhirPatientId, data, notificationId) {
801
+ saveNotification(data, notificationId) {
827
802
  if (notificationId) {
828
- return this.send("PUT", "/patients/{id}/notifications/{notification_id}", {
829
- pathParams: { id: fhirPatientId, notification_id: notificationId },
803
+ return this.send("PUT", "/patients/notifications/{notification_id}", {
804
+ pathParams: { notification_id: notificationId },
830
805
  body: data
831
806
  });
832
807
  }
833
- return this.send("POST", "/patients/{id}/notifications", {
834
- pathParams: { id: fhirPatientId },
808
+ return this.send("POST", "/patients/notifications", {
835
809
  body: data
836
810
  });
837
811
  }
838
- deleteNotification(fhirPatientId, notificationId) {
839
- return this.send("DELETE", "/patients/{id}/notifications/{notification_id}", {
840
- pathParams: { id: fhirPatientId, notification_id: notificationId }
812
+ deleteNotification(notificationId) {
813
+ return this.send("DELETE", "/patients/notifications/{notification_id}", {
814
+ pathParams: { notification_id: notificationId }
841
815
  });
842
816
  }
843
- createMedication(fhirPatientId, request) {
844
- return this.send("POST", "/patients/{id}/medications", {
845
- pathParams: { id: fhirPatientId },
817
+ createMedication(request) {
818
+ return this.send("POST", "/patients/medications", {
846
819
  body: request
847
820
  });
848
821
  }
849
- listMedications(fhirPatientId, query) {
850
- return this.send("GET", "/patients/{id}/medications", {
851
- pathParams: { id: fhirPatientId },
822
+ listMedications(query) {
823
+ return this.send("GET", "/patients/medications", {
852
824
  query
853
825
  });
854
826
  }
855
- getMedication(fhirPatientId, medicationId) {
856
- return this.send("GET", "/patients/{id}/medications/{med_id}", {
857
- pathParams: { id: fhirPatientId, med_id: medicationId }
827
+ getMedication(medicationId) {
828
+ return this.send("GET", "/patients/medications/{med_id}", {
829
+ pathParams: { med_id: medicationId }
858
830
  });
859
831
  }
860
- updateMedicationStatus(fhirPatientId, medicationId, request) {
861
- return this.send("PUT", "/patients/{id}/medications/{med_id}", {
862
- pathParams: { id: fhirPatientId, med_id: medicationId },
832
+ updateMedicationStatus(medicationId, request) {
833
+ return this.send("PUT", "/patients/medications/{med_id}", {
834
+ pathParams: { med_id: medicationId },
863
835
  body: request
864
836
  });
865
837
  }
@@ -1327,6 +1299,43 @@ var GraphClient = class extends BaseServiceClient {
1327
1299
  pathParams: { doc_id: docId }
1328
1300
  });
1329
1301
  }
1302
+ // ─── Diagnostic Tests ────────────────────────────────────────────────
1303
+ searchDiagnosticTests(query) {
1304
+ return this.send("GET", "/diagnostic-tests/search", {
1305
+ query
1306
+ });
1307
+ }
1308
+ listDiagnosticSpecialties() {
1309
+ return this.send("GET", "/diagnostic-tests/specialties");
1310
+ }
1311
+ getDiagnosticAnalyte(analyteId, query) {
1312
+ return this.send("GET", "/diagnostic-tests/analytes/{analyte_id}", {
1313
+ pathParams: { analyte_id: analyteId },
1314
+ query
1315
+ });
1316
+ }
1317
+ getDiagnosticTestSystem(testSystemId, query) {
1318
+ return this.send("GET", "/diagnostic-tests/test-systems/{test_system_id}", {
1319
+ pathParams: { test_system_id: testSystemId },
1320
+ query
1321
+ });
1322
+ }
1323
+ listDiagnosticTests(query) {
1324
+ return this.send("GET", "/diagnostic-tests", {
1325
+ query
1326
+ });
1327
+ }
1328
+ getDiagnosticTest(testId) {
1329
+ return this.send("GET", "/diagnostic-tests/{test_id}", {
1330
+ pathParams: { test_id: testId }
1331
+ });
1332
+ }
1333
+ listDiagnosticTestRelationships(testId, query) {
1334
+ return this.send("GET", "/diagnostic-tests/{test_id}/relationships", {
1335
+ pathParams: { test_id: testId },
1336
+ query
1337
+ });
1338
+ }
1330
1339
  };
1331
1340
 
1332
1341
  // src/clients/connectors/ConnectorFactory.ts
@@ -4351,22 +4360,22 @@ var HCSDK_OPERATION_SUMMARY = [
4351
4360
  { service: "auth", method: "POST", path: "/auth/register", sdkMethod: "auth.register", summary: "Register patient" },
4352
4361
  { service: "auth", method: "POST", path: "/auth/login", sdkMethod: "auth.login", summary: "Login" },
4353
4362
  { service: "auth", method: "POST", path: "/auth/verify-email", sdkMethod: "auth.verifyEmail", summary: "Verify email OTP" },
4354
- { service: "patient", method: "POST", path: "/patients/{id}/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4355
- { service: "patient", method: "POST", path: "/patients/{id}/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4356
- { service: "patient", method: "PUT", path: "/patients/{id}/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4357
- { service: "patient", method: "PUT", path: "/patients/{id}/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4358
- { service: "patient", method: "GET", path: "/patients/{id}", sdkMethod: "patient.getProfile", summary: "Get patient" },
4359
- { service: "patient", method: "POST", path: "/patients/{id}/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4360
- { service: "patient", method: "GET", path: "/patients/{id}/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4361
- { service: "patient", method: "GET", path: "/patients/{id}/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4362
- { service: "patient", method: "POST", path: "/patients/{id}/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4363
- { service: "patient", method: "POST", path: "/patients/{id}/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4364
- { service: "patient", method: "PUT", path: "/patients/{id}/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4365
- { service: "patient", method: "POST", path: "/patients/{id}/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4366
- { service: "patient", method: "POST", path: "/patients/{id}/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4367
- { service: "patient", method: "GET", path: "/patients/{id}/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4368
- { service: "patient", method: "GET", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4369
- { service: "patient", method: "PUT", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4363
+ { service: "patient", method: "POST", path: "/patients/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4364
+ { service: "patient", method: "POST", path: "/patients/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4365
+ { service: "patient", method: "PUT", path: "/patients/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4366
+ { service: "patient", method: "PUT", path: "/patients/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4367
+ { service: "patient", method: "GET", path: "/patients", sdkMethod: "patient.getProfile", summary: "Get patient" },
4368
+ { service: "patient", method: "POST", path: "/patients/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4369
+ { service: "patient", method: "GET", path: "/patients/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4370
+ { service: "patient", method: "GET", path: "/patients/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4371
+ { service: "patient", method: "POST", path: "/patients/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4372
+ { service: "patient", method: "POST", path: "/patients/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4373
+ { service: "patient", method: "PUT", path: "/patients/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4374
+ { service: "patient", method: "POST", path: "/patients/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4375
+ { service: "patient", method: "POST", path: "/patients/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4376
+ { service: "patient", method: "GET", path: "/patients/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4377
+ { service: "patient", method: "GET", path: "/patients/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4378
+ { service: "patient", method: "PUT", path: "/patients/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4370
4379
  { service: "patient", method: "GET", path: "/locations/nearest", sdkMethod: "patient.listNearestLocations", summary: "Nearest clinics/providers" },
4371
4380
  { service: "patient", method: "POST", path: "/encounters", sdkMethod: "patient.createEncounter", summary: "Create encounter" },
4372
4381
  { service: "patient", method: "GET", path: "/encounters", sdkMethod: "patient.listEncounters", summary: "List encounters" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthcloudai/hc-sdk",
3
- "version": "0.11.0",
3
+ "version": "2.0.1",
4
4
  "description": "All-in-one HealthCloud SDK with typed platform APIs and secure connector clients.",
5
5
  "author": "Healthcheck Systems Inc",
6
6
  "license": "MIT",