@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/README.md CHANGED
@@ -78,8 +78,10 @@ await sdk.auth.login({
78
78
  ```
79
79
 
80
80
  ```ts
81
- // 4. All subsequent calls use the token automatically
82
- const patient = await sdk.patient.getProfile("patient-id");
81
+ // 4. All subsequent calls use the token automatically. getProfile() is
82
+ // self-service — it always returns the authenticated patient, resolved
83
+ // server-side from the token, so no id is passed here.
84
+ const patient = await sdk.patient.getProfile();
83
85
  ```
84
86
 
85
87
  ---
@@ -599,10 +601,19 @@ const authResponse = await sdk.auth.login({
599
601
 
600
602
  ## Patient
601
603
 
604
+ All methods below are **self-service**: the authenticated patient is
605
+ resolved server-side from the caller's PATIENT-pool Bearer token, so none of
606
+ them take a patient id argument — the SDK never lets a client supply one.
607
+ (`sdk.diagnostics`, documented separately, is different: every method there
608
+ still takes an explicit `patientId` since providers and field agents
609
+ legitimately act on patients other than themselves; when the caller holds a
610
+ PATIENT-pool token, the backend now enforces server-side that `patientId`
611
+ must be their own, 403 otherwise.)
612
+
602
613
  ### Profile, phone, address, race, demographics
603
614
 
604
615
  ```ts
605
- const profile = await sdk.patient.getProfile("patient-id");
616
+ const profile = await sdk.patient.getProfile();
606
617
  ```
607
618
 
608
619
  ```json
@@ -625,7 +636,7 @@ const profile = await sdk.patient.getProfile("patient-id");
625
636
 
626
637
  ```ts
627
638
  // Dashboard snapshot
628
- const dashboard = await sdk.patient.getDashboard("patient-id");
639
+ const dashboard = await sdk.patient.getDashboard();
629
640
  ```
630
641
 
631
642
  ```json
@@ -642,7 +653,7 @@ const dashboard = await sdk.patient.getDashboard("patient-id");
642
653
 
643
654
  ```ts
644
655
  // Update phone (triggers SMS OTP)
645
- await sdk.patient.updatePhone("patient-id", { phone: "+15550001234" });
656
+ await sdk.patient.updatePhone({ phone: "+15550001234" });
646
657
  ```
647
658
 
648
659
  ```json
@@ -651,7 +662,7 @@ await sdk.patient.updatePhone("patient-id", { phone: "+15550001234" });
651
662
 
652
663
  ```ts
653
664
  // Verify SMS OTP
654
- await sdk.patient.verifySms("patient-id", { otp: "654321" });
665
+ await sdk.patient.verifySms({ otp: "654321" });
655
666
  ```
656
667
 
657
668
  ```json
@@ -660,7 +671,7 @@ await sdk.patient.verifySms("patient-id", { otp: "654321" });
660
671
 
661
672
  ```ts
662
673
  // Update address
663
- await sdk.patient.updateAddress("patient-id", {
674
+ await sdk.patient.updateAddress({
664
675
  street: "123 Main St",
665
676
  city: "San Francisco",
666
677
  state: "CA",
@@ -674,16 +685,36 @@ await sdk.patient.updateAddress("patient-id", {
674
685
 
675
686
  ```ts
676
687
  // Update race
677
- await sdk.patient.updateRace("patient-id", { races: ["white"] });
688
+ await sdk.patient.updateRace({ races: ["white"] });
678
689
  ```
679
690
 
680
691
  ```json
681
692
  { "updated": true }
682
693
  ```
683
694
 
695
+ ```ts
696
+ // Get the authenticated patient's boolean feature/state flags — {} if none are set
697
+ const flags = await sdk.patient.getFlags();
698
+ ```
699
+
700
+ ```json
701
+ { "imported_vitals": true }
702
+ ```
703
+
704
+ ```ts
705
+ // Update flags — a partial merge, not a replace: only the flags named here
706
+ // change, every other existing flag is left unchanged. Idempotent. Returns
707
+ // the complete flags dictionary after the merge.
708
+ await sdk.patient.updateFlags({ onboarding_completed: true });
709
+ ```
710
+
711
+ ```json
712
+ { "imported_vitals": true, "onboarding_completed": true }
713
+ ```
714
+
684
715
  ```ts
685
716
  // Update demographics — partial update, all fields optional
686
- await sdk.patient.updateDemographics("patient-id", {
717
+ await sdk.patient.updateDemographics({
687
718
  date_of_birth: "1990-06-15",
688
719
  sex_at_birth: "female", // 'male' | 'female' | 'intersex' | 'unknown'
689
720
  gender_identity: "woman",
@@ -702,7 +733,7 @@ await sdk.patient.updateDemographics("patient-id", {
702
733
  ### Photo, face match, ID document OCR
703
734
 
704
735
  ```ts
705
- const uploadUrl = await sdk.patient.getPhotoUploadUrl("patient-id");
736
+ const uploadUrl = await sdk.patient.getPhotoUploadUrl();
706
737
  ```
707
738
 
708
739
  ```json
@@ -710,7 +741,7 @@ const uploadUrl = await sdk.patient.getPhotoUploadUrl("patient-id");
710
741
  ```
711
742
 
712
743
  ```ts
713
- await sdk.patient.uploadPhoto("patient-id", {
744
+ await sdk.patient.uploadPhoto({
714
745
  data: "base64-image-data",
715
746
  content_type: "image/jpeg",
716
747
  });
@@ -721,10 +752,10 @@ await sdk.patient.uploadPhoto("patient-id", {
721
752
  ```
722
753
 
723
754
  ```ts
724
- const photo = await sdk.patient.getPhoto("patient-id", { binary_id: "binary-id" });
755
+ const photo = await sdk.patient.getPhoto({ binary_id: "binary-id" });
725
756
 
726
757
  // Face match (Rekognition CompareFaces against a stored FHIR Binary)
727
- await sdk.patient.compareFaceMatch("patient-id", {
758
+ await sdk.patient.compareFaceMatch({
728
759
  selfie_data: "base64-selfie-data",
729
760
  reference_binary_id: "binary-id",
730
761
  similarity_threshold: 80.0, // optional, defaults to 80.0
@@ -742,7 +773,7 @@ await sdk.patient.compareFaceMatch("patient-id", {
742
773
 
743
774
  ```ts
744
775
  // OCR identity document (Textract AnalyzeID)
745
- await sdk.patient.scanIdentityDocument("patient-id", {
776
+ await sdk.patient.scanIdentityDocument({
746
777
  document_data: "base64-document-data",
747
778
  verify_against_demographics: true, // compares extracted name+DOB to the patient's FHIR record
748
779
  });
@@ -761,7 +792,7 @@ await sdk.patient.scanIdentityDocument("patient-id", {
761
792
  ### Insurance
762
793
 
763
794
  ```ts
764
- await sdk.patient.createInsurance("patient-id", {
795
+ await sdk.patient.createInsurance({
765
796
  priority: "primary", // 'primary' | 'secondary' | 'tertiary'
766
797
  payer_name: "Blue Cross Blue Shield",
767
798
  member_id: "M001",
@@ -790,7 +821,7 @@ response, so it's typed as `InsuranceEligibilityResponse` (`JsonValue`).
790
821
 
791
822
  ```ts
792
823
  // List the patient's stored insurances
793
- const insurances = await sdk.patient.listPatientInsurances("patient-id");
824
+ const insurances = await sdk.patient.listPatientInsurances();
794
825
  ```
795
826
 
796
827
  ### Records, import, pharmacy, dependents, notifications
@@ -801,11 +832,11 @@ stabilized, so responses are not yet generated models. The methods are:
801
832
 
802
833
  | Area | Methods | Routes |
803
834
  |---|---|---|
804
- | Health-record / CCDA import | `importHealthRecord`, `importCCDA` | `POST /patients/{id}/health-record/import` |
805
- | Vitals / activity import | `importVitals`, `importActivity`, `listActivity`, `deleteActivity` | `/patients/{id}/vitals/import`, `/patients/{id}/activity*` |
806
- | Preferred pharmacy | `getPreferredPharmacy`, `setPreferredPharmacy` | `GET|PUT /patients/{id}/preferred-pharmacy` |
807
- | Dependents | `listDependents`, `saveDependent`, `deleteDependent` | `/patients/{id}/dependents*` |
808
- | Notifications | `listNotifications`, `saveNotification`, `deleteNotification` | `/patients/{id}/notifications*` |
835
+ | Health-record / CCDA import | `importHealthRecord`, `importCCDA` | `POST /patients/health-record/import` |
836
+ | Vitals / activity import | `importVitals`, `importActivity`, `listActivity`, `deleteActivity` | `/patients/vitals/import`, `/patients/activity*` |
837
+ | Preferred pharmacy | `getPreferredPharmacy`, `setPreferredPharmacy` | `GET|PUT /patients/preferred-pharmacy` |
838
+ | Dependents | `listDependents`, `saveDependent`, `deleteDependent` | `/patients/dependents*` |
839
+ | Notifications | `listNotifications`, `saveNotification`, `deleteNotification` | `/patients/notifications*` |
809
840
  | Agent configuration | `getAgentConfiguration`, `getAgent` | `GET /agentconfiguration`, `GET /agent` |
810
841
  | Care session / check-in / sidebar | `getCheckin`, `getCurrentCareSession`, `getPatientSidebar` | `GET /checkin`, `GET /care-sessions/current`, `GET /patient/sidebar` |
811
842
  | Current screening symptoms | `createCurrentScreeningSymptoms` | `POST /screenings/current/symptoms` |
@@ -827,7 +858,7 @@ every_8_hours, every_12_hours, every_48_hours, weekly, biweekly, monthly,
827
858
  as_needed, other`.
828
859
 
829
860
  ```ts
830
- await sdk.patient.createMedication("patient-id", {
861
+ await sdk.patient.createMedication({
831
862
  name: "Amoxicillin",
832
863
  route: "oral",
833
864
  dosage: { value: 500, unit: "mg", frequency: "twice_daily" },
@@ -849,7 +880,7 @@ await sdk.patient.createMedication("patient-id", {
849
880
  ```
850
881
 
851
882
  ```ts
852
- const meds = await sdk.patient.listMedications("patient-id");
883
+ const meds = await sdk.patient.listMedications();
853
884
  // optional: { resource_type: "MedicationRequest" | "MedicationStatement" }
854
885
  ```
855
886
 
@@ -858,10 +889,10 @@ const meds = await sdk.patient.listMedications("patient-id");
858
889
  ```
859
890
 
860
891
  ```ts
861
- const med = await sdk.patient.getMedication("patient-id", "med-id");
892
+ const med = await sdk.patient.getMedication("med-id");
862
893
  // → a single MedicationResponse
863
894
 
864
- await sdk.patient.updateMedicationStatus("patient-id", "med-id", {
895
+ await sdk.patient.updateMedicationStatus("med-id", {
865
896
  status: "completed",
866
897
  notes: "course finished",
867
898
  });
@@ -1369,6 +1400,15 @@ const vitals = await sdk.vitals.list("patient-id");
1369
1400
 
1370
1401
  ## Diagnostics
1371
1402
 
1403
+ Every method takes an explicit `patientId` — unlike `sdk.patient`, this
1404
+ group is not self-service, since providers and field agents legitimately
1405
+ look up or record diagnostics for a patient other than themselves (e.g.
1406
+ `createRapidTest`, used to record a test performed for a patient). When the
1407
+ caller holds a PATIENT-pool token, the backend enforces server-side that
1408
+ `patientId` must be their own FHIR id — passing another patient's id returns
1409
+ `403`, so patient A can never read or write patient B's diagnostics.
1410
+ Provider/field-agent callers are unrestricted.
1411
+
1372
1412
  ```ts
1373
1413
  // Create rapid test result
1374
1414
  await sdk.diagnostics.createRapidTest("patient-id", {
@@ -1521,11 +1561,13 @@ const handshake = await sdk.mcp.patient<Record<string, never>, McpInitializeResu
1521
1561
  ```
1522
1562
 
1523
1563
  ```ts
1564
+ // get_patient is self-service — no patient_id argument; the patient is
1565
+ // resolved server-side from whichever Bearer token this SDK instance holds.
1524
1566
  const result = await sdk.mcp.patient<{ name: string; arguments: Record<string, unknown> }, McpToolCallResult>({
1525
1567
  jsonrpc: "2.0",
1526
1568
  id: 3,
1527
1569
  method: "tools/call",
1528
- params: { name: "get_patient", arguments: { patient_id: fhirPatientId } },
1570
+ params: { name: "get_patient", arguments: {} },
1529
1571
  });
1530
1572
  ```
1531
1573
 
@@ -1605,7 +1647,7 @@ All non-2xx responses and network failures are normalized into `SDKError`:
1605
1647
  import { SDKError } from "@healthcloudai/hc-sdk";
1606
1648
 
1607
1649
  try {
1608
- await sdk.patient.getProfile("patient-id");
1650
+ await sdk.patient.getProfile();
1609
1651
  } catch (error) {
1610
1652
  if (error instanceof SDKError) {
1611
1653
  console.log(error.statusCode); // HTTP status; 0 for network errors
@@ -1637,25 +1679,27 @@ import { HCSDK, SDKError, type PatientResponse } from "@healthcloudai/hc-sdk";
1637
1679
 
1638
1680
  const sdk = new HCSDK({ environment: "dev", tenantId: "eclinicapi" });
1639
1681
 
1640
- export function usePatientProfile(patientId: string) {
1682
+ export function useOwnPatientProfile() {
1641
1683
  const [data, setData] = useState<PatientResponse | null>(null);
1642
1684
  const [loading, setLoading] = useState(true);
1643
1685
  const [error, setError] = useState<SDKError | null>(null);
1644
1686
 
1645
1687
  useEffect(() => {
1646
- sdk.patient.getProfile(patientId)
1688
+ // Self-service: getProfile() always resolves the currently authenticated
1689
+ // patient (from the SDK's Bearer token) — there is no patient id to pass.
1690
+ sdk.patient.getProfile()
1647
1691
  .then(setData)
1648
1692
  .catch((err: unknown) => {
1649
1693
  if (err instanceof SDKError) setError(err);
1650
1694
  })
1651
1695
  .finally(() => setLoading(false));
1652
- }, [patientId]);
1696
+ }, []);
1653
1697
 
1654
1698
  return { data, loading, error };
1655
1699
  }
1656
1700
 
1657
- export function PatientProfile({ patientId }: { patientId: string }) {
1658
- const { data, loading, error } = usePatientProfile(patientId);
1701
+ export function PatientProfile() {
1702
+ const { data, loading, error } = useOwnPatientProfile();
1659
1703
  if (loading) return <ActivityIndicator />;
1660
1704
  if (error) return <Text>Error {error.statusCode}: {error.message}</Text>;
1661
1705
  return <View><Text>{JSON.stringify(data)}</Text></View>;
package/dist/index.cjs CHANGED
@@ -681,40 +681,69 @@ 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
- getProfile(fhirPatientId) {
709
- return this.send("GET", "/patients/{id}", {
710
- pathParams: { id: fhirPatientId }
711
- });
708
+ /**
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.
714
+ *
715
+ * @returns The complete flags dictionary; `{}` if the patient has no flags set.
716
+ */
717
+ getFlags() {
718
+ return this.send("GET", "/patients/flags", {});
712
719
  }
713
- getDashboard(fhirPatientId) {
714
- return this.send("GET", "/patients/{id}/dashboard", {
715
- pathParams: { id: fhirPatientId }
720
+ /**
721
+ * Partially update the authenticated patient's boolean flags dictionary.
722
+ * PATCH /patients/flags
723
+ *
724
+ * This is a merge, not a replace: only the flag names present in `request`
725
+ * are changed, every other existing flag is left unchanged. Setting the
726
+ * same value again is idempotent. Returns the complete flags dictionary
727
+ * after the merge.
728
+ *
729
+ * Self-service: the patient is resolved from the caller's Bearer token —
730
+ * there is no patient id parameter.
731
+ *
732
+ * @param request - One or more `{ flagName: boolean }` entries to merge in
733
+ */
734
+ updateFlags(request) {
735
+ return this.send("PATCH", "/patients/flags", {
736
+ body: request
716
737
  });
717
738
  }
739
+ /** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
740
+ getProfile() {
741
+ return this.send("GET", "/patients", {});
742
+ }
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", {});
746
+ }
718
747
  getAgentConfiguration() {
719
748
  return this.send("GET", "/agentconfiguration", {});
720
749
  }
@@ -735,68 +764,55 @@ var PatientClient = class extends BaseServiceClient {
735
764
  body: request
736
765
  });
737
766
  }
738
- uploadPhoto(fhirPatientId, request) {
739
- return this.send("POST", "/patients/{id}/photo", {
740
- pathParams: { id: fhirPatientId },
767
+ uploadPhoto(request) {
768
+ return this.send("POST", "/patients/photo", {
741
769
  body: request
742
770
  });
743
771
  }
744
772
  /**
745
- * Get a patient's photo by binary_id, or the stored photo if binary_id is omitted.
746
- * 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=...
747
775
  *
748
- * @param fhirPatientId - The FHIR Patient ID
749
776
  * @param query - Optional query parameters; if omitted, fetches the stored/default photo
750
777
  */
751
- getPhoto(fhirPatientId, query) {
752
- return this.send("GET", "/patients/{id}/photo", {
753
- pathParams: { id: fhirPatientId },
778
+ getPhoto(query) {
779
+ return this.send("GET", "/patients/photo", {
754
780
  query
755
781
  });
756
782
  }
757
- getPhotoUploadUrl(fhirPatientId) {
758
- return this.send("GET", "/patients/{id}/photo/upload-url", {
759
- pathParams: { id: fhirPatientId }
760
- });
783
+ getPhotoUploadUrl() {
784
+ return this.send("GET", "/patients/photo/upload-url", {});
761
785
  }
762
- compareFaceMatch(fhirPatientId, request) {
763
- return this.send("POST", "/patients/{id}/face-match", {
764
- pathParams: { id: fhirPatientId },
786
+ compareFaceMatch(request) {
787
+ return this.send("POST", "/patients/face-match", {
765
788
  body: request
766
789
  });
767
790
  }
768
- scanIdentityDocument(fhirPatientId, request) {
769
- return this.send("POST", "/patients/{id}/identity-document", {
770
- pathParams: { id: fhirPatientId },
791
+ scanIdentityDocument(request) {
792
+ return this.send("POST", "/patients/identity-document", {
771
793
  body: request
772
794
  });
773
795
  }
774
- updateDemographics(fhirPatientId, request) {
775
- return this.send("PUT", "/patients/{id}/demographics", {
776
- pathParams: { id: fhirPatientId },
796
+ updateDemographics(request) {
797
+ return this.send("PUT", "/patients/demographics", {
777
798
  body: request
778
799
  });
779
800
  }
780
- createInsurance(fhirPatientId, request) {
781
- return this.send("POST", "/patients/{id}/insurance", {
782
- pathParams: { id: fhirPatientId },
801
+ createInsurance(request) {
802
+ return this.send("POST", "/patients/insurance", {
783
803
  body: request
784
804
  });
785
805
  }
786
- listPatientInsurances(fhirPatientId) {
787
- return this.send("GET", "/patients/{id}/insurance", {
788
- pathParams: { id: fhirPatientId }
789
- });
806
+ listPatientInsurances() {
807
+ return this.send("GET", "/patients/insurance", {});
790
808
  }
791
- importHealthRecord(fhirPatientId, payload) {
792
- return this.send("POST", "/patients/{id}/health-record/import", {
793
- pathParams: { id: fhirPatientId },
809
+ importHealthRecord(payload) {
810
+ return this.send("POST", "/patients/health-record/import", {
794
811
  body: payload
795
812
  });
796
813
  }
797
- importCCDA(fhirPatientId, content) {
798
- return this.send("POST", "/patients/{id}/health-record/import", {
799
- pathParams: { id: fhirPatientId },
814
+ importCCDA(content) {
815
+ return this.send("POST", "/patients/health-record/import", {
800
816
  body: {
801
817
  resourceType: "Binary",
802
818
  contentType: "text/xml",
@@ -804,104 +820,90 @@ var PatientClient = class extends BaseServiceClient {
804
820
  }
805
821
  });
806
822
  }
807
- importVitals(fhirPatientId, source, payload) {
808
- return this.send("POST", "/patients/{id}/vitals/import", {
809
- pathParams: { id: fhirPatientId },
823
+ importVitals(source, payload) {
824
+ return this.send("POST", "/patients/vitals/import", {
810
825
  body: { source, payload }
811
826
  });
812
827
  }
813
- importActivity(fhirPatientId, source, payload) {
814
- return this.send("POST", "/patients/{id}/activity/import", {
815
- pathParams: { id: fhirPatientId },
828
+ importActivity(source, payload) {
829
+ return this.send("POST", "/patients/activity/import", {
816
830
  body: { source, payload }
817
831
  });
818
832
  }
819
- listActivity(fhirPatientId, type) {
820
- return this.send("GET", "/patients/{id}/activity", {
821
- pathParams: { id: fhirPatientId },
833
+ listActivity(type) {
834
+ return this.send("GET", "/patients/activity", {
822
835
  query: type ? { type } : void 0
823
836
  });
824
837
  }
825
- deleteActivity(fhirPatientId, activityId) {
826
- return this.send("DELETE", "/patients/{id}/activity/{activity_id}", {
827
- pathParams: { id: fhirPatientId, activity_id: activityId }
838
+ deleteActivity(activityId) {
839
+ return this.send("DELETE", "/patients/activity/{activity_id}", {
840
+ pathParams: { activity_id: activityId }
828
841
  });
829
842
  }
830
- getPreferredPharmacy(fhirPatientId) {
831
- return this.send("GET", "/patients/{id}/preferred-pharmacy", {
832
- pathParams: { id: fhirPatientId }
833
- });
843
+ getPreferredPharmacy() {
844
+ return this.send("GET", "/patients/preferred-pharmacy", {});
834
845
  }
835
- setPreferredPharmacy(fhirPatientId, data) {
836
- return this.send("PUT", "/patients/{id}/preferred-pharmacy", {
837
- pathParams: { id: fhirPatientId },
846
+ setPreferredPharmacy(data) {
847
+ return this.send("PUT", "/patients/preferred-pharmacy", {
838
848
  body: data
839
849
  });
840
850
  }
841
- listDependents(fhirPatientId) {
842
- return this.send("GET", "/patients/{id}/dependents", {
843
- pathParams: { id: fhirPatientId }
844
- });
851
+ listDependents() {
852
+ return this.send("GET", "/patients/dependents", {});
845
853
  }
846
- saveDependent(fhirPatientId, data, dependentId) {
854
+ saveDependent(data, dependentId) {
847
855
  if (dependentId) {
848
- return this.send("PUT", "/patients/{id}/dependents/{dependent_id}", {
849
- pathParams: { id: fhirPatientId, dependent_id: dependentId },
856
+ return this.send("PUT", "/patients/dependents/{dependent_id}", {
857
+ pathParams: { dependent_id: dependentId },
850
858
  body: data
851
859
  });
852
860
  }
853
- return this.send("POST", "/patients/{id}/dependents", {
854
- pathParams: { id: fhirPatientId },
861
+ return this.send("POST", "/patients/dependents", {
855
862
  body: data
856
863
  });
857
864
  }
858
- deleteDependent(fhirPatientId, dependentId) {
859
- return this.send("DELETE", "/patients/{id}/dependents/{dependent_id}", {
860
- pathParams: { id: fhirPatientId, dependent_id: dependentId }
865
+ deleteDependent(dependentId) {
866
+ return this.send("DELETE", "/patients/dependents/{dependent_id}", {
867
+ pathParams: { dependent_id: dependentId }
861
868
  });
862
869
  }
863
- listNotifications(fhirPatientId) {
864
- return this.send("GET", "/patients/{id}/notifications", {
865
- pathParams: { id: fhirPatientId }
866
- });
870
+ listNotifications() {
871
+ return this.send("GET", "/patients/notifications", {});
867
872
  }
868
- saveNotification(fhirPatientId, data, notificationId) {
873
+ saveNotification(data, notificationId) {
869
874
  if (notificationId) {
870
- return this.send("PUT", "/patients/{id}/notifications/{notification_id}", {
871
- pathParams: { id: fhirPatientId, notification_id: notificationId },
875
+ return this.send("PUT", "/patients/notifications/{notification_id}", {
876
+ pathParams: { notification_id: notificationId },
872
877
  body: data
873
878
  });
874
879
  }
875
- return this.send("POST", "/patients/{id}/notifications", {
876
- pathParams: { id: fhirPatientId },
880
+ return this.send("POST", "/patients/notifications", {
877
881
  body: data
878
882
  });
879
883
  }
880
- deleteNotification(fhirPatientId, notificationId) {
881
- return this.send("DELETE", "/patients/{id}/notifications/{notification_id}", {
882
- pathParams: { id: fhirPatientId, notification_id: notificationId }
884
+ deleteNotification(notificationId) {
885
+ return this.send("DELETE", "/patients/notifications/{notification_id}", {
886
+ pathParams: { notification_id: notificationId }
883
887
  });
884
888
  }
885
- createMedication(fhirPatientId, request) {
886
- return this.send("POST", "/patients/{id}/medications", {
887
- pathParams: { id: fhirPatientId },
889
+ createMedication(request) {
890
+ return this.send("POST", "/patients/medications", {
888
891
  body: request
889
892
  });
890
893
  }
891
- listMedications(fhirPatientId, query) {
892
- return this.send("GET", "/patients/{id}/medications", {
893
- pathParams: { id: fhirPatientId },
894
+ listMedications(query) {
895
+ return this.send("GET", "/patients/medications", {
894
896
  query
895
897
  });
896
898
  }
897
- getMedication(fhirPatientId, medicationId) {
898
- return this.send("GET", "/patients/{id}/medications/{med_id}", {
899
- pathParams: { id: fhirPatientId, med_id: medicationId }
899
+ getMedication(medicationId) {
900
+ return this.send("GET", "/patients/medications/{med_id}", {
901
+ pathParams: { med_id: medicationId }
900
902
  });
901
903
  }
902
- updateMedicationStatus(fhirPatientId, medicationId, request) {
903
- return this.send("PUT", "/patients/{id}/medications/{med_id}", {
904
- pathParams: { id: fhirPatientId, med_id: medicationId },
904
+ updateMedicationStatus(medicationId, request) {
905
+ return this.send("PUT", "/patients/medications/{med_id}", {
906
+ pathParams: { med_id: medicationId },
905
907
  body: request
906
908
  });
907
909
  }
@@ -4393,22 +4395,22 @@ var HCSDK_OPERATION_SUMMARY = [
4393
4395
  { service: "auth", method: "POST", path: "/auth/register", sdkMethod: "auth.register", summary: "Register patient" },
4394
4396
  { service: "auth", method: "POST", path: "/auth/login", sdkMethod: "auth.login", summary: "Login" },
4395
4397
  { service: "auth", method: "POST", path: "/auth/verify-email", sdkMethod: "auth.verifyEmail", summary: "Verify email OTP" },
4396
- { service: "patient", method: "POST", path: "/patients/{id}/phone", sdkMethod: "patient.updatePhone", summary: "Update phone + send SMS OTP" },
4397
- { service: "patient", method: "POST", path: "/patients/{id}/verify-sms", sdkMethod: "patient.verifySms", summary: "Verify SMS OTP" },
4398
- { service: "patient", method: "PUT", path: "/patients/{id}/address", sdkMethod: "patient.updateAddress", summary: "Update address" },
4399
- { service: "patient", method: "PUT", path: "/patients/{id}/race", sdkMethod: "patient.updateRace", summary: "Update race" },
4400
- { service: "patient", method: "GET", path: "/patients/{id}", sdkMethod: "patient.getProfile", summary: "Get patient" },
4401
- { service: "patient", method: "POST", path: "/patients/{id}/photo", sdkMethod: "patient.uploadPhoto", summary: "Upload photo" },
4402
- { service: "patient", method: "GET", path: "/patients/{id}/photo", sdkMethod: "patient.getPhoto", summary: "Get photo" },
4403
- { service: "patient", method: "GET", path: "/patients/{id}/photo/upload-url", sdkMethod: "patient.getPhotoUploadUrl", summary: "Get presigned upload URL" },
4404
- { service: "patient", method: "POST", path: "/patients/{id}/face-match", sdkMethod: "patient.compareFaceMatch", summary: "Compare selfie to stored photo (Rekognition)" },
4405
- { service: "patient", method: "POST", path: "/patients/{id}/identity-document", sdkMethod: "patient.scanIdentityDocument", summary: "OCR identity document (Textract AnalyzeID)" },
4406
- { service: "patient", method: "PUT", path: "/patients/{id}/demographics", sdkMethod: "patient.updateDemographics", summary: "Update demographics (DOB, nationality, etc.)" },
4407
- { service: "patient", method: "POST", path: "/patients/{id}/insurance", sdkMethod: "patient.createInsurance", summary: "Create insurance coverage" },
4408
- { service: "patient", method: "POST", path: "/patients/{id}/medications", sdkMethod: "patient.createMedication", summary: "Create medication order" },
4409
- { service: "patient", method: "GET", path: "/patients/{id}/medications", sdkMethod: "patient.listMedications", summary: "List medications" },
4410
- { service: "patient", method: "GET", path: "/patients/{id}/medications/{med_id}", sdkMethod: "patient.getMedication", summary: "Get medication" },
4411
- { 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" },
4412
4414
  { service: "patient", method: "GET", path: "/locations/nearest", sdkMethod: "patient.listNearestLocations", summary: "Nearest clinics/providers" },
4413
4415
  { service: "patient", method: "POST", path: "/encounters", sdkMethod: "patient.createEncounter", summary: "Create encounter" },
4414
4416
  { service: "patient", method: "GET", path: "/encounters", sdkMethod: "patient.listEncounters", summary: "List encounters" },