@hipnation-truth/sdk 0.3.0 → 0.4.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.d.mts CHANGED
@@ -445,37 +445,20 @@ declare class PatientDetailsResource {
445
445
  get(input: PatientDetailsInput): Promise<PatientDetailsResult>;
446
446
  getBasic(input: PatientDetailsInput): Promise<PatientBasicDetailsResult>;
447
447
  getMedical(elationId: string): Promise<PatientMedicalDetailsResult>;
448
- }
449
-
450
- /**
451
- * PhysiciansResource — Convex-backed physician lookups.
452
- *
453
- * Populated from Elation by Truth's daily PhysiciansBackfillCron. Replaces
454
- * per-physician Elation HTTP hops with a single Convex batch query.
455
- */
456
-
457
- interface Physician {
458
- _id: string;
459
- elationId: number;
460
- firstName?: string;
461
- lastName?: string;
462
- npi?: string;
463
- credentials?: string;
464
- specialties?: string[];
465
- practice?: number;
466
- email?: string;
467
- phone?: string;
468
- lastSyncedAt: string;
469
- }
470
- declare class PhysiciansResource {
471
- private readonly convex;
472
- constructor(convex: ConvexHttpClient);
473
448
  /**
474
- * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
449
+ * Trigger a server-side refresh of the patient's Elation medical
450
+ * records (medications, problems, allergies, appointments) into the
451
+ * Convex cache. Fire-and-forget — the UI should read via the Convex-
452
+ * reactive `usePatientMedical` hook.
475
453
  */
476
- getByElationIds(ids: number[]): Promise<Physician[]>;
477
- getByElationId(id: number): Promise<Physician | null>;
478
- listByPractice(practice: number, limit?: number): Promise<Physician[]>;
454
+ refreshMedical(elationId: number): Promise<{
455
+ totals: {
456
+ medications: number;
457
+ problems: number;
458
+ allergies: number;
459
+ appointments: number;
460
+ };
461
+ }>;
479
462
  }
480
463
 
481
464
  /**
@@ -550,6 +533,37 @@ declare class PatientResource {
550
533
  list(options?: PatientListOptions): Promise<PaginatedResult<Patient>>;
551
534
  }
552
535
 
536
+ /**
537
+ * PhysiciansResource — Convex-backed physician lookups.
538
+ *
539
+ * Populated from Elation by Truth's daily PhysiciansBackfillCron. Replaces
540
+ * per-physician Elation HTTP hops with a single Convex batch query.
541
+ */
542
+
543
+ interface Physician {
544
+ _id: string;
545
+ elationId: number;
546
+ firstName?: string;
547
+ lastName?: string;
548
+ npi?: string;
549
+ credentials?: string;
550
+ specialties?: string[];
551
+ practice?: number;
552
+ email?: string;
553
+ phone?: string;
554
+ lastSyncedAt: string;
555
+ }
556
+ declare class PhysiciansResource {
557
+ private readonly convex;
558
+ constructor(convex: ConvexHttpClient);
559
+ /**
560
+ * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
561
+ */
562
+ getByElationIds(ids: number[]): Promise<Physician[]>;
563
+ getByElationId(id: number): Promise<Physician | null>;
564
+ listByPractice(practice: number, limit?: number): Promise<Physician[]>;
565
+ }
566
+
553
567
  /**
554
568
  * Reminder types — scheduled conversation reminders.
555
569
  */
package/dist/index.d.ts CHANGED
@@ -445,37 +445,20 @@ declare class PatientDetailsResource {
445
445
  get(input: PatientDetailsInput): Promise<PatientDetailsResult>;
446
446
  getBasic(input: PatientDetailsInput): Promise<PatientBasicDetailsResult>;
447
447
  getMedical(elationId: string): Promise<PatientMedicalDetailsResult>;
448
- }
449
-
450
- /**
451
- * PhysiciansResource — Convex-backed physician lookups.
452
- *
453
- * Populated from Elation by Truth's daily PhysiciansBackfillCron. Replaces
454
- * per-physician Elation HTTP hops with a single Convex batch query.
455
- */
456
-
457
- interface Physician {
458
- _id: string;
459
- elationId: number;
460
- firstName?: string;
461
- lastName?: string;
462
- npi?: string;
463
- credentials?: string;
464
- specialties?: string[];
465
- practice?: number;
466
- email?: string;
467
- phone?: string;
468
- lastSyncedAt: string;
469
- }
470
- declare class PhysiciansResource {
471
- private readonly convex;
472
- constructor(convex: ConvexHttpClient);
473
448
  /**
474
- * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
449
+ * Trigger a server-side refresh of the patient's Elation medical
450
+ * records (medications, problems, allergies, appointments) into the
451
+ * Convex cache. Fire-and-forget — the UI should read via the Convex-
452
+ * reactive `usePatientMedical` hook.
475
453
  */
476
- getByElationIds(ids: number[]): Promise<Physician[]>;
477
- getByElationId(id: number): Promise<Physician | null>;
478
- listByPractice(practice: number, limit?: number): Promise<Physician[]>;
454
+ refreshMedical(elationId: number): Promise<{
455
+ totals: {
456
+ medications: number;
457
+ problems: number;
458
+ allergies: number;
459
+ appointments: number;
460
+ };
461
+ }>;
479
462
  }
480
463
 
481
464
  /**
@@ -550,6 +533,37 @@ declare class PatientResource {
550
533
  list(options?: PatientListOptions): Promise<PaginatedResult<Patient>>;
551
534
  }
552
535
 
536
+ /**
537
+ * PhysiciansResource — Convex-backed physician lookups.
538
+ *
539
+ * Populated from Elation by Truth's daily PhysiciansBackfillCron. Replaces
540
+ * per-physician Elation HTTP hops with a single Convex batch query.
541
+ */
542
+
543
+ interface Physician {
544
+ _id: string;
545
+ elationId: number;
546
+ firstName?: string;
547
+ lastName?: string;
548
+ npi?: string;
549
+ credentials?: string;
550
+ specialties?: string[];
551
+ practice?: number;
552
+ email?: string;
553
+ phone?: string;
554
+ lastSyncedAt: string;
555
+ }
556
+ declare class PhysiciansResource {
557
+ private readonly convex;
558
+ constructor(convex: ConvexHttpClient);
559
+ /**
560
+ * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
561
+ */
562
+ getByElationIds(ids: number[]): Promise<Physician[]>;
563
+ getByElationId(id: number): Promise<Physician | null>;
564
+ listByPractice(practice: number, limit?: number): Promise<Physician[]>;
565
+ }
566
+
553
567
  /**
554
568
  * Reminder types — scheduled conversation reminders.
555
569
  */
package/dist/index.js CHANGED
@@ -679,56 +679,15 @@ var PatientDetailsResource = class {
679
679
  );
680
680
  });
681
681
  }
682
- };
683
-
684
- // src/resources/physicians.ts
685
- var PhysiciansResource = class {
686
- constructor(convex) {
687
- this.convex = convex;
688
- }
689
682
  /**
690
- * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
683
+ * Trigger a server-side refresh of the patient's Elation medical
684
+ * records (medications, problems, allergies, appointments) into the
685
+ * Convex cache. Fire-and-forget — the UI should read via the Convex-
686
+ * reactive `usePatientMedical` hook.
691
687
  */
692
- getByElationIds(ids) {
693
- return __async(this, null, function* () {
694
- if (ids.length === 0) {
695
- return [];
696
- }
697
- try {
698
- const rows = yield this.convex.query(
699
- "physicians:getByElationIds",
700
- { ids }
701
- );
702
- return rows != null ? rows : [];
703
- } catch (e) {
704
- return [];
705
- }
706
- });
707
- }
708
- getByElationId(id) {
688
+ refreshMedical(elationId) {
709
689
  return __async(this, null, function* () {
710
- try {
711
- const row = yield this.convex.query(
712
- "physicians:getByElationId",
713
- { id }
714
- );
715
- return row != null ? row : null;
716
- } catch (e) {
717
- return null;
718
- }
719
- });
720
- }
721
- listByPractice(practice, limit) {
722
- return __async(this, null, function* () {
723
- try {
724
- const rows = yield this.convex.query(
725
- "physicians:listByPractice",
726
- { practice, limit }
727
- );
728
- return rows != null ? rows : [];
729
- } catch (e) {
730
- return [];
731
- }
690
+ return yield this.post("/patients/medical/refresh", { elationId });
732
691
  });
733
692
  }
734
693
  };
@@ -813,6 +772,58 @@ var PatientResource = class {
813
772
  }
814
773
  };
815
774
 
775
+ // src/resources/physicians.ts
776
+ var PhysiciansResource = class {
777
+ constructor(convex) {
778
+ this.convex = convex;
779
+ }
780
+ /**
781
+ * Resolve a batch of physicians by Elation IDs. Missing ids are dropped.
782
+ */
783
+ getByElationIds(ids) {
784
+ return __async(this, null, function* () {
785
+ if (ids.length === 0) {
786
+ return [];
787
+ }
788
+ try {
789
+ const rows = yield this.convex.query(
790
+ "physicians:getByElationIds",
791
+ { ids }
792
+ );
793
+ return rows != null ? rows : [];
794
+ } catch (e) {
795
+ return [];
796
+ }
797
+ });
798
+ }
799
+ getByElationId(id) {
800
+ return __async(this, null, function* () {
801
+ try {
802
+ const row = yield this.convex.query(
803
+ "physicians:getByElationId",
804
+ { id }
805
+ );
806
+ return row != null ? row : null;
807
+ } catch (e) {
808
+ return null;
809
+ }
810
+ });
811
+ }
812
+ listByPractice(practice, limit) {
813
+ return __async(this, null, function* () {
814
+ try {
815
+ const rows = yield this.convex.query(
816
+ "physicians:listByPractice",
817
+ { practice, limit }
818
+ );
819
+ return rows != null ? rows : [];
820
+ } catch (e) {
821
+ return [];
822
+ }
823
+ });
824
+ }
825
+ };
826
+
816
827
  // src/resources/reminders.ts
817
828
  var RemindersResource = class {
818
829
  constructor(convexClient) {