@healthcloudai/hc-sdk 0.11.0 → 2.0.0

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 CHANGED
@@ -681,69 +681,68 @@ var PatientClient = class extends BaseServiceClient {
681
681
  connect() {
682
682
  return this.connectService();
683
683
  }
684
- updatePhone(fhirPatientId, request) {
685
- return this.send("POST", "/patients/{id}/phone", {
686
- pathParams: { id: fhirPatientId },
684
+ /** POST /patients/phone — self-service; the patient is resolved from the caller's Bearer token. */
685
+ updatePhone(request) {
686
+ return this.send("POST", "/patients/phone", {
687
687
  body: request
688
688
  });
689
689
  }
690
- verifySms(fhirPatientId, request) {
691
- return this.send("POST", "/patients/{id}/verify-sms", {
692
- pathParams: { id: fhirPatientId },
690
+ /** POST /patients/verify-sms — self-service; the patient is resolved from the caller's Bearer token. */
691
+ verifySms(request) {
692
+ return this.send("POST", "/patients/verify-sms", {
693
693
  body: request
694
694
  });
695
695
  }
696
- updateAddress(fhirPatientId, request) {
697
- return this.send("PUT", "/patients/{id}/address", {
698
- pathParams: { id: fhirPatientId },
696
+ /** PUT /patients/address — self-service; the patient is resolved from the caller's Bearer token. */
697
+ updateAddress(request) {
698
+ return this.send("PUT", "/patients/address", {
699
699
  body: request
700
700
  });
701
701
  }
702
- updateRace(fhirPatientId, request) {
703
- return this.send("PUT", "/patients/{id}/race", {
704
- pathParams: { id: fhirPatientId },
702
+ /** PUT /patients/race — self-service; the patient is resolved from the caller's Bearer token. */
703
+ updateRace(request) {
704
+ return this.send("PUT", "/patients/race", {
705
705
  body: request
706
706
  });
707
707
  }
708
708
  /**
709
- * Get a patient's complete boolean flags dictionary, e.g. `{ imported_vitals: true }`.
710
- * GET /patients/{id}/flags
709
+ * Get the authenticated patient's complete boolean flags dictionary, e.g. `{ imported_vitals: true }`.
710
+ * GET /patients/flags
711
+ *
712
+ * Self-service: the patient is resolved from the caller's Bearer token —
713
+ * there is no patient id parameter.
711
714
  *
712
- * @param fhirPatientId - The FHIR Patient ID
713
715
  * @returns The complete flags dictionary; `{}` if the patient has no flags set.
714
716
  */
715
- getFlags(fhirPatientId) {
716
- return this.send("GET", "/patients/{id}/flags", {
717
- pathParams: { id: fhirPatientId }
718
- });
717
+ getFlags() {
718
+ return this.send("GET", "/patients/flags", {});
719
719
  }
720
720
  /**
721
- * Partially update a patient's boolean flags dictionary.
722
- * PATCH /patients/{id}/flags
721
+ * Partially update the authenticated patient's boolean flags dictionary.
722
+ * PATCH /patients/flags
723
723
  *
724
724
  * This is a merge, not a replace: only the flag names present in `request`
725
725
  * are changed, every other existing flag is left unchanged. Setting the
726
726
  * same value again is idempotent. Returns the complete flags dictionary
727
727
  * after the merge.
728
728
  *
729
- * @param fhirPatientId - The FHIR Patient ID
729
+ * Self-service: the patient is resolved from the caller's Bearer token —
730
+ * there is no patient id parameter.
731
+ *
730
732
  * @param request - One or more `{ flagName: boolean }` entries to merge in
731
733
  */
732
- updateFlags(fhirPatientId, request) {
733
- return this.send("PATCH", "/patients/{id}/flags", {
734
- pathParams: { id: fhirPatientId },
734
+ updateFlags(request) {
735
+ return this.send("PATCH", "/patients/flags", {
735
736
  body: request
736
737
  });
737
738
  }
738
- getProfile(fhirPatientId) {
739
- return this.send("GET", "/patients/{id}", {
740
- pathParams: { id: fhirPatientId }
741
- });
739
+ /** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
740
+ getProfile() {
741
+ return this.send("GET", "/patients", {});
742
742
  }
743
- getDashboard(fhirPatientId) {
744
- return this.send("GET", "/patients/{id}/dashboard", {
745
- pathParams: { id: fhirPatientId }
746
- });
743
+ /** GET /patients/dashboard — self-service; the patient is resolved from the caller's Bearer token. */
744
+ getDashboard() {
745
+ return this.send("GET", "/patients/dashboard", {});
747
746
  }
748
747
  getAgentConfiguration() {
749
748
  return this.send("GET", "/agentconfiguration", {});
@@ -765,68 +764,55 @@ var PatientClient = class extends BaseServiceClient {
765
764
  body: request
766
765
  });
767
766
  }
768
- uploadPhoto(fhirPatientId, request) {
769
- return this.send("POST", "/patients/{id}/photo", {
770
- pathParams: { id: fhirPatientId },
767
+ uploadPhoto(request) {
768
+ return this.send("POST", "/patients/photo", {
771
769
  body: request
772
770
  });
773
771
  }
774
772
  /**
775
- * Get a patient's photo by binary_id, or the stored photo if binary_id is omitted.
776
- * GET /patients/{id}/photo?binary_id=...
773
+ * Get the authenticated patient's photo by binary_id, or the stored photo if binary_id is omitted.
774
+ * GET /patients/photo?binary_id=...
777
775
  *
778
- * @param fhirPatientId - The FHIR Patient ID
779
776
  * @param query - Optional query parameters; if omitted, fetches the stored/default photo
780
777
  */
781
- getPhoto(fhirPatientId, query) {
782
- return this.send("GET", "/patients/{id}/photo", {
783
- pathParams: { id: fhirPatientId },
778
+ getPhoto(query) {
779
+ return this.send("GET", "/patients/photo", {
784
780
  query
785
781
  });
786
782
  }
787
- getPhotoUploadUrl(fhirPatientId) {
788
- return this.send("GET", "/patients/{id}/photo/upload-url", {
789
- pathParams: { id: fhirPatientId }
790
- });
783
+ getPhotoUploadUrl() {
784
+ return this.send("GET", "/patients/photo/upload-url", {});
791
785
  }
792
- compareFaceMatch(fhirPatientId, request) {
793
- return this.send("POST", "/patients/{id}/face-match", {
794
- pathParams: { id: fhirPatientId },
786
+ compareFaceMatch(request) {
787
+ return this.send("POST", "/patients/face-match", {
795
788
  body: request
796
789
  });
797
790
  }
798
- scanIdentityDocument(fhirPatientId, request) {
799
- return this.send("POST", "/patients/{id}/identity-document", {
800
- pathParams: { id: fhirPatientId },
791
+ scanIdentityDocument(request) {
792
+ return this.send("POST", "/patients/identity-document", {
801
793
  body: request
802
794
  });
803
795
  }
804
- updateDemographics(fhirPatientId, request) {
805
- return this.send("PUT", "/patients/{id}/demographics", {
806
- pathParams: { id: fhirPatientId },
796
+ updateDemographics(request) {
797
+ return this.send("PUT", "/patients/demographics", {
807
798
  body: request
808
799
  });
809
800
  }
810
- createInsurance(fhirPatientId, request) {
811
- return this.send("POST", "/patients/{id}/insurance", {
812
- pathParams: { id: fhirPatientId },
801
+ createInsurance(request) {
802
+ return this.send("POST", "/patients/insurance", {
813
803
  body: request
814
804
  });
815
805
  }
816
- listPatientInsurances(fhirPatientId) {
817
- return this.send("GET", "/patients/{id}/insurance", {
818
- pathParams: { id: fhirPatientId }
819
- });
806
+ listPatientInsurances() {
807
+ return this.send("GET", "/patients/insurance", {});
820
808
  }
821
- importHealthRecord(fhirPatientId, payload) {
822
- return this.send("POST", "/patients/{id}/health-record/import", {
823
- pathParams: { id: fhirPatientId },
809
+ importHealthRecord(payload) {
810
+ return this.send("POST", "/patients/health-record/import", {
824
811
  body: payload
825
812
  });
826
813
  }
827
- importCCDA(fhirPatientId, content) {
828
- return this.send("POST", "/patients/{id}/health-record/import", {
829
- pathParams: { id: fhirPatientId },
814
+ importCCDA(content) {
815
+ return this.send("POST", "/patients/health-record/import", {
830
816
  body: {
831
817
  resourceType: "Binary",
832
818
  contentType: "text/xml",
@@ -834,104 +820,90 @@ var PatientClient = class extends BaseServiceClient {
834
820
  }
835
821
  });
836
822
  }
837
- importVitals(fhirPatientId, source, payload) {
838
- return this.send("POST", "/patients/{id}/vitals/import", {
839
- pathParams: { id: fhirPatientId },
823
+ importVitals(source, payload) {
824
+ return this.send("POST", "/patients/vitals/import", {
840
825
  body: { source, payload }
841
826
  });
842
827
  }
843
- importActivity(fhirPatientId, source, payload) {
844
- return this.send("POST", "/patients/{id}/activity/import", {
845
- pathParams: { id: fhirPatientId },
828
+ importActivity(source, payload) {
829
+ return this.send("POST", "/patients/activity/import", {
846
830
  body: { source, payload }
847
831
  });
848
832
  }
849
- listActivity(fhirPatientId, type) {
850
- return this.send("GET", "/patients/{id}/activity", {
851
- pathParams: { id: fhirPatientId },
833
+ listActivity(type) {
834
+ return this.send("GET", "/patients/activity", {
852
835
  query: type ? { type } : void 0
853
836
  });
854
837
  }
855
- deleteActivity(fhirPatientId, activityId) {
856
- return this.send("DELETE", "/patients/{id}/activity/{activity_id}", {
857
- pathParams: { id: fhirPatientId, activity_id: activityId }
838
+ deleteActivity(activityId) {
839
+ return this.send("DELETE", "/patients/activity/{activity_id}", {
840
+ pathParams: { activity_id: activityId }
858
841
  });
859
842
  }
860
- getPreferredPharmacy(fhirPatientId) {
861
- return this.send("GET", "/patients/{id}/preferred-pharmacy", {
862
- pathParams: { id: fhirPatientId }
863
- });
843
+ getPreferredPharmacy() {
844
+ return this.send("GET", "/patients/preferred-pharmacy", {});
864
845
  }
865
- setPreferredPharmacy(fhirPatientId, data) {
866
- return this.send("PUT", "/patients/{id}/preferred-pharmacy", {
867
- pathParams: { id: fhirPatientId },
846
+ setPreferredPharmacy(data) {
847
+ return this.send("PUT", "/patients/preferred-pharmacy", {
868
848
  body: data
869
849
  });
870
850
  }
871
- listDependents(fhirPatientId) {
872
- return this.send("GET", "/patients/{id}/dependents", {
873
- pathParams: { id: fhirPatientId }
874
- });
851
+ listDependents() {
852
+ return this.send("GET", "/patients/dependents", {});
875
853
  }
876
- saveDependent(fhirPatientId, data, dependentId) {
854
+ saveDependent(data, dependentId) {
877
855
  if (dependentId) {
878
- return this.send("PUT", "/patients/{id}/dependents/{dependent_id}", {
879
- pathParams: { id: fhirPatientId, dependent_id: dependentId },
856
+ return this.send("PUT", "/patients/dependents/{dependent_id}", {
857
+ pathParams: { dependent_id: dependentId },
880
858
  body: data
881
859
  });
882
860
  }
883
- return this.send("POST", "/patients/{id}/dependents", {
884
- pathParams: { id: fhirPatientId },
861
+ return this.send("POST", "/patients/dependents", {
885
862
  body: data
886
863
  });
887
864
  }
888
- deleteDependent(fhirPatientId, dependentId) {
889
- return this.send("DELETE", "/patients/{id}/dependents/{dependent_id}", {
890
- pathParams: { id: fhirPatientId, dependent_id: dependentId }
865
+ deleteDependent(dependentId) {
866
+ return this.send("DELETE", "/patients/dependents/{dependent_id}", {
867
+ pathParams: { dependent_id: dependentId }
891
868
  });
892
869
  }
893
- listNotifications(fhirPatientId) {
894
- return this.send("GET", "/patients/{id}/notifications", {
895
- pathParams: { id: fhirPatientId }
896
- });
870
+ listNotifications() {
871
+ return this.send("GET", "/patients/notifications", {});
897
872
  }
898
- saveNotification(fhirPatientId, data, notificationId) {
873
+ saveNotification(data, notificationId) {
899
874
  if (notificationId) {
900
- return this.send("PUT", "/patients/{id}/notifications/{notification_id}", {
901
- pathParams: { id: fhirPatientId, notification_id: notificationId },
875
+ return this.send("PUT", "/patients/notifications/{notification_id}", {
876
+ pathParams: { notification_id: notificationId },
902
877
  body: data
903
878
  });
904
879
  }
905
- return this.send("POST", "/patients/{id}/notifications", {
906
- pathParams: { id: fhirPatientId },
880
+ return this.send("POST", "/patients/notifications", {
907
881
  body: data
908
882
  });
909
883
  }
910
- deleteNotification(fhirPatientId, notificationId) {
911
- return this.send("DELETE", "/patients/{id}/notifications/{notification_id}", {
912
- pathParams: { id: fhirPatientId, notification_id: notificationId }
884
+ deleteNotification(notificationId) {
885
+ return this.send("DELETE", "/patients/notifications/{notification_id}", {
886
+ pathParams: { notification_id: notificationId }
913
887
  });
914
888
  }
915
- createMedication(fhirPatientId, request) {
916
- return this.send("POST", "/patients/{id}/medications", {
917
- pathParams: { id: fhirPatientId },
889
+ createMedication(request) {
890
+ return this.send("POST", "/patients/medications", {
918
891
  body: request
919
892
  });
920
893
  }
921
- listMedications(fhirPatientId, query) {
922
- return this.send("GET", "/patients/{id}/medications", {
923
- pathParams: { id: fhirPatientId },
894
+ listMedications(query) {
895
+ return this.send("GET", "/patients/medications", {
924
896
  query
925
897
  });
926
898
  }
927
- getMedication(fhirPatientId, medicationId) {
928
- return this.send("GET", "/patients/{id}/medications/{med_id}", {
929
- pathParams: { id: fhirPatientId, med_id: medicationId }
899
+ getMedication(medicationId) {
900
+ return this.send("GET", "/patients/medications/{med_id}", {
901
+ pathParams: { med_id: medicationId }
930
902
  });
931
903
  }
932
- updateMedicationStatus(fhirPatientId, medicationId, request) {
933
- return this.send("PUT", "/patients/{id}/medications/{med_id}", {
934
- pathParams: { id: fhirPatientId, med_id: medicationId },
904
+ updateMedicationStatus(medicationId, request) {
905
+ return this.send("PUT", "/patients/medications/{med_id}", {
906
+ pathParams: { med_id: medicationId },
935
907
  body: request
936
908
  });
937
909
  }
@@ -4423,22 +4395,22 @@ var HCSDK_OPERATION_SUMMARY = [
4423
4395
  { service: "auth", method: "POST", path: "/auth/register", sdkMethod: "auth.register", summary: "Register patient" },
4424
4396
  { service: "auth", method: "POST", path: "/auth/login", sdkMethod: "auth.login", summary: "Login" },
4425
4397
  { service: "auth", method: "POST", path: "/auth/verify-email", sdkMethod: "auth.verifyEmail", summary: "Verify email OTP" },
4426
- { service: "patient", method: "POST", path: "/patients/{id}/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4427
- { service: "patient", method: "POST", path: "/patients/{id}/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4428
- { service: "patient", method: "PUT", path: "/patients/{id}/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4429
- { service: "patient", method: "PUT", path: "/patients/{id}/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4430
- { service: "patient", method: "GET", path: "/patients/{id}", sdkMethod: "patient.getProfile", summary: "Get patient" },
4431
- { service: "patient", method: "POST", path: "/patients/{id}/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4432
- { service: "patient", method: "GET", path: "/patients/{id}/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4433
- { service: "patient", method: "GET", path: "/patients/{id}/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4434
- { service: "patient", method: "POST", path: "/patients/{id}/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4435
- { service: "patient", method: "POST", path: "/patients/{id}/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4436
- { service: "patient", method: "PUT", path: "/patients/{id}/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4437
- { service: "patient", method: "POST", path: "/patients/{id}/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4438
- { service: "patient", method: "POST", path: "/patients/{id}/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4439
- { service: "patient", method: "GET", path: "/patients/{id}/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4440
- { service: "patient", method: "GET", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4441
- { service: "patient", method: "PUT", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4398
+ { service: "patient", method: "POST", path: "/patients/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4399
+ { service: "patient", method: "POST", path: "/patients/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4400
+ { service: "patient", method: "PUT", path: "/patients/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4401
+ { service: "patient", method: "PUT", path: "/patients/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4402
+ { service: "patient", method: "GET", path: "/patients", sdkMethod: "patient.getProfile", summary: "Get patient" },
4403
+ { service: "patient", method: "POST", path: "/patients/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4404
+ { service: "patient", method: "GET", path: "/patients/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4405
+ { service: "patient", method: "GET", path: "/patients/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4406
+ { service: "patient", method: "POST", path: "/patients/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4407
+ { service: "patient", method: "POST", path: "/patients/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4408
+ { service: "patient", method: "PUT", path: "/patients/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4409
+ { service: "patient", method: "POST", path: "/patients/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4410
+ { service: "patient", method: "POST", path: "/patients/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4411
+ { service: "patient", method: "GET", path: "/patients/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4412
+ { service: "patient", method: "GET", path: "/patients/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4413
+ { service: "patient", method: "PUT", path: "/patients/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4442
4414
  { service: "patient", method: "GET", path: "/locations/nearest", sdkMethod: "patient.listNearestLocations", summary: "Nearest clinics/providers" },
4443
4415
  { service: "patient", method: "POST", path: "/encounters", sdkMethod: "patient.createEncounter", summary: "Create encounter" },
4444
4416
  { service: "patient", method: "GET", path: "/encounters", sdkMethod: "patient.listEncounters", summary: "List encounters" },