@hipnation-truth/sdk 0.29.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/index.mjs CHANGED
@@ -1962,7 +1962,30 @@ var reportSchema = z.object({
1962
1962
  // True when the requested employer has no materialized report row yet
1963
1963
  // (ehr-sync's dailyHandler has not run for it). `selected` is null in that
1964
1964
  // case — the caller sees the employer roster but no report data to render.
1965
- pending: z.boolean()
1965
+ pending: z.boolean(),
1966
+ // #249: every distinct doctor across all stored employer reports (deduped
1967
+ // server-side by normalized name). Optional: older servers omit it, and
1968
+ // the server omits it when the roster query fails.
1969
+ doctorRoster: z.array(z.string()).optional()
1970
+ });
1971
+ var memberActivationByDoctorSchema = z.object({
1972
+ doctor: z.string(),
1973
+ // Oldest generatedAt of the stored employer reports used; null when no
1974
+ // employer matched.
1975
+ generatedAt: z.string().nullable(),
1976
+ employers: z.array(
1977
+ z.object({
1978
+ employerId: z.string(),
1979
+ employerName: z.string(),
1980
+ counts: z.object({
1981
+ outreach: z.number(),
1982
+ scheduled: z.number(),
1983
+ review: z.number(),
1984
+ data: z.number()
1985
+ }),
1986
+ members: z.array(memberSchema.omit({ lastName: true, firstName: true }))
1987
+ })
1988
+ )
1966
1989
  });
1967
1990
  var ReportsError = class extends Error {
1968
1991
  /**
@@ -2022,6 +2045,37 @@ var ReportsResource = class {
2022
2045
  return yield res.json();
2023
2046
  });
2024
2047
  }
2048
+ /**
2049
+ * Fetches one doctor's non-activated members across every employer from
2050
+ * GET /reports/member-activation/by-doctor. The server matches names
2051
+ * ignoring case, spacing, punctuation and Dr./MD/DO, so "Dr. Marie Curie"
2052
+ * and "Marie Curie, MD" return the same employers. An unknown doctor
2053
+ * returns `employers: []`, not an error. Requires the user JWT (same as
2054
+ * `memberActivation`); throws `ReportsError` on a non-OK response.
2055
+ */
2056
+ memberActivationByDoctor(params) {
2057
+ return __async(this, null, function* () {
2058
+ const url = new URL(
2059
+ `${this.baseUrl}/api/reports/member-activation/by-doctor`
2060
+ );
2061
+ url.searchParams.set("doctor", params.doctor);
2062
+ const res = yield fetch(url.toString(), {
2063
+ method: "GET",
2064
+ headers: yield buildAuthHeaders(this.auth, {
2065
+ requireUserToken: true
2066
+ })
2067
+ });
2068
+ if (!res.ok) {
2069
+ const text = yield res.text().catch(() => "");
2070
+ throw new ReportsError(
2071
+ "member-activation-by-doctor",
2072
+ res.status,
2073
+ text.slice(0, 200)
2074
+ );
2075
+ }
2076
+ return yield res.json();
2077
+ });
2078
+ }
2025
2079
  };
2026
2080
 
2027
2081
  // src/resources/tasks.ts