@hipnation-truth/sdk 0.28.0 → 0.30.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/react.d.ts CHANGED
@@ -3008,8 +3008,42 @@ declare const reportSchema: z.ZodObject<{
3008
3008
  }, z.core.$strip>>;
3009
3009
  }, z.core.$strip>>;
3010
3010
  pending: z.ZodBoolean;
3011
+ doctorRoster: z.ZodOptional<z.ZodArray<z.ZodString>>;
3011
3012
  }, z.core.$strip>;
3012
3013
  type MemberActivationReport = z.infer<typeof reportSchema>;
3014
+ declare const memberActivationByDoctorSchema: z.ZodObject<{
3015
+ doctor: z.ZodString;
3016
+ generatedAt: z.ZodNullable<z.ZodString>;
3017
+ employers: z.ZodArray<z.ZodObject<{
3018
+ employerId: z.ZodString;
3019
+ employerName: z.ZodString;
3020
+ counts: z.ZodObject<{
3021
+ outreach: z.ZodNumber;
3022
+ scheduled: z.ZodNumber;
3023
+ review: z.ZodNumber;
3024
+ data: z.ZodNumber;
3025
+ }, z.core.$strip>;
3026
+ members: z.ZodArray<z.ZodObject<{
3027
+ status: z.ZodEnum<{
3028
+ data: "data";
3029
+ activated: "activated";
3030
+ outreach: "outreach";
3031
+ scheduled: "scheduled";
3032
+ review: "review";
3033
+ }>;
3034
+ reason: z.ZodNullable<z.ZodString>;
3035
+ elationId: z.ZodString;
3036
+ name: z.ZodString;
3037
+ doctor: z.ZodNullable<z.ZodString>;
3038
+ membershipStart: z.ZodString;
3039
+ daysSinceMembershipStart: z.ZodNumber;
3040
+ activationDate: z.ZodNullable<z.ZodString>;
3041
+ futureApptDate: z.ZodNullable<z.ZodString>;
3042
+ hasLink: z.ZodBoolean;
3043
+ }, z.core.$strip>>;
3044
+ }, z.core.$strip>>;
3045
+ }, z.core.$strip>;
3046
+ type MemberActivationByDoctor = z.infer<typeof memberActivationByDoctorSchema>;
3013
3047
  declare class ReportsResource {
3014
3048
  private readonly baseUrl;
3015
3049
  private readonly auth;
@@ -3029,6 +3063,17 @@ declare class ReportsResource {
3029
3063
  memberActivation(params?: {
3030
3064
  employerId?: string;
3031
3065
  }): Promise<MemberActivationReport>;
3066
+ /**
3067
+ * Fetches one doctor's non-activated members across every employer from
3068
+ * GET /reports/member-activation/by-doctor. The server matches names
3069
+ * ignoring case, spacing, punctuation and Dr./MD/DO, so "Dr. Marie Curie"
3070
+ * and "Marie Curie, MD" return the same employers. An unknown doctor
3071
+ * returns `employers: []`, not an error. Requires the user JWT (same as
3072
+ * `memberActivation`); throws `ReportsError` on a non-OK response.
3073
+ */
3074
+ memberActivationByDoctor(params: {
3075
+ doctor: string;
3076
+ }): Promise<MemberActivationByDoctor>;
3032
3077
  }
3033
3078
 
3034
3079
  type TaskStatus = "open" | "in_progress" | "resolved" | "cancelled";
package/dist/react.js CHANGED
@@ -2100,7 +2100,30 @@ var reportSchema = import_zod.z.object({
2100
2100
  // True when the requested employer has no materialized report row yet
2101
2101
  // (ehr-sync's dailyHandler has not run for it). `selected` is null in that
2102
2102
  // case — the caller sees the employer roster but no report data to render.
2103
- pending: import_zod.z.boolean()
2103
+ pending: import_zod.z.boolean(),
2104
+ // #249: every distinct doctor across all stored employer reports (deduped
2105
+ // server-side by normalized name). Optional: older servers omit it, and
2106
+ // the server omits it when the roster query fails.
2107
+ doctorRoster: import_zod.z.array(import_zod.z.string()).optional()
2108
+ });
2109
+ var memberActivationByDoctorSchema = import_zod.z.object({
2110
+ doctor: import_zod.z.string(),
2111
+ // Oldest generatedAt of the stored employer reports used; null when no
2112
+ // employer matched.
2113
+ generatedAt: import_zod.z.string().nullable(),
2114
+ employers: import_zod.z.array(
2115
+ import_zod.z.object({
2116
+ employerId: import_zod.z.string(),
2117
+ employerName: import_zod.z.string(),
2118
+ counts: import_zod.z.object({
2119
+ outreach: import_zod.z.number(),
2120
+ scheduled: import_zod.z.number(),
2121
+ review: import_zod.z.number(),
2122
+ data: import_zod.z.number()
2123
+ }),
2124
+ members: import_zod.z.array(memberSchema.omit({ lastName: true, firstName: true }))
2125
+ })
2126
+ )
2104
2127
  });
2105
2128
  var ReportsError = class extends Error {
2106
2129
  /**
@@ -2160,6 +2183,37 @@ var ReportsResource = class {
2160
2183
  return yield res.json();
2161
2184
  });
2162
2185
  }
2186
+ /**
2187
+ * Fetches one doctor's non-activated members across every employer from
2188
+ * GET /reports/member-activation/by-doctor. The server matches names
2189
+ * ignoring case, spacing, punctuation and Dr./MD/DO, so "Dr. Marie Curie"
2190
+ * and "Marie Curie, MD" return the same employers. An unknown doctor
2191
+ * returns `employers: []`, not an error. Requires the user JWT (same as
2192
+ * `memberActivation`); throws `ReportsError` on a non-OK response.
2193
+ */
2194
+ memberActivationByDoctor(params) {
2195
+ return __async(this, null, function* () {
2196
+ const url = new URL(
2197
+ `${this.baseUrl}/api/reports/member-activation/by-doctor`
2198
+ );
2199
+ url.searchParams.set("doctor", params.doctor);
2200
+ const res = yield fetch(url.toString(), {
2201
+ method: "GET",
2202
+ headers: yield buildAuthHeaders(this.auth, {
2203
+ requireUserToken: true
2204
+ })
2205
+ });
2206
+ if (!res.ok) {
2207
+ const text = yield res.text().catch(() => "");
2208
+ throw new ReportsError(
2209
+ "member-activation-by-doctor",
2210
+ res.status,
2211
+ text.slice(0, 200)
2212
+ );
2213
+ }
2214
+ return yield res.json();
2215
+ });
2216
+ }
2163
2217
  };
2164
2218
 
2165
2219
  // src/resources/tasks.ts