@healthcloudai/hc-sdk 0.10.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.js CHANGED
@@ -609,40 +609,69 @@ 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
- getProfile(fhirPatientId) {
637
- return this.send("GET", "/patients/{id}", {
638
- pathParams: { id: fhirPatientId }
639
- });
636
+ /**
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.
642
+ *
643
+ * @returns The complete flags dictionary; `{}` if the patient has no flags set.
644
+ */
645
+ getFlags() {
646
+ return this.send("GET", "/patients/flags", {});
640
647
  }
641
- getDashboard(fhirPatientId) {
642
- return this.send("GET", "/patients/{id}/dashboard", {
643
- pathParams: { id: fhirPatientId }
648
+ /**
649
+ * Partially update the authenticated patient's boolean flags dictionary.
650
+ * PATCH /patients/flags
651
+ *
652
+ * This is a merge, not a replace: only the flag names present in `request`
653
+ * are changed, every other existing flag is left unchanged. Setting the
654
+ * same value again is idempotent. Returns the complete flags dictionary
655
+ * after the merge.
656
+ *
657
+ * Self-service: the patient is resolved from the caller's Bearer token —
658
+ * there is no patient id parameter.
659
+ *
660
+ * @param request - One or more `{ flagName: boolean }` entries to merge in
661
+ */
662
+ updateFlags(request) {
663
+ return this.send("PATCH", "/patients/flags", {
664
+ body: request
644
665
  });
645
666
  }
667
+ /** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
668
+ getProfile() {
669
+ return this.send("GET", "/patients", {});
670
+ }
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", {});
674
+ }
646
675
  getAgentConfiguration() {
647
676
  return this.send("GET", "/agentconfiguration", {});
648
677
  }
@@ -663,68 +692,55 @@ var PatientClient = class extends BaseServiceClient {
663
692
  body: request
664
693
  });
665
694
  }
666
- uploadPhoto(fhirPatientId, request) {
667
- return this.send("POST", "/patients/{id}/photo", {
668
- pathParams: { id: fhirPatientId },
695
+ uploadPhoto(request) {
696
+ return this.send("POST", "/patients/photo", {
669
697
  body: request
670
698
  });
671
699
  }
672
700
  /**
673
- * Get a patient's photo by binary_id, or the stored photo if binary_id is omitted.
674
- * 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=...
675
703
  *
676
- * @param fhirPatientId - The FHIR Patient ID
677
704
  * @param query - Optional query parameters; if omitted, fetches the stored/default photo
678
705
  */
679
- getPhoto(fhirPatientId, query) {
680
- return this.send("GET", "/patients/{id}/photo", {
681
- pathParams: { id: fhirPatientId },
706
+ getPhoto(query) {
707
+ return this.send("GET", "/patients/photo", {
682
708
  query
683
709
  });
684
710
  }
685
- getPhotoUploadUrl(fhirPatientId) {
686
- return this.send("GET", "/patients/{id}/photo/upload-url", {
687
- pathParams: { id: fhirPatientId }
688
- });
711
+ getPhotoUploadUrl() {
712
+ return this.send("GET", "/patients/photo/upload-url", {});
689
713
  }
690
- compareFaceMatch(fhirPatientId, request) {
691
- return this.send("POST", "/patients/{id}/face-match", {
692
- pathParams: { id: fhirPatientId },
714
+ compareFaceMatch(request) {
715
+ return this.send("POST", "/patients/face-match", {
693
716
  body: request
694
717
  });
695
718
  }
696
- scanIdentityDocument(fhirPatientId, request) {
697
- return this.send("POST", "/patients/{id}/identity-document", {
698
- pathParams: { id: fhirPatientId },
719
+ scanIdentityDocument(request) {
720
+ return this.send("POST", "/patients/identity-document", {
699
721
  body: request
700
722
  });
701
723
  }
702
- updateDemographics(fhirPatientId, request) {
703
- return this.send("PUT", "/patients/{id}/demographics", {
704
- pathParams: { id: fhirPatientId },
724
+ updateDemographics(request) {
725
+ return this.send("PUT", "/patients/demographics", {
705
726
  body: request
706
727
  });
707
728
  }
708
- createInsurance(fhirPatientId, request) {
709
- return this.send("POST", "/patients/{id}/insurance", {
710
- pathParams: { id: fhirPatientId },
729
+ createInsurance(request) {
730
+ return this.send("POST", "/patients/insurance", {
711
731
  body: request
712
732
  });
713
733
  }
714
- listPatientInsurances(fhirPatientId) {
715
- return this.send("GET", "/patients/{id}/insurance", {
716
- pathParams: { id: fhirPatientId }
717
- });
734
+ listPatientInsurances() {
735
+ return this.send("GET", "/patients/insurance", {});
718
736
  }
719
- importHealthRecord(fhirPatientId, payload) {
720
- return this.send("POST", "/patients/{id}/health-record/import", {
721
- pathParams: { id: fhirPatientId },
737
+ importHealthRecord(payload) {
738
+ return this.send("POST", "/patients/health-record/import", {
722
739
  body: payload
723
740
  });
724
741
  }
725
- importCCDA(fhirPatientId, content) {
726
- return this.send("POST", "/patients/{id}/health-record/import", {
727
- pathParams: { id: fhirPatientId },
742
+ importCCDA(content) {
743
+ return this.send("POST", "/patients/health-record/import", {
728
744
  body: {
729
745
  resourceType: "Binary",
730
746
  contentType: "text/xml",
@@ -732,104 +748,90 @@ var PatientClient = class extends BaseServiceClient {
732
748
  }
733
749
  });
734
750
  }
735
- importVitals(fhirPatientId, source, payload) {
736
- return this.send("POST", "/patients/{id}/vitals/import", {
737
- pathParams: { id: fhirPatientId },
751
+ importVitals(source, payload) {
752
+ return this.send("POST", "/patients/vitals/import", {
738
753
  body: { source, payload }
739
754
  });
740
755
  }
741
- importActivity(fhirPatientId, source, payload) {
742
- return this.send("POST", "/patients/{id}/activity/import", {
743
- pathParams: { id: fhirPatientId },
756
+ importActivity(source, payload) {
757
+ return this.send("POST", "/patients/activity/import", {
744
758
  body: { source, payload }
745
759
  });
746
760
  }
747
- listActivity(fhirPatientId, type) {
748
- return this.send("GET", "/patients/{id}/activity", {
749
- pathParams: { id: fhirPatientId },
761
+ listActivity(type) {
762
+ return this.send("GET", "/patients/activity", {
750
763
  query: type ? { type } : void 0
751
764
  });
752
765
  }
753
- deleteActivity(fhirPatientId, activityId) {
754
- return this.send("DELETE", "/patients/{id}/activity/{activity_id}", {
755
- pathParams: { id: fhirPatientId, activity_id: activityId }
766
+ deleteActivity(activityId) {
767
+ return this.send("DELETE", "/patients/activity/{activity_id}", {
768
+ pathParams: { activity_id: activityId }
756
769
  });
757
770
  }
758
- getPreferredPharmacy(fhirPatientId) {
759
- return this.send("GET", "/patients/{id}/preferred-pharmacy", {
760
- pathParams: { id: fhirPatientId }
761
- });
771
+ getPreferredPharmacy() {
772
+ return this.send("GET", "/patients/preferred-pharmacy", {});
762
773
  }
763
- setPreferredPharmacy(fhirPatientId, data) {
764
- return this.send("PUT", "/patients/{id}/preferred-pharmacy", {
765
- pathParams: { id: fhirPatientId },
774
+ setPreferredPharmacy(data) {
775
+ return this.send("PUT", "/patients/preferred-pharmacy", {
766
776
  body: data
767
777
  });
768
778
  }
769
- listDependents(fhirPatientId) {
770
- return this.send("GET", "/patients/{id}/dependents", {
771
- pathParams: { id: fhirPatientId }
772
- });
779
+ listDependents() {
780
+ return this.send("GET", "/patients/dependents", {});
773
781
  }
774
- saveDependent(fhirPatientId, data, dependentId) {
782
+ saveDependent(data, dependentId) {
775
783
  if (dependentId) {
776
- return this.send("PUT", "/patients/{id}/dependents/{dependent_id}", {
777
- pathParams: { id: fhirPatientId, dependent_id: dependentId },
784
+ return this.send("PUT", "/patients/dependents/{dependent_id}", {
785
+ pathParams: { dependent_id: dependentId },
778
786
  body: data
779
787
  });
780
788
  }
781
- return this.send("POST", "/patients/{id}/dependents", {
782
- pathParams: { id: fhirPatientId },
789
+ return this.send("POST", "/patients/dependents", {
783
790
  body: data
784
791
  });
785
792
  }
786
- deleteDependent(fhirPatientId, dependentId) {
787
- return this.send("DELETE", "/patients/{id}/dependents/{dependent_id}", {
788
- pathParams: { id: fhirPatientId, dependent_id: dependentId }
793
+ deleteDependent(dependentId) {
794
+ return this.send("DELETE", "/patients/dependents/{dependent_id}", {
795
+ pathParams: { dependent_id: dependentId }
789
796
  });
790
797
  }
791
- listNotifications(fhirPatientId) {
792
- return this.send("GET", "/patients/{id}/notifications", {
793
- pathParams: { id: fhirPatientId }
794
- });
798
+ listNotifications() {
799
+ return this.send("GET", "/patients/notifications", {});
795
800
  }
796
- saveNotification(fhirPatientId, data, notificationId) {
801
+ saveNotification(data, notificationId) {
797
802
  if (notificationId) {
798
- return this.send("PUT", "/patients/{id}/notifications/{notification_id}", {
799
- pathParams: { id: fhirPatientId, notification_id: notificationId },
803
+ return this.send("PUT", "/patients/notifications/{notification_id}", {
804
+ pathParams: { notification_id: notificationId },
800
805
  body: data
801
806
  });
802
807
  }
803
- return this.send("POST", "/patients/{id}/notifications", {
804
- pathParams: { id: fhirPatientId },
808
+ return this.send("POST", "/patients/notifications", {
805
809
  body: data
806
810
  });
807
811
  }
808
- deleteNotification(fhirPatientId, notificationId) {
809
- return this.send("DELETE", "/patients/{id}/notifications/{notification_id}", {
810
- pathParams: { id: fhirPatientId, notification_id: notificationId }
812
+ deleteNotification(notificationId) {
813
+ return this.send("DELETE", "/patients/notifications/{notification_id}", {
814
+ pathParams: { notification_id: notificationId }
811
815
  });
812
816
  }
813
- createMedication(fhirPatientId, request) {
814
- return this.send("POST", "/patients/{id}/medications", {
815
- pathParams: { id: fhirPatientId },
817
+ createMedication(request) {
818
+ return this.send("POST", "/patients/medications", {
816
819
  body: request
817
820
  });
818
821
  }
819
- listMedications(fhirPatientId, query) {
820
- return this.send("GET", "/patients/{id}/medications", {
821
- pathParams: { id: fhirPatientId },
822
+ listMedications(query) {
823
+ return this.send("GET", "/patients/medications", {
822
824
  query
823
825
  });
824
826
  }
825
- getMedication(fhirPatientId, medicationId) {
826
- return this.send("GET", "/patients/{id}/medications/{med_id}", {
827
- pathParams: { id: fhirPatientId, med_id: medicationId }
827
+ getMedication(medicationId) {
828
+ return this.send("GET", "/patients/medications/{med_id}", {
829
+ pathParams: { med_id: medicationId }
828
830
  });
829
831
  }
830
- updateMedicationStatus(fhirPatientId, medicationId, request) {
831
- return this.send("PUT", "/patients/{id}/medications/{med_id}", {
832
- pathParams: { id: fhirPatientId, med_id: medicationId },
832
+ updateMedicationStatus(medicationId, request) {
833
+ return this.send("PUT", "/patients/medications/{med_id}", {
834
+ pathParams: { med_id: medicationId },
833
835
  body: request
834
836
  });
835
837
  }
@@ -4321,22 +4323,22 @@ var HCSDK_OPERATION_SUMMARY = [
4321
4323
  { service: "auth", method: "POST", path: "/auth/register", sdkMethod: "auth.register", summary: "Register patient" },
4322
4324
  { service: "auth", method: "POST", path: "/auth/login", sdkMethod: "auth.login", summary: "Login" },
4323
4325
  { service: "auth", method: "POST", path: "/auth/verify-email", sdkMethod: "auth.verifyEmail", summary: "Verify email OTP" },
4324
- { service: "patient", method: "POST", path: "/patients/{id}/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4325
- { service: "patient", method: "POST", path: "/patients/{id}/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4326
- { service: "patient", method: "PUT", path: "/patients/{id}/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4327
- { service: "patient", method: "PUT", path: "/patients/{id}/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4328
- { service: "patient", method: "GET", path: "/patients/{id}", sdkMethod: "patient.getProfile", summary: "Get patient" },
4329
- { service: "patient", method: "POST", path: "/patients/{id}/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4330
- { service: "patient", method: "GET", path: "/patients/{id}/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4331
- { service: "patient", method: "GET", path: "/patients/{id}/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4332
- { service: "patient", method: "POST", path: "/patients/{id}/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4333
- { service: "patient", method: "POST", path: "/patients/{id}/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4334
- { service: "patient", method: "PUT", path: "/patients/{id}/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4335
- { service: "patient", method: "POST", path: "/patients/{id}/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4336
- { service: "patient", method: "POST", path: "/patients/{id}/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4337
- { service: "patient", method: "GET", path: "/patients/{id}/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4338
- { service: "patient", method: "GET", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4339
- { service: "patient", method: "PUT", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4326
+ { service: "patient", method: "POST", path: "/patients/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4327
+ { service: "patient", method: "POST", path: "/patients/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4328
+ { service: "patient", method: "PUT", path: "/patients/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4329
+ { service: "patient", method: "PUT", path: "/patients/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4330
+ { service: "patient", method: "GET", path: "/patients", sdkMethod: "patient.getProfile", summary: "Get patient" },
4331
+ { service: "patient", method: "POST", path: "/patients/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4332
+ { service: "patient", method: "GET", path: "/patients/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4333
+ { service: "patient", method: "GET", path: "/patients/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4334
+ { service: "patient", method: "POST", path: "/patients/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4335
+ { service: "patient", method: "POST", path: "/patients/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4336
+ { service: "patient", method: "PUT", path: "/patients/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4337
+ { service: "patient", method: "POST", path: "/patients/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4338
+ { service: "patient", method: "POST", path: "/patients/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4339
+ { service: "patient", method: "GET", path: "/patients/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4340
+ { service: "patient", method: "GET", path: "/patients/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4341
+ { service: "patient", method: "PUT", path: "/patients/medications/{med_id}", sdkMethod: "patient.updateMedicationStatus", summary: "Update medication status" },
4340
4342
  { service: "patient", method: "GET", path: "/locations/nearest", sdkMethod: "patient.listNearestLocations", summary: "Nearest clinics/providers" },
4341
4343
  { service: "patient", method: "POST", path: "/encounters", sdkMethod: "patient.createEncounter", summary: "Create encounter" },
4342
4344
  { 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.10.0",
3
+ "version": "2.0.0",
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",