{"version":3,"sources":["../package.json","../../shared/logger.ts","../../scrapers/cookies.ts","../../shared/env.ts","../../shared/hostConcurrency.ts","../../scrapers/http.ts","../../scrapers/myChart/core/myChartRequest.ts","../../scrapers/list-all-mycharts/mychart-instances.json","../../scrapers/list-all-mycharts/directory.ts","../../scrapers/myChart/core/util.ts","../../shared/telemetry.ts","../../scrapers/myChart/auth/termsAndConditions.ts","../../scrapers/myChart/auth/blockedInstances.ts","../../scrapers/myChart/auth/softwareAuthenticator.ts","../../scrapers/myChart/auth/login.ts","../../node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js","../../read-local-passwords/sqlite.ts","../../read-local-passwords/chromium.ts","../../read-local-passwords/der.ts","../../read-local-passwords/firefox.ts","../../read-local-passwords/myChartFilter.ts","../../read-local-passwords/index.ts","../../scrapers/myChart/core/signedOutPage.ts","../../scrapers/myChart/core/sessionRenewal.ts","../../scrapers/myChart/core/sessionStore.ts","../../scrapers/myChart/core/makeAuthenticatedRequest.ts","../../scrapers/myChart/chart/messages/communicationCenterToken.ts","../../shared/detailedError.ts","../../scrapers/myChart/chart/messages/messageUpload.ts","../../scrapers/myChart/chart/messages/sendMessage.ts","../../scrapers/myChart/chart/messages/sendReply.ts","../../scrapers/myChart/core/rawResponse.ts","../../scrapers/myChart/processors/read.ts","../../scrapers/myChart/processors/htmlText.ts","../../scrapers/myChart/chart/messages/conversations.processor.ts","../../scrapers/myChart/chart/messages/conversations.ts","../../scrapers/myChart/chart/profile/profileHtml.ts","../../scrapers/myChart/chart/profile/profile.processor.ts","../../scrapers/myChart/chart/profile/profile.ts","../../scrapers/myChart/proxy/proxyContext.ts","../../scrapers/myChart/auth/totp.ts","../../scrapers/myChart/core/csrf.ts","../../scrapers/myChart/auth/setupTotp.ts","../cli/totpStore.ts","../cli/passkeyStore.ts","../../scrapers/myChart/auth/passkeyLoginRetry.ts","../../scrapers/myChart/auth/silentLogin.ts","../../scrapers/metadata/version.ts","../../scrapers/myChart/processors/markdown.ts","../../scrapers/myChart/processors/processor.ts","../../scrapers/myChart/proxy/proxyTools.ts","../../shared/capabilities/args.ts","../../shared/capabilities/params.ts","../../shared/capabilities/public.ts","../../scrapers/myChart/chart/healthSummary/healthSummary.processor.ts","../../scrapers/myChart/chart/healthSummary/healthSummary.ts","../../scrapers/myChart/chart/medications/medications.processor.ts","../../scrapers/myChart/chart/medications/medications.ts","../../scrapers/myChart/chart/allergies/allergies.processor.ts","../../scrapers/myChart/chart/allergies/allergies.ts","../../scrapers/myChart/chart/healthIssues/healthIssues.processor.ts","../../scrapers/myChart/chart/healthIssues/healthIssues.ts","../../scrapers/myChart/chart/vitals/vitals.processor.ts","../../scrapers/myChart/chart/vitals/vitals.ts","../../scrapers/myChart/chart/immunizations/immunizations.processor.ts","../../scrapers/myChart/chart/immunizations/immunizations.ts","../../scrapers/myChart/chart/preventiveCare/preventiveCare.processor.ts","../../scrapers/myChart/chart/preventiveCare/preventiveCare.ts","../../scrapers/myChart/chart/medicalHistory/medicalHistory.processor.ts","../../scrapers/myChart/chart/medicalHistory/medicalHistory.ts","../../scrapers/myChart/chart/goals/goals.processor.ts","../../scrapers/myChart/chart/goals/goals.ts","../../shared/capabilities/registry/profile.ts","../../scrapers/myChart/chart/notes/notes.processor.ts","../../scrapers/myChart/chart/notes/notes.ts","../../scrapers/myChart/chart/visits/visits.processor.ts","../../scrapers/myChart/chart/visits/visits.ts","../../shared/capabilities/registry/visits.ts","../../scrapers/myChart/eunity/imagingViewer.ts","../../scrapers/myChart/chart/labs/labResults.processor.ts","../../scrapers/myChart/chart/labs/imagingResults.processor.ts","../../scrapers/myChart/chart/labs/labResults.ts","../../shared/amf3Reader.ts","../../scrapers/myChart/clo-image-parser/sortByPatientPosition.ts","../../shared/amf3Writer.ts","../../scrapers/myChart/eunity/imagingDirectDownload.ts","../../shared/capabilities/imaging.ts","../../shared/capabilities/registry/results.ts","../../scrapers/myChart/chart/messages/messageThreads.processor.ts","../../scrapers/myChart/chart/messages/messageThreads.ts","../../scrapers/myChart/core/safeFileName.ts","../../scrapers/myChart/core/dcsDocument.ts","../../scrapers/myChart/chart/messages/messageAttachment.ts","../../scrapers/myChart/chart/messages/recipients.processor.ts","../../scrapers/myChart/chart/messages/recipients.ts","../../scrapers/myChart/chart/messages/deleteMessage.ts","../../shared/resolveUnique.ts","../../shared/capabilities/resolve.ts","../../shared/capabilities/registry/messages.ts","../../shared/epicDate.ts","../../scrapers/myChart/chart/bills/summaryHtml.ts","../../scrapers/myChart/chart/bills/bills.processor.ts","../../scrapers/myChart/chart/bills/bills.ts","../../scrapers/myChart/chart/insurance/insurance.processor.ts","../../scrapers/myChart/chart/insurance/insurance.ts","../../scrapers/myChart/chart/insuranceBenefits/insuranceBenefits.processor.ts","../../scrapers/myChart/chart/insuranceBenefits/insuranceBenefits.ts","../../scrapers/myChart/chart/insurancePayers/insurancePayers.processor.ts","../../scrapers/myChart/chart/insurancePayers/insurancePayers.ts","../../shared/capabilities/registry/billing.ts","../../scrapers/myChart/chart/careTeam/careTeam.processor.ts","../../scrapers/myChart/chart/careTeam/careTeam.ts","../../scrapers/myChart/chart/referrals/referrals.processor.ts","../../scrapers/myChart/chart/referrals/referrals.ts","../../scrapers/myChart/chart/letters/letters.processor.ts","../../scrapers/myChart/chart/letters/letters.ts","../../scrapers/myChart/chart/documents/documents.processor.ts","../../scrapers/myChart/chart/documents/documents.ts","../../scrapers/myChart/chart/documents/documentDownload.ts","../../scrapers/myChart/chart/upcomingOrders/upcomingOrders.processor.ts","../../scrapers/myChart/chart/upcomingOrders/upcomingOrders.ts","../../scrapers/myChart/chart/questionnaires/questionnaires.processor.ts","../../scrapers/myChart/chart/questionnaires/questionnaires.ts","../../scrapers/myChart/chart/careJourneys/careJourneys.processor.ts","../../scrapers/myChart/chart/careJourneys/careJourneys.ts","../../scrapers/myChart/chart/activityFeed/activityFeed.processor.ts","../../scrapers/myChart/chart/activityFeed/activityFeed.ts","../../scrapers/myChart/chart/educationMaterials/educationMaterials.processor.ts","../../scrapers/myChart/chart/educationMaterials/educationMaterials.ts","../../scrapers/myChart/chart/ehiExport/ehiExport.processor.ts","../../scrapers/myChart/chart/ehiExport/ehiExport.ts","../../scrapers/myChart/chart/otherMyCharts/otherMyCharts.processor.ts","../../scrapers/myChart/chart/otherMyCharts/otherMyCharts.ts","../../shared/capabilities/registry/care.ts","../../scrapers/myChart/chart/emergencyContacts/emergencyContacts.processor.ts","../../scrapers/myChart/chart/emergencyContacts/emergencyContacts.ts","../../shared/capabilities/registry/emergencyContacts.ts","../../shared/capabilities/registry/prescriptions.ts","../../shared/capabilities/registry/patients.ts","../../scrapers/myChart/auth/setupPasskey.ts","../../shared/capabilities/registry/accountSecurity.ts","../../scrapers/npi/npiRegistry.processor.ts","../../scrapers/npi/npiRegistry.ts","../../shared/capabilities/registry/providers.ts","../../scrapers/list-all-mycharts/resolveLoginUrl.ts","../../scrapers/list-all-mycharts/refreshDirectory.ts","../../scrapers/list-all-mycharts/searchDirectory.ts","../../shared/capabilities/registry/directory.ts","../../shared/capabilities/index.ts","../../scrapers/myChart/clo-image-parser/clo_to_bitmap.ts","../../scrapers/myChart/clo-image-parser/exporters/png16.ts","../../scrapers/myChart/clo-image-parser/exporters/to_jpg.ts","../../shared/readLocalFile.ts","../cli/capabilityActions.ts","../cli/help.ts","../../scrapers/myChart/prelogin/preloginSession.ts","../../scrapers/myChart/prelogin/guestEstimates.ts","../../scrapers/myChart/prelogin/orgProfile.ts","../../scrapers/myChart/prelogin/providerDirectory.ts","../../scrapers/myChart/prelogin/networkProfile.ts","../../scrapers/myChart/prelogin/schedulingContext.ts","../../scrapers/myChart/prelogin/schedulingQuestionnaire.ts","../../scrapers/myChart/prelogin/openSlots.ts","../../scrapers/myChart/prelogin/index.ts","../cli/cli.ts","../cli/entry.ts"],"sourcesContent":["{\n  \"name\": \"mychart-cli\",\n  \"version\": \"2.2.0\",\n  \"description\": \"Programmatic access to Epic MyChart patient portals: login, scrape every section of a patient's chart, and act on it.\",\n  \"license\": \"SEE LICENSE IN LICENSE\",\n  \"author\": \"Fan Pier Labs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/Fan-Pier-Labs/openrecord.git\",\n    \"directory\": \"npm-package\"\n  },\n  \"homepage\": \"https://github.com/Fan-Pier-Labs/openrecord/tree/main/npm-package\",\n  \"keywords\": [\n    \"mychart\",\n    \"epic\",\n    \"ehr\",\n    \"health\",\n    \"medical-records\",\n    \"patient-portal\",\n    \"scraper\"\n  ],\n  \"engines\": {\n    \"node\": \">=18\"\n  },\n  \"type\": \"module\",\n  \"main\": \"./dist/index.cjs\",\n  \"module\": \"./dist/index.js\",\n  \"types\": \"./dist/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": {\n        \"types\": \"./dist/index.d.ts\",\n        \"default\": \"./dist/index.js\"\n      },\n      \"require\": {\n        \"types\": \"./dist/index.d.cts\",\n        \"default\": \"./dist/index.cjs\"\n      }\n    }\n  },\n  \"bin\": {\n    \"mychart-cli\": \"dist/cli.cjs\"\n  },\n  \"sideEffects\": false,\n  \"files\": [\n    \"dist\",\n    \"README.md\",\n    \"CHANGELOG.md\",\n    \"docs\",\n    \"LICENSE\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsup\",\n    \"dev\": \"tsup --watch\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"test\": \"bun test --isolate .unit.test.ts .integration.test.ts\",\n    \"prepublishOnly\": \"bun run build\",\n    \"check:publish\": \"publint --strict && attw --pack .\"\n  },\n  \"dependencies\": {\n    \"cheerio\": \"^1.2.0\",\n    \"compare-versions\": \"^6.1.1\",\n    \"date-fns\": \"^4.4.0\",\n    \"fzstd\": \"^0.1.1\",\n    \"html-to-text\": \"^10.0.1\",\n    \"jpeg-js\": \"^0.4.4\",\n    \"js-base64\": \"^3.9.3\",\n    \"markdown-table\": \"^3.0.4\",\n    \"sharp\": \"^0.35.3\",\n    \"totp-generator\": \"^2.0.1\",\n    \"tough-cookie\": \"^6.0.2\"\n  },\n  \"devDependencies\": {\n    \"@arethetypeswrong/cli\": \"^0.18.2\",\n    \"@types/html-to-text\": \"^9.0.4\",\n    \"@types/node\": \"^26.2.0\",\n    \"publint\": \"^0.3.14\",\n    \"tsup\": \"^8.5.1\",\n    \"typescript\": \"^6.0.3\"\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Globally-configurable log singleton for the scraper layer.\n *\n * The scrapers emit a steady stream of progress messages — HTTP status,\n * cookie state, parsed login-page diagnostics, etc. These are debug-level\n * information that the consumer (CLI, web app, MCP server, tests) decides\n * how to surface.\n *\n * Default behavior matches what `console.*` would do — debug/info to\n * stdout, warn/error to stderr — so callers that don't configure anything\n * see the same output they always did.\n *\n * Stdio MCP servers MUST configure a sink that never writes to stdout,\n * because the JSON-RPC framing on stdout doesn't tolerate non-JSON text.\n * Example:\n *\n *   import { setLogSink } from '../../shared/logger';\n *   setLogSink((level, args) => console.error(`[${level}]`, ...args));\n *\n * Tests can silence the chatter with `silenceLogger()`.\n */\n\ntype LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\nexport type LogSink = (level: LogLevel, args: unknown[]) => void;\n\nconst defaultSink: LogSink = (level, args) => {\n  // Mirror console.* defaults: debug/info → stdout, warn/error → stderr.\n  if (level === 'warn') console.warn(...args);\n  else if (level === 'error') console.error(...args);\n  else console.log(...args);\n};\n\nlet activeSink: LogSink = defaultSink;\n\nexport const logger = {\n  debug(...args: unknown[]): void { activeSink('debug', args); },\n  info(...args: unknown[]): void  { activeSink('info', args);  },\n  warn(...args: unknown[]): void  { activeSink('warn', args);  },\n  error(...args: unknown[]): void { activeSink('error', args); },\n};\n\n/**\n * Replace the sink that receives every logger.* call. Pass a custom\n * function to filter, format, redirect, or drop messages.\n */\nexport function setLogSink(sink: LogSink): void {\n  activeSink = sink;\n}\n\n/** Restore the default console-based sink. */\nexport function resetLogSink(): void {\n  activeSink = defaultSink;\n}\n\n/** Drop every log message. Useful in tests. */\nexport function silenceLogger(): void {\n  activeSink = () => { /* no-op */ };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Wiring a tough-cookie jar to a fetch `Response`.\n *\n * **Why tough-cookie doesn't do this for us:** it is a cookie *store*, not an\n * HTTP client. It parses and serializes cookie strings and decides which ones\n * match a URL, but it never sees a request or a response — that's deliberate,\n * so it can back node-fetch, axios, a browser shim or us. Pulling the strings\n * out of a `Response` and handing them over is the caller's half of the\n * contract, and this file is that half.\n *\n * Only `scrapers/http.ts` should call these.\n */\n\nimport type { CookieJar } from 'tough-cookie';\n\n/**\n * The `Cookie` header to send with a request, or null when the jar has nothing\n * for this URL. Domain, path, secure and expiry matching are the jar's job.\n */\nexport async function cookieHeaderFor(jar: CookieJar, url: string): Promise<string | null> {\n  const cookieString = await jar.getCookieString(url);\n  return cookieString || null;\n}\n\n/**\n * Read every `Set-Cookie` off a response into the jar.\n *\n * Two paths because the runtimes disagree. Node/undici and Bun expose\n * `Headers.getSetCookie()`, which keeps the headers as separate strings.\n * React Native's `Headers` (RN 0.86 still ships the whatwg-fetch shim) has no\n * such method and folds them into one comma-joined string — so they have to be\n * split back apart on the commas that separate cookies rather than the ones\n * inside an `Expires=Wed, 09 Jun 2027 …` date. Looking ahead for a `name=` is\n * what tells those apart.\n *\n * The React Native path is live code, not defensive plumbing: the eUnity\n * imaging scraper runs on device and carries its own jar.\n */\nexport async function storeSetCookies(jar: CookieJar, url: string, response: Response): Promise<void> {\n  const headers = response.headers as unknown as { getSetCookie?: () => string[] };\n\n  let setCookies: string[];\n  if (typeof headers.getSetCookie === 'function') {\n    setCookies = headers.getSetCookie();\n  } else {\n    const raw = response.headers.get('set-cookie');\n    setCookies = raw ? raw.split(/,\\s*(?=[A-Za-z0-9_-]+=)/) : [];\n  }\n\n  for (const cookieStr of setCookies) {\n    try {\n      await jar.setCookie(cookieStr.trim(), url);\n    } catch {\n      // A cookie we can't parse is one we can't send back. Dropping it beats\n      // failing a request that would otherwise have worked.\n    }\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * How many requests may be in flight to a single MyChart host at once.\n *\n * Ten is comfortably below what a browser opens against one origin (six for\n * HTTP/1.1, more over HTTP/2) while still letting a full 30-category scrape\n * finish quickly. Raise it only with evidence that a given instance tolerates\n * more — the cost of guessing high is the whole deployment's egress IP getting\n * blocked for every user at once.\n *\n * Override with MYCHART_MAX_CONCURRENT_REQUESTS_PER_HOST. Anything that isn't\n * a positive integer falls back to the default rather than silently disabling\n * the limit.\n */\nexport const DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST = 10;\n\nfunction parseMaxConcurrency(raw: string | undefined): number {\n  if (raw === undefined) return DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST;\n  const parsed = Number(raw);\n  if (!Number.isInteger(parsed) || parsed < 1) {\n    return DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST;\n  }\n  return parsed;\n}\n\nexport const MAX_CONCURRENT_REQUESTS_PER_HOST = parseMaxConcurrency(\n  process.env.MYCHART_MAX_CONCURRENT_REQUESTS_PER_HOST,\n);\n\n/** Exported for tests — the parsing rule above, without the process.env read. */\nexport const __parseMaxConcurrencyForTest = parseMaxConcurrency;\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Per-host concurrency limiting for outbound scraper requests.\n *\n * A single \"scrape everything\" run fans out ~30 scrapers at once, each making\n * two or more requests, all aimed at one hospital's MyChart. On the hosted web\n * app every user shares one egress IP, so those bursts stack across users and\n * look exactly like an attack to whatever sits in front of the portal. Gating\n * requests per hostname keeps a burst to a steady trickle without any caller\n * having to know it is being throttled.\n *\n * The limit is per *host*, not per session or per user: the thing being\n * protected is the far end, and it counts connections, not accounts.\n *\n * Permits are handed out first-come-first-served. A waiter is resolved by the\n * releasing request handing its permit straight over rather than releasing it\n * and letting the queue race for it, so a saturated host can't starve an early\n * arrival.\n */\n\nimport { logger } from './logger';\nimport { MAX_CONCURRENT_REQUESTS_PER_HOST } from './env';\n\n/** Counting semaphore with a FIFO wait queue. */\nclass HostSemaphore {\n  /** Permits currently held by in-flight requests. */\n  private active = 0;\n\n  /** Resolvers for callers waiting on a permit, oldest first. */\n  private readonly waiters: Array<() => void> = [];\n\n  constructor(readonly limit: number) {}\n\n  get inFlight(): number {\n    return this.active;\n  }\n\n  get queued(): number {\n    return this.waiters.length;\n  }\n\n  /** Resolves once a permit is held. Every acquire must be paired with a release. */\n  acquire(): Promise<void> {\n    if (this.active < this.limit) {\n      this.active += 1;\n      return Promise.resolve();\n    }\n    return new Promise<void>((resolve) => {\n      this.waiters.push(resolve);\n    });\n  }\n\n  release(): void {\n    const next = this.waiters.shift();\n    if (next) {\n      // Hand the permit directly to the next waiter. `active` deliberately\n      // stays where it is — the permit moved, it wasn't given back.\n      next();\n    } else {\n      this.active -= 1;\n    }\n  }\n}\n\n/**\n * Next.js bundles each API route separately, so a plain module-level Map would\n * give every route its own set of limiters and the cap would mean nothing in\n * the one place it matters most. Same reasoning as the session store.\n */\nconst globalKey = '__mychart_host_limiters__' as const;\n\nfunction registry(): Map<string, HostSemaphore> {\n  const g = globalThis as unknown as Record<string, Map<string, HostSemaphore> | undefined>;\n  const existing = g[globalKey];\n  if (existing) return existing;\n  const created = new Map<string, HostSemaphore>();\n  g[globalKey] = created;\n  return created;\n}\n\n/**\n * Normalize a URL to the key its limiter is stored under.\n *\n * Keys on the host actually being contacted rather than the session's nominal\n * hostname, so a redirect onto a different deployment gets its own budget\n * instead of spending the original host's.\n *\n * Port is part of the key: two fake-mychart instances on one machine are two\n * different servers. Anything unparseable falls back to the raw string, which\n * still groups consistently.\n */\nexport function hostKeyForUrl(url: string): string {\n  try {\n    return new URL(url).host.toLowerCase();\n  } catch {\n    return url.toLowerCase();\n  }\n}\n\nfunction limiterFor(hostKey: string): HostSemaphore {\n  const limiters = registry();\n  const existing = limiters.get(hostKey);\n  if (existing) return existing;\n  const created = new HostSemaphore(MAX_CONCURRENT_REQUESTS_PER_HOST);\n  limiters.set(hostKey, created);\n  return created;\n}\n\n/**\n * Run `fn` while holding one of the host's permits.\n *\n * Wrap only the individual network call. `makeRequest` recurses to follow\n * redirects, and holding a permit across that recursion would let one chain\n * hold several at once — enough concurrent redirect-following requests would\n * then deadlock waiting on permits their own callers are holding.\n */\nexport async function withHostLimit<T>(url: string, fn: () => Promise<T>): Promise<T> {\n  const hostKey = hostKeyForUrl(url);\n  const limiter = limiterFor(hostKey);\n\n  if (limiter.inFlight >= limiter.limit) {\n    // Host only, never the path — request URLs carry record and patient ids.\n    logger.debug(\n      `[ratelimit] ${hostKey} at ${limiter.limit} in flight, queueing (${limiter.queued + 1} waiting)`,\n    );\n  }\n\n  await limiter.acquire();\n  try {\n    return await fn();\n  } finally {\n    limiter.release();\n  }\n}\n\n/** In-flight and queued counts per host. Test and diagnostic use only. */\nexport function hostLimiterStats(): Record<string, { inFlight: number; queued: number; limit: number }> {\n  const stats: Record<string, { inFlight: number; queued: number; limit: number }> = {};\n  for (const [host, limiter] of registry()) {\n    stats[host] = { inFlight: limiter.inFlight, queued: limiter.queued, limit: limiter.limit };\n  }\n  return stats;\n}\n\n/**\n * Drop every limiter. Tests only — discarding a limiter with waiters would\n * strand them, so this is not safe to call while requests are in flight.\n */\nexport function resetHostLimiters(): void {\n  registry().clear();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The single outbound HTTP path for the scrapers.\n *\n * Every request this repo aims at a health system goes through `scraperFetch`,\n * because four things have to be true of all of them and none of the four\n * survives being reimplemented at a call site:\n *\n *  - **The browser header block.** MyChart and the eUnity image servers behind\n *    it answer a request that looks like Chrome; a bare `fetch` gets a login\n *    wall or a 403.\n *  - **The cookie jar.** Session, load-balancer and bot-check cookies are set\n *    mid-redirect-chain and expected back on the very next hop, so injecting\n *    `Cookie` and harvesting `Set-Cookie` can't be optional.\n *  - **The per-host permit.** A full 30-category scrape otherwise arrives at\n *    one hospital as ~60 simultaneous requests, which is how an instance ends\n *    up in `blockedInstances.ts`.\n *  - **The deadline.** A host that accepts the connection and never answers\n *    hangs the scrape forever, holding a permit the whole time.\n *\n * A second raw-fetch path is exactly how the cap silently stops applying — it\n * keeps working, so nobody notices it isn't limited. So there isn't one. If you\n * need \"just a quick request\", call this.\n */\n\nimport type { CookieJar } from 'tough-cookie';\nimport { cookieHeaderFor, storeSetCookies } from './cookies';\nimport { withHostLimit } from '../shared/hostConcurrency';\n\n/**\n * Pretend to be Google Chrome on macOS. Sent on every request; a call site that\n * needs a different value for one of these passes it in `init.headers`, which\n * wins.\n */\nexport const BROWSER_HEADERS: Readonly<Record<string, string>> = {\n  'Cache-Control': 'max-age=0',\n  // Every version here has to match the one in User-Agent below. A request\n  // claiming Chrome 131 in one header and 126 in another is a fingerprint no\n  // real browser produces, and CLAUDE.md names request-shape mismatch as the\n  // first thing to suspect behind an unexplained 403.\n  'Sec-Ch-Ua': '\"Not/A)Brand\";v=\"24\", \"Chromium\";v=\"131\", \"Google Chrome\";v=\"131\"',\n  'Sec-Ch-Ua-Mobile': '?0',\n  'Sec-Ch-Ua-Platform': 'macOS',\n  'Sec-Fetch-Dest': 'document',\n  'Sec-Fetch-Mode': 'navigate',\n  'Sec-Fetch-Site': 'same-origin',\n  'Sec-Fetch-User': '?1',\n  'Upgrade-Insecure-Requests': '1',\n  'Dnt': '1',\n  'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',\n};\n\n/**\n * The network call itself — everything below the headers, the jar and the\n * permit.\n */\nexport type Transport = (url: string, init: RequestInit) => Promise<Response>;\n\n// expo/fetch when running inside an Expo app — its Swift-side\n// URLSessionDelegate honors redirect:\"manual\". Under Node/Bun the require\n// throws (the module isn't resolvable outside the app) and this stays\n// undefined, which doubles as a runtime signal for where we're running.\nconst expoFetch: Transport | undefined = (() => {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-require-imports\n    const m = require('expo/fetch') as { fetch?: Transport };\n    return m?.fetch;\n  } catch {\n    return undefined;\n  }\n})();\n\n/**\n * Whether the platform keeps its own cookie store.\n *\n * On React Native that's iOS's `HTTPCookieStorage`, wired into the fetch the\n * runtime provides — so a tough-cookie jar there would be a second, empty\n * store shadowing the real one. Everywhere else nothing manages cookies for\n * us and the jar is the only thing keeping a session alive.\n *\n * Two signals, because getting this wrong on device is a silently broken\n * session rather than a crash: React Native's own `navigator` marker, and the\n * fact that `expo/fetch` resolved at all. Both hold in the app, neither holds\n * under Node or Bun.\n */\nexport const PLATFORM_OWNS_COOKIES: boolean =\n  expoFetch !== undefined ||\n  (typeof navigator !== 'undefined' &&\n    (navigator as { product?: string }).product === 'ReactNative');\n\n/**\n * Installed by tests to route every scraper request at a scripted server. See\n * {@link setTestTransport} — production code never sets this.\n */\nlet testTransport: Transport | null = null;\n\n/**\n * Send every subsequent scraper request to `fn`. Tests only; pass null to\n * restore the real network.\n *\n * This exists so `myChartUserPassLogin` and friends don't have to carry a\n * \"pass me a fetch\" parameter that only tests ever fill in. Set it in\n * `beforeEach` and clear it in `afterEach` — it is process-wide.\n */\nexport function setTestTransport(fn: Transport | null): void {\n  testTransport = fn;\n}\n\n/**\n * Pick the network call for this request. Three cases, in order:\n *\n *  1. **Tests** — a scripted transport, either process-wide\n *     ({@link setTestTransport}) or per-session (`MyChartRequest.transport`).\n *  2. **We own the cookies** — a jar was handed over, so we're driving the\n *     redirect chain and the cookies ourselves. Prefer `expo/fetch` when it's\n *     there, because it honors `redirect: 'manual'` where React Native's own\n *     fetch quietly follows redirects and hides the hops from us.\n *  3. **The platform owns the cookies** — use the runtime's own fetch, the one\n *     its cookie store is actually attached to. Substituting a different\n *     networking stack here would send every request out with no session.\n *\n * `globalThis.fetch` is read per call rather than captured at import, so a test\n * that swaps the global still intercepts.\n */\nfunction resolveTransport(override: Transport | undefined, cookieJar: CookieJar | null | undefined): Transport {\n  if (testTransport) return testTransport;\n  if (override) return override;\n  if (cookieJar && expoFetch) return expoFetch;\n  return (url, init) => globalThis.fetch(url, init);\n}\n\n/**\n * The transport a request gets when nothing overrides it and no jar is in\n * play. Exported for tests and diagnostics.\n */\nexport const platformFetch: Transport = (url, init) => resolveTransport(undefined, null)(url, init);\n\n/**\n * `RequestInit` with headers narrowed to a plain object.\n *\n * `Omit` rather than an intersection with `RequestInit`, and that is\n * load-bearing: intersecting leaves `headers` as `HeadersInit &\n * Record<string, string>`, whose `string[][]` branch survives. A caller\n * passing the tuple form (`[['X-Foo', '1']]`) or a `Headers` instance would\n * type-check, and `{ ...init.headers }` below would spread it by index —\n * producing a header literally named `0`, or nothing at all, instead of the\n * headers asked for. Every outbound request in the product goes through here,\n * so that failure would be silent and total. Narrowing the type makes the\n * merge below the only thing this function has to support.\n */\nexport type ScraperFetchInit = Omit<RequestInit, 'headers'> & {\n  headers?: Record<string, string>;\n};\n\nexport type ScraperFetchOptions = {\n  /**\n   * Jar to read `Cookie` from and write `Set-Cookie` back into. Pass null when\n   * {@link PLATFORM_OWNS_COOKIES}, where a second jar would only shadow the\n   * store the OS is already keeping.\n   */\n  cookieJar?: CookieJar | null;\n\n  /** Override the network call for this session. See {@link resolveTransport}. */\n  transport?: Transport | undefined;\n};\n\n/**\n * Make one outbound scraper request.\n *\n * Does not follow redirects — callers that need to (`MyChartRequest.makeRequest`,\n * the eUnity SAML chain) pass `redirect: 'manual'` and come back round for a\n * fresh permit on each hop. That is deliberate: only the individual network\n * call sits inside the permit, because holding one across a whole redirect\n * chain would let a single chain hold several at once and deadlock against its\n * own callers.\n */\nexport async function scraperFetch(\n  url: string,\n  init: ScraperFetchInit = {},\n  options: ScraperFetchOptions = {},\n): Promise<Response> {\n  const { cookieJar } = options;\n  const transport = resolveTransport(options.transport, cookieJar);\n\n  const headers: Record<string, string> = { ...BROWSER_HEADERS, ...init.headers };\n\n  // MyChart's APIs speak JSON, so a POST body that didn't declare a type is a\n  // JSON one. Call sites that send anything else (form-encoded logins, AMF)\n  // set Content-Type themselves and that wins.\n  if (init.method === 'POST' && init.body && !headers['Content-Type']) {\n    headers['Content-Type'] = 'application/json';\n  }\n\n  if (cookieJar) {\n    const cookie = await cookieHeaderFor(cookieJar, url);\n    if (cookie) headers['Cookie'] = cookie;\n  }\n\n  // Two minutes, then give up. A host that accepts the connection and never\n  // answers would otherwise hang the scrape forever while holding one of that\n  // host's ten permits, so a few of them starve every other category on it.\n  // `AbortSignal.timeout` would be the one-liner, but React Native's polyfill\n  // (`abort-controller`) doesn't have that static — AbortController it does\n  // have. One deadline per network call, so a redirect chain gets a fresh one\n  // per hop, the same shape as the permit.\n  const abort = new AbortController();\n  const timer = setTimeout(() => abort.abort(), 120_000);\n\n  let response: Response;\n  try {\n    response = await withHostLimit(url, () =>\n      transport(url, { ...init, headers, signal: abort.signal }),\n    );\n  } finally {\n    clearTimeout(timer);\n  }\n\n  if (cookieJar) {\n    await storeSetCookies(cookieJar, url, response);\n  }\n\n  return response;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { CookieJar } from 'tough-cookie'\nimport type { RequestConfig } from './types';\nimport { logger } from '../../../shared/logger';\nimport { PLATFORM_OWNS_COOKIES, scraperFetch, type Transport } from '../../http';\n\n/**\n * Options for creating a MyChartRequest.\n *\n * There is deliberately no \"pass me a fetch\" option: which network call to\n * make, and whether to keep our own cookie jar, are platform questions that\n * `scrapers/http.ts` answers at runtime. Callers say where they're going, not\n * how to get there.\n */\nexport type MyChartRequestOptions = {\n  protocol?: string;\n};\n\n// Redirect statuses worth following. 303/307/308 are rare on MyChart but do\n// show up in front of it (SSO stops, load balancers), and dropping them turns\n// a working instance into an unexplained blank response.\nconst REDIRECT_STATUSES = [301, 302, 303, 307, 308];\n\n// Matches what browsers allow before declaring a redirect loop.\nconst MAX_REDIRECTS = 20;\n\n// Class to keep track of variables used when making requests\n// to MyChart's Site.\nexport class MyChartRequest {\n\n  // Cookie jar to keep track of all the cookies received.\n  // On platforms that handle cookies natively (iOS), this jar stays empty\n  // and is only used for getCookieInfo() / serialize() compatibility.\n  cookieJar: CookieJar;\n\n  // Test seam. Null in production — scraperFetch picks the transport from the\n  // platform. Assigning a function here intercepts this session's requests\n  // without losing the headers, the jar, the per-host permit or the deadline,\n  // all of which live above the transport.\n  transport: Transport | null = null;\n\n  // The hostname of the MyChart site, eg. mychart.example.org\n  hostname: string;\n\n  // Protocol to use for requests. Defaults to 'https'. Set to 'http' for local fake-mychart server.\n  protocol: string;\n\n  // The deployment prefix every MyChart route sits under: '/MyChart' for most\n  // instances, '/MyChart-PRD' or '/UCSFMyChart' for others. null means the\n  // instance is mounted at the domain root and there is no prefix at all\n  // (e.g. mychart.clevelandclinic.org), or that we haven't discovered one yet.\n  firstPathPart: string | null = null;\n\n  /**\n   * Restore this session to a logged-in state, wired by each client after\n   * login (the CLI, the desktop extension and the mobile app each know where\n   * their own credentials live — this class deliberately doesn't).\n   *\n   * Called by `makeAuthenticatedRequest` when a request bounces to the login\n   * page. The hook must log back in and adopt the fresh state onto THIS\n   * instance (see `adoptStateFrom`), returning true on success and false when\n   * a silent re-login isn't possible (e.g. the account requires interactive\n   * 2FA). Left unset, an expired session surfaces as `SessionExpiredError`\n   * instead of being renewed.\n   */\n  reauthenticate?: () => Promise<boolean>;\n\n  /**\n   * Opt out of the automatic keepalive enrollment makeAuthenticatedRequest\n   * performs after successful requests. Set by clients that explicitly asked\n   * for no background pings (MyChartClient's `keepalive: false`).\n   */\n  disableAutoKeepalive?: boolean;\n\n  /**\n   * The patient record this session was last deliberately switched to,\n   * recorded by `switchProxyTarget`. Re-login resets MyChart's server-side\n   * proxy context to the account holder, so automatic session renewal consults\n   * this to put the context back before any caller retries — without it, a\n   * renewed session would silently read the wrong patient's chart.\n   */\n  activeProxyTarget?: { id: string; isSelf: boolean; displayName: string };\n\n  /**\n   * Re-runs the verified proxy switch that produced `activeProxyTarget`,\n   * with autoRenew: false. Armed by proxyContext together with\n   * `activeProxyTarget`; called by session renewal (`sessionRenewal.ts`)\n   * after a silent re-login, which resets MyChart's server-side context to\n   * the account holder. A closure on the request — rather than an import of\n   * proxyContext from the renewal path — so the renewal module stays a leaf\n   * and the module graph stays acyclic.\n   */\n  restoreProxyContext?: () => Promise<void>;\n\n  constructor(hostname: string, options?: string | MyChartRequestOptions) {\n    // Support old signature: new MyChartRequest(hostname, protocol?)\n    const opts: MyChartRequestOptions = typeof options === 'string'\n      ? { protocol: options }\n      : (options ?? {});\n\n    this.cookieJar = new CookieJar();\n    this.hostname = MyChartRequest.normalizeHostname(hostname);\n    this.protocol = opts.protocol ?? 'https';\n  }\n\n  /**\n   * Strip protocol/path from user input so only the bare hostname remains.\n   * e.g. \"https://mychart.example.org/MyChart\" → \"mychart.example.org\"\n   */\n  static normalizeHostname(input: string): string {\n    const trimmed = input.trim();\n    try {\n      const parsed = new URL(trimmed.includes('://') ? trimmed : `https://${trimmed}`);\n      // Use host (includes port) instead of hostname (strips port)\n      // so that \"localhost:4000\" is preserved for local development\n      return parsed.host;\n    } catch {\n      return trimmed;\n    }\n  }\n\n  getCookieInfo(): { count: number; names: string[] } {\n    const serialized = this.cookieJar.serializeSync() as unknown as { cookies?: { key: string; domain?: string; path?: string }[] };\n    const cookies = serialized?.cookies ?? [];\n    return {\n      count: cookies.length,\n      names: cookies.map(c => `${c.key}=${c.domain ?? ''}${c.path ?? ''}`),\n    };\n  }\n\n  // Promise-typed for API stability (npm-package exposes it); the work is synchronous.\n  serialize(): Promise<string> {\n    return Promise.resolve(JSON.stringify({\n      firstPathPart: this.firstPathPart,\n      hostname: this.hostname,\n      protocol: this.protocol,\n      cookies: this.cookieJar.serializeSync()\n    }))\n  }\n\n  static unserialize(serializedData: string, options?: MyChartRequestOptions): Promise<MyChartRequest | null> {\n    try {\n      const data = JSON.parse(serializedData);\n      // firstPathPart is null for root-mounted instances, so check for presence\n      // rather than truthiness.\n      if (data?.hostname && data.firstPathPart !== undefined && data.cookies) {\n        const request = new MyChartRequest(data.hostname, { ...options, protocol: data.protocol });\n        request.firstPathPart = data.firstPathPart;\n        if (Object.keys(data.cookies).length > 0) {\n          request.cookieJar = CookieJar.deserializeSync(data.cookies);\n        }\n        return Promise.resolve(request);\n      } else {\n        // `data` holds the serialized cookie jar — log its shape, never its contents.\n        logger.error(\n          'Invalid data for MyChartRequest unserialization. Fields present:',\n          data && typeof data === 'object' ? Object.keys(data).join(', ') : typeof data,\n        );\n      }\n    } catch (error) {\n      logger.error('Error unserializing MyChartRequest:', error);\n    }\n    return Promise.resolve(null);\n  }\n\n  setFirstPathPart(firstPathPart: string | null) {\n    this.firstPathPart = firstPathPart;\n  }\n\n  /**\n   * Point every subsequent request at a different host.\n   *\n   * Vanity hostnames outlive the deployments behind them — `login.wellspan.org`\n   * redirects to `my.wellspan.org`, `patients.mycslink.org` to\n   * `mycslink.cedars-sinai.org`. Discovery follows those moves so the rest of\n   * the session talks to the host that actually serves the chart.\n   */\n  setHostname(hostname: string) {\n    this.hostname = MyChartRequest.normalizeHostname(hostname);\n  }\n\n  /**\n   * Adopt a freshly logged-in instance's session state onto this one, in\n   * place.\n   *\n   * The login functions construct and return a brand-new MyChartRequest, but\n   * everything holding a reference mid-scrape (in-flight scrapers, the session\n   * stores, the keepalive) points at the old object — so a re-login hook copies\n   * the new state across rather than swapping references. Hostname and mount\n   * come along too, because discovery during the fresh login may legitimately\n   * have followed a vanity-host move.\n   *\n   * `transport` is deliberately NOT copied: it's a per-instance test seam, and\n   * production requests read `this.cookieJar` at call time anyway — reassigning\n   * the jar is enough.\n   */\n  adoptStateFrom(other: MyChartRequest) {\n    this.cookieJar = other.cookieJar;\n    this.hostname = other.hostname;\n    this.protocol = other.protocol;\n    this.firstPathPart = other.firstPathPart;\n  }\n\n\n  // Make a request with the given config.\n  // Returns the raw response object.\n  //\n  // `redirectsFollowed` is bookkeeping for the recursive redirect follow below;\n  // callers pass one argument and let it default.\n  async makeRequest(config: RequestConfig, redirectsFollowed = 0): Promise<Response> {\n    config.method ??= 'GET';\n\n    if (!config.url && !config.path) {\n      throw new Error(\"Either url or path must be defined in the config object.\");\n    }\n\n    // The Chrome header block, the cookie jar, the per-host permit and the\n    // deadline are all scraperFetch's job; this only says what MyChart is\n    // being asked for.\n    // A bodyless request omits the key rather than sending `body: undefined`.\n    const finalConfig = {\n      method: config.method ?? 'GET',\n      redirect: \"manual\" as const,\n      ...(config.body !== undefined ? { body: config.body } : {}),\n      headers: config.headers ?? {},\n    }\n\n    // No prefix (root-mounted instance) means nothing goes in front of the\n    // path — not even the separating slash, which would leave a double slash\n    // that some servers redirect on.\n    const mountPath = this.firstPathPart ? '/' + this.firstPathPart : '';\n    const url = config.url ?? (this.protocol + '://' + this.hostname + mountPath + config.path);\n\n    const response = await scraperFetch(url, finalConfig, {\n      // Who keeps the cookies is a property of the runtime, not of the\n      // caller — see PLATFORM_OWNS_COOKIES.\n      cookieJar: PLATFORM_OWNS_COOKIES ? null : this.cookieJar,\n      transport: this.transport ?? undefined,\n    })\n    // Log each request and its status code.\n    logger.debug(response.status, url)\n\n    // Follow redirects, if necessary.\n    if (REDIRECT_STATUSES.includes(response.status) && config.followRedirects !== false) {\n\n      let newLocation = response.headers.get('Location');\n\n      if (!newLocation) {\n        throw new Error(\"302 didn't have a location header\" + url)\n      }\n\n      // Some instances redirect a URL straight back to itself and never stop —\n      // mychart.crossingrivers.org does this on /MyChart/, cookies and all.\n      // Without a cap this recurses until the process runs out of stack.\n      if (redirectsFollowed >= MAX_REDIRECTS) {\n        logger.debug(`Giving up after ${MAX_REDIRECTS} redirects, last hop:`, url);\n        return response;\n      }\n\n      // If the Location header returned doesn't isn't absolute, make it absolute.\n      newLocation = new URL(newLocation, url).href\n\n      // 307/308 exist precisely to preserve the method and body; everything\n      // else turns into a GET, which is what browsers do with a 302 too.\n      const preserveMethod = response.status === 307 || response.status === 308;\n      // Spreading `config` carries its body along, so the non-preserving hop has\n      // to drop the key outright — `body: undefined` would leave it present.\n      const { body: priorBody, ...configWithoutBody } = config;\n      return this.makeRequest({\n        ...configWithoutBody,\n        url: newLocation,\n        method: preserveMethod ? config.method : 'GET',\n        ...(preserveMethod && priorBody !== undefined ? { body: priorBody } : {}),\n      }, redirectsFollowed + 1)\n    }\n\n    return response;\n  }\n}\n","[\n  {\n    \"aliases\": [\n      \"Heart of Texas\",\n      \"Waco Family Health Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F32A6D0C-4295-418F-B756-D93161176663/1fe809172035d131f77155d7c8519ebd.png\",\n    \"name\": \"Waco Family Medicine\",\n    \"slgId\": \"118\",\n    \"url\": \"https://mychart.wacofhc.org/mychartwacoprod/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/534F1D5A-9531-4342-9309-5FAAF9D476D9/7a5f8523bef7741b8441d80c8a125d63.png\",\n    \"name\": \"Kelsey-Seybold\",\n    \"slgId\": \"148\",\n    \"url\": \"https://www.mykelseyonline.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BE0EE000-29A2-4D3B-8592-5CA8FF3DFF37/bfd0a6791c4bd34d42f0cc4727661b0e.png\",\n    \"name\": \"Sick Kids - CHEO\",\n    \"slgId\": \"158\",\n    \"url\": \"https://mychart.kidshealthalliance.ca/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"LCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63871B9F-41AE-438F-860E-75B9866C9FAD/de15c75282acee566bf5a16f4b929e9e.png\",\n    \"name\": \"Ann & Robert H. Lurie Children's Hospital of Chicago\",\n    \"slgId\": \"159\",\n    \"url\": \"https://mychart.luriechildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A15CE633-709F-4565-A52E-3FE209D5F711/6f25311d1b72e60c94872a39627bc354.png\",\n    \"name\": \"Children's Hospital Colorado\",\n    \"slgId\": \"160\",\n    \"url\": \"https://mychart.childrenscolorado.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Dedham\",\n      \"Granite\",\n      \"Harvard\",\n      \"dma\",\n      \"gmg\",\n      \"hvma\",\n      \"smg\",\n      \"ssmc\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A414F13-EB48-42FD-A355-CF1EF1137401/2e3038becb3d091569f29fa5b5a1033e.png\",\n    \"name\": \"Atrius Health\",\n    \"slgId\": \"163\",\n    \"url\": \"https://myhealth.atriushealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.ucsfhealth.org/ucsfmychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8611ECA4-D39F-4D60-A57D-29FF1A944F3C/e70c9dc6c844f5958bb5b4f5e907f44f.png\",\n    \"name\": \"UCSF\",\n    \"slgId\": \"166\",\n    \"url\": \"https://ucsfmychart.ucsfmedicalcenter.org/ucsfmychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UCMC\",\n      \"Uchicago Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/40CFE185-E0C9-4A84-82A4-BA97BEEA06FC/864f2d7f12919f5e63490e67442818d9.png\",\n    \"name\": \"University of Chicago Hospitals\",\n    \"slgId\": \"169\",\n    \"url\": \"https://mychart.uchospitals.edu/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/globalHealth.png\",\n    \"name\": \"GlobalHealth Holdings\",\n    \"slgId\": \"192\",\n    \"url\": \"https://myglobal.globalhealth.com/MyGlobal/\"\n  },\n  {\n    \"aliases\": [\n      \"Edward-Elmhurst\",\n      \"Edward\",\n      \"Elmhurst\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9F221901-15BD-4247-B6C6-04FF45B294E3/5ab866441ffdb896884e64c2ad2fdfad.png\",\n    \"name\": \"Endeavor Health\",\n    \"slgId\": \"206-2\",\n    \"url\": \"https://mychart.eehealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"penn\",\n      \"holy\",\n      \"spirit\",\n      \"susquehanna\",\n      \"valley\",\n      \"svms\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/98D46880-4AB1-4088-B3F4-6CD45EE883FA/9cd3f74d41decc680114d43ca4a40048.png\",\n    \"name\": \"Geisinger\",\n    \"slgId\": \"223\",\n    \"url\": \"https://www.geisinger.org/mygeisinger\"\n  },\n  {\n    \"aliases\": [\n      \"svms\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0E058C76-3F97-426D-92C2-27CA841B7D3F/4ae62343a47d74f087dd47bea4e41a2c.png\",\n    \"name\": \"Susquehanna Valley Medical Specialties\",\n    \"slgId\": \"223-2\",\n    \"url\": \"https://www.mycarecompass.org/mychart\"\n  },\n  {\n    \"aliases\": [\n      \"community\",\n      \"care\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A1FD4DB-3BC4-422B-ACAD-167E10A971D9/3d5a4ee9bf894c9b86892fa96cd62147.png\",\n    \"name\": \"CommunityCare\",\n    \"slgId\": \"223-3\",\n    \"url\": \"https://www.mycarecompass.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Evangelical,Evan,ECH\",\n      \"Evangelical\",\n      \"Evan\",\n      \"ECH\"\n    ],\n    \"directoryUrl\": \"https://www.evanhospital.com/for-patients/mychart?utm_content=mychart\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2007ABDB-1202-423E-977B-90E44089FAD1/25c000f5cd160a5c6eb049874b8b0a37.png\",\n    \"name\": \"Evangelical Community Hospital\",\n    \"slgId\": \"223-4\",\n    \"url\": \"https://my.wellspan.org/MyWellSpan/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/healthPartners.png\",\n    \"name\": \"HealthPartners\",\n    \"slgId\": \"227\",\n    \"url\": \"https://www.healthpartners.com/public/login/\"\n  },\n  {\n    \"aliases\": [\n      \"Seattle Cancer Care Alliance\",\n      \"SCCA\",\n      \"Fred Hutchinson Cancer Center\",\n      \"Fred Hutch\",\n      \"FHCC\",\n      \"UWMC\",\n      \"University of Washington\",\n      \"University of Washington Medicine\",\n      \"University of Washington Medical Center\",\n      \"Harborview Medical Center\",\n      \"HMC\",\n      \"Northwest Hospital\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6E2FD2F6-0BBE-4084-8029-CD57EACCC0B9/59963a47e8575ff8a59a37e1c35db6cf.png\",\n    \"name\": \"UW Medicine\",\n    \"slgId\": \"255\",\n    \"url\": \"https://mychart.uwmedicine.org/prod01/\"\n  },\n  {\n    \"aliases\": [\n      \"EBNHC\",\n      \"East Boston Neighborhood Health Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B76AF78-1F8E-4EF8-BECF-0A11000D8F61/641f204d7974860d4df928d74b88125f.png\",\n    \"name\": \"NeighborHealth\",\n    \"slgId\": \"265\",\n    \"url\": \"https://mychart.ebnhc.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"PAMF\",\n      \"Palo Alto Medical Foundation\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C92CA5F8-2A5D-4252-9812-8D2C1E9EFBEE/7a2286b74f37e7f82ecebaf2870d6bb7.png\",\n    \"name\": \"Sutter Health\",\n    \"slgId\": \"278\",\n    \"url\": \"https://myhealthonline.sutterhealth.org/MHO/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5D6EFCF3-986F-4D18-AF3D-52DFED744394/e80f9334a7ef07e1abf0aef03cb086f6.png\",\n    \"name\": \"MultiCare\",\n    \"slgId\": \"279\",\n    \"url\": \"https://mychart.multicare.org/mymulticare/\"\n  },\n  {\n    \"aliases\": [\n      \"seamar\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/677072AF-1112-423D-B8EB-D163A75C37BE/bc3631b07a57f1ea09c504339711bad6.png\",\n    \"name\": \"Sea Mar\",\n    \"slgId\": \"279-1\",\n    \"url\": \"https://mychart.seamarchc.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A2A13FA-3F85-496A-AADF-64A474A3B57E/909bda72eb846ab62afba99b823ba300.png\",\n    \"name\": \"Carol Milgard Breast Center\",\n    \"slgId\": \"279-2\",\n    \"url\": \"https://prd.ccmychart.org/cmbc/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3F1498E7-159E-4C6B-BF18-2B0457420AD3/fa8d1e409e0c4e7ef271b7dbb53723e9.png\",\n    \"name\": \"Kootenai Health\",\n    \"slgId\": \"279-3\",\n    \"url\": \"https://kh.ccmychart.org/kh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4A7DCF80-6572-4591-8EB9-AADF97A9C3F6/37c7f5e393ed519a95fb9e4ec2055f06.png\",\n    \"name\": \"East Adams Rural Hospital\",\n    \"slgId\": \"279-4\",\n    \"url\": \"https://ccmychart.org/EARH/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5A446EE-54FD-4986-BE0D-707B5220CC4A/cc3389d0fa62a03decf3eb8fd5c08a91.png\",\n    \"name\": \"Willapa Harbor Hospital\",\n    \"slgId\": \"279-5\",\n    \"url\": \"https://www.ccmychart.org/whh/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/74295128-E94C-4F59-8617-DC10786CEAA9/a6f6e26f50cc143b84e66d7ca2f3e89d.png\",\n    \"name\": \"Western Washington Medical Group\",\n    \"slgId\": \"279-6\",\n    \"url\": \"https://www.ccmychart.org/wwmg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/36549BF2-4305-4410-993B-D1CC1493C5A0/8942f2a02605fab9838591b7c4c6e8e3.png\",\n    \"name\": \"Forks Community Hospital\",\n    \"slgId\": \"279-7\",\n    \"url\": \"https://www.ccmychart.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/276FDF9B-DF30-44D0-B543-A6D6419A23D1/c45dd7714a8584c5189047b0df1ed5f8.png\",\n    \"name\": \"Coeur OBGYN\",\n    \"slgId\": \"279-8\",\n    \"url\": \"https://cob.ccmychart.org/COB/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92971D29-C98F-4F6C-A8D4-71759E7BE6FB/fa86870d87d40bd52e0faead9cc7706d.png\",\n    \"name\": \"MetroHealth OH\",\n    \"slgId\": \"292\",\n    \"url\": \"https://mychart.metrohealth.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3074A2F0-E70A-4146-BD9A-A22FD518D98B/61bfbd606bc9998f5b844f86a23b99f0.png\",\n    \"name\": \"Spry Health\",\n    \"slgId\": \"292-1\",\n    \"url\": \"https://mychart.myspry.com/MySpry/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/23D9BA59-1625-4267-A268-15E46F605218/2922fed7b5fcd5168386ece0f1edbe37.png\",\n    \"name\": \"Lumina\",\n    \"slgId\": \"292-2\",\n    \"url\": \"https://mychart.luminaimaging.com/Lumina/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3B3C0989-D60E-476B-BE66-D41EBE099EF6/3cbb72d187bdf9287d8fb8b6d76f431f.png\",\n    \"name\": \"SprySenior\",\n    \"slgId\": \"292-3\",\n    \"url\": \"https://mychart.sprysenior.com/SprySenior/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/39492130-6268-4F1C-9B29-AB067887A9D8/92c2e031670e528de844655e5976229b.png\",\n    \"name\": \"Ovatient\",\n    \"slgId\": \"292-4\",\n    \"url\": \"https://mychart.ovatient.com/ovatient/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5A835B36-9F80-43D0-AE57-AC59DE99071E/aa9b8e3f8d1474c59d6bdb78200a5f49.png\",\n    \"name\": \"Rush University Medical Center\",\n    \"slgId\": \"294\",\n    \"url\": \"https://mychart.rush.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Upenn\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3C7E96BE-8641-4F8F-813C-9539EE54B6CF/542696a2dcac9778e716eca6218c8b79.png\",\n    \"name\": \"Penn Medicine\",\n    \"slgId\": \"297\",\n    \"url\": \"https://secure.mypennmedicine.org/MyPennMedicine/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D38BF378-B92B-4C28-9299-F9E19580FE23/935ebf7864e30980d896bfc2d3e81faa.png\",\n    \"name\": \"Parkland\",\n    \"slgId\": \"300\",\n    \"url\": \"https://mychart.parklandhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3FD9A7B3-AFC9-4C31-9949-D58F689D9E46/676681c052c5e9247841d2ce36327aa5.png\",\n    \"name\": \"Advocate Aurora Health\",\n    \"slgId\": \"301\",\n    \"url\": \"https://livewell.aah.org/Chart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FE78E453-C8C7-4A9D-86BF-E76BDFFEFACC/312c60284a35050e071495765a8af354.png\",\n    \"name\": \"BayCare Clinic\",\n    \"slgId\": \"301-2\",\n    \"url\": \"https://my.baycareclinic.com/BaycareClinicsMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2D572A81-B9EC-4FFB-86FD-5BD146E37323/796c3fead77ccb867a08d2c18a3691fe.png\",\n    \"name\": \"PediaTrust\",\n    \"slgId\": \"301-3\",\n    \"url\": \"https://mychart.pediatrust.com/pediatrust/\"\n  },\n  {\n    \"aliases\": [\n      \"The U\",\n      \"Moran\",\n      \"Huntsman\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/595156B8-337C-4601-B5BF-F8218D4A7C33/6f58596dec7c13c4690336e26a89a898.png\",\n    \"name\": \"University of Utah\",\n    \"slgId\": \"303\",\n    \"url\": \"https://mychart.med.utah.edu/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D71E825E-FC64-4339-877C-4036443A1B3B/36bc1465970095c7c6290420debddc23.png\",\n    \"name\": \"Carson Tahoe\",\n    \"slgId\": \"303-2\",\n    \"url\": \"https://mychart.carsontahoe.com/patientportal/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Kaukauna\",\n      \"Aascend\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D55B9BC2-44A1-45A5-8970-29C59A6E5971/875b3c10da497ed6e042cbf561aac26d.png\",\n    \"name\": \"Thedacare\",\n    \"slgId\": \"306\",\n    \"url\": \"https://my.thedacare.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Green\",\n      \"Iron\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFA8861F-5520-41E1-B91D-29A78135B01A/baaafdbca6a10c4cff495c9b57e63e25.png\",\n    \"name\": \"Bellin\",\n    \"slgId\": \"306-2\",\n    \"url\": \"https://www.mybellin.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/46DDD7A6-096D-424D-8C73-5BE9C720F753/b9e14bf544f53f5a5a9a4c63d10d9b2c.png\",\n    \"name\": \"Partnership Community Health\",\n    \"slgId\": \"306-3\",\n    \"url\": \"https://my.thedacare.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/17F921B6-8A73-4DC0-9615-9619600A489F/de4898f3aef650477aeb039741af8423.png\",\n    \"name\": \"Neuroscience Group\",\n    \"slgId\": \"306-4\",\n    \"url\": \"https://my.thedacare.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"mhf\",\n      \"lhe\",\n      \"legacy\",\n      \"ump\",\n      \"university\",\n      \"rmg\",\n      \"Richfield\",\n      \"bfp\",\n      \"Burnsville\",\n      \"gich\",\n      \"grand\",\n      \"Itasca\",\n      \"rmc\",\n      \"range\",\n      \"UMP\",\n      \"healtheast\",\n      \"mhealth\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F882D77-7848-48A6-A1BF-F6790CC1C5F2/94ae3c820c126746cedd5b85a1b13323.png\",\n    \"name\": \"M Health Fairview\",\n    \"slgId\": \"312\",\n    \"url\": \"https://mychart.fairview.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"bfp\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63DF9584-1626-42D7-BDCD-E7E5E994811D/399ee137206d9099505c4101c9c0efd8.png\",\n    \"name\": \"Burnsville Family Physicians\",\n    \"slgId\": \"312-1\",\n    \"url\": \"https://mychart.fairview.org/BFP/\"\n  },\n  {\n    \"aliases\": [\n      \"Fairview\",\n      \"UMP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/31C18269-5E97-4BDC-BBD8-11240B5637A5/e26f88e158d40bf491c7fc36372cb026.png\",\n    \"name\": \"University of Minnesota Physicians\",\n    \"slgId\": \"312-2\",\n    \"url\": \"https://mychart.fairview.org/UMP/\"\n  },\n  {\n    \"aliases\": [\n      \"rmc\",\n      \"mesaba\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/40E6016B-9A25-47A9-A889-3804EC7199E0/ee217b9ccac33d45345aaca2b0bfebcf.png\",\n    \"name\": \"Fairview Range\",\n    \"slgId\": \"312-3\",\n    \"url\": \"https://mychart.fairview.org/Range/\"\n  },\n  {\n    \"aliases\": [\n      \"rmg\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/432C8DD0-FF50-46EC-8114-03A072AF534B/2108af86b97b678f5ac8395685a161a4.png\",\n    \"name\": \"Richfield Medical Group\",\n    \"slgId\": \"312-4\",\n    \"url\": \"https://mychart.fairview.org/RMG/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CA938278-FF65-45A2-AB71-1B47A1CC5CBF/cdcfa6b6b432f6efe8046c96585d6030.png\",\n    \"name\": \"Carle\",\n    \"slgId\": \"316\",\n    \"url\": \"https://www.mycarle.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.mychristie.com/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B7D5BE1-A97D-4DC2-BD02-0CC39BDFD363/a1f0cab512067455a94fcc53dcfb530a.png\",\n    \"name\": \"Christie Clinic\",\n    \"slgId\": \"316-1\",\n    \"url\": \"https://www.mychristie.com/Christie/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/17295821-B4C2-4C23-A54F-77D47DD40547/3834bdd477b3c5d4838bec8bb696bf1b.png\",\n    \"name\": \"Buffalo Medical Group\",\n    \"slgId\": \"317\",\n    \"url\": \"https://www.mybmgchart.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8209F764-AEB4-47FF-A078-A210F994CEA6/c8e9c2d496540359108ed7a4d7ff9de9.png\",\n    \"name\": \"TriHealth\",\n    \"slgId\": \"319\",\n    \"url\": \"https://mychart.trihealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37EED2FE-14D4-4E63-B1A6-5AC2F88CE502/ddfe1f23cee07397455ebd18f7626c9d.png\",\n    \"name\": \"Highland District Hospital\",\n    \"slgId\": \"319-1\",\n    \"url\": \"https://mychart.hdh.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A96AB50C-F20B-42EE-999E-5A8835EB2D08/371222bc36a6ad232346ffd8808df3d5.png\",\n    \"name\": \"Highland Health Providers\",\n    \"slgId\": \"319-2\",\n    \"url\": \"https://mychart.hhproviders.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [\n      \"Martin\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9F5E6BE5-4466-4E1D-99AC-29A21E438E38/ffb08582202b9334a608314adae7b2ff.png\",\n    \"name\": \"Cleveland Clinic\",\n    \"slgId\": \"320\",\n    \"url\": \"https://mychart.clevelandclinic.org/\"\n  },\n  {\n    \"aliases\": [\n      \"AIDHC\",\n      \"NCH\",\n      \"Alfred\",\n      \"DuPont\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5143ED02-CA5D-4973-A30C-372B4F714A3D/63db5ae059ffe2cf29b854cb09d2ca09.png\",\n    \"name\": \"Nemours Children's Health\",\n    \"slgId\": \"321\",\n    \"url\": \"https://mychart.nemours.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"Solution Health\",\n      \"Elliot\",\n      \"Southern New Hampshire\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D42E60F8-AFCA-43E6-AEF4-D008A5A31EE3/0c4d40d2908d6cbdd1739131f4a3385f.png\",\n    \"name\": \"SolutionHealth\",\n    \"slgId\": \"333\",\n    \"url\": \"https://mychart.solutionhealth.org/mychartprd\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F5A6B613-9F03-4412-95F4-19E9C9DFF9B6/f0b8ad4617fae71e8848c6771a01e6fd.png\",\n    \"name\": \"Dreyer\",\n    \"slgId\": \"342\",\n    \"url\": \"https://myadvocateaurora.org/chart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/791816FD-6E8E-46AB-B3D1-BDE12000A275/432af8585fdeb046d327481792eab0d5.png\",\n    \"name\": \"Essentia Health\",\n    \"slgId\": \"343\",\n    \"url\": \"https://www.essentiamychart.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8B685F5C-822E-4779-94FA-37E4876E028F/bdfdf33b4123be94d0ac7e5e9cabbf88.png\",\n    \"name\": \"Bois Forte Health and Human Services\",\n    \"slgId\": \"343-3\",\n    \"url\": \"https://boisforte.com/services/medical-services/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.ebch.org/patients-visitor-info/billing-insurance\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B490D2E7-EE17-4C0C-A60C-A3D22B1C1220/257fcb0e55eee1d55b92d2e3f36d929f.png\",\n    \"name\": \"Ely Bloomenson Community Hospital\",\n    \"slgId\": \"343-4\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://haywardmemorialhospital.com/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/52960CD8-D9B7-4263-AE92-F6C95EE27C34/42601c4cfa6172b8f47b555f712615e2.png\",\n    \"name\": \"Hayward Medical Center\",\n    \"slgId\": \"343-5\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Tamarack Health\"\n    ],\n    \"directoryUrl\": \"https://ashlandmmc.com/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5028C3F7-FF3B-4FF9-92E5-BB4242985511/aa2d5264cb4c201a6195e72d7359a9e4.png\",\n    \"name\": \"Ashland Medical Center\",\n    \"slgId\": \"343-7\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FB72409C-3E95-4DAA-93DA-B7FD4E029C27/dc22584d143e2003aacdcb32b311e87f.png\",\n    \"name\": \"Ridgeview\",\n    \"slgId\": \"343-8\",\n    \"url\": \"https://www.ridgeviewmedical.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.spoonerhealth.com/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FE8B684E-5293-4DED-A769-9F052F131D32/2e853f2463ffd4b60ff22ed563e6cd5b.png\",\n    \"name\": \"Spooner Health\",\n    \"slgId\": \"343-9\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6F6EB782-17D6-4095-B3C3-F252275DC757/cece47a011c625a99569bac2c66fdea6.png\",\n    \"name\": \"Linton Regional Medical Center\",\n    \"slgId\": \"343-10\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3AC117A9-D74A-416A-A88B-C38DDB496439/ae5b42a197893ef38e483bbe080eae3d.png\",\n    \"name\": \"IMA Healthcare\",\n    \"slgId\": \"343-11\",\n    \"url\": \"https://communityconnect.essentiahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Zale\",\n      \"Aston\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/558A1BEA-C6EB-431A-8012-43E2162DDD1D/92ee8059fcdcea8a43836b95fae5ea50.png\",\n    \"name\": \"UTSW\",\n    \"slgId\": \"408\",\n    \"url\": \"https://mychart.utsouthwestern.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Children’s\",\n      \"Philadelphia\",\n      \"Children’s Hospital of Philadelphia\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/18E45220-F3CD-43A5-8FDE-31AAD2F88ABD/7039100c2c9f44fa215d9538d34e53de.png\",\n    \"name\": \"CHOP\",\n    \"slgId\": \"410\",\n    \"url\": \"https://mychop.chop.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"American Family\",\n      \"AFCH\",\n      \"Swedish American\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E401A06A-B403-441B-BF27-3D87F580FD7D/9f7901eb0a267bd6a8a552b8e9346e72.png\",\n    \"name\": \"UW Health\",\n    \"slgId\": \"412\",\n    \"url\": \"https://uwhealthmychart.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Quartz Senior Preferred\",\n      \"Quartz Senior Choice\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1ADC3E93-7D5F-4081-B684-AFD33EDBB307/56f21032077aba820c7361525a10a797.png\",\n    \"name\": \"Quartz\",\n    \"slgId\": \"412-1\",\n    \"url\": \"https://quartzmychart.com/Quartz/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [\n      \"ACHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6BB8D9C9-6C62-4451-A5CF-274D71289206/c005810a10777f6d8d97ff8f4c335a7b.png\",\n    \"name\": \"Access Community Health Centers\",\n    \"slgId\": \"412-2\",\n    \"url\": \"https://accesshealthmychart.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://swedishamericanmychart.org/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F6A0997B-8D9E-4EB1-BE16-7475B0A4665B/977e1c7cc757a902f3604ea8a26b252f.png\",\n    \"name\": \"SwedishAmerican\",\n    \"slgId\": \"412-3\",\n    \"url\": \"https://mychart.uwhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Group Health Cooperative\",\n      \"GHCSCW\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4F234B9E-D476-4CC5-8FFD-3178D780288D/30bda73599f5dd83030f6f84dee78068.png\",\n    \"name\": \"GHC\",\n    \"slgId\": \"413\",\n    \"url\": \"https://ghcmychart.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DE7EF240-4807-4EF7-A016-ED95665992F8/2bb99e40e502abee81b8e87091bfd82e.png\",\n    \"name\": \"Presbyterian Healthcare Services\",\n    \"slgId\": \"416\",\n    \"url\": \"https://mypres.phs.org/Pages/default.aspx\"\n  },\n  {\n    \"aliases\": [\n      \"Harris County\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A96571E6-FAAC-4EC3-9673-CC8B2F33FF0A/f74079eff9f12269b7b88615c692919a.png\",\n    \"name\": \"Harris Health\",\n    \"slgId\": \"420\",\n    \"url\": \"https://myhealth.harrishealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A522E0E0-4E6C-4F47-AF21-AAC6E0A7F1D6/60a2ee98d7fa873487a8109f65255eb9.png\",\n    \"name\": \"Vecino Health Centers\",\n    \"slgId\": \"420-2\",\n    \"url\": \"https://myhealth.harrishealth.org/vecino/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/57BF0A9C-49F2-48E7-9F8C-030B55682769/bf43de329727c798ccbdfe9e7a978dbb.png\",\n    \"name\": \"Healthcare for the Homeless Houston\",\n    \"slgId\": \"420-3\",\n    \"url\": \"https://myhealth.harrishealth.org/hhh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B5F7B3C8-95EC-4FE3-B7BA-D32ADCF36042/abc046de800bc68223332d7ef87ab7db.png\",\n    \"name\": \"Harris County Public Health\",\n    \"slgId\": \"420-4\",\n    \"url\": \"https://myhealth.harrishealth.org/hcph/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/12EB952A-2347-44AF-A8B4-04440A931F00/7524437e17b50415ec42662536d07848.png\",\n    \"name\": \"Contra Costa Health Services\",\n    \"slgId\": \"421\",\n    \"url\": \"https://mychart.cchealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"PHN\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/25592EA5-5C98-43C0-AF5F-9634634D638D/3530a08e9d13af4b1c3e69972b46f40e.png\",\n    \"name\": \"Ascension - Providence HealthCare Network\",\n    \"slgId\": \"425\",\n    \"url\": \"https://mychart.providence-waco.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"IFH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F1378979-AD85-4637-B9D8-262641DEC2AC/caea9754af13c4e3b43017a84c875932.png\",\n    \"name\": \"The Institute for Family Health\",\n    \"slgId\": \"426\",\n    \"url\": \"https://mychartmyhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Northshore University Health System\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1D3707AA-9ABE-477E-B86D-4A558AB60A7F/74dd919094e150b021468576e0a80d3a.png\",\n    \"name\": \"Endeavor Health – NorthShore University HealthSystem\",\n    \"slgId\": \"431\",\n    \"url\": \"https://www.northshoreconnect.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Neighborcare\",\n      \"Adventist\",\n      \"Ahoskie\",\n      \"Alisal\",\n      \"Ambrose\",\n      \"AMC\",\n      \"Asher\",\n      \"Bastyr\",\n      \"BEACH\",\n      \"Beaverton\",\n      \"Bend\",\n      \"Benton\",\n      \"BHCHP\",\n      \"Boston\",\n      \"Braxton\",\n      \"BUC\",\n      \"Butte\",\n      \"CareOregon\",\n      \"Carino\",\n      \"Cascades\",\n      \"Cathlamet\",\n      \"Centro\",\n      \"CFHC\",\n      \"CHC\",\n      \"Chiloquin\",\n      \"Chowan\",\n      \"Clackamas\",\n      \"Clatsop\",\n      \"Clement\",\n      \"Cleveland\",\n      \"Codman\",\n      \"Colerain\",\n      \"Columbia\",\n      \"Corazon\",\n      \"Cornelius\",\n      \"Corvallis\",\n      \"Cowlitz\",\n      \"Crook\",\n      \"Cruz\",\n      \"CSTL\",\n      \"D.A.P\",\n      \"Deschutes\",\n      \"Donner\",\n      \"Door\",\n      \"DotHouse\",\n      \"Emeline\",\n      \"FMC\",\n      \"Forest\",\n      \"FQHC\",\n      \"Garcia\",\n      \"Gary\",\n      \"Grant\",\n      \"GRMDC-Greater\",\n      \"Grove\",\n      \"Harrison\",\n      \"Healdsburg\",\n      \"HealthNet\",\n      \"HFA\",\n      \"HHS\",\n      \"HPHP\",\n      \"HSC\",\n      \"Jane\",\n      \"Jefferson\",\n      \"K-8\",\n      \"Klamath,\",\n      \"KOD\",\n      \"Kodiak\",\n      \"LAGUNA\",\n      \"LCDC\",\n      \"Lincoln\",\n      \"Linn\",\n      \"Longview\",\n      \"Lynn\",\n      \"Madras\",\n      \"Mattapan\",\n      \"MCHD\",\n      \"McMinnville\",\n      \"Medford\",\n      \"Millvale\",\n      \"MMG\",\n      \"MMM\",\n      \"Molalla\",\n      \"Monterey\",\n      \"Mosaic\",\n      \"Multnomah\",\n      \"Nehalem\",\n      \"NFP\",\n      \"Norwood\",\n      \"NUNM\",\n      \"Olivet\",\n      \"P.C.\",\n      \"Pacific\",\n      \"Parkrose\",\n      \"Pasadena\",\n      \"Pauley\",\n      \"PCC\",\n      \"Pine\",\n      \"Portland\",\n      \"Prineville\",\n      \"Queenscare\",\n      \"RCCHC\",\n      \"RCH\",\n      \"Rinehart\",\n      \"Rogue\",\n      \"Romero\",\n      \"Santa\",\n      \"SBHC\",\n      \"Scappoose\",\n      \"Seattle\",\n      \"Southwest\",\n      \"Springfield\",\n      \"Stuhr\",\n      \"Tahoe\",\n      \"Tillamook\",\n      \"Truckee\",\n      \"TTMG\",\n      \"TUC\",\n      \"Upham's\",\n      \"VGFG\",\n      \"VGT\",\n      \"Virginia\",\n      \"WAC\",\n      \"Wahkiakum\",\n      \"Wallace\",\n      \"WCHC\",\n      \"WesternU\",\n      \"Wheeler\",\n      \"Whittier\",\n      \"WIC/MSS\",\n      \"Klamath\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7E9A3915-C089-4BAC-89D0-D1B23486D2DF/4fad490f0ba95053c298aca54710c32a.png\",\n    \"name\": \"OCHIN\",\n    \"slgId\": \"432\",\n    \"url\": \"https://mychart.ochin.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6A448D63-B6B4-42E3-B195-549FD2D28893/86c33a2548bfc097654d8dfeb836b187.png\",\n    \"name\": \"Saban\",\n    \"slgId\": \"432-2\",\n    \"url\": \"https://mychart.ochin.org/mychartsaban/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/62ED9D80-D9B9-4AA6-AB36-E1A9E6475BD0/0c7504a2bca16ad8cd9baa08396c1a38.png\",\n    \"name\": \"GoldenShore Medical\",\n    \"slgId\": \"432-3\",\n    \"url\": \"https://mychart.ochin.org/mychartgsm\"\n  },\n  {\n    \"aliases\": [\n      \"DAP\",\n      \"Totalcare\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4AC58483-55F8-4ED1-91FF-01F98E2B8CE0/77d4a8bc886c7048bd07485e9d023760.png\",\n    \"name\": \"DAP\",\n    \"slgId\": \"432-4\",\n    \"url\": \"https://mychart.ochin.org/mychartdap/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01C8AF76-A7AA-4F72-AB19-B99EA3FAA4B1/2f340b67e813ef9f962268e5a2ad2318.png\",\n    \"name\": \"Mosaic Medical\",\n    \"slgId\": \"432-5\",\n    \"url\": \"https://mychart.ochin.org/mychartmosaic/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7ED173CC-1364-4D8C-B471-1B5F1DC9F832/0e8704357ff003736a921950d0885322.png\",\n    \"name\": \"Mercy Care\",\n    \"slgId\": \"432-6\",\n    \"url\": \"https://mychart.ochin.org/mychartsjmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D6396F8F-25A7-4919-91A3-6AD977D4FF8B/89ee3df9732d45457a1fd0590eacdc6c.png\",\n    \"name\": \"South Boston Community Health Center\",\n    \"slgId\": \"432-7\",\n    \"url\": \"https://mychart.ochin.org/mychartsbchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E500A88D-3426-4109-83A3-901AECBD726B/79e74a33abe16de85cac262d96637511.png\",\n    \"name\": \"Gracelight Community Health\",\n    \"slgId\": \"432-8\",\n    \"url\": \"https://mychart.ochin.org/MyChartGCH\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F853B2A9-E88C-4D96-9DD0-EA84E033B6CF/d8abea169563236de485d124132b2dfb.png\",\n    \"name\": \"Axis Community Health\",\n    \"slgId\": \"432-9\",\n    \"url\": \"https://mychart.ochin.org/mychartaxis/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/485C0155-3DBF-4AB4-BC2D-8D151C1EF56B/42defe97e6714299da7b231382150458.png\",\n    \"name\": \"Kintegra Health\",\n    \"slgId\": \"432-11\",\n    \"url\": \"https://mychart.ochin.org/mychartkintegra/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/218FB81D-FC48-48CE-BAD0-270E4715DE69/74b5c3d391973076f8ec8baa290cc8cc.png\",\n    \"name\": \"One Community Health\",\n    \"slgId\": \"432-12\",\n    \"url\": \"https://mychart.ochin.org/mychartoch/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CC224CC5-E694-4587-8A87-53E84D5E284B/815db0e5522a92da2eff1c0991b909a4.png\",\n    \"name\": \"Southern Jersey Family Medical Centers\",\n    \"slgId\": \"432-13\",\n    \"url\": \"https://mychart.ochin.org/mychartsjfmc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FE25B2B6-4871-45B9-94F9-087DE50AAFAA/8a561926ea824b6b77fa02e5be2d4e8b.png\",\n    \"name\": \"Carolina Health Centers\",\n    \"slgId\": \"432-14\",\n    \"url\": \"https://mychart.ochin.org/mychartchc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/79CFD047-9A6A-4CC2-B767-F1F1C5CA6BBD/e6fd8c881d8f30d9084570a30fcc3468.png\",\n    \"name\": \"Columbia River Health\",\n    \"slgId\": \"432-15\",\n    \"url\": \"https://mychart.ochin.org/MyChartCRH/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E39AA794-957B-4195-8419-1B93BDB39086/57b511f3e42748605f6824ba37d62528.png\",\n    \"name\": \"Full Circle Health\",\n    \"slgId\": \"432-16\",\n    \"url\": \"https://mychart.ochin.org/mychartfch/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D0B9B15D-7CAD-48C4-8CB8-87F6EDBC7C61/e70e2e9d789ee23aac55aefd0d3e888e.png\",\n    \"name\": \"LifeLong Medical\",\n    \"slgId\": \"432-17\",\n    \"url\": \"https://mychart.ochin.org/MyChartllmc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/14844414-FADD-45EC-9356-E193F1CAD6EB/09da2a8225d32b7e52bf8331322e0f28.png\",\n    \"name\": \"University of Minnesota\",\n    \"slgId\": \"432-18\",\n    \"url\": \"https://mychart.ochin.org/MyChartCUHCC/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/277667B0-D1CE-4942-AD51-DAB5998CA5E5/d2a85974df7cf0d01d57e79c34aa8edd.png\",\n    \"name\": \"North Lakes\",\n    \"slgId\": \"432-19\",\n    \"url\": \"https://mychart.ochin.org/MyChartNorthlakes/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FFA323BC-96F4-4401-979E-32FB5DC977A5/70effacf2389b68c197a3694d2d9ec51.png\",\n    \"name\": \"Baywell Health\",\n    \"slgId\": \"432-20\",\n    \"url\": \"https://mychart.ochin.org/mychartbaywell/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37012B22-FD3E-4023-BCEE-59F20EE9D25D/34400d6b4084f43efba9db050d6a805c.png\",\n    \"name\": \"Western University\",\n    \"slgId\": \"432-21\",\n    \"url\": \"https://mychart.ochin.org/MyChartWesternU/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/36AC75A7-75CB-4671-BFBE-52EF768A04FD/2d9630bb9f4672efc60bdf9659a5483e.png\",\n    \"name\": \"Bay Area Community Health\",\n    \"slgId\": \"432-22\",\n    \"url\": \"https://mychart.ochin.org/mychartbach/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/00361412-16EC-478B-B986-5D51914833EA/ebb92b55bf3ca4108bae86cdb058ed6d.png\",\n    \"name\": \"Tiburcio Vasquez Health Center\",\n    \"slgId\": \"432-23\",\n    \"url\": \"https://mychart.ochin.org/mycharttiburcio/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3C8460A4-0913-409F-9DCD-D2A85785496E/263f65382ee8e5d2502fdc6ba5af9df8.png\",\n    \"name\": \"OpenDoor Community Health Center\",\n    \"slgId\": \"432-24\",\n    \"url\": \"https://mychart.ochin.org/mychartopendoor/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/622E01DA-AB25-4268-A4F4-3D19F9F382F8/ab9bb3a4c63c6b16c11bff38734f55e6.png\",\n    \"name\": \"ChapCare\",\n    \"slgId\": \"432-25\",\n    \"url\": \"https://mychart.ochin.org/mychartchap/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/17AE0813-7878-4209-B2D4-1F83C2B2BE45/6a7a711937f9b90b0fb19433e4401759.png\",\n    \"name\": \"Ravenswood Family Health Network\",\n    \"slgId\": \"432-26\",\n    \"url\": \"https://mychart.ochin.org/mychartrfhc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2628F2C4-0781-456C-9BD0-A16C62897A27/14bbfb44605224bd43872541df2e1a6b.png\",\n    \"name\": \"Neighborhood Health Center\",\n    \"slgId\": \"432-27\",\n    \"url\": \"https://mychart.ochin.org/mychartnhc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7EC9768C-F742-4E0D-B6F9-B9D670423324/45d5db97a91db7cb4a9c5fef14ad5096.png\",\n    \"name\": \"Native American Health Center\",\n    \"slgId\": \"432-28\",\n    \"url\": \"https://mychart.ochin.org/mychartnahc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B3D25E7F-308C-4D07-AC5B-5E76776A175C/4c3017abeb5b187ac1b2a6da7dd0ab5e.png\",\n    \"name\": \"Share Our Selves\",\n    \"slgId\": \"432-29\",\n    \"url\": \"https://mychart.ochin.org/mychartsos/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0786EE88-987D-4203-BA9C-D3D0484939FC/9b9241d75f665301f6001048442fe775.png\",\n    \"name\": \"La Clinica\",\n    \"slgId\": \"432-30\",\n    \"url\": \"https://mychart.ochin.org/mychartlclr/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/060C86B4-BF32-4A56-9F4F-79C100DF5C67/62565dc7411e54eeeadd577607118e56.png\",\n    \"name\": \"TrueCare\",\n    \"slgId\": \"432-31\",\n    \"url\": \"https://mychart.ochin.org/mycharttc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6149CB26-8A66-480F-92F4-679D7E6B9775/cd3f8e143b3e9a78ee4d78c680db9d22.png\",\n    \"name\": \"Laguna Beach\",\n    \"slgId\": \"432-32\",\n    \"url\": \"https://mychart.ochin.org/mychartlbcc/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63325E8E-84DF-49CE-8F35-F7A7C80F2B4C/b9b819aa60328b7666d9324f3377e802.png\",\n    \"name\": \"Virginia Garcia Memorial Health Center\",\n    \"slgId\": \"432-33\",\n    \"url\": \"https://mychart.ochin.org/mychartvg/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/05A1EDE8-212F-486E-8C58-F2959D41E2A4/61686f4081b2215ef2789dbef7471452.png\",\n    \"name\": \"Harbor Health\",\n    \"slgId\": \"432-34\",\n    \"url\": \"https://mychart.ochin.org/mycharthh/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D71DBC5-54F7-4BBA-978F-36EE9D077D57/e33da47b86ed19142e816a7a741e4ff3.png\",\n    \"name\": \"One Community Health\",\n    \"slgId\": \"432-35\",\n    \"url\": \"https://mychart.ochin.org/mychartochor/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B9471C78-6F72-41C2-B6BF-F9994485B0B5/52669d7b3a85d7e7de7c2c0dd39ee892.png\",\n    \"name\": \"Pacific University Oregon\",\n    \"slgId\": \"432-36\",\n    \"url\": \"https://mychart.ochin.org/mychartpuo/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4208FA0E-52A4-409D-BD2A-CAAD3CCED555/0a0c9b508cfc7be1e43fc285d63c74f1.png\",\n    \"name\": \"Sixteenth Street\",\n    \"slgId\": \"432-37\",\n    \"url\": \"https://mychart.ochin.org/mychartschc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E2D7EEEB-9C3D-4D91-9ABF-C2D25F1A3ED9/07a994883acff895820cb17e0ecfac56.png\",\n    \"name\": \"Gerald L. Ignace Indian Health Center\",\n    \"slgId\": \"432-38\",\n    \"url\": \"https://mychart.ochin.org/mychartgliihc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BB8FA15C-91F4-49F7-B700-7949A65CDA6C/9fbae2d4ec5a8082886d1b1bea793af6.png\",\n    \"name\": \"Elica Health Centers\",\n    \"slgId\": \"432-39\",\n    \"url\": \"https://mychart.ochin.org/mychartehc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/739DEC69-0918-4155-83B0-227BD3540A46/a590ca2913d68673723f3aabf0b8ce98.png\",\n    \"name\": \"Lummi Tribal Health Center\",\n    \"slgId\": \"432-40\",\n    \"url\": \"https://mychart.ochin.org/mychartlths/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7C15566E-BD9F-406F-8F76-E733BCDC0BA4/0d6883fd6eb79eba591a8017a7a1737c.png\",\n    \"name\": \"Tarzana Treatment Center\",\n    \"slgId\": \"432-41\",\n    \"url\": \"https://mychart.ochin.org/mychartttc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/86535C7B-CCDD-4DA9-A7C3-946EC194FFD9/a6e0122b522c73a489fb303e452932a0.png\",\n    \"name\": \"La Pine Community Health Center\",\n    \"slgId\": \"432-42\",\n    \"url\": \"https://mychart.ochin.org/mychartlpchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3F080FAD-1731-490C-9C20-DE81644314E5/bb38a383890b8760d74c696f7db17cb8.png\",\n    \"name\": \"On Lok\",\n    \"slgId\": \"432-43\",\n    \"url\": \"https://mychart.ochin.org/mychartol/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/10519EF2-250D-4513-BF7B-A059BE9B5A4B/1e67ba4605c1972b6e7535fce4c4cb84.png\",\n    \"name\": \"Riverland Community Health\",\n    \"slgId\": \"432-44\",\n    \"url\": \"https://mychart.ochin.org/RCHealth\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ABC38F68-4CCF-4977-B324-035E9DFE615E/205e2f01b10f1f8cd039db3aac0fcb7c.png\",\n    \"name\": \"MCHC Health Centers\",\n    \"slgId\": \"432-45\",\n    \"url\": \"https://mychart.ochin.org/mychartmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C590B2A9-87D7-4011-97FE-8D587FB17140/a84bff3662219d8a05d19cecfa2497e2.png\",\n    \"name\": \"Carolina Family Health Centers\",\n    \"slgId\": \"432-46\",\n    \"url\": \"https://mychart.ochin.org/mychartcfhc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B0E32677-2579-43F4-AF34-64B471BE7169/1583e9507fcd71452edfe1ca2dee3e81.png\",\n    \"name\": \"Lyon Martin\",\n    \"slgId\": \"432-47\",\n    \"url\": \"https://mychart.ochin.org/mychartlmhs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9606748F-BA40-41B4-AFF0-E67E9D15FF63/66ce3eaf24b6f60fd19b94036af6bcc9.png\",\n    \"name\": \"Rogue Community Health\",\n    \"slgId\": \"432-48\",\n    \"url\": \"https://mychart.ochin.org/mychartrogue/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8DA12D00-D6FC-42CE-90BB-961B18B8856B/e10e76f3a2fced3e083eb0db78492f8f.png\",\n    \"name\": \"Lakeshore Community Health Center\",\n    \"slgId\": \"432-49\",\n    \"url\": \"https://mychart.ochin.org/mychartlchc/\"\n  },\n  {\n    \"aliases\": [\n      \"myerie\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ED74911E-2400-41DF-9C2C-B571AC68209C/a40c0e3ec604fe1438568e359e94b48e.png\",\n    \"name\": \"Family Health Centers\",\n    \"slgId\": \"432-50\",\n    \"url\": \"https://mychart.ochin.org/MyErie/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/666C6071-1864-4050-9E3E-1CC160471530/2de1f59ff9f8581ee1363cb8f1041148.png\",\n    \"name\": \"Agape Health Services\",\n    \"slgId\": \"432-51\",\n    \"url\": \"https://mychart.ochin.org/mychartagape/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/750D7DC1-23CE-46D9-B683-7E784B841141/b7a50d0f260b01a3eb9da2f7122e7556.png\",\n    \"name\": \"Outer Cape Health Services\",\n    \"slgId\": \"432-52\",\n    \"url\": \"https://mychart.ochin.org/mychartochs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5D095EAA-3F72-4AC8-9870-34EBA61F464E/1c42c32ec467f38ad0fb7ab40b926d12.png\",\n    \"name\": \"Avenue 360\",\n    \"slgId\": \"432-53\",\n    \"url\": \"https://mychart.ochin.org/MyChartA360/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B1D3AAC9-FA2F-4D24-A341-4DC3DD6B4E08/db3ab4a6d21f688f8bf3ba075c53b498.png\",\n    \"name\": \"Hot Springs Health Program\",\n    \"slgId\": \"432-54\",\n    \"url\": \"https://mychart.ochin.org/MyChartHSH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B52274E6-40F1-4113-B4D4-CAD2AD2C53E3/bd0222ef5e8a4724dbeb762553ba8a56.png\",\n    \"name\": \"San Francisco Community Clinic Consortium\",\n    \"slgId\": \"432-55\",\n    \"url\": \"https://mychart.ochin.org/MyChartSFSOS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3463C7D4-5EDA-495C-B758-0BB4EA3E13C9/4a65cf6d84a459c40daab9a117d21783.png\",\n    \"name\": \"San Francisco Community Health Center\",\n    \"slgId\": \"432-56\",\n    \"url\": \"https://mychart.ochin.org/MyChartSFCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8C8FB58F-78D5-47E6-9757-1AEE0A3A10A7/3b3ac1fc170a86bdd622cfa7b569f271.png\",\n    \"name\": \"Coast Community Health Center\",\n    \"slgId\": \"432-57\",\n    \"url\": \"https://mychart.ochin.org/MyChartCCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0CED0B3E-A76A-4BD8-BFBF-9924D8F3273D/1ce3abe287c20ffe134b0184cfc67955.png\",\n    \"name\": \"Franklin Primary Health Center\",\n    \"slgId\": \"432-58\",\n    \"url\": \"https://mychart.ochin.org/MyChartFPHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9B186993-599F-4010-B482-D172F4715052/04b323aedf881ab53072ee11413b8136.png\",\n    \"name\": \"Pines Health Services\",\n    \"slgId\": \"432-59\",\n    \"url\": \"https://mychart.ochin.org/MyChartPHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/70D7A71C-A283-4D81-A42B-F86592F689D8/d3f25852a1b6ce0ccdea2317c5536ad9.png\",\n    \"name\": \"Mission Neighborhood Health Center\",\n    \"slgId\": \"432-60\",\n    \"url\": \"https://mychart.ochin.org/MyChartMNHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/03A65E6A-BFF7-40A2-9575-49A67F9F1096/0893e08bd5ee9a0e979cd268a0fa2f4f.png\",\n    \"name\": \"The Centers\",\n    \"slgId\": \"432-61\",\n    \"url\": \"https://mychart.ochin.org/MyChartCHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DEEBEB80-A4F3-4AD9-B700-DA16E41E4F94/d179f32bf647cc82fe05d7c19d4157cc.png\",\n    \"name\": \"Milwaukee Health Services\",\n    \"slgId\": \"432-62\",\n    \"url\": \"https://mychart.ochin.org/MyChartMHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5FAA9B87-01B8-41F2-929B-40F6F803CFF4/562656ef855fabedfc9d56454797e9e2.png\",\n    \"name\": \"St. Anthony's\",\n    \"slgId\": \"432-63\",\n    \"url\": \"https://mychart.ochin.org/MyChartSA/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/58156723-4559-47CA-80ED-16787A040919/5ef26b488cf48ae26265bbd40eb54737.png\",\n    \"name\": \"Multnomah County Health Department\",\n    \"slgId\": \"432-64\",\n    \"url\": \"https://mychart.ochin.org/MyChartmultco/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EE050ACE-D80A-42FB-8AC7-071C2D5D38B6/38130cdaa55acf774c25b2126e117c71.png\",\n    \"name\": \"Care Alliance Health Center\",\n    \"slgId\": \"432-65\",\n    \"url\": \"https://mychart.ochin.org/MyChartCA/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D55F16E1-C950-4F12-93F9-32571D212FC2/b502137c1b80c7281443f750b0d06e08.png\",\n    \"name\": \"Jane Pauley Community Health Center\",\n    \"slgId\": \"432-66\",\n    \"url\": \"https://mychart.ochin.org/MyChartJPCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/215F5F67-1DA6-4D4E-B135-FAB765B0227D/2256ebc340ed821050e59d7d0b7777fa.png\",\n    \"name\": \"Alliance Medical Center\",\n    \"slgId\": \"432-67\",\n    \"url\": \"https://mychart.ochin.org/MyChartAMC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A99D91FB-F7C8-4C38-9696-78479CB03122/24548ef8a018c09f016a4f400a179380.png\",\n    \"name\": \"Wallace\",\n    \"slgId\": \"432-68\",\n    \"url\": \"https://mychart.ochin.org/MyChartWallace/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4DB8EB80-D701-43C4-A251-FA32C3C41117/9303ca18afddfa61d08f32e5bcc3f68e.png\",\n    \"name\": \"Nehalem Bay Health Center\",\n    \"slgId\": \"432-69\",\n    \"url\": \"https://mychart.ochin.org/NehalemBayHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/04C1B101-2DD1-4208-9CDD-25A6DD231CA5/3023c8814f2bc8f369f4e3e560272f75.png\",\n    \"name\": \"King County Public Health\",\n    \"slgId\": \"432-70\",\n    \"url\": \"https://mychart.ochin.org/MyChartKingCounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F4BA2F6-EB37-4FDC-9C5D-6D33007F1D38/279fc941a6793a7a3e49d10010c30878.png\",\n    \"name\": \"La Clinica\",\n    \"slgId\": \"432-71\",\n    \"url\": \"https://mychart.ochin.org/MyChartLaClinicaHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1D513D3A-EA60-4443-88DE-73406065BFAF/43a8e866db67136d15943d54aa628916.png\",\n    \"name\": \"Bartz-Altadonna Community Health Center\",\n    \"slgId\": \"432-72\",\n    \"url\": \"https://mychart.ochin.org/MyChartBACHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5388CEDC-4636-4326-AA38-2DBAF53CA453/8bebfb80e95a1e1c24d84dc4b9b71b87.png\",\n    \"name\": \"Clackamas County Health Centers\",\n    \"slgId\": \"432-73\",\n    \"url\": \"https://mychart.ochin.org/MyChartClackamas/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0C43C689-7288-4F42-A8EE-2F83C90E4E9C/4ee28ac4e1845ae6bbbb17bd686d4a60.png\",\n    \"name\": \"El Centro de Corazón\",\n    \"slgId\": \"432-74\",\n    \"url\": \"https://mychart.ochin.org/ECDC\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92AC5B00-78FF-4EC5-82D0-0223785BF9DD/c03db45e2b258d256cc02c9c8fc57693.png\",\n    \"name\": \"South of Market Health Center\",\n    \"slgId\": \"432-75\",\n    \"url\": \"https://mychart.ochin.org/MyChartEquityHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DBE652C3-EAB7-4533-B83B-A5B375CF1627/f23408e34ce26a327bd8a76649f76275.png\",\n    \"name\": \"Tillamook County Community Health Centers\",\n    \"slgId\": \"432-76\",\n    \"url\": \"https://mychart.ochin.org/MyChartTillamook/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F2E7FB36-C014-42D9-A57B-125D55BC4371/90befd1150923919aeb3cfea9b11d847.png\",\n    \"name\": \"Clinica Romero\",\n    \"slgId\": \"432-77\",\n    \"url\": \"https://mychart.ochin.org/MyChartCR/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CE8F90E1-DCE9-4A9F-8FAA-69DFAF19ED69/617aafa6412730d5e7b1e2bd157a1c9b.png\",\n    \"name\": \"Terry Reilly Health Services\",\n    \"slgId\": \"432-78\",\n    \"url\": \"https://mychart.ochin.org/MyChartTRHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/73E2C0B0-2C13-4535-9901-98677569B00D/ac5f7174f1ed63f8fbb90cc024a1046d.png\",\n    \"name\": \"Variety Care Health Centers\",\n    \"slgId\": \"432-79\",\n    \"url\": \"https://mychart.ochin.org/MyChartVCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A38FF012-8055-4988-8017-FBAAB6565860/f7230e2d781646285abd68a648775d1c.png\",\n    \"name\": \"Southwest Community Health Center\",\n    \"slgId\": \"432-80\",\n    \"url\": \"https://mychart.ochin.org/MyChartSWCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F4B8B78B-3729-4EB9-80EC-5A5FFE586260/8fcb89dd0c22c02c97469a71081c7fc6.png\",\n    \"name\": \"United Community & Family Services Healthcare\",\n    \"slgId\": \"432-81\",\n    \"url\": \"https://mychart.ochin.org/mychartucfs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19439B06-D589-4C13-AC30-C356A7322FDD/f82b30a737274cc871d443127d810744.png\",\n    \"name\": \"Equitas Health\",\n    \"slgId\": \"432-82\",\n    \"url\": \"https://mychart.ochin.org/mychartequitas/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/688F7A3C-0B0C-4AA8-A567-D7486A94A5CC/22c0625d40429882f18ccbdd8de4fe5c.png\",\n    \"name\": \"Albany County Department of Health\",\n    \"slgId\": \"432-83\",\n    \"url\": \"https://mychart.ochin.org/mychartach/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3182C82A-30A9-4AE1-8D7C-90E5B612E1DA/616a48c3eea06d38eae63df60d4bc46e.png\",\n    \"name\": \"Valley Family Health Care\",\n    \"slgId\": \"432-84\",\n    \"url\": \"https://mychart.ochin.org/mychartvfhc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D07E243-12B9-4833-8EDA-C4EB55683171/b93d5c1ac8458296bb5543e7da7994b9.png\",\n    \"name\": \"Asian Health Services\",\n    \"slgId\": \"432-85\",\n    \"url\": \"https://mychart.ochin.org/mychartahs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C7A6B777-94FF-4A65-81C5-EB8DE7473182/c9f39dbafe30bc56e81532a888c9caa9.png\",\n    \"name\": \"Seattle Indian Health Board\",\n    \"slgId\": \"432-86\",\n    \"url\": \"https://mychart.ochin.org/mychartsihb/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3A144D86-0E39-4331-B0C1-CD47198C3FEF/146d1664038aee62f6b30cfe655628a8.png\",\n    \"name\": \"InterCommunity Health Care\",\n    \"slgId\": \"432-87\",\n    \"url\": \"https://mychart.ochin.org/mychartintercommunity/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0501FBA4-18AA-4389-9BD1-83BC91E1931B/aa60273fe33e5f1251a73b19def59ec1.png\",\n    \"name\": \"Asian Counseling and Referral Service\",\n    \"slgId\": \"432-88\",\n    \"url\": \"https://mychart.ochin.org/mychartacrs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D533A14-2B62-4CEA-A24E-26FF3ECD5ED9/b8013c002959f1aa82461d052f647867.png\",\n    \"name\": \"Maple City Health Care Center\",\n    \"slgId\": \"432-89\",\n    \"url\": \"https://mychart.ochin.org/mychartMCHCC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2EBF76B5-5CDA-4D6D-88B9-50E58F666338/3c7e27644fc1ce787afefec317dd8353.png\",\n    \"name\": \"Adapt Integrated Health Care\",\n    \"slgId\": \"432-90\",\n    \"url\": \"https://mychart.ochin.org/mychartAdaptIHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3BD8D43D-60AD-44C0-B23E-ECC92E4CA755/cc13e0ef0aa702a74eb5ec3c0fd6547a.png\",\n    \"name\": \"Signature Health\",\n    \"slgId\": \"432-91\",\n    \"url\": \"https://mychart.ochin.org/mychartSH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D8C8B9AE-70B5-4DFA-B782-D00AA5DC5D71/72190965f493d6593fdf0dc78ddeb577.png\",\n    \"name\": \"Washington County Public Health\",\n    \"slgId\": \"432-92\",\n    \"url\": \"https://mychart.ochin.org/mychartwc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7A2280E4-47DC-4828-BA0A-4E5BE5BCCD83/565933f58662ab6210200a395a560526.png\",\n    \"name\": \"Amplify Health\",\n    \"slgId\": \"432-93\",\n    \"url\": \"https://mychart.ochin.org/mychartAdvanceCH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/44BBF4B1-80FD-4B2B-A354-A4A40AA1A5B6/39f3ea487b1d8355283b90cb953ff4d0.png\",\n    \"name\": \"Seattle Roots Community Health\",\n    \"slgId\": \"432-94\",\n    \"url\": \"https://mychart.ochin.org/MyChartSeattleroots/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3DF4AE17-FEEC-4BD7-954C-90884215E7DD/36745b49b5d403a3e5a7cb1e10bd1c94.png\",\n    \"name\": \"Community Health Systems\",\n    \"slgId\": \"432-95\",\n    \"url\": \"https://mychart.ochin.org/MyChartCHSOFWI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3C39E765-546B-4089-AF74-CB203579EA63/5bbfddff4e17e1f3b4eb055a0587e985.png\",\n    \"name\": \"HealthRIGHT 360\",\n    \"slgId\": \"432-96\",\n    \"url\": \"https://mychart.ochin.org/MyChartHealthRight360/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C90DBA43-9F17-4FDA-A0F0-ADEC5F31B83A/8e66884598c78bd23719a5b6ef890d1b.png\",\n    \"name\": \"Neighborcare Health\",\n    \"slgId\": \"432-97\",\n    \"url\": \"https://mychart.ochin.org/mychartnch/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63398B17-14DA-41EF-BDA5-92EF5F288B79/80c0488ae1baa774ea38a9f3caecff3e.png\",\n    \"name\": \"Quality of Life Health Services\",\n    \"slgId\": \"432-98\",\n    \"url\": \"https://mychart.ochin.org/MyChartQOL/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8928F0FE-C562-49F3-B9DE-410C6685F8E4/5dfecde4e56730993a7bbf826b243a42.png\",\n    \"name\": \"Cempa Community Care\",\n    \"slgId\": \"432-99\",\n    \"url\": \"https://mychart.ochin.org/MyChartCempa/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75EF3493-95FD-4FC7-8E1D-2B08D8D8DCF9/57c2de832812d6d95ea27a85dba252dd.png\",\n    \"name\": \"Indian Health Center of Santa Clara Valley\",\n    \"slgId\": \"432-100\",\n    \"url\": \"https://mychart.ochin.org/MyChartIHCSCV/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E93DFD2D-9427-4F58-A30A-9ED088E4CD1F/634221656af98dcb01d6fda348092bfe.png\",\n    \"name\": \"School Health Clinics of Santa Clara County\",\n    \"slgId\": \"432-101\",\n    \"url\": \"https://mychart.ochin.org/MyChartSHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/80179415-5280-4419-80AB-312BAD70C929/fc9174a087a810f56ba79ecc0777f1be.png\",\n    \"name\": \"Howard Brown Health\",\n    \"slgId\": \"432-102\",\n    \"url\": \"https://mychart.ochin.org/MyChartHBH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/50C1F16E-17A7-4496-820C-E14876D255AB/aaec7ae2d95e43f348ead00adf5f1938.png\",\n    \"name\": \"Prince George's County Health Department\",\n    \"slgId\": \"432-103\",\n    \"url\": \"https://mychart.ochin.org/mychartpgchd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/676F06F8-2A14-4DC4-928E-D9541955DC91/faab6e0cb83939e43f832cabf1121a44.png\",\n    \"name\": \"Bee Busy Wellness Center\",\n    \"slgId\": \"432-104\",\n    \"url\": \"https://mychart.ochin.org/mychartbbwc\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/93DA2024-412F-4CB5-BE51-6CAF6609F077/d75e9e06c04cdba8a6bef96fcef25968.png\",\n    \"name\": \"Planned Parenthood of Northern California\",\n    \"slgId\": \"432-106\",\n    \"url\": \"https://mychart.ochin.org/mychartppnorcal\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D9221D80-3879-41C4-A272-F6394C2A7D00/2f9852ee5dcef53b547c1d50b5a04365.png\",\n    \"name\": \"Gardner Health Services\",\n    \"slgId\": \"432-107\",\n    \"url\": \"https://mychart.ochin.org/MyChartGHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/153C15C4-9D22-45A4-B882-47C4440F105B/d6493e38fd8d58797142ca823259fea5.png\",\n    \"name\": \"Monterey County Health Department Clinic Services\",\n    \"slgId\": \"432-108\",\n    \"url\": \"https://mychart.ochin.org/MyChartMCHD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/211F2468-24AE-4E97-8D13-9FAB6F0B0C3D/6c01e99fd3e537e4ccc41e14d5170940.png\",\n    \"name\": \"Marin Community Clinic\",\n    \"slgId\": \"432-109\",\n    \"url\": \"https://mychart.ochin.org/MyChartMCC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4300D852-5172-44E9-96D9-4CC9F8A0983B/99039f14945298f6abf6582cd3a5f1cd.png\",\n    \"name\": \"Callen Lorde\",\n    \"slgId\": \"432-110\",\n    \"url\": \"https://mychart.ochin.org/MyChartCallen-Lorde/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/224FACF2-3CC0-49B3-B451-C57FB528FB5A/1c6bbdcd97bd4b336ff8519b99bff644.png\",\n    \"name\": \"VNA Health Care\",\n    \"slgId\": \"432-111\",\n    \"url\": \"https://mychart.ochin.org/MyChartVNAHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C7785A28-8697-454E-9FFD-23E143F9F672/caba6e8737d0c70cdbfd2f92d373084a.png\",\n    \"name\": \"AACI\",\n    \"slgId\": \"432-112\",\n    \"url\": \"https://mychart.ochin.org/MyChartAACI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BBC23DAA-6F60-4B30-9E42-516393ED3BB5/9fd763991c067adbf2a53b8aec05bf48.png\",\n    \"name\": \"Public Health Management Corporation\",\n    \"slgId\": \"432-113\",\n    \"url\": \"https://mychart.ochin.org/MyPHMCHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C295E7F2-3993-4E53-9850-C68E6158675C/f75c33cfa9c94736f0a83947eb6c6966.png\",\n    \"name\": \"Father Joe's Villages\",\n    \"slgId\": \"432-114\",\n    \"url\": \"https://mychart.ochin.org/MyChartSVDP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ADA2016B-9C60-4CE2-9044-7E004B7824A1/91eef634b851b3e44f6ccf1b7c1ad137.png\",\n    \"name\": \"River Valley Primary Care Services\",\n    \"slgId\": \"432-115\",\n    \"url\": \"https://mychart.ochin.org/MyChartRVPCS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F620AAD2-C8E6-47C8-A836-3014DC17AA45/0d3ed06501eded08ff3a836cfa70ce58.png\",\n    \"name\": \"Prime Health Plus\",\n    \"slgId\": \"432-116\",\n    \"url\": \"https://mychart.ochin.org/MyChartPrimeHealthPlus/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1208897A-660C-4C3C-AAE5-DC0714B8D310/72571d26b97239b0498ea327a2b0706f.png\",\n    \"name\": \"Kenosha Community Health Center\",\n    \"slgId\": \"432-117\",\n    \"url\": \"https://mychart.ochin.org/MyChartKCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/539593C4-9C76-4C31-9C48-9D66623933F2/0f23cbe66890327773c9c981730e6d2b.png\",\n    \"name\": \"Eagle View Community Health Center\",\n    \"slgId\": \"432-118\",\n    \"url\": \"https://mychart.ochin.org/MyChartEagleViewHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D04BF8FE-C070-4C9D-8D72-3DE00F9FBB4C/4e7c6f9b7715b4993aa89fa48ef11172.png\",\n    \"name\": \"Whatley Health Services\",\n    \"slgId\": \"432-120\",\n    \"url\": \"https://mychart.ochin.org/MyChartWhatleyHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E55930C1-C809-4459-843F-21E1B7CD419F/5a05b7b94524b2c380036828cd4ff093.png\",\n    \"name\": \"Community Health of Central Washington\",\n    \"slgId\": \"432-121\",\n    \"url\": \"https://mychart.ochin.org/MyChartCHCW/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D801A561-12C6-43D8-9A4C-7E7689AB7678/c7c5aa9f8840e45cc2d687f2d38966db.png\",\n    \"name\": \"Western North Carolina Community Health Services\",\n    \"slgId\": \"432-122\",\n    \"url\": \"https://mychart.ochin.org/WNCCHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/28F69BDE-412C-4530-A7FE-41DAB59C6493/ad89c12ce9496bab8987cf6af5142b2a.png\",\n    \"name\": \"Community Mental Health Affiliates\",\n    \"slgId\": \"432-123\",\n    \"url\": \"https://mychart.ochin.org/CMHACC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DDF39E80-197E-4749-8113-E320A3DF8FBD/f62fe645dd83faef6e00cc83225d15cd.png\",\n    \"name\": \"Southside Health Center\",\n    \"slgId\": \"432-124\",\n    \"url\": \"https://mychart.ochin.org/SouthsideCHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19E5DEBB-EC97-4490-8CBD-0D957A9CC46D/4ba3a776e3a49042f3492ce66892364b.png\",\n    \"name\": \"Cascadia Health\",\n    \"slgId\": \"432-125\",\n    \"url\": \"https://mychart.ochin.org/CascadiaHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F9CAD01E-259C-4ECC-A0AA-2B81E7E961B0/9a75f6ab56f59cfe0d477d229cadfd06.png\",\n    \"name\": \"Petaluma Health Center\",\n    \"slgId\": \"432-126\",\n    \"url\": \"https://mychart.ochin.org/PHealthCenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2AD2E55B-4C06-409B-A15E-549F2C43A1BA/26d75745a850ea255c54f7c98c7da7eb.png\",\n    \"name\": \"NOAH\",\n    \"slgId\": \"432-127\",\n    \"url\": \"https://mychart.ochin.org/NOAHHelps/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/159A973B-2918-4925-9D70-91B73C626FB4/68b03724029aa7cfcb0d1a3512976f94.png\",\n    \"name\": \"Friends of Family Health Center\",\n    \"slgId\": \"432-128\",\n    \"url\": \"https://mychart.ochin.org/FOFHealthCenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C525B4CB-211A-46B6-8B94-A7C501001E1F/dc103abd657729fd0cd513b74c8a75ff.png\",\n    \"name\": \"Minidoka Memorial Hospital\",\n    \"slgId\": \"432-129\",\n    \"url\": \"https://mychart.ochin.org/MyChartMinidoka/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/06B4796F-C3C5-43A9-86A5-3EA06E43DA7A/1bfd28bef55e25bd5936d7c529e503da.png\",\n    \"name\": \"Progressive Community Health Centers\",\n    \"slgId\": \"432-130\",\n    \"url\": \"https://mychart.ochin.org/ProgressiveCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4832E4EB-912A-4E15-8803-A570E35C8B19/b325bd2d793329d3df77d68450a9619c.png\",\n    \"name\": \"Triad Adult & Pediatric Medicine\",\n    \"slgId\": \"432-131\",\n    \"url\": \"https://mychart.ochin.org/TAPMedicine/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/999DE841-1045-468B-B794-51D92C5863F3/08680a136de3eafb0970d68fad6e4e30.png\",\n    \"name\": \"Santa Rosa Community Health\",\n    \"slgId\": \"432-132\",\n    \"url\": \"https://mychart.ochin.org/SRHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4B0CBEBC-DFC8-47E7-A8D2-C6815B9E74C3/db66cbb577c8c718e2298f57bb4bf172.png\",\n    \"name\": \"Bear Lake Memorial Clinic\",\n    \"slgId\": \"432-133\",\n    \"url\": \"https://mychart.ochin.org/BLMHospital/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BB1973F4-0799-459C-B928-63D16B1D26F2/48a60a3400fd9c10d4350b99a1a287f2.png\",\n    \"name\": \"SoHum Health\",\n    \"slgId\": \"432-134\",\n    \"url\": \"https://mychart.ochin.org/mychartshchd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2F9100B2-97C2-41CC-918C-C3DE25DFD258/3e3eacb71bd58294954df94a1a30074a.png\",\n    \"name\": \"Lower Lights Christian Health Center\",\n    \"slgId\": \"432-135\",\n    \"url\": \"https://mychart.ochin.org/LowerLightsHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/72430119-BAA6-4F8E-A7CD-AEA5FA5A7D0D/0506e27322cdaa0d96ef6f89b1e96403.png\",\n    \"name\": \"Star Valley Health\",\n    \"slgId\": \"432-136\",\n    \"url\": \"https://mychart.ochin.org/mychartsvh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B27E4AAC-C011-46D8-8B3A-9BDBDDA7FF6E/96ee1a100e1ed1aa20d7d936f4c8413a.png\",\n    \"name\": \"Sonoma Valley Community Health Center\",\n    \"slgId\": \"432-137\",\n    \"url\": \"https://mychart.ochin.org/svchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AE5B2391-D019-4ADD-80FE-1946A1201A12/333913fc57eb1e5ebbd2241eea2dcfae.png\",\n    \"name\": \"River Hills Community Health Center\",\n    \"slgId\": \"432-138\",\n    \"url\": \"https://mychart.ochin.org/riverhillshealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E822B994-F4CA-40FC-BB96-2DA9E90D15AE/fae8e9457e3078ecd9bdd61e76be6c99.png\",\n    \"name\": \"Lakewood Health System\",\n    \"slgId\": \"432-139\",\n    \"url\": \"https://mychart.ochin.org/mychartlhs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0094CA64-764E-4585-A828-30631307EE1D/118c156fdb00f6a727d2d695d1404e6c.png\",\n    \"name\": \"Community Health Center of Southeastern Iowa\",\n    \"slgId\": \"432-140\",\n    \"url\": \"https://mychart.ochin.org/chcseia/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACECE089-92F5-436A-9D64-AFEC42FE47EF/d928e082e6266b26a86de627d2681bc3.png\",\n    \"name\": \"All Care Health Center\",\n    \"slgId\": \"432-141\",\n    \"url\": \"https://mychart.ochin.org/allcarehealthcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2AE1CA9E-6E6F-4C99-B3E6-35FEDBCEA56E/191ed72d3f2ec0da4c204e99584e5b2e.png\",\n    \"name\": \"Outreach Community Health Centers\",\n    \"slgId\": \"432-142\",\n    \"url\": \"https://mychart.ochin.org/ochc-milw/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F938B880-2585-4A9F-916A-1D1F3C7A1153/6c879a88cdeca08a80f2fd8d68a772a6.png\",\n    \"name\": \"Community Health Center of Fort Dodge\",\n    \"slgId\": \"432-143\",\n    \"url\": \"https://mychart.ochin.org/chcfd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F299C53-2D2D-4BAB-816F-6E2BB9DF4D26/9fd757e0e7d3785364d9adbbe561f138.png\",\n    \"name\": \"Peoples Community Health Clinic\",\n    \"slgId\": \"432-144\",\n    \"url\": \"https://mychart.ochin.org/peoples-clinic/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37805BFF-41C2-4176-AFAD-3E00090DECA9/0635367692dd621794b3f94bebd252a8.png\",\n    \"name\": \"Crescent Community Health Center\",\n    \"slgId\": \"432-145\",\n    \"url\": \"https://mychart.ochin.org/crescentchc/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D5E69FAA-1AF0-412C-BBF4-1B83C1BE94A6/06602265edbefb53336168a965fbf7b8.png\",\n    \"name\": \"Family Health Center of Marshfield\",\n    \"slgId\": \"432-146\",\n    \"url\": \"https://mychart.ochin.org/familyhealthcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F0352A6B-3594-4458-9D01-7A488B35686D/84de483b281f48ec791f9d1698a44ebe.png\",\n    \"name\": \"Primary Health Care\",\n    \"slgId\": \"432-147\",\n    \"url\": \"https://mychart.ochin.org/phciowa/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/922E13C7-D61E-4E17-992F-A3F2F06DD2CC/27f898aa7af37570810024cf07476905.png\",\n    \"name\": \"Infinity Health Care\",\n    \"slgId\": \"432-148\",\n    \"url\": \"https://mychart.ochin.org/weareinfinityhealth/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8007812C-F5BA-43B1-A640-EF2E4A4C232F/4f48cd9e96d4f3d067c7a4bc383caa06.png\",\n    \"name\": \"Siouxland Community Health Center\",\n    \"slgId\": \"432-149\",\n    \"url\": \"https://mychart.ochin.org/slandchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/248A4B87-5720-4ABC-89C5-08FF3B1D5256/d230b21a9be9de163f32018b9d1ba5ff.png\",\n    \"name\": \"Community Health Care, Inc\",\n    \"slgId\": \"432-150\",\n    \"url\": \"https://mychart.ochin.org/chcqca/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D9505B2-CE99-4BB0-97F0-658442628067/070e4e1e1df28d413313cf0c7dc3019f.png\",\n    \"name\": \"Harmony Health Medical Clinic\",\n    \"slgId\": \"432-151\",\n    \"url\": \"https://mychart.ochin.org/myharmonyhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/401BE3C7-7552-4194-93FD-F98BD47A6C8C/c11842fafc76cbb30c085cab74032582.png\",\n    \"name\": \"Burnett Medical Center\",\n    \"slgId\": \"432-152\",\n    \"url\": \"https://mychart.ochin.org/burnettmedicalcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D5DBBC0F-029E-4B5A-B908-99EBE61BA6A0/6084b540697d7232c3dca63cf7200b2d.png\",\n    \"name\": \"United Community Health Center\",\n    \"slgId\": \"432-153\",\n    \"url\": \"https://mychart.ochin.org/unitedcommunityhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09D011A2-B37F-42DD-A0CE-45EC081DB935/78c385c073271af6a3ded0427aad4049.png\",\n    \"name\": \"CamCare\",\n    \"slgId\": \"432-154\",\n    \"url\": \"https://mychart.ochin.org/camcare/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8F6220BF-C25D-48D3-ACA9-96B7A0272FFD/71d360e728fd698af78e9a2b2f75b680.png\",\n    \"name\": \"Central Outreach Wellness Center\",\n    \"slgId\": \"432-155\",\n    \"url\": \"https://mychart.ochin.org/centraloutreach/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6AB36D3F-44A3-4AAA-A44D-B6636BB02F34/7e738e96387e28dcfce39843ba02afc9.png\",\n    \"name\": \"Jewish Community Free Clinic\",\n    \"slgId\": \"432-156\",\n    \"url\": \"https://mychart.ochin.org/jewishfreeclinic/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E320317-86DA-4F3F-8524-685238B36351/6a08ca418c63e4561ed3c2808137ea1b.png\",\n    \"name\": \"Riverwood Healthcare Center\",\n    \"slgId\": \"432-157\",\n    \"url\": \"https://mychart.ochin.org/rwhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3B6AD5CD-A62E-4D70-92F0-A5D53622B096/d9728b0e0d96e88d2845f0403a11a322.png\",\n    \"name\": \"Sacramento County Public Health\",\n    \"slgId\": \"432-158\",\n    \"url\": \"https://mychart.ochin.org/scph/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ECDC6AFC-84CE-469A-9CBE-24E620C90C92/972f7c8e3debfe114c06ce67195477f6.png\",\n    \"name\": \"People's Community Clinic\",\n    \"slgId\": \"432-159\",\n    \"url\": \"https://mychart.ochin.org/mychartaustinpcc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D695FA26-596E-4BE7-AD26-67ED7810CA9E/6f3a3d66abd236c73862634ed5003148.png\",\n    \"name\": \"Citizens Health\",\n    \"slgId\": \"432-160\",\n    \"url\": \"https://mychart.ochin.org/cmciks/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/816E2922-9FF7-4A9A-B157-DA26055C45BC/04b22b29d7bb9581c12946a3d378a27d.png\",\n    \"name\": \"Central City Concern\",\n    \"slgId\": \"432-161\",\n    \"url\": \"https://mychart.ochin.org/centralcityconcern/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C7ABEA66-6A31-4430-A1BF-A9789EF79767/c358927ec4d20dc4b98398056a7db807.png\",\n    \"name\": \"Radiant Health Centers\",\n    \"slgId\": \"432-162\",\n    \"url\": \"https://mychart.ochin.org/MyChartRadiantHealthCenters/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6979D048-3583-448D-8C2C-455FC2460FFF/87e47fbad9a2626989f2571af4d29787.png\",\n    \"name\": \"Wilmington Community Clinic\",\n    \"slgId\": \"432-163\",\n    \"url\": \"https://mychart.ochin.org/wilmingtoncc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/55C55ABD-8200-4427-BED7-D5128A11A78B/f5044bbf1adfdd3a6311aba4c7a10f0a.png\",\n    \"name\": \"Ko-Kwel Wellness Center\",\n    \"slgId\": \"432-164\",\n    \"url\": \"https://mychart.ochin.org/mychartkokwelwellness/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F1CE3370-83C3-44D9-B03E-F754488BCE45/fd245b6e84bac918e54ee4b50502e688.png\",\n    \"name\": \"BestCare Treatment\",\n    \"slgId\": \"432-165\",\n    \"url\": \"https://mychart.ochin.org/bestcaretreatment/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DB167C99-1407-486E-9A32-145328CA1F44/b03223ca482affb88755a95c356744d0.png\",\n    \"name\": \"Native American Community Clinic\",\n    \"slgId\": \"432-166\",\n    \"url\": \"https://mychart.ochin.org/NACC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9C177F82-1946-4C6F-8D9C-3C02C559E09D/98d19b35f620857948e3bddf75c5376e.png\",\n    \"name\": \"Winters Healthcare\",\n    \"slgId\": \"432-167\",\n    \"url\": \"https://mychart.ochin.org/wintershealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/21E41F98-9F17-4626-9CE6-20CFFC47EFED/9207acb8995faabfb79d0c3205bd7502.png\",\n    \"name\": \"Mountain Valleys Health Centers\",\n    \"slgId\": \"432-168\",\n    \"url\": \"https://mychart.ochin.org/mountainvalleyshealthcenters/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D5997CD5-3340-4D84-9C24-4BA92EF30669/be202030e7f76840ce1a845a13a5864b.png\",\n    \"name\": \"Syracuse Community Health\",\n    \"slgId\": \"432-169\",\n    \"url\": \"https://mychart.ochin.org/syracusecommunityhealthmychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B85E00A-AD87-4DC3-A37E-A34C079ECBD7/4d0319d4f9d686b6faf4b7fef446b908.png\",\n    \"name\": \"Baltimore City Health Department\",\n    \"slgId\": \"432-170\",\n    \"url\": \"https://mychart.ochin.org/health.baltimorecity/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5EC3B371-896A-4A0E-9598-9605AA9FA3CF/6b36621a766079a2652552bbe4f9010d.png\",\n    \"name\": \"Indian Health Board of Minneapolis\",\n    \"slgId\": \"432-171\",\n    \"url\": \"https://mychart.ochin.org/IHB/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09804572-C521-4A36-843B-29C719E414F3/42060501e5d7ddb6375b88703470769b.png\",\n    \"name\": \"Gritman Medical Center\",\n    \"slgId\": \"432-172\",\n    \"url\": \"https://mychart.ochin.org/gritman/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4A98D79C-DA59-4930-938D-3BF29060934E/3e76e33e89a4f3ba182d45f41ad7207d.png\",\n    \"name\": \"Jordan Valley Community Health Center\",\n    \"slgId\": \"432-173\",\n    \"url\": \"https://mychart.ochin.org/jordanvalleymychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0D1A4BF9-B99D-4E94-9CA0-F902A5A1588A/a15ecfd1ecf78d0742e78ed496177207.png\",\n    \"name\": \"Nevada Health Centers\",\n    \"slgId\": \"432-174\",\n    \"url\": \"https://mychart.ochin.org/nvhc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AAB6F4F0-97F8-454F-9255-AED4478A9934/bfbef02c8eb9c47fb573f049573a2328.png\",\n    \"name\": \"River People Health Center\",\n    \"slgId\": \"432-175\",\n    \"url\": \"https://mychart.ochin.org/rphc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6498B7C4-6071-4036-8EAF-32CE5E9FF3AF/b4cb9db96b7d52e4d419b5f08d607ee3.png\",\n    \"name\": \"Lawndale Christian Health Center\",\n    \"slgId\": \"432-176\",\n    \"url\": \"https://mychart.ochin.org/mylawndale/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1BB9A5B5-85F9-4D05-8739-1E4B6FD53438/8f014813ba65dad37ec864de4a0427b0.png\",\n    \"name\": \"CommuniCare+OLE\",\n    \"slgId\": \"432-178\",\n    \"url\": \"https://mychart.ochin.org/ccolemychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8203680D-7E29-43D5-BBAA-B941BAE19B19/fa87268a5d76a07ff0e7558ccbe1ccc6.png\",\n    \"name\": \"Grace Health\",\n    \"slgId\": \"432-179\",\n    \"url\": \"https://mychart.ochin.org/gracehealthKY/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CCD497F0-3CEA-48B7-882D-E3DE4C2EA505/8e96765a52fe5535b10ffec83d00e03f.png\",\n    \"name\": \"Solano County\",\n    \"slgId\": \"432-180\",\n    \"url\": \"https://mychart.ochin.org/SolanoCountyHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/903C2FEF-D2D2-4B28-917D-2750D8637EAA/3741eacba5c1be926056f32f4c567ade.png\",\n    \"name\": \"Washoe Tribal Health Center\",\n    \"slgId\": \"432-181\",\n    \"url\": \"https://mychart.ochin.org/washoemychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/213AA6B4-B500-4CCD-BA8A-0009727FCC5A/5896a9817465e7c5f7e02fe43cefe944.png\",\n    \"name\": \"Indian Health Council\",\n    \"slgId\": \"432-182\",\n    \"url\": \"https://mychart.ochin.org/indianhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2E58325D-EBEB-431B-A914-D0A8850327B2/00e477005a618d8f81b2d6fa5e8bc5f5.png\",\n    \"name\": \"Osceola Medical Center\",\n    \"slgId\": \"432-183\",\n    \"url\": \"https://mychart.ochin.org/omc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2855C7CE-8EEB-44D7-A730-F7E576DFE7A8/957d20a065c0752a24bfcfd9a0173eef.png\",\n    \"name\": \"Kahuku Medical Center\",\n    \"slgId\": \"432-184\",\n    \"url\": \"https://mychart.ochin.org/kahukumedicalcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91E469B1-FA6C-4096-86FB-FD8BE2768E25/4729b42afb889bd6903db6b5ebc0e94d.png\",\n    \"name\": \"Santa Cruz Community Health\",\n    \"slgId\": \"432-185\",\n    \"url\": \"https://mychart.ochin.org/schealthcenters/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F3F6F9A-DBD3-4A0B-B336-A8C9CF3CC62F/604e08044b08e401e8aa74c5d7f984c3.png\",\n    \"name\": \"Stigler Health and Wellness Center\",\n    \"slgId\": \"432-186\",\n    \"url\": \"https://mychart.ochin.org/healthwellnssokMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"RRHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B1BC2BCB-6858-4F05-8EAD-0463491AA73E/81f1009b216e21517125d4e4a223cb05.png\",\n    \"name\": \"Redwoods Rural Health Center\",\n    \"slgId\": \"432-187\",\n    \"url\": \"https://mychart.ochin.org/RRHCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2CBD84C5-A8E3-4B7F-AF0A-5003C9842358/2cb199b6ca66d51e44e22f850a66ea29.png\",\n    \"name\": \"The NATIVE Project\",\n    \"slgId\": \"432-188\",\n    \"url\": \"https://mychart.ochin.org/NATIVEProject/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3E7EDDFB-3514-46C4-94EE-81980DA29E35/e186ebdbd26c056a39366f43c156319b.png\",\n    \"name\": \"Ray County Hospital and Healthcare\",\n    \"slgId\": \"432-189\",\n    \"url\": \"https://mychart.ochin.org/RCHH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A9CAAE9B-9B8D-4293-8963-714A3FD208AB/8d349467a259342b24c797dfdd9364a2.png\",\n    \"name\": \"Vivent Health\",\n    \"slgId\": \"432-190\",\n    \"url\": \"https://mychart.ochin.org/viventhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3EA05A3C-FEE9-431D-9950-527D8D185F63/9a380eb3c6f525d63d1961852df0bd2f.png\",\n    \"name\": \"Unity Care NW\",\n    \"slgId\": \"432-191\",\n    \"url\": \"https://mychart.ochin.org/UnityCareNW/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CB5F325B-884B-4043-9DF9-F1F8CA667957/5f79e599fd41c336743eaa746fcd9a7e.png\",\n    \"name\": \"Minnesota Community Care\",\n    \"slgId\": \"432-192\",\n    \"url\": \"https://mychart.ochin.org/mcc/\"\n  },\n  {\n    \"aliases\": [\n      \"PSP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2478B855-7725-49A8-A469-99EB96923909/d614ea00e2e6c5fee89014efadd454eb.png\",\n    \"name\": \"Palouse Specialty Physicians\",\n    \"slgId\": \"432-193\",\n    \"url\": \"https://mychart.ochin.org/PSP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/417DC34F-56DD-4626-947A-AC5DA87927F7/841fc55a90c2d2acfb7b4d82094de45f.png\",\n    \"name\": \"Madison Regional Health System\",\n    \"slgId\": \"432-194\",\n    \"url\": \"https://mychart.ochin.org/MRHSMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/55156957-DE12-4AC2-9FC4-283714DF63A5/f44dab71ed24fc74222fc348a54b9d00.png\",\n    \"name\": \"City of Milwaukee Health Department\",\n    \"slgId\": \"432-195\",\n    \"url\": \"https://mychart.ochin.org/mhdmychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/53C1DDD0-7ECF-43C2-A1CE-A9597CB44E7E/ea3a17ff486c18ee1c9feb547bad2159.png\",\n    \"name\": \"Habitat Health\",\n    \"slgId\": \"432-196\",\n    \"url\": \"https://mychart.ochin.org/habitathealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E44AB895-BD0B-4CA2-A38D-F2425F46C7F3/9f314ce04a5609f7c91dff0009a26a1a.png\",\n    \"name\": \"Venice Family Clinic\",\n    \"slgId\": \"432-197\",\n    \"url\": \"https://mychart.ochin.org/VFC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/95B888E5-1C06-464E-A7C1-8EE127A96617/5d7f15621fd82bfd48ffea06c9d612cc.png\",\n    \"name\": \"Community Medical Centers\",\n    \"slgId\": \"432-198\",\n    \"url\": \"https://mychart.ochin.org/cmcenters/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/33B6C564-B6AC-4E1C-9A84-89D12C2DD23D/485124110e7249d83d69b7fb9a3fa40b.png\",\n    \"name\": \"Columbia Community Mental Health\",\n    \"slgId\": \"432-199\",\n    \"url\": \"https://mychart.ochin.org/CCMH1/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3050BD27-49B3-4FE2-BCEF-D0198E307B44/0a2eee9e70f861c16630f2c08bca079f.png\",\n    \"name\": \"Elevated Community Health\",\n    \"slgId\": \"432-200\",\n    \"url\": \"https://mychart.ochin.org/ElevatedCH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A5DFE016-4ED4-45BA-B6E4-9F69CA640C41/7759a08f9adfbbf1c486516290ff0c64.png\",\n    \"name\": \"WellSpace Health\",\n    \"slgId\": \"432-201\",\n    \"url\": \"https://mychart.ochin.org/WellSpaceHealthMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E37EC101-5E9F-4A40-BD93-DBB65271EC90/8ad2cd657b5f396a0cb120b8f647a6ce.png\",\n    \"name\": \"Root Center for Advanced Recovery\",\n    \"slgId\": \"432-202\",\n    \"url\": \"https://mychart.ochin.org/rootcentermychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5C38BB2A-F20A-464F-8E8E-08C9FFFA09E2/a10fcae95209c621984deebdf793d728.png\",\n    \"name\": \"Sublette County Health\",\n    \"slgId\": \"432-203\",\n    \"url\": \"https://mychart.ochin.org/sublette/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2E6AAED8-6A0C-4E15-BE61-1F8FEA1C840B/b6d9380e74892de43ccb5f2c6ddbcf5f.png\",\n    \"name\": \"Lynn Community Health Center\",\n    \"slgId\": \"432-204\",\n    \"url\": \"https://mychart.ochin.org/LynnCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3DA8CE81-3FC6-431F-B497-41A91397C6CD/57c5d8776d44f45e1d8a9161287c9aa0.png\",\n    \"name\": \"Sonoma County Indian Health Project\",\n    \"slgId\": \"432-205\",\n    \"url\": \"https://mychart.ochin.org/SCIHP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8F1B9611-B808-450A-8A57-ADB481127A3B/47188e029f3f4f076f202a11dbd2469c.png\",\n    \"name\": \"Muslim Community and Health Care\",\n    \"slgId\": \"432-206\",\n    \"url\": \"https://mychart.ochin.org/MyChartMCHCWI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F161287A-AC40-4F3E-B836-AA50A13B11A6/e312954180de1c85c283cc3b196820d2.png\",\n    \"name\": \"Bertie County Rural Health\",\n    \"slgId\": \"432-207\",\n    \"url\": \"https://mychart.ochin.org/BCRHA/\"\n  },\n  {\n    \"aliases\": [\n      \"CBWCHC, 王嘉廉社區醫療中心\",\n      \"CBWCHC\",\n      \"王嘉廉社區醫療中心\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/88DF1783-6E98-44F1-94A7-74D53B9F5F62/a7a84c743521db7604b661c31394ead2.png\",\n    \"name\": \"Charles B. Wang Community Health Center\",\n    \"slgId\": \"432-208\",\n    \"url\": \"https://mychart.ochin.org/cbwchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/98743675-92EB-4514-B792-7F6896F2C6F8/fd6130b965986514ba4b7ca5023e5f49.png\",\n    \"name\": \"Clinicas Del Camino Real\",\n    \"slgId\": \"432-209\",\n    \"url\": \"https://mychart.ochin.org/clinicas/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/68CFBE44-6845-4DC6-B1D3-971E63308CB4/3e70b1329bd537f1e92104b55841f66c.png\",\n    \"name\": \"Sawtooth Mountain Clinic\",\n    \"slgId\": \"432-210\",\n    \"url\": \"https://mychart.ochin.org/smc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/49886CD4-5DD6-41E7-9CA9-DD07DE12A3D3/c18f25c9ae585ad6647db7396e2ec861.png\",\n    \"name\": \"Lake Superior Community Health Center\",\n    \"slgId\": \"432-211\",\n    \"url\": \"https://mychart.ochin.org/lschc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/456EAFE5-CED8-442A-BD6A-B056CC385F23/379d28a7a8581acd963faed44e14a432.png\",\n    \"name\": \"United Indian Health Services\",\n    \"slgId\": \"432-212\",\n    \"url\": \"https://mychart.ochin.org/uihs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8316AEB7-5769-43B6-9258-B02AFD07DCE6/e70d9f709c24a0c4088b4256027046cc.png\",\n    \"name\": \"Community Health Services, Inc\",\n    \"slgId\": \"432-213\",\n    \"url\": \"https://mychart.ochin.org/CHSImychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/874CB8EB-3BF9-4810-96F5-8C2E5DE690DC/7ab2c721c76987b7d2cb5fe96331c244.png\",\n    \"name\": \"Little Traverse Bay Bands\",\n    \"slgId\": \"432-214\",\n    \"url\": \"https://mychart.ochin.org/ltbbhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A392736-7771-4937-9D5D-733C8885113C/7f36350a0d3fb670e6c92b0f77daa5a7.png\",\n    \"name\": \"Scenic Rivers Health Services\",\n    \"slgId\": \"432-215\",\n    \"url\": \"https://mychart.ochin.org/scenicrivershealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B257038A-ABF9-4CAF-95D3-09C0EECFB05F/d8fb5a38643d459a0d2d9da47d4db564.png\",\n    \"name\": \"Chehalis Tribal Wellness Center\",\n    \"slgId\": \"432-216\",\n    \"url\": \"https://mychart.ochin.org/ChehalistribeMychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/55D916CF-D4E3-4883-B5E1-14022B3823B4/3c9a0f088e4a105b4d496b30885606bb.png\",\n    \"name\": \"Marimn Health\",\n    \"slgId\": \"432-217\",\n    \"url\": \"https://mychart.ochin.org/marimnhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0725DDC1-8570-4F01-9E60-F9690B950E26/8be3e760ada046bf99871bb8f1d8f7ac.png\",\n    \"name\": \"Cascade Medical Center\",\n    \"slgId\": \"432-218\",\n    \"url\": \"https://mychart.ochin.org/cascademedicalcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7C8820BB-56E5-4429-8B54-6F4A5050EFDF/0fadc24796c7e33affac82f2e0fcf77d.png\",\n    \"name\": \"Flandreau Santee Sioux Tribal Health Center\",\n    \"slgId\": \"432-219\",\n    \"url\": \"https://mychart.ochin.org/flandreautribalhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EEFDA95D-4689-4C49-8F66-70B77575A2A6/5eb711d5e0d193219e81d27cf8db140d.png\",\n    \"name\": \"Wallowa Valley Center for Wellness\",\n    \"slgId\": \"432-220\",\n    \"url\": \"https://mychart.ochin.org/wvcenterforwellness/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/46C79821-33C5-4698-9193-E5461B4A0344/29e8c5d18ccfcaaa90a95daa66bc0b71.png\",\n    \"name\": \"Immanuel PACE\",\n    \"slgId\": \"432-221\",\n    \"url\": \"https://mychart.ochin.org/immanuel/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B90F1919-CF5F-4717-BB71-270CBFDA579F/ac6c1fb8c4bad21028a63af962902ad1.png\",\n    \"name\": \"San Luis Obispo Public Health Department\",\n    \"slgId\": \"432-222\",\n    \"url\": \"https://mychart.ochin.org/slopublichealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A86D4D31-83F4-4B34-A0FC-C23429C6881E/db013ed494929e00254c1cb635f2b91f.png\",\n    \"name\": \"Peak Vista\",\n    \"slgId\": \"432-233\",\n    \"url\": \"https://mychart.ochin.org/PeakVista/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A2BBC05-FAFC-40A7-862A-165F6CD42A7F/7aeda64b219f405fae4a8a4de11c88ba.png\",\n    \"name\": \"Open Door Health Center\",\n    \"slgId\": \"432-234\",\n    \"url\": \"https://mychart.ochin.org/ODHCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6982E93C-6458-4E04-BE2C-12D392F26099/f378e91f4336a15ebde44b0b873f7ed0.png\",\n    \"name\": \"Missouri Ozarks\",\n    \"slgId\": \"432-235\",\n    \"url\": \"https://mychart.ochin.org/missouriozarks/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9F50E3AE-47F1-4CCF-924C-86BC5CEBA39F/23c7f5dabf02986c82692ee630794f1c.png\",\n    \"name\": \"Pueblo Community Health Center\",\n    \"slgId\": \"432-236\",\n    \"url\": \"https://mychart.ochin.org/pueblocommunityhealthcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B6B293CB-327E-4287-B18B-0DC8C0FA1A6D/f510a01137f78c94998d140353a1083c.png\",\n    \"name\": \"JAMHI\",\n    \"slgId\": \"432-237\",\n    \"url\": \"https://mychart.ochin.org/JAMHI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/519EBEA5-3253-4300-B32E-880B0E88310C/15db7bd3dd6e763fe3809d3da3b9914d.png\",\n    \"name\": \"Yakima Neighborhood Health\",\n    \"slgId\": \"432-238\",\n    \"url\": \"https://mychart.ochin.org/ynhsmychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63D4BB72-9FD9-42B6-BF4F-6CC4EE440E28/48e094d9461b7a126be9a53d4c9580d1.png\",\n    \"name\": \"CITTHS\",\n    \"slgId\": \"432-239\",\n    \"url\": \"https://mychart.ochin.org/CITHHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/368F76C6-324C-4E1B-9B09-95603D0F2260/74aa6fc4c4539786c58b7ef49cd6d1ad.png\",\n    \"name\": \"Bigfork Valley\",\n    \"slgId\": \"432-240\",\n    \"url\": \"https://mychart.ochin.org/bigforkvalley/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7868F7F6-0EE9-4078-97D7-3F1801B01947/2215b3209e3e165480ca318cfef40ab1.png\",\n    \"name\": \"LALGBT Center\",\n    \"slgId\": \"432-241\",\n    \"url\": \"https://mychart.ochin.org/lalgbtcenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6890873E-0138-4B98-88CB-E7E7042CC99D/9e2b4e4ef86199c042de9e1d8badffec.png\",\n    \"name\": \"Puyallup Tribal Health Authority\",\n    \"slgId\": \"432-242\",\n    \"url\": \"https://mychart.ochin.org/ptha/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/185726C7-BEDC-47DB-8FCB-447D39DB5942/912b21062f84c104ea7f825f112147c4.png\",\n    \"name\": \"Muckleshoot Tribal Health & Wellness Center\",\n    \"slgId\": \"432-243\",\n    \"url\": \"https://mychart.ochin.org/muckleshoot/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0B37EE11-67CB-442E-A083-38CFE1831FB9/c3b4c254eac9d89ed9f07729e0b953e3.png\",\n    \"name\": \"One Health Center\",\n    \"slgId\": \"432-244\",\n    \"url\": \"https://mychart.ochin.org/OHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/71544DB8-1F4F-4B8D-94FA-A5A9AD332757/e9fc0784194f08e4bf8b235c8217c188.png\",\n    \"name\": \"Waianae Coast Comprehensive Care\",\n    \"slgId\": \"432-245\",\n    \"url\": \"https://mychart.ochin.org/wcchc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4598A388-E94E-4089-989B-28C0F137FFBD/1dc940163ebad8e765e562bef812df98.png\",\n    \"name\": \"PacificSource PACE\",\n    \"slgId\": \"432-246\",\n    \"url\": \"https://mychart.ochin.org/pacificsourcepace/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5C4080F9-4BE3-4AEB-BEC0-261B0FCABCE3/b55e00f90343b706edccea44562e4645.png\",\n    \"name\": \"Jackson County Regional Health Center\",\n    \"slgId\": \"432-247\",\n    \"url\": \"https://mychart.ochin.org/JCRHC/\"\n  },\n  {\n    \"aliases\": [\n      \"CHCB\",\n      \"Community Health Centers of Burlington\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A58429BB-B04B-4D7B-A4EB-93AFB13B181C/fd040509a98885db7a8c4eb2312fd6cb.png\",\n    \"name\": \"Community Health Centers Burlington\",\n    \"slgId\": \"432-248\",\n    \"url\": \"https://mychart.ochin.org/CHCB/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/28EF12BB-1E15-4339-8FF7-8BE58B26753B/a5e6089b12f008a5257637bd7aa61b61.png\",\n    \"name\": \"The Healthcare Connection\",\n    \"slgId\": \"432-249\",\n    \"url\": \"https://mychart.ochin.org/healthcareconnection/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E264DA44-3596-4954-A440-803BA9A5971A/deb5b3b024931a86dbd5519187976451.png\",\n    \"name\": \"Piedmont Health\",\n    \"slgId\": \"432-250\",\n    \"url\": \"https://mychart.ochin.org/piedmonthealth/\"\n  },\n  {\n    \"aliases\": [\n      \"RBHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2435C85A-FF6D-46EE-89BE-0FF79E14C932/4317c646b638fad82ec63931c04dd640.png\",\n    \"name\": \"Rocky Boy Health Center\",\n    \"slgId\": \"432-251\",\n    \"url\": \"https://mychart.ochin.org/RBHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E069B0EE-08E8-4D24-AF09-A859B8952F18/e00b0ee81e13f2b3115dcaf027505211.png\",\n    \"name\": \"Squaxin Island Tribal Health Center\",\n    \"slgId\": \"432-252\",\n    \"url\": \"https://mychart.ochin.org/Squaxin/\"\n  },\n  {\n    \"aliases\": [\n      \"CIBD\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB46E058-FE98-447E-95A1-8AC214D867CA/1b77dd21055cb3a13756c59ab8f7d43e.png\",\n    \"name\": \"Center for Comprehensive Care & Diagnosis of Inherited Blood Disorders\",\n    \"slgId\": \"432-253\",\n    \"url\": \"https://mychart.ochin.org/CIBD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4F75B91D-9698-4A14-A96D-985F6C44ABB8/28a6147346c7a62ff00fd03473e67c9b.png\",\n    \"name\": \"Siskiyou Community Health Center\",\n    \"slgId\": \"432-254\",\n    \"url\": \"https://mychart.ochin.org/SiskiyouMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Kimaw Medical Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E4876C9F-E41F-4B7D-B594-17369955FD70/c253e73130b9521d88fd553e86209c83.png\",\n    \"name\": \"K'ima:w Medical Center\",\n    \"slgId\": \"432-255\",\n    \"url\": \"https://mychart.ochin.org/KimawMedicalCenter/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D0806623-37D6-4918-B444-1C2CC3952082/c37e62bf078c828f3e310541d62cd6b5.png\",\n    \"name\": \"San Diego County\",\n    \"slgId\": \"432-256\",\n    \"url\": \"https://mychart.ochin.org/sandiegocounty/\"\n  },\n  {\n    \"aliases\": [\n      \"Westside Family Healthcare\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9FFA9E64-A9C6-4028-A55F-44A6C6A0CC5B/2d74ccdf96b69853bc2e09df15436ff6.png\",\n    \"name\": \"West Side Family Healthcare\",\n    \"slgId\": \"432-257\",\n    \"url\": \"https://mychart.ochin.org/MyWestside/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EF3C0132-BD37-4C1A-ABD3-EB8AB8E565D5/917d3c5f4ad06d3f51af3910995fa279.png\",\n    \"name\": \"Guthrie\",\n    \"slgId\": \"433\",\n    \"url\": \"https://e.guthrie.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UHNJ\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7CEF7BFE-D567-429D-9B5D-5FF4B6AF40C2/042dcec91b61a70fb0acf022e5f07da4.png\",\n    \"name\": \"University Hospital\",\n    \"slgId\": \"434\",\n    \"url\": \"https://mychart.uhnj.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Prevea\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7CAF78B4-2EC3-4DE8-8DE3-FD21CA9BCA1B/e4149a9d0c46df36735eb0639ae5fcdc.png\",\n    \"name\": \"Hospital Sisters Health System\",\n    \"slgId\": \"441\",\n    \"url\": \"https://www.myhshs.org/myhshs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4E9DABBB-833A-4E83-BD3C-AF5AF78B88CD/ec556989b9522ba85cf6929b630b804f.png\",\n    \"name\": \"Prevea Health\",\n    \"slgId\": \"441-2\",\n    \"url\": \"https://www.myprevea.com/MyPrevea/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9B63B48A-5D8D-470C-90A9-F1F29F21503F/7ba21aa95ced5d5af82e9158d168cadf.png\",\n    \"name\": \"Prairie Cardiovascular\",\n    \"slgId\": \"441-3\",\n    \"url\": \"https://www.mychartportal.org/prairie/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/36C758B0-7538-4847-B60E-99AF752E6EF2/94e335d87cd630bb1d72bf3cf7bac76d.png\",\n    \"name\": \"HSHS Medical Group\",\n    \"slgId\": \"441-4\",\n    \"url\": \"https://www.myhshs.org/myhshs/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/86ACD128-532B-41BC-94C8-8111A8B93FA3/d65bc27e4e8664e5bf1a59b392bafe2b.png\",\n    \"name\": \"Hemophilia Outreach Center\",\n    \"slgId\": \"441-6\",\n    \"url\": \"https://www.mychartportal.org/myhoc/\"\n  },\n  {\n    \"aliases\": [\n      \"Rincon\",\n      \"TMCOne\",\n      \"TMC\",\n      \"SPG\",\n      \"Saguaro Physician Group\",\n      \"SAIDS\",\n      \"Souther Arizona Infection Disease\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/30C1002D-BE89-4D5E-B97A-6A6C5B74D9AD/043d1daed298747e37bbb77132b4f970.png\",\n    \"name\": \"Tucson Medical Center\",\n    \"slgId\": \"442\",\n    \"url\": \"https://mychart.tmcaz.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FB0436DE-7D06-490C-86F6-2E1EDA70EBF4/65ee238df441ab0dd3621b63c3a52d40.png\",\n    \"name\": \"Tucson Independent Physicians and Surgeons\",\n    \"slgId\": \"442-3\",\n    \"url\": \"https://mychart.tmcaz.com/tucson-physicians/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/14CEFB3C-948C-4AE5-9F3A-D8D8FD32441A/259f8d6a683bddacb3f1296f0643ada9.png\",\n    \"name\": \"Austin Regional Clinic\",\n    \"slgId\": \"443\",\n    \"url\": \"https://mychart.austinregionalclinic.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"CHA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6901CD6-71E2-4209-89DF-77395BC8F1E4/4fa649328e6ad06b0c6ccccdaf9cb557.png\",\n    \"name\": \"Cambridge Health Alliance\",\n    \"slgId\": \"445\",\n    \"url\": \"https://mychart.challiance.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UCDHS\"\n    ],\n    \"directoryUrl\": \"https://mychart.ucdavis.edu/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4AFE64F4-A4D8-4441-9C05-CD3986E0EB89/7cdf7ba6e2d8bd7a406522ed78bbf53d.png\",\n    \"name\": \"UC Davis\",\n    \"slgId\": \"451\",\n    \"url\": \"https://mychart.ucdavis.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/10D5F19B-1B4E-4F2B-9C59-5FD3FE77A08C/60315c46bce72bec626b1dcf9dbb1113.png\",\n    \"name\": \"Marshall Medical Center\",\n    \"slgId\": \"451-2\",\n    \"url\": \"https://mychart.marshallmedical.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/32B5FFE1-4BDB-4BEC-9794-5D4C1E4A8A10/8fba9ab95f91cf5e766bd3793fb2112f.png\",\n    \"name\": \"Froedtert\",\n    \"slgId\": \"453\",\n    \"url\": \"https://www.mychartlink.com/mychart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F517C3F7-FD51-406B-82B2-5D7A3BFB6F3E/1f470d4865328e3aa40c5ebc3224e24e.png\",\n    \"name\": \"Froedtert South\",\n    \"slgId\": \"453-2\",\n    \"url\": \"https://mychart.froedtertsouth.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E5D6D6B5-0DC5-40E5-B00C-C79229C7B1DE/38edc4f7bd4ae63bd92f94143e707b1f.png\",\n    \"name\": \"Aspirus\",\n    \"slgId\": \"456\",\n    \"url\": \"https://myaspirus.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Kaiser Colorado\",\n      \"Kaiser Georgia\",\n      \"Kaiser Hawaii\",\n      \"Kaiser N Cal\",\n      \"Kaiser S Cal\",\n      \"Kaiser Washington\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/kaiserPermanente.png\",\n    \"name\": \"Kaiser Permanente\",\n    \"slgId\": \"459\",\n    \"url\": \"https://healthy.kaiserpermanente.org/consumer-sign-on\"\n  },\n  {\n    \"aliases\": [\n      \"Gottlieb\",\n      \"LUMC\",\n      \"LUHS\"\n    ],\n    \"directoryUrl\": \"https://myloyola.luhs.org/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3F0B7093-E6C0-4664-ADDD-A6F4062ECA22/04b9d9ae43ae8f2a792e2ac130848228.png\",\n    \"name\": \"Loyola Medicine\",\n    \"slgId\": \"461\",\n    \"url\": \"https://mychart.trinity-health.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"District One\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2C3CA0E8-E5F9-4F56-9108-AC2A283E34C6/67136a05c353de39d6c5e35e3b639933.png\",\n    \"name\": \"Allina\",\n    \"slgId\": \"465\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5134AD77-1DCE-4E6C-B411-66F71548CBBE/0f96727606af1154503f65c100cd6d96.png\",\n    \"name\": \"Welia Health\",\n    \"slgId\": \"465-1\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5E01766F-84FF-4A89-8335-4F5D1A8BF8CA/a3ea5a0661660f752d16d0857f00ffdd.png\",\n    \"name\": \"Hutchinson Health\",\n    \"slgId\": \"465-4\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [\n      \"GRHS\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8ED825BC-FA2C-4198-8041-61F3EE8A3597/5edc97a94a05d646a78e90b1a981af55.png\",\n    \"name\": \"Glencoe Regional Health Services\",\n    \"slgId\": \"465-5\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [\n      \"DOH\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/731CEE7C-C285-4895-9D98-5B5B739568EA/a97ff635414345c91d2e471bfad21b34.png\",\n    \"name\": \"District One Hospital\",\n    \"slgId\": \"465-6\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8CC3212E-08D9-420F-BDD5-ED5ED1F83808/3d5233e69377c7920a142b2ff871c94d.png\",\n    \"name\": \"St. Croix Health\",\n    \"slgId\": \"465-7\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75501A79-F5A3-436D-BDDE-C2F0F66D437D/a6a0cd5504cd044478fc728b4f7f91b6.png\",\n    \"name\": \"River's Edge Hospital & Clinic\",\n    \"slgId\": \"465-8\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/33CB0626-DC69-41E0-AEAD-0B122C00585F/fb92877ec17200794c572390e27ef241.png\",\n    \"name\": \"Cuyuna Regional Medical Center\",\n    \"slgId\": \"465-9\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3BEE6F0D-5FC2-43C8-9917-9E250A0139DB/75848629ef5f86f90e117920c50897a2.png\",\n    \"name\": \"Western Wisconsin Health\",\n    \"slgId\": \"465-11\",\n    \"url\": \"https://account.allinahealth.org/dashboard/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1E9EB932-73FE-4CB7-B922-1E21E74F4202/2c1e23f4e908db32d6ac737fc0295ad9.png\",\n    \"name\": \"Children's Healthcare of Atlanta\",\n    \"slgId\": \"469\",\n    \"url\": \"https://mychart.choa.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Straub\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4B602511-9CC9-4E28-9949-DFA544D71725/e644ac16e27023b050a042f8e9d78056.png\",\n    \"name\": \"Hawaii Pacific Health\",\n    \"slgId\": \"471\",\n    \"url\": \"https://mychart.hawaiipacifichealth.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4685804C-7F47-4032-AB65-84D19F137D37/1afa5be0a5372d95ca9d1cb09354a2b7.png\",\n    \"name\": \"UTMB\",\n    \"slgId\": \"477\",\n    \"url\": \"https://mychart.utmb.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Corewell Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AAD32F2C-1046-479B-9034-7A29070EB3D4/269a6eabc910db93cb7c80c7894f6fa8.png\",\n    \"name\": \"Beaumont\",\n    \"slgId\": \"485\",\n    \"url\": \"https://mybeaumontchart.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"THR\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/515041ED-C9A9-415E-BD9F-7AD703665BC0/9aa7ca08e48981948fcac8f27cbab26c.png\",\n    \"name\": \"Texas Health Resources\",\n    \"slgId\": \"491\",\n    \"url\": \"https://mychart.texashealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Dayton\",\n      \"Ohio\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C89AF8E5-75C9-44C6-956B-8D7A1EE88FBB/549998508d37daed945c267abf89621d.png\",\n    \"name\": \"Premier Health\",\n    \"slgId\": \"494\",\n    \"url\": \"https://mychart.premierhealthpartners.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C39350C0-4206-423C-96E2-C404C848F619/d66a5dd08cb783e8f767617264536798.png\",\n    \"name\": \"MemorialCare\",\n    \"slgId\": \"498\",\n    \"url\": \"https://mymemorialcare.memorialcare.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/38B7A014-5DA2-4514-B7FC-C930E63C39F3/e9c9354ed24fe9115dbbc37ed873709c.png\",\n    \"name\": \"The Queen's Health System\",\n    \"slgId\": \"501\",\n    \"url\": \"https://mychart.queens.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Kona\",\n      \"Kohala\",\n      \"Alii Health\",\n      \"West Hawaii Region\",\n      \"Queens\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/312B7F3F-9EC4-41E1-B7FE-2F05C7B043D3/2aac62790b42f661838144b8760ed865.png\",\n    \"name\": \"Queen's Connect\",\n    \"slgId\": \"501-1\",\n    \"url\": \"https://mychart.queens.org/QueensConnect/\"\n  },\n  {\n    \"aliases\": [\n      \"UCSD\",\n      \"University of California\",\n      \"San\",\n      \"Diego\",\n      \"SanDiego\",\n      \"UC\",\n      \"UC San Diego\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D7D8163C-58C3-4646-831D-5316CF76E920/ea788dd79fe9a5a47e4833666b8ecf38.png\",\n    \"name\": \"UC San Diego\",\n    \"slgId\": \"502\",\n    \"url\": \"https://myucsdchart.ucsd.edu/ucsd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3CA90A63-7820-4083-AEF9-0889A9B8822A/2795df851141b4d8876261b173a03cb8.png\",\n    \"name\": \"San Diego Sports Medicine\",\n    \"slgId\": \"502-1\",\n    \"url\": \"https://sdsm.healthmychart.org/sdsm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B711966E-E22C-48BF-BBFF-A0C1953CE278/df64c060413fda3420a617d6824ac85b.png\",\n    \"name\": \"The Neurology Center\",\n    \"slgId\": \"502-2\",\n    \"url\": \"https://mychart.neurocenter.com/tnc/\"\n  },\n  {\n    \"aliases\": [\n      \"Riverside\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/78C91E1C-3C30-45FA-9618-6E094B2A38C6/2e01dba41c94c29b345bda30d31a408c.png\",\n    \"name\": \"UCR Health\",\n    \"slgId\": \"502-3\",\n    \"url\": \"https://mychart.ucrhealth.org/ucr/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D7AA807-222E-435D-A123-9400C10615D4/93f958b877e7798f7c992df02d0a7ca9.png\",\n    \"name\": \"IGO Medical Group\",\n    \"slgId\": \"502-4\",\n    \"url\": \"https://mychart.igomed.com/igo/\"\n  },\n  {\n    \"aliases\": [\n      \"Irvine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3D311888-2477-47DA-A516-712E3796E19D/0bf6222c1a5443f6b86c8975b8ed79a4.png\",\n    \"name\": \"UCI Health Archive\",\n    \"slgId\": \"502-5\",\n    \"url\": \"https://my.ucihealth.org/UCI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D32682E7-5F3E-4FB5-A25C-945A1E5CB8B9/357d97f768fc87cbe37f06497c559a93.png\",\n    \"name\": \"Rancho Family Medical Group\",\n    \"slgId\": \"502-6\",\n    \"url\": \"https://mychart.ranchofamilymed.com/rfm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6BC7002D-0E2B-48D2-88CC-F106E8B41B3A/74b3c105c75550bc88f822720aaeb4f8.png\",\n    \"name\": \"Optimas Family Medicine\",\n    \"slgId\": \"502-7\",\n    \"url\": \"https://optimas.healthmychart.org/ofm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92EBA383-BDE6-4AE6-863F-4CD695974F03/4062962f3ef4b3182bb1fe398baff5a8.png\",\n    \"name\": \"Well Being Health\",\n    \"slgId\": \"502-8\",\n    \"url\": \"https://mychart.wellbeingmed.org/wbmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/08FDB36D-67E0-44DB-8052-897811C025BB/988ff9e305c02d639bed4ed40e3ecc26.png\",\n    \"name\": \"Perlman Clinic\",\n    \"slgId\": \"502-11\",\n    \"url\": \"https://myucsdchart.ucsd.edu/mpc/\"\n  },\n  {\n    \"aliases\": [\n      \"UCSDSHS\",\n      \"SHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3B6C6450-82B2-4872-B9D3-4E230FF1424C/ff559f45f4744c7a156011ed4be51649.png\",\n    \"name\": \"UC San Diego Student Health\",\n    \"slgId\": \"502-12\",\n    \"url\": \"https://mystudentchart.ucsd.edu/shs/\"\n  },\n  {\n    \"aliases\": [\n      \"NCFMG\",\n      \"NCMG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/72323DBD-8B47-4F11-BFAD-A792F557F77A/56146a451fef3bfd8f08cedee859d21d.png\",\n    \"name\": \"North Coast Family Medical Group\",\n    \"slgId\": \"502-13\",\n    \"url\": \"https://mychart.ncfmg.com/ncfmg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1EA03B15-E28C-4C6C-9F8D-02877323AE18/79719faf1864b41b29cb3f20444f1114.png\",\n    \"name\": \"UC San Diego Employee SSO\",\n    \"slgId\": \"502-14\",\n    \"url\": \"https://myucsdchart.ucsd.edu/ucsd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Torrey\",\n      \"Pines\",\n      \"TPOMG\",\n      \"TPOSM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C8558461-5CC6-442D-AB89-0DD2220B8FD5/9e5913117d59b4b8a12dcf43761ff6fe.png\",\n    \"name\": \"Torrey Pines Orthopaedics & Sports Medicine\",\n    \"slgId\": \"502-15\",\n    \"url\": \"https://mychart.tpomg.com/tpomg/\"\n  },\n  {\n    \"aliases\": [\n      \"Elsayed\",\n      \"MKE\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6F6E5DD9-3464-4182-9D55-76743B16AD81/22e3fcf02bf2d71980b9f8ca2109daec.png\",\n    \"name\": \"Oxford Care\",\n    \"slgId\": \"502-17\",\n    \"url\": \"https://oxfordcare.healthmychart.org/MKE/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2211B304-52D5-428B-9076-B7BBA3C9225B/b6a4e1ae030c779ca9e96e58a3fc1a61.png\",\n    \"name\": \"Aligned Geriatrics\",\n    \"slgId\": \"502-18\",\n    \"url\": \"https://rawimedical.healthmychart.org/RAW/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"DENT\",\n      \"DENTMD\",\n      \"SDENTS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D1016A5-22FD-4318-9DF4-7D1729F80EC3/83a8103f0c8d69d5b1b7cacf79bc028e.png\",\n    \"name\": \"San Diego Ear, Nose & Throat Specialists MyChart\",\n    \"slgId\": \"502-19\",\n    \"url\": \"https://mychart.sdents.com/DENT/\"\n  },\n  {\n    \"aliases\": [\n      \"CCMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A8DB4FE4-7A5C-4B1F-BF26-6D3BC85942F7/855ac2b3b8294bdff8351dd927fdf315.png\",\n    \"name\": \"Compassionate Care Medical Center\",\n    \"slgId\": \"502-20\",\n    \"url\": \"https://mychart.et0502.epichosted.com/CCMC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D9678530-B848-451B-8F47-E04ECF1A67C9/49cf5502d53b83f2659ca66d949d8ad3.png\",\n    \"name\": \"Methodist Hospitals\",\n    \"slgId\": \"503\",\n    \"url\": \"https://mychart.methodisthospitals.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Knight\",\n      \"Doernbecher\",\n      \"OHSU\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4AEA3322-8629-41DF-B335-35B5DF379BE9/a3f6a549780ef1edb30769a0de8533c2.png\",\n    \"name\": \"Oregon Health and Science University\",\n    \"slgId\": \"504\",\n    \"url\": \"https://mychartweb.ohsu.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"AHCG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BFF57AAB-4154-4D38-BA94-EA862C49DF00/6c4dc84a30675d6ac842595c4eb14e1b.png\",\n    \"name\": \"Adventist Health Columbia Gorge\",\n    \"slgId\": \"504-2\",\n    \"url\": \"https://mychartweb.ohsu.edu/mychartmcmc/\"\n  },\n  {\n    \"aliases\": [\n      \"Hillsboro Medical Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FBE06E36-19AD-457E-8B48-5968CD6E662C/db57bbe93196531974c2dd25ad1eb137.png\",\n    \"name\": \"Tuality Healthcare\",\n    \"slgId\": \"504-3\",\n    \"url\": \"https://mychartweb.ohsu.edu/mychartmcmc/\"\n  },\n  {\n    \"aliases\": [\n      \"Viborg\",\n      \"Ortonville\",\n      \"Burke\",\n      \"Kittson\",\n      \"Riverview\",\n      \"Pioneer\",\n      \"Winner\",\n      \"Douglas\",\n      \"Jamestown\",\n      \"Mahnomen\",\n      \"Perham\",\n      \"Sidney\",\n      \"Windom\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4E4F2922-DC19-4360-AF7D-4B21F7D45755/4f0673e9e283f3f482e137f734f15da1.png\",\n    \"name\": \"Sanford\",\n    \"slgId\": \"507\",\n    \"url\": \"https://www.mysanfordchart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E5ACF3C3-105A-4938-BDA8-BA70B5CC38B5/444dbcdc2498b8795c6fd01fbc7406de.png\",\n    \"name\": \"Sanford Health Plan\",\n    \"slgId\": \"507-3\",\n    \"url\": \"https://member.sanfordhealthplan.org/portal/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6051EAA8-2D36-4734-ADCE-0B8680D8E09B/1b480c29959accffbd9afdd63bf024c5.png\",\n    \"name\": \"United Hospital District\",\n    \"slgId\": \"507-4\",\n    \"url\": \"https://www.mysanfordchart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4BEF4943-17BC-4FDD-8D3B-2825E0F2FD66/399ea3966bcee5fa5a76578f829addf6.png\",\n    \"name\": \"Lake Region Healthcare\",\n    \"slgId\": \"507-5\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F6A0F216-D162-43CA-89B7-0E64CD81866F/5e330e5f02fbc5556bdf8ef6095d6511.png\",\n    \"name\": \"Jamestown Regional Medical Center\",\n    \"slgId\": \"507-6\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0D7416D4-47D9-421B-A4C1-60EAB61A2E88/691f4c03975ac200bc918ae66a334193.png\",\n    \"name\": \"Coteau des Prairie Medical Center\",\n    \"slgId\": \"507-7\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/094DB9A2-5E32-49D3-AAD6-254182DC5A2B/34a97f4e7f27869af2967367ae2da176.png\",\n    \"name\": \"Community Memorial Hospital\",\n    \"slgId\": \"507-8\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6C4DDB04-0E63-4E9F-B936-D05C92546A6A/98382a1598faefbce99cdc73b46441a3.png\",\n    \"name\": \"Douglas County Memorial Hospital\",\n    \"slgId\": \"507-9\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FC84F98B-0293-4F27-90B1-5D21B000E1DD/c41f753768bfe59e1b01a4f1de5d0b68.png\",\n    \"name\": \"Lifescape\",\n    \"slgId\": \"507-10\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7BB8D9C9-5FB8-4221-8D75-8527E0D139C5/87029dc36182ebc3e0e2135f161c5a80.png\",\n    \"name\": \"Murray County Medical Center\",\n    \"slgId\": \"507-11\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6E6A1E87-676B-4472-A665-D15BAC883ECB/94173ea0f537edbd8401105a88298b83.png\",\n    \"name\": \"Orange City Area Health System\",\n    \"slgId\": \"507-12\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A6BEF191-D966-46C4-B86D-7FA41FBDC206/f5c133267785b4d027c06136ab3e4ab0.png\",\n    \"name\": \"Ortonville Area Health Services\",\n    \"slgId\": \"507-13\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37C7E7C6-87DE-4763-9230-13A7489A196B/b6519d30a0cd54138eb3e6fb7269fd09.png\",\n    \"name\": \"Perham Health\",\n    \"slgId\": \"507-14\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1C7E0D4C-FE64-4B93-A923-2CE1D94F3E08/255f0bc2ec0ea1f70d0342c68d4c5a9e.png\",\n    \"name\": \"Pioneer Memorial Hospital\",\n    \"slgId\": \"507-15\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0263B35E-ED84-4AC0-AED8-01B31BA8A073/84364d28909754651fb3f294c10a8b23.png\",\n    \"name\": \"Rainy Lake Medical Center\",\n    \"slgId\": \"507-16\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A7F4880E-BA56-405D-BBD0-1B4F8A3BF7B5/8f65b93b83ab07acd74bb38147f19198.png\",\n    \"name\": \"Riverview Health\",\n    \"slgId\": \"507-17\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B8DF17FF-A023-4665-8ABC-226435C15062/a0f30ded16e79c8dd5c7d569d227484d.png\",\n    \"name\": \"Sidney Health Center\",\n    \"slgId\": \"507-18\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B7D2BF0-92CC-44CD-A2A2-F1EBB3DE14E5/dea16804ebe5002b2b1582584ac67b36.png\",\n    \"name\": \"UND Center for Family Medicine\",\n    \"slgId\": \"507-19\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/10EA3CCC-EED7-41C1-A1AA-1EC316BFAD32/c6bc3c101b438e5d4547efb8a849a60a.png\",\n    \"name\": \"Windom Area Health\",\n    \"slgId\": \"507-20\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FCFBEB8F-9B06-4875-A51F-9AED1A51D8A5/904d6fb695632ed45811fc6a3481a638.png\",\n    \"name\": \"Jacobson Memorial Hospital\",\n    \"slgId\": \"507-21\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A1368752-75DD-4802-BED4-930419A46EF3/20b6f37447acaa87763146fb86cf7168.png\",\n    \"name\": \"Kittson Healthcare\",\n    \"slgId\": \"507-22\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/642CEB4C-C35F-4CEC-8C50-391B0F91B4CD/ba21c73560fc6961730d29c2ee4bd475.png\",\n    \"name\": \"Mahnomen Health Center\",\n    \"slgId\": \"507-23\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/57109FF9-0AEB-45DA-AD15-D57F420EC44D/0f94011dad734482955909420b985f34.png\",\n    \"name\": \"McKenzie County Healthcare\",\n    \"slgId\": \"507-24\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A9B04E5-84D3-497B-B6BF-9C1085DD3E41/39989cbbb6f638c6b92d9fbaecb015e1.png\",\n    \"name\": \"Winner Regional Healthcare\",\n    \"slgId\": \"507-25\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/030AA01D-5021-49BA-AF84-2B2F0362CBFC/1d7a6a064cd2b26ed77fdfe9d4b00314.png\",\n    \"name\": \"Family Healthcare\",\n    \"slgId\": \"507-26\",\n    \"url\": \"https://www.mychartcp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D3B6E822-614A-4ED8-8F1D-B31DBFDFB6AC/d59d18875fb4188fbdec0754e9406336.png\",\n    \"name\": \"North Memorial\",\n    \"slgId\": \"509\",\n    \"url\": \"https://mychart.northmemorial.com/NorthMemorial/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A328F605-2BC6-40F7-921B-DCA5C039CE08/9c9e0929e7940ff2963c2a1dd25d27b7.png\",\n    \"name\": \"Stellis Health\",\n    \"slgId\": \"509-2\",\n    \"url\": \"https://mychart.northmemorial.com/StellisHealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E516761-C19C-45FE-A9C1-14F754B40473/270e6ca52ab2e22082c2e5e0eeef5613.png\",\n    \"name\": \"Broadway\",\n    \"slgId\": \"509-3\",\n    \"url\": \"https://mychart.northmemorial.com/UMPBroadway/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D2BE6D17-247A-4933-80CF-D4AAF4EF449F/43ee35de7f9406ca9f6082f4092fb2fd.png\",\n    \"name\": \"Minneapolis Clinic of Neurology MyChart\",\n    \"slgId\": \"509-4\",\n    \"url\": \"https://mychart.northmemorial.com/MplsClinicNeuro/\"\n  },\n  {\n    \"aliases\": [\n      \"North Lung\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DC9D17A6-327F-46B3-89BF-15FDB1E83D9D/3fd1a42b6c960c439b458c707c368e05.png\",\n    \"name\": \"Respiratory Consultants\",\n    \"slgId\": \"509-5\",\n    \"url\": \"https://mychart.northmemorial.com/NorthLung/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C724F0D0-4DFF-42CB-BBEA-EF270860D80D/3e2956a2ae40813f7d0da37b3acf361f.png\",\n    \"name\": \"Hennepin\",\n    \"slgId\": \"510\",\n    \"url\": \"https://mychart.hcmc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Atrius\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BFEF6499-59B0-4F2C-BF48-CC30117B413E/fead0c5626e854477a6a5415d1fd42bf.png\",\n    \"name\": \"Reliant Medical Group\",\n    \"slgId\": \"511\",\n    \"url\": \"https://mychart.reliantmedicalgroup.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5AD0DC52-FA58-44DA-9846-5A8334B797D7/8ca2c638a1aa5e49f9d2849c1a1fc0c2.png\",\n    \"name\": \"ProHealth Physicians\",\n    \"slgId\": \"511-1\",\n    \"url\": \"https://mychart.prohealthmd.com/PHCT/\"\n  },\n  {\n    \"aliases\": [\n      \"Mount Sinai\",\n      \"MyMountSinai\",\n      \"Mt Sinai\",\n      \"Mt Sinai MyChart\",\n      \" Mount Sinai Health System\",\n      \"mshs\",\n      \"The Mount Sinai Hospital\",\n      \"Mount Sinai West\",\n      \"Mount Sinai Morningside\",\n      \"Mount Sinai Queens\",\n      \"Mount Sinai Brooklyn\",\n      \"Mount Sinai Beth Israel\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/063BAE07-AA7A-4EB3-8CF7-F0FB981F3545/5779ebc5a4328ccd8acf3da2eddbbfce.png\",\n    \"name\": \"MountSinai\",\n    \"slgId\": \"513\",\n    \"url\": \"https://mychart.mountsinai.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3E1170D6-CE8E-405A-8CA3-FB79A99C5EB4/2386a6bd19924eadab1c59979cd3cb4a.png\",\n    \"name\": \"Mount Sinai New York - Concierge Care\",\n    \"slgId\": \"513-1\",\n    \"url\": \"https://mychart.mountsinai.org/ConciergeCare/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/30759592-F490-4B83-9379-6828DED67F20/456373027cff26e8b7a3ebc263fd827a.png\",\n    \"name\": \"Health Center, powered by Mount Sinai\",\n    \"slgId\": \"513-2\",\n    \"url\": \"https://mychart.mountsinai.org/healthcenter/\"\n  },\n  {\n    \"aliases\": [\n      \"Mount Sinai Doctors Concierge Care\",\n      \"New York Concierge Care\",\n      \"New York Mount Sinai Concierge Care\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A8A04CB3-00C5-472B-B6F7-31B9716C52EA/513d80e1d6334440de114feaf196e01a.png\",\n    \"name\": \"The Health Center at Hudson Yards\",\n    \"slgId\": \"513-3\",\n    \"url\": \"https://mychart.mountsinai.org/hchy/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/32294665-D793-4375-AE58-B98ECBB9E198/d6d555d7bf01bbec49e29aaf5cc6e8f6.png\",\n    \"name\": \"Renown\",\n    \"slgId\": \"514\",\n    \"url\": \"https://mychart.renown.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/44325FD0-D3C1-4802-8056-C86AFCCE3AC8/e15fa2ebf5cfef307870c12d341b6196.png\",\n    \"name\": \"Barton Health\",\n    \"slgId\": \"514-2\",\n    \"url\": \"https://mychart.bartonhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7C83BD7F-6D44-403E-AF17-6FE51528E654/a87167d3e341cc2d06136d082393f2dd.png\",\n    \"name\": \"Carson Valley Health\",\n    \"slgId\": \"514-3\",\n    \"url\": \"https://mychart.carsonvalleyhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Melrose\",\n      \"Prarie\",\n      \"Becker\",\n      \"Sauk\",\n      \"Northway\",\n      \"SCMC\",\n      \"Stevens\",\n      \"NovaCare\",\n      \"RC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E15B35A5-DF39-4849-B254-EC38914B2B05/f5c9ac66617e36a1042bf46f842f250b.png\",\n    \"name\": \"CentraCare\",\n    \"slgId\": \"515\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Alexandria\",\n      \"DCH\",\n      \"Alomere\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACE154C2-7EE9-4397-BB8E-69C485026829/f635494bcee721ef939b196fba76da6f.png\",\n    \"name\": \"Alomere Health\",\n    \"slgId\": \"515-2\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"TCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B596854D-3BC5-4A5C-B37E-11D1FF1866A8/c81aabe9e274a8f218da283ff53a97d8.png\",\n    \"name\": \"Astera Health\",\n    \"slgId\": \"515-3\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B0541DEC-7D91-4C0F-BBD3-76AD297604C4/7755a8312098bc808c38e248dbf3dc83.png\",\n    \"name\": \"Rice Memorial Hospital\",\n    \"slgId\": \"515-4\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Unity\",\n      \"Randall\",\n      \"Little Falls\",\n      \"Albany\",\n      \"Avon\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/49A248BF-C9C7-47E9-8AE1-CF178CCBA23D/1093e01ea1566d4dd890396d1ff4b269.png\",\n    \"name\": \"St. Gabriel's Health\",\n    \"slgId\": \"515-5\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Olivia\",\n      \"Renville\",\n      \"Hector\",\n      \"RC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5779FE68-714D-4A16-A76E-398FE0D2DA51/05a84a0573fcf2def2bc9e3cf9348d84.png\",\n    \"name\": \"RC Hospitals & Clinics\",\n    \"slgId\": \"515-6\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1323A564-FEEB-49E9-BE15-310B0FE20579/ebe5627eac33e8c828a778b140751811.png\",\n    \"name\": \"Stevens Community Medical Center\",\n    \"slgId\": \"515-7\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4E77D6B4-79DC-4457-9CEB-FB35896203A7/be0fcf5f2d9870d990bd64aae97138e9.png\",\n    \"name\": \"CCM Health\",\n    \"slgId\": \"515-8\",\n    \"url\": \"https://mychart.centracare.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/00324E2F-5967-4B1E-BE31-CFD4C2CE4ED6/cb3e54e8791bfeef5eb18de04770415d.png\",\n    \"name\": \"Johnson Memorial Health Services\",\n    \"slgId\": \"515-9\",\n    \"url\": \"https://mychart.centracare.com/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/32E8EAC3-A37A-4771-B718-4FA4B7A5EDA4/f2503ca5fc3001697278e2491ddb49ca.png\",\n    \"name\": \"Appleton Health\",\n    \"slgId\": \"515-10\",\n    \"url\": \"https://mychart.centracare.com/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://millelacsband.com/home/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F6068D5-2168-43F3-A6F5-1991E0BEC684/060194f15779a847328b7b11bd133f97.png\",\n    \"name\": \"Mille Lacs Band of Ojibwe\",\n    \"slgId\": \"515-11\",\n    \"url\": \"https://mychart.centracare.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5ECE09C3-890D-4C36-A016-C969C995BD8F/981a988f932ea01cea1fa9389771d29a.png\",\n    \"name\": \"Stellis Health\",\n    \"slgId\": \"515-13\",\n    \"url\": \"https://mychart.centracare.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0425B269-A87B-4C65-9728-77E833F88F0B/65108cec87d0217e8256abd5a0fd529c.png\",\n    \"name\": \"Salem Health\",\n    \"slgId\": \"516\",\n    \"url\": \"https://mychart.salemhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"UHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/048D8305-D5BB-442E-B4AF-31A36AEF1561/8ad45df0b47a683164afaf5aa643d5a8.png\",\n    \"name\": \"ECU Health\",\n    \"slgId\": \"517\",\n    \"url\": \"https://mychart.vidanthealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BE3A4C0C-83A8-479A-AB67-D2D0C3E44FEC/f0d951031ea43d43cbdce806d4120809.png\",\n    \"name\": \"Lee Health Systems, Inc\",\n    \"slgId\": \"523\",\n    \"url\": \"https://mychart.leememorial.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3D70798B-E572-4C95-9AF6-53CF69759DAC/104e63ddee89a82c720cf41166fa1fd3.png\",\n    \"name\": \"Nationwide Children's Hospital\",\n    \"slgId\": \"525\",\n    \"url\": \"https://mychart.nationwidechildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/78208CF4-F153-4670-BE4C-ECB32E10673E/8103cc05d4c2ef789e5be917ce340584.png\",\n    \"name\": \"University of Michigan Health-West\",\n    \"slgId\": \"530\",\n    \"url\": \"https://mychart.metrohealth.net/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BC047D0E-5EF1-4EA9-A6AC-AC37FA0E27E6/a3bdcc23cb60f267f350d5c6c400d4b4.png\",\n    \"name\": \"Packard Health\",\n    \"slgId\": \"530-1\",\n    \"url\": \"https://mychart.metrohealth.net/packardhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB230D47-7948-4527-AD17-3781C5DB67F9/24e321d3726898457f1693ce79ecc50d.png\",\n    \"name\": \"Sentara Health\",\n    \"slgId\": \"531\",\n    \"url\": \"https://myhealth.sentara.com/Login/Login.aspx\"\n  },\n  {\n    \"aliases\": [\n      \"LGH\",\n      \"LGHealth\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19E5F01A-4F00-4C4B-B72A-1091F23101B9/00d1f9c196a5f0962795b5d9d6ea2597.png\",\n    \"name\": \"Lancaster\",\n    \"slgId\": \"538\",\n    \"url\": \"https://www.mylghealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/85AAEF8C-3F33-424A-AD87-870A22D6640F/7bc9132140aa4e74710016f7b42280d5.png\",\n    \"name\": \"Stanford\",\n    \"slgId\": \"541\",\n    \"url\": \"https://myhealth.stanfordhealthcare.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01D28DBE-8575-4570-A9CC-B767A1F4F0DB/0530e6483d5689dd10f29868572ed2cc.png\",\n    \"name\": \"Covenant HealthCare\",\n    \"slgId\": \"545\",\n    \"url\": \"https://mychart.chs-mi.com/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8A153522-835A-4424-B6B4-7A22AC59722C/0fde66d3bc42d107589801236c7dcb70.png\",\n    \"name\": \"Mary Free Bed\",\n    \"slgId\": \"545-1\",\n    \"url\": \"https://mychart.chs-mi.com/MFBPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8CC4FFF5-DBF6-4530-AC88-EB0CB9125DD2/f9966d679e896c65fe9e987356b0cec1.png\",\n    \"name\": \"Scheurer\",\n    \"slgId\": \"545-2\",\n    \"url\": \"https://mychart.chs-mi.com/ScheurerPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/49891F3B-7BFC-4707-837D-BD013F2A64EF/ea9730ee08922ce7e4f608d1984e71c0.png\",\n    \"name\": \"Aspire\",\n    \"slgId\": \"545-3\",\n    \"url\": \"https://mychart.chs-mi.com/AspirePRD/\"\n  },\n  {\n    \"aliases\": [\n      \"CMU\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D1ADF52-110E-4DE7-B5FC-75A12D529FCF/f7684f45d6a3e93fd718db2f9f872d60.png\",\n    \"name\": \"Central Michigan University\",\n    \"slgId\": \"545-4\",\n    \"url\": \"https://mychart.chs-mi.com/CMUPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"Mercy\",\n      \"MercyHealth\",\n      \"Mercy Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1AC5D4A7-9833-4FFF-926D-EA63A80FFCB2/ff1a45ded549203f5b6d66c910be7f06.png\",\n    \"name\": \"MHS\",\n    \"slgId\": \"549\",\n    \"url\": \"https://mychart.mercyhealthsystem.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"TCHP\",\n      \"Texas Childrens Health Plan\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2EF09046-00DA-4E7D-AADB-3FAFCF5270B1/c2db34e98e7818d4cc98d10d0a82e140.png\",\n    \"name\": \"Texas Children's\",\n    \"slgId\": \"551\",\n    \"url\": \"https://mychart.texaschildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92339AF7-015E-4B0D-A289-0ED1BCEE6B02/f90690d70c0d2a5f1223eb4380013104.png\",\n    \"name\": \"Children's Nebraska\",\n    \"slgId\": \"553\",\n    \"url\": \"https://connect.childrensomaha.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UMMS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AF7FB057-E834-4BE2-83CB-5E9BF750E9F5/3d6cba9393487636d4419b25b1169035.png\",\n    \"name\": \"University of Maryland Medical System\",\n    \"slgId\": \"555\",\n    \"url\": \"https://myportfolio.umm.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MPCP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F281A93-70C5-42F5-B27F-20987BE5F9E8/adc4dde0e82e3e8eb28663293c95c74a.png\",\n    \"name\": \"Maryland Primary Care Physicians\",\n    \"slgId\": \"555-1\",\n    \"url\": \"https://mychart.umms.org/mpcp/\"\n  },\n  {\n    \"aliases\": [\n      \"Ohio State\",\n      \"Wexner\",\n      \"OSU\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/879BB6E5-F469-4F52-ADE3-8E89875767C4/925b87fbbd17555c3b732bf7dc7f5437.png\",\n    \"name\": \"The Ohio State University Wexner Medical Center\",\n    \"slgId\": \"557\",\n    \"url\": \"https://mychart.osu.edu/osumc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6F39ED51-3C17-4C1D-A3D8-839B331F06E2/ce37c6e1ce78c319a9ed57d53ea289f4.png\",\n    \"name\": \"Memorial Health\",\n    \"slgId\": \"557-1\",\n    \"url\": \"https://mychart.osu.edu/memorialhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09BB305B-FDCA-4CEF-9257-E5BB77CFA993/2ca044a908f8e890ca777a83c12677f2.png\",\n    \"name\": \"Hocking Valley\",\n    \"slgId\": \"557-3\",\n    \"url\": \"https://mychart.osu.edu/hocking/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/734C3034-FC60-41FF-A3A7-AE1174B8AA50/4a7176f260b030cb6f8114b45a835dd8.png\",\n    \"name\": \"Mercer Health\",\n    \"slgId\": \"557-4\",\n    \"url\": \"https://mychart.osu.edu/mercerhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8DA5F271-EAF1-4D45-8CDA-E8032E1DE686/b93bab9aa3faa9e888381032633f9157.png\",\n    \"name\": \"Madison Health\",\n    \"slgId\": \"557-5\",\n    \"url\": \"https://mychart.osu.edu/madisonhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B4C0FF54-06D3-4617-859A-5B78B7C7338B/5ccdae7af13f9d5429b18e0a73d87ec1.png\",\n    \"name\": \"Avita Health System\",\n    \"slgId\": \"557-6\",\n    \"url\": \"https://mychart.osu.edu/avitahealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/12A4772E-A632-4C1F-A525-36D422F89AAC/37e8c53f6a77c4c309b2bddcf03da40c.png\",\n    \"name\": \"Adena Health System\",\n    \"slgId\": \"557-7\",\n    \"url\": \"https://mychart.osu.edu/adena/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E7625AA3-1F22-4C02-A9E4-AA5F13845B42/7d5035dac11ba1776a0d3e8eba70423b.png\",\n    \"name\": \"Heart of Ohio Family Health\",\n    \"slgId\": \"557-8\",\n    \"url\": \"https://mychart.osu.edu/HeartofOhioFamilyHealth/\"\n  },\n  {\n    \"aliases\": [\n      \"LCA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/82D522E1-FDC0-4908-84B1-9144814D3C2F/e9da6e143d60c854a497213625fea8fc.png\",\n    \"name\": \"LifeCare Alliance\",\n    \"slgId\": \"557-9\",\n    \"url\": \"https://mychart.osu.edu/lifecarealliance/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D2FA27D8-7812-4A27-AE15-E92AB1A0AD38/71bef75bd72f23f0215deb3e8feba5f3.png\",\n    \"name\": \"Wilson Health System\",\n    \"slgId\": \"557-10\",\n    \"url\": \"https://mychart.osu.edu/wilsonhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/80EC87A0-4BF7-4965-AB71-554CA5DD7417/3549c89d93830a7209c92c073dfd4666.png\",\n    \"name\": \"Columbus Public Health\",\n    \"slgId\": \"557-11\",\n    \"url\": \"https://mychart.osu.edu/ColumbusPublicHealth/\"\n  },\n  {\n    \"aliases\": [\n      \"Ruby\",\n      \"WVU\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/944C4FAA-4372-41F4-A6DE-91283BB61000/8a077d32148684befc9670f9f0daaf37.png\",\n    \"name\": \"West Virginia University\",\n    \"slgId\": \"563\",\n    \"url\": \"https://mywvuchart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2335DC7B-AD6A-43EA-BB97-91DA473D7748/8c72a966c049dcd8cc9ed4cbcf8cf8d9.png\",\n    \"name\": \"Peak Health\",\n    \"slgId\": \"563-1\",\n    \"url\": \"https://mypeak.peakhealth.org/MyPeak/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"CCHMC\",\n      \"MyPages\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/775C2DF0-43FC-4C94-9470-FB9B32E253C3/20f5dc0ddec235c408bceb58ccc6be1a.png\",\n    \"name\": \"Cincinnati Children's\",\n    \"slgId\": \"565\",\n    \"url\": \"https://mychart.cincinnatichildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3363E074-4E98-4106-A605-44A6B4B5DB2C/9e1eb7de55773d874a240674376c0a31.png\",\n    \"name\": \"Dayton Children's Hospital\",\n    \"slgId\": \"567\",\n    \"url\": \"https://mykidschart.childrensdayton.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"KUMed\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/975C8660-8337-4239-B8FF-E6232EA27CEA/5fb9be2cca9e0cd3833ce926ecd52c09.png\",\n    \"name\": \"The University of Kansas Health System\",\n    \"slgId\": \"569\",\n    \"url\": \"https://mychart.kansashealthsystem.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6FC0A06C-8DC2-401F-AD59-5514EBD84D5C/7cdca55ab88f0d5b0900eb298570dae5.png\",\n    \"name\": \"SLUCare\",\n    \"slgId\": \"571\",\n    \"url\": \"https://mychart.ssmhc.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Seattle Children's Primary Care Group\",\n      \"Richmond Pediatrics\",\n      \"SCPCG\",\n      \"UPPC\",\n      \"University Place Pediatric Clinic\",\n      \"Seattle Children’s Hospital\",\n      \"SCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/79F431F5-3C4D-4AA0-9114-B4C1A7572268/13b9bb93552546e39dac5e2510346f97.png\",\n    \"name\": \"Seattle Children's MyChart\",\n    \"slgId\": \"574\",\n    \"url\": \"https://mychart.seattlechildrens.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Olympia Pediatrics\",\n      \"Woodinville Pediatrics\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BA338701-936D-4FBB-97AD-5E4D73EF0544/16df04b7ab12cbd9f51e8197317695f5.png\",\n    \"name\": \"Seattle Childrens Community Connect\",\n    \"slgId\": \"574-1\",\n    \"url\": \"https://mychart.schconnect.org/schconnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F4D400B1-53ED-41D3-A877-37C1256D26CB/f6cc5827073147970dc83ba6f5272562.png\",\n    \"name\": \"CHI St. Vincent\",\n    \"slgId\": \"575-3\",\n    \"url\": \"https://www.chistvincentonecare.com/#/login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/236DF432-C3F3-4CDA-B4FC-D46A644C0CFF/90dd6f4eead15284cf816ef1f25ceac8.png\",\n    \"name\": \"RiverView Health\",\n    \"slgId\": \"575-4\",\n    \"url\": \"https://mychart.riverview.org/#/login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/78B8CA32-C3A1-43FA-988D-2FE1B8E72CA7/e257fc92b795ce37f6ee9b87314adcc5.png\",\n    \"name\": \"Tahoe Forest Health System\",\n    \"slgId\": \"575-5\",\n    \"url\": \"https://mychart.tfhd.com/#/login\"\n  },\n  {\n    \"aliases\": [\n      \"River Valley\",\n      \"Truckee\",\n      \"Tahoe\",\n      \"TTMG\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A47E6AA7-84ED-4CAF-9743-A7E8DD53A4CE/47ed46ba40977a487d8d275bed7e08ab.png\",\n    \"name\": \"MTS\",\n    \"slgId\": \"575-6\",\n    \"url\": \"https://www.mtsmychart.com/#/login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2AA87881-F601-4A6E-AF02-C1EFE5455AE6/7f778213ae8f380643f520caa0d4fa12.png\",\n    \"name\": \"Boys Town\",\n    \"slgId\": \"575-7\",\n    \"url\": \"https://www.myboystown.org/login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DBDF7C54-D184-4F55-8FD9-0FB7E44D8FFF/bdddae6d7d385e9491c4dadc91739d96.png\",\n    \"name\": \"Metro Imaging\",\n    \"slgId\": \"575-8\",\n    \"url\": \"https://mychart.metroimaging.org/app/login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/67AFD048-AC33-43F2-BAF6-68FD6376E63C/3105102222fc19fbbc1cadb500e6d4d0.png\",\n    \"name\": \"Cooper\",\n    \"slgId\": \"578\",\n    \"url\": \"https://my.cooperhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/myMercy.png\",\n    \"name\": \"Mercy\",\n    \"slgId\": \"580\",\n    \"url\": \"https://www.mymercy.net/#/login\"\n  },\n  {\n    \"aliases\": [\n      \"University\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D706906-7091-41AB-A566-4114E029BC43/01af5a56ce15c5e8ee695aba5d63af3e.png\",\n    \"name\": \"UT Medicine San Antonio\",\n    \"slgId\": \"582\",\n    \"url\": \"https://mychart.utmedicinesa.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Sound Family Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/77AE67F2-7609-41B7-B29A-D5C4853F06F0/dd8023a950bd591a5f52a552fa5eef37.png\",\n    \"name\": \"Optum Care Washington\",\n    \"slgId\": \"584\",\n    \"url\": \"https://www.myhealthchart.com/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Uiowa\",\n      \"University\",\n      \"UIHC\",\n      \"University of Iowa Health Care\",\n      \"University of Iowa\",\n      \"Iowa Health Care\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/107E0750-CD77-4984-8BA6-FE1BF09114CB/770f185439c64560d23ea9df74faff3d.png\",\n    \"name\": \"UIHC\",\n    \"slgId\": \"592\",\n    \"url\": \"https://mychart.uihealthcare.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"ISH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/893E9FF5-F0AD-418C-9B67-6A04ADF173DD/d4f3094c9ca13ced956971c68f0665e6.png\",\n    \"name\": \"Iowa Specialty Hospitals and Clinics\",\n    \"slgId\": \"592-1\",\n    \"url\": \"https://mychart.uihealthcare.org/ish//\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B17DC221-4E41-4C3F-9B6E-66176687CAA7/83c2aa00d305bfbbf70420e25378ed70.png\",\n    \"name\": \"Cass County Health System\",\n    \"slgId\": \"592-2\",\n    \"url\": \"https://mychart.uihealthcare.org/cchs/\"\n  },\n  {\n    \"aliases\": [\n      \"WMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F595ED27-AAB5-4899-97C3-C174FFAC1C37/705abbc9a93046e2a5a58d8d0d2052b8.png\",\n    \"name\": \"Winneshiek Medical Center\",\n    \"slgId\": \"592-3\",\n    \"url\": \"https://mychart.uihealthcare.org/winmedical/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACAA61E3-FBCB-4587-9F59-9C4C48A86225/3a2449e908b31a38c3e9c0270227bfe5.png\",\n    \"name\": \"Myrtue Medical Center\",\n    \"slgId\": \"592-4\",\n    \"url\": \"https://mychart.uihealthcare.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B9FB4CA-6891-4AF7-A540-BBFB0AA49B99/9d78a4e053d19dce68871b59a76d4c9f.png\",\n    \"name\": \"Jefferson County Health Center\",\n    \"slgId\": \"592-5\",\n    \"url\": \"https://mychart.uihealthcare.org/JCHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AAE9088-14D7-40E4-9693-7B2A1565DC3A/1f5f8bdbe02a27aaf6ea0a209c798f31.png\",\n    \"name\": \"Van Buren County Hospital\",\n    \"slgId\": \"592-6\",\n    \"url\": \"https://mychart.uihealthcare.org/vbch/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01BDE635-2788-43A1-B03C-B42457AF418F/9188555afc72941d20a92e59ef4b4e08.png\",\n    \"name\": \"Audubon County Memorial Hospital & Clinics\",\n    \"slgId\": \"592-7\",\n    \"url\": \"https://mychart.uihealthcare.org/ACMH/\"\n  },\n  {\n    \"aliases\": [\n      \"WCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A071253-19A2-4ECB-8FDE-8D52EEE3EEDA/f2ddb2185c3a6719f79d922b323c374e.png\",\n    \"name\": \"Washington County Hospital and Clinics\",\n    \"slgId\": \"592-8\",\n    \"url\": \"https://mychart.uihealthcare.org/wchc/\"\n  },\n  {\n    \"aliases\": [\n      \"VMH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C2DBEAA3-8442-42F9-A405-0E7733427DFB/4ea7005da4ec281459a1c7cf3af063d3.png\",\n    \"name\": \"Veterans Memorial Hospital\",\n    \"slgId\": \"592-9\",\n    \"url\": \"https://mychart.uihealthcare.org/VMH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/765ADE35-B76B-413F-91E2-335D98938E6D/d734c86fa40871c7ce06f7d314c52d4f.png\",\n    \"name\": \"Waverly Health Center\",\n    \"slgId\": \"592-10\",\n    \"url\": \"https://mychart.uihealthcare.org/Waverly/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/11CEBD0A-0DE0-4858-98EE-2B6842360A4C/21e448163e395b2e25f445f932174753.png\",\n    \"name\": \"Children's Health\",\n    \"slgId\": \"594\",\n    \"url\": \"https://mychart.childrens.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/29E5112F-3E84-455F-A45D-3791ED85ED8B/aa8ae18072ca53cc154f6d461638fa1c.png\",\n    \"name\": \"OSF HealthCare\",\n    \"slgId\": \"596\",\n    \"url\": \"https://www.osfmychart.org/osfmychart/\"\n  },\n  {\n    \"aliases\": [\n      \"CCSI\",\n      \"Cancer Care\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A83AE072-F921-480B-AB0C-FEF78E4C23B2/88fe7fb82bddbaf5d2999fe01250d629.png\",\n    \"name\": \"CancerCare Specialists\",\n    \"slgId\": \"596-3\",\n    \"url\": \"https://mychart.pchosted.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/84BCC9D1-6DC6-486D-8730-BC483AA3C49C/e1f0e7014e9941c2c186e3ec26909fbf.png\",\n    \"name\": \"Hannahville Indian Community Health and Human Services\",\n    \"slgId\": \"596-5\",\n    \"url\": \"https://hicmychart.org/hannahville/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"RCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75881119-0691-4094-A3CA-303EFB86A8F3/7998d66c4c9f2f3f236947f48f58c657.png\",\n    \"name\": \"Rochelle Community Hospital\",\n    \"slgId\": \"596-7\",\n    \"url\": \"https://rch-mychart.pchosted.com/Rochelle/\"\n  },\n  {\n    \"aliases\": [\n      \"WGH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B2AF9CC9-3FEB-4B58-881B-1C6BDEF9DD8F/0b346aad78123fce3e90cbd800b3341e.png\",\n    \"name\": \"Wabash General Hospital\",\n    \"slgId\": \"596-8\",\n    \"url\": \"https://wghmychart.com/Wabash/\"\n  },\n  {\n    \"aliases\": [\n      \"HHSIL\",\n      \"HHS\",\n      \"HCHC\",\n      \"Heartland Clinic\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B99B6C94-82F8-4062-B53D-C7AB27A6CF71/34a4daef6fd6782b5170561a3f13e665.png\",\n    \"name\": \"Heartland Health Services\",\n    \"slgId\": \"596-9\",\n    \"url\": \"https://hhsilmychart.com/HHSIL/\"\n  },\n  {\n    \"aliases\": [\n      \"Schwab Rehab\",\n      \"SMG\",\n      \"Holy Cross Hospital\",\n      \"Mount Sinai Hospital\",\n      \"Mt Sinai Hospital\",\n      \"One Lawndale\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7965D0A5-FB51-4971-B827-AC2E1C2FDAA6/6b6b8007c14376760091c2a71137c70a.png\",\n    \"name\": \"Sinai Chicago\",\n    \"slgId\": \"596-10\",\n    \"url\": \"https://mysinaichicago.org/SinaiChicago/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/27263DF2-3A60-4915-B368-3A81DC26A684/c9985996009f5919ec785c1c2f815a00.png\",\n    \"name\": \"Salem Township Hospital\",\n    \"slgId\": \"596-11\",\n    \"url\": \"https://www.sthmychart.org/Salemtownshiphospital/\"\n  },\n  {\n    \"aliases\": [\n      \"CFM\",\n      \"Complete Family Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7F8D03F1-DE7F-4847-AE86-13DE8D916874/eedef719681c679ff0acd8c01d44b018.png\",\n    \"name\": \"Hannibal Regional Healthcare System\",\n    \"slgId\": \"596-12\",\n    \"url\": \"https://www.myhannibalregional.org/HRHSMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/54646AF7-7FCB-40F3-B680-F4EEBF80CCA8/b34c51efde0987dcd9c62f9d7b92d264.png\",\n    \"name\": \"Leon Medical Centers\",\n    \"slgId\": \"598\",\n    \"url\": \"https://www.leonmediconnect.com/myChartLeonMediConnect/\"\n  },\n  {\n    \"aliases\": [\n      \"VA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2399C6C7-71CD-4463-B5CB-A70931EE17B1/edce0cedb3fa0b2c57a89d9fd4be3b60.png\",\n    \"name\": \"Carilion Clinic\",\n    \"slgId\": \"600\",\n    \"url\": \"https://mychart.carilionclinic.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Vernon\",\n      \"Gundersen\",\n      \"Bellin Health\",\n      \"Gundersen Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8FE41241-AA60-40F2-B230-8865DFA77207/895f8ce02bc15c59f08b03ee1de97b29.png\",\n    \"name\": \"Emplify Health\",\n    \"slgId\": \"605\",\n    \"url\": \"https://mychart.emplifyhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F8B2E89-EC0D-421E-8984-0F5A993D2961/b4ad571683b16a57d04183a0b7fbde4b.png\",\n    \"name\": \"Vernon Memorial Healthcare\",\n    \"slgId\": \"605-1\",\n    \"url\": \"https://www.vmhmychart.org/vmh/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9CCCEF38-0478-4BC2-A23C-4C9F72C8FA49/60a508209265099c2fa3a36d74ba8aca.png\",\n    \"name\": \"Tomah Health\",\n    \"slgId\": \"605-2\",\n    \"url\": \"https://mychart.gundersenhealth.org/tmh/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0620BEB2-BF49-434E-9230-7BC71FA8AC33/ddd7f69a9053f8c5dc3201202f5cb347.png\",\n    \"name\": \"Crossing Rivers Health\",\n    \"slgId\": \"605-3\",\n    \"url\": \"https://mychart.crossingrivers.org/CRH/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/370D653B-F699-4821-AA2E-3A328DE92DF3/d99be10261517a16f58aec1a5da20712.png\",\n    \"name\": \"NorthEast Wisconsin Community Clinic\",\n    \"slgId\": \"605-4\",\n    \"url\": \"https://mychart.emplifyhealth.org/newcc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FBC393CB-FFA1-4E7B-AFC1-F1CBB1AB0891/d3dbd299ad32f623ff2e06bd2ef16a7f.png\",\n    \"name\": \"Urology Associates of Green Bay\",\n    \"slgId\": \"605-5\",\n    \"url\": \"https://mychart.emplifyhealth.org/uagb/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2FE3EA15-67C3-4AD6-B0FD-08B466E30056/905997d16ccbdf3529110ca683d4d8eb.png\",\n    \"name\": \"Unity\",\n    \"slgId\": \"605-6\",\n    \"url\": \"https://mychart.emplifyhealth.org/unity/\"\n  },\n  {\n    \"aliases\": [\n      \"Seders\",\n      \"Foothill Cardiology\",\n      \"Marina Hospital\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C835A918-CEA4-4A64-A9B5-A2C33D1E6B46/6fee18fce7850edfade671b6219bffb7.png\",\n    \"name\": \"Cedars-Sinai\",\n    \"slgId\": \"612\",\n    \"url\": \"https://patients.mycslink.org/mycslink/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/41FEF58C-8AAB-4358-AD0D-6AB0DAE27664/7aabdc975a3d7ec0be78e42d52bd7ab8.png\",\n    \"name\": \"Huntington Hospital\",\n    \"slgId\": \"612-1\",\n    \"url\": \"https://mycslink.cedars-sinai.org/mycslink/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"SMGS\",\n      \"Maryville\",\n      \"Francis\",\n      \"Dean\",\n      \"Monroe\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BBB11DF9-0909-4C61-9426-47E76373AFD4/5f07a715f751ed497cb3420a88fb54c9.png\",\n    \"name\": \"SSM Health\",\n    \"slgId\": \"618\",\n    \"url\": \"https://mychart.ssmhc.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"SG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EBB0A3BB-2087-4C54-8D76-9F104DD50CF5/16c93f72b69b90d613f57b543fba5be8.png\",\n    \"name\": \"Spaarne Gasthuis\",\n    \"slgId\": \"621\",\n    \"url\": \"https://www.mijnspaarnegasthuis.nl/MyChart_PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/46D5BF57-A9C2-4DE8-8C5F-DB0F0DC7B964/83ebcf05621dab1633b1f07ceaea3286.png\",\n    \"name\": \"UK King's Daughters\",\n    \"slgId\": \"631\",\n    \"url\": \"https://mychart.kdmc.net/MyChartPRODUCTION/\"\n  },\n  {\n    \"aliases\": [\n      \"Lincoln\",\n      \"NorDx\",\n      \"Pen Bay\",\n      \"Spring Harbor\",\n      \"St. Andrews\",\n      \"Synernet\",\n      \"Waldo\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5D863D48-5733-49C7-BF7B-2774228DA235/7aeae230b0382e123a0e3ce3bec7196f.png\",\n    \"name\": \"MaineHealth\",\n    \"slgId\": \"633\",\n    \"url\": \"https://mychart.mainehealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/72BEB453-FE00-432E-9E77-79468DAB336C/ff638a446864070cea27c02de8808cd5.png\",\n    \"name\": \"Rady Children's\",\n    \"slgId\": \"637\",\n    \"url\": \"https://www.mychartatradychildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"CVMC\",\n      \"CVPH\",\n      \"PMC\",\n      \"UVMHN\",\n      \"Fletcher Allen\",\n      \"FAHC\",\n      \"UVMMC\",\n      \"UVMH\",\n      \"UVM Health\",\n      \"UVMHealth\",\n      \"AHMC\",\n      \"ECH\",\n      \"HelenPorter\",\n      \"Porter\",\n      \"Alice Hyde\",\n      \"Elizabethtown\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/278ED610-FD31-41CE-AABD-2F10868BD947/cc8fc689b89141208da850dbe3575652.png\",\n    \"name\": \"University of Vermont Health Network\",\n    \"slgId\": \"639\",\n    \"url\": \"https://mychart.uvmhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SCLHS,SCL,SCL Health\",\n      \"SCLHS\",\n      \"SCL\",\n      \"SCL Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9015E058-3F3E-4311-828C-29C6AAC87479/d3a100469b462ab6dd5df6da59e7eda4.png\",\n    \"name\": \"Intermountain Health\",\n    \"slgId\": \"645\",\n    \"url\": \"https://mychart.intermountainhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4CEE1A4C-3CD3-4FBE-8009-EF1C1F00BAA2/5ffbd6a7c09359fd2e5beb7f7fbac2d4.png\",\n    \"name\": \"Cody Regional Health\",\n    \"slgId\": \"645-1\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DEA44526-003B-4A4C-ACA2-87CDB626E9E9/2baa46ef57deb81ca03f16357c1b8d77.png\",\n    \"name\": \"Uptown Community Health Center\",\n    \"slgId\": \"645-4\",\n    \"url\": \"https://mychart.sclhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DA887866-9F39-419C-AE95-2AE14D5C71CA/bbad2175f84b4be9aa1e1f78f1acdcf6.png\",\n    \"name\": \"Memorial Regional Health\",\n    \"slgId\": \"645-5\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/69F142A9-2C9B-40B7-9577-79C923A0EB72/3f9c39680ad0c3081bb58850c774d8ba.png\",\n    \"name\": \"Billings OBGYN\",\n    \"slgId\": \"645-6\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NJH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E90619C5-AD4B-4AE9-84A0-B1ADB69AADFF/daab3aac5793458d4c728ad378c35d3d.png\",\n    \"name\": \"National Jewish Health\",\n    \"slgId\": \"645-7\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SPH\",\n      \"Saint Peter's\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6A825E4-5DC9-4794-B0AA-9364F42B273A/40d0aaf11bbf3724bfaee7577e4a2e10.png\",\n    \"name\": \"St. Peter's Health\",\n    \"slgId\": \"645-8\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C76B7047-156D-4635-AC9E-5FEB669BF00A/7afb70e20fb4a92b2bcc075e1e6f226b.png\",\n    \"name\": \"Family Health West\",\n    \"slgId\": \"645-9\",\n    \"url\": \"https://mychart.sclhealth.org/CCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/60E01898-B245-4B08-A694-223AC79887D8/243cb10563937e8110f9e8f4a2e7778d.png\",\n    \"name\": \"Franciscan Alliance\",\n    \"slgId\": \"648\",\n    \"url\": \"https://franciscanmychart.org/Mychart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/520C14EC-91DD-46D9-AE4D-CE5788B04B80/79b26f5c77f70ff6761793e8c0014ee9.png\",\n    \"name\": \"Specialty Physicians of Illinois\",\n    \"slgId\": \"648-2\",\n    \"url\": \"https://spimychart.com/spimychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DA3DE8B4-971A-4436-926A-CEDF9C6CA778/1b2eaceb8131bd6104e458b7f45ed345.png\",\n    \"name\": \"Franciscan HealthConnect\",\n    \"slgId\": \"648-3\",\n    \"url\": \"https://franciscanmychart.org/HCC/\"\n  },\n  {\n    \"aliases\": [\n      \"NM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91B185AB-7DFE-4965-8344-EFC077935EDE/f06821151da4e846502826c030f80b07.png\",\n    \"name\": \"Northwestern Medicine\",\n    \"slgId\": \"650\",\n    \"url\": \"https://mychart.cdh.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LRMC\",\n      \"LHA\",\n      \"Corewell Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6A9C528D-5BDF-4842-896D-520644B00DB2/dba71dfaf00f4b49d5144e6fb466afb2.png\",\n    \"name\": \"Lakeland HealthCare\",\n    \"slgId\": \"652\",\n    \"url\": \"https://mychart.lakelandregional.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/98703C3A-1EFF-4725-A69B-1F4854E90C4A/b0710d51a321e1636bd830bf31c966ee.png\",\n    \"name\": \"The Christ Hospital\",\n    \"slgId\": \"655\",\n    \"url\": \"https://www.thechristhospitalmychart.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"MSMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4BFF9297-4233-492A-84F7-F1256C553DAE/e68eb0cbb90fc1dc2394fdeca09d96fa.png\",\n    \"name\": \"Mount Sinai Florida\",\n    \"slgId\": \"658\",\n    \"url\": \"https://mychart.msmc.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Fox Chase\",\n      \"FoxChase\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ECBB1096-EFCC-437A-96EE-1F22E7CB53DB/ca30f4d7babe55b241b92608b91a7ff5.png\",\n    \"name\": \"TempleHealth\",\n    \"slgId\": \"660\",\n    \"url\": \"https://my.templehealth.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2D1263C9-A487-4F71-9EF2-329DBE9CA7FA/c4b7f415751acb59f0bdb1fc04f4438e.png\",\n    \"name\": \"Baylor\",\n    \"slgId\": \"663\",\n    \"url\": \"https://mychart.bcm.edu/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E359F4C6-159A-4EF8-A72A-7FE95EE7FC34/3989fc5af49d94ff6431854a239159f1.png\",\n    \"name\": \"Onvida\",\n    \"slgId\": \"665\",\n    \"url\": \"https://mycare.onvidahealth.org/mycare/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E50DDAF0-6BF3-4C55-BD69-6564C71D7A5B/a33edcf008cada7ff08b59e879ebb960.png\",\n    \"name\": \"Community Medical Centers\",\n    \"slgId\": \"668\",\n    \"url\": \"https://mychart.communitymedical.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E5150F9A-AF19-48CA-AF14-D0A8EA1F3140/597baa537a89d1662134c0c14c8f40c0.png\",\n    \"name\": \"Legacy Health System\",\n    \"slgId\": \"671\",\n    \"url\": \"https://myhealth.lhs.org/myhealth/\"\n  },\n  {\n    \"aliases\": [\n      \"UFHealth\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/398B304C-2708-4EA5-8E84-CA2CA2147E67/3fdae5a9e666e3cb68dec643e55d563b.png\",\n    \"name\": \"University of Florida\",\n    \"slgId\": \"677\",\n    \"url\": \"https://mychart.shands.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [\n      \"McFarland\",\n      \"MFC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1D50C3B1-524F-4649-89C5-AAE635877933/16ff9f3dc0c3bedbf0a2afa8ee0fc214.png\",\n    \"name\": \"Health Ventures\",\n    \"slgId\": \"682\",\n    \"url\": \"https://www.mychartiowa.com/mychartprd/\"\n  },\n  {\n    \"aliases\": [\n      \"SHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ED36D834-A8D1-472F-AA30-B6F68CE65351/aed8fa182b9724c832840cadbd110b64.png\",\n    \"name\": \"University of Michigan Health-Sparrow\",\n    \"slgId\": \"684\",\n    \"url\": \"https://mychart.sparrow.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/211B76F5-67A1-48D2-89BD-0ACE0E09500F/3f2d3b8cd3e38177de38e94479a78f61.png\",\n    \"name\": \"Driscoll Children's Hospital\",\n    \"slgId\": \"686\",\n    \"url\": \"https://mychart.dchstx.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"luminis\",\n      \"Anne Arundel\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FE3757AE-90F5-442B-B5F6-258034AADF04/78ed38fa40a80f0cb9e1322e68ba6eeb.png\",\n    \"name\": \"Luminis Health\",\n    \"slgId\": \"688\",\n    \"url\": \"https://mychart.aahs.org/MyChart/default.asp\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AFB84EEC-5518-4972-91DA-7BE72AB56D83/43529dd660e981794f17b9fd30f5586b.png\",\n    \"name\": \"Akron Children's\",\n    \"slgId\": \"691\",\n    \"url\": \"https://mychart.akronchildrens.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0110F175-16F7-4119-BA43-6D1A65A2CDFE/b9a912e72d5cd3099b2193dc3e0d7873.png\",\n    \"name\": \"Summit County Public Health\",\n    \"slgId\": \"691-2\",\n    \"url\": \"https://mychart.akronchildrens.org/SCPH/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/592F912D-86D7-4B06-BE25-F116FB958DE6/fcd669eccb105f035792c2fd093ae310.png\",\n    \"name\": \"Child Guidance and Family Solutions\",\n    \"slgId\": \"691-3\",\n    \"url\": \"https://mychart.akronchildrens.org/CGFS/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"IHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0AA8401E-40F9-40B3-BC8D-10D1883DD3A0/f4e6e80ff3fba7ee3d6ca1a7998e0a3f.png\",\n    \"name\": \"Infirmary\",\n    \"slgId\": \"694\",\n    \"url\": \"https://www.myihchart.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/474E32F6-E1F3-45D2-8CA2-4B56431CD940/6b0d1c653b794698b2f95b7baacfdc90.png\",\n    \"name\": \"OLVG\",\n    \"slgId\": \"696\",\n    \"url\": \"https://www.mijnolvg.nl/mychart-prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D4BEDA44-408B-44E1-9E5F-3C7E1332E3F8/fe909d8a3aee8022193cbddd8aa74987.png\",\n    \"name\": \"Hackensack Meridian Health\",\n    \"slgId\": \"701\",\n    \"url\": \"https://mychart.hmhn.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Memorial\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BA6EAC96-2856-4A0B-8763-E7DB6E21720D/8b75a971dc8a5a4baee0d2b3125e21a5.png\",\n    \"name\": \"Deaconess\",\n    \"slgId\": \"703\",\n    \"url\": \"https://www.viewmychart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/93B8D786-EC37-46F5-8D6F-50774943CB6B/4c9b0955864988b6aa4dc425526e356e.png\",\n    \"name\": \"Good Samaritan\",\n    \"slgId\": \"703-1\",\n    \"url\": \"https://www.viewmychart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Maricopa\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/20CF9756-DEE9-4B13-B08E-ED7492A5BD74/6375af2575da800a25b10602b79ee97c.png\",\n    \"name\": \"Valleywise\",\n    \"slgId\": \"706\",\n    \"url\": \"https://mychart.valleywisehealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/21A7DB9D-69B8-4164-A7BC-EC6E9D0993CE/8985a9076eaf7627f332177dd97e3dd8.png\",\n    \"name\": \"St. Elizabeth Healthcare\",\n    \"slgId\": \"712\",\n    \"url\": \"https://mychart.stelizabeth.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9EFF94E0-DEF8-421C-AF64-C45A80F5A1A1/97e1deb2631e9dca183137bd92f3db86.png\",\n    \"name\": \"Hendricks Regional Health\",\n    \"slgId\": \"712-2\",\n    \"url\": \"https://mychart.hendricks.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Coal Country Community Health Center\",\n      \"Dakota Regional Medical Center\",\n      \"First Care Health Center\",\n      \"Heart of America Medical Center\",\n      \"Langdon Prarie Health\",\n      \"LifeCare Medical Center\",\n      \"Nelson County Health\",\n      \"North Valley Health Center\",\n      \"Northwood Deaconess Health Center\",\n      \"Pembina County Memorial Hospital\",\n      \"Sakakawea Medical Center\",\n      \"Spectra Health\",\n      \"St. Luke’s Medical Center\",\n      \"Tioga Medical Center\",\n      \"Towner County Medical Center\",\n      \"Unity Medical Center\",\n      \"Langdon Prairie Health\",\n      \"Headwaters Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/55ED4CFD-4147-4673-879C-C17364D1D8C4/bc8b0f5dbd4df7221c9bbe4ee0600bd3.png\",\n    \"name\": \"Altru\",\n    \"slgId\": \"714\",\n    \"url\": \"https://mychart.altru.org/myhealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D3924E01-4465-4C6D-B757-E129E4A51E32/3bd574239be9067a47a37a1ade9ac640.png\",\n    \"name\": \"NYU Langone\",\n    \"slgId\": \"718\",\n    \"url\": \"https://mychart.nyulmc.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7DFF2013-647B-4194-9722-AE6C5E77EA1A/ff778ea23b18a3c160a9ff0c88c2e570.png\",\n    \"name\": \"Dartmouth\",\n    \"slgId\": \"722\",\n    \"url\": \"https://www.mydh.org/portal/\"\n  },\n  {\n    \"aliases\": [\n      \"Spectrum Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/52F5962D-E151-4CD5-BB5C-89CC80F7E4EF/5fc3cd3355449e8ce6fa46e4b5a63f11.png\",\n    \"name\": \"Corewell Health\",\n    \"slgId\": \"733\",\n    \"url\": \"https://mychart.spectrumhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACBA36B5-D115-4A6F-B3F9-32077E061D28/55b2d95cbacfbcd9ceeadb982524a681.png\",\n    \"name\": \"Genesis\",\n    \"slgId\": \"735\",\n    \"url\": \"https://mychart.genesishcs.org/mychart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BE9C251E-2E1D-443C-AFF3-F8FE0F4B6075/be1723d491c964bc2be38f977a3f4ab0.png\",\n    \"name\": \"University of Virginia\",\n    \"slgId\": \"737\",\n    \"url\": \"https://mychart.healthsystem.virginia.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Hamilton County Public Health\",\n      \"CHP\",\n      \"Community\",\n      \"CMHP\",\n      \"Springfield\",\n      \"Humility\",\n      \"HMHP\",\n      \"Lourdes\",\n      \"Marcum\",\n      \"St. Joseph\",\n      \"St. Rita\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2BFEA94B-589A-4695-81AB-9D3D9CFBA3A7/2289de894db1e4ad5e83680a78c33789.png\",\n    \"name\": \"Mercy Health\",\n    \"slgId\": \"742\",\n    \"url\": \"https://chpepiceweb.health-partners.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/761372B4-6EB5-4993-9DBE-7C41706BE1D4/d3abe80fb22ead4b124ef7aa5ce8bd8f.png\",\n    \"name\": \"Wyandot Memorial Hospital\",\n    \"slgId\": \"742-4\",\n    \"url\": \"https://chpepiceweb.health-partners.org/MyChart\"\n  },\n  {\n    \"aliases\": [\n      \"Bon Secours\",\n      \"Greenville\",\n      \"Hampton Roads\",\n      \"Urology of Virginia\",\n      \"UVA\",\n      \"Richmond\",\n      \"Grove\",\n      \"Ditty\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/657EA875-EC52-4C4D-948C-955513172FCD/229cec6c5f83912351bd09fde56867e9.png\",\n    \"name\": \"Bon Secours Health System\",\n    \"slgId\": \"742-5\",\n    \"url\": \"https://mychart.bonsecours.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Boeing\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BE234A57-A6ED-4313-A0ED-28239B2ED68E/20b1a78b0dbc0488e91c9783f2413426.png\",\n    \"name\": \"Roper St. Francis\",\n    \"slgId\": \"742-6\",\n    \"url\": \"https://mychart.rsfh.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Bangor\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3BFB43C5-7147-4A09-AF05-14A91CE2A04F/d374f10bd77a33de25d29dec57cd211d.png\",\n    \"name\": \"Covenant Health\",\n    \"slgId\": \"742-7\",\n    \"url\": \"https://mychart.covh.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/21DF9195-B18F-415B-B7C9-E03C8B087651/3a6b6a0e9657403fd4cef49664aae050.png\",\n    \"name\": \"Chesapeake Regional Healthcare\",\n    \"slgId\": \"742-8\",\n    \"url\": \"https://mychart.chesapeakeregional.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Harness Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37F6E802-D4E0-4F65-90DF-841CF9AF3FBB/e47a587f707b1257dd717283a8adee43.png\",\n    \"name\": \"Harness Health Pharmacy\",\n    \"slgId\": \"742-9\",\n    \"url\": \"https://chpepiceweb.health-partners.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/07C7A4A5-5A72-46F7-AECD-EE56F463EA08/12565453d8efe19743ae75d34be62953.png\",\n    \"name\": \"University of Miami\",\n    \"slgId\": \"747\",\n    \"url\": \"https://myuhealthchart.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AD66ED55-FD15-4CAC-A2F1-5E0A6B91D69F/a2f679b02dbb3a6ab1f2f6c0653cbf36.png\",\n    \"name\": \"Grady Health System\",\n    \"slgId\": \"748\",\n    \"url\": \"https://mychart.gradyhealth.org/mychart\"\n  },\n  {\n    \"aliases\": [\n      \"Pain Relief of Dayton\",\n      \"Pulmonary Critical Care and Sleep Medicine Associates LLC\",\n      \"Shiloh Family Medicine\",\n      \"Pulmonary Medicine of Dayton Inc\",\n      \"Springfield Heart Surgeons LLC\",\n      \"Cova OBGYN LLC\",\n      \"Scheidler Health Associates LLC\",\n      \"Total Health and Wellness OBGYN LLC\",\n      \"Dayton Springfield Heart and Vascular Medicine\",\n      \"Western Avenue Family Practice LLC\",\n      \"Gastrocare of Southwest Ohio LLC\",\n      \"Good Neighbor House\",\n      \"Brigid's Path\",\n      \"Dayton Kidney\",\n      \"Diabetes and Endocrinology Specialists of Southwestern Ohio\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0130089D-C56F-4761-A70D-65C4F88668C4/9eda43784d9dc6ab9cce742e818001ac.png\",\n    \"name\": \"Kettering\",\n    \"slgId\": \"749\",\n    \"url\": \"https://mychart.ketteringhealth.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D16C807-AF3F-42AA-BB98-006C3410C763/d4c55d682e2740fb6431b332ee4cea52.png\",\n    \"name\": \"Powers Health\",\n    \"slgId\": \"750\",\n    \"url\": \"https://mychart.powershealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Highland\",\n      \"Strong Memorial\",\n      \"URMC\",\n      \"UR Medicine\",\n      \"Jones\",\n      \"St. James\",\n      \"Noye\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3AEAAF21-B7F8-4D76-B35F-2BC8D260D9A4/1e40fd1b6097546493ea557dbe947368.png\",\n    \"name\": \"University of Rochester\",\n    \"slgId\": \"751\",\n    \"url\": \"https://mychart.urmc.rochester.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Upstate\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E16EAD55-CF6B-447B-997D-85A74DE4BC3E/435522108c4c28207fe0714bc1f7dd7d.png\",\n    \"name\": \"SUNY\",\n    \"slgId\": \"753\",\n    \"url\": \"https://mychart.upstate.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"University of Colorado Health\"\n    ],\n    \"directoryUrl\": \"https://www.uchealth.org/access-my-health-connection/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A2A9A284-29D2-45D1-8F3A-153B2D6A58A9/3facfb253594172257a07d169f497ef9.png\",\n    \"name\": \"UCHealth\",\n    \"slgId\": \"755\",\n    \"url\": \"https://mychart.uchealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SummitStone\",\n      \"Health\",\n      \"Partners\",\n      \"HealthPartners\",\n      \"Summit\",\n      \"Stone\",\n      \"UCH\",\n      \"UCHealth\",\n      \"Sheridan Health Services\",\n      \"Belleview Point Clinic\",\n      \"Bellview Point Clinic\",\n      \"RWMC\",\n      \"RWHS\",\n      \"RWPC\",\n      \"Regional\",\n      \"West\",\n      \"Scottsbluff\",\n      \"airlink\",\n      \"RWEMS\",\n      \"regionalwest\",\n      \"Regional West\",\n      \"GNVH\",\n      \"GVH\",\n      \"Gunnison\",\n      \"Valley\",\n      \"Gunnison Valley\",\n      \"CCH\",\n      \"Campbell County Hospital\",\n      \"Campbell\",\n      \"Campbell County Medical Group\",\n      \"campbellcounty\",\n      \"SCHR\",\n      \"Surgery Center of Highlands Ranch\",\n      \"Highlands\",\n      \"Ranch\",\n      \"SCOHR\",\n      \"SCA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DD42AC11-992A-4DED-9E66-8DCA82D339EC/e3f97a04666cc003bc44e36955a2292a.png\",\n    \"name\": \"UCHealth Affiliated Clinics and Hospitals MyChart\",\n    \"slgId\": \"755-1\",\n    \"url\": \"https://mychart.uchealth.org/Affiliates/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"OCR\",\n      \"orthopedic\",\n      \"rockies\",\n      \"OSCR\",\n      \"and\",\n      \"centers\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/84A43BB0-DFC6-4B82-9AFC-17374AD3AA6F/4651e381562e2b031362f4a6c97f7fd0.png\",\n    \"name\": \"Orthopaedic & Spine Center of the Rockies\",\n    \"slgId\": \"755-2\",\n    \"url\": \"https://mychart.connect.orthohealth.com/ocr/\"\n  },\n  {\n    \"aliases\": [\n      \"valleyviewhospital\",\n      \"valleyview\",\n      \"valleyviewhealth\",\n      \"vvh\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BBF4406C-291B-4EF8-9EEC-5F499311645C/37f7333c81a9b94111ab3a9526a2160c.png\",\n    \"name\": \"Valley View Hospital\",\n    \"slgId\": \"755-3\",\n    \"url\": \"https://mychart.connect.vvh.org/vvh/\"\n  },\n  {\n    \"aliases\": [\n      \"VailHealth\",\n      \"Vail\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B4DE327A-01B1-4CAE-87E9-25EABF7F287E/e21bde293699b3852894002f50464709.png\",\n    \"name\": \"Vail Health\",\n    \"slgId\": \"755-4\",\n    \"url\": \"https://mychart.portal.vailhealth.org/vail/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A61A26F5-F784-4F4E-AA1C-B0697994CADD/3d9e6c65b7b672eb8e019614ccf55e5a.png\",\n    \"name\": \"Providence, Alaska\",\n    \"slgId\": \"758\",\n    \"url\": \"https://mychartak.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6EB5D3E-9E35-46C1-9CFB-4D66E501B744/9be6431d7cad1db67eec4a30fec322a3.png\",\n    \"name\": \"Central Peninsula Hospital\",\n    \"slgId\": \"758-2\",\n    \"url\": \"https://ak.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/35D312CF-84C5-4EC9-B701-2D3AA9C65DED/1b1d92e0e8d4d74a41944b3a5ed71ac6.png\",\n    \"name\": \"Alaska Neurology Center\",\n    \"slgId\": \"758-3\",\n    \"url\": \"https://mychartak.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/471F82D3-15A8-47FE-89DB-458507E89209/ee862ea38d32ac82ef92ca38698dcbd9.png\",\n    \"name\": \"Anchorage Neighborhood Health Center\",\n    \"slgId\": \"758-4\",\n    \"url\": \"https://ak.myonlinechart.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91866C5F-E486-45D2-83CF-203CAA3EA0D9/230dee51190884422f1c114f286a1660.png\",\n    \"name\": \"Seward Community Health Center\",\n    \"slgId\": \"758-5\",\n    \"url\": \"https://ak.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A615067B-3A26-4E68-B6D0-7225DAB08D96/18faab404a1b3fc446be7963a99f59bd.png\",\n    \"name\": \"Anchorage Neurosurgical Associates\",\n    \"slgId\": \"758-6\",\n    \"url\": \"https://ak.myonlinechart.org/affiliate/authentication/login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/82B4A5FF-F481-479C-AC39-10A4CDD934C3/59dfe3f24aba26fa4869b854411fc444.png\",\n    \"name\": \"South Peninsula Hospital\",\n    \"slgId\": \"758-8\",\n    \"url\": \"https://ak.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A05C7056-537D-4C37-B087-E711ED6D735B/fd7eb1947599d9e4eaa9a90f539475cb.png\",\n    \"name\": \"Vancouver Clinic\",\n    \"slgId\": \"759\",\n    \"url\": \"https://mychart.tvc.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"TGH\",\n      \"TGMG\",\n      \"Bayshore\",\n      \"Kennedy\",\n      \"Healthpark\",\n      \"Brandon\",\n      \"Lois\",\n      \"University of South Florida\",\n      \"USF\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/81CA6B45-88CA-4DAD-B447-0F2DF3104384/8b53d2d2d63653276ef119b3ca6c14bd.png\",\n    \"name\": \"Tampa General Hospital\",\n    \"slgId\": \"761\",\n    \"url\": \"https://mychart.tgh.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"USF\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7ECAA2A5-C10F-4A3D-ADA0-7E3A86C5C00F/070dbb6c5a167b66bd65f280d1dc4eec.png\",\n    \"name\": \"University of South Florida\",\n    \"slgId\": \"761-2\",\n    \"url\": \"https://mychart.health.usf.edu/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/20D06619-9FB4-49C8-82D9-B56593A2FB16/848cef707d804833e15f2d0ebf9f495f.png\",\n    \"name\": \"Access Community Health Network\",\n    \"slgId\": \"762\",\n    \"url\": \"https://www.myaccesshealth.net/myaccesshealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/244E2594-848B-4AFD-9FB5-29785132A54A/e536b0be714135f96b28a396b7ae56b3.png\",\n    \"name\": \"Memorial Healthcare System\",\n    \"slgId\": \"763\",\n    \"url\": \"https://mychart.mhs.net/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F5D7D46-2F30-4CBB-BCCC-CE817BFB253C/ba5cff883e180b3e6254b992f21cdcab.png\",\n    \"name\": \"Communitycare PLAN\",\n    \"slgId\": \"763-2\",\n    \"url\": \"https://mychart.mhs.net/mychartCCP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E160925D-DF5B-4EA3-A0E0-FDAE9725E71D/55cc0d9ae24d17c2f8560bf8069cdccd.png\",\n    \"name\": \"Connect PBC\",\n    \"slgId\": \"763-3\",\n    \"url\": \"https://mychart.mhs.net/connectpbc/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Wenatchee\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AA42D750-EBAF-46BF-9704-E7B04EF24AD0/77e0fb6666d2b33b207a95d9fef367fc.png\",\n    \"name\": \"Confluence Health\",\n    \"slgId\": \"764\",\n    \"url\": \"https://mychart.confluencehealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Orange\",\n      \"CRMC\",\n      \"Catskill\",\n      \"ORMC\",\n      \"GHV\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2F180C53-4CF2-4A86-8B53-251A4A2B0586/a142547691ae179e21370d44af7c3283.png\",\n    \"name\": \"Garnet Health\",\n    \"slgId\": \"765\",\n    \"url\": \"https://mychart.garnethealth.org/GH/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9E7312CB-3860-4B9B-9643-9655F9DA78ED/d243410566fc9c3609c59c67416be7c6.png\",\n    \"name\": \"Amphia\",\n    \"slgId\": \"767\",\n    \"url\": \"https://mijn.amphia.nl/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"SVHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EEE0EC9B-F4BA-4986-8D4D-D7D57DE1F98E/02273e78638628be1261291cc261f4dc.png\",\n    \"name\": \"Stormont Vail Health Care\",\n    \"slgId\": \"768\",\n    \"url\": \"https://mychart.stormontvail.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B7E9EC7D-740F-4724-BB3C-BE65F41ADD4A/12a2614efc22f209840ab0b73e6eba5a.png\",\n    \"name\": \"Riverside Medical Clinic\",\n    \"slgId\": \"771\",\n    \"url\": \"https://myhealthyconnection.riversidemedicalclinic.com/\"\n  },\n  {\n    \"aliases\": [\n      \"RGHS\",\n      \"RGH\",\n      \"Roc Regional\",\n      \"Rochester Regional Health System\",\n      \"Rochester Regional Health\",\n      \"Roc Health\",\n      \"RRH\",\n      \"UHS\",\n      \"Unity Health System\",\n      \"Unity Hospital\",\n      \"ViaHealth\",\n      \"SLH\",\n      \"St. Lawrence Health\",\n      \"Clifton Springs Hospital & Clinic\",\n      \"CSHC\",\n      \"Newark Wayne Community Hospital\",\n      \"NWCH\",\n      \"United Memorial Medical Center\",\n      \"UMMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EDA5C2E0-47C4-42B6-8700-B855427F9175/afdec1f6bdf11b879246a097b2fd7569.png\",\n    \"name\": \"Rochester Regional Health\",\n    \"slgId\": \"772\",\n    \"url\": \"https://mycare.rochesterregional.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A2D46505-1A70-47EC-A262-7B9F487526DE/85553598ab8c87b904ec9968668209c8.png\",\n    \"name\": \"Catholic Health Services of Long Island\",\n    \"slgId\": \"773\",\n    \"url\": \"https://mychart.chsli.org/mychartprod/\"\n  },\n  {\n    \"aliases\": [\n      \"Khoulani\",\n      \"Hammoud\",\n      \"WeCare Villa Linde\",\n      \"Korant\",\n      \"Alghanem\",\n      \"Arif\",\n      \"Aziem\",\n      \"Cypress Cardiology\",\n      \"Eustace\",\n      \"Fadl\",\n      \"Genesee Colorectal Center\",\n      \"Heart Rhythm Clinic of Michigan\",\n      \"Law\",\n      \"Michigan Health Specialists\",\n      \"Milford\",\n      \"MHS\",\n      \"Michigan Rheumatology Group\",\n      \"Mohamed\",\n      \"Saeed\",\n      \"Sharman\",\n      \"Syed\",\n      \"Blueberry Healthcare\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F572899-A5E3-4AD6-81B9-DB2A6E521AD0/9008bec0737d689af7d002541b47fa6d.png\",\n    \"name\": \"Hurley Medical Center\",\n    \"slgId\": \"774\",\n    \"url\": \"https://mychart.hurleymc.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Jamaica\",\n      \"Flushing\",\n      \"TJH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/82AC8D3A-BF04-4B1C-AFA3-30348523EC6B/54f585fd8d14db18d0560135743d7337.png\",\n    \"name\": \"MediSys Health Network\",\n    \"slgId\": \"775\",\n    \"url\": \"https://mychart.medisys.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/103D4643-4312-4F6C-8C7C-0B787BCD1C72/62f91b955281cf286c9c4f3c59803da4.png\",\n    \"name\": \"Bassett Healthcare\",\n    \"slgId\": \"778\",\n    \"url\": \"https://www.mybassetthealthconnection.org/mychart-prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9DF460AE-AA00-4ED2-8192-BA97F931D6D4/a19c17bd05ec7b770c49faf2c136f649.png\",\n    \"name\": \"Lallie Kemp Regional Medical Center\",\n    \"slgId\": \"779\",\n    \"url\": \"https://www.mylsuhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B79AD562-1537-4170-8893-54AEC2650070/b0dc7271fd1dbf78f05b2b2c8b9edf8e.png\",\n    \"name\": \"LCMC Health\",\n    \"slgId\": \"779-1\",\n    \"url\": \"https://patientportal.lcmchealth.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E18583F4-83CD-43B0-9DC3-DF67D14D8419/a22425d4ef47685e12a5ced5f748b1d8.png\",\n    \"name\": \"Children's Heart Clinic of LA\",\n    \"slgId\": \"779-5\",\n    \"url\": \"https://ccpatientportal.lcmchealth.org/chcla/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EE737888-646F-442A-86A9-AF72563E1E72/cd03101983bb905765a87ff106204888.png\",\n    \"name\": \"Culicchia Neurological\",\n    \"slgId\": \"779-6\",\n    \"url\": \"https://ccpatientportal.lcmchealth.org/cnc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C892FFA3-BCAC-45D5-A350-79B69154210D/4a7c6b7847b15448369b84a0cca2aea0.png\",\n    \"name\": \"Dr Brain\",\n    \"slgId\": \"779-7\",\n    \"url\": \"https://patientportal.lcmchealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/141C9BDD-9E85-407E-8F86-8513A53D1F45/0d4de53b1714b48b7984718480ce21cb.png\",\n    \"name\": \"LSU Health Network\",\n    \"slgId\": \"779-9\",\n    \"url\": \"https://ccpatientportal.lsuhn.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CA31C1AA-C8D4-451A-95B5-AB74FC577E1C/369a7d582d0831fa5cf1c262b1f507eb.png\",\n    \"name\": \"MRI of Louisiana\",\n    \"slgId\": \"779-10\",\n    \"url\": \"https://ccpatientportal.lcmchealth.org/mriofla/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/23C7902C-A826-4246-81A2-21A776DA641C/6cb46304d841193565860afb8c3a324e.png\",\n    \"name\": \"Pennington Biomedical\",\n    \"slgId\": \"779-11\",\n    \"url\": \"https://ccpatientportal.lcmchealth.org/pbr/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/04990177-DA13-4EB0-99DB-BC3BD66B0AEC/1213bccd3082b26dc980c83d0c730c8e.png\",\n    \"name\": \"St Thomas Community Health Center\",\n    \"slgId\": \"779-12\",\n    \"url\": \"https://ccpatientportal.stthomaschc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/67D32C1B-2AD9-4CBE-8A14-D10EE03D6D69/0c5035458d49204a6148fa1dafa729b7.png\",\n    \"name\": \"Caplan Eye Clinic\",\n    \"slgId\": \"779-13\",\n    \"url\": \"https://patientportal.lcmchealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/553A24A4-988D-4F61-96CE-2AA3DCA98272/58404408b4bd4ca2cc31e8f9039be61c.png\",\n    \"name\": \"New Orleans Nephrology Associates\",\n    \"slgId\": \"779-14\",\n    \"url\": \"https://patientportal.lcmchealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OMHS\",\n      \"Daviess\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/636FD587-BE76-4CD1-B232-C471EA0E0F09/b35aa09547fa7fba28fb3feec71d26d2.png\",\n    \"name\": \"Owensboro\",\n    \"slgId\": \"781\",\n    \"url\": \"https://mychart.omhs.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0C875055-71B8-4B5A-BB22-25BB856920C4/7350b2ecad87e8c2c4c5b20b854d5b98.png\",\n    \"name\": \"Baptist Health\",\n    \"slgId\": \"782\",\n    \"url\": \"https://mychart.baptist-health.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UMMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01609000-D36A-44E3-A5BA-FAE6ADAAB1D3/49d12a24ed4f474de826df65fbaa2820.png\",\n    \"name\": \"University of Mississippi Medical Center\",\n    \"slgId\": \"784\",\n    \"url\": \"https://www.umc.edu/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"MSDH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2EC9AA2A-411F-4A27-9264-DEA89051F42B/4bbc46253ee2b29bfa50c3a2f8deef99.png\",\n    \"name\": \"Mississippi State Department of Health\",\n    \"slgId\": \"784-1\",\n    \"url\": \"https://mymsdh.umc.edu/MyChart_MSDH_PRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/65E473E2-299B-4720-A22A-ADA3D711AE08/f6c30a4aae37791e48af3ab3a0eaa0bd.png\",\n    \"name\": \"GA Carmichael\",\n    \"slgId\": \"784-2\",\n    \"url\": \"https://mychart.umc.edu/GACFHCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/17E027C0-0DD9-447C-B5A8-32C32824B18A/92f0abdee038ecdaeffff55962df4d5f.png\",\n    \"name\": \"Sansum\",\n    \"slgId\": \"785\",\n    \"url\": \"https://mychart.sansumclinic.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Ressurrection\",\n      \"AMITA\",\n      \"Presence Health\",\n      \"Resurrection\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4699F483-BD08-4562-883D-3892023CA556/c22b8b23289562b831dc8d36f4bc2126.png\",\n    \"name\": \"Ascension Illinois\",\n    \"slgId\": \"787\",\n    \"url\": \"https://mychart.presencehealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"WHHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4F148F3D-FE5C-4605-935B-2256EF673C71/41ba6086256a9fa3214bf86a6503a7b1.png\",\n    \"name\": \"Washington Health\",\n    \"slgId\": \"788\",\n    \"url\": \"https://mychart.whhs.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/35107A90-FD80-4382-97B0-EEA6B4E2199D/33a290dccaf8a723643f3acc60c8b1c6.png\",\n    \"name\": \"JPS Health Network\",\n    \"slgId\": \"789\",\n    \"url\": \"https://jpsmychart.jpshealth.org/jpsmychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Meriter\",\n      \"RAMC\",\n      \"Reedsburg\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3623AD0C-0AAF-4029-BC3D-03503924D0C1/ac7ed77bd373a0425b7054c8fafb05a4.png\",\n    \"name\": \"UnityPoint Health\",\n    \"slgId\": \"790\",\n    \"url\": \"https://chart.myunitypoint.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A13E1601-F5D0-4278-BA67-71DC9DBA87E2/9270d09fb1eb44ad9d846b105d2c0c87.png\",\n    \"name\": \"Associated Physicians\",\n    \"slgId\": \"790-1\",\n    \"url\": \"https://chart.myunitypoint.org/associatedphysicians/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5795598C-F77D-4A82-850E-EFC61142D990/ae25e939a1d6e652244202c23f01cf3b.png\",\n    \"name\": \"Buchanan County Health Center\",\n    \"slgId\": \"790-2\",\n    \"url\": \"https://chart.myunitypoint.org/buchanancounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D722D7EE-87D5-4088-A1BA-CB58FFE6A602/504b5d518f3ceef7fa93cf79c3db7044.png\",\n    \"name\": \"Buena Vista Regional Medical Center\",\n    \"slgId\": \"790-3\",\n    \"url\": \"https://chart.myunitypoint.org/buenavista/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B3D17A2C-95CE-4379-B94A-71BF55CD599C/1ab80b372b24dab155af214bb23281ac.png\",\n    \"name\": \"Cherokee Regional Medical Center\",\n    \"slgId\": \"790-4\",\n    \"url\": \"https://chart.myunitypoint.org/cherokeeregional/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1FACDDD4-7CA6-42A9-B7F9-56C8017BCF3E/412da3ff1d20003bcf1d1cfbceec3dae.png\",\n    \"name\": \"Clarke County Hospital\",\n    \"slgId\": \"790-5\",\n    \"url\": \"https://chart.myunitypoint.org/clarkecounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/605DD804-6B49-4F49-AA9A-0D17D9AEB04E/ae5e1e7fcada0450410256448441bdc4.png\",\n    \"name\": \"Community Memorial Hospital\",\n    \"slgId\": \"790-6\",\n    \"url\": \"https://chart.myunitypoint.org/communitymemorial/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/650CC3C9-7BA0-4297-ACC1-F24AA6C4CA58/bc9382eb7eac4431b9705d811ef7b9f0.png\",\n    \"name\": \"Compass Memorial Healthcare (Marengo)\",\n    \"slgId\": \"790-7\",\n    \"url\": \"https://chart.myunitypoint.org/compassmemorial/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/42030861-19D0-40C8-865A-90AF480E83D2/82b5df6ca343420c53f5298b9463799f.png\",\n    \"name\": \"Family Medicine LLP\",\n    \"slgId\": \"790-8\",\n    \"url\": \"https://chart.myunitypoint.org/familymedicinellp/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E071ADD8-CF39-4740-8192-C7F7723B1C9F/fbfad517fe33b6476b43fb3202ea75a3.png\",\n    \"name\": \"Foot & Ankle of Iowa\",\n    \"slgId\": \"790-9\",\n    \"url\": \"https://chart.myunitypoint.org/footandankleofiowa/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2F475A3D-205D-45BB-B552-121112BEFCE5/04c59f3a16a1244dc358c30558ac95ae.png\",\n    \"name\": \"Grant Regional Health Center\",\n    \"slgId\": \"790-10\",\n    \"url\": \"https://chart.myunitypoint.org/grantregional/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/982E33EE-ED58-4E04-BCA0-037815DEAEB7/9cd9445865bf1aea7b87c0d2bcef56e5.png\",\n    \"name\": \"Greater Regional Health\",\n    \"slgId\": \"790-11\",\n    \"url\": \"https://chart.myunitypoint.org/greaterregional/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CB8FDB56-4FD4-4E78-9920-1F6373C98AFC/f5e6398caf063e245f7110721faebc4d.png\",\n    \"name\": \"Greene County Medical Center\",\n    \"slgId\": \"790-12\",\n    \"url\": \"https://chart.myunitypoint.org/greenecounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A0E507E-17D9-415D-A1B6-4FCB090B63B3/bd5b64fe32e423a3ec62cc555452c75f.png\",\n    \"name\": \"Grundy County Memorial Hospital\",\n    \"slgId\": \"790-13\",\n    \"url\": \"https://chart.myunitypoint.org/grundycounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/71FC3755-E577-469E-8D66-C1AC7D6173A2/7703da116b79106692fab0cc88bdf712.png\",\n    \"name\": \"Guthrie County Hospital\",\n    \"slgId\": \"790-14\",\n    \"url\": \"https://chart.myunitypoint.org/guthriecounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CCB38BC4-70E2-4341-8C2A-631A5781B251/a384fe45c89b4558081930399405a3cd.png\",\n    \"name\": \"Hammond-Henry Hospital\",\n    \"slgId\": \"790-15\",\n    \"url\": \"https://chart.myunitypoint.org/hammondhenry/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E8C4CE3E-CE2B-4E6D-997B-126967CCD59A/16cc87e5df100bfcb8da69d9d4a60bb0.png\",\n    \"name\": \"Humboldt County Memorial Hospital\",\n    \"slgId\": \"790-16\",\n    \"url\": \"https://chart.myunitypoint.org/humboldtcounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/294341F7-515B-4100-8A20-0B41C0FB489E/325adcdd134639628d676619896fe509.png\",\n    \"name\": \"Lafayette Hospital and Clinics\",\n    \"slgId\": \"790-17\",\n    \"url\": \"https://chart.myunitypoint.org/lafayette/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C164E080-3B72-4ABA-B630-7537EB5C2388/6d6afa308b542912ffce796603f1e1cf.png\",\n    \"name\": \"Loring Hospital\",\n    \"slgId\": \"790-18\",\n    \"url\": \"https://chart.myunitypoint.org/loring/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB56500B-37D4-461A-95AB-4CACC8B2CC40/7450841b69e8d7c750f138e094752c14.png\",\n    \"name\": \"Lucas County Health Center\",\n    \"slgId\": \"790-19\",\n    \"url\": \"https://chart.myunitypoint.org/lucascounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B858608-83CE-4F34-805E-D7A6A35C3DB5/4cc899c18d7c0ac8101efeb854c6cd25.png\",\n    \"name\": \"Madison Womens Health\",\n    \"slgId\": \"790-20\",\n    \"url\": \"https://chart.myunitypoint.org/madisonwomenshealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4E9696A7-AF48-41EB-9360-C28B1FF66119/5a87b2d989b68fb313f4d211849543af.png\",\n    \"name\": \"Mahaska Health Partnership\",\n    \"slgId\": \"790-21\",\n    \"url\": \"https://chart.myunitypoint.org/mahaska/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EEBF7EB8-ED5F-4EC5-BF2E-F2ACD76A5D1C/2a40b03016a8f2a23f7c994019b25639.png\",\n    \"name\": \"Memorial Hospital Association (Carthage)\",\n    \"slgId\": \"790-22\",\n    \"url\": \"https://chart.myunitypoint.org/memorial/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/744D03E4-2E9F-478F-B539-60B974E1566A/d37f247e7cc935f526d6f0d8b2db5aeb.png\",\n    \"name\": \"Pocahontas Community Hospital\",\n    \"slgId\": \"790-23\",\n    \"url\": \"https://chart.myunitypoint.org/pocahontas/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/018C7D00-67EE-4223-8BAB-4C102C2E5515/f87d14efa250384e0eaa466497f16045.png\",\n    \"name\": \"Quincy Medical Group\",\n    \"slgId\": \"790-24\",\n    \"url\": \"https://chart.myunitypoint.org/quincymedicalgroup/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/04ED8885-987B-456D-B97D-45B4FCFC3EF3/f179c80b24b87e95e1733579351963a3.png\",\n    \"name\": \"Reedsburg Area Medical Center\",\n    \"slgId\": \"790-25\",\n    \"url\": \"https://chart.myunitypoint.org/reedsburg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6DDAEA34-8AA2-401D-B275-E16E72C80B02/393190480f93aa85f52b3efbb1567a63.png\",\n    \"name\": \"Stewart Memorial Community Hospital\",\n    \"slgId\": \"790-26\",\n    \"url\": \"https://chart.myunitypoint.org/stewartmemorial/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/29EAC1E0-1D3E-45E2-AD66-B7A44FED0AAE/ed9b231497a965fb9c131c4af4f4c30a.png\",\n    \"name\": \"Story County Hospital\",\n    \"slgId\": \"790-27\",\n    \"url\": \"https://chart.myunitypoint.org/storycounty/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1AA0FFD6-1767-409C-82ED-220518CF712B/ea793ba7cfcc6dde98c852a6cd7fe700.png\",\n    \"name\": \"Guttenberg Municipal Hospital\",\n    \"slgId\": \"790-28\",\n    \"url\": \"https://chart.myunitypoint.org/guttenberg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F39A3784-4C24-4B95-A5AD-87AF47BF17B2/3a5f7143086627d52aeb7fa1ac6bdb22.png\",\n    \"name\": \"Virginia Gay Hospital\",\n    \"slgId\": \"790-29\",\n    \"url\": \"https://chart.myunitypoint.org/virginiagay/\"\n  },\n  {\n    \"aliases\": [\n      \"Michigan Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/73F4A836-5CE7-4C3D-A057-E74FB8F745B5/7823b20b1f8a63271bc565047bb12e86.png\",\n    \"name\": \"University of Michigan Health\",\n    \"slgId\": \"791\",\n    \"url\": \"https://www.myuofmhealth.org/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [\n      \"PHCMA\",\n      \"Prohealth care\",\n      \"Pro health care\",\n      \"Prohealthcare\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2C504F61-EFF4-4580-B7E9-0C585B44B06A/3851c876a8e99b2a5815d1cbfc3493e8.png\",\n    \"name\": \"ProHealth Care\",\n    \"slgId\": \"792\",\n    \"url\": \"https://mychart.prohealthcare.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EF2B0CC2-04CC-40B6-9246-BAA5FA1526EF/b55ce44410fcba3ade804a81ecefa7ce.png\",\n    \"name\": \"Cleveland Clinic Abu Dhabi\",\n    \"slgId\": \"793\",\n    \"url\": \"https://patientportal.clevelandclinicabudhabi.ae/patientportal/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [\n      \"Forrest\",\n      \"Pine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/603BCC5F-3DAC-4EE3-9EF2-AE48B651AAB9/fcc6f2fd9e16bc3a91e9e23cc544a0ae.png\",\n    \"name\": \"Hattiesburg\",\n    \"slgId\": \"795\",\n    \"url\": \"https://iris.hattiesburgclinic.com/iris/\"\n  },\n  {\n    \"aliases\": [\n      \"Ochsner\",\n      \"MyOchsner\",\n      \"MyO\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B6687FEA-5B4C-4071-A6BA-9B82138A562B/bdca389591b106d5faf1857b2d3cd064.png\",\n    \"name\": \"Ochsner Health System\",\n    \"slgId\": \"796\",\n    \"url\": \"https://my.ochsner.org/prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BEB5897E-410A-42F3-84AE-93C03845208A/6c9bea40d0547613e6262666d590f8e1.png\",\n    \"name\": \"St. Tammany\",\n    \"slgId\": \"796-2\",\n    \"url\": \"https://mychart.stph.org/mychartstph/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B3CA949C-E278-42EE-9B95-4FF45E7E175B/f0650e69755e877454f98bfcce137fab.png\",\n    \"name\": \"Terrebonne General Medical Center\",\n    \"slgId\": \"796-3\",\n    \"url\": \"https://www.ohnmychart.org/tgmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/322B65AA-FA9A-4BD7-B043-0826FD0E00EA/aad1f18ac11cdc01d6d6ac993d69d2ba.png\",\n    \"name\": \"Ochsner Health System Digital Medicine\",\n    \"slgId\": \"796-5\",\n    \"url\": \"https://mydigmed.ochsner.org/digitalmedicine/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3552B583-2C95-4EF6-A6D1-DF2DA7014785/72adab0fbb2cddd1ff8fd8211406698f.png\",\n    \"name\": \"Titus Regional Medical Center\",\n    \"slgId\": \"796-6\",\n    \"url\": \"https://ohnmychart.org/titus/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Moses\",\n      \"Wesley Long\",\n      \"Annie Penn\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/717CDFF8-6E3C-42BB-98D0-5A6D888514E9/7ab2cba203cdc402c6b713083c537c10.png\",\n    \"name\": \"Cone Health\",\n    \"slgId\": \"797\",\n    \"url\": \"https://mychart.conehealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"New Hanover\",\n      \"NHRMC\",\n      \"Novant Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACB402FD-D40C-4ABA-A5CC-75CE3CA17123/281e39db68032c2bfd3d4638427ac67e.png\",\n    \"name\": \"Novant\",\n    \"slgId\": \"798\",\n    \"url\": \"https://www.novantmychart.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Independent\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A350394E-775D-4172-85D8-C52958B6F746/96c5edaeac6f14e33bcf32440d20e31e.png\",\n    \"name\": \"Novant Health Partners\",\n    \"slgId\": \"798-2\",\n    \"url\": \"https://www.nhmychartcc.org/MyChartCC/\"\n  },\n  {\n    \"aliases\": [\n      \"Saint\",\n      \"SLHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/65D343C9-1C9B-4DB9-8DE5-5037C0A527F9/7971701b144a26c359eb974f2a9fb113.png\",\n    \"name\": \"St. Luke's\",\n    \"slgId\": \"799\",\n    \"url\": \"https://mychart.slhs.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Lawrence Memorial\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5BCA62F-5179-4370-A032-0739F45D1802/73bb9e522ed97b2ba9f45a270608e065.png\",\n    \"name\": \"Yale New Haven Health/Yale Medical Group\",\n    \"slgId\": \"800\",\n    \"url\": \"https://mychart.ynhhs.org/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E9F4A11-4D7F-4986-8353-3D6273B45C88/5c4087e71dec9a6c4cd8468fc6184ea1.png\",\n    \"name\": \"Providence, Washington, Idaho, Montana\",\n    \"slgId\": \"802\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/61772CB3-4352-4C44-8813-6E7A8BC96A2A/ab5b4230231b187fdcd308c50b0c9195.png\",\n    \"name\": \"Western Montana Clinics\",\n    \"slgId\": \"802-1\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7C172F4-EFA8-472C-85DF-ECE8E3DB20D1/51afcb9f16c088ff3a430f5dee805194.png\",\n    \"name\": \"Olympic Medical Center\",\n    \"slgId\": \"802-2\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6C201B64-89B9-4DEC-AE35-BCF20F967348/ac537daff55a560c9c5fb613c5b7eeb8.png\",\n    \"name\": \"Missoula Surgical Associates\",\n    \"slgId\": \"802-3\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1C9F1662-D230-4FED-8636-957575A9C2C5/5babcec34d2d0f3dc3be0574c914d6e6.png\",\n    \"name\": \"Grande Ronde\",\n    \"slgId\": \"802-4\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5423E9E9-C16A-4384-8B8F-B2849D53EFF9/e25ed8425d4cbfbf1a4c157e36aa716c.png\",\n    \"name\": \"Jefferson Healthcare\",\n    \"slgId\": \"802-5\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/714FBD7C-866D-4DBC-981D-A55693430BEC/72308fb0d9611e5b9baff9fe27c31615.png\",\n    \"name\": \"Jamestown Family Health Clinic\",\n    \"slgId\": \"802-6\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BE3234E3-802D-4B16-AA06-51FED4638677/9c2e140a4855de419bb14d674c1bc4bc.png\",\n    \"name\": \"Proliance Hand, Wrist & Elbow Physicians\",\n    \"slgId\": \"802-7\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/845FE275-8DC7-416A-ABDD-695D83FA9E63/428d0d2c217a74e04ea3b9be47a6885c.png\",\n    \"name\": \"ProOrtho Orthopedics and Sports Medicine\",\n    \"slgId\": \"802-8\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D9B6CE3-0405-4745-890C-009243C5311D/9046ca5f68344b7fa63c62fec89a435f.png\",\n    \"name\": \"Barrett Hospital and Healthcare\",\n    \"slgId\": \"802-9\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0EA9DABE-785F-4C49-AE9E-FCAF71A9F945/883ee1bf47f4b02b8be7dcc4ee7a22b8.png\",\n    \"name\": \"Community Hospital for Anaconda\",\n    \"slgId\": \"802-10\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7A7EEEFE-5326-4AC3-8DEE-C8B41EA0BFDC/5945421295c800ac37cd76ab7285c735.png\",\n    \"name\": \"Clark Fork Valley Hospital\",\n    \"slgId\": \"802-11\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/512605B4-21BC-47B4-A69B-8E899166884E/81bc388e29775647043ba6cd6ada3d60.png\",\n    \"name\": \"Everett Bone and Joint\",\n    \"slgId\": \"802-12\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4286737A-7E10-471B-9162-A962838C906D/d412346d7b7b9e2c6d74e2e566d7dc4d.png\",\n    \"name\": \"Tulalip Health System\",\n    \"slgId\": \"802-13\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D608C06A-CC4F-414A-B559-F3FC047391CE/912e1843aee2b04e1489e2f4ed7433ac.png\",\n    \"name\": \"North Olympic Healthcare Network\",\n    \"slgId\": \"802-14\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/74BF6467-D7F9-452E-B2F9-5817EFCF2CB8/2f59cf1a4e54ed6f2befebc8f5998a02.png\",\n    \"name\": \"Shodair Children's Hospital\",\n    \"slgId\": \"802-15\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8F4228AD-F321-4189-95E5-87BC9B182474/f3cfca9c9e1bf00ca836da68b37282f5.png\",\n    \"name\": \"Pacific Medical Center\",\n    \"slgId\": \"802-16\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9880C6A1-1E95-42F0-9C2E-5D27A0F1F1DC/3b207b5fdcde401296aee4e373ec5041.png\",\n    \"name\": \"Providence Swedish\",\n    \"slgId\": \"802-17\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F2CC3998-A0B7-4EB8-BE65-A23392AC0436/2637c2a2ec811c3c2ac4852d461ad921.png\",\n    \"name\": \"Prosser Memorial Health\",\n    \"slgId\": \"802-18\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DAD1044B-4E6E-4520-B7F3-7F960CA105F4/8472c8d5514003c90f669f914b30197d.png\",\n    \"name\": \"Kadlec Health System\",\n    \"slgId\": \"802-19\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/578CF391-3B7C-4815-97D7-092FA7F1BE7D/02effb35b60091aad856519997d4a412.png\",\n    \"name\": \"Columbia Basin Hospital\",\n    \"slgId\": \"802-20\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [\n      \"ICHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E6FFFC0-51D6-4CE5-B70F-2F7DE4C8437D/750fc7d3ea52857b96d95b0df1a6c22f.png\",\n    \"name\": \"International Health Community Services\",\n    \"slgId\": \"802-21\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/76A2EA74-D1A5-4A44-A432-57C3706A0BC3/5b951d96600e8378bd8a3c174622dc71.png\",\n    \"name\": \"Samaritan Healthcare\",\n    \"slgId\": \"802-22\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7F7EB47-8291-4CDE-95C7-18D69A72DE1A/606251b17181dd1f361afa858ceeef1e.png\",\n    \"name\": \"Newport Hospital & Health Services\",\n    \"slgId\": \"802-23\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F0D3F643-ED51-4675-B3DA-D0D832C83227/3494861a294d8dc780caa61b0d7e18d2.png\",\n    \"name\": \"Cascade Community Health\",\n    \"slgId\": \"802-24\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [\n      \"Seattle Medical Associates\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/734C2EF6-0290-405D-B875-0411A37AC6F5/dc9e83382503f560a600327e8e14d23c.png\",\n    \"name\": \"Seattle Medical Associates\",\n    \"slgId\": \"802-25\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7A6322CA-12E5-43B7-A46F-A106F37360E6/edc859b49eb239f02b3d49c003b35132.png\",\n    \"name\": \"Kinwell\",\n    \"slgId\": \"802-26\",\n    \"url\": \"https://kinwell.myonlinechart.org/kinwellmychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3DCC1AE5-216C-4597-ACED-798785786B99/e94502cdc5ce59f7e7c2ec0ee1e4cceb.png\",\n    \"name\": \"Rocky Mountain ENT\",\n    \"slgId\": \"802-27\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F777730A-65B9-494D-B046-71125A475DB8/a67d88ce9660b22ceb626cc14d80d573.png\",\n    \"name\": \"Credena Health - Washington/Montana\",\n    \"slgId\": \"802-28\",\n    \"url\": \"https://credenahealthwm.myonlinechart.org/Credenahealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/45F91C5D-7E80-4B9C-A2E7-3AE92DBEA7C1/5c6961c45d141555b4dd57ddfb6a3a88.png\",\n    \"name\": \"Credena Health - Alaska\",\n    \"slgId\": \"802-29\",\n    \"url\": \"https://credenahealthak.myonlinechart.org/Credenahealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19FD2450-B508-4F04-96AF-25E23B6172ED/82037d3cc823e482f9587313da7cc4b3.png\",\n    \"name\": \"Lincoln Hospital & Clinics\",\n    \"slgId\": \"802-30\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/73C7AF16-53E0-4414-A306-70AAB17FFF7B/a5c29f3c61a86d323f479d38fde77c60.png\",\n    \"name\": \"Excelsior Family Medicine\",\n    \"slgId\": \"802-31\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8177EAFD-B4BF-4836-B042-1A84898EA686/8ce71f563fbe9525fe57bc1b922b101b.png\",\n    \"name\": \"Stillaguamish Tribe of Indians\",\n    \"slgId\": \"802-32\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/60EA6ED0-FC6F-42CA-884F-DDDB9689E262/ee770a2ba918d278fd788b2adbbe1ab7.png\",\n    \"name\": \"Seattle Premier Health\",\n    \"slgId\": \"802-33\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFA44219-0500-4ECE-BF3F-722760CAD9B1/580a0e8c732df6da49dfbb319ab6c2ba.png\",\n    \"name\": \"Providence Swedish Rehabilitation Hospital\",\n    \"slgId\": \"802-34\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/17EB6121-3A54-42FE-8159-35F463AF7CD6/cbfea791ad24da943243518bdc29fdf2.png\",\n    \"name\": \"Cancer Care NorthWest\",\n    \"slgId\": \"802-35\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFACDBAA-1BF5-4A9C-9934-66575384A8C6/457d3f626eb87bd707d33247fdd427ea.png\",\n    \"name\": \"Pullman Regional Hospital\",\n    \"slgId\": \"802-36\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19370AE7-6C5D-4B52-90C9-5AFC82628E81/ba76d904abbbfbdade77838c17a1fadc.png\",\n    \"name\": \"Summit Pacific Medical Center\",\n    \"slgId\": \"802-37\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1EBF7E83-1266-4863-8301-00A7E29B1BFD/9a97d78d13fe7b3ad768f8f8a228d245.png\",\n    \"name\": \"Wallowa Memorial Hospital and Medical Center\",\n    \"slgId\": \"802-38\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EDC2D7DF-7D11-4BEC-841D-5B24F0EDE0D1/8c97213d6e62ac52371b5dafd83cf040.png\",\n    \"name\": \"Whitman Hospital Medical Clinics\",\n    \"slgId\": \"802-39\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7B5AC2DA-29FB-4711-83AB-7FFD051ACC3D/b0fb9d95f4f8eb34865f458deea24c43.png\",\n    \"name\": \"Yelm Family Medicine\",\n    \"slgId\": \"802-40\",\n    \"url\": \"https://mychartwa.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B50AE7BF-B448-4822-9FEA-8DE22086D48B/efcdd1ce8e55040f90bcd3eae0a9ac51.png\",\n    \"name\": \"Butte Native Wellness\",\n    \"slgId\": \"802-41\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9D58F852-7BC2-45D9-B263-E174AA31C386/b61d0f920d522691bbf17841a3b74a9b.png\",\n    \"name\": \"Infinity Cancer Care\",\n    \"slgId\": \"802-42\",\n    \"url\": \"https://wamt.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"South Haven\",\n      \"SHHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/645DB9E1-CEC8-4BD8-A526-01643E039323/58f57d0c219173029892c6f9c8b84c0f.png\",\n    \"name\": \"Bronson\",\n    \"slgId\": \"804\",\n    \"url\": \"https://mychart.bronsonhealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5E54205F-2E6E-4677-8223-6CC6363B4E0A/156baed66e6f058c6a3f5fc76a45e131.png\",\n    \"name\": \"Kalamazoo College\",\n    \"slgId\": \"804-2\",\n    \"url\": \"https://mychart.bronsonhealth.com/hosted/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D72EE21C-0F53-4D0E-83D2-CD781BCC3196/b56543f8e8e2b44db1242e60a7ae2349.png\",\n    \"name\": \"Family Health Center\",\n    \"slgId\": \"804-3\",\n    \"url\": \"https://mychart.fhckzoo.com/MyChartFHC\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/48D39E1B-E0BE-44B5-A213-AB2489F51A24/7d2e17c909691f201f44a87ef5807db0.png\",\n    \"name\": \"Western Michigan University\",\n    \"slgId\": \"804-4\",\n    \"url\": \"https://mychart.wmed.edu/MyChartWMED/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7C7ED6A3-1DFB-4C8A-BF6E-E4BDF5779F08/7d5cc225f86f278077c8bd799f3c0272.png\",\n    \"name\": \"Kalamazoo Foot Surgery\",\n    \"slgId\": \"804-5\",\n    \"url\": \"https://mychart.bronsonhealth.com/mychartkfs/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/203F9561-E950-4EB9-9410-2507517D8F82/3c76dfcf75a4d881b3e6655655ccbcbc.png\",\n    \"name\": \"Advanced Vascular Surgery\",\n    \"slgId\": \"804-6\",\n    \"url\": \"https://mychart.avsurgery.com/mychartavs/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"WMCC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0BDA47B2-223A-4488-8815-B1708C11257D/2f95f34d47aa2d620171735d272895ae.png\",\n    \"name\": \"West Michigan Cancer Center\",\n    \"slgId\": \"804-7\",\n    \"url\": \"https://mychart.wmcc.org/mychartwmcc/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/20747028-2ECA-487A-9B37-8B5AC95CFC8F/7398b86bcd4146e1efd3bdd73b0ce9db.png\",\n    \"name\": \"Cereal City Pediatrics\",\n    \"slgId\": \"804-8\",\n    \"url\": \"https://mychart.bronsonhealth.com/mychartccp/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/05B25455-CBF0-499C-B6E7-984091778926/debfc67ae12adbcecf23bfbda5e7a1ed.png\",\n    \"name\": \"UCLA Medical Center\",\n    \"slgId\": \"806\",\n    \"url\": \"https://my.uclahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4597D5AA-D3E9-40A2-872A-0DCFF09E713C/65a2e1fb16e32cbe494a2f0bd5fb994b.png\",\n    \"name\": \"UCLA Health Medicare Advantage Plan\",\n    \"slgId\": \"806-1\",\n    \"url\": \"https://my.uclahealthmedicareadvantage.org/HealthPlan/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DB6DD5F9-2568-44E0-A7D7-B59CCC27CBE4/d6eed7a7bda076c846ce114cd17ecee2.png\",\n    \"name\": \"Providence, Greater Portland Area\",\n    \"slgId\": \"808\",\n    \"url\": \"https://mychartor.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8DFE7B9B-B693-4184-962D-AEEFFDEF6B0A/6aaaefb88e3e2c7f30325a3cb05c9d2b.png\",\n    \"name\": \"Nor-Lea Hospital District\",\n    \"slgId\": \"808-1\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CC5542B1-C5B7-43A6-9A84-C012E02D5B57/c1ef59651e1047e14fce983d4afd262f.png\",\n    \"name\": \"Family Medical Group\",\n    \"slgId\": \"808-3\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AA91CDC5-7A2D-47D6-867C-1BCDFD3FCBA1/7e5d240290ab0b6d7a767ec81f1aa141.png\",\n    \"name\": \"Ocean Beach Hospital & Medical Center\",\n    \"slgId\": \"808-4\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/15F62B3C-2832-408F-BA17-72C4C246D9B5/4d3c497b44eab8f9931b0a17c9026416.png\",\n    \"name\": \"Southern Oregon Orthopedics\",\n    \"slgId\": \"808-5\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FFDF82AB-CE8B-4807-8DAD-E7173C3A0F25/6c4c48f6ca6770ab3e6a5fc48fd820c6.png\",\n    \"name\": \"Southern California Multi Specialty Center\",\n    \"slgId\": \"808-7\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CEAA1C3A-C697-4006-AB8B-789D5C103816/cf33ad6504f2cba782e44b243a6e6bf6.png\",\n    \"name\": \"Covenant Health\",\n    \"slgId\": \"808-8\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BD908C3B-D840-4411-AF4B-5CDCDBFDD3E4/524bdd4206b323ae4b04b041bd3b68dc.png\",\n    \"name\": \"Columbia Gorge Family Medicine\",\n    \"slgId\": \"808-9\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [\n      \"St Joseph Hospital Orange\",\n      \"Mission Hospital Mission Viejo Laguna Beach\",\n      \"St Jude Medical Center\",\n      \"St Mary's Medical Center\",\n      \"Heritage Medical Group\",\n      \"Petaluma Valley Hospital\",\n      \"Queen of the Valley Hospital\",\n      \"Redwood Memorial Hospital\",\n      \"Santa Rosa Memorial Hospital\",\n      \"St Joseph Hospital Eureka\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/869BE637-725C-4009-9CDD-BEB2C47959F3/accfa310c4e576c2698b155a1316835c.png\",\n    \"name\": \"Providence, Oregon, California\",\n    \"slgId\": \"808-10\",\n    \"url\": \"https://mychartor.providence.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ED74E469-625F-4885-8BA0-0D294BF94BF0/7ab8929b3a606c9427afc4ad958cbc81.png\",\n    \"name\": \"Orange County Thoracic and Cardiovascular Surgeons\",\n    \"slgId\": \"808-12\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D1D1424-23B3-41D5-B89F-D7E71F0BBE15/eb5e29721ba1b1814c32090d8625666a.png\",\n    \"name\": \"Orange County Neurosurgical Associates\",\n    \"slgId\": \"808-13\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/48E269B9-C2C2-4257-9893-43E718AB7089/66f3e4f48e2e71a290582ae6acd2c430.png\",\n    \"name\": \"Greater Orange County Ear, Nose, Throat, Head & Neck Surgeons\",\n    \"slgId\": \"808-14\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0B268BD7-F418-4F97-9442-8167B14DA875/7d2a0ebac5be81c99d1a54238f458ae6.png\",\n    \"name\": \"Fairchild Medical Center\",\n    \"slgId\": \"808-15\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8340D3E3-D1EC-49EE-AE9E-0C3EDD2FD1AB/b5674c9f6c906df1fe873be9c06fe383.png\",\n    \"name\": \"Sonoma Valley Hospital\",\n    \"slgId\": \"808-18\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B445DE9D-BC94-4AE9-A26B-21CF8445F1F4/ac2278547d47a639fe00bb135c9326a1.png\",\n    \"name\": \"Credena Health, Pharmacy Home Delivery\",\n    \"slgId\": \"808-21\",\n    \"url\": \"https://credenahealthoc.myonlinechart.org/Credenahealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19AEB223-15F0-43D7-BB02-E8D05047AEEF/a4c7088abdd63c858c8402ec2d671fa1.png\",\n    \"name\": \"South Tabor Family Physicians & Services\",\n    \"slgId\": \"808-22\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/56C91476-BA75-4A18-84C7-137F40C300CB/cbea2d41a474ff1bceb4492e3130a602.png\",\n    \"name\": \"Providence Cedars Sinai Tarzana\",\n    \"slgId\": \"808-24\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B78C3C0-A4A3-4BAE-A5D6-3C1B59B0CB98/2ddfd72704898f9c6b58c80418bf5080.png\",\n    \"name\": \"The Oregon Clinic\",\n    \"slgId\": \"808-25\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/928EDFBE-D925-4E18-80AE-ED5E5F4FEFE7/19f7d679adba3a53d09b05ae36845645.png\",\n    \"name\": \"Head and Neck Associates of Orange County\",\n    \"slgId\": \"808-26\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0719F247-3BFE-4520-8E1F-457E5476CF87/6166e5cd84b5737e69b29a5f6e008957.png\",\n    \"name\": \"Curry Health Network\",\n    \"slgId\": \"808-27\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5A6E270-05F9-4907-95C2-854A78536936/f28983bee5aa15e898934bbcaa73a2b5.png\",\n    \"name\": \"Southern Coos Hospital & Health Center\",\n    \"slgId\": \"808-28\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B8456BB-6CA9-4E2D-B543-B51692CEF45D/58cdc26aba12567b3ad7109d219da0c6.png\",\n    \"name\": \"Oregon Heart Center\",\n    \"slgId\": \"808-29\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/532DDBCA-D4FA-49F4-B3E6-91C212640C80/ed24102687d3f941902312a4c1073f5d.png\",\n    \"name\": \"Community Memorial Healthcare\",\n    \"slgId\": \"808-30\",\n    \"url\": \"https://orca.myonlinechart.org/affiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"UCP\",\n      \"UCH\",\n      \"Drake\",\n      \"West Chester\",\n      \"University\",\n      \"UPSH\",\n      \"Pointe\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1C44AA8C-A88E-45C2-A3FE-E0AE35315703/2ed357a7c955d082822b46cc748719f2.png\",\n    \"name\": \"UC Health\",\n    \"slgId\": \"814\",\n    \"url\": \"https://my.uchealth.com/myuchealth/\"\n  },\n  {\n    \"aliases\": [\n      \"LCOH\",\n      \"Lindner\",\n      \"Center\",\n      \"Hope\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/87A5E3CC-31EE-4776-9ADF-412526DC1B95/55dc1a45a5796deb154f382de797ae9d.png\",\n    \"name\": \"Lindner Center of Hope\",\n    \"slgId\": \"814-1\",\n    \"url\": \"https://lcohmychart.uchealth.com/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/131BAC01-1DEC-419C-A418-270A6A966FFF/060cc37ce6621aa0ed67ce27a0386cb9.png\",\n    \"name\": \"Children's Wisconsin\",\n    \"slgId\": \"815\",\n    \"url\": \"https://mychart.chw.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"HIS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6881AD79-20B1-484B-8A28-54A69449AE32/fdaee56afc80837dc7a6ce4349afad2a.png\",\n    \"name\": \"Inova Health System\",\n    \"slgId\": \"816\",\n    \"url\": \"https://mychart.inova.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7066955-4F2F-4E7A-B379-A8760ADD0FDD/5fe625d7f1c92a9f88f0ec3cbf78055a.png\",\n    \"name\": \"Valley Health\",\n    \"slgId\": \"816-1\",\n    \"url\": \"https://mychart.inova.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7DB5FC4B-CE33-4E83-9879-151AA3E63702/cf706e2fa6030f47dbc8bd289f0b2009.png\",\n    \"name\": \"Valley Medical Center\",\n    \"slgId\": \"817\",\n    \"url\": \"https://mychart.valleymed.org/MyChart_PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B4FBEA3-9FE8-4A9C-8A63-264CA99F964E/a528363e490e3d51e769fed82b1f9f25.png\",\n    \"name\": \"Norton Healthcare\",\n    \"slgId\": \"819\",\n    \"url\": \"https://mychart.nortonhealthcare.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"SRHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/765F0F7E-8B74-43D9-B76E-D3C317E821F0/5158213da2f7fdf3d77bebb1d30800b1.png\",\n    \"name\": \"Singing River Health System\",\n    \"slgId\": \"822\",\n    \"url\": \"https://mychart.mysrhs.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Medical\",\n      \"University\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/71A90C87-3BF8-431F-9536-2857DF670282/3e7210acd71e18c742cbf2d34a42c745.png\",\n    \"name\": \"MUSC Health\",\n    \"slgId\": \"824\",\n    \"url\": \"https://mychart.muschealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DE48C199-21A0-4D4D-9D9A-B43ABDC18453/306f18f77668eff696dc5f34f73fd45f.png\",\n    \"name\": \"Tidelands Health\",\n    \"slgId\": \"824-2\",\n    \"url\": \"https://mychart.tidelandshealth.org/tidelands-cc/\"\n  },\n  {\n    \"aliases\": [\n      \"NMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E390E48B-D07A-40AE-9C82-2007E77B098F/ae02767f17999f23206afa9784f775ca.png\",\n    \"name\": \"The Nebraska Medical Center\",\n    \"slgId\": \"825\",\n    \"url\": \"https://www.onechartpatient.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Faith Regional\",\n      \"Beatrice\",\n      \"Mary Lanning\",\n      \"Great Plains\",\n      \"North Platte\",\n      \"Platte Valley\",\n      \"Clarkson Heart Center\",\n      \"Neurology Consults of Nebraska\",\n      \"Plattsmouth\",\n      \"McGill Family Practice\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C65BB700-301F-4443-915D-4328A9EB45CA/382b33d8d7cf2997cace3b4a30e8d185.png\",\n    \"name\": \"OneChart\",\n    \"slgId\": \"825-2\",\n    \"url\": \"https://www.onechartpatient.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Scottsdale\",\n      \"John C. Lincoln\",\n      \"JCL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/451C9930-6B7E-4B90-B45D-B263206CC019/d53970ae6c6881d7d56de1a74cad1d04.png\",\n    \"name\": \"Honor Health\",\n    \"slgId\": \"826\",\n    \"url\": \"https://mychart.honorhealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"WFH\",\n      \"WFMG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/827E7E2C-E47A-45E0-8DDC-B2AFE0F46E82/1f1c93dd0b584a232d17f0bf7931a565.png\",\n    \"name\": \"Ascension Wisconsin\",\n    \"slgId\": \"827\",\n    \"url\": \"https://wimychart.ascension.org/mychartprd/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/45E8D52C-4641-4932-A12C-7DAE84ECE8D3/4051a6bb1970238e818db53f76cc5d51.png\",\n    \"name\": \"Brookwood Baptist Health\",\n    \"slgId\": \"829\",\n    \"url\": \"https://mychart.bhsala.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OLL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7487DFCD-0B80-44C9-8266-8DF08B4AE63A/06c501c3810f7f728ad35d82dede9d5c.png\",\n    \"name\": \"FMOL Health | Our Lady of the Lake\",\n    \"slgId\": \"830\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"BRC\",\n      \"CASSO\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/168FA899-EAD4-4624-816A-3C2D9557590F/9a4db355f42afbfbba69f13e3cadca6c.png\",\n    \"name\": \"The Baton Rouge Clinic\",\n    \"slgId\": \"830-2\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OLL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/28F4F242-3EAC-43C6-85B7-61DA289715FA/72d8fb4cf9d2217f9f21e32d7384a951.png\",\n    \"name\": \"FMOL Health | Our Lady of Lourdes\",\n    \"slgId\": \"830-4\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Francis\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/24D5D933-1947-4D70-8E9E-544E01EC43AE/1802c9fe24a7c30c0146bfbbb6f8066f.png\",\n    \"name\": \"FMOL Health | St. Francis\",\n    \"slgId\": \"830-5\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E5066F7A-1A19-48AF-962B-D56E7B75A92C/7995f4ce21b24c0f460cc7c637165ad4.png\",\n    \"name\": \"FMOL Health | Our Lady of the Angels\",\n    \"slgId\": \"830-6\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6EC69E3-657C-46FB-B3B9-72BE396F455E/0f925594da812a69e2cb95a1349ae5a3.png\",\n    \"name\": \"Complete Cardiovascular Care\",\n    \"slgId\": \"830-7\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/80646B14-3A59-46F1-9973-DC9D44E69F2C/d869caa1ba0a611e22b66904dd597bf1.png\",\n    \"name\": \"FMOL Health | St. Dominic\",\n    \"slgId\": \"830-8\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EA695BB8-D257-4755-B111-CB45B6A7256B/f4280258b7b349708cbb207e67e8124a.png\",\n    \"name\": \"FMOL Health | Our Lady of the Lake Children's\",\n    \"slgId\": \"830-9\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/88A9E1F0-F454-4B4A-9A1A-0D87646A8BCE/e1777f04a3d8ce3b563673b638cd659a.png\",\n    \"name\": \"Urgent Care - Lake/Lourdes/St. Francis\",\n    \"slgId\": \"830-10\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7E3D02BB-5D39-4EA7-B9D4-010D5FD68CF9/b0b47728a2b104647eac3770887d6b55.png\",\n    \"name\": \"Our Lady of the Lake LSU\",\n    \"slgId\": \"830-11\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"ENT\",\n      \"ENT Jackson\",\n      \"ENT Surgical\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AFED4FB4-AEA9-4028-95A9-B8BE3CD4DAA2/a76e1f9ada322753e5391a120dcdc85e.png\",\n    \"name\": \"Ear, Nose, & Throat Surgical\",\n    \"slgId\": \"830-12\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SMRMC\",\n      \"Southwest Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/61192979-1913-47F3-943F-D6A3870F9B8C/15617faa333f982f3a6d99cea2175f54.png\",\n    \"name\": \"Southwest Mississippi Regional Medical Center\",\n    \"slgId\": \"830-13\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F0A185A0-3358-49C6-B25C-51B0B7120ACB/a46fa403ff5e77ff24fb7316707b8c25.png\",\n    \"name\": \"MEA Medical Clinic\",\n    \"slgId\": \"830-15\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Lane\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/77F41977-9EF6-467B-BA43-F1F07C162B64/b985719a257ff9f7ac2b08587a0fab30.png\",\n    \"name\": \"Lane Regional Medical Center\",\n    \"slgId\": \"830-16\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MRMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B57D8C4D-B84B-47D7-8BFE-759AD98D9CDE/950de1b60f7252114d32c5a9804c6315.png\",\n    \"name\": \"Madison Ridgeland Medical Clinic\",\n    \"slgId\": \"830-17\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LCMHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B3EF9AB-A388-437A-8CD9-5EE59B72EB17/81668e3ed5074a772c2b5deea8ca0226.png\",\n    \"name\": \"Lake Charles Memorial Health System\",\n    \"slgId\": \"830-18\",\n    \"url\": \"https://mychart.lcmh.com/memorialmychart/\"\n  },\n  {\n    \"aliases\": [\n      \"BROC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9E018D94-2560-4CC5-9220-CD7B922C5E94/00175307f75171b5fed31bafa1459feb.png\",\n    \"name\": \"Baton Rouge Orthopaedic Clinic\",\n    \"slgId\": \"830-19\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Neighborhood Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F962E051-D010-499A-BF8C-958BEEA02D2D/daf951c89a645e4f8fd280d73e4fc125.png\",\n    \"name\": \"Neighborhood Health Clinic\",\n    \"slgId\": \"830-20\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LOS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4626EEF3-25B6-46E6-940D-48C78689F9B5/389570b67dc521ee3e29c0422bfb3cd1.png\",\n    \"name\": \"Louisiana Orthopaedic Specialists\",\n    \"slgId\": \"830-21\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TWC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7B619047-C78D-462B-883D-EC3E9014DDD1/3a21c4a1814921d7f9d3a02160876657.png\",\n    \"name\": \"The Woman's Clinic\",\n    \"slgId\": \"830-22\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BAC050DD-ECDF-43EF-9897-9BEE501A2E90/172397e53c35c18e59079a8c36cd4557.png\",\n    \"name\": \"Jackson Pulmonary Associates\",\n    \"slgId\": \"830-24\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5AB52ECB-297B-4580-BEBF-F2C88433D16C/26a00341ae270a7e06d4c8b68b0b53f6.png\",\n    \"name\": \"West Ascension Parish Hospital\",\n    \"slgId\": \"830-25\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1020DB21-5FB1-4F0E-8E39-9A6CE19ACB42/5767d91cb1f3c2fb26e4cbd70299b0f6.png\",\n    \"name\": \"North Sunflower Medical Center\",\n    \"slgId\": \"830-27\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/514548BC-6B46-4752-867B-DC24B4DD7C7E/7b6be8a5e972d137fc1d452806253ec2.png\",\n    \"name\": \"Mississippi Arthritis Clinic\",\n    \"slgId\": \"830-28\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7CD8425-6926-4268-BC25-C4777F8D999A/d90166a01bc30e5d00c1b289012614d7.png\",\n    \"name\": \"Point Coupee General Hospital\",\n    \"slgId\": \"830-29\",\n    \"url\": \"https://mychart.fmolhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B712DAFA-91AF-49AA-97E8-9183F91B12BA/116b2af0e855dcb96ff04b670d9f6317.png\",\n    \"name\": \"Christus Health\",\n    \"slgId\": \"832\",\n    \"url\": \"https://mychart.christushealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9C069438-ED42-49DE-A3D1-A6B2444D5287/109843ebfebd8274dcba895b901c2097.png\",\n    \"name\": \"Santa Fe Imaging\",\n    \"slgId\": \"832-2\",\n    \"url\": \"https://mychart.christushealth.org/santafeimaging/\"\n  },\n  {\n    \"aliases\": [\n      \"CHN\",\n      \"eCommunity\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D8F61A2-72EE-4393-B30F-094B9FA7ADE8/598e3464a778862e899b8b94c3fc0c3f.png\",\n    \"name\": \"Community Health Network\",\n    \"slgId\": \"834\",\n    \"url\": \"https://mychart.ecommunity.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"DUHS\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/23C0FDA8-3E56-4EB5-A0AB-A5E3135186F2/884de02423e5c24e1fcb02a1dc2ffbf6.png\",\n    \"name\": \"Duke University Health System\",\n    \"slgId\": \"835\",\n    \"url\": \"https://www.dukemychart.org/home/\"\n  },\n  {\n    \"aliases\": [\n      \"LLUMC\",\n      \"Murrieta\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8BA17FEA-13B6-4677-9A68-68B7EAC7FA10/8a922e69af67ca6566f54953784b9b6a.png\",\n    \"name\": \"Loma Linda\",\n    \"slgId\": \"836\",\n    \"url\": \"https://mylluhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"SACHS\",\n      \"Social Action Corps\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3839A5BE-24E6-4078-AFFA-7A10A989C9E1/7b4ee6c913938eb9065fe8ca3dac5b88.png\",\n    \"name\": \"SAC Health System\",\n    \"slgId\": \"836-1\",\n    \"url\": \"https://mychart.ieccn.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"RUHS\",\n      \"RCRMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E3523E5-35E8-4AFE-9C36-3D641B051102/54fcc62d9b338574c83d23840a1561f2.png\",\n    \"name\": \"Riverside University Health System\",\n    \"slgId\": \"836-2\",\n    \"url\": \"https://myruhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D8C128C8-0AD1-4AFE-80F4-4C79E393A86E/98c65432ae6f899762133b42bfef045f.png\",\n    \"name\": \"Maren Medical Group\",\n    \"slgId\": \"836-3\",\n    \"url\": \"https://mymaren.ieccn.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"PRMC\",\n      \"PPG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EB61B1BA-A5C6-4C48-A348-54D50436E32A/14091d75cea99d26e34de84875a8462b.png\",\n    \"name\": \"Parkview Health\",\n    \"slgId\": \"838\",\n    \"url\": \"https://mychart.parkview.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CMCH\",\n      \"CHF\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F4789A15-BF2B-4BB1-A1C9-C12EB7368F1A/d75cde5b0093a8e401954f6301f2806b.png\",\n    \"name\": \"Cameron Health\",\n    \"slgId\": \"838-1\",\n    \"url\": \"https://cameronmch.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E702DF93-5E06-4EBD-9EA4-4F373586CD9F/d1b70e268d67c6c358fcf6c148812d70.png\",\n    \"name\": \"Hillsdale Hospital\",\n    \"slgId\": \"838-2\",\n    \"url\": \"https://hillsdale.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/510B0FB2-ED8D-4CF7-8B6E-0B3EA7164E25/30b5299aa0769cec447d40359b98a4a7.png\",\n    \"name\": \"Adams Memorial Hospital\",\n    \"slgId\": \"838-4\",\n    \"url\": \"https://adams.mychartcc.com/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://chwc.mychartcc.com/Authentication/Login\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/343C85BE-0F2B-485A-A3E6-BCE4F40950D6/ae520d1326cf550867fd1e5b304f1a66.png\",\n    \"name\": \"Parkview Bryan and Montpelier Hospitals\",\n    \"slgId\": \"838-5\",\n    \"url\": \"https://mychart.parkview.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/324535A1-F2A0-4457-ADDF-FC5B5FD03E4B/1ab176ed4042fe6f84deafc0ac2139a1.png\",\n    \"name\": \"Paulding County Hospital\",\n    \"slgId\": \"838-6\",\n    \"url\": \"https://pauldingcountyhospital.mychartcc.com/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/60B5C3C7-3E9D-4745-92C9-028368EB292C/af7f0c99a68164427411fa515e24e893.png\",\n    \"name\": \"Alliance Health Centers\",\n    \"slgId\": \"838-7\",\n    \"url\": \"https://alliance.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [\n      \"Woodlawn\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E0FC6D79-D546-4741-AE2D-62629824687B/62ac0771314466981299a1ec800791d8.png\",\n    \"name\": \"Woodlawn Health\",\n    \"slgId\": \"838-8\",\n    \"url\": \"https://woodlawnhealth.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [\n      \"Aging\",\n      \"&\",\n      \"In\",\n      \"Home\",\n      \"Services\",\n      \"and\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E121FD30-2354-4956-940C-FA93F7A792C1/97851e43fc2197ca1225377753341278.png\",\n    \"name\": \"AIHS Guide\",\n    \"slgId\": \"838-9\",\n    \"url\": \"https://aihsguide.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3054B3B8-694E-4A8F-ABA2-51E663316603/b4764cd38ddfd7c899367539cc7074f9.png\",\n    \"name\": \"Iridescent Health\",\n    \"slgId\": \"838-10\",\n    \"url\": \"https://iridescenthealth.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/57A3F558-510D-4140-853A-9607C685D5A5/29dd70c4a026fc69ca388228780ffcf3.png\",\n    \"name\": \"Linke Urology and Robotics\",\n    \"slgId\": \"838-11\",\n    \"url\": \"https://linkeurology.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6DADB2C-E9C7-4F7F-94AC-D37F8731B4F6/18ee77437416bd86960ba3361bc3d509.png\",\n    \"name\": \"Monarch Medicine\",\n    \"slgId\": \"838-12\",\n    \"url\": \"https://monarchmedicine.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/236DF432-C3F3-4CDA-B4FC-D46A644C0CFF/90dd6f4eead15284cf816ef1f25ceac8.png\",\n    \"name\": \"Riverview Health\",\n    \"slgId\": \"838-13\",\n    \"url\": \"https://riverview.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C34E48E0-A791-4757-A056-C5A2C78FDF77/47856cf85d1562329b8d205f4643bb1e.png\",\n    \"name\": \"Healthier Moms and Babies\",\n    \"slgId\": \"838-14\",\n    \"url\": \"https://healthiermomsandbabiesin.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/497CC94C-C02A-4242-AA1C-95D510D56015/9c58026edf03bb7c7c0264ebf4af48dd.png\",\n    \"name\": \"Elyussif Orthopedic & Knee Pain Center\",\n    \"slgId\": \"838-16\",\n    \"url\": \"https://thekneepaincenter.mychartcc.com/\"\n  },\n  {\n    \"aliases\": [\n      \"Piedmont\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2AC1AD6E-FB64-4FC2-90C0-C16117EF4879/bd3b3cb1881e0ef78a2e934bcca1c152.png\",\n    \"name\": \"Piedmont Healthcare\",\n    \"slgId\": \"839\",\n    \"url\": \"https://mychart.piedmont.org/prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DD4F0CF3-D112-4099-88F4-8CE7EB3C6471/4ad49c3b1db4ef3a9fc996b1658ef741.png\",\n    \"name\": \"Shepherd Center\",\n    \"slgId\": \"839-1\",\n    \"url\": \"https://mychart.shepherd.org/ShepherdPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/62CA190A-CD7B-4D6C-96D7-C5CA68C087DC/f21f74b71d915f59e4abdbf7473df6f2.png\",\n    \"name\": \"North Oaks Health System\",\n    \"slgId\": \"840\",\n    \"url\": \"https://mychart.northoaks.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/13D24BF9-140F-49AA-B7C6-05C4411A1EFF/a5120b283edc5985c80fd09dd35776a5.png\",\n    \"name\": \"Connecticut Children's\",\n    \"slgId\": \"841\",\n    \"url\": \"https://mychart.connecticutchildrens.org/MYC-PRD/\"\n  },\n  {\n    \"aliases\": [\n      \"JHHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5D0BEDF-5F17-49DF-B66F-1D43AFB57252/f8e476ec25e63cca7ba5cbce4ca128f2.png\",\n    \"name\": \"Johns Hopkins Medicine\",\n    \"slgId\": \"842\",\n    \"url\": \"https://mychart.hopkinsmedicine.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"AHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/84B96C64-703B-45F5-B769-64D7077A2E20/f2954a7af360f34f49ad773a7d2626f0.png\",\n    \"name\": \"Asante Health System\",\n    \"slgId\": \"843\",\n    \"url\": \"https://mychart.asante.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C26956B7-AF7F-419F-89D5-78923EBC6B82/3dc0a5abafa6f1973a58e9b0bcedd3d8.png\",\n    \"name\": \"Sky Lakes\",\n    \"slgId\": \"843-2\",\n    \"url\": \"https://mychart.skylakes.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Reading\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/90E9776E-43B4-436E-8E03-0FB327016C59/609d8f50ac1f1887cd7ecb5c31d6d450.png\",\n    \"name\": \"Tower Health\",\n    \"slgId\": \"844\",\n    \"url\": \"https://www.mytowerhealth.org/mytowerhealth/\"\n  },\n  {\n    \"aliases\": [\n      \"CHI Memorial\",\n      \"CHI Saint Joseph Health\",\n      \"St. Luke's Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6698C9C0-1B95-47C1-8DD6-DE8D328D6DF9/a286af8b729b95cca13de8d46c5f9985.png\",\n    \"name\": \"CommonSpirit - AR/GA/KY/TN/TX\",\n    \"slgId\": \"845\",\n    \"url\": \"https://patientportalsouth.commonspirit.org/PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C721898C-9665-4060-B39F-FFA501B4EF49/070e7bc0043a792b063e713b3a3becf9.png\",\n    \"name\": \"CHI Memorial\",\n    \"slgId\": \"845-1\",\n    \"url\": \"https://mychart.memorial.org/TN/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F67F60E8-6106-4C86-BCA2-6CA87008DB3E/0620aa27bf215c5b4f2298fac6d18b9a.png\",\n    \"name\": \"CHI St. Joseph's Health\",\n    \"slgId\": \"845-2\",\n    \"url\": \"https://mychart.chisaintjosephhealth.org/KY/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EC1F62FD-C317-4356-9D3E-E7C9D59A9A3E/06e6a340fd58f0da914e6247bb799438.png\",\n    \"name\": \"Memorial Health\",\n    \"slgId\": \"846\",\n    \"url\": \"https://mychart.memorialhealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Henry\",\n      \"HFHS\",\n      \"HF\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CEB997CA-8757-4A9D-B3EF-AC551B8CC521/9a482cc0a907e048581eb7c2078daffc.png\",\n    \"name\": \"Henry Ford Health\",\n    \"slgId\": \"848\",\n    \"url\": \"https://mychart.hfhs.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"SHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4A1865CA-46D7-49BB-BD5A-9A07A6286E31/49e1078ce797d012d5d615e415186b79.png\",\n    \"name\": \"Samaritan Health Services\",\n    \"slgId\": \"849\",\n    \"url\": \"https://mychart.samhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/06F5BE68-3546-4EF2-ACE6-D3B1A2F30FFD/4f737ef9cfc0c3426b553c74b5b2bf84.png\",\n    \"name\": \"Overlake\",\n    \"slgId\": \"851\",\n    \"url\": \"https://mychart.overlakehospital.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E8320063-570E-4B21-870C-48AAD9435851/8ff28c03be2b0e6f13d816c488340ee2.png\",\n    \"name\": \"Snoqualmie Valley Health\",\n    \"slgId\": \"851-1\",\n    \"url\": \"https://mychart.connectomc.org/SVH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EE83FA7F-4A04-4E81-8783-50B72685782F/21a7760bec9eef7952add26b645e1d7d.png\",\n    \"name\": \"Proliance Orthopedics & Sports Medicine\",\n    \"slgId\": \"851-2\",\n    \"url\": \"https://mychart.connectomc.org/posm/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FBE69B45-3DDF-4179-8C53-B9C3F1D35F39/5875fd3680b38e03075588b739b60352.png\",\n    \"name\": \"Lexington County Health Services\",\n    \"slgId\": \"852\",\n    \"url\": \"https://mychart.lexmed.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FCD20A6A-4978-4963-8711-B68684F179B5/e1d69a1690361f0e7cbaa79c11a7f86f.png\",\n    \"name\": \"PeaceHealth\",\n    \"slgId\": \"853\",\n    \"url\": \"https://my.peacehealth.org/MyPeaceHealth/\"\n  },\n  {\n    \"aliases\": [\n      \"CRMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A60E703B-B56B-48EA-AA51-A8C80AB4181B/43145ba2012c274ef76a5b15411ed6aa.png\",\n    \"name\": \"Cheyenne Regional Medical Center\",\n    \"slgId\": \"854\",\n    \"url\": \"https://mychart.crmcwy.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6535AF2A-C023-4FFF-A83D-1D1744072B00/1b0f7595746ce9b83c3675fb6c0719d9.png\",\n    \"name\": \"Thunder Basin\",\n    \"slgId\": \"854-1\",\n    \"url\": \"https://mychart.crmcwy.org/tbo/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"MWSS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2C89C12F-E3F4-4535-B772-9A90FB7893C1/194c3fa2c2f672e3e96c8b4f7dd43511.png\",\n    \"name\": \"Mountain West Surgical Specialists\",\n    \"slgId\": \"854-2\",\n    \"url\": \"https://mychart.crmcwy.org/mwss/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/44FFDC06-A2B7-40FF-A953-F3504F4155E9/5dc280e0d8acb3c61f001e754d9c69cd.png\",\n    \"name\": \"Santa Clara\",\n    \"slgId\": \"855\",\n    \"url\": \"https://myhealthonline.sccgov.org/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://my.bswhealth.com/login\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7326D257-ECB8-42BA-B0B3-7A20B6DEFECA/a3be589781fa99427c15a8429dd6e01c.png\",\n    \"name\": \"Baylor Scott & White Health\",\n    \"slgId\": \"856\",\n    \"url\": \"https://mychart.bswhealth.com/fa/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5EAE5BED-5204-4BAB-9516-33CEB7B406FA/23d556db335df3fd939323b76b33db27.png\",\n    \"name\": \"Stanford Children's Health\",\n    \"slgId\": \"857\",\n    \"url\": \"https://mychart.stanfordchildrens.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Mountainstar\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9B635151-ED5B-4D63-8C16-1D00525659B2/7a18cc16db2df899da02ea382f636a5f.png\",\n    \"name\": \"HCA\",\n    \"slgId\": \"858\",\n    \"url\": \"https://mychart.hca-west.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EDC8F1E7-6EDD-44D2-99A1-CD35BBF392EB/6f478b7ef8db619c64e463e92cb7914d.png\",\n    \"name\": \"Alaska Regional Hospital\",\n    \"slgId\": \"858-2\",\n    \"url\": \"https://mychart.mountainstarhealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DA19A269-D8BD-4FC8-8ED2-01D82CFA7CA5/c5ca149d8a01aeb93c292c9c78dfaac1.png\",\n    \"name\": \"WellStar\",\n    \"slgId\": \"863\",\n    \"url\": \"https://mychart.wellstar.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6151ABF4-E436-4268-989A-760A619143AD/6b7070c8708426af3a3ad1c50f0c6904.png\",\n    \"name\": \"LaGrange Internal Medicine\",\n    \"slgId\": \"863-1\",\n    \"url\": \"https://mychart.wellstar.org/WellConnected/\"\n  },\n  {\n    \"aliases\": [\n      \"MMC\",\n      \"MPS\",\n      \"IAI\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5851F94D-CFD1-49C3-AFBE-F5E1BF118FE4/40a0ac732c4de263ee2194dc1b1a124e.png\",\n    \"name\": \"Mercy Medical Center\",\n    \"slgId\": \"864\",\n    \"url\": \"https://mychart.mercycare.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F89AEA0F-9276-461E-9147-274ABE403092/1f938267d075a44feb174adee4bbadf2.png\",\n    \"name\": \"Steindler Orthopedic Clinic\",\n    \"slgId\": \"864-1\",\n    \"url\": \"https://mychart.steindler.com/Steindler/\"\n  },\n  {\n    \"aliases\": [\n      \"UAMS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/62CF4EF0-2872-4C2E-9938-DE66D7A4FD04/7fbd8f7557c6ec3a0a8ca6be901aa2d5.png\",\n    \"name\": \"University of Arkansas for Medical Sciences\",\n    \"slgId\": \"865\",\n    \"url\": \"https://mychart.uamshealth.com/\"\n  },\n  {\n    \"aliases\": [\n      \"FHS\",\n      \"Catholic Health Initiatives\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB49B66B-952D-47D9-AEE2-1D70FD72AC64/f1162ef5704d1e25da3ba8ef512c7433.png\",\n    \"name\": \"CHI Franciscan Health\",\n    \"slgId\": \"866\",\n    \"url\": \"https://mychart.catholichealth.net/PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AB9F4D9-8A55-4064-8E13-608414C4DBE9/ed7cdb4fde49b544e0c22e479282d5bc.png\",\n    \"name\": \"Puget Sound Orthopaedics\",\n    \"slgId\": \"866-2\",\n    \"url\": \"https://mychart.pugetsoundorthopaedics.com/CCPSO/\"\n  },\n  {\n    \"aliases\": [\n      \"JMH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E946AAF2-6B96-4AFB-8E22-D7808A6F1A16/28bd1b566592496db28cf8c8d4a5fc52.png\",\n    \"name\": \"John Muir Health\",\n    \"slgId\": \"869\",\n    \"url\": \"https://mychart.johnmuirhealth.com/mychartmcmprd/\"\n  },\n  {\n    \"aliases\": [\n      \"ACH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ACDC2B5D-7F8E-456D-8ABF-89F1C0FCA3B3/71cbef931feb53b570cf63c342ba8701.png\",\n    \"name\": \"CHI Health\",\n    \"slgId\": \"870\",\n    \"url\": \"https://mychart.chihealth.com/prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EDB4A9A3-F909-4737-A959-1F086A4F95B6/ad761fab00b00ffbfb1a044f7da64728.png\",\n    \"name\": \"CHI St. Alexius Health\",\n    \"slgId\": \"870-2\",\n    \"url\": \"https://mychartsta.chihealth.com/staprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B7811BF0-DD2D-476B-894D-010D9E79DF0A/5fb87a648dc2521c85a47b37e39ff7f4.png\",\n    \"name\": \"Children's Hospital Oakland\",\n    \"slgId\": \"871\",\n    \"url\": \"https://mychart.cho.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/mijnRadboud.png\",\n    \"name\": \"Radboudumc\",\n    \"slgId\": \"872\",\n    \"url\": \"https://mijnradboud.radboudumc.nl/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/74774E90-2F9C-4050-9241-50A4657B7F5C/5e691cd553acc1c9e4f3886dc56356d9.png\",\n    \"name\": \"Mass General Brigham\",\n    \"slgId\": \"873\",\n    \"url\": \"https://patientgateway.massgeneralbrigham.org/mychart-prd/\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FAE2802B-6C96-40ED-8F18-453A7390A17C/5e4917652a5c0a01dd37a1d5f0a85cba.png\",\n    \"name\": \"Cambridge University Hospitals\",\n    \"slgId\": \"874\",\n    \"url\": \"https://mychart.addenbrookes.nhs.uk/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4A168067-CA73-4461-AF7A-A9FC06FE8CC3/b17f858671d85976daeb46aacbf8e0f2.png\",\n    \"name\": \"Baptist Memorial Health Care\",\n    \"slgId\": \"875\",\n    \"url\": \"https://mychart.baptistonecare.org/prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E8C6DA21-2284-4310-92E2-FFE9972D1734/83d757150eac6ae1844572f171d2abf9.png\",\n    \"name\": \"Hometown Health Clinic\",\n    \"slgId\": \"875-1\",\n    \"url\": \"https://mychart.baptistonecare.org/HometownPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://epicconnect.org/ccprd/CommunityConnect/mychartcc.html\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6EEC02FD-5902-4F32-9092-1EC2858B6116/a6b47bd92ca3c6e24ced3c6937b96650.png\",\n    \"name\": \"Mitchell Family Medicine and The Ark Children's Clinic\",\n    \"slgId\": \"875-2\",\n    \"url\": \"https://epicconnect.org/ccprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6C2578B5-0B9E-44E8-B0E5-3131BB541D85/7401e51b04d540eb1f3c190acce15c28.png\",\n    \"name\": \"Yazoo City Medical Clinic\",\n    \"slgId\": \"875-3\",\n    \"url\": \"https://mychart.baptistonecare.org/YCMCPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D32D5570-700B-4937-BF40-8D70DD4FFA97/07b2b1fdf9d14d45771d92a3129767db.png\",\n    \"name\": \"Mississippi Pediatric Endocrine Care, PLLC\",\n    \"slgId\": \"875-5\",\n    \"url\": \"https://mychart.baptistonecare.org/MSPedEndPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3B54CC08-1CA3-48E0-8AF0-EE56342B9BB8/05418a6120126b1bb273e66581cb817c.png\",\n    \"name\": \"Khumalo Foot and Ankle Clinic\",\n    \"slgId\": \"875-6\",\n    \"url\": \"https://mychart.baptistonecare.org/Khumaloprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/97640920-3E47-4AF0-8D4D-53D169934037/7780fc11ec08ca7796e5aef1e2a8db56.png\",\n    \"name\": \"Harmony\",\n    \"slgId\": \"875-7\",\n    \"url\": \"https://mychart.baptistonecare.org/HarmonyPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A6415FA1-DF10-4CF7-9FA5-7B0B222AEE08/e50c5a6025ead75752a96e7c2c70f5ff.png\",\n    \"name\": \"University Clinical Health\",\n    \"slgId\": \"875-8\",\n    \"url\": \"https://mychart.baptistonecare.org/UCHprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B5373D21-81DF-4161-BEFD-A503C6C5B60F/d718af3fc576815cdb5d647cfadeb4d7.png\",\n    \"name\": \"Surgical Clinic Associates\",\n    \"slgId\": \"875-9\",\n    \"url\": \"https://mychart.baptistonecare.org/SCAprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2424106F-D50E-428E-8A47-C2F005D58A38/2137dfcd33da5fc7710c99a82dda8d1a.png\",\n    \"name\": \"Oxford Neurology\",\n    \"slgId\": \"875-10\",\n    \"url\": \"https://mychart.baptistonecare.org/OxfordNeurologyPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/06E88294-ED88-41D1-9A32-E36C12B1D6AE/541e572e1603346c266a15dca3a3ba1b.png\",\n    \"name\": \"MCAM\",\n    \"slgId\": \"875-11\",\n    \"url\": \"https://mychart.baptistonecare.org/MCAMprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09CF7C56-09FB-4F7E-A7F8-6FBEE862BBD2/a5d4c152f1f09f2622a582156a18a689.png\",\n    \"name\": \"Central Surgical Associates\",\n    \"slgId\": \"875-12\",\n    \"url\": \"https://mychart.baptistonecare.org/CSAPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/65AE6B5B-C955-4135-89F0-FBF42738D638/b10f59e1820dd9d5aed396d4545444fe.png\",\n    \"name\": \"Mercy Health Services\",\n    \"slgId\": \"876\",\n    \"url\": \"https://mychart.mdmercy.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CE9A1099-7088-40E4-89AF-7CBF93AB430B/d48db7c71683b89d45fd13d1d66df3cd.png\",\n    \"name\": \"Saint Luke's Health System\",\n    \"slgId\": \"877\",\n    \"url\": \"https://mysaintlukes.corp.saint-lukes.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"covenant\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/10E4EA37-8728-4D78-B59E-924BCA870EF5/d20905dba73c6936b6b77a99142012cc.png\",\n    \"name\": \"MercyOne\",\n    \"slgId\": \"878-2\",\n    \"url\": \"https://mychart.trinity-health.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B9D54CE4-0EA7-41CF-A3D8-FEC61D3F0BFA/bb9a017751b51aab748921c12a197ff7.png\",\n    \"name\": \"Ballad Health\",\n    \"slgId\": \"879\",\n    \"url\": \"https://mychart.balladhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"East Tennessee State University Health\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FF631305-2062-4344-AFE5-22680E0546F6/e57e99ac5106106c3c731fcdf223cf3a.png\",\n    \"name\": \"ETSU Health\",\n    \"slgId\": \"879-1\",\n    \"url\": \"https://mychart.etsuhealth.org/community_connect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/61D74F94-186E-4D5F-947E-95FF89E27837/8d6c1610075f8c7eeabd99d4b4b2afff.png\",\n    \"name\": \"Boston Medical Center\",\n    \"slgId\": \"880\",\n    \"url\": \"https://mychart.bmc.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A977980-2A0E-4399-B7AC-E95044D27380/6e62fe46b4aa82e0e0fa47f2195ae27a.png\",\n    \"name\": \"Codman Square Health Center\",\n    \"slgId\": \"880-1\",\n    \"url\": \"https://mychart.bmc.org/codman/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F9CA7AB0-AD5E-46C5-A3A5-14D641F22228/d6c744f76a30fb19eb7cb908c5565f60.png\",\n    \"name\": \"DotHouse Health\",\n    \"slgId\": \"880-2\",\n    \"url\": \"https://mychart.bmc.org/dothouse/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5844A7C9-600F-40D3-86A4-30FEC5C26BB7/29c4f17888d5fcd37dca1f47ba76103d.png\",\n    \"name\": \"Endeavor Health\",\n    \"slgId\": \"881\",\n    \"url\": \"https://mychart.nch.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AE54B7C8-F0F2-4A17-97E9-5EB470F29246/3227ded2ab09c813e650dbde5b1a052e.png\",\n    \"name\": \"UNC Health Care\",\n    \"slgId\": \"882\",\n    \"url\": \"https://myuncchart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/614F0865-DBF4-4DA7-8EF3-FEDA4569E66C/19a6c24d376b8bc82f29170ee8e4f330.png\",\n    \"name\": \"Alignment Corporation\",\n    \"slgId\": \"882-1\",\n    \"url\": \"https://www.myuncchart.org/Alignment/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B334ECF1-DA70-4BBE-8310-74F49BE41A8F/5fd6a1ef9bde0fb288a8deae4a676659.png\",\n    \"name\": \"Robeson Health Care\",\n    \"slgId\": \"882-2\",\n    \"url\": \"https://www.myuncchart.org/RHCC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/193EED33-572F-4752-842C-F34679C312BB/24240b9719fbf0608721527dca77fb67.png\",\n    \"name\": \"Adams School of Dentistry for UNC\",\n    \"slgId\": \"882-3\",\n    \"url\": \"https://www.myuncchart.org/UNCADAMSDENTISTRY/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5CE8F8A6-6C84-4EE7-8742-B4B582416C89/9b50b9e18bdb1710c4e311946639d4e6.png\",\n    \"name\": \"OIC of Rocky Mount\",\n    \"slgId\": \"882-4\",\n    \"url\": \"https://www.myuncchart.org/oicmedical/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F62C1F3-1899-4037-B80F-5C3C5613A8EA/425d1e7305f13b6e2ef0ad95f3b60639.png\",\n    \"name\": \"DCO Public Health\",\n    \"slgId\": \"882-5\",\n    \"url\": \"https://www.myuncchart.org/dcopublichealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C81C4691-E961-4185-8073-685FE184B592/7940d15afaf1b9383f5ffa9324e08b96.png\",\n    \"name\": \"MedNorth\",\n    \"slgId\": \"882-7\",\n    \"url\": \"https://www.myuncchart.org/Mednorth/\"\n  },\n  {\n    \"aliases\": [\n      \"Kingsbrook\",\n      \"Interfaith\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9C7E68F5-097F-41D6-A537-0704459F0316/a1493e3af5bfad40c8ec476a67d454e1.png\",\n    \"name\": \"One Brooklyn Health System\",\n    \"slgId\": \"883\",\n    \"url\": \"https://www.myonebrooklynhealth.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Brooklyn\",\n      \"Bronx\",\n      \"Manhattan\",\n      \"Queens\",\n      \"Elmhurst\",\n      \"Coney\",\n      \"Woodhull\",\n      \"Bellevue\",\n      \"Jacobi\",\n      \"Lincoln\",\n      \"Harlem\",\n      \"Metropolitan\",\n      \"Gotham\",\n      \"Kings\",\n      \"Seaview\",\n      \"Morrisania\",\n      \"Belvis\",\n      \"Cumberland\",\n      \"East\",\n      \"Gouverneur\",\n      \"Sydenham\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A5BB2C5-BFB9-4A27-9E95-DF0DE118172D/dc7fa496b1cd059ceb5c0f6a012aa785.png\",\n    \"name\": \"NYC Health and Hospitals\",\n    \"slgId\": \"884\",\n    \"url\": \"https://epicmychart.nychhc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E08F31BA-3D62-40A8-B27D-BB3EA3436E97/428b0e8126fc27cd74871ecacbe3f4aa.png\",\n    \"name\": \"OhioHealth\",\n    \"slgId\": \"886\",\n    \"url\": \"https://mychart.ohiohealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ED842E96-3B8D-46B7-963B-1BA952EA0D45/c64aa70c56e871729930569d5d6121e0.png\",\n    \"name\": \"Saint Francis Health System\",\n    \"slgId\": \"888\",\n    \"url\": \"https://mychart.saintfrancis.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/11524199-737B-4E97-8578-F066DC0F1D13/992c559586faa7949ddea7917ef65c1a.png\",\n    \"name\": \"Oklahoma State University\",\n    \"slgId\": \"888-1\",\n    \"url\": \"https://osumedicinemychart.com/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"TBJ\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5D40FA6E-B3EE-47D4-B66C-2234DFE4B4E2/51e1bf2dde95c1164dee8c58c2b51c5c.png\",\n    \"name\": \"Tulsa Bone and Joint Associates\",\n    \"slgId\": \"888-3\",\n    \"url\": \"https://mychart.sfcommunityconnect.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"BILH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5FA8CC57-8E3F-4B3B-896F-1E83AA84FA0D/089af2cebe6770cfaeddddcbb94d8ef5.png\",\n    \"name\": \"Beth Israel Lahey Health\",\n    \"slgId\": \"890\",\n    \"url\": \"https://mychart.bilh.org/MyChart-BILH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9A280F32-02D4-4EE7-B500-ECBC94467244/a8270461925a6dd5d76461ecca9da048.png\",\n    \"name\": \"WakeMed Health and Hospitals\",\n    \"slgId\": \"892\",\n    \"url\": \"https://mychart.wakemed.org/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [\n      \"CNE\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5EB94F36-F4D3-4FA1-9195-F904CED9F1F7/a623b216252db68078aca64934bc5096.png\",\n    \"name\": \"Care New England\",\n    \"slgId\": \"893\",\n    \"url\": \"https://mychart.carene.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C3E6ABA4-8EFD-4D81-8A0C-53D2C6336D84/fbf985daeac42eb1333975aa5f6b945d.png\",\n    \"name\": \"CaroMont Health\",\n    \"slgId\": \"894\",\n    \"url\": \"https://mychart.caromonthealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Lifespan\",\n      \"Brown University Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BAA79554-A977-4EFF-BA2E-FEDE13CF1177/e1e883d7a99b02bbb150c281c78864f2.png\",\n    \"name\": \"Lifespan\",\n    \"slgId\": \"895\",\n    \"url\": \"https://mychart.brownhealth.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2505588D-11C0-496F-82BE-CFBFD92B9A91/a4c300ad433613cea454696090342f54.png\",\n    \"name\": \"Women's College Hospital\",\n    \"slgId\": \"897\",\n    \"url\": \"https://www.wchchart.ca/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B405BED2-B252-41FC-9404-F3ED010E1885/f90ab097bb84da3c8362a5847e68f1b8.png\",\n    \"name\": \"Allegheny Health Network\",\n    \"slgId\": \"898\",\n    \"url\": \"https://mychart.ahn.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFF3443F-D12E-44FB-A7A7-6288BE98C38A/b221d5efc2c953c70d26b2f1c211189c.png\",\n    \"name\": \"AdvantageCare Physicians\",\n    \"slgId\": \"901\",\n    \"url\": \"https://my.acpny.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/717B36AE-A43F-45D2-9C27-BFA38D21A056/fd026f79e4c1a23ccdad123b23d9e43e.png\",\n    \"name\": \"Lehigh Valley Health Network\",\n    \"slgId\": \"902\",\n    \"url\": \"https://www.mylvhn.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9D088464-A6BA-4EBA-9C24-AE6CDFEE5970/70e201e3bc4600326f481e13000dae02.png\",\n    \"name\": \"Valley Health Partners\",\n    \"slgId\": \"902-1\",\n    \"url\": \"https://www.myvhponline.org/myvhp/\"\n  },\n  {\n    \"aliases\": [\n      \"Bureau\",\n      \"Allentown Health Bureau\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DEE421D5-3D21-48D7-BA92-81F4412DAFCA/1f2b7db3efb1165c05c2eb16f72e45a4.png\",\n    \"name\": \"City of Allentown Pennsylvania\",\n    \"slgId\": \"902-2\",\n    \"url\": \"https://myahbonline.org/myahb/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D130BB07-1D7A-4747-A0F2-A4155C05F190/2ef82012f8349240ecf60ae979c1eb77.png\",\n    \"name\": \"Bethlehem Health Bureau\",\n    \"slgId\": \"902-3\",\n    \"url\": \"https://www.mybhbonline.org/mybhb/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/77164E2C-0394-4091-9BF4-71A653E6B33E/3c25530161bcf294a52aa5ec033cae37.png\",\n    \"name\": \"Pocano Ambulatory Surgery Center\",\n    \"slgId\": \"902-4\",\n    \"url\": \"https://mypasconline.com/mypasc/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/42955B06-F734-4DD7-9079-5B37A412BC40/68cc40de2cf89a28a7c2abee1cbbc16c.png\",\n    \"name\": \"MyConnect Health Portal\",\n    \"slgId\": \"902-5\",\n    \"url\": \"https://myconnectportal.com/MyConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/80160441-B729-415B-BC37-9A2A6295AC45/c01baf2efd6261836c1f6bb6cd48cbd0.png\",\n    \"name\": \"City of Hope\",\n    \"slgId\": \"903\",\n    \"url\": \"https://www.mycityofhope.org/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B5F51E5-FD95-4551-8594-B58CF51B3390/32d87356d64c7c13dff565bdfc979f9b.png\",\n    \"name\": \"Hamilton Health Sciences\",\n    \"slgId\": \"904\",\n    \"url\": \"https://mychart.hhsc.ca/MyChartEpicPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"Navicent\",\n      \"Wake Forest\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0CDF57FF-11CD-4A21-98A7-3D40E5EE2897/0eacd6be74fe01705d56a13bc1140f5a.png\",\n    \"name\": \"Atrium Health\",\n    \"slgId\": \"905\",\n    \"url\": \"https://my.atriumhealth.org/MyAtriumHealth/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/173FB720-D1EF-4C5F-BD2C-82AC96E45AE3/a38a5d191894615763d3693a0cfa08c1.png\",\n    \"name\": \"Scotland Health Care System\",\n    \"slgId\": \"905-2\",\n    \"url\": \"https://www.myscotlandhealth.org/MyScotlandHealth/\"\n  },\n  {\n    \"aliases\": [\n      \"Foothills\",\n      \"Saluda\",\n      \"Rosenberg\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AE55A04-272D-4EFD-8A5F-752C00340089/dc1f366f04878d6dfd6b22db937aea9b.png\",\n    \"name\": \"St. Luke's Hospital\",\n    \"slgId\": \"905-3\",\n    \"url\": \"https://www.mystlukeschart.org/MyStLukesChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37B2D188-184A-42E3-8F05-54C478367804/f781af4b7e950c5c6e2f9cd27a554789.png\",\n    \"name\": \"Morehouse Medicine\",\n    \"slgId\": \"905-5\",\n    \"url\": \"https://my.morehousehealthcare.com/MHC/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/418DB21D-C916-46DB-82A3-63E73AF47143/717b03b2935aa65b18b74842c150c694.png\",\n    \"name\": \"Alleghany Health\",\n    \"slgId\": \"905-6\",\n    \"url\": \"https://my.alleghanyhealth.org/alh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D4364012-0ACC-4DA8-8FC4-335BFCDE9C56/47d0374e5dd73277c8f8a0e41be3cb58.png\",\n    \"name\": \"Camino Health Center\",\n    \"slgId\": \"905-7\",\n    \"url\": \"https://my.caminosalud.com/camino/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2B678280-B07D-4FA6-9EB6-97C0B54CE0CE/7555db616560cfc11efccafefc51d7ff.png\",\n    \"name\": \"St. David's\",\n    \"slgId\": \"906\",\n    \"url\": \"https://mychart.stdavids.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6527C52A-44F7-40FB-985A-3CF31A46C950/447a463f27ddec7657e251bf395e753f.png\",\n    \"name\": \"Arlington Maternal Fetal Specialists\",\n    \"slgId\": \"906-1\",\n    \"url\": \"https://mychart.stdavids.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"AHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D501183C-0DDA-4029-941D-3536832FE333/2ec809264c9751f0c91952b772ca86c2.png\",\n    \"name\": \"Atlantic Health\",\n    \"slgId\": \"907\",\n    \"url\": \"https://mychart.atlantichealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1BDD6F86-E733-4510-A168-371C7490C2A1/94720c6a8396d7c4768a995beed1c7ff.png\",\n    \"name\": \"Hartford Healthcare\",\n    \"slgId\": \"908\",\n    \"url\": \"https://mychartplus.org/myChart/\"\n  },\n  {\n    \"aliases\": [\n      \"AdRad\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E88D994D-C733-48F9-AB68-6D5F3C21DBDD/7dea4929845bd35d4f6f4ca7eff2f7e0.png\",\n    \"name\": \"Advanced Radiology\",\n    \"slgId\": \"908-1\",\n    \"url\": \"https://mychartplus.org/AdRad/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4110F5B8-FF29-4662-8DD1-96F339D5611E/d3cdbc95899c0faef456b2420fd4345b.png\",\n    \"name\": \"Connecticut GI\",\n    \"slgId\": \"908-2\",\n    \"url\": \"https://mychartplus.org/CTGI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DF896436-C493-4A8C-866A-7984D93BB1C3/fcd5e4d822537ec9c0b0adbb908abe87.png\",\n    \"name\": \"Physicians Alliance of Connecticut\",\n    \"slgId\": \"908-3\",\n    \"url\": \"https://mychartplus.org/PACT/authentication/login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/23DB0C23-BA84-4A4A-B690-0862892B052A/8e310ec307dce4dcbc86a744d3184a8f.png\",\n    \"name\": \"Starling\",\n    \"slgId\": \"908-4\",\n    \"url\": \"https://mychartplus.org/Starling/\"\n  },\n  {\n    \"aliases\": [\n      \"OAH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B3BC08F6-B0AA-4653-A6E8-D7FBD9CCB89F/1cd8f7e6ef8279adf97ca2e53c96ae7c.png\",\n    \"name\": \"Orthopedic Associates of Hartford\",\n    \"slgId\": \"908-5\",\n    \"url\": \"https://mychartplus.org/OAH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1ACD605C-1D25-441A-B855-3F526249CD5B/3f594a71e15c5a5586a2c7c8f3714935.png\",\n    \"name\": \"Connecticut Orthopaedics\",\n    \"slgId\": \"908-6\",\n    \"url\": \"https://mychartplus.org/CTOR/\"\n  },\n  {\n    \"aliases\": [\n      \"CT ENT\",\n      \"ENT Kids\",\n      \"CT Ear, Nose & Throat\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/484DE8C6-7074-41C3-93A2-1868A3A5C48E/740a2eceeb19dc4b635f757dbf60d3bc.png\",\n    \"name\": \"Connecticut Ear, Nose & Throat Associates\",\n    \"slgId\": \"908-7\",\n    \"url\": \"https://mychartplus.org/ctent/\"\n  },\n  {\n    \"aliases\": [\n      \"ECC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F5368E6-4766-4D5C-AFCA-A99C794E3434/163c690ca7f30f15af10ad7de84fff0c.png\",\n    \"name\": \"Endoscopy Center of Connecticut\",\n    \"slgId\": \"908-8\",\n    \"url\": \"https://mychartplus.hhchealth.org/ecc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1839A31E-643A-4343-AFE6-662DFFF5DCE7/78544f462d14498e39aee1f1e2b7bffe.png\",\n    \"name\": \"Comprehensive Orthopaedics\",\n    \"slgId\": \"908-9\",\n    \"url\": \"https://mychartplus.org/comc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB4031CD-A7C0-450E-A244-67909DC1ACD7/150ba516764d3b84653b253596ac19de.png\",\n    \"name\": \"SCA Health\",\n    \"slgId\": \"908-10\",\n    \"url\": \"https://mychartplus.org/sca/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FE256D2B-99F2-4B36-90B0-F440BB33D60F/1e254930653a134c1216f3c871a2ce6b.png\",\n    \"name\": \"University of Texas MD Anderson Cancer Center\",\n    \"slgId\": \"909\",\n    \"url\": \"https://my.mdanderson.org/Account/Login\"\n  },\n  {\n    \"aliases\": [\n      \"WPH\",\n      \"MMC\",\n      \"MHS\",\n      \"SMG\",\n      \"MNH\",\n      \"MMV\",\n      \"MNR\",\n      \"White Plains\",\n      \"Scarsdale\",\n      \"Nyack\",\n      \"St. Luke's Cornwall\",\n      \"Burke\",\n      \"Mount Vernon\",\n      \"New Rochelle\",\n      \"Cedar\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F68B341-F4DB-48E0-9282-4EEAE630A07E/35323924f8ac7b3afc7174fa29cfc651.png\",\n    \"name\": \"Montefiore Health System, Inc\",\n    \"slgId\": \"910\",\n    \"url\": \"https://mychart.montefiore.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/545A6802-0061-41F3-982A-4D2900FD1713/39d15abf00e208d277f1681d90aca3b1.png\",\n    \"name\": \"Amsterdam UMC\",\n    \"slgId\": \"911\",\n    \"url\": \"https://mijndossier.amsterdamumc.nl/MyChart-PRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DB28FC91-3A6F-4455-9020-80152607E838/19e8b662a864effb099ed0f6220ad07f.png\",\n    \"name\": \"Prime Healthcare\",\n    \"slgId\": \"913\",\n    \"url\": \"https://mychart.primehealthcare.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AAB2380-49D2-4C40-98A0-1172562CA450/8fce41f1d6ba7e04e1794f34caa75f5b.png\",\n    \"name\": \"Southcoast Health System\",\n    \"slgId\": \"914\",\n    \"url\": \"https://mychart.southcoast.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C0ED286C-818F-4137-8FDA-BF0289B5013D/bdf28ce6cc2b0fa2d81fcd8dcf41405d.png\",\n    \"name\": \"Prisma Health\",\n    \"slgId\": \"915\",\n    \"url\": \"https://mychart.prismahealth.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A8EC5AF4-5AA5-42C2-AF08-F2D7BA98B02D/7c1466b666de6b9830ca8cbe9f039e26.png\",\n    \"name\": \"MinSP\",\n    \"slgId\": \"916\",\n    \"url\": \"https://minsundhedsplatform.dk/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5668A828-7983-49D4-BD26-6261D74243DA/c0ef1e594616ca3c3663c2e1bab5b486.png\",\n    \"name\": \"Johns Hopkins Aramco Healthcare\",\n    \"slgId\": \"918\",\n    \"url\": \"https://mychart.jhah.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.slhn.org/mychart/login\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B3C09DF4-55A7-4E4F-B6BE-34FDC97CD330/4f4692c692a7ef4d01dab35e3e799f64.png\",\n    \"name\": \"St Luke's\",\n    \"slgId\": \"919\",\n    \"url\": \"https://mychart.slhn.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"David Chui, MD\",\n      \"Modern Orthopedics\",\n      \"Peter Youn, MD\",\n      \"Manjul Patwardhan, MD\",\n      \"Shiva Mohtashami, MD\",\n      \"Marc Zare, MD\",\n      \"Mountain View Surgery Center\",\n      \"Agah Medical\",\n      \"SJ Ear and Sinus Center\",\n      \"Western Radiation Oncology\",\n      \"Silicon Valley Chest and Sleep Medicine\",\n      \"Andrew Kees Roorda, M.D.\",\n      \"South Bay Allergy and Asthma\",\n      \"Silicon Valley Sports Medicine\",\n      \"Vivaya Jujare, MD\",\n      \"Advanced Cardiology Specialists\",\n      \"San Jose Pacific Neurology Center\",\n      \"El Camino GI Medical Associates\",\n      \"Los Gatos Premiere Medicine\",\n      \"Valley Medical Consultants (Cardio)\",\n      \"Valley Medical Consultants (Neuro)\",\n      \"Apex Cardiology\",\n      \"San Jose Integrative Wellness Center\",\n      \"California Movement Disordrs Center\",\n      \"John Dang, MD\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09C31F41-339C-476E-AB0D-D37843033FED/61fd2ac5fc0b298ab2d2e7878e4f5324.png\",\n    \"name\": \"El Camino Health\",\n    \"slgId\": \"920\",\n    \"url\": \"https://mycare.elcaminohospital.org/mychart\"\n  },\n  {\n    \"aliases\": [\n      \"Silicon Valley Sports Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/default.png\",\n    \"name\": \"El Camino\",\n    \"slgId\": \"920-1\",\n    \"url\": \"https://mycare.elcaminohospital.org/ccmycare/\"\n  },\n  {\n    \"aliases\": [\n      \"CVS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F85923ED-C0AA-4FDE-9C4F-CE7747CD1D88/059442a8be78fd9f7d096ccad6714c11.png\",\n    \"name\": \"Minute Clinic\",\n    \"slgId\": \"921\",\n    \"url\": \"https://mychart.minuteclinic.com/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F5218193-AE72-494D-95B3-6F96A12C2978/86320775d23c39ebf4eaf1d6670830b4.png\",\n    \"name\": \"Houston Methodist\",\n    \"slgId\": \"922\",\n    \"url\": \"https://mychart.houstonmethodist.org/mychart-prod/\"\n  },\n  {\n    \"aliases\": [\n      \"MCH\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92D41D89-93C0-4627-8FE4-3FF0319725DE/e8b319523ab9ebce60c4814734206dec.png\",\n    \"name\": \"Medical Clinic of Houston L.L.P.\",\n    \"slgId\": \"922-1\",\n    \"url\": \"https://mchllp.houstonmethodist.org/MCHMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F02487C-9F5E-4B3D-BD3D-BD76E908E6B4/bf8e73d698f96fc655b302ccdbe3bc3d.png\",\n    \"name\": \"ProMedica\",\n    \"slgId\": \"924\",\n    \"url\": \"https://mychart.promedica.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"HSS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3D29CC50-4211-4E3B-9286-0BB05C025E16/86a4eb775d933ee90213c43183aed0d1.png\",\n    \"name\": \"Hospital for Special Surgery\",\n    \"slgId\": \"927\",\n    \"url\": \"https://myhss.hss.edu/MyHSS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D051F1F4-565C-45B8-BE9F-D17E52B05D49/f9fb237b8789e9e0fa2428ac00a318da.png\",\n    \"name\": \"The Royal Childrens Hospital\",\n    \"slgId\": \"929\",\n    \"url\": \"https://myrchportal.rch.org.au/MyRCHPortal/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [\n      \"Royal Women\",\n      \"Royal Melbourne\",\n      \"Peter Mac\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1A109291-F542-4AA7-B060-9DEE35007EC5/cbcda4d04e5e2f932ab2dd61e06b270a.png\",\n    \"name\": \"Parkville Health Services\",\n    \"slgId\": \"929-1\",\n    \"url\": \"https://health-hub.org.au/Health-Hub/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7C458233-67C2-40F0-8F48-A9C563EE1E11/d492bd1e9bc841933e26b5bdab29b142.png\",\n    \"name\": \"Denver Health\",\n    \"slgId\": \"932\",\n    \"url\": \"https://mychart.denverhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9C784D95-5407-47CF-9DFC-F6121C36A67F/dcd935651ed015f221bde993cfc0e697.png\",\n    \"name\": \"Medisch Centrum Leeuwarden\",\n    \"slgId\": \"933\",\n    \"url\": \"https://www.mijnmcl.nl/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/639936F9-A667-4674-9431-6D3E00A8E8FB/ba4ca39d91601dea26ea133014c8d5f9.png\",\n    \"name\": \"INTEGRIS Health\",\n    \"slgId\": \"934\",\n    \"url\": \"https://integrisandme.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/74413C11-99B6-49DF-BBD5-FE118FB6D16C/4e6603523d94fa42fa74205b312b68ec.png\",\n    \"name\": \"HPI\",\n    \"slgId\": \"934-1\",\n    \"url\": \"https://mychart.communityhospitalokc.com/MyChartHPI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/62B09227-2FE9-4787-8176-124A7A3165B9/cec9aa5fca8ffbcae48aebbebef7ee12.png\",\n    \"name\": \"Baptist Healthcare\",\n    \"slgId\": \"935\",\n    \"url\": \"https://mychart.baptisthealth.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"BMC\",\n      \"Total Care\",\n      \"Bend Memorial Clinic\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BDDBAB36-1221-4ACF-811E-97645B88F0C7/f2f2322a846e292e273cc968a7781c4f.png\",\n    \"name\": \"Summit Health - Oregon\",\n    \"slgId\": \"936\",\n    \"url\": \"https://mychart.bmctotalcare.com/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75BDDD65-DDDA-4E5A-9BBC-0DFBAC683B34/ed01377a03c452fb4596ee713fcec9e5.png\",\n    \"name\": \"Riverside Medical Center\",\n    \"slgId\": \"937\",\n    \"url\": \"https://www.riversidemychart.org/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4B717686-2BC4-47F7-8E8B-2A1F2835D34F/412ed3077f949f4a167b20590a866933.png\",\n    \"name\": \"Spartanburg Regional Healthcare System\",\n    \"slgId\": \"939\",\n    \"url\": \"https://mychart.spartanburgregional.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6AE2D9DA-DA59-4C0B-B68D-5E912C915A47/7ecd554547e66a1034518e6faca0a6dc.png\",\n    \"name\": \"Cottage Health System\",\n    \"slgId\": \"941\",\n    \"url\": \"https://mychart.sbch.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EF4FBA96-A9EB-4FB0-A8C0-790F97DC0BE6/477a1263357ea878b81b0397240793c8.png\",\n    \"name\": \"CommonSpirit Mountain Region\",\n    \"slgId\": \"942\",\n    \"url\": \"https://epic.mycenturahealth.org/MCH/\"\n  },\n  {\n    \"aliases\": [\n      \"YFVWC\",\n      \"Family Medical Center\",\n      \"Unify Community Health\",\n      \"Salud\",\n      \"Rosewood\",\n      \"Lancaster\",\n      \"Miramar\",\n      \"Mirasol\",\n      \"Mountainview\",\n      \"MC. View\",\n      \"Grandview\",\n      \"SSIC\",\n      \"Lincoln\",\n      \"Valley Vista\",\n      \"FMC\",\n      \"Mid-Valley\",\n      \"Sunnyside\",\n      \"Toppenish\",\n      \"Granger\",\n      \"Coastal\",\n      \"Clatskanie\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B1578C03-1EC4-48B1-B0DF-0AF47B4E2983/c3a01644e8e230233e6be61a76e6aa86.png\",\n    \"name\": \"Yakima Valley Farm Workers Clinic\",\n    \"slgId\": \"943\",\n    \"url\": \"https://mychart.yvfwc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C3FC5B53-A627-4B32-8FD2-3674F2E10BC2/7945f4461dfd1195f1a847dc4d98e3ea.png\",\n    \"name\": \"Bayhealth Medical Center\",\n    \"slgId\": \"944\",\n    \"url\": \"https://epmychart.bayhealth.org/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AFAF5298-4BCF-445F-AF9C-36E063FE3A9C/c4e4506c88eb827b4f917bf51e4c7971.png\",\n    \"name\": \"First State Infectious Diseases\",\n    \"slgId\": \"944-2\",\n    \"url\": \"https://epmychart.bayhealth.org/FirstStateID\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6CBB7C1-E95D-4227-A918-74AAF94578E5/37b6d9d10d2cc880a9c144d58a8468d7.png\",\n    \"name\": \"Dedicated to Women\",\n    \"slgId\": \"944-3\",\n    \"url\": \"https://epmychart.bayhealth.org/DedicatedtoWomen/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D644C857-F331-4581-AF6F-4271872491DD/e10b4fe8edb40c379e53def3981dfe95.png\",\n    \"name\": \"CNMRI\",\n    \"slgId\": \"944-5\",\n    \"url\": \"https://epmychart.bayhealth.org/CNMRI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B00B16B7-5334-482A-B973-ED703F1C7DB9/a3c88780575d9f34f7a772485ad1e39f.png\",\n    \"name\": \"Eranga Cardiology\",\n    \"slgId\": \"944-6\",\n    \"url\": \"https://epmychart.bayhealth.org/ErangaCardio/\"\n  },\n  {\n    \"aliases\": [\n      \"Saint Francis Healthcare System - Cape Girardeau, MO\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8917CCD9-A056-4E54-B818-450B3DB05F24/4129d31cede6de839e4ebf7173f301ee.png\",\n    \"name\": \"Saint Francis Healthcare System\",\n    \"slgId\": \"945\",\n    \"url\": \"https://mychart.sfmc.net/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/51AE420F-AF16-42E2-8A0E-15BB509669A5/0605f6207946201c571fa3fa519eba93.png\",\n    \"name\": \"Select Medical\",\n    \"slgId\": \"948\",\n    \"url\": \"https://mychart.selectmedical.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F45BA4A4-86BC-41C8-9143-1E5312151BFE/b43cf5d87bd5d8e2c57d00c51e2398c8.png\",\n    \"name\": \"Concentra\",\n    \"slgId\": \"948-1\",\n    \"url\": \"https://mychart.concentra.com/ConcentraMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B153A67F-20D7-4C9E-8735-6C4231DD7F16/ba1f649a0ad817c31b6c89863772cfac.png\",\n    \"name\": \"University Health\",\n    \"slgId\": \"950\",\n    \"url\": \"https://mychart.uhsystem.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"GBMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B5F5D67-1075-4EA8-92D1-039B42B801CE/ddcc3683b017d31fb6c22dac5d29aabe.png\",\n    \"name\": \"Greater Baltimore Medical Center\",\n    \"slgId\": \"954\",\n    \"url\": \"https://eportal.gbmc.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7BF485B2-90B3-4825-B5D5-E97C91B1F400/2e46ace04669e7d96ad08296cc573bcb.png\",\n    \"name\": \"St Jansdal Ziekenhuis\",\n    \"slgId\": \"955\",\n    \"url\": \"https://mijn.stjansdal.nl/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Jefferson Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/39361CA4-41B4-4557-BC9C-16A95EF57FB1/fd17fa4bc03e2b062f78cde379135da8.png\",\n    \"name\": \"Thomas Jefferson University Health System\",\n    \"slgId\": \"957\",\n    \"url\": \"https://mychart.jefferson.edu/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/mayoClinic.png\",\n    \"name\": \"Mayo Clinic\",\n    \"slgId\": \"958\",\n    \"url\": \"https://mayoclinichealthsystem.org/patient-online-services\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B02E68E5-1674-4498-BDBC-B66908BBFEDE/f67bcf3e55401ffdee2d6cc03d0c06aa.png\",\n    \"name\": \"Riverside Health System\",\n    \"slgId\": \"961\",\n    \"url\": \"https://mychart.riversideonline.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2A86AEDF-EAE9-4183-8289-FC59EE023BB1/e60ef962e47f7de8c6e34681c830f024.png\",\n    \"name\": \"Conemaugh Health System\",\n    \"slgId\": \"962\",\n    \"url\": \"https://mychart.conemaugh.org/MyChart-2017-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/121426FC-79BA-45FE-8DD6-9433794305BF/f8b104110b49b44c77f0249ad9c8f3ac.png\",\n    \"name\": \"Eskenazi\",\n    \"slgId\": \"963\",\n    \"url\": \"https://mychart.eskenazihealth.edu/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/777E282F-A340-4F4F-AFE4-74416556D53C/9d32ea62685134b84716b26269c80299.png\",\n    \"name\": \"Scripps Health\",\n    \"slgId\": \"964\",\n    \"url\": \"https://myscripps.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"WUSM\",\n      \"Barnes-Jewish\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F1C8D6ED-4747-4E4E-A4EC-8408D8C7ED8E/d0a51cbbbbe544c2e2b54f930d742ded.png\",\n    \"name\": \"BJC Healthcare & Washington University\",\n    \"slgId\": \"965\",\n    \"url\": \"https://www.mypatientchart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BF5A7E23-3452-4000-9AB6-B7400AADA87B/38d8b8debe4a30b6632f89f79e30016b.png\",\n    \"name\": \"Erlanger Health System\",\n    \"slgId\": \"967\",\n    \"url\": \"https://mychart.erlanger.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://mychart.mah.org/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/93AE1427-0818-407B-9F4B-81C40EAE5369/c56d8d88f22f081eab988ebf79802ce1.png\",\n    \"name\": \"Mount Auburn\",\n    \"slgId\": \"968\",\n    \"url\": \"https://mychart.bilh.org/MyChart-BILH/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/259DDE9A-6C0B-4B65-8325-389418E5FD71/e0f5d86ad7fb66c77f80243c3e26b795.png\",\n    \"name\": \"Texas Scottish Rite Hospital for Children\",\n    \"slgId\": \"970\",\n    \"url\": \"https://mychart.scottishriteforchildren.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4282099D-90A9-4A91-8BFD-BD6FA1CBA21F/8d7dac2d574456adb36a6f03f5ee724a.png\",\n    \"name\": \"AnMed Health\",\n    \"slgId\": \"971\",\n    \"url\": \"https://mychart.anmed.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/97FE6CD8-A93F-4007-9423-ED25A700AB7C/de2ee50874f53da79d7a9ef7f614fd9c.png\",\n    \"name\": \"TidalHealth\",\n    \"slgId\": \"972\",\n    \"url\": \"https://mychart.tidalhealth.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9D766DA8-0ABB-4E13-BA35-CE65AF1DF840/d9622b9280f4f2837ce1a8c90a4f74fb.png\",\n    \"name\": \"Dubai Health\",\n    \"slgId\": \"973\",\n    \"url\": \"https://services.dubaihealth.ae/Mychart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DF0F67EC-8537-40B2-B7EC-F6EE3E7AEC67/a79888901ee8714fca017bb7ab5088bf.png\",\n    \"name\": \"WellSpan\",\n    \"slgId\": \"975\",\n    \"url\": \"https://login.wellspan.org/mywellspan/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/911CA0AC-DA57-4447-8AFD-8F69CB1921B6/1270c8325d14217443fa7dd4751d5db5.png\",\n    \"name\": \"Keystone Health\",\n    \"slgId\": \"975-1\",\n    \"url\": \"https://my.keystonehealth.org/mykeystonehealth\"\n  },\n  {\n    \"aliases\": [\n      \"Quest,QuestBH,MyQuestBH\",\n      \"QuestBH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C4EB685D-B265-4E4D-9916-CB3D8E1FBE27/39dd8310ec8f85f7f27409d2c4602bb2.png\",\n    \"name\": \"Quest Behavioral Health\",\n    \"slgId\": \"975-2\",\n    \"url\": \"https://my.questbh.com/myquestbh\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/722AF7E8-FF49-4181-BE97-FA1524B1D024/f777a745763094ee654f3ee9f4c56e39.png\",\n    \"name\": \"UMass Memorial Health\",\n    \"slgId\": \"978\",\n    \"url\": \"https://mychartonline.umassmemorial.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/614ED497-6585-40B9-B63A-FA0F6751B053/840b36bacc39943642aa0714c5cafd98.png\",\n    \"name\": \"Community Health Connections\",\n    \"slgId\": \"978-1\",\n    \"url\": \"https://www.mychart.chcfhc.org/CHCMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/691222C8-A3DD-4B27-8CFA-DE8334D2AED5/0c4679c5cd82afaa540b2a8ff970e61c.png\",\n    \"name\": \"Mackenzie Health\",\n    \"slgId\": \"979\",\n    \"url\": \"https://mychart.mackenziehealth.ca/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0615A748-816B-450A-AB70-05A2A9CC8252/1d6ee4529607f98760515ee2c9f8435b.png\",\n    \"name\": \"Casey House\",\n    \"slgId\": \"979-1\",\n    \"url\": \"https://mychart.caseyhouse.ca/caseyhouse/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/86CED80A-B5A6-4920-8DDF-C24D3FCD641D/b2c3e5bd915c75026674dfede4d9c8d9.png\",\n    \"name\": \"Methodist Health System\",\n    \"slgId\": \"980\",\n    \"url\": \"https://mychart.methodisthealthsystem.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Chalmers\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/66945EAC-FFEF-48FF-B06E-89DB7BABF5E5/d4db06a35d9160a1c691014a57b41054.png\",\n    \"name\": \"Department of Veterans Affairs\",\n    \"slgId\": \"985-1\",\n    \"url\": \"https://www.myhealth.va.gov/mhv-portal-web/user-login\"\n  },\n  {\n    \"aliases\": [\n      \"SIH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/78B71354-7339-413C-BE2D-9381A3B6ABD1/0acb46fb97b0f1435eaad30b817974d0.png\",\n    \"name\": \"Southern Illinois Healthcare\",\n    \"slgId\": \"986\",\n    \"url\": \"https://mychart.sih.net/mychartprd/\"\n  },\n  {\n    \"aliases\": [\n      \"Hardin County General Hospital and Clinic\",\n      \"Physicians Surgery Center\",\n      \"Urology Institute of Southern Illinois\",\n      \"Vitalysis\",\n      \"Thomas Kupferer\",\n      \"Hornik Neurosciences PLLC\",\n      \"Hanson Medical Services\",\n      \"KDMS Consultants\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D7615E7-F026-4550-A99D-F720C7562A54/960b593fab9c85ee1d8fbf59b87200c5.png\",\n    \"name\": \"SIH Affiliates\",\n    \"slgId\": \"986-1\",\n    \"url\": \"https://mychart.southernilcc.net/MyChartCCPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"Boston Children's\",\n      \"PPOC\",\n      \"Aida\",\n      \"Yavshayan\",\n      \"Alena\",\n      \"Ashenberg\",\n      \"Amherst\",\n      \"Ann\",\n      \"Nicoloff\",\n      \"Becker\",\n      \"Arlington\",\n      \"Bedford\",\n      \"Belmont\",\n      \"Cambridge\",\n      \"Brookline\",\n      \"Briarpatch\",\n      \"Nantucket\",\n      \"Sandwich\",\n      \"Yarmouth\",\n      \"Port\",\n      \"1180\",\n      \"Beacon\",\n      \"Benjamin\",\n      \"Spingarn\",\n      \"Rottenberg\",\n      \"Bridgewater\",\n      \"Crown\",\n      \"Colony\",\n      \"Garden\",\n      \"Auburn\",\n      \"Shrewsbury\",\n      \"Chestnut\",\n      \"Hill\",\n      \"Andover\",\n      \"Cove\",\n      \"Commonwealth\",\n      \"Elena\",\n      \"Gorlovsky\",\n      \"East\",\n      \"Milton\",\n      \"Fairview\",\n      \"Fellsway\",\n      \"Falmouth\",\n      \"Framingham\",\n      \"Greater\",\n      \"Lowell\",\n      \"Westford\",\n      \"Heather\",\n      \"Davidson\",\n      \"Heena\",\n      \"Banker\",\n      \"Holliston\",\n      \"Milford\",\n      \"Horizon\",\n      \"Holyoke\",\n      \"Hadley\",\n      \"Hyde\",\n      \"Jeffrey\",\n      \"Feldman\",\n      \"Lexington\",\n      \"Longwood\",\n      \"Leominster\",\n      \"Meel\",\n      \"Marion\",\n      \"Main\",\n      \"Street\",\n      \"Northampton\",\n      \"Adams\",\n      \"Williamstown\",\n      \"Needham\",\n      \"Waltham\",\n      \"Newton\",\n      \"Wellesley\",\n      \"Reading\",\n      \"Neponset\",\n      \"Valley\",\n      \"Brockton\",\n      \"Springfield\",\n      \"Westfield\",\n      \"Hampden\",\n      \"Malden\",\n      \"Associates\",\n      \"Primary\",\n      \"Mathur\",\n      \"Purple\",\n      \"Crayon\",\n      \"Medford\",\n      \"House\",\n      \"Call\",\n      \"Stavitsky\",\n      \"Belchertown\",\n      \"Wilbraham\",\n      \"Lynn\",\n      \"Melrose\",\n      \"Peabody\",\n      \"Salem\",\n      \"Plymouth\",\n      \"Post\",\n      \"Road\",\n      \"Roslindale\",\n      \"Roth\",\n      \"Rotter\",\n      \"Laster\",\n      \"Singular\",\n      \"Start\",\n      \"Line\",\n      \"Suburban\",\n      \"Steven\",\n      \"Harris\",\n      \"Swansea\",\n      \"TLC\",\n      \"Village\",\n      \"Wayland\",\n      \"West\",\n      \"Walpole\",\n      \"Westwood\",\n      \"Easton\",\n      \"Mansfield\",\n      \"Woburn\",\n      \"Wareham\",\n      \"Walden\",\n      \"Pond\",\n      \"Bramblebush\",\n      \"Cape Cod\",\n      \"South Deerfield\",\n      \"Northern Bershire\",\n      \"North Adams\",\n      \"Canton\",\n      \"West Bridgewater\",\n      \"Stoneham\",\n      \"Chelsea\",\n      \"Winchester\",\n      \"Pediatrics at Newton Wellesley\",\n      \"Washington\",\n      \"Community Pediatrics\",\n      \"Haverhill\",\n      \"Newburyport\",\n      \"Rowley\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CEB3A622-A9D9-4EF9-9321-EFD871459494/d9b42ce50bd788b2c1c10d0d70deb893.png\",\n    \"name\": \"Pediatric Physicians' Organization at Children's\",\n    \"slgId\": \"988\",\n    \"url\": \"https://mychart.chppoc.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/site/en-us/images/login/custom/apotti.png\",\n    \"name\": \"Apotti\",\n    \"slgId\": \"990\",\n    \"url\": \"https://www.maisa.fi/maisa/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0DF5F6AB-7D34-42AB-8F2C-04643134FE47/4763dee8c8c646428a52a2e4ff6b3d31.png\",\n    \"name\": \"FirstHealth of the Carolinas\",\n    \"slgId\": \"991\",\n    \"url\": \"https://www.firsthealthmychart.org/mychartprd\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5D086AC3-EDAF-4FDB-A008-9E61A2589435/207bb06567c6ffcf097468dd496b4401.png\",\n    \"name\": \"UConn Health\",\n    \"slgId\": \"996\",\n    \"url\": \"https://mychart.uconn.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/11F68621-BBD5-4167-8456-8BD40BE69D76/73d0b89b77d29c4e76b2cea1f78eab34.png\",\n    \"name\": \"UHI\",\n    \"slgId\": \"996-1\",\n    \"url\": \"https://mychart.uconn.edu/UHI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4D9FA37B-F3F9-4606-8BEB-09980767F5DA/e85a1aec3e0d34f8d0cb1fc94726b2fd.png\",\n    \"name\": \"Eisenhower Health\",\n    \"slgId\": \"997\",\n    \"url\": \"https://mychart.eisenhowerhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1863FC1B-895D-4957-A494-78DEC5FAD000/1b2bc0c2940d9356b0d26fa1e8fca898.png\",\n    \"name\": \"Watson Clinic\",\n    \"slgId\": \"998\",\n    \"url\": \"https://mychart.watsonclinic.com/prd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E2D628D6-2E3D-4974-83D1-B8E885B2B7FA/30526bf5c0638ecc3855fb160a83458f.png\",\n    \"name\": \"Sint Antonius Ziekenhuis\",\n    \"slgId\": \"999\",\n    \"url\": \"https://mijnantonius.antoniusziekenhuis.nl/MijnAntonius/\"\n  },\n  {\n    \"aliases\": [\n      \"Charlotte Eye Ear Nose and Throat Associates\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/63FF35D3-C24D-451F-8969-C98CCD857AC4/25c0911ed71c386409ca0141addbb228.png\",\n    \"name\": \"CEENTA\",\n    \"slgId\": \"1001\",\n    \"url\": \"https://myceentachart.com/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B7834CEC-7E2B-44F1-9B60-89D191237B7B/bf5527698f295c258fbf2f6178ed3681.png\",\n    \"name\": \"South Shore Health\",\n    \"slgId\": \"1002\",\n    \"url\": \"https://mychart.southshorehealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8A39E5B3-872B-4970-9E9B-F3F8250FAB41/0ac0322df620466a492395eb4599ce9a.png\",\n    \"name\": \"MyMichigan Health\",\n    \"slgId\": \"1003\",\n    \"url\": \"https://mymidmichigan.midmichigan.net/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F8976298-3862-44FE-A6E0-C0B57F22C2E1/63b1de29b7ee82bfb11dd7f288fe280b.png\",\n    \"name\": \"Mackinac Straits Health System\",\n    \"slgId\": \"1003-1\",\n    \"url\": \"https://my.midmichigan.net/mshs/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6052AC20-DA7F-4480-92C6-42BDF8B85241/6263600de3a9bf4e0d6b3733cf5f5def.png\",\n    \"name\": \"Helen Newberry Joy\",\n    \"slgId\": \"1003-2\",\n    \"url\": \"https://my.midmichigan.net/hnj/authentication/login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A384D828-B4EF-423A-B4A8-DE6E35284F44/807696c2ea60bf2e9f39346d0a0e46bd.png\",\n    \"name\": \"Nimkee\",\n    \"slgId\": \"1003-3\",\n    \"url\": \"https://mymidmichigan.midmichigan.net/SCIT/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3A22CCA2-8ED3-41F2-9EBB-FDBD6B3A9CA2/d61d764e03cab697340905c995de150e.png\",\n    \"name\": \"Karu Medical Associates\",\n    \"slgId\": \"1003-4\",\n    \"url\": \"https://mymidmichigan.midmichigan.net/IPP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/675AD1D5-F245-4E64-B5A7-D174B15465E0/5570be166c95db7b7fc07eb13fb37b32.png\",\n    \"name\": \"Great Lakes Surgical Associates\",\n    \"slgId\": \"1003-5\",\n    \"url\": \"https://mymidmichigan.midmichigan.net/IPP/\"\n  },\n  {\n    \"aliases\": [\n      \"MKHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9ED02A16-5CFC-436A-B288-ECA50BDB0558/49202f90110eb4d415c96f3dce3780bc.png\",\n    \"name\": \"McKenzie Health System\",\n    \"slgId\": \"1003-6\",\n    \"url\": \"https://mymidmichigan.midmichigan.net/MKHS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3EE1FB19-DF05-40DD-B407-C3E353D50DDA/9b65b699b9cb97ffddecfb5a7b700b0f.png\",\n    \"name\": \"Monument Health\",\n    \"slgId\": \"1004\",\n    \"url\": \"https://mychart.regionalhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4EA4D718-63DB-4B05-9D9B-1CB8DC2C22DC/53d0c532827207c1a0285af1b8f02812.png\",\n    \"name\": \"Skagit\",\n    \"slgId\": \"1005\",\n    \"url\": \"https://mychart.skagitregionalhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NGHS\",\n      \"NGPG\",\n      \"THC\",\n      \"Heart\",\n      \"GNC\",\n      \"Good\",\n      \"News\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C77647B1-C28F-44CF-92B4-836945333B23/febda5efbe507ba808e4e8656d99d0a5.png\",\n    \"name\": \"Northeast Georgia Health System\",\n    \"slgId\": \"1006\",\n    \"url\": \"https://mychart.nghs.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LC\",\n      \"TLC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F6F34575-C5D5-47F7-B5E9-DAAC68F302AB/eb42462130555bc3a90b4fd64840dc82.png\",\n    \"name\": \"Longstreet Clinic\",\n    \"slgId\": \"1006-2\",\n    \"url\": \"https://mychart.longstreetclinic.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/64EDEEE3-60C5-4A81-850B-BF01813EEBC0/52fb31433bb6eaef6dff20e58b382a19.png\",\n    \"name\": \"Main Line Health\",\n    \"slgId\": \"1007\",\n    \"url\": \"https://my.mainlinehealth.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BB9FAB99-DAC5-4FBA-B1C8-F85FEEF1FD93/62407d3ddd2390799d7daed2f66d10c6.png\",\n    \"name\": \"Vanderbilt University Medical Center\",\n    \"slgId\": \"1008\",\n    \"url\": \"https://myhealthatvanderbilt.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3EEB9012-D693-4F4C-A72C-2E1C730CD9C8/955c420d83fa87608224c0d8b9716127.png\",\n    \"name\": \"Heritage Medical Associates\",\n    \"slgId\": \"1008-1\",\n    \"url\": \"https://www.heritage.connecttomyhealth.com/hma/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/15D61105-034F-41ED-9B8E-42DCFBEADE28/e16ddf79c878547d9e75e435cfb02ef1.png\",\n    \"name\": \"UMCG\",\n    \"slgId\": \"1012\",\n    \"url\": \"https://mijn.umcg.nl/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F6DE0AF5-9DAF-4B10-ADD9-3A33E0B8997C/735a5e2514996c3224f34699138e30f3.png\",\n    \"name\": \"Hill Physicians Medical Group\",\n    \"slgId\": \"1013\",\n    \"url\": \"https://www.myhillchart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/12E9CC92-D549-4312-9F0E-753D9A49B4DE/905fb3f29ac6b49a514105d2401cf741.png\",\n    \"name\": \"OrthoVirginia\",\n    \"slgId\": \"1015\",\n    \"url\": \"https://mychart.orthovirginia.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/52E0E9E0-177A-4F9D-84AF-602B684CB2B5/1731a57fb9a8708b28fbcfe6a407b702.png\",\n    \"name\": \"MTOSC\",\n    \"slgId\": \"1015-1\",\n    \"url\": \"https://mychart.orthovirginia.com/MTOSC/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"AUB\",\n      \"AUBMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5293132D-DB7B-4320-A661-3E0EF9A0AECA/238b4c2e1c0e29f8e19dbbf5b1637ab2.png\",\n    \"name\": \"American University of Beirut Medical Center\",\n    \"slgId\": \"1016\",\n    \"url\": \"https://myaubhealth.aubmc.org.lb/mychartprd/\"\n  },\n  {\n    \"aliases\": [\n      \"Summit Surgical\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/84F79C38-7893-4F3C-90B9-A546C190ED32/77a71ff895f5021c6f4f50be5d418020.png\",\n    \"name\": \"Virtua Health\",\n    \"slgId\": \"1017\",\n    \"url\": \"https://secure.myvirtua.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4108CB0C-FDFC-4332-AFA6-9DACE689FBCA/97b55a0ff454172f4bd521198ca67756.png\",\n    \"name\": \"Cherry Hill Free Clinic\",\n    \"slgId\": \"1017-1\",\n    \"url\": \"https://cherryhillfreeclinic.virtua.org/cherryhillfreeclinic/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EA9B428C-D2A4-441D-9715-A5529FA6F3AE/10e054be50256d0356357694e4e11b29.png\",\n    \"name\": \"Summit Surgical Center\",\n    \"slgId\": \"1017-2\",\n    \"url\": \"https://summitsurgical.virtua.org/SummitSurgical/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D6BBEADF-B3CE-4878-BDAF-C1508F20E5B2/92c7de961add386941c0134bf13cabd1.png\",\n    \"name\": \"Elisabeth-TweeSteden Ziekenhuis\",\n    \"slgId\": \"1019\",\n    \"url\": \"https://www.mijnetz.nl/mychart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9009E1A8-40A6-4973-AD98-3BA471D9D4CA/216e3e35b79d4300579c4c7254857cd9.png\",\n    \"name\": \"Shannon\",\n    \"slgId\": \"1020\",\n    \"url\": \"https://mychart.shannonhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/58A2DEFE-C856-4E4E-AEB5-98F42F34DAF2/d76359edcdc479d3de54b6701f52e594.png\",\n    \"name\": \"La Esperanza Clinic\",\n    \"slgId\": \"1020-1\",\n    \"url\": \"https://mychart.shannonhealth.org/lec/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EC23B4CB-D0CD-4970-A76B-4B4AA9D326E8/75ce5902ac461fa788e2b1dc93966fdd.png\",\n    \"name\": \"Heart of Texas\",\n    \"slgId\": \"1020-2\",\n    \"url\": \"https://mychart.shannonhealth.org/hths/\"\n  },\n  {\n    \"aliases\": [\n      \"UMCSN\",\n      \"UMConnect\",\n      \"University Medical Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B998ECD0-405A-45F7-BD31-EE53D2BD21AA/d22a29b8b40589c27a25afe9e6494e4a.png\",\n    \"name\": \"UMC Southern Nevada\",\n    \"slgId\": \"1023\",\n    \"url\": \"https://umconnect.umcsn.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2CF73B6B-4177-40AD-B6AD-2A63F8DA3594/78031a93470623dc1985496c99c13652.png\",\n    \"name\": \"UNLV Health\",\n    \"slgId\": \"1023-1\",\n    \"url\": \"https://mychart.unlvhealth.org/UNLVMyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01A4DDD7-3B8D-4358-993A-A511F1D828B8/2fb869d9105c7f81ccb0338bba5029ec.png\",\n    \"name\": \"SGMC\",\n    \"slgId\": \"1024\",\n    \"url\": \"https://mychart.sgmc.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/53B4924C-D981-437E-90F6-16C3202AB790/e847b1e90c7a975696902077c183eccf.png\",\n    \"name\": \"Wiregrass Student Health Clinic\",\n    \"slgId\": \"1024-1\",\n    \"url\": \"https://mychart.sgmc.org/wiregrass/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1C599F5E-7667-474A-9A38-B2ADC9AB216F/8e6303b7c7ae86a1efe1d53ec556eaa4.png\",\n    \"name\": \"Lovelace Health\",\n    \"slgId\": \"1025-1\",\n    \"url\": \"https://mychart.lovelace.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/83BEFC51-2BA0-4EA0-8DBB-2B1B7D74DE3F/141eee7d1c8e30b644a0b61c2bb89631.png\",\n    \"name\": \"BSA\",\n    \"slgId\": \"1025-2\",\n    \"url\": \"https://mychart.bsahs.org/bsa/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/304BAD4D-4A89-4FD1-8662-AFAE485BE886/eb70a73c489d11889b8b3512b85b6683.png\",\n    \"name\": \"Hillcrest\",\n    \"slgId\": \"1025-4\",\n    \"url\": \"https://mychart.hillcrest.com/hmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/355CDED0-6997-4A89-B234-A1B510B4D0E9/d7a428d964b94b329bd9859a6fbd7d80.png\",\n    \"name\": \"Tulsa Spine & Specialty Hospital\",\n    \"slgId\": \"1025-5\",\n    \"url\": \"https://mychart.tulsaspinehospital.com/tssh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/56882A83-9A28-413C-91DC-51C437B4C2B4/72906376696c7ed51466ea309f15137f.png\",\n    \"name\": \"Oklahoma Heart Institute\",\n    \"slgId\": \"1025-6\",\n    \"url\": \"https://mychart.oklahomaheart.com/ohi/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/573F4397-5D58-49D7-BF56-A437154B0797/2f569dda1e0df9a87ea55612e829db8c.png\",\n    \"name\": \"Bailey Medical Center\",\n    \"slgId\": \"1025-7\",\n    \"url\": \"https://mychart.baileymedicalcenter.com/bmc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91403112-021B-44F2-89E6-F381EF47A3DD/b5d4e869c85c20bb8829c5223f4d05e1.png\",\n    \"name\": \"Utica Park Clinic\",\n    \"slgId\": \"1025-8\",\n    \"url\": \"https://mychart.uticaparkclinic.com/upc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4F810753-0790-4EF5-876A-F81F5037A2D8/2150e6b0cc7ec00d479e6e5c5d962378.png\",\n    \"name\": \"Portneuf Medical Center\",\n    \"slgId\": \"1025-9\",\n    \"url\": \"https://mychart.portneuf.org/pmc/\"\n  },\n  {\n    \"aliases\": [\n      \"Hackensack\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/90F51E58-8D99-4AF5-8742-97EB3ADEE875/17edbf5472b4f363864c8b4a528f691a.png\",\n    \"name\": \"Pascack Valley Medical Center\",\n    \"slgId\": \"1025-10\",\n    \"url\": \"https://mychart.pvmedicalcenter.com/pvc/\"\n  },\n  {\n    \"aliases\": [\n      \"Hackensack\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DE7D15CC-5DE6-4409-96B8-17B96C0AEE78/af67c88a4ffa3fb6b95b72856122e535.png\",\n    \"name\": \"Mountainside Medical Center\",\n    \"slgId\": \"1025-11\",\n    \"url\": \"https://mychart.mountainsidemedicalcenter.com/MMC/\"\n  },\n  {\n    \"aliases\": [\n      \"St. Francis\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/66DB8964-598C-40D0-BA93-47E31CA5D65D/f7228f1f91eb24a4cfdb96bcb7baf6dc.png\",\n    \"name\": \"University of Kansas Health System\",\n    \"slgId\": \"1025-12\",\n    \"url\": \"https://mychart.kutopeka.com/ukh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/48B5AA19-0E08-4BD0-906E-9C3DB0070FAD/97db58ee178ef6567c9f0740ff3d9c5b.png\",\n    \"name\": \"Seton Medical Center and Wellstone Health Partners\",\n    \"slgId\": \"1025-13\",\n    \"url\": \"https://mychart.setonharkerheights.net/smc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BCF90258-395C-4E87-8CAD-90FB8D8193AD/bdc88a3803e254c0738ee99d2cf18305.png\",\n    \"name\": \"UT Health East Texas\",\n    \"slgId\": \"1025-14\",\n    \"url\": \"https://mychart.uthealtheasttexas.com/UTHET/\"\n  },\n  {\n    \"aliases\": [\n      \"SCHS\",\n      \"Harney\",\n      \"HDH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5C79CED2-54C9-4A1A-A9C5-8CB8640D5B4A/491a25cbc68dbbbfcacff3f5b0c7b0a1.png\",\n    \"name\": \"St. Charles Health System\",\n    \"slgId\": \"1030\",\n    \"url\": \"https://mychart.stcharleshealthcare.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"NBMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0CF979CB-F955-472C-BB97-4526C28E2763/c3209e221c0571bb1aa1d55c2ff064f4.png\",\n    \"name\": \"Bay Area Hospital\",\n    \"slgId\": \"1030-2\",\n    \"url\": \"https://mychart.bayareahospital.org/BAH/\"\n  },\n  {\n    \"aliases\": [\n      \"NBMC\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E7E6E38B-6577-4AE1-B8E3-7A0CF0F5EAF4/77596848ef0f0ec5bedd4ed2b1bbfe64.png\",\n    \"name\": \"Bay Clinic\",\n    \"slgId\": \"1030-3\",\n    \"url\": \"https://bayclinic.net/Bay-Clinic-pp.html\"\n  },\n  {\n    \"aliases\": [\n      \"NBMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EC06E0E8-E455-4B5C-B6FA-E93EC0DC9252/08bdfe5b49d42070755f11e3af3f934e.png\",\n    \"name\": \"Santiam Hospital\",\n    \"slgId\": \"1030-4\",\n    \"url\": \"https://mychart.santiamhospital.org/Santiam/\"\n  },\n  {\n    \"aliases\": [\n      \"Harney,HDH\",\n      \"Harney\",\n      \"HDH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7D1FE04-326C-4772-871F-80AAE7229DA6/e471aaae3f0b31a4e9afc4af676ced6c.png\",\n    \"name\": \"Harney District Hospital\",\n    \"slgId\": \"1030-5\",\n    \"url\": \"https://mychart.harneydh.com/Harney/\"\n  },\n  {\n    \"aliases\": [\n      \"VIM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5E9A9C67-B9F7-4934-A568-AFC0C53ABD19/0991af772322265dd584d29e481ae6e7.png\",\n    \"name\": \"Volunteers in Medicine Cascades\",\n    \"slgId\": \"1030-6\",\n    \"url\": \"https://mychart.vim-cascades.org/VIM/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/051B89BB-841B-4E13-BC2C-A9D6F6DD3ADC/dad77771a4f44e4c2b804d5eb8b5f9a3.png\",\n    \"name\": \"Bryan Health\",\n    \"slgId\": \"1031\",\n    \"url\": \"https://mychart.bryanhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0FD2F72E-EFA4-4327-999F-FB970DC207B7/900ff851ee6d495294ad770604e678a6.png\",\n    \"name\": \"New Life Clinic\",\n    \"slgId\": \"1031-1\",\n    \"url\": \"https://newlifeclinic.myhealthplace.org/NLC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/663027A0-E89D-45E4-B43C-18AD272F78D4/2cfc0b524342726f35f0b5ad0b482662.png\",\n    \"name\": \"Community Medical Center\",\n    \"slgId\": \"1031-2\",\n    \"url\": \"https://cmcfc.myhealthplace.org/CMC\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/25596E68-43BE-4A36-9835-35DFD7E8B7B2/f7ccd3f0894a36291128995262a55203.png\",\n    \"name\": \"Lincoln Medical Education Partnership\",\n    \"slgId\": \"1031-3\",\n    \"url\": \"https://lmep.myhealthplace.org/LMEP/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5CCB1E8D-BDB3-444B-9DDF-DDFE2769F7B3/febdba4e8d8387b90cbf33a5790b88b1.png\",\n    \"name\": \"Dialysis Center of Lincoln\",\n    \"slgId\": \"1031-4\",\n    \"url\": \"https://dcl-kidneycare.myhealthplace.org/dcl/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/94985280-B4DD-41D3-A246-E5D343F8F74A/51c973ebd97b1c96cd07aa9141001a84.png\",\n    \"name\": \"Enloe Medical Center\",\n    \"slgId\": \"1034\",\n    \"url\": \"https://mychart.enloe.org/MyChart\"\n  },\n  {\n    \"aliases\": [\n      \"SPHP\",\n      \"Muskegon\",\n      \"Hackley\",\n      \"Lakeshore\",\n      \"Johnson\",\n      \"Plymouth\",\n      \"Diley\",\n      \"Ridge\",\n      \"Shelby\",\n      \"Saint\",\n      \"Mary\",\n      \"Grand\",\n      \"Rapids\",\n      \"Hauenstein\",\n      \"Baker\",\n      \"Lacks\",\n      \"Mishawaka\",\n      \"Germantown\",\n      \"Ada\",\n      \"West\",\n      \"Olive\",\n      \"Joe\",\n      \"Bend\",\n      \"Ann\",\n      \"Arbor\",\n      \"St\",\n      \"Joseph\",\n      \"Livingston\",\n      \"Brighton\",\n      \"Howell\",\n      \"Oakland\",\n      \"Pontiac\",\n      \"Chelsea\",\n      \"Livonia\",\n      \"Reichert\",\n      \"Health\",\n      \"Silver\",\n      \"Spring\",\n      \"Albany\",\n      \"IHA\",\n      \"SJMG\",\n      \"Ypsilanti\",\n      \"Carmel\",\n      \"Elite\",\n      \"MCMG\",\n      \"Trinity\",\n      \"Holy\",\n      \"Cross\",\n      \"Detroit\",\n      \"Peter\",\n      \"Mount\",\n      \"Mercy\",\n      \"Agnes\",\n      \"MidAtlantic\",\n      \"Grove\",\n      \"Alphonsus\",\n      \"Nampa\",\n      \"Ontario\",\n      \"Boise\",\n      \"Specialist\",\n      \"Clarkston\",\n      \"Independence\",\n      \"Premier\",\n      \"Samaritan\",\n      \"Sacred\",\n      \"Catholic\",\n      \"Nazareth\",\n      \"Francis\",\n      \"Syracuse\",\n      \"Fresno\",\n      \"THONE\",\n      \"England\",\n      \"Stafford\",\n      \"Sinai\",\n      \"Hartford\",\n      \"Waterbury\",\n      \"Springfield\",\n      \"Iowa\",\n      \"MercyOne\",\n      \"Loyola\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/224B95D1-6016-4C8E-8EF5-776385B8B187/5d57bd9b146eeb6ab4093161e417ef44.png\",\n    \"name\": \"Trinity Health\",\n    \"slgId\": \"1035\",\n    \"url\": \"https://mychart.trinity-health.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1D2C3CC3-96EA-43D6-AB8A-F08D1EB49B89/a1063d825ad00774880b1bcf79dbc101.png\",\n    \"name\": \"Arkansas Children's\",\n    \"slgId\": \"1036\",\n    \"url\": \"https://mychart.archildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C4E1B2F9-8A0B-413B-87BF-EA761CD94DFC/7db1eb23cedd03658e30549b31460e21.png\",\n    \"name\": \"Hot Springs Pediatric Clinic\",\n    \"slgId\": \"1036-2\",\n    \"url\": \"https://mychart.archildrens.org/HotSpringsPediatricClinic/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9E13F600-0859-4D4C-B5FD-AF7099C0BA7B/290eff47042cd0219fe25ef29de48233.png\",\n    \"name\": \"Cook Children's\",\n    \"slgId\": \"1037\",\n    \"url\": \"https://mychart.cookchildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Epic\",\n      \"Beaver Medical Group\",\n      \"Inland Empire & San Diego\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/25243763-094F-47A8-85B5-525A6554D218/44d12ed605176b9d4881be2fa438d4c9.png\",\n    \"name\": \"Optum Medical Care of Inland Empire and San Diego\",\n    \"slgId\": \"1038\",\n    \"url\": \"https://www.mybeaverchart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3CFED9A3-10BF-4CA5-962E-A4B71A24D638/450225700ea69f1b6b22aa6e82b8c486.png\",\n    \"name\": \"VHC Health\",\n    \"slgId\": \"1039\",\n    \"url\": \"https://myvhc.virginiahospitalcenter.com/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4C51A8D9-B5B3-470A-9A8B-675C45DF9877/7888c68c4d75439902c309d3e5e7ecc9.png\",\n    \"name\": \"Acumen Physician Solutions\",\n    \"slgId\": \"1041\",\n    \"url\": \"https://mychart.acumenmd.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"The Brooklyn Hospital Center\",\n      \"TBHC\",\n      \"TBH Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9B16EC7C-FC58-4A43-A784-D124E162F412/7d7c70c5a4a0100488fe3c60fb5eb80d.png\",\n    \"name\": \"Brooklyn Health\",\n    \"slgId\": \"1043\",\n    \"url\": \"https://mychart.tbh.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C1F3AD3B-E298-4840-B7D2-3EFB25BB4123/530cd57184b64b4395909d6a052680e6.png\",\n    \"name\": \"St. Joseph's Healthcare Hamilton\",\n    \"slgId\": \"1045\",\n    \"url\": \"https://mydovetale.ca/MyDovetale/\"\n  },\n  {\n    \"aliases\": [\n      \"Dayton\",\n      \"Ohio\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/16926741-135F-4126-82D5-00BD8EFD165E/0dbfbce4d4e4c32a23318bbfbe14d1e5.png\",\n    \"name\": \"Premise Health\",\n    \"slgId\": \"1052\",\n    \"url\": \"https://www.mypremisehealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/15F7CBF6-8C86-4375-B51F-CDEA5E46462D/7f76b5893d5c91a03bc82639ecad3590.png\",\n    \"name\": \"University College London Hospitals\",\n    \"slgId\": \"1053\",\n    \"url\": \"https://mycare.uclh.nhs.uk/MyCare/\"\n  },\n  {\n    \"aliases\": [\n      \"MW\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E615349D-921C-411A-A6A1-73547A7174E0/95d7c9543f0fa11c4d75c481e684aafe.png\",\n    \"name\": \"Mary Washington\",\n    \"slgId\": \"1055\",\n    \"url\": \"https://mychart.mwhc.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F0573E6-E62E-4E74-BBD7-02FA58B698D8/0aa82e78a2554ed85e0e42a8074fea24.png\",\n    \"name\": \"Columbus Regional Health\",\n    \"slgId\": \"1056\",\n    \"url\": \"https://mychart.crh.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F46A644C-3893-45DF-95AB-CF57467FE0A7/6b65f8b051077a228ee84fe61d631e19.png\",\n    \"name\": \"Molina Healthcare\",\n    \"slgId\": \"1057\",\n    \"url\": \"https://mychart.molinahealthcare.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"CHOMP\",\n      \"Monterey\",\n      \"Peninsula\",\n      \"MMG\",\n      \"CHI\",\n      \"COMMUNITY\",\n      \"INNOVATIONS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F666E02-F9D6-47BA-A477-3A4646024792/599e45d4a0c91e4bdd0138848770e975.png\",\n    \"name\": \"Montage Health\",\n    \"slgId\": \"1058\",\n    \"url\": \"https://mychart.montagehealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"GOSH\",\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E3786FC-A083-4C45-A4E9-B39D9E174A75/b200dddca2b142df04f05b2f957173f1.png\",\n    \"name\": \"Great Ormond Street Hospital\",\n    \"slgId\": \"1059\",\n    \"url\": \"https://my.gosh.nhs.uk/mychart\"\n  },\n  {\n    \"aliases\": [\n      \"The Royal Marsden\",\n      \"The Marsden\",\n      \"Marsden Hospital\",\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E2C06A5F-0E2A-4065-9469-B79B7BE0E3DC/9b3c08417e37df06aea2538b870ca073.png\",\n    \"name\": \"RMH\",\n    \"slgId\": \"1059-1\",\n    \"url\": \"https://mymarsden.rmh.nhs.uk/MyMarsden/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E9EDC1A3-9022-4B17-A86A-A36DF5696970/9c32d443de8a8d92c61d99cbf6bee0bd.png\",\n    \"name\": \"North Mississippi Health Services\",\n    \"slgId\": \"1060\",\n    \"url\": \"https://myconnection.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EBAC404A-A835-4D92-BB0C-688A630F97F9/f4b04ee5b09439201d080bbe181345c0.png\",\n    \"name\": \"Meritus\",\n    \"slgId\": \"1062\",\n    \"url\": \"https://mychart.meritushealth.com/meritus/\"\n  },\n  {\n    \"aliases\": [\n      \"Atlas\",\n      \"GHC\",\n      \"Group Health Centre\",\n      \"TOH\",\n      \"Renfrew\",\n      \"Hawkesbury\",\n      \"Heart\",\n      \"St. Francis\",\n      \"Winchester\",\n      \"Deep River\",\n      \"Kemptville\",\n      \"The Atlas Alliance\",\n      \"Arnprior Regional Health\",\n      \"Deep River & District Health\",\n      \"Glengarry Memorial Hospital\",\n      \"Group Health Centre (Sault Ste. Marie)\",\n      \"Hawkesbury District General Hospital\",\n      \"Kemptville District Hospital\",\n      \"Hôpital Montfort\",\n      \"Mississippi River Health Alliance \",\n      \"Almonte General Hospital\",\n      \"Carleton Place & District Memorial Hospital\",\n      \"Pembroke Regional Hospital\",\n      \"Queensway Carleton Hospital\",\n      \"Renfrew Victoria Hospital\",\n      \"St. Francis Memorial Hospital\",\n      \"The Ottawa Hospital\",\n      \"The Ottawa Hospital Academic Family Health Team\",\n      \"The Royal\",\n      \"The University of Ottawa Heart Institute\",\n      \"Winchester District Memorial Hospital\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/77047401-579A-4300-A96F-EAA8A17105CD/635603672104e9af26d820bf7a33e4ef.png\",\n    \"name\": \"The Ottawa Hospital\",\n    \"slgId\": \"1063\",\n    \"url\": \"https://www.myatlasalliance.ca/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BB20310D-E0EA-4AF0-AA91-1979C7F581CA/572cbbffea071823d2763b484ec8c675.png\",\n    \"name\": \"Community First Medical Center\",\n    \"slgId\": \"1070\",\n    \"url\": \"https://mychart.cfmedicalcenter.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9E1B4481-2F53-4295-9E6B-279BE2A9822D/8af264411a29b323fbe7f469eb785805.png\",\n    \"name\": \"Luzerner Kantonsspital\",\n    \"slgId\": \"1072\",\n    \"url\": \"https://meinluks.ch/mychartprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"EHMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D6CD39C7-036C-49FF-ACD9-5C2E7762C308/555d77af5aa453e06fe077087a552f66.png\",\n    \"name\": \"Englewood\",\n    \"slgId\": \"1073\",\n    \"url\": \"https://mychart.englewoodhealth.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/26871DF8-2BBA-4474-8444-307D0D29310D/9ff354a65b6c10408d9b3cad80d8247f.png\",\n    \"name\": \"Alameda Health System\",\n    \"slgId\": \"1075\",\n    \"url\": \"https://my.alamedahealthsystem.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D6BAA57-FF6B-4088-BC3E-D2ECB48AEB0D/eeb818cdcce7ecc611ddb6be8a66a471.png\",\n    \"name\": \"Cleveland Clinic London\",\n    \"slgId\": \"1076\",\n    \"url\": \"https://mychart.clevelandcliniclondon.uk/prd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D2189D0E-EFCE-4E17-ADC1-4676F4E19784/e5078085ec302a92414cb95385eeb919.png\",\n    \"name\": \"Olmsted Medical Center\",\n    \"slgId\": \"1077\",\n    \"url\": \"https://mychart.olmmed.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Dentist\",\n      \"Dental\",\n      \"Dentistry\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3AF4F7E7-1A7E-46E9-80B9-0BED833AAA66/cf91b426db99c7eaeb8b579c3416ffe7.png\",\n    \"name\": \"Smile Generation MyChart\",\n    \"slgId\": \"1079\",\n    \"url\": \"https://www.smilegenerationmychart.com/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/85CEBD71-5F23-486D-B96D-F40C850CA145/cc71d129036ad2e67d26eba9dc287501.png\",\n    \"name\": \"San Francisco Dept of Public Health\",\n    \"slgId\": \"1082\",\n    \"url\": \"https://mychart.sfdph.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5042050-796F-43BF-9E39-DD1C4A89B519/e0d8e666291dfd0a3ea2eafe76c8bc9d.png\",\n    \"name\": \"UI Health\",\n    \"slgId\": \"1085\",\n    \"url\": \"https://mychart.uillinois.edu/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/53F7AE02-DD80-41DF-944D-999B9687109C/6727528f7b28726a73f8b0d03c266ea6.png\",\n    \"name\": \"Pine Rest\",\n    \"slgId\": \"1086\",\n    \"url\": \"https://mychart.pinerest.org/mychartPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"CFLKS\",\n      \"Central Florida Kidney Specialists\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AE049BE-87DA-41E2-8557-2758CF01DB0B/6130b35a59a307d46db67b0093c244a8.png\",\n    \"name\": \"DaVita Physician Solutions\",\n    \"slgId\": \"1087\",\n    \"url\": \"https://mychart.davitaphysiciansolutions.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F96C0AD0-46B5-49E1-A804-7FDA45CFC728/d6aa50eae6ba38dbc70eebda6b838498.png\",\n    \"name\": \"Alberta Health Services\",\n    \"slgId\": \"1088\",\n    \"url\": \"https://myhealth.alberta.ca/MyHealthRecords\"\n  },\n  {\n    \"aliases\": [\n      \"WCM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3F0700C0-F2D2-4806-A9B7-C9DEF017D036/8de956d62c4cfe42f68ad8fb7b928f3d.png\",\n    \"name\": \"Weill Cornell Medicine\",\n    \"slgId\": \"1089-1\",\n    \"url\": \"https://www.myconnectnyc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NYP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/107E07C9-5D9A-4D2D-85E3-D23F84722720/0a55aca1d9025584feb859f034c6a51e.png\",\n    \"name\": \"New York Presbyterian\",\n    \"slgId\": \"1089-2\",\n    \"url\": \"https://www.myconnectnyc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CUIMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2A2A0217-F474-4CB5-91EB-1ED65F3EF3C8/d809ca0900e0c3c97fa035f33e615038.png\",\n    \"name\": \"Columbia University Irving Medical Center\",\n    \"slgId\": \"1089-3\",\n    \"url\": \"https://www.myconnectnyc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75BCC020-27AE-42DC-B8CB-CD56310D5BBE/bb75c1caa9b7a8af244cc3b56bda5de6.png\",\n    \"name\": \"Cliniques universitaires Saint-Luc\",\n    \"slgId\": \"1090\",\n    \"url\": \"https://mon.saintluc.be/mon\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AA313BD4-13A7-41F1-824F-C5FF8F842020/cef2f60ba0b0f9fdd450182c0810d3d9.png\",\n    \"name\": \"Cape Fear Valley\",\n    \"slgId\": \"1094\",\n    \"url\": \"https://mychart.capefearvalley.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/65093B0C-32EA-43B0-83D5-4AA56AD601C8/246d6170cfbe5d9bbabb6523e28b5ab1.png\",\n    \"name\": \"Kennedy Krieger Institute\",\n    \"slgId\": \"1095\",\n    \"url\": \"https://mychart.kennedykrieger.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6CC5B21F-EE0D-47CB-BD0C-BCC68FD2DD53/b61dd0a1e9b7972943cd5d12f7d61120.png\",\n    \"name\": \"United Regional\",\n    \"slgId\": \"1096\",\n    \"url\": \"https://mychart.unitedregional.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B80C7977-1344-453D-A37C-9262A258F183/c31b180fc7fa025f4851235acb50302a.png\",\n    \"name\": \"Tanner Health System\",\n    \"slgId\": \"1098\",\n    \"url\": \"https://www.tannermychart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/049BB6E0-673B-45DA-9CC6-617CA3810A3C/948a4d24c3802559e2ee3b81d1a9e240.png\",\n    \"name\": \"Valley Children's Hospital\",\n    \"slgId\": \"1100\",\n    \"url\": \"https://mychart.valleychildrens.org/portal/\"\n  },\n  {\n    \"aliases\": [\n      \"MVHS\",\n      \"Wynn\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2F853737-CC25-46ED-9085-86B3F413FA8B/a5b34ad905e34cacb2950cc8d33d6957.png\",\n    \"name\": \"Mohawk Valley Health System\",\n    \"slgId\": \"1103\",\n    \"url\": \"https://mychart.mvhealthsystem.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SDMG\",\n      \"SD\",\n      \"Slocum\",\n      \"Dickson\",\n      \"Slocum Dickson\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/554369CF-51ED-4346-90AB-46E3173673E3/f6ee5701a55eeb61f5109f8b7c9156a3.png\",\n    \"name\": \"Slocum-Dickson Medical Group\",\n    \"slgId\": \"1103-1\",\n    \"url\": \"https://mychart.sdmg.com/sdmg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/09DD5BB0-2676-4384-BCD7-EEA99675DC1D/ea122484c1d9054ad74f2892e2933aa2.png\",\n    \"name\": \"Boulder Community Health\",\n    \"slgId\": \"1105\",\n    \"url\": \"https://my.bch.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BADB8061-127B-4DEA-8C40-DD274C7B9C1A/8058faa46ce0fe7be916569803b718f2.png\",\n    \"name\": \"The Pediatric Center Boulder\",\n    \"slgId\": \"1105-1\",\n    \"url\": \"https://tpcportal.bch.org/MyChartPRD-PEDS/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/53B07B98-855C-4079-AAEE-F431DD757531/8f8f80b19e4a74837a8ec377e1569a32.png\",\n    \"name\": \"Boulder Medical Center\",\n    \"slgId\": \"1105-2\",\n    \"url\": \"https://bmcportal.bch.org/MyChartPRD-BMC/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/601425BC-1E3D-4C3E-8A85-B26D2E977093/4e6410f51517ac6d89c1632088392884.png\",\n    \"name\": \"King Fahad Medical City\",\n    \"slgId\": \"1107\",\n    \"url\": \"https://www.kfmc.med.sa/EN/Pages/Home.aspx\"\n  },\n  {\n    \"aliases\": [\n      \"Helseplattformen\",\n      \"Helsetjenester\",\n      \"HMN\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BD5D4E9E-0F61-4950-AB44-31325D2D0127/d6047f2408b7f3f40fecc22fd7b83825.png\",\n    \"name\": \"Helse Midt-Norge\",\n    \"slgId\": \"1114\",\n    \"url\": \"https://tjenester.helsami.no/HelsaMi/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D72E1AE-0A37-4882-B1A5-FA75474161BB/a5b14e6b5faf7f0d58c82f21e0c49c26.png\",\n    \"name\": \"Trillium Health Partners\",\n    \"slgId\": \"1116\",\n    \"url\": \"https://mychart.thp.ca/MYCHART/\"\n  },\n  {\n    \"aliases\": [\n      \"Dart\",\n      \"Wichita\",\n      \"Domtar\",\n      \"Dow\",\n      \"Greenheck\",\n      \"Harbor\",\n      \"Hillenbrand\",\n      \"Huntington\",\n      \"HII\",\n      \"Kohl\",\n      \"Mayville\",\n      \"MEC\",\n      \"McKee\",\n      \"Miller\",\n      \"Nissin\",\n      \"Rexnord\",\n      \"Reynolds\",\n      \"Rockwell\",\n      \"Safeway\",\n      \"West Bend\",\n      \"WBMI\",\n      \"Tapco\",\n      \"Weldall\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F17D6880-2E7D-4337-839A-37678E54707B/77f91c5480d5cb9a0e089714802fb7fb.png\",\n    \"name\": \"Quadmed\",\n    \"slgId\": \"1121\",\n    \"url\": \"https://mychart.myquadmedical.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"nhs\",\n      \"Royal Devon University Healthcare\",\n      \"Torbay and South Devon\",\n      \"University Hospitals Plymouth\",\n      \"Plymouth\",\n      \"Derriforf Hospital\",\n      \"Exeter\",\n      \"North Devon District\",\n      \"Wonford Hospital\",\n      \"Derriford Hospital\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3674DC60-1F58-4E03-9676-E1F2ECC1EBFE/1b279cb5581578162559fa4be47bebdf.png\",\n    \"name\": \"MY CARE (Devon)\",\n    \"slgId\": \"1122\",\n    \"url\": \"https://mycare.exe.nhs.uk/mycare/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/767EF97E-14ED-4997-A73E-ABE303EAD8A3/bb32f99a75ab1e6c0e1fcd6d3a38a571.png\",\n    \"name\": \"AltaMed\",\n    \"slgId\": \"1123\",\n    \"url\": \"https://www.myaltamed.net/MyAltaMed/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E3C66043-C44F-42DD-A986-2764154B1FCB/3ec396f20daf41798af3ce79373c5277.png\",\n    \"name\": \"Middlesex Health\",\n    \"slgId\": \"1124\",\n    \"url\": \"https://mychart.middlesexhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/98ADA73A-6957-4A3D-8115-DADF53DF90D7/d0d9bb440f0d5d7ed1298b559b8329e2.png\",\n    \"name\": \"Exact Sciences\",\n    \"slgId\": \"1126\",\n    \"url\": \"https://mychart.exactscienceslabs.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"UHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/15951AC9-7B72-4CE5-BEB0-538AB8ABFA43/0ff87ebb250601fac8589d1df66a43b8.png\",\n    \"name\": \"United Health Services\",\n    \"slgId\": \"1127\",\n    \"url\": \"https://mychart.nyuhs.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"UHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CB4100E5-C3CD-47D4-A56D-CAD4644D4F01/26cf697c0e4cfe75121ea8e3094b72cb.png\",\n    \"name\": \"University Health System\",\n    \"slgId\": \"1130\",\n    \"url\": \"https://mychart.universityhealthsystem.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Bayfront Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2627DB95-972F-4389-9E5B-33C7B35F5F33/476732561e24e0cdb828e99c1dca5764.png\",\n    \"name\": \"Orlando Health\",\n    \"slgId\": \"1131\",\n    \"url\": \"https://mychart.orlandohealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/19552AF8-4A2D-472F-90CA-0E5168B0AA6D/09d354a1833cbbf936896a84e81f87da.png\",\n    \"name\": \"Baptist Health\",\n    \"slgId\": \"1131-1\",\n    \"url\": \"https://mychart.baptisthealthal.com/Baptist/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/71054E59-7788-4F4B-AECA-6CFED948FCA4/3415aac4f89cc57cd138fa1738c3c450.png\",\n    \"name\": \"Phelps Health\",\n    \"slgId\": \"1134\",\n    \"url\": \"https://mychart.phelpshealth.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/113896C4-E574-44AB-A4AD-3844CF9709A3/91db14b2c4426d807e23d1e57a860f17.png\",\n    \"name\": \"Evernorth Care Group\",\n    \"slgId\": \"1136\",\n    \"url\": \"https://mychart.cignamedicalgroup.com/Chart/\"\n  },\n  {\n    \"aliases\": [\n      \"My Wellness Center\",\n      \"TheCure\",\n      \"Cirrus\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F17C1137-98DB-44EE-B914-485C8DCAE301/8541c586c414299c91629038593dda44.png\",\n    \"name\": \"Evernorth Workplace Care\",\n    \"slgId\": \"1136-1\",\n    \"url\": \"https://mychart.evernorthworkplacecare.com/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B059F58-ABFC-4BF8-A2E9-B406956B91BA/a86bb760112bb4a405d508b069062695.png\",\n    \"name\": \"Evernorth Home-Based Care\",\n    \"slgId\": \"1136-2\",\n    \"url\": \"https://mychart.alegiscare.com/ChartAC/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Altais Medical Group Riverside\",\n      \" Brown and Toland Physicians\",\n      \"Family Care Specialists Medical Group\",\n      \"Altais Medical Group\",\n      \"Family Care Specialists\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E4C1336B-DCDC-4AF0-9DD6-71823DA87A19/93032dd9bfc98bb93cabad3ee141d77c.png\",\n    \"name\": \"Altais Health Solutions\",\n    \"slgId\": \"1138\",\n    \"url\": \"https://mychart.brownandtoland.com/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E9E8A499-E770-4D73-815D-B84795A1DDD3/5ee22f7d01c4bb814264f704efcf6824.png\",\n    \"name\": \"Catholic Health\",\n    \"slgId\": \"1144\",\n    \"url\": \"https://mychart.chsbuffalo.org/MyChart\"\n  },\n  {\n    \"aliases\": [\n      \"SVMHS\",\n      \"SVH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4E2396AD-C101-4230-910C-A914CB7A4637/536f6ede46d32c693ff574cab2bd4d03.png\",\n    \"name\": \"Salinas Valley Health\",\n    \"slgId\": \"1146\",\n    \"url\": \"https://mychart.svmh.com/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/08B67D45-D6B8-410F-9209-FE32F4AA1089/3afeaaf4c8fd1e9eb7c7c1050468cb77.png\",\n    \"name\": \"Doctors on Duty\",\n    \"slgId\": \"1146-1\",\n    \"url\": \"https://mychart.svmh.com/dod/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"CCN\",\n      \"Central Coast Nephrology\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BFC7CA6B-801F-4C5C-8E41-D049EB2CB879/5e664b5d669edeeb6108c6cbc2760bd0.png\",\n    \"name\": \"Salinas Valley Health Affiliates\",\n    \"slgId\": \"1146-2\",\n    \"url\": \"https://mychart.svmh.com/affiliates/\"\n  },\n  {\n    \"aliases\": [\n      \"SLMG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F6B042E4-1452-460A-8754-50185E2C5A69/cce8657454a9bf37c2c139817e46ecf1.png\",\n    \"name\": \"Santa Lucia Medical Group\",\n    \"slgId\": \"1146-3\",\n    \"url\": \"https://mychart.svmh.com/affiliates/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4A4C088A-5C30-4259-8177-B149A9144BC7/cda572508b2c374bb94b0471a800dbb2.png\",\n    \"name\": \"Johnny Blanchard, MD\",\n    \"slgId\": \"1146-4\",\n    \"url\": \"https://mychart.salinasvalleyhealth.com/affiliates/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/651BCCF3-A563-45C8-B6B5-4FD7737F425A/b2bf674e25012b46c05f1e37aa1d5b98.png\",\n    \"name\": \"Cape Cod Healthcare\",\n    \"slgId\": \"1149\",\n    \"url\": \"https://mychart.capecodhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CEHC\",\n      \"Scarborough Health Network\",\n      \"SHN\",\n      \"Peterborough Regional Health Centre\",\n      \"PRHC\",\n      \"Lakeridge Health\",\n      \"LH\",\n      \"Ross Memorial\",\n      \"RMH\",\n      \"Campbellford Memorial Hospital\",\n      \"CMH\",\n      \"Haliburton Highlands Health Service\",\n      \"HHHS\",\n      \"Northumberland Hills Hospital\",\n      \"NHH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4EF9DB2E-BE4E-4C1A-B167-E5CEA385A2A8/4f33dcb405afb26ee25f0a4ccb0ebade.png\",\n    \"name\": \"Central East Hospital Cluster\",\n    \"slgId\": \"1150\",\n    \"url\": \"https://mychart.ourepic.ca/MyChartPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"armc\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E3A4003F-3CA8-4B75-BC91-41CBD3EB3208/5ac0339d835766a82c9055adf05b3bff.png\",\n    \"name\": \"Arrowhead Regional Medical Center\",\n    \"slgId\": \"1152\",\n    \"url\": \"https://mychart.arrowheadregional.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Urology\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/33A2302B-A69A-4F22-A08F-D45D77809990/58988de05b30158b65dea5abea7ccd2d.png\",\n    \"name\": \"Summit Health\",\n    \"slgId\": \"1153\",\n    \"url\": \"https://mychart.njurology.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E24E83C8-3C7A-4CAB-91FD-1D077185523D/8c6ea7eacaa0f648cb071f0b4f91e0e9.png\",\n    \"name\": \"Planned Parenthood\",\n    \"slgId\": \"1154\",\n    \"url\": \"https://www.myplannedparenthoodchart.org/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [\n      \"University\",\n      \"Kentucky\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A45F73F5-B283-4F8F-891A-8C199464A5F4/7c397a07c1bdad974525d1e9a5829d34.png\",\n    \"name\": \"UK Healthcare\",\n    \"slgId\": \"1155\",\n    \"url\": \"https://mychart.uky.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/936E9C2E-B8B9-4BC4-BDAF-A29A0E5DACF9/0459010045bcf487b61dab3efff96b35.png\",\n    \"name\": \"Rockcastle Regional\",\n    \"slgId\": \"1155-1\",\n    \"url\": \"https://mychart.uky.edu/RockcastleMyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AB2FED51-43CF-4565-A14A-16FFF1A54117/386a17b9ad95b74c53f0b97d098ad795.png\",\n    \"name\": \"Southeast Health\",\n    \"slgId\": \"1156\",\n    \"url\": \"https://mychart.southeasthealth.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F1FF0AD-BC9B-4273-ADA9-9E938E5DDE5A/16db880478a22ecef34fbfb660c28c8a.png\",\n    \"name\": \"RWJBarnabas Health\",\n    \"slgId\": \"1157\",\n    \"url\": \"https://mychart.rwjbh.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/941BE324-66F3-43C0-9F48-67692E0E3BBF/609faa875d3dd2cba10fcd85a8665825.png\",\n    \"name\": \"Saint James Health\",\n    \"slgId\": \"1157-1\",\n    \"url\": \"https://mychart.rwjbh.org/saintjameshealth/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5A449825-200B-4D03-BEBF-7493BD8912B8/fc266e5fd827b6944887f8d11de9dd5a.png\",\n    \"name\": \"Rutgers Health University Behavioral Health Care\",\n    \"slgId\": \"1157-2\",\n    \"url\": \"https://mychart.rwjbh.org/ubhc/\"\n  },\n  {\n    \"aliases\": [\n      \"Community\",\n      \"Care\",\n      \"CUC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B9737BAA-04D6-478D-BC7D-CE0DD8BD57B5/0f917dc7c1483ea7829f5cb6978b4411.png\",\n    \"name\": \"CommUnityCare\",\n    \"slgId\": \"1164\",\n    \"url\": \"https://mychart.communitycaretx.org/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B155FBA-37DE-42EA-9905-9CA888A32F30/74fbd8dc2aec75a5bd8ebb0091fc1016.png\",\n    \"name\": \"Central Health\",\n    \"slgId\": \"1164-1\",\n    \"url\": \"https://mychart.centralhealth.net/CentralHealth/\"\n  },\n  {\n    \"aliases\": [\n      \"Licking\",\n      \"LMH\",\n      \"LMHS\",\n      \"Licking Memorial\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/706E2DDB-B6FC-4978-91CA-659371A4CC1F/1f697e5d7907ae2dbeca9b389abc55d3.png\",\n    \"name\": \"Licking Memorial Health System\",\n    \"slgId\": \"1168\",\n    \"url\": \"https://mychart.lmhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"GVHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C6FD7F9C-921A-4165-B5C0-3BDC454D062F/d77915325af1e94451c728a196d9bff2.png\",\n    \"name\": \"Golden Valley Health Centers\",\n    \"slgId\": \"1170\",\n    \"url\": \"https://mychart.gvhc.org/MyChartPRD/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"NI\",\n      \"HSC\",\n      \"HSCNI\",\n      \"SET\",\n      \"SEHSCT\",\n      \"BHSCT\",\n      \"NHSCT\",\n      \"WHSCT\",\n      \"SHSCT\",\n      \"South Eastern Trust\",\n      \"Belfast Trust\",\n      \"Northern Trust\",\n      \"Southern Trust\",\n      \"Western Trust\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/690AA3D4-93A0-4B69-B405-7A4472E14EA6/889314e7975ef0ede8bc15e0c35cfe7a.png\",\n    \"name\": \"Health and Social Care Northern Ireland\",\n    \"slgId\": \"1175\",\n    \"url\": \"https://mycare.encompass.hscni.net/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"MyUTP\",\n      \" UTP\",\n      \"Houston\",\n      \"University\",\n      \"Texas\",\n      \"HCPC\",\n      \"Harris\",\n      \"County\",\n      \"Psychiatric\",\n      \"UT Physicians\",\n      \"UT Health\",\n      \"UTPhysicians\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9C9518CF-2615-45A3-8A70-7D2C4A397AE0/02436ec0847224f2d673880eeb82a480.png\",\n    \"name\": \"UTHealth Houston\",\n    \"slgId\": \"1178\",\n    \"url\": \"https://MyUTHealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8A7A6C21-A838-4A2A-8BDA-C2131591FC7D/4b6e7c7803d10917b1f33e10473f0810.png\",\n    \"name\": \"Tufts Medicine\",\n    \"slgId\": \"1180\",\n    \"url\": \"https://www.mytuftsmed.org/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"DMEI\",\n      \"DEAN MCGEE\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CD708F45-A873-4755-9D8D-5BD881984052/c9924271b6e130727c969e619626588b.png\",\n    \"name\": \"OU Health\",\n    \"slgId\": \"1181\",\n    \"url\": \"https://mychart.ouhealth.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B02B32A-CB5F-44FA-9C47-C4B949D65E22/fefdd5a8146e6bd92eef597d613234ad.png\",\n    \"name\": \"OrthoCarolina\",\n    \"slgId\": \"1182\",\n    \"url\": \"https://my.orthocarolina.com/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"UHN\",\n      \"TGH\",\n      \"Toronto General Hospital\",\n      \"TWH\",\n      \"Toronto Western Hospital\",\n      \"PMH\",\n      \"Princess Margaret Hospital\",\n      \"TRI\",\n      \"Toronto Rehab Institute\",\n      \"University Centre\",\n      \"UC\",\n      \"Lyndhurst\",\n      \"Rumsey\",\n      \"Bickle\",\n      \"Altum Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B6360A7-ABF1-4B31-93C5-C906FC74AF10/39c5f2fd7461b1f2b3a490dd661f5e76.png\",\n    \"name\": \"University Health Network\",\n    \"slgId\": \"1183\",\n    \"url\": \"https://mychartprd.uhn.ca/mychartprd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/127508E6-0447-4669-B51E-AD9EAF3C0CC6/8465e6c8943c3d244dbc199cdefffcf4.png\",\n    \"name\": \"Arizona Community Physicians\",\n    \"slgId\": \"1186\",\n    \"url\": \"https://mychart.azacp.com/mychartprd/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/05A16420-F690-4434-A23B-29264804CD58/7224c32d2bd84a9e53ffad71eb7d6f6e.png\",\n    \"name\": \"FastMed\",\n    \"slgId\": \"1190\",\n    \"url\": \"https://mychart.fastmed.com/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0A45D1B2-3F3F-4A4F-85A8-E8D861DBB948/4df886ec6d0b2c3888892dbf77476b70.png\",\n    \"name\": \"AvanceCare\",\n    \"slgId\": \"1190-4\",\n    \"url\": \"https://mychart.avancecare.com/Avancecare/\"\n  },\n  {\n    \"aliases\": [\n      \"ULP\",\n      \"UofL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E297D59-55F5-4F40-A4F3-8A929DB161FA/ee785a012f0a270ed5bb9ca6c2279391.png\",\n    \"name\": \"University of Louisville Physicians\",\n    \"slgId\": \"1193\",\n    \"url\": \"https://mychart.uoflhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CC85D943-9FBE-40AA-A985-8E95868905D2/e0ca51ff101d42d8b4a793c58f4a3d23.png\",\n    \"name\": \"AdventHealth\",\n    \"slgId\": \"1194\",\n    \"url\": \"https://account.adventhealth.com/login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/98C25AA4-35C6-40EC-91EC-1A5BF69C0D45/43638628ee3c21de033254083e8df028.png\",\n    \"name\": \"Florida Advanced Gastroenterology Center\",\n    \"slgId\": \"1194-7\",\n    \"url\": \"https://mychart.adventhealth.com/shepherdshope/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F2A55EDD-9C86-4946-AEC6-C8BC484765A8/1ae577e91e0b278f678edc5be920ab42.png\",\n    \"name\": \"Shepherd's Hope\",\n    \"slgId\": \"1194-8\",\n    \"url\": \"https://mychart.adventhealth.com/shepherdshope/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8EA7F1B9-BB68-4C6A-8D7B-1C63E92D5A61/83266b9c2de5dda1120ab8d6aafbe4fa.png\",\n    \"name\": \"Grace Medical Home\",\n    \"slgId\": \"1194-9\",\n    \"url\": \"https://mychart.adventhealth.com/gracemedical/\"\n  },\n  {\n    \"aliases\": [\n      \"IBJI\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5AEFF82B-A7DF-419D-B670-7EC06D4EE737/2e61bdf22297d9949b2e2c6d1e30af9a.png\",\n    \"name\": \"Illinois Bone & Joint Institute\",\n    \"slgId\": \"1195\",\n    \"url\": \"https://mychart.ibji.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AAB04E1C-171D-4D5F-90B5-A6BD85C3B3EB/772bec42bd61d988568616d7e8271e38.png\",\n    \"name\": \"Hoag Memorial Hospital Presbyterian\",\n    \"slgId\": \"1197\",\n    \"url\": \"https://www.hoagconnect.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D38AC1AA-A175-47EB-B689-34B48BC86E4F/86889000d1398a8c6f1489cca563ce91.png\",\n    \"name\": \"Insel Gruppe\",\n    \"slgId\": \"1199\",\n    \"url\": \"https://myinsel.insel.ch/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7A274B6D-2E95-4BE1-9169-DE97F49CC8AD/45000712b28f1316f3238d05d465d96b.png\",\n    \"name\": \"VCU Health\",\n    \"slgId\": \"1200\",\n    \"url\": \"https://mychart.vcuhealth.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"MFT\",\n      \"NHS\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0E72A436-25BF-41B0-A5E3-BE4C37A51D98/e3a2d66647081cabb81d74f86aaff44d.png\",\n    \"name\": \"Manchester Foundation Trust\",\n    \"slgId\": \"1203\",\n    \"url\": \"https://my.mft.nhs.uk/MyMFT/\"\n  },\n  {\n    \"aliases\": [\n      \"Deaconess\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D1592944-2F90-461E-BD2E-5A7A2A8A2280/343e11af0a61137c257f0f6b8b9d2074.png\",\n    \"name\": \"Memorial Hospital and Healthcare Center\",\n    \"slgId\": \"1204\",\n    \"url\": \"https://mychart.mhhcc.org/MyChartPRD\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C9B49438-D822-4E1C-805A-6C1BC028AD03/8721cda77555adde4d37fe96018ccb86.png\",\n    \"name\": \"Baptist Health - Northeast Florida\",\n    \"slgId\": \"1206\",\n    \"url\": \"https://my.baptistchart.com/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5177420A-83D9-49D8-B854-D69E319220D3/8799e767929fa6fcc1e5e96c6991266c.png\",\n    \"name\": \"Men's Mental Health\",\n    \"slgId\": \"1206-1\",\n    \"url\": \"https://mensmentalhealthservices.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"directoryUrl\": \"https://www.floridalungclinic.com/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1BAC3F22-56F9-4095-B86A-F43F1E583F38/ce838180dddb8a2e312dfc16cc82988c.png\",\n    \"name\": \"Jacksonville Lung Clinic\",\n    \"slgId\": \"1206-2\",\n    \"url\": \"https://my.baptistchart.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/05F40EF7-4771-4B03-9794-47CD294F7109/b1996afa66221604fe72fe0e2dd38539.png\",\n    \"name\": \"Emory Healthcare\",\n    \"slgId\": \"1208\",\n    \"url\": \"https://mychart.emoryhealthcare.org/MyChart-prd/\"\n  },\n  {\n    \"aliases\": [\n      \"Canberra\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0375D893-E2A0-44BA-A546-55AE93CD05EE/021db640d92dcab0f7f0c8b7904f6b62.png\",\n    \"name\": \"ACT Health\",\n    \"slgId\": \"1211\",\n    \"url\": \"https://www.mydhr.act.gov.au/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D090E776-C5CF-4DB6-91A6-7B913584C21C/6a1049130d6b48a2e8b7197765acb118.png\",\n    \"name\": \"King's College Hospital\",\n    \"slgId\": \"1212-1\",\n    \"url\": \"https://mychart.kch.nhs.uk/KCH/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/34A6C107-9B0E-4D00-8071-44E5D18AC6DF/8d6937438bcbd09542ad94b6e8fd4f30.png\",\n    \"name\": \"Guy's and St Thomas'\",\n    \"slgId\": \"1212-2\",\n    \"url\": \"https://mychart.gstt.nhs.uk/GSTT/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"NHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F32ECCE8-3D9C-4578-B0B6-233BF9C84245/fb49b4a9e025d592bd24cb6f2e33fe87.png\",\n    \"name\": \"Frimley Health Foundation NHS Trust\",\n    \"slgId\": \"1214\",\n    \"url\": \"https://myfrimleyhealthrecord.fhft.nhs.uk/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7526BFD6-6BE1-4A53-B435-5AB7329A1B00/19de522fb8e24393f8c2f7df0af6014c.png\",\n    \"name\": \"Reid Health\",\n    \"slgId\": \"1220\",\n    \"url\": \"https://myreidhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MCN\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3FD89B98-3959-4F5C-BF3B-70F1B85B0ABF/de43be67a4d4c0c7b828c571e2a2fef2.png\",\n    \"name\": \"Muscogee Creek Nation\",\n    \"slgId\": \"1221\",\n    \"url\": \"https://mychart.creekhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/787F96F2-DE94-4D1E-ACA0-B7EB9C129B6B/7b0fc6c208a9e59c46d6d56fefa5a8cb.png\",\n    \"name\": \"Osage Nation Health System\",\n    \"slgId\": \"1221-1\",\n    \"url\": \"https://mychart.osagehealth.org/Osage/\"\n  },\n  {\n    \"aliases\": [\n      \"MFA\",\n      \"George Washington Medical Faculty Associates\",\n      \"GW\",\n      \"Medical Faculty Associates\",\n      \"CMG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/695D75A8-C662-4184-9BDC-3D7693B6EC3B/7ffcf7d30d47f808ca2ca2168b7ba228.png\",\n    \"name\": \"Capital Medical Group\",\n    \"slgId\": \"1222\",\n    \"url\": \"https://mychart.gwdocs.com/MyChart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C0200738-F8E0-4A98-886A-6042621484A5/576e7ebe9e5432864c0f8048b9601fd0.png\",\n    \"name\": \"Pikeville Medical Center\",\n    \"slgId\": \"1225\",\n    \"url\": \"https://mychart.pikevillehospital.org/MyChart\"\n  },\n  {\n    \"aliases\": [\n      \"Health Alliance\",\n      \"Simplete\",\n      \"OSF MedAvantage\",\n      \"FirstCarolina\",\n      \"FirstMedicare\",\n      \"New Hanover\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/884D56AC-3BC0-4E4C-A28E-4FBEFA4E1837/a7505319c6405319fec9b2a35e28cb55.png\",\n    \"name\": \"Hally\",\n    \"slgId\": \"1228\",\n    \"url\": \"https://mychart.hally.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NCH\",\n      \"Naples Comprehensive Health\",\n      \"Naples\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/726A1428-09CE-4E3E-A603-8018A72AB297/8f17cccf63b80480a28f2a004ef20398.png\",\n    \"name\": \"NCH Healthcare System\",\n    \"slgId\": \"1233\",\n    \"url\": \"https://www.mychart-nchmd.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/402C29DE-774D-467F-A414-636F173262F4/f81c4170e383356ddfb552777b5759a4.png\",\n    \"name\": \"Integris Physician Group\",\n    \"slgId\": \"1233-2\",\n    \"url\": \"https://mychart-cc-ipg-nchmd.org/mychart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/45F9CB14-F48B-4325-8A26-D673F1BF33A9/00835d2dc677a63f9e8758cc8ced9406.png\",\n    \"name\": \"Upwell Primary Care\",\n    \"slgId\": \"1233-3\",\n    \"url\": \"https://mychart-cc-sghu-nchmd.org/mychart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7807AEFD-A099-4910-966A-9E4287C34881/bf039b1e096c755b36ea1a3a9257c8cb.png\",\n    \"name\": \"Infectious Disease Associates of Naples\",\n    \"slgId\": \"1233-4\",\n    \"url\": \"https://mychart-cc-ida-nchmd.org/mychart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5683FEAA-589A-47E3-8D8D-31F5F5A76A38/480a23ef3e21d3da220067725ff4f1c5.png\",\n    \"name\": \"BioSpine Institute\",\n    \"slgId\": \"1233-5\",\n    \"url\": \"https://mychart-cc-bsh-nchmd.org/mychart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0440E6F4-A2CD-4D82-B75D-8CEB85CEDF44/1a83dfa648836eed6c459bddeb62cb56.png\",\n    \"name\": \"Winmind Behavioral Health & Addiction Medicine\",\n    \"slgId\": \"1233-6\",\n    \"url\": \"https://mychart-cc-sghw-nchmd.org/mychart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/308F59AA-45E7-4185-A7CB-83AAC5BB1760/504cbc6546a8ea766f09c3a2e4fd304e.png\",\n    \"name\": \"Naples Concierge Cardiology and Internal Medicine\",\n    \"slgId\": \"1233-8\",\n    \"url\": \"https://mychart-cc-ncc-nchmd.org/MyChart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/89096E9C-B017-4341-9B58-C42FA11A9F7F/1e7960b3ee216528293f9cbedd5bc303.png\",\n    \"name\": \"EverWell Precision Health\",\n    \"slgId\": \"1233-9\",\n    \"url\": \"https://mychart-cc-ewp-nchmd.org/MyChart-cc-nchmd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3A990C86-2529-4C6E-8F27-DD5F13935EF1/28942f9bd7cfa51a00d12bde29bd8c8b.png\",\n    \"name\": \"St. Jude\",\n    \"slgId\": \"1234\",\n    \"url\": \"https://mychart.stjude.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5EACDF3B-2666-4B19-B58B-906DEDE4E7F2/55880d62089d39491cd661144a9d85cd.png\",\n    \"name\": \"Self Regional\",\n    \"slgId\": \"1235\",\n    \"url\": \"https://mychart.selfregional.org/MySRH/\"\n  },\n  {\n    \"aliases\": [\n      \"amstelland\",\n      \"ZHA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/72622A05-601E-4338-A305-D6B704DFBF49/521fa90a1dbedbd056067e6f1dcf4316.png\",\n    \"name\": \"Ziekenhuis Amstelland Directory\",\n    \"slgId\": \"1236\",\n    \"url\": \"https://mijnzha.ziekenhuisamstelland.nl/MyChart-ZHAPRD/\"\n  },\n  {\n    \"aliases\": [\n      \"Health On Broadway\",\n      \"Health On Tucson\",\n      \"Health On University\",\n      \"St. Elizabeth Health Center\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/511B9B46-A6C2-4879-B366-B6AF1D8AD059/9253f22708bc9040f78199810dc2eca2.png\",\n    \"name\": \"El Rio Health\",\n    \"slgId\": \"1240\",\n    \"url\": \"https://elriomychart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3ED4A7D7-0782-4743-A1BD-DF6831B8F04C/81f3d34cf6066cd47cce42e8c9902a26.png\",\n    \"name\": \"West Tennessee Healthcare\",\n    \"slgId\": \"1243\",\n    \"url\": \"https://mychart.wth.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"UT\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/260AD984-F297-4E1B-BD77-7DC1F865D436/924c4a1069997bab58739edbdaa9e599.png\",\n    \"name\": \"University of Toledo\",\n    \"slgId\": \"1245\",\n    \"url\": \"https://mychart.utoledo.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/41B1C806-9EA7-43A4-9D24-36A3004923B0/53e9caa411feeade6ec271eaa150315a.png\",\n    \"name\": \"Children's of Alabama\",\n    \"slgId\": \"1246\",\n    \"url\": \"https://mychart.childrensal.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7F45E59E-C30E-40E4-8868-EA76EF175B5A/2d68533d91b5bb0bd075b5896d80955c.png\",\n    \"name\": \"Bozeman Health\",\n    \"slgId\": \"1252\",\n    \"url\": \"https://mychart.bozemanhealth.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BED21DD1-A7E8-4763-A502-34429BACCE84/682cda0771b335be222f4c59a9f65bd5.png\",\n    \"name\": \"Community Health Partners\",\n    \"slgId\": \"1252-1\",\n    \"url\": \"https://mc.bh.bozemanhealth.org/CHPMyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7ACB281B-3875-4FDD-8A0F-90B6A58941F2/ec84296564bcd9a327fca38a507a3f7a.png\",\n    \"name\": \"Chickasaw Nation Health\",\n    \"slgId\": \"1253\",\n    \"url\": \"https://mychart.chickasawnationhealth.net/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6338E8AF-E486-444B-98E3-B195B1AF09AD/326b4af8e79bd213f9babaf66f5c5235.png\",\n    \"name\": \"Aspen Valley Health\",\n    \"slgId\": \"1254\",\n    \"url\": \"https://mychart.aspenvalleyhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CHI\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/46EBFAE9-F6FD-4FBB-BD71-85CA6A1BBEB9/9a98c7ba4349b414408b6aefa20eee36.png\",\n    \"name\": \"Community Health of South Florida\",\n    \"slgId\": \"1256-1\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B873017B-03C2-4E23-A9C4-9B92ED267ACF/7e7f1afbd08b5e8be4b05c0c5f469c62.png\",\n    \"name\": \"Evara Health\",\n    \"slgId\": \"1256-2\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"JTCHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D595F7FD-8B65-401F-B0D8-711517017DF4/0d8bf3c56ee7ea706e6f3d2d1717cc8f.png\",\n    \"name\": \"Jessie Trice Community Health System\",\n    \"slgId\": \"1256-3\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MBCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E11D833-1CBB-486A-B6BA-B9922DD1166D/1e1f46b69027276cc747a17e15a37bdc.png\",\n    \"name\": \"Miami Beach Community Health Center\",\n    \"slgId\": \"1256-4\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TFHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7AA022C-2691-4DC5-913B-2A557B08AD8A/f52f867c7e39adad6a25c8c6e7892925.png\",\n    \"name\": \"Tampa Family Health Centers\",\n    \"slgId\": \"1256-5\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"BCOM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/20DD93D8-EC30-4FF3-B2F3-CF3B73A21581/d84628bc85ad7ef51caa931bfa07189a.png\",\n    \"name\": \"Broward Community and Family Health Centers\",\n    \"slgId\": \"1256-6\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CHCL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/510843B9-D5B5-4A8F-A827-B25D0DB600C2/7b11b7fd377b95e7d2c23532b3376bdc.png\",\n    \"name\": \"Community Health Center of Lubbock\",\n    \"slgId\": \"1256-7\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CWH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/13C6E5CB-E8E3-4246-8231-5D5E94052B74/16eb024d6a1754e77cb7e9db93b66e0a.png\",\n    \"name\": \"CommWell Health\",\n    \"slgId\": \"1256-8\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"FCHSTL\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0531DFBA-2793-4B8A-A1AF-44BA65F8458B/bf0250e2eee4543db71c73d6d56aac80.png\",\n    \"name\": \"Family Care Health Centers of St. Louis\",\n    \"slgId\": \"1256-9\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"FNDCR\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/75B7894B-883A-4AC4-BDED-5CD6A878A0E9/d0692ad265481d5aae9910e3b3fc5578.png\",\n    \"name\": \"FoundCare\",\n    \"slgId\": \"1256-10\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LCFHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F894984-4F44-4775-8392-103D10E390F4/54a214fb288acdc3d5b3e70b1f7d020a.png\",\n    \"name\": \"La Casa Family Health Centers\",\n    \"slgId\": \"1256-11\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OBFH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/04AC8535-1B9F-45D8-860B-4ECF6BD30125/5e8623df03218fe417d6fba9faeeb933.png\",\n    \"name\": \"Orange Blossom Family Health\",\n    \"slgId\": \"1256-12\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B31C6EE9-24BE-454E-818A-B4C02C454814/a3a9aeaa6ef9d26b0b0c0071a49c674b.png\",\n    \"name\": \"CareArc\",\n    \"slgId\": \"1256-13\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"HICHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/89E35EF7-B46A-4390-8B2D-23F26635A606/7505aae79f269378a8e29497cc597209.png\",\n    \"name\": \"Hawaii Island Community Health Center\",\n    \"slgId\": \"1256-14\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"PCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CF8FA0E7-7E61-473A-9A71-CB491B29441A/a551e16f961658efc6bf28a142b587a7.png\",\n    \"name\": \"Providence Community Health Centers\",\n    \"slgId\": \"1256-15\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CAM\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A7A9A76B-BE6C-44FD-A8AD-F94A381B4154/87fdd1d0dcf08ea977e66f2e7bd07be4.png\",\n    \"name\": \"Camillus Health Concern\",\n    \"slgId\": \"1256-16\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"EUCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3F312342-838C-43EA-B343-0A46E98A6858/2dccc2ad2c463f70101dce7c925d7979.png\",\n    \"name\": \"Empower U\",\n    \"slgId\": \"1256-17\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/941B7185-0543-4A8C-A100-8BDB28DE1724/6a90446d0b3156e63b09d7c006bdb4eb.png\",\n    \"name\": \"NeoMed Center\",\n    \"slgId\": \"1256-18\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"LCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8CD89AAF-6694-448B-BF93-FE358D667685/ae128c26790ad7f6ae26de2d7520a8d3.png\",\n    \"name\": \"Legacy Community Health\",\n    \"slgId\": \"1256-19\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"PCHG\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DA993771-F0AC-46E2-B924-553535E8E482/6814aa5ae065867fe94242cf8573c959.png\",\n    \"name\": \"Premier Community HealthCare\",\n    \"slgId\": \"1256-20\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"GCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5BFB639E-1AD8-4B51-B713-FBAB849993C0/16a4e2c42872812e92d0b1f00ef8cc57.png\",\n    \"name\": \"Genesis Community Health\",\n    \"slgId\": \"1256-21\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7ED585C7-C536-43A3-8EEB-C3B54867B134/b7325a79ae72b7d20268386cd2071828.png\",\n    \"name\": \"Malama I Ke Ola Health Center\",\n    \"slgId\": \"1256-22\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TCCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/86F6A51B-710A-433E-9B0C-562C48D65CA8/c75fd1edf8439bab63d7d0a7dbf5b037.png\",\n    \"name\": \"Treasure Coast Community Health\",\n    \"slgId\": \"1256-23\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MCHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6EB303B3-BA81-4957-9AE7-C66EFF3AF61A/8988eb69bcbb24a583a917f51f9fdf8c.png\",\n    \"name\": \"Med Centro\",\n    \"slgId\": \"1256-24\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"FCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6FDE0587-E2B1-44A6-84B4-9C41A9198D36/c3c55c8590ba464d1e22848a39770bf1.png\",\n    \"name\": \"Florida Community Health Centers\",\n    \"slgId\": \"1256-25\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"THC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8A87ECE2-A66B-4AE5-BDCD-1386B304056C/f29b0fc874315e603cc4f255d29757f9.png\",\n    \"name\": \"True Health\",\n    \"slgId\": \"1256-26\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"PHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/697E10C2-698C-4D61-9699-A9BFBD84DBD7/1714748850174a49c4af7288f96f962e.png\",\n    \"name\": \"Partnership Health Center\",\n    \"slgId\": \"1256-27\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"BAHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/51851463-1745-4256-92C0-FFD61DFA946F/5c8a3d4cfc3fe574dcb7d05e4dbdcbb0.png\",\n    \"name\": \"Ben Archer Health Center\",\n    \"slgId\": \"1256-28\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"HCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B364EFC0-0F5D-4AE6-AB88-0437AE2D8606/5eaa27de834b5948f184c50951b58a80.png\",\n    \"name\": \"Homestead Community Health Center\",\n    \"slgId\": \"1256-29\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"DHCS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B43073F-2B17-4A17-A92D-08BEB266823A/17a9800232d7735eda03f6fadc20e5a5.png\",\n    \"name\": \"District Health Care Services\",\n    \"slgId\": \"1256-30\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"HCDPBC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1882D2BD-C452-4FF6-A008-6AFD49ECBD1C/a46d72fe4c85871d58189e3d1b19e9dd.png\",\n    \"name\": \"Health Care District of Palm Beach County\",\n    \"slgId\": \"1256-31\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CFHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B6789E46-E667-4836-9A2C-2C39D2EF093C/e13974812eb269107513a64b1bb47e6b.png\",\n    \"name\": \"Chicago Family Health Center\",\n    \"slgId\": \"1256-32\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TCAH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2A685D17-B17B-42B4-8CD6-382FA85DF776/01944c57022b18ce5af7af9535271e6b.png\",\n    \"name\": \"TCA Health\",\n    \"slgId\": \"1256-33\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DAF7DDC8-AA3E-4DE1-8635-BA206ED9C2DD/2e919721a6f617014270c4d5bca3a22f.png\",\n    \"name\": \"Christian Community Health Center\",\n    \"slgId\": \"1256-34\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"FCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/848D546D-6F43-45AD-8D0C-DC0A45ADD924/9f83cbe79bc7781300318e81b27c4b83.png\",\n    \"name\": \"Family Christian Health Center\",\n    \"slgId\": \"1256-35\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"BCFWC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A3536A2F-788C-4E5B-AF3E-0A15F15ABF9E/f8aba643060a029f8687adc71d5ee266.png\",\n    \"name\": \"Beloved Community Family Wellness Center\",\n    \"slgId\": \"1256-36\",\n    \"url\": \"https://mychart.hcnetwork.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ABDB6072-60C5-470B-82E1-B67F54E9C1E3/a7765b01ffd22ecfab6a93c68b0ff4bb.png\",\n    \"name\": \"Lakeland Regional Health\",\n    \"slgId\": \"1257\",\n    \"url\": \"https://mychart.mylrh.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/92891993-135D-4EE0-86F6-4FD4E6C374A2/2dc5b53064b00182295070e5ede71ac6.png\",\n    \"name\": \"University Hospitals Cleveland\",\n    \"slgId\": \"1258\",\n    \"url\": \"https://mychart.uhhospitals.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Florence Nephrology Associates\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/139A5FC8-8ECA-418D-BC96-1AB23F936DEB/fac7861c9ec6e92549fd8cbe29602125.png\",\n    \"name\": \"McLeod Health\",\n    \"slgId\": \"1267\",\n    \"url\": \"https://www.mcleodmychart.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/698F813F-5655-4091-B6BD-C3B3644F3D34/3c32139bd6e74b02c0d9f845c78d6641.png\",\n    \"name\": \"Valley Health Plan\",\n    \"slgId\": \"1268\",\n    \"url\": \"https://vhpconnect.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/16FE68FA-CAC3-4FBD-9A5C-C3FBA5EF1451/e942eae2e91aa29be6461ea4cc614de2.png\",\n    \"name\": \"EvergreenHealth\",\n    \"slgId\": \"1270\",\n    \"url\": \"https://mychart.evergreenhealth.com/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C3D54A75-CAB9-443A-9A61-2E54F678560B/c3a31cc437d7560af72ab9108a807cbb.png\",\n    \"name\": \"Mosaic Life Care\",\n    \"slgId\": \"1274\",\n    \"url\": \"https://mychart.mymlc.com/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D368C663-E245-41D7-A308-C4828F33D2EE/e1cc66085ea6094b44e70320525fd81a.png\",\n    \"name\": \"InnovAge\",\n    \"slgId\": \"1276\",\n    \"url\": \"https://mychart.innovage.com/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4EACF4AD-DEEA-49E2-B0B8-CF38866F18F8/34e144f86d39ca2884d186d3af5e1033.png\",\n    \"name\": \"Valley Health\",\n    \"slgId\": \"1277\",\n    \"url\": \"https://mychart.valleyhealth.org/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/865CB55A-478E-4E4C-91D4-9EBF8BCFCE58/05ce9742cd8b27a9056f6b75e0540e38.png\",\n    \"name\": \"Shriner's Childrens\",\n    \"slgId\": \"1283\",\n    \"url\": \"https://mychart.shrinerschildrens.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/021A1CD5-BCE6-4939-96E1-9B9013710A2E/239042a846ec99b4a2eec35da6bd2b98.png\",\n    \"name\": \"KeyCare\",\n    \"slgId\": \"1284\",\n    \"url\": \"https://mychart.keycare.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5C63E782-9C41-414C-8B0B-2BF3C3E6FA96/a76872ecbeac67837de32a509268d7ea.png\",\n    \"name\": \"Array\",\n    \"slgId\": \"1284-1\",\n    \"url\": \"https://mychart.arraybc.com/Array/\"\n  },\n  {\n    \"aliases\": [\n      \"Northern Ohio Medical Specialists\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C5A76E45-46D5-420E-805A-54AF83C83761/038549ab80ded0c575c7a76588aab7e4.png\",\n    \"name\": \"NOMS\",\n    \"slgId\": \"1285\",\n    \"url\": \"https://mychart.nomshealthcare.com/MyChart-Prod/\"\n  },\n  {\n    \"aliases\": [\n      \"BCBSLA\",\n      \"LABLUE\",\n      \"LA Blue\",\n      \"Blue Cross Louisiana\",\n      \"MYLABlue\",\n      \"Blue Cross LA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F21AFA3E-883D-43DE-9F08-CF8DA1438EE9/a6ef5d249fb450868208d55c4d5b3a80.png\",\n    \"name\": \"Louisiana Blue\",\n    \"slgId\": \"1288\",\n    \"url\": \"https://my.lablue.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/704A0B3A-5A34-4A99-8DBB-0029493CF39B/9269986f82a8a3a70f3189ff1b4807ea.png\",\n    \"name\": \"Summa Health\",\n    \"slgId\": \"1289\",\n    \"url\": \"https://mychart.summahealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/960A00A7-E39F-4029-8206-EDBA60720EE7/35f7958841e864858f159e6f7c8488f6.png\",\n    \"name\": \"Charles River Community Health\",\n    \"slgId\": \"1290-1\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2659C5F0-C68C-4351-80DF-D961653C8133/46f0f7e86fa2824a229637d62fcbac1c.png\",\n    \"name\": \"Brockton Neighborhood Health Center\",\n    \"slgId\": \"1290-2\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E1A557E5-7AA1-4ABC-9D9C-A4CF728F9049/d00648e812aca98917b88eb18f260477.png\",\n    \"name\": \"Duffy Health Center\",\n    \"slgId\": \"1290-3\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/26B5A533-C7DC-4D4A-A505-2203636DBBA4/6792edfb6f722d3a462adf2554579f1c.png\",\n    \"name\": \"Fenway Health\",\n    \"slgId\": \"1290-4\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D4FA60DF-4145-4362-8A47-07733F18C2EB/4cc17c90f8e76e504540dff3268c39d6.png\",\n    \"name\": \"Community Health Center of Franklin County\",\n    \"slgId\": \"1290-5\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FC9C2C2A-CF30-40E5-AA80-71DCFE9662B0/2322045abd983a490cfe7b9af6f18a1e.png\",\n    \"name\": \"New Bedford Community Health\",\n    \"slgId\": \"1290-6\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/36031890-FB4A-4A19-821C-E71D4A7773A9/5b4518b3f8dfa652fddc50eccd1dda97.png\",\n    \"name\": \"Health First Family Care Center\",\n    \"slgId\": \"1290-7\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FAE608F3-BEFC-40D3-9697-83F1721B7374/154ea076ec0eef8af0269d41052b651c.png\",\n    \"name\": \"Hilltown Community Health Center\",\n    \"slgId\": \"1290-8\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/99FF2FCF-EF44-4788-A5F1-6641708DD8A6/229b3b8ad47024ba1a31c35ed765b1c1.png\",\n    \"name\": \"Holyoke Health\",\n    \"slgId\": \"1290-9\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D711D6B0-057F-4772-98A0-D3906A21B7D8/9918f3e71a5bbc8ba37f75a35e8c319e.png\",\n    \"name\": \"Island Health Care\",\n    \"slgId\": \"1290-10\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0798C82E-98EF-4DD6-B154-1EA7EDD80297/1454b218ebb4ac4e20100f5559ca8211.png\",\n    \"name\": \"Lowell Community Health Center\",\n    \"slgId\": \"1290-11\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CD2B6BF8-208B-427E-A2B9-DF3323D14C15/ade04e6b876f287324565311b9189cd9.png\",\n    \"name\": \"North Shore Community Health\",\n    \"slgId\": \"1290-12\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E4F38C0D-3797-444A-AAE0-85ED9D90CA0C/f2dd243140e4af2a57c11cdc17127ebf.png\",\n    \"name\": \"Family Health Center of Worcester\",\n    \"slgId\": \"1290-13\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/00A5D920-0EC2-4AF3-8C64-DF4DB97D10FC/559aed467ca0a57170d11282ab846b54.png\",\n    \"name\": \"High Country Community Health\",\n    \"slgId\": \"1290-14\",\n    \"url\": \"https://mychartepic.c3ctc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0C6D582E-0783-4631-A2EF-724C6082FE19/b9f376868e52408902c57829a7667f50.png\",\n    \"name\": \"Oregon Medical Group\",\n    \"slgId\": \"1292\",\n    \"url\": \"https://epicpnwmychart.optum.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OptumCare\",\n      \"Midwest\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/40DB1D0C-A64C-487E-A8DE-E5A08A8BEA0D/f4616dc8b91484820a9566dc304c5ef9.png\",\n    \"name\": \"Optum Mountain West\",\n    \"slgId\": \"1292-1\",\n    \"url\": \"https://epicpnwmychart.optum.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Optum,SMA\",\n      \"Optum\",\n      \"SMA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EE31B0D9-F646-4C4F-B67F-F9FBB8B5474E/83487a93675d7de109b0ba0c2e76330a.png\",\n    \"name\": \"Southwest Medical\",\n    \"slgId\": \"1292-2\",\n    \"url\": \"https://epicpnwmychart.optum.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"OCCA\",\n      \"LA\",\n      \"OC\",\n      \"OCLA\",\n      \"Optum California\",\n      \"Los Angeles & Orange County\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EBC1365B-C229-4A1F-9BA9-9293A500809B/f50476f0fa9490e3395284764dc591d5.png\",\n    \"name\": \"Optum Medical Care of Los Angeles and Orange County\",\n    \"slgId\": \"1292-3\",\n    \"url\": \"https://epicpnwmychart.optum.com/MyChartCALI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8B52AFDB-EF84-4357-9809-51021E9DC768/f249145d347b7716779183523a0d758a.png\",\n    \"name\": \"Duly Health and Care\",\n    \"slgId\": \"1296\",\n    \"url\": \"https://mychart.dupagemedicalgroup.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1F54615D-A983-4BBC-B4A5-0F262908FAE8/bc725500a0f161122f647a50c62f39ea.png\",\n    \"name\": \"Albany Med Health System\",\n    \"slgId\": \"1299\",\n    \"url\": \"https://mychart.albanymed.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C1882AA3-CAF0-4E2A-90D6-381D5AD41BB8/db2f5191e58bab2aa9fee4c1aeb56a9c.png\",\n    \"name\": \"Ohio Department of Behavioral Health\",\n    \"slgId\": \"1316\",\n    \"url\": \"https://mychart.dbh.ohio.gov/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/092D168A-DF54-44FD-86A1-64ACD9568015/98e13510f35dabd201340e8a70164fee.png\",\n    \"name\": \"Central Ohio Primary Care Physicians\",\n    \"slgId\": \"1318\",\n    \"url\": \"https://mychart.copcp.com/mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"Winchester\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F9B7FB6D-98AA-499D-B783-D64FB080DECF/d08cda39ed050a25d8a730ee400c9c6f.png\",\n    \"name\": \"Valley Health System\",\n    \"slgId\": \"1320\",\n    \"url\": \"https://mychart.valleyhealthlink.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B12E70A1-40AD-4C09-82CC-9A68A3E755BC/0a3c4b6d420c2af4844533e4ae87920e.png\",\n    \"name\": \"Family Care Network\",\n    \"slgId\": \"1323\",\n    \"url\": \"https://mychart.fcn.net/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SBH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/18CDFEE6-CD6C-4E05-8E66-8483332086A4/70452ae530a08258571f28389b468adb.png\",\n    \"name\": \"St. Barnabas Health\",\n    \"slgId\": \"1324\",\n    \"url\": \"https://sbhmychart.barnabas.network/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C72E5CF4-A3AD-49ED-9770-B1A23DC0548C/ed66ad2b7a6e0b00255fd8f10bd2fa1b.png\",\n    \"name\": \"Memorial Hermann Health System\",\n    \"slgId\": \"1326\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E72445F2-5D81-4136-87AD-2F4EF17E031A/cc96a89193b6c7a0a11e001e6fa5b537.png\",\n    \"name\": \"Maeville Pediatrics\",\n    \"slgId\": \"1326-1\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9A2B7013-5514-4AE6-965B-6D452C22BF3D/76eb20c050d121a058682ec180869f21.png\",\n    \"name\": \"Digestive Specialists PA\",\n    \"slgId\": \"1326-2\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/786F8F55-BD94-4E9D-A06D-590EE5754541/6d5b026ec61681b5245d8652950da33f.png\",\n    \"name\": \"Wishing Well Pediatrics\",\n    \"slgId\": \"1326-3\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/40F9BC3B-8235-4781-BAD7-86D51F73B986/415a8e417f8bd0265e4e768a483c0fa6.png\",\n    \"name\": \"Prestige Medical Sai\",\n    \"slgId\": \"1326-4\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/008A6F9F-64A4-43DA-AB02-5F589FE800EB/be6ca3ffe91107106eaf7ea135f2d773.png\",\n    \"name\": \"Bellaire Allergy & Asthma\",\n    \"slgId\": \"1326-5\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/403E055A-1C30-4BEF-9B3A-37FA97EF2F4A/780699093d4463c1a987d8c7812a403b.png\",\n    \"name\": \"Moonat Med Associates\",\n    \"slgId\": \"1326-6\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F5D3236C-BC6D-4CAB-B5DC-02090179C11D/e7cb9aca41750037a6207c667ed4f4df.png\",\n    \"name\": \"Pearland Family Wellness Clinic\",\n    \"slgId\": \"1326-7\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9224C230-CFA8-4CCC-B3BD-992405E09B42/5c2e5ba76273e742663b89be5ac3ef55.png\",\n    \"name\": \"Over the Moon Pediatrics\",\n    \"slgId\": \"1326-8\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DFD54DAE-F813-4551-B321-85DEEAA29A2A/bbc68b2ce5a9d859aebff4b54675c9ec.png\",\n    \"name\": \"Houston Foot and Ankle Professional Group\",\n    \"slgId\": \"1326-9\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/299ACE88-C0F9-44A2-A2CF-E67741CD19B9/5faa1c5a5a4ed93ef82600a265a03ca6.png\",\n    \"name\": \"Magnolia Lane Pediatrics\",\n    \"slgId\": \"1326-10\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9ECE7CAC-8A0D-4AF2-9F16-B9D1C7682D9D/86714509e2bbf3c975bfef5d8e311d24.png\",\n    \"name\": \"Sugar Land Pain and Spine Specialists\",\n    \"slgId\": \"1326-11\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/43F480B5-C626-4AA2-A2F2-F4429A6BBBC0/96676213f006c2a5f5ddf25e44747673.png\",\n    \"name\": \"Pinnacle Primary Care\",\n    \"slgId\": \"1326-12\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2B346A62-C66B-4070-B7CB-A840CDE6A21E/2d97984d41d7628610505d5cb7104f47.png\",\n    \"name\": \"Gentle Pediatrics\",\n    \"slgId\": \"1326-13\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F8077EFA-C8AC-48C9-82DC-6B9986F33B85/6f15bde55df1cc6063c1a21593fd44c1.png\",\n    \"name\": \"Nurture Women's Care\",\n    \"slgId\": \"1326-14\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7236D2B8-AA39-45FB-B0AD-C1B5A8B375F5/1d0ec6506e41d8c5531368abcee4ecbe.png\",\n    \"name\": \"Family and Aging Center\",\n    \"slgId\": \"1326-15\",\n    \"url\": \"https://mychart.memorialhermann.org/MyChartaffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFDF6003-CECB-4B1A-9A4E-CD186549E579/ff09b384266485ee39262424a78cb241.png\",\n    \"name\": \"Whole Care Pediatrics\",\n    \"slgId\": \"1326-16\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B6A4F24-1EAF-4BFD-9DD2-38FFAFF85E00/a159cf591ba429daa66ada735bd932de.png\",\n    \"name\": \"Rukmini D. Kumar MD\",\n    \"slgId\": \"1326-17\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"HLHV\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CA0F1C92-997F-462E-AFF5-D1091EB52955/5f072623c3e11e4348aec8b1ddc1c249.png\",\n    \"name\": \"Healthy Living Heart and Vein\",\n    \"slgId\": \"1326-18\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D3183EAC-4B4F-4357-BD04-8C176481FD2B/7c816762e1616e8675a617ffb83599bd.png\",\n    \"name\": \"Pediatric Digestive Care\",\n    \"slgId\": \"1326-19\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"XOWE\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7D024E1C-DF45-4681-8916-FD153673B122/83412d8cc67259a1f28b01649d639add.png\",\n    \"name\": \"XO Wellness\",\n    \"slgId\": \"1326-20\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5F0285EA-D3BF-4BA1-9F2F-59AC90D1ABA1/e6d88787dcccb71dbb68dde8e9b55fb7.png\",\n    \"name\": \"Macie Medical\",\n    \"slgId\": \"1326-21\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"ORVA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CC859AB6-0155-42F8-9414-DDF7E88FE762/4b316a86c9dd2875b6beffd5f65b1e12.png\",\n    \"name\": \"Optimcurea Renal and Vascular Access Care\",\n    \"slgId\": \"1326-22\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"POZI\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D916A0E-37FB-4F8D-8726-4A88655E735A/4574780dd6025f6f0f84494124336f96.png\",\n    \"name\": \"Pozitiv Wellness\",\n    \"slgId\": \"1326-23\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"HDLD\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/974BA05C-7E37-4B6D-9AD9-590D9F593DD2/bb8edf523bdb4bb1fce2063db4170b42.png\",\n    \"name\": \"Hope Digestive and Liver Disease Clinic\",\n    \"slgId\": \"1326-24\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"TXFC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2E575D0A-EB98-4DC4-A1B6-3B44DC9B0E7A/65b8a760937b7f467035401ed944a53e.png\",\n    \"name\": \"Texas Family Clinic\",\n    \"slgId\": \"1326-25\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4B58153F-BC6D-4F2B-A888-084AFB650FF9/5ed268a7540dccdbb3864f86cf4bcf53.png\",\n    \"name\": \"Kids First Pediatrics\",\n    \"slgId\": \"1326-26\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AF08205B-5329-407E-9A8E-D8100705AB98/0431b42077f4175e50a688269489d2e9.png\",\n    \"name\": \"JW Family Medicine\",\n    \"slgId\": \"1326-27\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5DB65212-A7B9-4133-B894-C2FDA2526646/af730db0fd85a17a8309c0b14fba1ed3.png\",\n    \"name\": \"Concierge Health Partners\",\n    \"slgId\": \"1326-28\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ADACCCD3-0D6D-4574-B4BE-6E4DBC25401B/7c6a0bd424eea902595f42ee4589331f.png\",\n    \"name\": \"Advanced Spine and Pain Specialists\",\n    \"slgId\": \"1326-29\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [\n      \"JIKE\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CAF70DF2-D8A5-4F6A-A514-AAD666F9E214/89444c1de5f5d2d85790889a641baf71.png\",\n    \"name\": \"JOHN IKE, MD, MPH, PA\",\n    \"slgId\": \"1326-30\",\n    \"url\": \"https://mhcc.memorialhermann.org/MyChartAffiliate/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AC4C7713-F9AA-435D-96D1-EC0C71DD3A0E/a8d067f6e0ecd32036f929350e3f5817.png\",\n    \"name\": \"San Ysidro Health\",\n    \"slgId\": \"1327\",\n    \"url\": \"https://mychart.syhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"clonoSEQ\",\n      \"Adaptive\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4F31E525-3D57-494A-94BD-55C508BC10BD/f437a67880016b7db902265d8e212d31.png\",\n    \"name\": \"clonoSEQ by Adaptive Biotech\",\n    \"slgId\": \"1328\",\n    \"url\": \"https://mychart.clonoseq.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CF4D8B8D-9C32-49EF-A677-1B9BCAEE3EC0/ee2ad858737584e435d385f47bfc49e0.png\",\n    \"name\": \"Midwestern University Clinics\",\n    \"slgId\": \"1329\",\n    \"url\": \"https://mychart.mwuclinics.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"NEMS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1835BCB2-65D8-4C6A-8065-4DB3531BE311/9034623fab46909c24619380dac10d9c.png\",\n    \"name\": \"North East Medical Services\",\n    \"slgId\": \"1332\",\n    \"url\": \"https://mychart.nems.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6B8F4530-BFD6-4511-8F59-6ACB13467BAC/55f595e794b65101204bab3d6fd5cb96.png\",\n    \"name\": \"Go East Medical Services\",\n    \"slgId\": \"1332-1\",\n    \"url\": \"https://mychart.nems.org/NV/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2749B0C4-BE53-4CEB-BC26-E650AE83F4C4/a9127bf54eb3f3f6dc86febb4d6192a7.png\",\n    \"name\": \"Benefis Health System\",\n    \"slgId\": \"1334\",\n    \"url\": \"https://mychart.benefis.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Hamilton Medical Center and Physician Practices\",\n      \"Bradley Medical Center and Physician Practices\",\n      \"HMC\",\n      \"BMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8E20384C-DED4-4186-B133-64889420CB5C/97fd4129ad37cdad6272b7b1f6646fa6.png\",\n    \"name\": \"Vitruvian Health\",\n    \"slgId\": \"1336\",\n    \"url\": \"https://mychart.vitruvianhealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"UT Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6082A2D0-CEBA-4F0B-9908-0614130CA381/c8966dda6b34213b579f9dadf47509c3.png\",\n    \"name\": \"UT Dell Medicine\",\n    \"slgId\": \"1337\",\n    \"url\": \"https://portal.utmedicine.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"OHH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EEDE6E71-0DDC-4CF5-93EE-E64B39122A13/f770203ed1e7845094844ec9131dac77.png\",\n    \"name\": \"Oklahoma Heart Hospital\",\n    \"slgId\": \"1338\",\n    \"url\": \"https://myohh.okheart.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CF701E59-32C4-4CFF-B643-8CB294CFC8A5/4e6ef38b5ba9468b22165038748aff66.png\",\n    \"name\": \"Woman's\",\n    \"slgId\": \"1339\",\n    \"url\": \"https://mychart.womans.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4AF64FED-159E-4B83-8CE0-0DF6061177E5/febf27baba19c96b99a9db4b6d9a891d.png\",\n    \"name\": \"Unity Health Toronto\",\n    \"slgId\": \"1341\",\n    \"url\": \"https://mychart.unityhealth.to/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MLH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E28BAD57-CF8A-4BF5-88E2-F2C18433ED9B/950a22c03cd6ca769196be0aa486b5ba.png\",\n    \"name\": \"Methodist Le Bonheur Healthcare\",\n    \"slgId\": \"1342\",\n    \"url\": \"https://mychart.methodisthealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DD703A2F-FD37-476C-93EE-2F0F82881E39/d9b0f3a551e28aaf06725c9e91e73bfd.png\",\n    \"name\": \"Boston Children's Hospital\",\n    \"slgId\": \"1351\",\n    \"url\": \"https://mychart.childrenshospital.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/87FD1C9F-E3AD-4A78-BAA4-0218FC22229D/2caa39fbf88647d1287f4a0d9022c1d0.png\",\n    \"name\": \"Franciscan Children's Hospital\",\n    \"slgId\": \"1351-2\",\n    \"url\": \"https://mychart.franciscanchildrens.org/franciscan/\"\n  },\n  {\n    \"aliases\": [\n      \"MSKCC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C226DD79-BED2-4888-8633-A8C3A4B21865/d5dd8eb5f5ccb9cce5f133a8e620001c.png\",\n    \"name\": \"Memorial Sloan Kettering Cancer Center\",\n    \"slgId\": \"1353\",\n    \"url\": \"https://mskmychart.mskcc.org/MyChart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/38423683-FDCD-4987-A39B-1D47409E2377/2ba02f1fa531b562d03b272cfc0cff8a.png\",\n    \"name\": \"Baton Rouge General\",\n    \"slgId\": \"1355\",\n    \"url\": \"https://mychart.brgeneral.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1C607F30-2C88-4C71-A771-596DAF86F067/d3da602093e4db6c6769619d15acab38.png\",\n    \"name\": \"County of San Mateo\",\n    \"slgId\": \"1356\",\n    \"url\": \"https://mychart.smchealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/51BCB4E9-3B38-4B46-8CE5-D57FFE33511A/c5b84c63b8e98fdc1e2d3875cc5eb778.png\",\n    \"name\": \"Carelon\",\n    \"slgId\": \"1358\",\n    \"url\": \"https://mychart.carelonhealth.com/\"\n  },\n  {\n    \"aliases\": [\n      \"FHCP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/62BF519C-A911-4512-968F-344864586AAD/97c6da816bdf3815ac22ecc3abd4c5ff.png\",\n    \"name\": \"Florida Health Care Plans\",\n    \"slgId\": \"1359\",\n    \"url\": \"https://mychart.fhcp.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Northwell Health System\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E7B53360-500D-49B5-8A26-0861252DD5ED/c70e79730c6ae7706bd5f01d77c93784.png\",\n    \"name\": \"Northwell Health\",\n    \"slgId\": \"1361\",\n    \"url\": \"https://my.northwell.edu/Mychart/Authentication/Login?\"\n  },\n  {\n    \"aliases\": [\n      \"NCDHHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/328AB1EA-60BE-43AD-BAC2-7774810047AB/4ab2264e4ec238a961c63c1c23c3b531.png\",\n    \"name\": \"North Carolina Department of Health and Human Services\",\n    \"slgId\": \"1364\",\n    \"url\": \"https://mychart.ncdhhs.gov/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"JMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BEDE774F-85F6-44B5-911E-60A801CCC685/51c07ec66f2e8266eef9ffc7dbedc84c.png\",\n    \"name\": \"Jupiter Medical Center\",\n    \"slgId\": \"1365\",\n    \"url\": \"https://mychart.jupitermed.com/MyChartPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A4F80BDE-DA1C-4BE7-B128-92638CA4D8F6/87505dd9254417f1415e671ca20dc4f2.png\",\n    \"name\": \"NL Health Services\",\n    \"slgId\": \"1368\",\n    \"url\": \"https://mychart.epic.nlhealthservices.ca/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3C33BBCB-9B91-42F9-A260-34F9790CA74E/fd53e2217a6c014077a6fcd7695120c1.png\",\n    \"name\": \"Broward Health\",\n    \"slgId\": \"1369\",\n    \"url\": \"https://mychart.browardhealth.org/Mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [\n      \"MUMC+\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1576ADA1-2DA1-4F86-831D-CDDCA78552E9/eaed1fbde453ead70b299d77051333d6.png\",\n    \"name\": \"Maastricht UMC+\",\n    \"slgId\": \"1371\",\n    \"url\": \"https://mijn.mumc.nl/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3CB9C16E-2649-4C7C-BE49-6F8849BA2A61/e3d8bf17bdaab8b60209e2927cace1d7.png\",\n    \"name\": \"Ciro\",\n    \"slgId\": \"1371-1\",\n    \"url\": \"https://mychart.mijnciro.nl/MyChart-Ciro-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C4EF51E4-D2C2-4C39-8C56-FDBAA6DD1481/8dbfde4379058ed341a20813ea0d44d6.png\",\n    \"name\": \"Stamford Health\",\n    \"slgId\": \"1378\",\n    \"url\": \"https://mychart.stamfordhealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CNHSA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/DDAE89F4-F3A5-41BF-B4D6-1890859004A2/d5165ecc66bedb311c1fcd7daca1c519.png\",\n    \"name\": \"Choctaw Nation\",\n    \"slgId\": \"1380\",\n    \"url\": \"https://mychart.cnhsa.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Cayuga Health\",\n      \"Arnot Health\",\n      \"Cayuga Medical Center\",\n      \"Schuyler Hospital\",\n      \"Arnot Ogden Medical Center\",\n      \"Ira Davenport Memorial Hospital\",\n      \"St. Joseph's Hospital\",\n      \"Xtensys Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A3C32A64-A83D-4777-997B-9ACE5141922E/2f21c2ddccf2e2507045d0c8c0a570d0.png\",\n    \"name\": \"Centralus Health\",\n    \"slgId\": \"1381\",\n    \"url\": \"https://mychart.centralushealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C6BB4EA3-D980-4D14-88AE-A248BBFA58CF/9f0354328b857ddc3d782f5ba4a09675.png\",\n    \"name\": \"Crouse Health\",\n    \"slgId\": \"1381-1\",\n    \"url\": \"https://mycrousechart.crouse.org/crouse/\"\n  },\n  {\n    \"aliases\": [\n      \"CEHS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BFD5DA81-8A36-4D4B-8187-53FCBA499980/1c117ba9304806b8fdb420cd3ed89e00.png\",\n    \"name\": \"CarolinaEast Health System\",\n    \"slgId\": \"1385\",\n    \"url\": \"https://mychart.carolinaeasthealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TMH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2D2A9EBA-FBEF-447F-9179-06870514E150/554533df65f78eb358e4d783042ec22b.png\",\n    \"name\": \"Tallahassee Memorial Healthcare\",\n    \"slgId\": \"1387\",\n    \"url\": \"https://mychart.TMH.org\"\n  },\n  {\n    \"aliases\": [\n      \"MyUPMC\",\n      \"UPMC Central\",\n      \"UPMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8B5CBC9A-AE3B-469F-9BB9-BAE130EC2E92/912e19934ad18a4247a861ca1092e99c.png\",\n    \"name\": \"MyUPMC\",\n    \"slgId\": \"1392\",\n    \"url\": \"https://myupmc.upmc.com/MyUPMC/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91403B91-BE0F-4877-B0AC-645809266D36/7528bfbf7709cb1e6b23bba1e0c10f80.png\",\n    \"name\": \"Halifax Hospital Medical Center\",\n    \"slgId\": \"1393\",\n    \"url\": \"https://mychart.halifaxhealth.org/MyChart\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B40F23AD-254A-4AC5-9FA5-EC74076582F4/4406f9b78e486f85cbab28e36c79ee0b.png\",\n    \"name\": \"HealthPoint\",\n    \"slgId\": \"1395\",\n    \"url\": \"https://mychart.healthpointchc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Mon dossier sante\",\n      \"mon dossier santé\",\n      \"Sante Quebec\",\n      \"Santé Québec\",\n      \"mondossiersante\",\n      \"MonDossierSanté\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1472CE2E-953E-4DAF-88A5-EBC58CDC823A/53b463865be86c9d250a3beb63433841.png\",\n    \"name\": \"Mon dossier santé\",\n    \"slgId\": \"1396\",\n    \"url\": \"https://mondossiersante.sante.quebec/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C6CDB99F-FB46-4BD7-B9A7-818DE9791C5C/1e056b316afe3b7754c2ec7d71b5ee77.png\",\n    \"name\": \"Birmingham Women's and Children's\",\n    \"slgId\": \"1398\",\n    \"url\": \"https://mychart.bwc.nhs.uk/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7E41E352-2D1A-496A-ADDF-FF0E680E7CAE/3e6405b0ea3984478e137c7da2f50903.png\",\n    \"name\": \"CoxHealth\",\n    \"slgId\": \"1402\",\n    \"url\": \"https://mychart.coxhealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Penn State\",\n      \"Penn State Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CCC5C684-4864-4A55-85EC-C883AD5C784C/cfb77d56862b9bc0afb3fd72b9e40983.png\",\n    \"name\": \"PennState Health\",\n    \"slgId\": \"1407\",\n    \"url\": \"https://mychart.pennstatehealth.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"PHNY\",\n      \"ProHealth\",\n      \"Riverside\",\n      \"Pro Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6384D169-2C79-4F6E-B9E3-AE40A3080AC8/6d1d062874af3d1dd22bcdfa3af890d4.png\",\n    \"name\": \"Optum Medical Care\",\n    \"slgId\": \"1409-1\",\n    \"url\": \"https://epicmychart.optum.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"ESNEFT\",\n      \"Colchester\",\n      \"Ipswich\",\n      \"Aldeburgh\",\n      \"Felixstowe\",\n      \"Bluebird Lodge\",\n      \"Clacton\",\n      \"Harwich\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/4B8B6827-3D2B-41B4-9056-774C63AEF72C/ff007dfe02d85068744c23c3214f0f26.png\",\n    \"name\": \"East Suffolk and North Essex NHS Foundation Trust\",\n    \"slgId\": \"1418\",\n    \"url\": \"https://mychart.esneft.nhs.uk/MyChart-PRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EF90E438-E8A9-4C37-8181-516BA6C15EA9/e74b0339c18f2d577c4a637bd858d38c.png\",\n    \"name\": \"Beebe Healthcare\",\n    \"slgId\": \"1421\",\n    \"url\": \"https://mychart.beebehealthcare.org/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1E92ECF0-65DE-46B6-BF3F-C04FF0069C9E/ca1f13d7adad952bd5b481051eb96ec3.png\",\n    \"name\": \"Children's Mercy Kansas City\",\n    \"slgId\": \"1422\",\n    \"url\": \"https://mychart.et1422.epichosted.com/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F4CB8E77-6BE9-4BD6-A260-9F09DEBC65CA/b3b2b1471d3d2263a0bee2855ba799fb.png\",\n    \"name\": \"Health First\",\n    \"slgId\": \"1426\",\n    \"url\": \"https://mychart.hf.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/76691FF5-8451-489E-B4E4-4158EB9A7BFF/7692e251fb479f64239c2ff3552b8031.png\",\n    \"name\": \"Clinica Sierra Vista\",\n    \"slgId\": \"1430\",\n    \"url\": \"https://mychart.clinicasierravista.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B25EB9D4-C0E9-4E48-92A6-5B4A13CD17AC/024ebe245d1f5492198b3a3d7a8a81d3.png\",\n    \"name\": \"Unity Health Care\",\n    \"slgId\": \"1432\",\n    \"url\": \"https://mychart.cachconnect.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C7A8DF5F-8B1B-47D5-B217-01523B2ED41B/299d044273fb1fbdd5e63f5ae0461f74.png\",\n    \"name\": \"Whitman Walker Health\",\n    \"slgId\": \"1432-1\",\n    \"url\": \"https://mychart.cachconnect.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/20DE3902-A30A-4580-92CA-6139254EAFA3/0dbc7b14f5cffa969e89ed12c180fdd1.png\",\n    \"name\": \"Health First Health Plans\",\n    \"slgId\": \"1433\",\n    \"url\": \"https://mychart.myhfhp.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Dental Dental of California\",\n      \"Delta Dental of CA\",\n      \"Emerge\",\n      \"Emergebright\",\n      \"Harmony Whole Person Oral HealthCare\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F3450E4-1344-4C59-A16A-AD6E6BFBA2A8/3d07cf9ea0b722d941f0f63b5b0fb201.png\",\n    \"name\": \"Harmony\",\n    \"slgId\": \"1434-1\",\n    \"url\": \"https://mychart.harmonyoralhealth.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CGHMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FB1A6990-BD22-4272-AC62-B7A380BD1437/f6c1a248285987444a4d7c7983d432b2.png\",\n    \"name\": \"CGH Medical Center\",\n    \"slgId\": \"1437\",\n    \"url\": \"https://mychart.cghmc.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/7BD499FB-74B8-4356-BC46-71651418D547/2b65ef996cfe0676f99e91498d088a0b.png\",\n    \"name\": \"Adventist Health\",\n    \"slgId\": \"1438\",\n    \"url\": \"https://mychart.adventisthealth.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Avera Health Plans\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/27E46713-6A1F-43C4-9366-D120E5D66DD6/abd900db78ad02597dfa8653d1eabc02.png\",\n    \"name\": \"Avera Health\",\n    \"slgId\": \"1439\",\n    \"url\": \"https://averamychart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A4D7C76A-F32A-47B2-8C27-C759F1198CAF/8034ec43f628d1b0994780d24c7db3ee.png\",\n    \"name\": \"Surgical Institute of South Dakota, PC\",\n    \"slgId\": \"1439-1\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/31EB623C-3B54-4636-8889-23FB021E3ECE/ec0d385cc0053479a1a3e5932ea9a003.png\",\n    \"name\": \"Access Health\",\n    \"slgId\": \"1439-2\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/16B01E91-815D-47E8-806F-2094B4702C24/2fa869e560a57ce93278b5d35b71380a.png\",\n    \"name\": \"Bowdle Healthcare Center\",\n    \"slgId\": \"1439-3\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/347FFA0D-049E-4A65-9A54-010705F54355/a37adb54bf5229be48b0dd14c4646f33.png\",\n    \"name\": \"Brookings Health System\",\n    \"slgId\": \"1439-4\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9077B1A8-39C3-48F2-9C03-F48F467761A1/94ac422ea81a3472743e47d7b6e07b6e.png\",\n    \"name\": \"Community Memorial Hospital and Redfield Clinic\",\n    \"slgId\": \"1439-5\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/505CF7C0-C898-4960-8986-6074FA9D6F36/05c65f2b337141600a7040a55f00c6f9.png\",\n    \"name\": \"Eureka Community Health Services Avera and Clinics\",\n    \"slgId\": \"1439-6\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/2EEDB4FA-90BC-4DAD-9612-EEC73E668DBF/4750d74b9cf18ac11447145a52110191.png\",\n    \"name\": \"Floyd Valley Healthcare\",\n    \"slgId\": \"1439-7\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6ECD70E9-6B1A-4D92-9495-CCA66611FBFE/3de277f6c751fd84f1dc210615d4651a.png\",\n    \"name\": \"Hegg Health Center\",\n    \"slgId\": \"1439-8\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B10E2691-5715-4E92-A6BB-CD6B4C9CDB2C/92479937172d47b6a3cf889fb2c195a7.png\",\n    \"name\": \"Lakes Regional Healthcare\",\n    \"slgId\": \"1439-9\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1B48D0F0-72DB-4A86-B88A-CC6C3810CDAE/107ea65cd015844967538c05634e8c94.png\",\n    \"name\": \"Landmann Jungman Memorial Hospital Avera and Scotland Medical Clinic Avera\",\n    \"slgId\": \"1439-10\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E70CD587-2EB4-48AC-A380-662B841AB89C/1a4e21521810a06d24bc840dff647969.png\",\n    \"name\": \"Marshall County Healthcare Center Avera\",\n    \"slgId\": \"1439-11\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8980E103-1E91-473E-AC4A-2B9941830ACD/298ce53889d774d3130e1850cb64af69.png\",\n    \"name\": \"Wagner Community Memorial Hospital Avera\",\n    \"slgId\": \"1439-12\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F7E1F18B-1030-47D2-B57F-AC648B8A2547/2f4494f71b900fa0315f92f0d70bd25f.png\",\n    \"name\": \"NWIA Bone, Joint & Sports Surgeons\",\n    \"slgId\": \"1439-13\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/01F6E124-8238-4420-A532-176DC75D2B02/31f78bd5b05c873768f099d75dfc859d.png\",\n    \"name\": \"Northwest Iowa Surgeons, PC\",\n    \"slgId\": \"1439-14\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FBD144FF-9B72-407E-9B8F-908AB0BACFCE/d7c792b6dcd40f7541b19fd1a75adfdd.png\",\n    \"name\": \"Osceola Regional Health Center\",\n    \"slgId\": \"1439-15\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1CB4E82D-AC88-4942-B3BD-395F64D4D4A3/bbffe4e744bac073e6ad3df94976ae26.png\",\n    \"name\": \"Pipestone County Medical Center and Family Clinic Avera\",\n    \"slgId\": \"1439-16\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/05E700D0-7656-46B7-9E61-0B9A0C7131AF/0ecf7ce4ea8970a2508fc7ae54fbaf72.png\",\n    \"name\": \"Platte Health Center Avera\",\n    \"slgId\": \"1439-17\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/83FE8907-F79F-4083-AD47-936B6306989F/71b2db91adb55079261244792aa39f24.png\",\n    \"name\": \"Regional Health Services of Howard County\",\n    \"slgId\": \"1439-18\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/37C6B940-7FF0-4857-B0EA-2919DEE37348/6781607210b235d7aa3d60d49dd25e2e.png\",\n    \"name\": \"Sioux Center Health\",\n    \"slgId\": \"1439-19\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B716D7AE-745C-45DB-B024-6CB9D715DA94/0ccfa49b5e45cd517d1d53b9cfb81cec.png\",\n    \"name\": \"Spencer Hospital\",\n    \"slgId\": \"1439-20\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CA2F1725-DFEC-41D9-A5B3-27AC315D0952/42efe6729496631a5dcee671a32a9d33.png\",\n    \"name\": \"St. Michael's Hospital Avera and Bon Homme Family Practice\",\n    \"slgId\": \"1439-21\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F27C8140-5266-4243-A446-3FE99AB500E0/69220e0e0d3a7edd7d1db3f785e9f664.png\",\n    \"name\": \"Hendricks Community Hospital Association\",\n    \"slgId\": \"1439-22\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D8C107AA-56DA-489B-9843-56F3091ABB8C/4e328fb497a0e12d4611dbbba92bdf0d.png\",\n    \"name\": \"Freeman Regional Health Services\",\n    \"slgId\": \"1439-23\",\n    \"url\": \"https://mychartconnectsites.org/MyChartConnect/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/256BAB67-0606-4386-8343-22E00E5D189F/0ac0b4b63c935eddc6492c990df15655.png\",\n    \"name\": \"Avera Health Plans\",\n    \"slgId\": \"1439-24\",\n    \"url\": \"https://averamychart.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/57A1DF79-715C-4BFE-960F-C0DF29BB1527/d245963213488aeacc7ebd3014624117.png\",\n    \"name\": \"Washington Regional Medical System\",\n    \"slgId\": \"1440\",\n    \"url\": \"https://mychart.wregional.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"TTUHSC\",\n      \"Texas Tech\",\n      \"Health Sciences Center\",\n      \"University Medical Center\",\n      \"Lubbock\",\n      \"UMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/539A9385-8352-4850-9B28-23D1B3D9613A/343e04440a9f3afe35f81a1af758a42f.png\",\n    \"name\": \"UMC Health System\",\n    \"slgId\": \"1442\",\n    \"url\": \"https://mychart.umchealthsystem.com/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/50C57D55-0CA0-4F02-B530-244740A13DBF/e70d089254c04421ea51a1f30f6615ba.png\",\n    \"name\": \"Children's Minnesota\",\n    \"slgId\": \"1444\",\n    \"url\": \"https://mychart.childrensmn.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"WOHS\",\n      \"OSler\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/68E56014-A864-4AF8-A15D-CF60FC44252F/9471abc8cbf0396d03f589d1284b3c34.png\",\n    \"name\": \"William Osler Health Care\",\n    \"slgId\": \"1445\",\n    \"url\": \"https://mychartportal.williamoslerhs.ca/MYCHARTPRD/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/862B44FE-632A-42B6-8A9E-41E95C1C03DA/f543a5b8bf30dc29d0b51251f46b68ae.png\",\n    \"name\": \"Citizen Potawatomi Nation\",\n    \"slgId\": \"1447\",\n    \"url\": \"https://mychart.cpnhs.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Irvine\",\n      \"UC Irvine\",\n      \"UCI\",\n      \"UCI Health\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/AC73CE0E-76E1-4AA4-A4E7-600B681BA7C8/007cf478b9f6afb6dfef0b41dc98334c.png\",\n    \"name\": \"UC Irvine\",\n    \"slgId\": \"1448\",\n    \"url\": \"https://my.ucihealth.org/UCI/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CFC92655-608D-46A9-BFE2-77F7387B8D85/9aa1ce5eec5731e372946c4c716c8a1b.png\",\n    \"name\": \"PacificSource\",\n    \"slgId\": \"1452\",\n    \"url\": \"https://mychart.pacificsource.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SCRMC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D2D6DBF5-6BEA-4A72-A65D-934A09882D64/9168803e2df9bafd91e72d8e5f46d74b.png\",\n    \"name\": \"South Central Regional Medical Center\",\n    \"slgId\": \"1453\",\n    \"url\": \"https://mychart.scrmc.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"CCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ABE81B04-AE5B-4133-8286-EFB33593FBBB/f78ecbf925e5e5b059232b11a6d4173d.png\",\n    \"name\": \"Covington County Hospital\",\n    \"slgId\": \"1453-1\",\n    \"url\": \"https://mychart.covingtoncountyhospital.com/CCHMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"SCH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/CB9FEE91-E922-4626-8594-E2EE8E76BE29/0f0687716e1cdc01e8af0d50445904ca.png\",\n    \"name\": \"Simpson General Hospital\",\n    \"slgId\": \"1453-2\",\n    \"url\": \"https://mychart.simpsongeneral.com/SGHMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"MGH\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8C41DA1D-C345-4ECD-8093-01E40D0DCF87/67888cef3a104ff378ff3fc63c688609.png\",\n    \"name\": \"Magee General Hospital\",\n    \"slgId\": \"1453-3\",\n    \"url\": \"https://mychart.mghosp.org/MGHMyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"HHSC\",\n      \"Hilo Benioff Medical Center\",\n      \"East Hawaii Health Clinics\",\n      \"Honoka'a Hospital\",\n      \"Ka'u Hospital\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/283FF0A2-DA8E-4E20-8D62-5146884D9085/222d4a970d6fa8c9716fa8c0852257e7.png\",\n    \"name\": \"Hawaii Health Systems Corp\",\n    \"slgId\": \"1454\",\n    \"url\": \"https://mychart.ehr.hhsc.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"GPPC\",\n      \"General Physicians\",\n      \"General Physician\",\n      \"General Physician PC\",\n      \"OMP\",\n      \"Olean Medical Group\",\n      \"Olean Medical Practice\",\n      \"Olean General Hospital\",\n      \"LEMs\",\n      \"Lake Erie Medical Services\",\n      \"Bradford\",\n      \"Bradford Regional Medical Center\",\n      \"Brooks\",\n      \"Brooks-TLC Hospital\",\n      \"Cuba Memorial Hospital\",\n      \"Queen City\",\n      \"Buffalo General Hospital\",\n      \"Buffalo General Medical Center\",\n      \"BGMC\",\n      \"BGH\",\n      \"Gates Vascular Institute\",\n      \"GVI\",\n      \"Oishei Children's Hospital\",\n      \"OCH\",\n      \"Galisano Children's Hospital\",\n      \"GCH\",\n      \"Children's Hospital of Buffalo\",\n      \"Millard Fillmore Hospital\",\n      \"Millard Fillmore Suburban Hospital\",\n      \"MFSH\",\n      \"Degraff Hospital\",\n      \"DeGraff Medical Park\",\n      \"Harlem Road Ambulatory Surgery Center\",\n      \"Southtowns Surgery Center\",\n      \"Kaleida Labs\",\n      \"Kaleida Health Laboratories\",\n      \"Highpointe\",\n      \"Highpointe on Michigan\",\n      \"Degraff Rehabilitation and Skilled Nursing Facility\",\n      \"VNA of WNY\",\n      \"Visiting Nurses Association of WNY\",\n      \"Great Lakes Cardiovascular\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6D1FA575-F237-4CF3-9C0D-07AF13CF664E/de596286442227757bf067082c886413.png\",\n    \"name\": \"Kaleida\",\n    \"slgId\": \"1455\",\n    \"url\": \"https://mychart.kaleidahealth.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Erie County Medical Center\",\n      \"Premier Health Partners\",\n      \"PHP\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/46F72A03-24C0-4139-908E-381F55477A8E/6f67f1da7321dbbda727af94e6a8300f.png\",\n    \"name\": \"ECMC\",\n    \"slgId\": \"1455-1\",\n    \"url\": \"https://mychart.ecmc.edu/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"University of Buffalo Medical Center\",\n      \"UBMD Physicians Group\",\n      \"University of Buffalo Physicians Group\",\n      \"UB Orthopedics\",\n      \"UB  Neurology\",\n      \"UB Primary Care\",\n      \"UB Surgery\",\n      \"UB Psychology\",\n      \"UB Internal Medicine\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/ABFCAA43-4B8A-4D0F-8CED-2C451E2B40EF/eb954e0477ed468cf46edb3c3a6c727d.png\",\n    \"name\": \"UBMD\",\n    \"slgId\": \"1455-2\",\n    \"url\": \"https://mychart.ubmd.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"St. Vincent’s\",\n      \"St Vincents\",\n      \"STV\",\n      \"Saint Vincents\",\n      \"UAB St. Vincent's\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6431665A-3398-4E07-8157-CBB34EFDB8B8/b587e5a27faf44cb8ac177512617accc.png\",\n    \"name\": \"UAB Medicine\",\n    \"slgId\": \"1460\",\n    \"url\": \"https://www.mychart.uabmedicine.org/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/91F9C35F-E073-4521-8BBC-C01E19262FB2/645276ecd757266818e5dbd32e0114f6.png\",\n    \"name\": \"ChristianaCare\",\n    \"slgId\": \"1461\",\n    \"url\": \"https://mychart.christianacare.org/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"GoHealthUC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/9FCA289F-6659-4B67-9DC9-3CE30A058254/e54542c8e3b9c52c2996afc2ed12b16e.png\",\n    \"name\": \"GoHealth Urgent Care\",\n    \"slgId\": \"1462\",\n    \"url\": \"https://mychart.gohealthuc.com/Mychart/Authentication/Login\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8FB522F7-F987-4C3E-8831-CC6F375CADEB/32255a81a2dca2cc217746e6c9c5d75d.png\",\n    \"name\": \"Blessing Health\",\n    \"slgId\": \"1464\",\n    \"url\": \"https://mychart.blessinghealth.org/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"Sarasota Memorial Hospital\",\n      \"Sarasota Memorial Health Care System\",\n      \"Sarasota Memorial Healthcare System\",\n      \"Venice Hospital\",\n      \"SMH\",\n      \"First Physicians Group\",\n      \"FPG\",\n      \"Newtown Clinic\",\n      \"Newtown Internal Medicine\",\n      \"Brian D Jellison Cancer Institute\",\n      \"Cornell Behavioral Health Pavilion\",\n      \"Sarasota Memorial Rehab Pavilion\",\n      \"Sarasota Rehab Pavilion\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/30BBE314-0D63-432F-A713-438E04E652B6/f937ae28c6a71160cb01ce21474e21db.png\",\n    \"name\": \"Sarasota Memorial Health MyChart\",\n    \"slgId\": \"1465\",\n    \"url\": \"https://mychart.smh.com/Mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Inspira\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5AAE9412-35C6-4EAE-901B-F5C161E36E45/d549412c78ba96ce9dc03fab8636fda1.png\",\n    \"name\": \"InspiraHealth\",\n    \"slgId\": \"1473-3\",\n    \"url\": \"https://mychart.inspirahealth.org/\"\n  },\n  {\n    \"aliases\": [\n      \"MNMC\",\n      \"Mt. Nittany\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/85F3309E-7700-4CEA-BE4C-508D2011A438/0010ed3a0021688e9c5fb4ce7a5aa011.png\",\n    \"name\": \"Mount Nittany Health\",\n    \"slgId\": \"1474\",\n    \"url\": \"https://mychart.mymountnittany.org/mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/522F5E02-A5B5-40AA-94BB-C447598AA0E8/32488a188b56b4e0287f3e2e32d1606e.png\",\n    \"name\": \"Great River Health\",\n    \"slgId\": \"1475\",\n    \"url\": \"https://mychart.greatriverhealth.org/mychart/\"\n  },\n  {\n    \"aliases\": [\n      \"Virginia Mason Franciscan Health\",\n      \"The Doctors Clinic\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/EB15B354-62CE-4217-BBA8-C520B3BCFB03/b08ae3c43f353d6dc5a77d4112af0c05.png\",\n    \"name\": \"CommonSpirit Health\",\n    \"slgId\": \"1482\",\n    \"url\": \"https://patientportal.commonspirit.org/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B39D03A0-A7B0-4781-A863-11FB07003E03/28d4e97dbd044ca4976b1397772b796c.png\",\n    \"name\": \"Freeman Health\",\n    \"slgId\": \"1491\",\n    \"url\": \"https://mychart.freemanhealth.com/Mychart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/778399B2-D7BA-49EB-9F66-D42E4FF50B94/2c3bd190077450ab6fa3927bad3462ee.png\",\n    \"name\": \"ENT and Allergy Associates\",\n    \"slgId\": \"1512\",\n    \"url\": \"https://mychart.entandallergy.com/MyChart/\"\n  },\n  {\n    \"aliases\": [\n      \"DVCH\",\n      \"CHDC\",\n      \"Union\",\n      \"The Alliance\",\n      \"Delaware Valley Community Health\",\n      \"Union Community Care\",\n      \"Community Health & Dental Care\",\n      \"PAHCTA\",\n      \"PA Alliance\",\n      \"PA Health Center Technology Alliance\",\n      \"Community Health and Dental Care\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/368599C6-5655-4AA4-B681-3E30B34FDFD4/59c0fdd64cc07d51773e59f2491474e3.png\",\n    \"name\": \"PA Health Center Technology Alliance\",\n    \"slgId\": \"1528\",\n    \"url\": \"https://thealliancepa.epicmychart.com/MyChart/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/FC28AF4F-20FB-45B8-B0EE-8D6964491689/49caeb6186d8431d7098057ecc46a592.png\",\n    \"name\": \"Drexel\",\n    \"slgId\": \"4001-1\",\n    \"url\": \"https://drexel.epicmychart.com/drx/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/70F05B10-AA33-4190-9578-7216339771D8/6d52d4eba3fb6c4117c02ef57942da5e.png\",\n    \"name\": \"MY DR NOW\",\n    \"slgId\": \"4001-2\",\n    \"url\": \"https://mydrnow.epicmychart.com/mdn/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D310D4A8-4141-487B-BC75-858C432EA8D8/9b447200e9aae8ead397a9b70345cfeb.png\",\n    \"name\": \"Foothill Family Clinic\",\n    \"slgId\": \"4001-3\",\n    \"url\": \"https://foothill.epicmychart.com/ffc/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/154B6A20-3838-41AA-815E-20A958D5B297/ee6c69e721c9d3606856852328226028.png\",\n    \"name\": \"Bruce W Moskowitz\",\n    \"slgId\": \"4001-4\",\n    \"url\": \"https://moskowitz.epicmychart.com/bwm/\"\n  },\n  {\n    \"aliases\": [\n      \"Burket Family Medicine\"\n    ],\n    \"down\": true,\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1BD55650-7303-43C6-BE22-8AAFE796623D/347c48af778d37cf0726f90cdc6797db.png\",\n    \"name\": \"Neighborhood Family Medicine\",\n    \"slgId\": \"4001-5\",\n    \"url\": \"https://burket.epicmychart.com/bkt/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1EA8127E-BA53-4838-98B6-5C3177D10AAD/b9864f7f9c4b8dac21d088a04a72cc66.png\",\n    \"name\": \"Caldera Family Medicine\",\n    \"slgId\": \"4001-6\",\n    \"url\": \"https://caldera.epicmychart.com/cfm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/BDCFF2CC-21A2-417D-B4E1-94EF8835D0FF/19f47a33a8e489e17b5ca69e5b1ef3d1.png\",\n    \"name\": \"Cascade Internal Medicine\",\n    \"slgId\": \"4001-7\",\n    \"url\": \"https://cascadeinternal.epicmychart.com/cim/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/12986920-7CFF-4316-8C17-78329BEF4263/188105c3e1b56b024d39a1781ed6054a.png\",\n    \"name\": \"East Cascade Women's Group\",\n    \"slgId\": \"4001-8\",\n    \"url\": \"https://eastcascadewomens.epicmychart.com/ecwg/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F386BA04-382D-495C-B2FC-5FE71403A3E7/cc2dfc4c5974d939d16cafd78d9a750b.png\",\n    \"name\": \"Fall Creek Internal Medicine\",\n    \"slgId\": \"4001-9\",\n    \"url\": \"https://fallcreek.epicmychart.com/fcim/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B65F1DFF-7266-44D1-AEBD-AC7CDFB3D7B6/0ad8b8f44cc37a47a43e8518f6cc3845.png\",\n    \"name\": \"Pine Springs Health\",\n    \"slgId\": \"4001-10\",\n    \"url\": \"https://pinesprings.epicmychart.com/psh/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/F46820D0-BDF8-4024-95C1-004DE22E0D3D/fc4c82d06a2d3931b1f91e519d515f17.png\",\n    \"name\": \"Ritual Medical\",\n    \"slgId\": \"4001-11\",\n    \"url\": \"https://ritual.epicmychart.com/rit/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/32B9B624-074F-4853-A58B-8EF31160C1A4/dc75461e4ae0ce69562ed53880404939.png\",\n    \"name\": \"West Bend Family Medicine\",\n    \"slgId\": \"4001-12\",\n    \"url\": \"https://westbend.epicmychart.com/wbfm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/D684E987-F829-4625-B05B-D1C3A7F63D3B/5bfea8ee6bb654dd9c6e2960cd974cd5.png\",\n    \"name\": \"Innovista Medical Center\",\n    \"slgId\": \"4001-13\",\n    \"url\": \"https://innovista.epicmychart.com/inv/\"\n  },\n  {\n    \"aliases\": [\n      \"DMA\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/1311069C-D762-47C0-9AFE-2B2E1851F985/13434776325357086437781cbc79cf4a.png\",\n    \"name\": \"Dickson Medical Associates\",\n    \"slgId\": \"4001-14\",\n    \"url\": \"https://dicksonmd.epicmychart.com/dma/\"\n  },\n  {\n    \"aliases\": [\n      \"CCHC\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/32CF22CD-EA8A-4357-B8C2-7048EFEF89FF/6879fdfc5ac4f352c08da67beaa26f0f.png\",\n    \"name\": \"Coastal Carolina Health Care\",\n    \"slgId\": \"4001-15\",\n    \"url\": \"https://cchchealthcare.epicmychart.com/cchc/\"\n  },\n  {\n    \"aliases\": [\n      \"OakLeaf Medical Network MyChart\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0C14FD8D-AA93-403A-80DD-7360C68F749A/342560743356954e25389fbac76b5f45.png\",\n    \"name\": \"Eau Claire GI Associates – OakLeaf Medical Network\",\n    \"slgId\": \"4001-16\",\n    \"url\": \"https://eauclairegi.epicmychart.com/ecgi/\"\n  },\n  {\n    \"aliases\": [\n      \"OakLeaf Medical Network MyChart\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/3023E928-BDD4-47FC-8B5A-0396C2AE72B3/d35c4249bcd52996db7411ef7dad3f1e.png\",\n    \"name\": \"Evergreen Surgical – OakLeaf Medical Network\",\n    \"slgId\": \"4001-17\",\n    \"url\": \"https://evergreensurgical.epicmychart.com/evg/\"\n  },\n  {\n    \"aliases\": [\n      \"OakLeaf Medical Network MyChart\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/306B2D26-BBDF-4645-8E31-78ED523B715A/cc55cc63b0cc7f5c40a503f3da30d08f.png\",\n    \"name\": \"Foot and Ankle Clinic – OakLeaf Medical Network\",\n    \"slgId\": \"4001-18\",\n    \"url\": \"https://footandankleclinic.epicmychart.com/fac/\"\n  },\n  {\n    \"aliases\": [\n      \"OakLeaf Medical Network MyChart\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8AC9AB35-005E-401E-A588-648A5C086FCF/86168fbc4eff60e342b44704b2fe6926.png\",\n    \"name\": \"OakLeaf Clinics – OakLeaf Medical Network\",\n    \"slgId\": \"4001-19\",\n    \"url\": \"https://oakleafclinics.epicmychart.com/oak/\"\n  },\n  {\n    \"aliases\": [\n      \"OakLeaf Medical Network MyChart\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/A067998D-946C-4EC6-90A4-44C59645721B/a5ed5ef744aa58642df7951cebd4ff52.png\",\n    \"name\": \"Western Wisconsin Urology – OakLeaf Medical Network\",\n    \"slgId\": \"4001-20\",\n    \"url\": \"https://wwu.epicmychart.com/wwu/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E51A552E-118A-410D-97C4-CF06DD88524F/2f2dbfc19af2a9a8bf7592b0b607a135.png\",\n    \"name\": \"The Portland Clinic\",\n    \"slgId\": \"4001-21\",\n    \"url\": \"https://theportlandclinic.epicmychart.com/tpc/\"\n  },\n  {\n    \"aliases\": [\n      \"TAMU\",\n      \"Texas A&M University\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/52921226-1098-42D8-A0E9-FE50FF2C5BCC/68232874ca16b59732fae9f2ea758989.png\",\n    \"name\": \"Texas A&M Health\",\n    \"slgId\": \"4001-22\",\n    \"url\": \"https://tamu.epicmychart.com/tamu/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/6ABC9525-0B8A-4BC0-8741-5772F30818F3/2323760bb7d66c81cdb8654de420a4d6.png\",\n    \"name\": \"Salem Clinic\",\n    \"slgId\": \"4001-23\",\n    \"url\": \"https://salemclinic.epicmychart.com/slm/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/E6E3BA33-BDB1-4CDF-8D8B-DF368CFDCE83/373b178737986481597926029aee9466.png\",\n    \"name\": \"eleHealth\",\n    \"slgId\": \"4001-24\",\n    \"url\": \"https://elehealth.epicmychart.com/ele/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B44A2931-D3DC-451C-BA07-EDB7D419ED40/965c5a5c8fe1856f463ab08d5f4167b2.png\",\n    \"name\": \"The Center\",\n    \"slgId\": \"4006-1\",\n    \"url\": \"https://thecenter.epicmychart.com/ctr/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/B27994FC-CEFB-457A-BB55-DBA552C3141F/db1714569ea9a7b18ea46b9bc30fcabe.png\",\n    \"name\": \"Articularis\",\n    \"slgId\": \"4006-2\",\n    \"url\": \"https://articularis.epicmychart.com/art/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/8D936264-1F96-4739-B367-B7DDAFABD6FE/b3356158f157e42a8b03dfd63a5be1c9.png\",\n    \"name\": \"Rebound Orthopedic and Neurosurgery\",\n    \"slgId\": \"4006-3\",\n    \"url\": \"https://reboundmd.epicmychart.com/rbd/\"\n  },\n  {\n    \"aliases\": [],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/C288A38B-5098-4FCC-A073-3CF46D2FF53E/11a8344fabd56a1913c0ae40a2b68a59.png\",\n    \"name\": \"Reno Orthopedic Center\",\n    \"slgId\": \"4006-4\",\n    \"url\": \"https://renoortho.epicmychart.com/roc/\"\n  },\n  {\n    \"aliases\": [\n      \"NWOS\"\n    ],\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/5B32FD50-D656-4B17-92C4-A68D6FFE9A20/dffc37eb19310822567f0ee2380102be.png\",\n    \"name\": \"Northwest Orthopaedic Specialists\",\n    \"slgId\": \"4006-5\",\n    \"url\": \"https://nwos.epicmychart.com/nwos/\"\n  },\n  {\n    \"aliases\": [\n      \"NBMC\"\n    ],\n    \"directoryUrl\": \"https://www.nbmchealth.com/mychart/\",\n    \"logoUrl\": \"https://media.epic.com/mychartdotorg/directus/organizations/0F10BD21-79BE-4B81-89FA-92A3730EE1A0/598bea4d6499381b95346594ea3f2430.png\",\n    \"name\": \"North Bend Medical Center\",\n    \"slgId\": \"1001534\",\n    \"url\": \"https://mychart.stcharleshealthcare.org/MyChart/\"\n  }\n]\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The MyChart directory — every Epic instance in the world, and its logo.\n *\n * Epic publishes the list that powers the org picker on mychart.org. Three\n * functions live here:\n *\n *  - {@link fetchMyChartDirectory} — Epic's live list, one request: the first\n *    half of the refresh (`refreshDirectory.ts`) that writes\n *    `mychart-instances.json` at release and reruns monthly in clients.\n *  - {@link listMyCharts} — the checked-in `mychart-instances.json`: what a\n *    client offers until its first refresh. The one scraper that makes no\n *    request.\n *  - {@link fetchMyChartIcon} — one instance's logo, as bytes and a data URI.\n *\n * ## Where the list comes from\n *\n * It used to be inlined into the HTML of `/LoginSignup` as\n * `window.PageContext = { Directory: JSON.parse('…') }`, and that is what this\n * repo scraped until mychart.org was rebuilt as a Next.js app. The page now\n * ships no organizations at all — the picker fetches\n * `/cached-api/help/organizations/` client-side — so the old regex matched\n * nothing and the scrape threw. Anything reading the HTML is reading a page\n * that no longer contains the answer.\n *\n * The payload also carries `countryData` and `stateData` (name/alias/ZIP\n * dictionaries, together the large majority of its ~1.8 MB). Neither says\n * anything about an instance, so neither is parsed or stored.\n *\n * ## Where the logo comes from\n *\n * Reimplemented from the picker's own render path, in its order, because the\n * fallbacks are not decorative: eight organizations have no `logo` record, and\n * seven of those are large systems (Mayo, Kaiser, HealthPartners, …) whose\n * logo is a hand-placed file keyed by directory id.\n *\n *   1. the organization's own Directus image,\n *   2. else the per-organization override in {@link CUSTOM_LOGOS},\n *   3. else Epic's generic MyChart logo.\n *\n * Every logo in the directory is served by `media.epic.com` — one host, so\n * `scraperFetch`'s per-host permit is what paces a bulk fetch, and fetching\n * all ~1400 of them is 1400 gated round trips. Fetch the ones you are about to\n * show, not the whole set.\n *\n * The directory URL and the media base are both overridable, and both default\n * to Epic's. fake-mychart serves the pair, which is what keeps CI off Epic\n * entirely.\n */\n\nimport { scraperFetch } from '../http';\nimport bundledInstances from './mychart-instances.json';\n\n/** The org-picker's data source. `locale` only changes the localized names. */\nexport const MYCHART_DIRECTORY_API_URL =\n  'https://www.mychart.org/cached-api/help/organizations/?locale=en-us&includeOrganizations=1';\n\n/**\n * Where the directory's images live. A separate host from the directory\n * itself, so it is a separate knob: {@link fetchMyChartDirectory} takes both,\n * and fake-mychart serves both from its own origin.\n */\nexport const MYCHART_MEDIA_BASE = 'https://media.epic.com/mychartdotorg';\n\n/**\n * The origin every logo is served from. A sandboxed UI (the MCPB setup widget)\n * has to name it in its CSP, or the host serves it `img-src 'none'`.\n */\nexport const MYCHART_MEDIA_ORIGIN = new URL(MYCHART_MEDIA_BASE).origin;\n\n/** The generic logo, shown for an organization that has none of its own. */\nexport function defaultLogoUrl(mediaBase: string = MYCHART_MEDIA_BASE): string {\n  return `${mediaBase}/site/en-us/images/login/default.png`;\n}\n\n/**\n * Logos Epic ships as site assets rather than directory records, keyed by\n * `slgId`. Lifted verbatim from the picker bundle; every id here belongs to an\n * organization whose directory entry has no `logo`.\n */\nconst CUSTOM_LOGOS: Readonly<Record<string, string>> = {\n  '192': 'login/custom/globalHealth.png',\n  '227': 'login/custom/healthPartners.png',\n  '338': 'login/custom/northwestern.png',\n  '459': 'login/custom/kaiserPermanente.png',\n  '580': 'login/custom/myMercy.png',\n  '872': 'login/custom/mijnRadboud.png',\n  '896': 'login/custom/chi.png',\n  '958': 'login/custom/mayoClinic.png',\n  '990': 'login/custom/apotti.png',\n};\n\n/** An organization's image record, as the directory publishes it. */\ninterface DirectoryLogo {\n  imageId: string;\n  fileName: string;\n  subAreaName: string;\n}\n\n/** One organization, as the directory publishes it. */\nexport interface DirectoryOrganization {\n  slgId: string;\n  name: string;\n  loginUrl: string;\n  // Read as `org.logo?.imageId`, and parsed off a directory entry that may not\n  // carry the key at all, so absent and undefined already behaved identically.\n  logo?: DirectoryLogo | undefined;\n  brandName?: string;\n  aliases?: string[];\n  states?: string[];\n  countries?: string[];\n  liveOnCentral?: boolean;\n  phone?: string;\n  email?: string;\n  emailHref?: string;\n  faq?: string;\n}\n\n/**\n * One MyChart instance, in the shape every client consumes — and the shape of\n * each entry in `mychart-instances.json`.\n */\nexport interface MyChartInstance {\n  /** Display name, e.g. \"UCHealth\". */\n  name: string;\n  /** The portal's login URL — what to connect to. */\n  url: string;\n  /**\n   * The login URL Epic's directory publishes. Usually the same as `url`; it\n   * differs when Epic's points somewhere that isn't the portal (UCSF's is an\n   * information page) and a refresh found the real one.\n   */\n  directoryUrl: string;\n  /** Absolute logo URL, always set — the generic one when unbranded. */\n  logoUrl: string;\n  /** Epic's directory id, e.g. \"432-112\". Survives a rename; the name doesn't. */\n  slgId: string;\n  /** Other names the same organization is searched by. */\n  aliases: string[];\n  /** Two-letter US state codes the organization operates in. */\n  states: string[];\n  /** Two-letter country codes. */\n  countries: string[];\n  /** What the organization calls its portal — \"MyChart\", \"Maisa\", \"MyUCHealth\". */\n  brandName: string;\n  /**\n   * True when the last refresh (`fetchResolvedMyChartDirectory`) found the\n   * portal broken in a way that is the same from anywhere — hostname gone,\n   * connection refused, TLS failure, a 5xx — twice. A hang is not counted. A\n   * snapshot from that refresh, not a live check, and never set by a plain\n   * directory fetch.\n   */\n  down?: boolean;\n  /** Whether the instance participates in MyChart Central. */\n  liveOnCentral: boolean;\n  /**\n   * The organization's MyChart support line, as Epic's picker shows it.\n   * Present for about two thirds of the directory; null when the entry has\n   * none.\n   */\n  phone: string | null;\n  /** The organization's MyChart support email, when the entry has one. */\n  email: string | null;\n  /** The organization's FAQ page — nearly always its own `stdfile` FAQ. */\n  faqUrl: string | null;\n}\n\n/**\n * The subset of an instance that ships in `mychart-instances.json`.\n *\n * That file is bundled into two clients, so it carries only fields something\n * actually reads: the picker renders `name`/`logoUrl`, connects to `url`,\n * searches `aliases`, and keys its icon cache on `slgId` (an organization can\n * be renamed; its directory id survives). Everything else stays available from\n * {@link fetchMyChartDirectory} at runtime.\n */\nexport type MyChartInstanceSeed = Pick<\n  MyChartInstance,\n  'name' | 'url' | 'logoUrl' | 'slgId' | 'aliases' | 'down'\n> & {\n  /** Stored only when it differs from `url` — it is how a correction is recorded. */\n  directoryUrl?: string;\n};\n\n/**\n * How both JSON files are written: entries sorted by `slgId` (numerically, so\n * `320` precedes `320-1` and `1001534`), each entry's keys alphabetically, so\n * a refresh's diff shows only what changed.\n */\nexport function toSortedJson(entries: readonly ({ slgId: string } & object)[]): string {\n  const sorted = [...entries]\n    .sort((a, b) => a.slgId.localeCompare(b.slgId, 'en', { numeric: true }))\n    .map((entry) => Object.fromEntries(Object.entries(entry).sort(([a], [b]) => (a < b ? -1 : 1))));\n  return `${JSON.stringify(sorted, null, 2)}\\n`;\n}\n\n/** Narrow a full instance to what the checked-in seed stores. */\nexport function toSeedEntry(instance: MyChartInstance): MyChartInstanceSeed {\n  return {\n    name: instance.name,\n    url: instance.url,\n    logoUrl: instance.logoUrl,\n    slgId: instance.slgId,\n    aliases: instance.aliases,\n    ...(instance.directoryUrl !== instance.url ? { directoryUrl: instance.directoryUrl } : {}),\n    ...(instance.down ? { down: true } : {}),\n  };\n}\n\nlet fingerprint: string | null = null;\n\n/**\n * Identifies the checked-in `mychart-instances.json`, so a client can tell\n * whether a refresh it saved was made beside this release's file or an older\n * one. A saved run from an older release is older than the file that replaced\n * it, and should not win over it. (FNV-1a over the file's contents.)\n */\nexport function bundledDirectoryFingerprint(): string {\n  if (fingerprint) return fingerprint;\n  const text = JSON.stringify(bundledInstances);\n  let hash = 0x811c9dc5;\n  for (let i = 0; i < text.length; i++) hash = Math.imul(hash ^ text.charCodeAt(i), 0x01000193);\n  fingerprint = (hash >>> 0).toString(16);\n  return fingerprint;\n}\n\n/**\n * Every MyChart the checked-in `mychart-instances.json` knows: Epic's\n * directory, every login URL checked, as of the last MCPB release. Unlike the\n * other scrapers it makes no request; it is what a client offers until its\n * first monthly refresh (`refreshMyChartDirectory`) finishes.\n */\nexport function listMyCharts(): MyChartInstanceSeed[] {\n  return bundledInstances;\n}\n\n/** The logo URL Epic's own picker would render for this organization. */\nexport function logoUrlFor(\n  org: DirectoryOrganization,\n  mediaBase: string = MYCHART_MEDIA_BASE,\n): string {\n  if (org.logo?.imageId && org.logo.fileName) {\n    const area = org.logo.subAreaName || 'organizations';\n    return `${mediaBase}/directus/${area}/${org.logo.imageId}/${org.logo.fileName}`;\n  }\n  const custom = CUSTOM_LOGOS[org.slgId];\n  if (custom) return `${mediaBase}/site/en-us/images/${custom}`;\n  return defaultLogoUrl(mediaBase);\n}\n\nfunction asStringArray(value: unknown): string[] {\n  if (!Array.isArray(value)) return [];\n  return value.filter((v): v is string => typeof v === 'string' && v.length > 0);\n}\n\n/**\n * Turn one raw directory entry into an instance, or null if it can't be one.\n *\n * An entry with no `loginUrl` is dropped rather than defaulted: three of them\n * exist, and a picker row that navigates nowhere is worse than a missing row.\n */\nfunction toInstance(raw: unknown, mediaBase: string): MyChartInstance | null {\n  if (typeof raw !== 'object' || raw === null) return null;\n  const org = raw as Record<string, unknown>;\n\n  const name = typeof org.name === 'string' ? org.name.trim() : '';\n  const slgId = typeof org.slgId === 'string' ? org.slgId : '';\n  const directoryUrl = typeof org.loginUrl === 'string' ? org.loginUrl.trim() : '';\n  if (!name || !directoryUrl) return null;\n\n  const logo = org.logo as DirectoryLogo | undefined;\n  return {\n    name,\n    url: directoryUrl,\n    directoryUrl,\n    logoUrl: logoUrlFor({ slgId, name, loginUrl: directoryUrl, logo }, mediaBase),\n    slgId,\n    aliases: asStringArray(org.aliases),\n    states: asStringArray(org.states),\n    countries: asStringArray(org.countries),\n    brandName: typeof org.brandName === 'string' ? org.brandName : '',\n    liveOnCentral: org.liveOnCentral === true,\n    phone: nonEmptyString(org.phone),\n    email: nonEmptyString(org.email),\n    faqUrl: nonEmptyString(org.faq),\n  };\n}\n\n/** The directory sends `\"\"` rather than omitting a contact field it lacks. */\nfunction nonEmptyString(value: unknown): string | null {\n  return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n}\n\n/**\n * Parse the directory API's response body.\n *\n * Throws when `organizations` is missing entirely — that means the endpoint\n * changed shape, and silently returning an empty list would look to every\n * client exactly like \"Epic has no organizations\", which is the failure the\n * old HTML scrape spent months in.\n */\nexport function parseDirectoryPayload(\n  payload: unknown,\n  mediaBase: string = MYCHART_MEDIA_BASE,\n): MyChartInstance[] {\n  const organizations = (payload as { organizations?: unknown } | null)?.organizations;\n  if (!Array.isArray(organizations)) {\n    throw new Error(\n      'MyChart directory response has no \"organizations\" array — the endpoint shape changed.',\n    );\n  }\n  return mergeDuplicates(\n    organizations.map((org) => toInstance(org, mediaBase)).filter((i): i is MyChartInstance => i !== null),\n  );\n}\n\n/**\n * Collapse entries with the same name **and** the same URL into one, which a\n * picker would otherwise show twice: Epic lists Cleveland Clinic once for the\n * US (`320`) and once for Canada (`320-1`). The shortest `slgId` — the\n * parent's — is kept, with every entry's aliases.\n *\n * Same name alone is not a duplicate (\"Baptist Health\" is two systems, in\n * Alabama and Arkansas), and neither is same portal alone (affiliates sharing\n * a parent's MyChart are searched by their own names).\n */\nexport function mergeDuplicates(instances: MyChartInstance[]): MyChartInstance[] {\n  const groups = new Map<string, MyChartInstance[]>();\n  for (const instance of instances) {\n    const key = `${instance.name.toLowerCase()}|${instance.url}`;\n    groups.set(key, [...(groups.get(key) ?? []), instance]);\n  }\n  return [...groups.values()].map((group) => {\n    const kept = group.reduce((a, b) => (b.slgId.length < a.slgId.length ? b : a));\n    return { ...kept, aliases: [...new Set(group.flatMap((i) => i.aliases))] };\n  });\n}\n\n/**\n * Fetch every MyChart instance Epic publishes. One request; ~1400 entries.\n *\n * Both endpoints are overridable, and they move together: an entry's `logo` is\n * an id and a filename, not a URL, so a directory served from somewhere else\n * has its images somewhere else too. Point them at fake-mychart and nothing\n * touches Epic.\n */\nexport async function fetchMyChartDirectory(\n  options: { directoryUrl?: string; mediaBase?: string } = {},\n): Promise<MyChartInstance[]> {\n  const url = options.directoryUrl ?? MYCHART_DIRECTORY_API_URL;\n  const response = await scraperFetch(url, { headers: { Accept: 'application/json' } });\n  if (!response.ok) {\n    throw new Error(`MyChart directory request failed: ${response.status} ${response.statusText}`);\n  }\n  return parseDirectoryPayload(await response.json(), options.mediaBase);\n}\n\n/** A fetched logo, ready to render or to store. */\nexport interface MyChartIcon {\n  /** Where it came from. */\n  url: string;\n  /** As reported by the server, defaulted to PNG (what Epic serves). */\n  contentType: string;\n  bytes: Uint8Array;\n  /** `data:<contentType>;base64,…` — renderable directly by an `<Image>`. */\n  dataUri: string;\n}\n\nfunction contentTypeFor(response: Response, url: string): string {\n  const header = response.headers.get('content-type');\n  if (header) {\n    const type = header.split(';')[0]?.trim();\n    if (type) return type;\n  }\n  if (/\\.svg$/i.test(url)) return 'image/svg+xml';\n  if (/\\.jpe?g$/i.test(url)) return 'image/jpeg';\n  return 'image/png';\n}\n\n/**\n * Fetch one instance's logo.\n *\n * Takes the instance itself or a bare logo URL, so a caller holding a whole\n * directory entry doesn't have to reach into it. Returns null when the logo is\n * simply not there (a 404, an unreachable host) — a missing logo is a blank\n * square in a picker, never a reason to fail whatever the caller was doing.\n * A malformed argument still throws, because that is a bug in the caller.\n */\nexport async function fetchMyChartIcon(\n  instanceOrUrl: string | Pick<MyChartInstance, 'logoUrl'>,\n): Promise<MyChartIcon | null> {\n  const url = typeof instanceOrUrl === 'string' ? instanceOrUrl : instanceOrUrl.logoUrl;\n  if (!url) return null;\n\n  let response: Response;\n  try {\n    response = await scraperFetch(url, {\n      headers: { Accept: 'image/avif,image/webp,image/apng,image/*,*/*;q=0.8' },\n    });\n  } catch {\n    return null;\n  }\n  if (!response.ok) return null;\n\n  const bytes = new Uint8Array(await response.arrayBuffer());\n  if (bytes.length === 0) return null;\n\n  const contentType = contentTypeFor(response, url);\n  return {\n    url,\n    contentType,\n    bytes,\n    dataUri: `data:${contentType};base64,${Buffer.from(bytes).toString('base64')}`,\n  };\n}\n\n/**\n * Every mount prefix the bundled directory publishes for a host, most-listed\n * first. A host that serves several tenants (`mychart.adventhealth.com/gracemedical`,\n * `/shepherdshope`, …) often has no default at its root, so discovery has\n * nowhere to land — but Epic's own picker knows every mount on it.\n */\nexport function directoryPrefixesFor(hostname: string): string[] {\n  const wanted = hostname.toLowerCase();\n  const counts = new Map<string, number>();\n  for (const instance of listMyCharts()) {\n    let url: URL;\n    try {\n      url = new URL(instance.url);\n    } catch {\n      continue;\n    }\n    if (url.host.toLowerCase() !== wanted) continue;\n    const prefix = url.pathname.split('/').find(Boolean);\n    if (!prefix || prefix.toLowerCase() === 'authentication') continue;\n    counts.set(prefix, (counts.get(prefix) ?? 0) + 1);\n  }\n  return [...counts].sort((a, b) => b[1] - a[1]).map(([prefix]) => prefix);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as cheerio from 'cheerio';\nimport { logger } from '../../../shared/logger';\n\n\nexport function getRequestVerificationTokenFromBody(html: string): string | undefined {\n  const $ = cheerio.load(html);\n\n  const tokenEle = $('input[name=\"__RequestVerificationToken\"]')\n\n  const requestVerificationToken = tokenEle?.[0]?.attribs?.value\n\n  if (!requestVerificationToken) {\n    logger.debug('could not find request verification token')\n    return undefined;\n  }\n\n  return requestVerificationToken;\n\n}\n\n/**\n * A MyChart activity page that carried no `__RequestVerificationToken`. The\n * API behind every activity refuses a request without one, so there is no\n * honest way to continue — and returning an empty result here is how \"the\n * session died\" used to read as \"this patient has no allergies\".\n */\nexport class MissingVerificationTokenError extends Error {\n  constructor(pagePath: string) {\n    super(\n      `No request verification token on ${pagePath}. The session may have expired, or this ` +\n        'instance does not serve that activity.',\n    );\n    this.name = 'MissingVerificationTokenError';\n  }\n}\n\n/** The page's antiforgery token, or a {@link MissingVerificationTokenError}. */\nexport function requireVerificationToken(html: string, pagePath: string): string {\n  const token = getRequestVerificationTokenFromBody(html);\n  if (!token) throw new MissingVerificationTokenError(pagePath);\n  return token;\n}\n\n/**\n * Sentinel returned by parseMyChartDate for missing/unparseable input.\n * Negative-infinity sorts before any valid date (including pre-1970),\n * so a newest-first sort using this key always places undated items last.\n */\nexport const MISSING_DATE = Number.NEGATIVE_INFINITY;\n\n/**\n * Parse a MyChart date string (ISO 8601 preferred, falls back to human\n * display like \"May 12, 2026 8:56 PM\") into epoch milliseconds.\n * Returns MISSING_DATE for empty/unparseable input so undated items sort\n * after any valid date (including pre-1970) in newest-first comparisons.\n */\nexport function parseMyChartDate(s: string | undefined | null): number {\n  if (!s) return MISSING_DATE;\n  const ms = Date.parse(s);\n  return Number.isNaN(ms) ? MISSING_DATE : ms;\n}\n\n/**\n * Sort items newest-first in place using a date extractor. Items returning\n * MISSING_DATE from the key fn land at the end. Returns the same array.\n */\nexport function sortNewestFirstByDate<T>(items: T[], keyFn: (item: T) => number): T[] {\n  return items.sort((a, b) => keyFn(b) - keyFn(a));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Anonymous usage telemetry, modelled after Next.js / Vercel CLI:\n *\n * - One stable random UUID per computer, stored as `deviceId` in\n *   `~/.openrecord.json` and shared by the CLI and the MCPB. Never derived\n *   from identifying information.\n * - Event payload is event name + properties + OS platform/arch +\n *   runtime version. No OS hostname, no git config.\n * - An event sent with a `user` (the MCPB's per-tool-call event) is NOT\n *   anonymous: it carries the user's email and MyChart username, and asks\n *   Amplitude to record the request's IP address.\n * - Opt out by setting `MYCHART_CLI_TELEMETRY_DISABLED` to any\n *   truthy value.\n *\n * Every event fans out to two independent sinks:\n *   1. Amplitude (product analytics UI)\n *   2. our own analytics Lambda, which writes to CloudWatch Logs\n *      (repo: Fan-Pier-Labs/openrecord-analytics)\n * Both are best-effort; a failure in one never affects the other.\n *\n * Fire-and-forget. Never throws, never blocks the caller.\n */\n\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport { randomUUID } from 'crypto';\n\nconst AMPLITUDE_API_KEY = 'a7d8557f623f24012e62edc61bbc0fd6';\nconst AMPLITUDE_HTTP_API = 'https://api2.amplitude.com/2/httpapi';\n\n/**\n * Self-hosted analytics sink (API Gateway → Lambda → CloudWatch Logs).\n * Redirect it with `OPENRECORD_ANALYTICS_ENDPOINT`, or turn this sink\n * off on its own with `OPENRECORD_ANALYTICS_DISABLED`.\n * `MYCHART_CLI_TELEMETRY_DISABLED` still disables everything at once.\n *\n * Read at call time rather than module load so tests (and consumers\n * that set env vars during startup) see the current value.\n */\nconst DEFAULT_ANALYTICS_ENDPOINT = 'https://pumlxw0t7e.execute-api.us-east-2.amazonaws.com';\n\nfunction analyticsEndpoint(): string {\n  if (process.env.OPENRECORD_ANALYTICS_DISABLED) return '';\n  return process.env.OPENRECORD_ANALYTICS_ENDPOINT || DEFAULT_ANALYTICS_ENDPOINT;\n}\n\n/** How long we'll wait on a telemetry request before giving up. */\nconst REQUEST_TIMEOUT_MS = 5000;\n\n/**\n * The opt-out for telemetry events. The version check ignores it — it sends\n * nothing but the request itself. Exported so the MCPB can skip the MyChart\n * email lookup behind its tool-call event, not just the send.\n *\n * `bun test` sets NODE_ENV=test, and every CI run would otherwise post its\n * deliberately failing tool calls and fake-mychart logins to production\n * analytics. Child processes inherit it, so the built CLI the integration\n * suites spawn stays quiet too. The telemetry suites set it back themselves.\n */\nexport function isTelemetryDisabled(): boolean {\n  return Boolean(process.env.MYCHART_CLI_TELEMETRY_DISABLED) || process.env.NODE_ENV === 'test';\n}\n\n/** Used only when `~/.openrecord.json` can't be read or written. */\nlet fallbackDeviceId: string | undefined;\n\n/**\n * Read or create a stable random UUID in `~/.openrecord.json`. The ID is not\n * derived from any identifying information; it exists purely to tie one\n * computer's events together. Re-read on every event rather than cached, so\n * a CLI run and the MCPB that start at once settle on whichever ID landed.\n */\nexport function getAnonymousId(): string {\n  const file = path.join(os.homedir(), '.openrecord.json');\n  try {\n    let config: Record<string, unknown> = {};\n    if (fs.existsSync(file)) {\n      config = JSON.parse(fs.readFileSync(file, 'utf8')) as Record<string, unknown>;\n      if (typeof config.deviceId === 'string' && config.deviceId) return config.deviceId;\n    }\n    const fresh = randomUUID();\n    fs.writeFileSync(file, `${JSON.stringify({ ...config, deviceId: fresh }, null, 2)}\\n`, { mode: 0o600 });\n    return fresh;\n  } catch {\n    // A corrupt file or a read-only home: don't overwrite it, but keep one ID\n    // for the life of the process so this run's events still group.\n    return (fallbackDeviceId ??= randomUUID());\n  }\n}\n\nexport interface EnvInfo {\n  platform: string;\n  arch: string;\n  runtime_version: string;\n  os_version: string;\n}\n\n/** Gather non-identifying environment info. */\nexport function gatherEnvInfo(): EnvInfo {\n  return {\n    platform: os.platform(),\n    arch: os.arch(),\n    // Read off globalThis so this file typechecks under tsconfigs without bun\n    // types (the expo app imports it directly).\n    runtime_version: (() => {\n      const bun = (globalThis as { Bun?: { version: string } }).Bun;\n      return bun ? `bun ${bun.version}` : `node ${process.version}`;\n    })(),\n    os_version: os.release(),\n  };\n}\n\n/** POST a JSON body, aborting after REQUEST_TIMEOUT_MS. Never throws. */\nasync function postJson(url: string, body: unknown): Promise<void> {\n  try {\n    const controller = new AbortController();\n    const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);\n    try {\n      await fetch(url, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify(body),\n        signal: controller.signal,\n      });\n    } finally {\n      clearTimeout(timeout);\n    }\n  } catch {\n    // Silently ignore — telemetry must never break the app.\n  }\n}\n\nexport interface ErrorReport {\n  name: string;\n  message: string;\n  /** The full stack, then each `cause`'s stack in turn. */\n  stack: string;\n}\n\n/** Anything thrown, as name + message + stack. A non-Error throw has no stack to give. */\nexport function describeError(error: unknown): ErrorReport {\n  if (!(error instanceof Error)) {\n    const text = typeof error === 'string' ? error : JSON.stringify(error) ?? String(error);\n    return { name: 'NonError', message: text, stack: text };\n  }\n  const stacks: string[] = [];\n  // Bounded, since a cause chain can loop.\n  for (let e: unknown = error; e !== undefined && stacks.length < 10; e = (e as Error).cause) {\n    stacks.push(e instanceof Error ? (e.stack ?? `${e.name}: ${e.message}`) : describeError(e).stack);\n  }\n  // The home folder is usually named after the macOS user.\n  const stack = stacks.join('\\nCaused by: ').replaceAll(os.homedir(), '~');\n  return { name: error.name, message: error.message, stack };\n}\n\n/**\n * Send a telemetry event to both sinks (Amplitude and our analytics\n * Lambda). Fire-and-forget. Never throws. Returns immediately when\n * telemetry is disabled via `MYCHART_CLI_TELEMETRY_DISABLED`.\n *\n * `source` identifies the client emitting the event ('cli', 'scraper',\n * 'openclaw', …) and is only used by the self-hosted sink; Amplitude\n * distinguishes clients by event name. `error` rides along as name, message\n * and full stack: as event properties on Amplitude, which truncates long\n * values, and whole as a top-level `error` for the Lambda.\n */\nexport function sendTelemetryEvent(\n  eventType: string,\n  eventProperties: Record<string, unknown> = {},\n  source = 'node',\n  user?: { email?: string | undefined; username?: string | undefined },\n  error?: unknown,\n): void {\n  if (isTelemetryDisabled()) return;\n\n  void (async () => {\n    try {\n      const envInfo = gatherEnvInfo();\n      const deviceId = getAnonymousId();\n      const properties = {\n        ...eventProperties,\n        arch: envInfo.arch,\n        runtime_version: envInfo.runtime_version,\n      };\n      const failure = error === undefined ? undefined : describeError(error);\n\n      const email = user?.email;\n      const username = user?.username;\n      const amplitude = postJson(AMPLITUDE_HTTP_API, {\n        api_key: AMPLITUDE_API_KEY,\n        events: [\n          {\n            device_id: deviceId,\n            event_type: eventType,\n            time: Date.now(),\n            platform: envInfo.platform,\n            os_name: envInfo.platform,\n            os_version: envInfo.os_version,\n            event_properties: failure\n              ? { ...properties, error_name: failure.name, error_message: failure.message, error_stack: failure.stack }\n              : properties,\n            // '$remote' tells Amplitude to record the IP the upload came from.\n            ...(user ? { ip: '$remote' } : {}),\n            ...(email ? { user_id: email } : {}),\n            ...(email || username\n              ? { user_properties: { ...(email ? { email } : {}), ...(username ? { username } : {}) } }\n              : {}),\n          },\n        ],\n      });\n\n      const endpoint = analyticsEndpoint();\n      const selfHosted = endpoint\n        ? postJson(endpoint, {\n            source,\n            deviceId,\n            // The key's presence tells the Lambda to log this event's email and\n            // the request's IP, which it reads off the request itself.\n            ...(user ? { email: email ?? null, username: username ?? null } : {}),\n            ...(failure ? { error: failure } : {}),\n            event: eventType,\n            ts: Date.now(),\n            properties: {\n              ...properties,\n              platform: envInfo.platform,\n              os_version: envInfo.os_version,\n            },\n          })\n        : Promise.resolve();\n\n      // Independent sinks: one failing must not cancel the other.\n      await Promise.allSettled([amplitude, selfHosted]);\n    } catch {\n      // Silently ignore — telemetry must never break the app.\n    }\n  })();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as cheerio from 'cheerio';\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { getRequestVerificationTokenFromBody } from '../core/util';\nimport { logger } from '../../../shared/logger';\n\n/**\n * Accept MyChart's Terms & Conditions on behalf of the user.\n *\n * Some MyChart instances present a T&C page\n * after login/2FA that must be accepted before any other page or API will work.\n * Every request redirects to /Authentication/TermsConditions until accepted.\n *\n * This is called automatically during login/2FA when the T&C page is detected.\n * The user consents to this at signup via the app-level Terms of Service checkbox.\n *\n * Returns true if T&C was accepted successfully, false if it failed.\n */\nexport async function acceptTermsAndConditions(mychartRequest: MyChartRequest): Promise<boolean> {\n  // Navigate to the T&C page\n  const res = await mychartRequest.makeRequest({ path: '/Authentication/TermsConditions' });\n  const body = await res.text();\n\n  const $ = cheerio.load(body);\n\n  // Extract the CSRF token from the T&C page\n  const csrfToken = getRequestVerificationTokenFromBody(body);\n\n  // Look for a form on the page\n  const form = $('form');\n  let formAction = '';\n  if (form.length > 0) {\n    formAction = form.attr('action') || '';\n  }\n\n  // Collect all hidden form fields\n  const formFields: Record<string, string> = {};\n  $('input[type=\"hidden\"]').each((_, el) => {\n    const name = $(el).attr('name');\n    const value = $(el).attr('value') || '';\n    if (name) {\n      formFields[name] = value;\n    }\n  });\n\n  if (!csrfToken) {\n    logger.debug('[terms] No CSRF token found on Terms & Conditions page');\n    return false;\n  }\n\n  // Build form-encoded body with all hidden fields\n  const formBody = Object.entries(formFields)\n    .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n    .join('&');\n\n  // Determine the POST URL\n  let postPath = formAction;\n  if (!postPath || postPath === '#') {\n    // Use path (not root-relative) so makeRequest prepends the firstPathPart\n    postPath = '/Authentication/TermsConditions';\n  }\n\n  // If the form action starts with \"/\" it's a root-relative path that already\n  // includes the firstPathPart (e.g. \"/MyChart/Authentication/TermsConditions\").\n  // Convert it to an absolute URL to avoid makeRequest prepending firstPathPart again.\n  const isAbsolute = postPath.startsWith('http');\n  const isRootRelative = postPath.startsWith('/') && formAction && formAction !== '#';\n  let requestConfig: { url?: string; path?: string };\n  if (isAbsolute) {\n    requestConfig = { url: postPath };\n  } else if (isRootRelative) {\n    // Form action from the page already includes firstPathPart\n    requestConfig = { url: `${mychartRequest.protocol}://${mychartRequest.hostname}${postPath}` };\n  } else {\n    // Fallback or relative path — let makeRequest prepend firstPathPart\n    requestConfig = { path: postPath };\n  }\n\n  logger.debug('[terms] Posting T&C acceptance to:', postPath);\n  logger.debug('[terms] Form fields:', Object.keys(formFields).join(', '));\n\n  const acceptResp = await mychartRequest.makeRequest({\n    ...requestConfig,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded',\n    },\n    body: formBody,\n  });\n\n  const acceptBody = await acceptResp.text();\n  const acceptUrl = acceptResp.url || '';\n\n  // Check if we're no longer on the T&C page\n  if (!acceptUrl.toLowerCase().includes('termsconditions') &&\n      !acceptBody.toLowerCase().includes('termsconditions')) {\n    logger.debug('[terms] Terms & Conditions accepted successfully');\n    return true;\n  }\n\n  // If still on T&C, try clicking accept links\n  logger.debug('[terms] First POST did not clear T&C page');\n  logger.debug('[terms] Response status:', acceptResp.status);\n\n  // Look for accept buttons/links\n  const $accept = cheerio.load(acceptBody);\n  const acceptLinks: string[] = [];\n  $accept('a, button').each((_, el) => {\n    const text = $accept(el).text().toLowerCase().trim();\n    if (text.includes('accept') || text.includes('agree') || text.includes('continue') || text.includes('i accept')) {\n      const href = $accept(el).attr('href');\n      if (href) acceptLinks.push(href);\n    }\n  });\n\n  for (const link of acceptLinks) {\n    logger.debug('[terms] Trying accept link:', link);\n    const linkIsAbsolute = link.startsWith('http');\n    const linkIsRootRelative = link.startsWith('/');\n    let linkConfig: { url?: string; path?: string };\n    if (linkIsAbsolute) {\n      linkConfig = { url: link };\n    } else if (linkIsRootRelative) {\n      linkConfig = { url: `${mychartRequest.protocol}://${mychartRequest.hostname}${link}` };\n    } else {\n      linkConfig = { path: link };\n    }\n    const linkResp = await mychartRequest.makeRequest(linkConfig);\n    const linkBody = await linkResp.text();\n    const linkUrl = linkResp.url || '';\n\n    if (!linkUrl.toLowerCase().includes('termsconditions') &&\n        !linkBody.toLowerCase().includes('termsconditions')) {\n      logger.debug('[terms] Terms & Conditions accepted via link');\n      return true;\n    }\n  }\n\n  logger.debug('[terms] Could not accept Terms & Conditions');\n  return false;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * MyChart instances that are known to not work and should be blocked\n * from being added by users.\n */\nexport const BLOCKED_MYCHART_INSTANCES: readonly string[] = [\n  'central.mychart.org',\n];\n\n/**\n * Check if a hostname is blocked. Compares against the blocklist\n * after normalizing to lowercase.\n */\nexport function isBlockedInstance(hostname: string): boolean {\n  const normalized = hostname.toLowerCase().trim();\n  return BLOCKED_MYCHART_INSTANCES.some(\n    (blocked) => normalized === blocked || normalized.endsWith('.' + blocked)\n  );\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport crypto from 'crypto';\n\n/**\n * Serialized passkey credential for storage.\n * Contains everything needed to authenticate with a MyChart account via WebAuthn.\n */\nexport interface PasskeyCredential {\n  /** Base64-encoded credential ID (raw bytes) */\n  credentialId: string;\n  /** Base64-encoded ECDSA P-256 private key (DER/PKCS8 format) */\n  privateKey: string;\n  /** The relying party ID used during registration */\n  rpId: string;\n  /** Base64-encoded user handle from registration */\n  userHandle: string;\n  /** Sign counter (incremented on each use) */\n  signCount: number;\n}\n\n/**\n * Result of creating a new passkey credential.\n * Contains the server-bound response fields AND the credential for local storage.\n */\nexport interface RegistrationResult {\n  /** Data to send to MyChart's CreatePasskey API */\n  serverResponse: {\n    rawId: string;\n    attestationData: string;\n    clientDataJSON: string;\n    indexForDefaultName: number;\n  };\n  /** Credential to store locally for future authentication */\n  credential: PasskeyCredential;\n}\n\n/**\n * Result of authenticating with a passkey credential.\n * Contains the fields to send in the DoLogin request.\n */\nexport interface AuthenticationResult {\n  id: string;\n  type: 'public-key';\n  rawId: string;\n  authenticatorAssertion: {\n    clientDataJSON: string;\n    authenticatorData: string;\n    signature: string;\n    userHandle: string;\n  };\n}\n\n/**\n * WebAuthn creation options as returned by MyChart's GenerateCreateRequest API.\n */\nexport interface MyChartCreationOptions {\n  rp: { id: string; name: string };\n  attestation: string;\n  authenticatorSelection: {\n    requireResidentKey: boolean;\n    residentKey: string;\n    userVerification: string;\n  };\n  challenge: string; // base64\n  pubKeyCredParams: Array<{ type: string; alg: number }>;\n  timeout: number;\n  user: { id: string; name: string; displayName: string };\n  excludeCredentials: Array<{ id: string; type: string }>;\n}\n\n// ─── Minimal CBOR encoder ───\n// Only handles the types needed for WebAuthn: maps, text strings, byte strings, integers.\n// Uses compact encoding (1-byte lengths for small values).\n\nfunction cborEncodeUint(majorType: number, value: number): Buffer {\n  const mt = majorType << 5;\n  if (value < 24) return Buffer.from([mt | value]);\n  if (value < 256) return Buffer.from([mt | 24, value]);\n  if (value < 65536) { const b = Buffer.alloc(3); b[0] = mt | 25; b.writeUInt16BE(value, 1); return b; }\n  const b = Buffer.alloc(5); b[0] = mt | 26; b.writeUInt32BE(value, 1); return b;\n}\n\nfunction cborEncodeNegInt(value: number): Buffer {\n  // CBOR negative: major type 1, value = -1 - n\n  return cborEncodeUint(1, -1 - value);\n}\n\nfunction cborEncodeTextString(str: string): Buffer {\n  const strBuf = Buffer.from(str, 'utf-8');\n  return Buffer.concat([cborEncodeUint(3, strBuf.length), strBuf]);\n}\n\nfunction cborEncodeByteString(buf: Buffer | Uint8Array): Buffer {\n  return Buffer.concat([cborEncodeUint(2, buf.length), Buffer.from(buf)]);\n}\n\nfunction cborEncodeMap(entries: Array<{ key: number | string; value: Buffer }>): Buffer {\n  const header = cborEncodeUint(5, entries.length);\n  const parts = [header];\n  for (const { key, value } of entries) {\n    if (typeof key === 'number') {\n      parts.push(key >= 0 ? cborEncodeUint(0, key) : cborEncodeNegInt(key));\n    } else {\n      parts.push(cborEncodeTextString(key));\n    }\n    parts.push(value);\n  }\n  return Buffer.concat(parts);\n}\n\n/**\n * CBOR-encode a COSE public key Map (integer keys).\n */\nfunction cborEncodeCoseKey(entries: Map<number, number | Buffer>): Buffer {\n  const mapEntries: Array<{ key: number; value: Buffer }> = [];\n  for (const [key, value] of entries) {\n    let encodedValue: Buffer;\n    if (typeof value === 'number') {\n      encodedValue = value >= 0 ? cborEncodeUint(0, value) : cborEncodeNegInt(value);\n    } else {\n      encodedValue = cborEncodeByteString(value);\n    }\n    mapEntries.push({ key, value: encodedValue });\n  }\n  return cborEncodeMap(mapEntries);\n}\n\n/**\n * CBOR-encode the attestation object: { fmt: \"none\", attStmt: {}, authData: <bytes> }\n */\nfunction cborEncodeAttestationObject(authData: Buffer): Buffer {\n  return cborEncodeMap([\n    { key: 'fmt', value: cborEncodeTextString('none') },\n    { key: 'attStmt', value: cborEncodeMap([]) }, // empty map\n    { key: 'authData', value: cborEncodeByteString(authData) },\n  ]);\n}\n\n/**\n * Convert a standard base64 string to a Buffer.\n * MyChart uses standard base64 (btoa/atob), not base64url.\n */\nfunction base64ToBuffer(b64: string): Buffer {\n  return Buffer.from(b64, 'base64');\n}\n\n/**\n * Convert a Buffer to standard base64 string.\n */\nfunction bufferToBase64(buf: Buffer | Uint8Array | ArrayBuffer): string {\n  return Buffer.from(buf as ArrayBuffer).toString('base64');\n}\n\n/**\n * Coerce whatever the runtime crypto returned (Node Buffer, Hermes\n * ArrayBuffer, or a TypedArray view) into a real Buffer. react-native-quick-crypto\n * hands back ArrayBuffers from generateKeyPairSync; the rest of this file\n * assumes Buffer-style byte indexing (`b[i]`) and `subarray`, so we normalize.\n */\nfunction toBuffer(input: Buffer | ArrayBuffer | Uint8Array): Buffer {\n  if (Buffer.isBuffer(input)) return input;\n  if (ArrayBuffer.isView(input)) {\n    return Buffer.from(input.buffer, input.byteOffset, input.byteLength);\n  }\n  return Buffer.from(input);\n}\n\n/**\n * Build the COSE-encoded public key for an ECDSA P-256 key.\n * COSE key format for EC2 (RFC 8152):\n *   1 (kty): 2 (EC2)\n *   3 (alg): -7 (ES256)\n *  -1 (crv): 1 (P-256)\n *  -2 (x): 32-byte x coordinate\n *  -3 (y): 32-byte y coordinate\n */\nfunction buildCosePublicKey(publicKeyDer: Buffer): Buffer {\n  // Extract raw x,y coordinates from the uncompressed public key point (04 || x || y)\n  const rawPubKey = extractRawPublicKey(publicKeyDer);\n  const x = rawPubKey.subarray(1, 33); // skip 0x04 prefix\n  const y = rawPubKey.subarray(33, 65);\n\n  // CBOR-encode the COSE key map\n  const coseKey = new Map<number, number | Buffer>();\n  coseKey.set(1, 2);   // kty: EC2\n  coseKey.set(3, -7);  // alg: ES256\n  coseKey.set(-1, 1);  // crv: P-256\n  coseKey.set(-2, x);  // x coordinate\n  coseKey.set(-3, y);  // y coordinate\n\n  return cborEncodeCoseKey(coseKey);\n}\n\n/**\n * Extract the raw uncompressed public key (65 bytes: 04 || x || y) from a DER-encoded SPKI public key.\n *\n * Accepts any byte container (Buffer, Uint8Array, ArrayBuffer) because\n * react-native-quick-crypto returns ArrayBuffers from generateKeyPairSync,\n * which don't support `[i]` byte indexing.\n */\nfunction extractRawPublicKey(spkiDer: Buffer | ArrayBuffer | Uint8Array): Buffer {\n  const bytes = toBuffer(spkiDer);\n  // The uncompressed point is at the end of the SPKI structure.\n  // For P-256, it's always 65 bytes (0x04 + 32 bytes x + 32 bytes y).\n  // Find the 0x04 byte that starts the uncompressed point.\n  // In SPKI format, it's preceded by a BIT STRING tag with a 0x00 unused-bits byte.\n  for (let i = bytes.length - 65; i >= 0; i--) {\n    if (bytes[i] === 0x04 && bytes.length - i >= 65) {\n      return Buffer.from(bytes.subarray(i, i + 65));\n    }\n  }\n  throw new Error(\n    `Could not extract raw public key from SPKI DER (length=${bytes.length})`,\n  );\n}\n\n/**\n * Build the authenticatorData for a registration (create) operation.\n *\n * Format (variable length):\n *   rpIdHash (32 bytes) || flags (1 byte) || signCount (4 bytes) || attestedCredentialData\n *\n * attestedCredentialData:\n *   aaguid (16 bytes) || credIdLen (2 bytes) || credentialId || credentialPublicKey (COSE)\n *\n * Flags: UP (0x01) | UV (0x04) | AT (0x40) = 0x45\n */\nfunction buildAuthDataForCreate(\n  rpId: string,\n  credentialId: Buffer,\n  publicKeyDer: Buffer,\n  signCount: number,\n): Buffer {\n  const rpIdHash = crypto.createHash('sha256').update(rpId).digest();\n  const flags = Buffer.from([0x45]); // UP + UV + AT\n  const counter = Buffer.alloc(4);\n  counter.writeUInt32BE(signCount);\n\n  // Attested credential data\n  const aaguid = Buffer.alloc(16); // all zeros for software authenticator\n  const credIdLen = Buffer.alloc(2);\n  credIdLen.writeUInt16BE(credentialId.length);\n  const cosePublicKey = buildCosePublicKey(publicKeyDer);\n\n  return Buffer.concat([rpIdHash, flags, counter, aaguid, credIdLen, credentialId, cosePublicKey]);\n}\n\n/**\n * Build the authenticatorData for an authentication (get) operation.\n *\n * Format:\n *   rpIdHash (32 bytes) || flags (1 byte) || signCount (4 bytes)\n *\n * Flags: UP (0x01) | UV (0x04) = 0x05\n */\nfunction buildAuthDataForGet(rpId: string, signCount: number): Buffer {\n  const rpIdHash = crypto.createHash('sha256').update(rpId).digest();\n  const flags = Buffer.from([0x05]); // UP + UV\n  const counter = Buffer.alloc(4);\n  counter.writeUInt32BE(signCount);\n\n  return Buffer.concat([rpIdHash, flags, counter]);\n}\n\n/**\n * Build the clientDataJSON for a WebAuthn operation.\n * This is a JSON object that gets base64-encoded.\n *\n * MyChart uses standard base64 (btoa), not base64url.\n */\nfunction base64ToBase64Url(b64: string): string {\n  return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\n\nfunction buildClientDataJSON(\n  type: 'webauthn.create' | 'webauthn.get',\n  challenge: string, // base64 from server\n  origin: string,\n): Buffer {\n  // WebAuthn spec: challenge in clientDataJSON must be base64url-encoded.\n  // The server sends it as standard base64, so convert: decode → re-encode as base64url.\n  // (Avoid `.toString('base64url')` — Hermes' Buffer polyfill doesn't support it.)\n  const challengeBase64url = base64ToBase64Url(challenge);\n  const clientData = {\n    type,\n    challenge: challengeBase64url,\n    origin,\n    crossOrigin: false,\n  };\n  return Buffer.from(JSON.stringify(clientData));\n}\n\n/**\n * Create a new passkey credential for registration with a MyChart account.\n *\n * This replaces what the browser's `navigator.credentials.create()` does:\n * 1. Generates an ECDSA P-256 key pair\n * 2. Builds the clientDataJSON\n * 3. Builds the attestationObject with \"none\" attestation\n * 4. Returns both the server response and the credential for local storage\n */\nexport function createCredential(\n  options: MyChartCreationOptions,\n  origin: string,\n  indexForDefaultName: number = 0,\n): RegistrationResult {\n  // Generate ECDSA P-256 key pair. On Node these come back as Buffers;\n  // on Hermes / react-native-quick-crypto they come back as ArrayBuffers.\n  // Normalize once so the rest of the code can rely on Buffer semantics.\n  const { publicKey, privateKey } = crypto.generateKeyPairSync('ec', {\n    namedCurve: 'P-256',\n    publicKeyEncoding: { type: 'spki', format: 'der' },\n    privateKeyEncoding: { type: 'pkcs8', format: 'der' },\n  });\n  const publicKeyBuf = toBuffer(publicKey);\n  const privateKeyBuf = toBuffer(privateKey);\n\n  // Generate a random credential ID (32 bytes)\n  const credentialId = crypto.randomBytes(32);\n\n  // Determine the RP ID: empty string in MyChart means use the origin's hostname\n  const rpId = options.rp.id || new URL(origin).hostname;\n\n  // Build clientDataJSON\n  const clientDataJSON = buildClientDataJSON('webauthn.create', options.challenge, origin);\n\n  // Build authenticator data with attested credential data\n  const authData = buildAuthDataForCreate(rpId, credentialId, publicKeyBuf, 0);\n\n  // Build attestation object (CBOR-encoded) with \"none\" format\n  const attestationObject = cborEncodeAttestationObject(authData);\n\n  return {\n    serverResponse: {\n      rawId: bufferToBase64(credentialId),\n      attestationData: bufferToBase64(attestationObject),\n      clientDataJSON: bufferToBase64(clientDataJSON),\n      indexForDefaultName,\n    },\n    credential: {\n      credentialId: bufferToBase64(credentialId),\n      privateKey: bufferToBase64(privateKeyBuf),\n      rpId,\n      userHandle: options.user.id,\n      signCount: 0,\n    },\n  };\n}\n\n/**\n * Authenticate with a stored passkey credential.\n *\n * This replaces what the browser's `navigator.credentials.get()` does:\n * 1. Builds the clientDataJSON\n * 2. Builds the authenticatorData\n * 3. Signs (authenticatorData || SHA-256(clientDataJSON)) with the private key\n * 4. Returns the assertion response for the DoLogin request\n */\nexport function createAssertion(\n  credential: PasskeyCredential,\n  challenge: string, // base64 from server\n  origin: string,\n): AuthenticationResult {\n  // Increment sign counter\n  credential.signCount++;\n\n  // Build clientDataJSON\n  const clientDataJSON = buildClientDataJSON('webauthn.get', challenge, origin);\n\n  // Build authenticator data (no attested credential data for get)\n  const authData = buildAuthDataForGet(credential.rpId, credential.signCount);\n\n  // Sign: authenticatorData || SHA-256(clientDataJSON)\n  const clientDataHash = crypto.createHash('sha256').update(clientDataJSON).digest();\n  const signatureBase = Buffer.concat([authData, clientDataHash]);\n\n  // Import the private key and sign\n  const privateKeyObj = crypto.createPrivateKey({\n    key: base64ToBuffer(credential.privateKey),\n    format: 'der',\n    type: 'pkcs8',\n  });\n\n  // ECDSA signature in DER format (which is what WebAuthn expects)\n  const signature = crypto.sign('SHA256', signatureBase, privateKeyObj);\n\n  // The browser's PublicKeyCredential.id is base64url-encoded,\n  // while rawId is standard base64 (btoa of the ArrayBuffer bytes).\n  const idBase64url = base64ToBase64Url(credential.credentialId);\n\n  return {\n    id: idBase64url,\n    type: 'public-key',\n    rawId: credential.credentialId,\n    authenticatorAssertion: {\n      clientDataJSON: bufferToBase64(clientDataJSON),\n      authenticatorData: bufferToBase64(authData),\n      signature: bufferToBase64(signature),\n      userHandle: credential.userHandle,\n    },\n  };\n}\n\n/**\n * Serialize a passkey credential to a JSON string for storage.\n */\nexport function serializeCredential(credential: PasskeyCredential): string {\n  return JSON.stringify(credential);\n}\n\n/**\n * Deserialize a passkey credential from a JSON string.\n */\nexport function deserializeCredential(json: string): PasskeyCredential {\n  return JSON.parse(json) as PasskeyCredential;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { MyChartRequest } from \"../core/myChartRequest\";\nimport { directoryPrefixesFor } from '../../list-all-mycharts/directory';\nimport * as cheerio from 'cheerio';\n\nimport { getRequestVerificationTokenFromBody } from \"../core/util\";\nimport { sendTelemetryEvent } from \"../../../shared/telemetry\";\nimport { acceptTermsAndConditions } from \"./termsAndConditions\";\nimport { isBlockedInstance } from \"./blockedInstances\";\nimport { createAssertion, type PasskeyCredential } from \"./softwareAuthenticator\";\nimport { logger } from '../../../shared/logger';\n\n\n// MyChart's login route. When a root redirect lands on it, everything in front\n// of it is the deployment prefix — and for root-mounted instances that's nothing.\nconst MYCHART_LOGIN_ROUTE = '/authentication/';\n\n/**\n * Where a MyChart deployment actually lives: the host serving it, and the\n * prefix its routes sit under (null for a root-mounted instance).\n *\n * The host is part of it because portals move. `patients.mycslink.org` redirects\n * to `mycslink.cedars-sinai.org/mycslink`, `login.wellspan.org` to\n * `my.wellspan.org/mywellspan` — the hostname a user hands us is often a\n * vanity alias for a deployment that lives somewhere else entirely.\n */\nexport type MountLocation = { hostname: string; firstPathPart: string | null };\n\n/** How many hops to follow before deciding a redirect chain is a loop. */\nconst MAX_DISCOVERY_HOPS = 10;\n\n/** Does this redirect path land on a MyChart route we recognize? */\nexport function landsOnMyChartRoute(path: string): boolean {\n  return path.toLowerCase().includes(MYCHART_LOGIN_ROUTE);\n}\n\n/**\n * The deployment prefix carried by a path, whatever announced it.\n *\n *   /MyChart/                   → 'MyChart'      (uhhospitals.org and most others)\n *   /UCSFMyChart/               → 'UCSFMyChart'\n *   /Authentication/Login       → null           (Cleveland Clinic — no prefix)\n *   /prd/Authentication/Login   → 'prd'\n *\n * null means \"no prefix\": nothing at all goes in front of MyChart's routes.\n */\nfunction firstPathPartFromPathname(pathname: string): string | null {\n  const routeStart = pathname.toLowerCase().indexOf(MYCHART_LOGIN_ROUTE);\n  // Path went straight to a MyChart route — take whatever precedes it.\n  if (routeStart >= 0) return pathname.slice(1, routeStart) || null;\n  return pathname.split('/')[1] || null;\n}\n\n/**\n * Where a root page's `<meta http-equiv=\"refresh\">` points, or null if there\n * isn't one we can use.\n *\n *   0; URL=/MyChart/                              → https://<host>/MyChart/\n *   1 ;url=https://mychart.renown.org/mychart     → as written (Renown)\n *\n * The target may be relative or absolute, so it goes through `new URL` rather\n * than string surgery — stripping every `/` out of an absolute URL folds the\n * host into the prefix (`https:mychart.renown.orgmychart`).\n *\n * Pass `hostname` to reject targets pointing at another host, the same way the\n * Location-header path does: a marketing page's path is not a MyChart prefix.\n *\n * Pass `baseUrl` when the page came from somewhere other than the bare host —\n * a relative `url=DefaultAsp` partway down a redirect chain resolves against\n * the page carrying it, not against `/`.\n */\nexport function parseMetaRefreshTarget(html: string, hostname?: string, baseUrl?: string): URL | null {\n  const $ = cheerio.load(html);\n  const content = $('meta[http-equiv=\"REFRESH\"]').attr('content');\n  if (!content) return null;\n\n  // content is `<seconds>; url=<target>`. Split on the first `=` only — the target\n  // can carry its own query string (`?id=…`).\n  const afterDelay = content.split(';').slice(1).join(';');\n  const equals = afterDelay.indexOf('=');\n  if (equals < 0) return null;\n\n  const target = afterDelay.slice(equals + 1).trim().replace(/^['\"]|['\"]$/g, '');\n  if (!target) return null;\n\n  // A placeholder base resolves relative targets; absolute ones ignore it.\n  let url: URL;\n  try {\n    url = new URL(target, baseUrl ?? `https://${hostname || 'mychart.invalid'}`);\n  } catch {\n    return null;\n  }\n\n  if (hostname && url.host !== hostname) {\n    logger.debug('Meta refresh points off-host:', hostname, '->', url.host);\n    return null;\n  }\n\n  return url;\n}\n\n/**\n * Work out the deployment prefix from a `<meta http-equiv=\"refresh\">` on the root page.\n *\n *   0; URL=/MyChart/                              → 'MyChart'\n *   1 ;url=https://mychart.renown.org/mychart     → 'mychart'   (Renown — absolute URL)\n *   0; URL=/Authentication/Login                  → null        (root-mounted)\n *\n * null is ambiguous here — it means either \"root-mounted\" or \"no usable refresh\n * tag\". Callers that need to tell those apart use `parseMetaRefreshTarget` and\n * check `landsOnMyChartRoute` on the result.\n */\nexport function parseFirstPathPartFromHtml(html: string, hostname?: string): string | null {\n  const target = parseMetaRefreshTarget(html, hostname);\n  return target ? firstPathPartFromPathname(target.pathname) : null;\n}\n\n/**\n * Work out the deployment prefix from the redirect a root probe returns. See\n * `firstPathPartFromPathname` for what the shapes map to; null means \"no\n * prefix\": nothing at all goes in front of MyChart's routes.\n */\nexport function parseFirstPathPartFromLocation(locationHeader: string, hostname: string, protocol = 'https'): string | null {\n  const { pathname } = new URL(locationHeader, protocol + '://' + hostname);\n  return firstPathPartFromPathname(pathname);\n}\n\nexport function parseFirstPathPartFromInput(input: string): string | null {\n  const trimmed = input.trim();\n  try {\n    const parsed = new URL(trimmed.includes('://') ? trimmed : `https://${trimmed}`);\n    const part = parsed.pathname.split('/').find(Boolean);\n    // `part` is `.split('/').find(Boolean)`-shaped: undefined or a\n    // non-empty string, never '' — so `!part?.…` and the old `!part || !part.…`\n    // take identical branches.\n    if (!part?.toLowerCase().includes('mychart')) {\n      return null;\n    }\n    return part;\n  } catch {\n    return null;\n  }\n}\n\nexport function looksLikeLoginPage(html: string): boolean {\n  const bodyLower = html.toLowerCase();\n  return bodyLower.includes('__requestverificationtoken')\n    || bodyLower.includes('login with passkey')\n    || bodyLower.includes('forgot login information')\n    || bodyLower.includes('error: please enable cookies to log in')\n    || bodyLower.includes('secondaryvalidationcontroller')\n    || bodyLower.includes('mychart® licensed from epic');\n}\n\n/**\n * Where a root page's `window.location = \"…\"` points, or null if there isn't one.\n *\n * A handful of instances (mydovetale.ca) announce the mount from a script tag\n * instead of a meta refresh:\n *\n *   <script>window.location=\"https://mydovetale.ca/MyDovetale/\";</script>\n *\n * The target is resolved against `baseUrl` and returned as-is — whether a\n * target on another host is worth following is the caller's decision.\n */\nexport function parseScriptRedirectTarget(html: string, baseUrl: string): URL | null {\n  // window.location = \"…\" / window.location.href = '…' / location.replace(\"…\")\n  const match = (/\\b(?:window\\.)?location(?:\\.href)?\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(html))\n    ?? (/\\b(?:window\\.)?location\\.(?:replace|assign)\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/i.exec(html));\n  if (!match) return null;\n  try {\n    return new URL(match[1]!, baseUrl); // both patterns have one non-optional capture group\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Every MyChart mount a page links to, most-linked first.\n *\n * Landing pages come in two flavours and both are covered here:\n *\n *   - an affiliate chooser that links straight at the route\n *     (`https://mychart.example.org/prd/Authentication/Login`), and\n *   - a hospital marketing homepage that links at the mount\n *     (`https://mychart.example.org/MyChart/`).\n *\n * Ranking, in order: links that name the login route, then links on the host we\n * were asked about, then paths that read like a MyChart mount, then how often\n * the page refers to them. Nothing here is trusted on sight — the caller checks\n * each candidate for a login page — so the ordering only decides how quickly we\n * get to the right one, which is why a bare `/NorthMemorial/` stays in the\n * running even though it names neither the route nor MyChart.\n */\nexport function extractMountsFromLinks(html: string, preferHostname?: string): MountLocation[] {\n  const $ = cheerio.load(html);\n  const candidates = new Map<string, MountLocation & { hits: number; namesRoute: boolean; namesMyChart: boolean }>();\n\n  const urls: string[] = [];\n  $('a[href], link[href], area[href]').each((_i, el) => { const v = $(el).attr('href'); if (v) urls.push(v); });\n  $('script[src], img[src], iframe[src], form[action]').each((_i, el) => {\n    const v = $(el).attr('src') ?? $(el).attr('action'); if (v) urls.push(v);\n  });\n  // Absolute URLs sitting in inline script/JSON that cheerio's selectors miss.\n  for (const m of html.matchAll(/https?:\\/\\/[^\\s\"'<>()]+/g)) urls.push(m[0]);\n\n  for (const raw of urls) {\n    let url: URL;\n    try { url = new URL(raw, `https://${preferHostname || 'mychart.invalid'}`); } catch { continue; }\n    if (url.protocol !== 'https:' && url.protocol !== 'http:') continue;\n\n    const namesRoute = landsOnMyChartRoute(url.pathname);\n    const prefix = firstPathPartFromPathname(url.pathname);\n    const namesMyChart = !!prefix && /mychart|chart|portal|prd/i.test(prefix);\n    const trimmed = url.pathname.replace(/\\/$/, '');\n    const segments = trimmed.split('/').filter(Boolean).length;\n\n    // `/Authentication/Login` on the bare host is a root mount; anything else\n    // with no prefix at all carries no information.\n    if (!namesRoute && !prefix) continue;\n    // A deep path is only interesting when its first segment already reads as a\n    // mount (`/MyChart/Scripts/…` on a marketing page). Otherwise it's the\n    // site's own content: `/patients-and-visitors/find-a-doctor.html`.\n    if (!namesRoute && !namesMyChart && segments > 1) continue;\n    // Files aren't mounts — keeps `/style.css` and `/logo.png` out of it.\n    if (!namesRoute && !namesMyChart && /\\.[a-z0-9]{2,5}$/i.test(trimmed)) continue;\n\n    const key = `${url.host}|${(prefix ?? '').toLowerCase()}`;\n    const existing = candidates.get(key);\n    if (existing) {\n      existing.hits++;\n      existing.namesRoute ||= namesRoute;\n    } else {\n      candidates.set(key, { hostname: url.host, firstPathPart: prefix, hits: 1, namesRoute, namesMyChart });\n    }\n  }\n\n  return [...candidates.values()]\n    .sort((a, b) =>\n      Number(b.namesRoute) - Number(a.namesRoute)\n      || Number(b.hostname === preferHostname) - Number(a.hostname === preferHostname)\n      || Number(b.namesMyChart) - Number(a.namesMyChart)\n      || b.hits - a.hits)\n    .map(({ hostname, firstPathPart }) => ({ hostname, firstPathPart }));\n}\n\nconst COMMON_FIRST_PATH_PART_CANDIDATES = ['MyChart', 'MyChart-PRD', 'MyChartPRD'];\n\nexport async function probeFirstPathPartByTryingCommonLoginPaths(mychartRequest: MyChartRequest): Promise<string | null> {\n  // The directory's own prefixes come last: on a host with one tenant the\n  // common names usually hit first, and on a host with several this is the\n  // only way to find any of them.\n  const candidates = [...COMMON_FIRST_PATH_PART_CANDIDATES];\n  for (const prefix of directoryPrefixesFor(mychartRequest.hostname)) {\n    if (!candidates.some((c) => c.toLowerCase() === prefix.toLowerCase())) candidates.push(prefix);\n  }\n  for (const candidate of candidates) {\n    const candidateUrl = `${mychartRequest.protocol}://${mychartRequest.hostname}/${candidate}/Authentication/Login`;\n    try {\n      const resp = await mychartRequest.makeRequest({ url: candidateUrl });\n      const finalUrl = new URL(resp.url || candidateUrl, candidateUrl);\n      const html = await resp.text();\n\n      if (finalUrl.host !== mychartRequest.hostname) {\n        logger.debug(`Skipping ${candidate} probe: redirected off-host to ${finalUrl.host}`);\n        continue;\n      }\n\n      if (resp.status >= 400) {\n        continue;\n      }\n\n      const finalPathPart = finalUrl.pathname.split('/').find(Boolean);\n      if (finalPathPart?.toLowerCase() === candidate.toLowerCase() && looksLikeLoginPage(html)) {\n        logger.debug('Recovered firstPathPart by probing common login path:', finalPathPart || candidate);\n        return finalPathPart || candidate;\n      }\n    } catch (error) {\n      logger.debug(`Failed ${candidate} probe:`, error);\n    }\n  }\n\n  return null;\n}\n\n/**\n * Does this URL serve a MyChart login page? Used to sanity-check a mount we\n * only guessed at — a link on a landing page, or a host a redirect handed us.\n */\nasync function verifyMount(mychartRequest: MyChartRequest, mount: MountLocation): Promise<boolean> {\n  const url = `${mychartRequest.protocol}://${mount.hostname}${mount.firstPathPart ? '/' + mount.firstPathPart : ''}/Authentication/Login`;\n  try {\n    const resp = await mychartRequest.makeRequest({ url });\n    if (resp.status >= 400) {\n      logger.debug('mount check failed:', url, resp.status);\n      return false;\n    }\n    const ok = looksLikeLoginPage(await resp.text());\n    logger.debug('mount check', ok ? 'passed:' : 'failed (not a login page):', url);\n    return ok;\n  } catch (e) {\n    logger.debug('mount check errored:', url, e);\n    return false;\n  }\n}\n\nfunction mountFromUrl(url: URL): MountLocation {\n  return { hostname: url.host, firstPathPart: firstPathPartFromPathname(url.pathname) };\n}\n\n/**\n * Walk the redirect chain from the root the way a browser would, and stop the\n * moment it lands on a MyChart route.\n *\n * Following the whole chain rather than just the first hop is what makes this\n * reliable. The canonical MyChart bounce is three hops, and only the last one\n * names the mount:\n *\n *   /                        302 → /MyChart/\n *   /MyChart/                302 → DefaultAsp          ← relative, no leading slash\n *   /MyChart/DefaultAsp      302 → /MyChart/Authentication/Login?\n *\n * Reading one hop is enough for the instances that redirect straight to\n * `/MyChart/`, but a root-mounted instance's first hop is the bare\n * `DefaultAsp` — which, read as a prefix, is nonsense. So we keep going, and\n * whatever precedes `/Authentication/` at the end of the chain is the answer.\n *\n * The chain is also allowed to leave the host: portals get consolidated, and a\n * vanity hostname redirecting to the deployment that now serves it is the norm,\n * not an anomaly. Whether to trust the new host is the caller's call.\n *\n * Returns the mount if the chain found one, plus the last page fetched so the\n * caller can mine a landing page for links when it didn't.\n */\nasync function followChainToMyChartRoute(\n  mychartRequest: MyChartRequest,\n  startUrl: string,\n): Promise<{ mount: MountLocation | null; finalUrl: string; html: string | null }> {\n  let url = startUrl;\n  let html: string | null = null;\n  const seen = new Set<string>();\n\n  for (let hop = 0; hop < MAX_DISCOVERY_HOPS; hop++) {\n    if (seen.has(url)) {\n      logger.debug('discovery: redirect loop back to', url);\n      break;\n    }\n    seen.add(url);\n\n    let response: Response;\n    try {\n      response = await mychartRequest.makeRequest({ followRedirects: false, url });\n    } catch (e) {\n      logger.debug('discovery: request failed', url, e);\n      break;\n    }\n\n    // Some runtimes (iOS) ignore redirect:'manual' and follow the chain\n    // themselves, in which case the response URL is already the end of it.\n    const followedTo = !response.headers.get('Location') && response.url && response.url !== url\n      ? response.url\n      : null;\n    const next = response.headers.get('Location') ?? followedTo;\n\n    if (next) {\n      let resolved: URL;\n      try {\n        resolved = new URL(next, url);\n      } catch {\n        logger.debug('discovery: uninterpretable redirect target', next);\n        break;\n      }\n      logger.debug('discovery:', response.status, url, '->', resolved.href);\n      if (landsOnMyChartRoute(resolved.pathname)) {\n        return { mount: mountFromUrl(resolved), finalUrl: resolved.href, html: null };\n      }\n      url = resolved.href;\n      continue;\n    }\n\n    html = await response.text().catch(() => '');\n    logger.debug('discovery:', response.status, url, `(${html.length} bytes, no redirect)`);\n\n    // Landed on the login page itself: this URL *is* the mount, and its own\n    // `<meta refresh>` points at nojs.asp — following that would lose it.\n    if (response.status < 400 && looksLikeLoginPage(html)) {\n      return { mount: mountFromUrl(new URL(url)), finalUrl: url, html };\n    }\n\n    // Not a redirect at the HTTP level, but the page may still announce the\n    // mount: a meta refresh (Renown) or a scripted window.location (Dovetale).\n    const target = parseMetaRefreshTarget(html, undefined, url) ?? parseScriptRedirectTarget(html, url);\n    if (!target) break;\n\n    logger.debug('discovery: body redirect', url, '->', target.href);\n    if (landsOnMyChartRoute(target.pathname)) {\n      return { mount: mountFromUrl(target), finalUrl: target.href, html };\n    }\n    url = target.href;\n  }\n\n  return { mount: null, finalUrl: url, html };\n}\n\n/**\n * Pin a discovered mount onto the request, moving hosts if that's where the\n * deployment turned out to live.\n *\n * A host move is only ever accepted on the strength of a login page actually\n * being served there (`verified`) — the host we end up on is the one that gets\n * sent the user's password. The scheme is not up for grabs either: only the\n * host is taken from the chain, so a session that started on https stays there\n * even if some hop along the way was plain http.\n */\nfunction applyMount(mychartRequest: MyChartRequest, mount: MountLocation, verified: boolean): boolean {\n  if (mount.hostname !== mychartRequest.hostname) {\n    if (!verified) return false;\n    logger.debug('MyChart moved hosts:', mychartRequest.hostname, '->', mount.hostname);\n    mychartRequest.setHostname(mount.hostname);\n  }\n  logger.debug('MyChart mount:', mychartRequest.hostname, mount.firstPathPart\n    ? `is prefixed with ${mount.firstPathPart}`\n    : 'is mounted at the domain root');\n  mychartRequest.setFirstPathPart(mount.firstPathPart);\n  return true;\n}\n\nexport async function determineFirstPathPart(mychartRequest: MyChartRequest): Promise<MyChartRequest | null> {\n\n  if (mychartRequest.firstPathPart) {\n    logger.debug('first path part already determined', mychartRequest.firstPathPart)\n    return mychartRequest;\n  }\n\n  const startedOnHostname = mychartRequest.hostname;\n  const root = mychartRequest.protocol + '://' + mychartRequest.hostname;\n  const { mount, html } = await followChainToMyChartRoute(mychartRequest, root);\n\n  if (mount) {\n    // A chain that stayed put proved the prefix by landing on it. One that\n    // moved hosts has to prove the new host serves MyChart before we trust it.\n    const sameHost = mount.hostname === startedOnHostname;\n    if (applyMount(mychartRequest, mount, sameHost || await verifyMount(mychartRequest, mount))) {\n      return mychartRequest;\n    }\n  }\n\n  // The chain ran out on a page that isn't MyChart — an affiliate chooser, a\n  // hospital homepage, an SSO stop. Those pages nearly always link at the real\n  // mount, so read it off them rather than guessing.\n  if (html) {\n    for (const candidate of extractMountsFromLinks(html, startedOnHostname).slice(0, 5)) {\n      logger.debug('trying mount linked from the landing page:', candidate.hostname, candidate.firstPathPart);\n      if (await verifyMount(mychartRequest, candidate) && applyMount(mychartRequest, candidate, true)) {\n        return mychartRequest;\n      }\n    }\n  }\n\n  const probed = await probeFirstPathPartByTryingCommonLoginPaths(mychartRequest);\n  if (probed) {\n    mychartRequest.setFirstPathPart(probed);\n    return mychartRequest;\n  }\n\n  logger.debug('Could not work out where MyChart is mounted on', mychartRequest.hostname);\n  return mychartRequest;\n}\n\nexport type TwoFaDeliveryInfo = {\n  method: 'email' | 'sms';\n  // Masked contact, e.g. \"***-***-1234\" or \"ab***@example.com\". Scraped, so it\n  // may arrive as an explicit undefined when the page didn't render one.\n  contact?: string | undefined;\n}\n\nexport type LoginResult = {\n  state: 'logged_in' | 'need_2fa' | 'invalid_login' | 'error'\n  error?: string\n  mychartRequest: MyChartRequest;\n\n  // only set if need2fa is true\n  twoFaSentTime?: number;\n  twoFaDelivery?: TwoFaDeliveryInfo | undefined;\n\n}\n\n/**\n * Masked contacts as MyChart prints them on the 2FA page — a masked address\n * and a masked number. Both are rewrites of patterns whose adjacent quantifiers\n * could each claim the same `*`, so a long run of mask characters with no `@`\n * or trailing digits — easy to plant in scraped portal HTML — got divided\n * between them every possible way: 800 stars took 25s, on the login path. Each\n * accepts exactly the same strings as the pattern it replaces. The lookbehinds\n * are the other half of the fix: a match can never start mid-run (the star\n * before it would have started an equally good match one character earlier),\n * and refusing those start offsets is what takes the scan to linear.\n */\nconst MASKED_EMAIL_RE = /(?<![\\w*])[\\w*]\\w*\\*[\\w*]*@[\\w.]+/;\nconst MASKED_PHONE_RE = /(?<!\\*)\\*\\*[\\d*-]*\\d{4}/;\n\n/**\n * Parse the secondary validation (2FA) page to detect which delivery methods are available.\n * Real MyChart pages show buttons like \"Email to me\" or \"Text to my phone\".\n * Returns which methods are available and any masked contact info found near the buttons.\n */\nexport function parse2faDeliveryMethods(html: string): {\n  hasEmail: boolean;\n  hasSms: boolean;\n  // Scraped off the page, so \"not found\" arrives as an explicit undefined.\n  emailContact?: string | undefined;\n  smsContact?: string | undefined;\n} {\n  const $ = cheerio.load(html);\n  let hasEmail = false;\n  let hasSms = false;\n  let emailContact: string | undefined;\n  let smsContact: string | undefined;\n\n  // Look at all buttons and links on the page for delivery method indicators\n  $('button, a, [role=\"button\"]').each((_, el) => {\n    const text = $(el).text().toLowerCase().trim();\n    if (text.includes('email')) {\n      hasEmail = true;\n      // Try to extract masked email from button text or nearby elements\n      const fullText = $(el).text().trim();\n      const emailMatch = MASKED_EMAIL_RE.exec(fullText);\n      if (emailMatch) emailContact = emailMatch[0];\n    }\n    if (text.includes('text') || text.includes('phone') || text.includes('sms')) {\n      hasSms = true;\n      // Try to extract masked phone from button text or nearby elements\n      const fullText = $(el).text().trim();\n      const phoneMatch = /[\\d*][\\d*-]+[\\d*]/.exec(fullText);\n      if (phoneMatch) smsContact = phoneMatch[0];\n    }\n  });\n\n  // Also look in paragraph/span text near the buttons for masked contact info\n  $('p, span, div').each((_, el) => {\n    const text = $(el).text();\n    if (!emailContact) {\n      const emailMatch = MASKED_EMAIL_RE.exec(text);\n      if (emailMatch) emailContact = emailMatch[0];\n    }\n    if (!smsContact) {\n      const phoneMatch = MASKED_PHONE_RE.exec(text);\n      if (phoneMatch) smsContact = phoneMatch[0];\n    }\n  });\n\n  return { hasEmail, hasSms, emailContact, smsContact };\n}\n\n// takes in the user + pass\n// and returns 1 of two things:\n// 1. login success and were golden\n// 2. we need 2fa code to complete login process\n// Note that this flow will trigger the 2fa code to be sent to the user's email\n// if were going the 2fa flow\n/**\n * The hidden bookkeeping fields MyChart's login form posts back alongside the\n * credentials. They are page-load telemetry, not secrets, but an instance that\n * renders them expects them echoed — so they're read off the page rather than\n * invented, with the defaults MyChart's own JS uses when a field is absent.\n */\nexport function parseLoginPageFields(html: string) {\n  const $ = cheerio.load(html);\n  return {\n    navRequestMetrics: $('input[name=\"__NavigationRequestMetrics\"]').attr('value') || '',\n    navRedirectMetrics: $('input[name=\"__NavigationRedirectMetrics\"]').attr('value') || '[]',\n    redirectChainIncludesLogin: $('input[name=\"__RedirectChainIncludesLogin\"]').attr('value') || '0',\n    currentPageLoadDescriptor: $('input[name=\"__CurrentPageLoadDescriptor\"]').attr('value') || '',\n    rttCaptureEnabled: $('input[name=\"__RttCaptureEnabled\"]').attr('value') || '1',\n  };\n}\n\n/** The name MyChart's login controller JS gives the username credential. */\nexport function usernameFieldFromControllerJs(js: string): 'LoginIdentifier' | 'Username' {\n  const credMatch = /Credentials:\\s*\\{([^}]{0,300})\\}/.exec(js);\n  const creds = credMatch?.[1];\n  if (creds && creds.includes('Username') && !creds.includes('LoginIdentifier')) {\n    return 'Username';\n  }\n  return 'LoginIdentifier';\n}\n\n/**\n * Whether this instance calls the username credential `LoginIdentifier` (the\n * newer name) or `Username`, read out of the login controller JS the page\n * references. Falls back to the newer name when the script can't be fetched.\n */\nexport async function detectUsernameField(mychartRequest: MyChartRequest, loginPageHtml: string): Promise<'LoginIdentifier' | 'Username'> {\n  const $ = cheerio.load(loginPageHtml);\n  const loginControllerSrc = $('script[src*=\"loginpagecontroller\"]').attr('src');\n  if (!loginControllerSrc) return 'LoginIdentifier';\n\n  try {\n    const jsUrl = loginControllerSrc.startsWith('http')\n      ? loginControllerSrc\n      // mychartRequest.hostname, not the raw hostname the caller passed: that\n      // one may still carry the scheme and path the user typed, and discovery\n      // may since have moved the session to the host that serves MyChart.\n      : mychartRequest.protocol + '://' + mychartRequest.hostname + loginControllerSrc;\n    const jsResp = await mychartRequest.makeRequest({ url: jsUrl });\n    const usernameField = usernameFieldFromControllerJs(await jsResp.text());\n    logger.debug('Detected credential field:', usernameField);\n    return usernameField;\n  } catch (e) {\n    logger.debug('Could not detect credential field, defaulting to LoginIdentifier', e);\n    return 'LoginIdentifier';\n  }\n}\n\nexport async function myChartUserPassLogin ({hostname, user, pass, skipSendCode, protocol}: {hostname: string, user: string, pass: string, skipSendCode?: boolean | undefined, protocol?: string | undefined}): Promise<LoginResult> {\n  // Fire-and-forget telemetry — never blocks or breaks the scraper\n  sendTelemetryEvent('scraper_login_started', { hostname }, 'scraper');\n\n  if (!hostname || !user || !pass) {\n    // Which one is missing, never the values: the sink is whatever the host\n    // wired up, and a plaintext password belongs in none of them.\n    logger.debug('missing hostname, user, or pass', {\n      hostname: hostname || '(missing)',\n      user: user ? '(present)' : '(missing)',\n      pass: pass ? '(present)' : '(missing)',\n    })\n    throw new Error('Missing hostname, user, or pass')\n  }\n\n  if (isBlockedInstance(hostname)) {\n    throw new Error(`${hostname} is not supported. central.mychart.org is a portal aggregator and cannot be scraped directly. Please use the individual hospital MyChart instance instead.`);\n  }\n\n\n  // Use HTTP for localhost and hostnames without a dot (e.g. Docker service names like \"fake-mychart:3000\")\n  const hostnameWithoutPort = hostname.split(':')[0]!; // split() always yields a first element\n  const effectiveProtocol = protocol ?? (hostnameWithoutPort === 'localhost' || !hostnameWithoutPort.includes('.') ? 'http' : 'https');\n  const mychartRequest = new MyChartRequest(hostname, { protocol: effectiveProtocol });\n  const firstPathPartFromInput = parseFirstPathPartFromInput(hostname);\n  if (firstPathPartFromInput) {\n    logger.debug('Using firstPathPart from user input:', firstPathPartFromInput);\n    mychartRequest.setFirstPathPart(firstPathPartFromInput);\n  }\n\n  const foundMyChartFirstPathPart = await determineFirstPathPart(mychartRequest)\n\n  if (!foundMyChartFirstPathPart) {\n    logger.debug('could not determine first path part')\n    return {state: 'error', error: 'could not determine first path part', mychartRequest}\n  }\n\n\n  // The homepage has a __RequestVerificationToken that we need to extract.\n  // Also get the cookies in the jar as well\n  const firstRequst = await mychartRequest.makeRequest({path: '/Authentication/Login'})\n\n  const loginPageHtml = await firstRequst.text()\n\n  let requestVerificationToken = getRequestVerificationTokenFromBody(loginPageHtml)\n\n  const { navRequestMetrics, navRedirectMetrics, redirectChainIncludesLogin, currentPageLoadDescriptor, rttCaptureEnabled } =\n    parseLoginPageFields(loginPageHtml);\n\n  const usernameField = await detectUsernameField(mychartRequest, loginPageHtml);\n\n  // b64EncodeUnicode handles unicode chars properly (matching WP.Utils.b64EncodeUnicode from MyChart JS)\n  const b64EncodeUnicode = (str: string) => btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (_, p1) => String.fromCharCode(parseInt(p1, 16))));\n\n  const LoginInfo = encodeURIComponent(JSON.stringify({\n    \"Type\": \"StandardLogin\",\n    \"Credentials\": {\n      [usernameField]: b64EncodeUnicode(user),\n      \"Password\": b64EncodeUnicode(pass)\n    }}\n  ))\n\n  const loginBody = \"__RequestVerificationToken=\" + requestVerificationToken\n    + \"&DeviceId=&postLoginUrl=&LoginInfo=\" + LoginInfo\n    + \"&__NavigationRequestMetrics=\" + encodeURIComponent(navRequestMetrics)\n    + \"&__NavigationRedirectMetrics=\" + encodeURIComponent(navRedirectMetrics)\n    + \"&__RedirectChainIncludesLogin=\" + redirectChainIncludesLogin\n    + \"&__CurrentPageLoadDescriptor=\" + encodeURIComponent(currentPageLoadDescriptor)\n    + \"&__RttCaptureEnabled=\" + rttCaptureEnabled;\n\n  const res = await mychartRequest.makeRequest({\n    path: \"/Authentication/Login/DoLogin\",\n    \"headers\": {\n      \"Content-Type\": \"application/x-www-form-urlencoded\",\n    },\n    \"body\": loginBody,\n    \"method\": \"POST\",\n  });\n\n  const secondaryAuthPage = await res.text()\n  const responseUrl = res.url || '';\n\n  logger.debug(`[login] DoLogin response: status=${res.status} url=${responseUrl}`);\n  logger.debug(`[login] Page checks: has_secondaryvalidationcontroller=${secondaryAuthPage.includes('secondaryvalidationcontroller')} has_md_home_index=${secondaryAuthPage.toLowerCase().includes('md_home_index')} has_termsconditions=${responseUrl.toLowerCase().includes('termsconditions')}`);\n\n  // If the user is required to set up 2fa but hasn't set up 2fa yet, there may be a message stating that they have to set up 2fa.\n\n  // Check for login failure first (can appear in URL or body)\n  const bodyLower = secondaryAuthPage.toLocaleLowerCase();\n  const urlLower = responseUrl.toLocaleLowerCase();\n  if (bodyLower.includes('login failed') || bodyLower.includes('login unsuccessful') || urlLower.includes('loginfailed')) {\n    logger.debug('Login failed with username ', user, hostname)\n    return {\n      state: 'invalid_login',\n      error: 'Username or password is incorrect',\n      mychartRequest\n    }\n  }\n\n  // If we need to do 2fa (check both body content and response URL):\n  if (secondaryAuthPage.includes('secondaryvalidationcontroller') || urlLower.includes('secondaryvalidation')) {\n\n    requestVerificationToken = getRequestVerificationTokenFromBody(secondaryAuthPage)\n    if (!requestVerificationToken) {\n      logger.debug('could not find request verification token on the 2FA page')\n      return {state: 'error', error: 'could not find request verification token', mychartRequest}\n    }\n\n    const codeSendTimeBefore = Date.now()\n\n    // Detect which 2FA delivery methods are available on the page\n    const deliveryMethods = parse2faDeliveryMethods(secondaryAuthPage);\n    logger.debug('2FA delivery methods:', JSON.stringify(deliveryMethods));\n\n    let twoFaDelivery: TwoFaDeliveryInfo | undefined;\n\n    // When using TOTP, we skip SendCode — the code is generated locally.\n    if (!skipSendCode) {\n      // I don't think we need to do this, but just in case\n      await mychartRequest.makeRequest({path: '/Authentication/SecondaryValidation/GetSMSConsentStrings?noCache=' + Math.random()})\n\n      // Determine delivery method:\n      // - Both detected → use email (deliveryMethodEmail=true)\n      // - Only one detected → use that one\n      // - Neither detected (JS-rendered page) → try all three param formats\n      //\n      // MyChart instances use different SendCode parameter names:\n      //   - deliveryMethodEmail=true  (send via email)\n      //   - deliveryMethodEmail=false (send via SMS on older instances)\n      //   - deliveryMethodSMS=true    (send via SMS on newer instances like bilh.org)\n      let sentMethod: 'email' | 'sms' | null = null;\n\n      const sendCodeHeaders = {\n        \"Content-Type\": \"application/x-www-form-urlencoded; charset=UTF-8\",\n        '__RequestVerificationToken': requestVerificationToken,\n      };\n\n      async function trySendCode(body: string, label: string): Promise<boolean> {\n        const resp = await mychartRequest.makeRequest({\n          path: \"/Authentication/SecondaryValidation/SendCode?noCache=\" + Math.random(),\n          headers: sendCodeHeaders,\n          body,\n          method: \"POST\",\n        });\n        const respBody = await resp.text();\n        const success = respBody.includes('\"Success\":true');\n        logger.debug(`[login] SendCode ${label}: status=${resp.status} success=${success}`);\n        return success;\n      }\n\n      if (deliveryMethods.hasEmail && deliveryMethods.hasSms) {\n        logger.debug('[login] Both email and SMS detected, using email');\n        if (await trySendCode('deliveryMethodEmail=true&resendCode=false&workflow=1', 'email')) {\n          sentMethod = 'email';\n        }\n      } else if (deliveryMethods.hasEmail) {\n        logger.debug('[login] Only email detected, using email');\n        if (await trySendCode('deliveryMethodEmail=true&resendCode=false&workflow=1', 'email')) {\n          sentMethod = 'email';\n        }\n      } else if (deliveryMethods.hasSms) {\n        logger.debug('[login] Only SMS detected, using SMS');\n        if (await trySendCode('deliveryMethodEmail=false&resendCode=false&workflow=1', 'sms-legacy')) {\n          sentMethod = 'sms';\n        }\n      }\n\n      // If nothing detected or detected method failed, try all formats\n      if (!sentMethod) {\n        logger.debug('[login] Trying all SendCode formats...');\n        // Try SMS formats first (more common for text-only instances)\n        if (await trySendCode('deliveryMethodSMS=true&resendCode=false&workflow=1', 'sms-new')) {\n          sentMethod = 'sms';\n        } else if (await trySendCode('deliveryMethodEmail=false&resendCode=false&workflow=1', 'sms-legacy')) {\n          sentMethod = 'sms';\n        } else if (await trySendCode('deliveryMethodEmail=true&resendCode=false&workflow=1', 'email')) {\n          sentMethod = 'email';\n        }\n      }\n\n      if (!sentMethod) {\n        logger.debug('[login] All SendCode attempts failed — could not send 2FA code');\n      }\n\n      // Try to extract masked contact info\n      let contact: string | undefined;\n      if (sentMethod === 'email') {\n        contact = deliveryMethods.emailContact;\n        twoFaDelivery = { method: 'email', contact };\n        logger.debug(`Asked for a 2FA code to be sent to email${contact ? ` (${contact})` : ''}, waiting for email to arrive`);\n      } else {\n        contact = deliveryMethods.smsContact;\n        twoFaDelivery = { method: 'sms', contact };\n        logger.debug(`Asked for a 2FA code to be sent via SMS${contact ? ` (${contact})` : ''}`);\n      }\n    } else {\n      logger.debug(\"Skipping SendCode (using TOTP)\")\n    }\n\n    return {\n      state: 'need_2fa',\n      twoFaSentTime: codeSendTimeBefore,\n      twoFaDelivery,\n      mychartRequest\n    }\n\n  }\n\n  // We are logged in!\n  if (bodyLower.includes('md_home_index')) {\n    return {\n      state: 'logged_in',\n      mychartRequest\n    }\n  }\n\n  // Check if we landed on Terms & Conditions page — auto-accept silently\n  // Use the response URL to avoid false positives from pages that merely\n  // reference \"termsconditions\" in CSS/JS/footer links.\n  if (urlLower.includes('termsconditions') || (bodyLower.includes('terms and conditions') && !urlLower.includes('/home'))) {\n    logger.debug('Landed on Terms & Conditions page after login, auto-accepting');\n    const accepted = await acceptTermsAndConditions(mychartRequest);\n    if (accepted) {\n      return {\n        state: 'logged_in',\n        mychartRequest\n      }\n    }\n    logger.debug('Failed to auto-accept Terms & Conditions');\n    return {\n      state: 'error',\n      error: 'Failed to accept MyChart Terms & Conditions',\n      mychartRequest\n    }\n  }\n\n  logger.debug('i am at some page, i dont know what to do!')\n  logger.debug('Response URL:', responseUrl)\n\n  return {\n    state: 'error',\n    error: 'Login failed: ended up on an unexpected page',\n    mychartRequest\n  }\n\n}\n\n\n// We have the 2fa code from the user's email, now we need to complete the login flow and get the remaining cookies\n// then we have full access to the user's mychart account.\n\nexport type TwoFaResult = {\n  state: 'logged_in' | 'invalid_2fa' | 'error'\n  mychartRequest: MyChartRequest\n}\n\nexport async function complete2faFlow({mychartRequest, code, twofaCodeArray, isTOTP}: {mychartRequest: MyChartRequest, code?: string, twofaCodeArray?: {code: string; score: number}[], isTOTP?: boolean | undefined}): Promise<TwoFaResult> {\n\n  // Accept either a single code string or an array of scored codes\n  const codeArray = twofaCodeArray ?? (code ? [{code, score: 1}] : []);\n  // Copy before sorting: `twofaCodeArray` belongs to the caller, and an\n  // in-place sort would reorder their array as a side effect of completing 2FA.\n  const sortedCodes = [...codeArray].sort((a, b) => b.score - a.score);\n\n  // // To make sure we don't grab an old code from the user's email, we only look for emails that arrived after the above API request was made. \n  // // Also, look up to 5 seconds before the request was made.\n  // // And check continously for a code to arrive for up to a minute. \n  // const code = await get2FaCodeFromEmail(codeSendTimeBefore - 1000 * 5, fromEmail!);\n\n\n\n  // Make another HTTP call to the secondary auth page to get the request verification token. \n  // This isn't necessary, but is the easiest way if we want to split the before 2fa and after 2fa steps. \n  const res = await mychartRequest.makeRequest({path: \"/Authentication/SecondaryValidation\"});\n\n  const secondaryAuthPage = await res.text()\n  const requestVerificationToken = getRequestVerificationTokenFromBody(secondaryAuthPage)\n\n  if (!requestVerificationToken) { \n    logger.debug('could not find request verification token on the 2FA page')\n    return {\n      state: 'error',\n      mychartRequest\n    }\n  }\n\n\n  // The codes themselves are live credentials — log how many arrived, not what they are.\n  logger.debug(\"Got 2fa codes from email:\", sortedCodes.length, \"candidate(s), scores:\", sortedCodes.map(c => c.score))\n\n  let invalidCode = false;\n\n  for (const candidate of sortedCodes) {\n    logger.debug('Trying code with score', candidate.score)\n    const resp = await mychartRequest.makeRequest({\n      path: \"/Authentication/SecondaryValidation/Validate?noCache=\" + Math.random(),\n      \"headers\": { \n        \"Content-Type\": \"application/x-www-form-urlencoded; charset=UTF-8\",\n        '__RequestVerificationToken': requestVerificationToken,\n      },\n      \"body\": \"TwoFactorCode=\" + candidate.code + \"&RememberMe=checked&IsPostLogin2FA=false&EnrollDeviceTrackingOnRemember=false&DeviceId=&Workflow=1&isTOTP=\" + (isTOTP ? \"true\" : \"false\"),\n      \"method\": \"POST\",\n    });\n\n    const respBody = await resp.json()\n\n    if (respBody.Success === true) {\n      const insideResp = await mychartRequest.makeRequest({path: '/inside.asp'})\n      const insideBody = await insideResp.text();\n      const insideBodyLower = insideBody.toLowerCase();\n\n      // Check if we landed on Terms & Conditions page — auto-accept silently\n      // Use the response URL (not just body content) to avoid false positives from\n      // pages that merely reference \"termsconditions\" in CSS/JS/footer links.\n      const insideUrl = (insideResp.url || '').toLowerCase();\n      if (insideUrl.includes('termsconditions') || (insideBodyLower.includes('terms and conditions') && !insideUrl.includes('/home'))) {\n        logger.debug('Landed on Terms & Conditions page after 2FA, auto-accepting');\n        const accepted = await acceptTermsAndConditions(mychartRequest);\n        if (!accepted) {\n          logger.debug('Failed to auto-accept Terms & Conditions after 2FA');\n          return {\n            state: 'error',\n            mychartRequest\n          };\n        }\n      }\n\n      return {\n        state: 'logged_in',\n        mychartRequest\n      };\n\n    }\n\n    if (respBody.TwoFactorCodeFailReason === 'codewrong') {\n      // wrong code!\n      logger.debug('wrong code! score:', candidate.score)\n      invalidCode = true;\n    }\n  }\n\n\n  if (invalidCode) {\n    return {\n      state: 'invalid_2fa',\n      mychartRequest\n    };\n  }\n\n  logger.debug('i am at some page after 2fa validation call, i dont know what to do!')\n  return {\n    state: 'error',\n    mychartRequest\n  };\n\n}\n\n\n/**\n * Login to MyChart using a passkey credential.\n * This completely replaces username/password + 2FA with a single WebAuthn assertion.\n *\n * Flow:\n * 1. Get login page + CSRF token (same as password login)\n * 2. POST /Authentication/Login/GetPasskeyGetParams — get WebAuthn challenge\n * 3. Software authenticator signs the challenge\n * 4. POST /Authentication/Login/DoLogin with Type: \"PasskeyLogin\"\n */\nexport async function myChartPasskeyLogin({hostname, credential, protocol}: {\n  hostname: string,\n  credential: PasskeyCredential,\n  protocol?: string | undefined,\n}): Promise<LoginResult> {\n  sendTelemetryEvent('scraper_passkey_login_started', { hostname }, 'scraper');\n\n  if (!hostname || !credential) {\n    throw new Error('Missing hostname or passkey credential');\n  }\n\n  if (isBlockedInstance(hostname)) {\n    throw new Error(`${hostname} is not supported.`);\n  }\n\n  const hostnameWithoutPort = hostname.split(':')[0]!; // split() always yields a first element\n  const effectiveProtocol = protocol ?? (hostnameWithoutPort === 'localhost' || !hostnameWithoutPort.includes('.') ? 'http' : 'https');\n  const mychartRequest = new MyChartRequest(hostname, { protocol: effectiveProtocol });\n  const firstPathPartFromInput = parseFirstPathPartFromInput(hostname);\n  if (firstPathPartFromInput) {\n    logger.debug('Using firstPathPart from user input:', firstPathPartFromInput);\n    mychartRequest.setFirstPathPart(firstPathPartFromInput);\n  }\n\n  const foundMyChartFirstPathPart = await determineFirstPathPart(mychartRequest);\n  if (!foundMyChartFirstPathPart) {\n    return { state: 'error', error: 'could not determine first path part', mychartRequest };\n  }\n\n  // Get login page + CSRF token\n  const loginPageResp = await mychartRequest.makeRequest({ path: '/Authentication/Login' });\n  const loginPageHtml = await loginPageResp.text();\n  const requestVerificationToken = getRequestVerificationTokenFromBody(loginPageHtml);\n\n  if (!requestVerificationToken) {\n    return { state: 'error', error: 'could not find request verification token', mychartRequest };\n  }\n\n  // Get passkey challenge\n  logger.debug('  Getting passkey challenge...');\n  const getParamsResp = await mychartRequest.makeRequest({\n    path: '/Authentication/Login/GetPasskeyGetParams?force=true&noCache=' + Math.random(),\n    method: 'POST',\n    headers: {\n      '__RequestVerificationToken': requestVerificationToken,\n      'X-Requested-With': 'XMLHttpRequest',\n    },\n  });\n\n  if (getParamsResp.status !== 200) {\n    logger.debug('  GetPasskeyGetParams failed:', getParamsResp.status);\n    return { state: 'error', error: 'Failed to get passkey challenge', mychartRequest };\n  }\n\n  const getParamsResult = await getParamsResp.json();\n  if (!getParamsResult.Success || !getParamsResult.PasskeyGetParams) {\n    logger.debug('  GetPasskeyGetParams unsuccessful. Success:', getParamsResult.Success);\n    return { state: 'error', error: 'Passkey login not available on this instance', mychartRequest };\n  }\n\n  const passkeyParams = getParamsResult.PasskeyGetParams;\n  logger.debug('  Got passkey challenge. RpId:', passkeyParams.RpId || '(default)');\n\n  // Create assertion using software authenticator\n  const origin = `${effectiveProtocol}://${mychartRequest.hostname}`;\n  const assertion = createAssertion(credential, passkeyParams.Challenge, origin);\n\n  // Extract additional hidden fields from the login page\n  const { navRequestMetrics, navRedirectMetrics, redirectChainIncludesLogin, currentPageLoadDescriptor, rttCaptureEnabled } =\n    parseLoginPageFields(loginPageHtml);\n\n  // Submit passkey login\n  const LoginInfo = encodeURIComponent(JSON.stringify({\n    Type: 'PasskeyLogin',\n    Credentials: assertion,\n  }));\n\n  const loginBody = '__RequestVerificationToken=' + requestVerificationToken\n    + '&DeviceId=&postLoginUrl=&LoginInfo=' + LoginInfo\n    + '&__NavigationRequestMetrics=' + encodeURIComponent(navRequestMetrics)\n    + '&__NavigationRedirectMetrics=' + encodeURIComponent(navRedirectMetrics)\n    + '&__RedirectChainIncludesLogin=' + redirectChainIncludesLogin\n    + '&__CurrentPageLoadDescriptor=' + encodeURIComponent(currentPageLoadDescriptor)\n    + '&__RttCaptureEnabled=' + rttCaptureEnabled;\n\n  logger.debug('  Submitting passkey login...');\n  const res = await mychartRequest.makeRequest({\n    path: '/Authentication/Login/DoLogin',\n    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n    body: loginBody,\n    method: 'POST',\n  });\n\n  const responseBody = await res.text();\n  const responseUrl = res.url || '';\n  const bodyLower = responseBody.toLocaleLowerCase();\n  const urlLower = responseUrl.toLocaleLowerCase();\n\n  // Check for login failure\n  if (bodyLower.includes('login failed') || bodyLower.includes('login unsuccessful') || urlLower.includes('loginfailed')) {\n    logger.debug('  Passkey login failed');\n    return { state: 'invalid_login', error: 'Passkey authentication failed', mychartRequest };\n  }\n\n  // Success — logged in directly (passkey bypasses 2FA)\n  if (bodyLower.includes('md_home_index')) {\n    logger.debug('  Passkey login successful!');\n    return { state: 'logged_in', mychartRequest };\n  }\n\n  // Terms & Conditions\n  if (urlLower.includes('termsconditions') || (bodyLower.includes('terms and conditions') && !urlLower.includes('/home'))) {\n    logger.debug('  Landed on Terms & Conditions page, auto-accepting');\n    const accepted = await acceptTermsAndConditions(mychartRequest);\n    if (accepted) {\n      return { state: 'logged_in', mychartRequest };\n    }\n    return { state: 'error', error: 'Failed to accept Terms & Conditions', mychartRequest };\n  }\n\n  // Unexpected page — might still need 2FA (shouldn't happen with passkey, but handle gracefully)\n  if (responseBody.includes('secondaryvalidationcontroller') || urlLower.includes('secondaryvalidation')) {\n    logger.debug('  Passkey login still requires 2FA — unexpected');\n    return { state: 'need_2fa', mychartRequest };\n  }\n\n  logger.debug('  Passkey login ended on unexpected page');\n  logger.debug('  Response URL:', responseUrl);\n  return { state: 'error', error: 'Passkey login ended on unexpected page', mychartRequest };\n}\n\nexport async function areCookiesValid(mychartRequest: MyChartRequest): Promise<boolean> {\n  const res = await mychartRequest.makeRequest({path: '/Home', followRedirects: false})\n  logger.debug(\"are cookies valid?\", res.status === 200, res.headers.get('Location'))\n  return res.status === 200\n}\n\n","var Module=typeof Module!=\"undefined\"?Module:{};var ENVIRONMENT_IS_NODE=true;const INT32_MIN=-2147483648;const INT32_MAX=2147483647;const NULL=0;const SQLITE_OK=0;const SQLITE_ROW=100;const SQLITE_DONE=101;const SQLITE_INTEGER=1;const SQLITE_FLOAT=2;const SQLITE_TEXT=3;const SQLITE_BLOB=4;const SQLITE_NULL=5;const SQLITE_UTF8=1;const SQLITE_TRANSIENT=-1;const SQLITE_DETERMINISTIC=2048;let temp;const sqlite3={};Module.onRuntimeInitialized=()=>{temp=stackAlloc(4);const v=null;const n=\"number\";const s=\"string\";const n1=[n];const n2=[n,...n1];const n3=[n,...n2];const n4=[n,...n3];const n5=[n,...n4];const signatures={open_v2:[n,[s,n,n,s]],exec:[n,n5],errmsg:[s,n1],prepare_v2:[n,n5],close_v2:[n,n1],finalize:[n,n1],reset:[n,n1],clear_bindings:[n,n1],bind_int:[n,n3],bind_int64:[n,n3],bind_double:[n,n3],bind_text:[n,n5],bind_blob:[n,n5],bind_blob64:[n,n5],bind_null:[n,n2],bind_parameter_index:[n,[n,s]],step:[n,n1],column_int64:[n,n2],column_double:[n,n2],column_text:[s,n2],column_blob:[n,n2],column_type:[n,n2],column_name:[s,n2],column_count:[n,n1],column_bytes:[n,n2],last_insert_rowid:[n,n1],changes:[n,n1],create_function_v2:[n,[n,s,n,n,n,n,n,n,n]],value_type:[n,n1],value_text:[s,n1],value_blob:[n,n1],value_int64:[n,n1],value_double:[n,n1],value_bytes:[n,n1],result_double:[v,n2],result_null:[v,n1],result_text:[v,n4],result_blob:[v,n4],result_blob64:[v,n4],result_int:[v,n2],result_int64:[v,n2],result_error:[v,n3],column_table_name:[s,n2],get_autocommit:[n,n1]};for(const[name,sig]of Object.entries(signatures)){sqlite3[name]=cwrap(`sqlite3_${name}`,sig[0],sig[1])}};class SQLite3Error extends Error{constructor(message){super(message);this.name=\"SQLite3Error\"}}function arrayToHeap(array){const ptr=_malloc(array.byteLength);HEAPU8.set(array,ptr);return ptr}function stringToHeap(str){const size=lengthBytesUTF8(str)+1;const ptr=_malloc(size);stringToUTF8(str,ptr,size);return ptr}function toNumberOrNot(bigInt){if(bigInt>=Number.MIN_SAFE_INTEGER&&bigInt<=Number.MAX_SAFE_INTEGER){return Number(bigInt)}return bigInt}function parseFunctionArguments(argc,argv){const args=[];for(let i=0;i<argc;i++){const ptr=getValue(argv+4*i,\"i32\");const type=sqlite3.value_type(ptr);let arg;switch(type){case SQLITE_INTEGER:arg=toNumberOrNot(sqlite3.value_int64(ptr));break;case SQLITE_FLOAT:arg=sqlite3.value_double(ptr);break;case SQLITE_TEXT:arg=sqlite3.value_text(ptr);break;case SQLITE_BLOB:const p=sqlite3.value_blob(ptr);if(p!=NULL){arg=HEAPU8.slice(p,p+sqlite3.value_bytes(ptr))}else{arg=new Uint8Array}break;case SQLITE_NULL:arg=null;break}args.push(arg)}return args}function setFunctionResult(cx,result){switch(typeof result){case\"boolean\":sqlite3.result_int(cx,result?1:0);break;case\"number\":if(Number.isSafeInteger(result)){if(result>=INT32_MIN&&result<=INT32_MAX){sqlite3.result_int(cx,result)}else{sqlite3.result_int64(cx,BigInt(result))}}else{sqlite3.result_double(cx,result)}break;case\"bigint\":sqlite3.result_int64(cx,result);break;case\"string\":const tempPtr=stringToHeap(result);sqlite3.result_text(cx,tempPtr,-1,SQLITE_TRANSIENT);_free(tempPtr);break;case\"object\":if(result===null){sqlite3.result_null(cx)}else if(result instanceof Uint8Array){const tempPtr=arrayToHeap(result);if(result.byteLength<=INT32_MAX){sqlite3.result_blob(cx,tempPtr,result.byteLength,SQLITE_TRANSIENT)}else{sqlite3.result_blob64(cx,tempPtr,BigInt(result.byteLength),SQLITE_TRANSIENT)}_free(tempPtr)}else{throw new SQLite3Error(`Unsupported type for function result: \"${typeof result}\"`)}break;default:throw new SQLite3Error(`Unsupported type for function result: \"${typeof result}\"`)}}class Database{constructor(filename,{fileMustExist=false,readOnly=false}={}){let flags;if(readOnly){flags=SQLITE_OPEN_READONLY}else{flags=SQLITE_OPEN_READWRITE;if(!fileMustExist)flags|=SQLITE_OPEN_CREATE}const rc=sqlite3.open_v2(filename,temp,flags,NULL);this._ptr=getValue(temp,\"i32\");if(rc!==SQLITE_OK){if(this._ptr!==NULL)sqlite3.close_v2(this._ptr);throw new SQLite3Error(`Could not open the database \"${filename}\"`)}this._functions=new Map}get isOpen(){return this._ptr!==null}get inTransaction(){this._assertOpen();return sqlite3.get_autocommit(this._ptr)===0}close(){this._assertOpen();for(const func of this._functions.values())removeFunction(func);this._functions.clear();this._handleError(sqlite3.close_v2(this._ptr));this._ptr=null}function(name,func,{deterministic=false}={}){this._assertOpen();function wrappedFunc(cx,argc,argv){const args=parseFunctionArguments(argc,argv);let result;try{result=func.apply(null,args)}catch(err){const tempPtr=stringToHeap(err.toString());sqlite3.result_error(cx,tempPtr,-1);_free(tempPtr);return}setFunctionResult(cx,result)}if(this._functions.has(name)){removeFunction(this._functions.get(name));this._functions.delete(name)}const funcPtr=addFunction(wrappedFunc,\"viii\");this._functions.set(name,funcPtr);let eTextRep=SQLITE_UTF8;if(deterministic)eTextRep|=SQLITE_DETERMINISTIC;this._handleError(sqlite3.create_function_v2(this._ptr,name,func.length,eTextRep,NULL,funcPtr,NULL,NULL,NULL));return this}exec(sql){this._assertOpen();const tempPtr=stringToHeap(sql);try{this._handleError(sqlite3.exec(this._ptr,tempPtr,NULL,NULL,NULL))}finally{_free(tempPtr)}}prepare(sql){this._assertOpen();return new Statement(this,sql)}run(sql,values){const stmt=this.prepare(sql);try{return stmt.run(values)}finally{stmt.finalize()}}all(sql,values,{expand=false}={}){return this._query(sql,values,false,expand)}get(sql,values,{expand=false}={}){return this._query(sql,values,true,expand)}_query(sql,values,single,expand){const stmt=this.prepare(sql);try{if(single){return stmt.get(values,{expand})}else{return stmt.all(values,{expand})}}finally{stmt.finalize()}}_assertOpen(){if(!this.isOpen)throw new SQLite3Error(\"Database already closed\")}_handleError(returnCode){if(returnCode!==SQLITE_OK)throw new SQLite3Error(sqlite3.errmsg(this._ptr))}}class Statement{constructor(db,sql){const tempPtr=stringToHeap(sql);try{db._handleError(sqlite3.prepare_v2(db._ptr,tempPtr,-1,temp,NULL))}finally{_free(tempPtr)}this._ptr=getValue(temp,\"i32\");if(this._ptr===NULL)throw new SQLite3Error(\"Nothing to prepare\");this._db=db}get database(){return this._db}get isFinalized(){return this._ptr===null}run(values){this._assertReady();this._bind(values);this._step();return{changes:sqlite3.changes(this._db._ptr),lastInsertRowid:toNumberOrNot(sqlite3.last_insert_rowid(this._db._ptr))}}iterate(values,{expand=false}={}){return this._queryRows(values,expand)}all(values,{expand=false}={}){return Array.from(this.iterate(values,{expand}))}get(values,{expand=false}={}){const result=this._queryRows(values,expand).next();return result.done?null:result.value}finalize(){if(this.isFinalized)throw new SQLite3Error(\"Statement already finalized\");try{this._db._handleError(sqlite3.finalize(this._ptr))}finally{this._ptr=null}}_reset(){return sqlite3.clear_bindings(this._ptr)===SQLITE_OK&&sqlite3.reset(this._ptr)===SQLITE_OK}*_queryRows(values,expand){this._assertReady();this._bind(values);const columns=this._getColumnNames();while(this._step())yield this._getRow(columns,expand)}_bind(values){if(!this._reset()){throw new SQLite3Error(\"Could not reset statement prior to binding new values\")}if(Array.isArray(values)){this._bindArray(values)}else if(values!=null&&typeof values===\"object\"){this._bindObject(values)}else if(typeof values!==\"undefined\"){this._bindValue(values,1)}}_step(){const ret=sqlite3.step(this._ptr);switch(ret){case SQLITE_ROW:return true;case SQLITE_DONE:return false;default:this._db._handleError(ret)}}_getRow(columns,expand){const row={};for(let i=0;i<columns.length;i++){let v;const colType=sqlite3.column_type(this._ptr,i);switch(colType){case SQLITE_INTEGER:v=toNumberOrNot(sqlite3.column_int64(this._ptr,i));break;case SQLITE_FLOAT:v=sqlite3.column_double(this._ptr,i);break;case SQLITE_TEXT:v=sqlite3.column_text(this._ptr,i);break;case SQLITE_BLOB:const p=sqlite3.column_blob(this._ptr,i);if(p!=NULL){v=HEAPU8.slice(p,p+sqlite3.column_bytes(this._ptr,i))}else{v=new Uint8Array}break;case SQLITE_NULL:v=null;break}const column=columns[i];if(expand){let table=sqlite3.column_table_name(this._ptr,i);table=table===\"\"?\"$\":table;if(Object.hasOwn(row,table)){row[table][column]=v}else{row[table]={[column]:v}}}else{row[column]=v}}return row}_getColumnNames(){const names=[];const columns=sqlite3.column_count(this._ptr);for(let i=0;i<columns;i++)names.push(sqlite3.column_name(this._ptr,i));return names}_bindArray(values){for(let i=0;i<values.length;i++)this._bindValue(values[i],i+1)}_bindObject(values){for(const[param,value]of Object.entries(values)){const i=sqlite3.bind_parameter_index(this._ptr,param);if(i===0)throw new SQLite3Error(`Unknown binding parameter: \"${param}\"`);this._bindValue(value,i)}}_bindValue(value,position){let ret;switch(typeof value){case\"string\":const tempPtr=stringToHeap(value);ret=sqlite3.bind_text(this._ptr,position,tempPtr,-1,SQLITE_TRANSIENT);_free(tempPtr);break;case\"number\":if(Number.isSafeInteger(value)){if(value>=INT32_MIN&&value<=INT32_MAX){ret=sqlite3.bind_int(this._ptr,position,value)}else{ret=sqlite3.bind_int64(this._ptr,position,BigInt(value))}}else{ret=sqlite3.bind_double(this._ptr,position,value)}break;case\"bigint\":ret=sqlite3.bind_int64(this._ptr,position,value);break;case\"boolean\":ret=sqlite3.bind_int(this._ptr,position,value?1:0);break;case\"object\":if(value===null){ret=sqlite3.bind_null(this._ptr,position)}else if(value instanceof Uint8Array){const tempPtr=arrayToHeap(value);if(value.byteLength<=INT32_MAX){ret=sqlite3.bind_blob(this._ptr,position,tempPtr,value.byteLength,SQLITE_TRANSIENT)}else{ret=sqlite3.bind_blob64(this._ptr,position,tempPtr,BigInt(value.byteLength),SQLITE_TRANSIENT)}_free(tempPtr)}else{throw new SQLite3Error(`Unsupported type for binding: \"${typeof value}\"`)}break;default:throw new SQLite3Error(`Unsupported type for binding: \"${typeof value}\"`)}if(ret!==SQLITE_OK)this._db._handleError(ret)}_assertReady(){if(this.isFinalized)throw new SQLite3Error(\"Statement already finalized\");if(!this._db.isOpen)throw new SQLite3Error(\"Database is closed\")}}Module.Database=Database;Module.SQLite3Error=SQLite3Error;const path=require(\"node:path\");const crypto=require(\"node:crypto\");const SQLITE_CANTOPEN=14;const SQLITE_IOERR_READ=266;const SQLITE_IOERR_SHORT_READ=522;const SQLITE_IOERR_FSYNC=1034;const SQLITE_IOERR_WRITE=778;const SQLITE_IOERR_DELETE=2570;const SQLITE_IOERR_CLOSE=4106;const SQLITE_IOERR_TRUNCATE=1546;const SQLITE_IOERR_FSTAT=1802;const SQLITE_IOERR_LOCK=3850;const SQLITE_IOERR_UNLOCK=2058;const SQLITE_OPEN_READONLY=1;const SQLITE_OPEN_READWRITE=2;const SQLITE_OPEN_CREATE=4;const SQLITE_OPEN_EXCLUSIVE=16;const SQLITE_ACCESS_READWRITE=1;const SQLITE_ACCESS_READ=2;const SQLITE_LOCK_NONE=0;const SQLITE_BUSY=5;function _fd(fileInfo){return getValue(fileInfo+4,\"i32\")}function _isLocked(fileInfo){return getValue(fileInfo+8,\"i32\")!=0}function _setLocked(fileInfo,locked){setValue(fileInfo+8,locked?1:0,\"i32\")}function _path(fileInfo){return UTF8ToString(getValue(fileInfo+12,\"i32\"))}function _safeInt(bigInt){if(bigInt<Number.MIN_SAFE_INTEGER||bigInt>Number.MAX_SAFE_INTEGER)throw 0;return Number(bigInt)}var programArgs=[];var thisProgram=\"./this.program\";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName;if(typeof __filename!=\"undefined\"){_scriptName=__filename}else{}var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require(\"node:fs\");scriptDirectory=__dirname+\"/\";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:\"utf8\");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\\\/g,\"/\")}programArgs=process.argv.slice(2);if(typeof module!=\"undefined\"){module[\"exports\"]=Module}quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var EXITSTATUS;var isFileURI=filename=>filename.startsWith(\"file://\");class EmscriptenEH{}class EmscriptenSjLj extends EmscriptenEH{}var runtimeInitialized=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.resizable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b)}function preRun(){var preRun=Module[\"preRun\"];if(preRun){if(typeof preRun==\"function\")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports[\"z\"]()}function postRun(){var postRun=Module[\"postRun\"];if(postRun){if(typeof postRun==\"function\")postRun=[postRun];onPostRuns.push(...postRun)}callRuntimeCallbacks(onPostRuns)}function abort(what){Module[\"onAbort\"]?.(what);what=`Aborted(${what})`;err(what);ABORT=true;what+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(what);throw e}var wasmBinaryFile;function findWasmBinary(){return locateFile(\"node-sqlite3-wasm.wasm\")}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw'sync fetching of the wasm failed: you can preload it to Module[\"wasmBinary\"] manually, or emcc.py will do that for you when generating HTML (but not JS)'}function instantiateSync(file,info){var module;var binary=getBinarySync(file);module=new WebAssembly.Module(binary);var instance=new WebAssembly.Instance(module,info);return[instance,module]}function getWasmImports(){var imports={a:wasmImports};return imports}function createWasm(){function receiveInstance(instance){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}var info=getWasmImports();var instantiateWasm=Module[\"instantiateWasm\"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,inst=>resolve(receiveInstance(inst)))})}wasmBinaryFile??=findWasmBinary();var result=instantiateSync(wasmBinaryFile,info);return receiveInstance(result[0])}class ExitStatus{name=\"ExitStatus\";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var onPreRuns=[];var noExitRuntime=true;var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var __abort_js=()=>abort(\"\");var runtimeKeepaliveCounter=0;var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=false;runtimeKeepaliveCounter=0};var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);var HEAP32;function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);var date=new Date(time*1e3);if(isNaN(date.getTime())){return 1}HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;return 0}var timers={};var handleException=e=>{if(e instanceof ExitStatus||e==\"unwind\"){return EXITSTATUS}quit_(1,e)};var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){Module[\"onExit\"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};var _exit=exitJS;var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{return func()}catch(e){handleException(e)}finally{maybeExit()}};var _emscripten_get_now=()=>performance.now();var __setitimer_js=(which,timeout_ms)=>{if(timers[which]){clearTimeout(timers[which].id);delete timers[which]}if(!timeout_ms)return 0;var id=setTimeout(()=>{delete timers[which];callUserCallback(()=>__emscripten_timeout(which,_emscripten_get_now()))},timeout_ms);timers[which]={id,timeout_ms};return 0};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var HEAPU8;var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var HEAPU32;var __tzset_js=(timezone,daylight,std_name,dst_name)=>{var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?\"-\":\"+\";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,\"0\");var minutes=String(absOffset%60).padStart(2,\"0\");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17)}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17)}};var _emscripten_date_now=()=>Date.now();var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str=\"\";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):\"\";var HEAP16;var HEAPF32;var HEAPF64;var HEAP64;function setValue(ptr,value,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":HEAP8[ptr]=value;break;case\"i8\":HEAP8[ptr]=value;break;case\"i16\":HEAP16[ptr>>1]=value;break;case\"i32\":HEAP32[ptr>>2]=value;break;case\"i64\":HEAP64[ptr>>3]=BigInt(value);break;case\"float\":HEAPF32[ptr>>2]=value;break;case\"double\":HEAPF64[ptr>>3]=value;break;case\"*\":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}function _nodejsAccess(vfs,filePath,flags,outResult){let aflags=fs.constants.F_OK;if(flags==SQLITE_ACCESS_READWRITE)aflags=fs.constants.R_OK|fs.constants.W_OK;if(flags==SQLITE_ACCESS_READ)aflags=fs.constants.R_OK;try{fs.accessSync(UTF8ToString(filePath),aflags);setValue(outResult,1,\"i32\")}catch{setValue(outResult,0,\"i32\")}return SQLITE_OK}function _nodejsCheckReservedLock(fi,outResult){try{fs.accessSync(`${_path(fi)}.lock`,fs.constants.F_OK);setValue(outResult,1,\"i32\")}catch{setValue(outResult,0,\"i32\")}return SQLITE_OK}function _nodejsClose(fi){_nodejsUnlock(fi,SQLITE_LOCK_NONE);try{fs.closeSync(_fd(fi))}catch{return SQLITE_IOERR_CLOSE}return SQLITE_OK}function _nodejsDelete(vfs,filePath,dirSync){const pathStr=UTF8ToString(filePath);try{fs.unlinkSync(pathStr)}catch(err){if(err.code!=\"ENOENT\")return SQLITE_IOERR_DELETE}if(dirSync){let fd=-1;try{fd=fs.openSync(path.dirname(pathStr),\"r\");fs.fsyncSync(fd)}catch{return SQLITE_IOERR_FSYNC}finally{try{fs.closeSync(fd)}catch{return SQLITE_IOERR_FSYNC}}}return SQLITE_OK}function _nodejsFileSize(fi,outSize){try{setValue(outSize,fs.fstatSync(_fd(fi)).size,\"i64\")}catch{return SQLITE_IOERR_FSTAT}return SQLITE_OK}function _nodejsFullPathname(vfs,relPath,sizeFullPath,outFullPath){const full=path.resolve(UTF8ToString(relPath));stringToUTF8(full,outFullPath,sizeFullPath);return full.length<sizeFullPath?SQLITE_OK:SQLITE_CANTOPEN}function _nodejsLock(fi,level){if(!_isLocked(fi)){try{fs.mkdirSync(`${_path(fi)}.lock`)}catch(err){return err.code==\"EEXIST\"?SQLITE_BUSY:SQLITE_IOERR_LOCK}_setLocked(fi,true)}return SQLITE_OK}function _nodejsRandomness(vfs,bytes,outBuffer){const buf=HEAPU8.subarray(outBuffer,outBuffer+bytes);crypto.randomFillSync(buf);return bytes}function _nodejsRead(fi,outBuffer,bytes,offset){const buf=HEAPU8.subarray(outBuffer,outBuffer+bytes);let bytesRead;try{bytesRead=fs.readSync(_fd(fi),buf,0,bytes,offset)}catch{return SQLITE_IOERR_READ}if(bytesRead==bytes){return SQLITE_OK}else if(bytesRead>=0){if(bytesRead<bytes){try{buf.fill(0,bytesRead)}catch{return SQLITE_IOERR_READ}}return SQLITE_IOERR_SHORT_READ}return SQLITE_IOERR_READ}function _nodejsSync(fi,flags){try{fs.fsyncSync(_fd(fi))}catch{return SQLITE_IOERR_FSYNC}return SQLITE_OK}function _nodejsTruncate(fi,size){try{fs.ftruncateSync(_fd(fi),_safeInt(size))}catch{return SQLITE_IOERR_TRUNCATE}return SQLITE_OK}function _nodejsUnlock(fi,level){if(level==SQLITE_LOCK_NONE&&_isLocked(fi)){try{fs.rmdirSync(`${_path(fi)}.lock`)}catch(err){if(err.code!=\"ENOENT\")return SQLITE_IOERR_UNLOCK}_setLocked(fi,false)}return SQLITE_OK}function _nodejsWrite(fi,buffer,bytes,offset){try{const bytesWritten=fs.writeSync(_fd(fi),HEAPU8.subarray(buffer,buffer+bytes),0,bytes,_safeInt(offset));return bytesWritten!=bytes?SQLITE_IOERR_WRITE:SQLITE_OK}catch{return SQLITE_IOERR_WRITE}}function _nodejs_max_path_length(){return process.platform==\"win32\"?260:4096}function _nodejs_open(filePath,flags,mode){let oflags=0;if(flags&SQLITE_OPEN_EXCLUSIVE)oflags|=fs.constants.O_EXCL;if(flags&SQLITE_OPEN_CREATE)oflags|=fs.constants.O_CREAT;if(flags&SQLITE_OPEN_READONLY)oflags|=fs.constants.O_RDONLY;if(flags&SQLITE_OPEN_READWRITE)oflags|=fs.constants.O_RDWR;try{return fs.openSync(UTF8ToString(filePath),oflags,mode)}catch{return-1}}function getValue(ptr,type=\"i8\"){if(type.endsWith(\"*\"))type=\"*\";switch(type){case\"i1\":return HEAP8[ptr];case\"i8\":return HEAP8[ptr];case\"i16\":return HEAP16[ptr>>1];case\"i32\":return HEAP32[ptr>>2];case\"i64\":return HEAP64[ptr>>3];case\"float\":return HEAPF32[ptr>>2];case\"double\":return HEAPF64[ptr>>3];case\"*\":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var getCFunc=ident=>{var func=Module[\"_\"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\"){return UTF8ToString(ret)}if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type===\"number\"||type===\"boolean\");var numericRet=returnType!==\"string\";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};var wasmTableMirror=[];var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i<offset+count;i++){var item=getWasmTableEntry(i);if(item){functionsInTableMap.set(item,i)}}}};var functionsInTableMap;var getFunctionAddress=func=>{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}return wasmTable[\"grow\"](1)};var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};var uleb128EncodeWithLen=arr=>{const n=arr.length;return[n%128|128,n>>7,...arr]};var wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111};var generateTypePack=types=>uleb128EncodeWithLen(Array.from(types,type=>{var code=wasmTypeCodes[type];return code}));var convertJsFunctionToWasm=(func,sig)=>{var bytes=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(sig.slice(1)),...generateTypePack(sig[0]===\"v\"?\"\":sig[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(bytes);var instance=new WebAssembly.Instance(module,{e:{f:func}});var wrappedFunc=instance.exports[\"f\"];return wrappedFunc};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));setWasmTableEntry(index,null);freeTableIndexes.push(index)};{if(Module[\"noExitRuntime\"])noExitRuntime=Module[\"noExitRuntime\"];if(Module[\"print\"])out=Module[\"print\"];if(Module[\"printErr\"])err=Module[\"printErr\"];if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];if(Module[\"arguments\"])programArgs=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];var preInit=Module[\"preInit\"];if(preInit){if(typeof preInit==\"function\")Module[\"preInit\"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}Module[\"cwrap\"]=cwrap;Module[\"addFunction\"]=addFunction;Module[\"removeFunction\"]=removeFunction;var _sqlite3_finalize,_sqlite3_reset,_sqlite3_clear_bindings,_sqlite3_value_blob,_sqlite3_value_text,_sqlite3_value_bytes,_sqlite3_value_double,_sqlite3_value_int64,_sqlite3_value_type,_sqlite3_result_blob,_sqlite3_result_blob64,_sqlite3_result_double,_sqlite3_result_error,_sqlite3_result_int,_sqlite3_result_int64,_sqlite3_result_null,_sqlite3_result_text,_sqlite3_step,_sqlite3_column_count,_sqlite3_column_blob,_sqlite3_column_bytes,_sqlite3_column_double,_sqlite3_column_int64,_sqlite3_column_text,_sqlite3_column_type,_sqlite3_column_name,_sqlite3_column_table_name,_sqlite3_bind_blob,_sqlite3_bind_blob64,_sqlite3_bind_double,_sqlite3_bind_int,_sqlite3_bind_int64,_sqlite3_bind_null,_sqlite3_bind_text,_sqlite3_bind_parameter_index,_sqlite3_exec,_sqlite3_prepare_v2,_sqlite3_errmsg,_sqlite3_last_insert_rowid,_sqlite3_changes,_sqlite3_close_v2,_sqlite3_create_function_v2,_sqlite3_open_v2,_sqlite3_get_autocommit,_malloc,_free,__emscripten_timeout,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,memory,__indirect_function_table,wasmMemory,wasmTable;function assignWasmExports(wasmExports){_sqlite3_finalize=Module[\"_sqlite3_finalize\"]=wasmExports[\"A\"];_sqlite3_reset=Module[\"_sqlite3_reset\"]=wasmExports[\"B\"];_sqlite3_clear_bindings=Module[\"_sqlite3_clear_bindings\"]=wasmExports[\"C\"];_sqlite3_value_blob=Module[\"_sqlite3_value_blob\"]=wasmExports[\"D\"];_sqlite3_value_text=Module[\"_sqlite3_value_text\"]=wasmExports[\"E\"];_sqlite3_value_bytes=Module[\"_sqlite3_value_bytes\"]=wasmExports[\"F\"];_sqlite3_value_double=Module[\"_sqlite3_value_double\"]=wasmExports[\"G\"];_sqlite3_value_int64=Module[\"_sqlite3_value_int64\"]=wasmExports[\"H\"];_sqlite3_value_type=Module[\"_sqlite3_value_type\"]=wasmExports[\"I\"];_sqlite3_result_blob=Module[\"_sqlite3_result_blob\"]=wasmExports[\"J\"];_sqlite3_result_blob64=Module[\"_sqlite3_result_blob64\"]=wasmExports[\"K\"];_sqlite3_result_double=Module[\"_sqlite3_result_double\"]=wasmExports[\"L\"];_sqlite3_result_error=Module[\"_sqlite3_result_error\"]=wasmExports[\"M\"];_sqlite3_result_int=Module[\"_sqlite3_result_int\"]=wasmExports[\"N\"];_sqlite3_result_int64=Module[\"_sqlite3_result_int64\"]=wasmExports[\"O\"];_sqlite3_result_null=Module[\"_sqlite3_result_null\"]=wasmExports[\"P\"];_sqlite3_result_text=Module[\"_sqlite3_result_text\"]=wasmExports[\"Q\"];_sqlite3_step=Module[\"_sqlite3_step\"]=wasmExports[\"R\"];_sqlite3_column_count=Module[\"_sqlite3_column_count\"]=wasmExports[\"S\"];_sqlite3_column_blob=Module[\"_sqlite3_column_blob\"]=wasmExports[\"T\"];_sqlite3_column_bytes=Module[\"_sqlite3_column_bytes\"]=wasmExports[\"U\"];_sqlite3_column_double=Module[\"_sqlite3_column_double\"]=wasmExports[\"V\"];_sqlite3_column_int64=Module[\"_sqlite3_column_int64\"]=wasmExports[\"W\"];_sqlite3_column_text=Module[\"_sqlite3_column_text\"]=wasmExports[\"X\"];_sqlite3_column_type=Module[\"_sqlite3_column_type\"]=wasmExports[\"Y\"];_sqlite3_column_name=Module[\"_sqlite3_column_name\"]=wasmExports[\"Z\"];_sqlite3_column_table_name=Module[\"_sqlite3_column_table_name\"]=wasmExports[\"_\"];_sqlite3_bind_blob=Module[\"_sqlite3_bind_blob\"]=wasmExports[\"$\"];_sqlite3_bind_blob64=Module[\"_sqlite3_bind_blob64\"]=wasmExports[\"aa\"];_sqlite3_bind_double=Module[\"_sqlite3_bind_double\"]=wasmExports[\"ba\"];_sqlite3_bind_int=Module[\"_sqlite3_bind_int\"]=wasmExports[\"ca\"];_sqlite3_bind_int64=Module[\"_sqlite3_bind_int64\"]=wasmExports[\"da\"];_sqlite3_bind_null=Module[\"_sqlite3_bind_null\"]=wasmExports[\"ea\"];_sqlite3_bind_text=Module[\"_sqlite3_bind_text\"]=wasmExports[\"fa\"];_sqlite3_bind_parameter_index=Module[\"_sqlite3_bind_parameter_index\"]=wasmExports[\"ga\"];_sqlite3_exec=Module[\"_sqlite3_exec\"]=wasmExports[\"ha\"];_sqlite3_prepare_v2=Module[\"_sqlite3_prepare_v2\"]=wasmExports[\"ia\"];_sqlite3_errmsg=Module[\"_sqlite3_errmsg\"]=wasmExports[\"ja\"];_sqlite3_last_insert_rowid=Module[\"_sqlite3_last_insert_rowid\"]=wasmExports[\"ka\"];_sqlite3_changes=Module[\"_sqlite3_changes\"]=wasmExports[\"la\"];_sqlite3_close_v2=Module[\"_sqlite3_close_v2\"]=wasmExports[\"ma\"];_sqlite3_create_function_v2=Module[\"_sqlite3_create_function_v2\"]=wasmExports[\"na\"];_sqlite3_open_v2=Module[\"_sqlite3_open_v2\"]=wasmExports[\"oa\"];_sqlite3_get_autocommit=Module[\"_sqlite3_get_autocommit\"]=wasmExports[\"pa\"];_malloc=Module[\"_malloc\"]=wasmExports[\"qa\"];_free=Module[\"_free\"]=wasmExports[\"ra\"];__emscripten_timeout=wasmExports[\"ta\"];__emscripten_stack_restore=wasmExports[\"ua\"];__emscripten_stack_alloc=wasmExports[\"va\"];_emscripten_stack_get_current=wasmExports[\"wa\"];memory=wasmMemory=wasmExports[\"y\"];__indirect_function_table=wasmTable=wasmExports[\"sa\"]}var wasmImports={n:__abort_js,l:__emscripten_runtime_keepalive_clear,o:__localtime_js,i:__setitimer_js,p:__tzset_js,q:_emscripten_date_now,a:_emscripten_get_now,j:_emscripten_resize_heap,w:_nodejsAccess,s:_nodejsCheckReservedLock,f:_nodejsClose,x:_nodejsDelete,v:_nodejsFileSize,m:_nodejsFullPathname,u:_nodejsLock,h:_nodejsRandomness,e:_nodejsRead,b:_nodejsSync,c:_nodejsTruncate,t:_nodejsUnlock,d:_nodejsWrite,g:_nodejs_max_path_length,r:_nodejs_open,k:_proc_exit};async function run(){preRun();var setStatus=Module[\"setStatus\"];if(setStatus){setStatus(\"Running...\");await new Promise(resolve=>setTimeout(resolve,1));setTimeout(setStatus,1,\"\")}if(ABORT)return;initRuntime();Module[\"onRuntimeInitialized\"]?.();postRun()}var wasmExports;wasmExports=createWasm();run();\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Read-only access to the SQLite files browsers keep their passwords in\n * (Chromium's `Login Data`, Firefox's `key4.db`).\n *\n * Backed by `node-sqlite3-wasm`: real SQLite, compiled to WebAssembly, so there\n * is no `.node` binary to build or ship per platform. That matters twice over —\n * the MCPB bundles to a single `dist/server.cjs`, and `node:sqlite` is not an\n * option because tsup targets node20 while that module needs Node 22.5+.\n *\n * The build copies `node-sqlite3-wasm.wasm` next to the bundle, because the\n * package resolves it as `__dirname + \"/node-sqlite3-wasm.wasm\"` at load time.\n */\n\nimport { copyFileSync, mkdtempSync, rmSync } from 'fs';\nimport { tmpdir } from 'os';\nimport * as path from 'path';\n\n/**\n * Run `read` against a private copy of a browser database.\n *\n * Always a copy, never the original: the browser may be running, and SQLite\n * takes locks and writes `-wal`/`-journal` siblings. Opening the live file\n * risks `SQLITE_BUSY` at best and touching the user's real password store at\n * worst — and this whole package is strictly read-only by policy.\n */\nexport async function withDatabaseCopy<T>(\n  databasePath: string,\n  read: (db: { all(sql: string): Record<string, unknown>[] }) => T,\n): Promise<T> {\n  // Load-bearing dynamic import: node-sqlite3-wasm instantiates a 1.2 MB\n  // WebAssembly module at require time. A static import would make every\n  // consumer of this package — including the capability registry, which is\n  // imported by all four clients — pay that cost on startup even when nobody\n  // ever reads a password store.\n  // eslint-disable-next-line no-restricted-syntax\n  const { Database } = await import('node-sqlite3-wasm');\n\n  const scratch = mkdtempSync(path.join(tmpdir(), 'openrecord-pwstore-'));\n  const copy = path.join(scratch, path.basename(databasePath));\n  try {\n    copyFileSync(databasePath, copy);\n    const db = new Database(copy, { readOnly: true });\n    try {\n      return read({ all: (sql: string) => db.all(sql) });\n    } finally {\n      db.close();\n    }\n  } finally {\n    // The copy holds decryptable credentials; do not leave it in the temp dir.\n    rmSync(scratch, { recursive: true, force: true });\n  }\n}\n\n/**\n * Coerce a column that should be text into a string.\n *\n * Written out rather than using `String(value)` because a driver may hand back\n * a Buffer for a TEXT column, and `String(buffer)` would stringify the object\n * rather than decode it.\n */\nexport function toText(value: unknown): string | null {\n  if (value == null) return null;\n  if (typeof value === 'string') return value;\n  if (typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') return String(value);\n  if (Buffer.isBuffer(value)) return value.toString('utf-8');\n  if (value instanceof Uint8Array) return Buffer.from(value).toString('utf-8');\n  return null;\n}\n\n/** Coerce a column that should be binary into a Buffer, whatever the driver hands back. */\nexport function toBuffer(value: unknown): Buffer | null {\n  if (value == null) return null;\n  if (Buffer.isBuffer(value)) return value;\n  if (value instanceof Uint8Array) return Buffer.from(value);\n  if (typeof value === 'string') return Buffer.from(value, 'binary');\n  return null;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Chromium-family password stores (Chrome, Arc, Brave, Edge, Vivaldi, Opera).\n *\n * Every one of them keeps the same two things: a `Login Data` SQLite file whose\n * `logins` table holds an encrypted `password_value`, and a per-browser master\n * key held by the OS. Only how the master key is protected differs by platform.\n */\n\nimport { execFile } from 'child_process';\nimport { createDecipheriv, pbkdf2Sync } from 'crypto';\nimport { existsSync, readFileSync, readdirSync } from 'fs';\nimport { homedir } from 'os';\nimport * as path from 'path';\nimport { promisify } from 'util';\nimport { toBuffer, toText, withDatabaseCopy } from './sqlite';\nimport type { PasswordStoreEntry } from './types';\n\nconst execFileAsync = promisify(execFile);\n\ninterface ChromiumBrowser {\n  /** Display name, also the Keychain *account* for the \"<name> Safe Storage\" item. */\n  name: string;\n  /** Keychain account on macOS, when it differs from the display name. */\n  keychainAccount?: string;\n  /** Profile root, relative to the platform's application-data directory. */\n  macDir?: string;\n  winDir?: string;\n}\n\n/**\n * Ordered so the browsers people actually keep health logins in come first.\n * Adding one is a single entry — the extraction path is shared.\n */\nconst BROWSERS: ChromiumBrowser[] = [\n  { name: 'Chrome', macDir: 'Google/Chrome', winDir: 'Google/Chrome/User Data' },\n  { name: 'Arc', macDir: 'Arc/User Data', winDir: 'Arc/User Data' },\n  { name: 'Brave', macDir: 'BraveSoftware/Brave-Browser', winDir: 'BraveSoftware/Brave-Browser/User Data' },\n  { name: 'Edge', keychainAccount: 'Microsoft Edge', macDir: 'Microsoft Edge', winDir: 'Microsoft/Edge/User Data' },\n  { name: 'Vivaldi', macDir: 'Vivaldi', winDir: 'Vivaldi/User Data' },\n  { name: 'Opera', keychainAccount: 'Opera', macDir: 'com.operasoftware.Opera', winDir: 'Opera Software/Opera Stable' },\n];\n\n/**\n * Every `Login Data` under a browser's root. Chromium writes one per profile\n * folder, and the folder names are not predictable (`Profile 28` is real), so\n * each folder is checked rather than a list of names. Opera keeps its single\n * profile in the root itself.\n */\nfunction loginDatabases(root: string): string[] {\n  let folders: string[];\n  try {\n    folders = readdirSync(root, { withFileTypes: true })\n      .filter(entry => entry.isDirectory())\n      .map(entry => path.join(root, entry.name));\n  } catch {\n    // Unreadable root (macOS can refuse it outright): skip this browser, not the scan.\n    return [];\n  }\n  return [root, ...folders].map(folder => path.join(folder, 'Login Data')).filter(existsSync);\n}\n\nfunction applicationSupportRoot(): string {\n  return process.platform === 'win32'\n    ? process.env.LOCALAPPDATA ?? path.join(homedir(), 'AppData', 'Local')\n    : path.join(homedir(), 'Library', 'Application Support');\n}\n\nfunction profileRoot(browser: ChromiumBrowser): string | null {\n  const relative = process.platform === 'win32' ? browser.winDir : browser.macDir;\n  return relative ? path.join(applicationSupportRoot(), relative) : null;\n}\n\n/** Each Chromium browser's profile root, for the access check in `index.ts`. */\nexport function chromiumProfileRoots(): { name: string; root: string }[] {\n  return BROWSERS.flatMap(browser => {\n    const root = profileRoot(browser);\n    return root ? [{ name: browser.name, root }] : [];\n  });\n}\n\n/**\n * macOS: the master key is a PBKDF2 stretch of the \"<Browser> Safe Storage\"\n * Keychain password. The salt and iteration count are Chromium's, hardcoded in\n * `os_crypt_mac.mm`, and have not changed since the feature shipped.\n *\n * This is the call that makes macOS put up \"…wants to access your keychain\".\n * That prompt is the consent gate, so it is deliberately not suppressed.\n */\nasync function macMasterKey(account: string): Promise<Buffer | null> {\n  try {\n    // execFile, not exec: the account name goes in as an argv entry so a\n    // browser name can never be read as shell syntax.\n    const { stdout } = await execFileAsync('security', ['find-generic-password', '-wa', account]);\n    const secret = stdout.trim();\n    if (!secret) return null;\n    return pbkdf2Sync(secret, Buffer.from('saltysalt', 'utf-8'), 1003, 16, 'sha1');\n  } catch {\n    // No such item, or the user clicked Deny. Both mean \"skip this browser\".\n    return null;\n  }\n}\n\n/**\n * Windows: the master key sits in `Local State` as DPAPI-protected bytes.\n *\n * Unwrapped through PowerShell's ProtectedData rather than a native DPAPI\n * addon, to keep this package free of per-platform binaries.\n */\nasync function windowsMasterKey(profileRootPath: string): Promise<Buffer | null> {\n  const localState = path.join(profileRootPath, 'Local State');\n  if (!existsSync(localState)) return null;\n\n  try {\n    const parsed = JSON.parse(readFileSync(localState, 'utf-8')) as {\n      os_crypt?: { encrypted_key?: string; app_bound_encrypted_key?: string };\n    };\n    const encoded = parsed.os_crypt?.encrypted_key;\n    if (!encoded) return null;\n\n    // Strip the 5-byte \"DPAPI\" tag Chromium prepends before base64-ing.\n    const blob = Buffer.from(encoded, 'base64').subarray(5);\n    const script =\n      'Add-Type -AssemblyName System.Security;' +\n      `$b=[Convert]::FromBase64String('${blob.toString('base64')}');` +\n      '[Convert]::ToBase64String([Security.Cryptography.ProtectedData]::Unprotect($b,$null,0))';\n    const { stdout } = await execFileAsync(\n      'powershell.exe',\n      ['-NoProfile', '-NonInteractive', '-Command', script],\n      { windowsHide: true },\n    );\n    const key = Buffer.from(stdout.trim(), 'base64');\n    return key.length === 32 ? key : null;\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Decrypt one `password_value` blob.\n *\n * The 3-byte prefix names the scheme. `v10`/`v11` are the OS-key schemes we\n * handle. `v20` is Chrome 127+ **app-bound encryption** on Windows, which binds\n * the key to the Chrome executable itself; it cannot be unwrapped from another\n * process by design, so we report it rather than pretending the row is corrupt.\n *\n * `scheme` is passed in rather than read from `process.platform` so both branches stay\n * reachable from a test on either OS. Exported for that reason.\n */\nexport function decryptPassword(\n  masterKey: Buffer,\n  blob: Buffer,\n  osScheme: 'mac' | 'windows',\n): { text?: string; reason?: string } {\n  if (blob.length === 0) return { text: '' };\n  const scheme = blob.subarray(0, 3).toString('latin1');\n\n  if (scheme === 'v20') return { reason: 'app-bound encryption (Chrome 127+ on Windows)' };\n\n  if (scheme !== 'v10' && scheme !== 'v11') {\n    // No recognised prefix: pre-encryption Chromium stored the password as-is.\n    return { text: blob.toString('utf-8') };\n  }\n\n  try {\n    if (osScheme === 'windows') {\n      // AES-256-GCM: 12-byte nonce, 16-byte tag at the end.\n      const nonce = blob.subarray(3, 15);\n      const body = blob.subarray(15);\n      const decipher = createDecipheriv('aes-256-gcm', masterKey, nonce);\n      decipher.setAuthTag(body.subarray(body.length - 16));\n      return { text: Buffer.concat([decipher.update(body.subarray(0, body.length - 16)), decipher.final()]).toString('utf-8') };\n    }\n\n    // macOS: AES-128-CBC with a fixed IV of sixteen spaces (0x20).\n    const ciphertext = blob.subarray(3);\n    if (ciphertext.length < 16 || ciphertext.length % 16 !== 0) return { reason: 'bad ciphertext length' };\n    const decipher = createDecipheriv('aes-128-cbc', masterKey, Buffer.alloc(16, 32));\n    return { text: Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString('utf-8') };\n  } catch (error) {\n    return { reason: (error as Error).message };\n  }\n}\n\n/** Every credential this machine's Chromium browsers have saved. */\nexport async function getChromiumLogins(): Promise<PasswordStoreEntry[]> {\n  const isMac = process.platform === 'darwin';\n  if (!isMac && process.platform !== 'win32') return [];\n\n  const entries: PasswordStoreEntry[] = [];\n\n  for (const browser of BROWSERS) {\n    const root = profileRoot(browser);\n    if (!root || !existsSync(root)) continue;\n\n    const databases = loginDatabases(root);\n    if (databases.length === 0) continue;\n\n    const masterKey = isMac\n      ? await macMasterKey(browser.keychainAccount ?? browser.name)\n      : await windowsMasterKey(root);\n    if (!masterKey) continue;\n\n    for (const database of databases) {\n      try {\n        const rows = await withDatabaseCopy(database, db =>\n          db.all('SELECT origin_url, username_value, password_value FROM logins'),\n        );\n\n        for (const row of rows) {\n          const blob = toBuffer(row.password_value);\n          const { text, reason } = blob\n            ? decryptPassword(masterKey, blob, isMac ? 'mac' : 'windows')\n            : { reason: 'no password blob' };\n          entries.push({\n            url: toText(row.origin_url) ?? '',\n            user: toText(row.username_value),\n            pass: text ?? null,\n            success: text != null,\n            source: browser.name,\n            ...(reason ? { failureReason: reason } : {}),\n          });\n        }\n      } catch {\n        // A profile that will not open (locked, corrupt, mid-upgrade) must not\n        // take the other profiles or browsers down with it.\n      }\n    }\n  }\n\n  return entries;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The sliver of ASN.1 DER that Firefox's NSS key store is written in.\n *\n * Only what the key-unwrapping path actually walks: definite-length SEQUENCEs,\n * OCTET STRINGs, INTEGERs and OBJECT IDENTIFIERs. Indefinite lengths, BER and\n * every other tag are out of scope — NSS never emits them here.\n */\n\nexport interface DerNode {\n  tag: number;\n  /** The node's contents, excluding tag and length bytes. */\n  content: Buffer;\n  /** Offset just past this node, relative to the buffer it was parsed from. */\n  end: number;\n  /** Present for constructed types (SEQUENCE, SET). */\n  children?: DerNode[];\n}\n\nexport const TAG_OCTET_STRING = 0x04;\nexport const TAG_SEQUENCE = 0x30;\nconst TAG_SET = 0x31;\n\n/** Parse one DER node at `offset`. */\nexport function parseDer(buffer: Buffer, offset = 0): DerNode {\n  const tag = buffer[offset];\n  if (tag === undefined) throw new Error('der: read past end of buffer');\n\n  let length = buffer[offset + 1];\n  if (length === undefined) throw new Error('der: truncated length');\n  let cursor = offset + 2;\n\n  // Long form: the low 7 bits say how many bytes carry the real length.\n  if (length & 0x80) {\n    const byteCount = length & 0x7f;\n    if (byteCount === 0 || byteCount > 4) throw new Error('der: unsupported length encoding');\n    length = 0;\n    for (let i = 0; i < byteCount; i++) {\n      const byte = buffer[cursor++];\n      if (byte === undefined) throw new Error('der: truncated long-form length');\n      length = length * 256 + byte;\n    }\n  }\n\n  const end = cursor + length;\n  if (end > buffer.length) throw new Error('der: node runs past end of buffer');\n  const content = buffer.subarray(cursor, end);\n\n  const node: DerNode = { tag, content, end };\n  if (tag === TAG_SEQUENCE || tag === TAG_SET) {\n    node.children = [];\n    let inner = 0;\n    while (inner < content.length) {\n      const element = parseDer(content, inner);\n      node.children.push(element);\n      inner = element.end;\n    }\n  }\n  return node;\n}\n\n/** Fetch a required child by index, with a message that says what was missing. */\nexport function child(node: DerNode, ...indexes: number[]): DerNode {\n  let current = node;\n  for (const index of indexes) {\n    const next = current.children?.[index];\n    if (!next) throw new Error(`der: expected a child at index ${index}`);\n    current = next;\n  }\n  return current;\n}\n\n/** Render an OBJECT IDENTIFIER's contents in dotted-decimal form. */\nexport function oidToString(content: Buffer): string {\n  const first = content[0];\n  if (first === undefined) return '';\n\n  // The first byte packs the two leading arcs as 40 * a + b.\n  const parts = [Math.floor(first / 40), first % 40];\n  let accumulator = 0;\n  for (let i = 1; i < content.length; i++) {\n    const byte = content[i]!;\n    accumulator = accumulator * 128 + (byte & 0x7f);\n    if ((byte & 0x80) === 0) {\n      parts.push(accumulator);\n      accumulator = 0;\n    }\n  }\n  return parts.join('.');\n}\n\n/** Read a DER INTEGER that is known to be small (iteration counts, key sizes). */\nexport function readInteger(node: DerNode): number {\n  if (node.content.length === 0) return 0;\n  if (node.content.length > 6) throw new Error('der: integer too large');\n  return node.content.readUIntBE(0, node.content.length);\n}\n\n/**\n * Strip PKCS#7 padding.\n *\n * Kept separate from the ciphers because NSS pads plaintext that is already a\n * whole number of blocks with a full block, and a naive \"last byte is the\n * count\" strip on unpadded data would silently truncate a key.\n */\nexport function stripPadding(plaintext: Buffer, blockSize: number): Buffer {\n  const padLength = plaintext[plaintext.length - 1];\n  if (padLength === undefined || padLength === 0 || padLength > blockSize || padLength > plaintext.length) {\n    return plaintext;\n  }\n  for (let i = plaintext.length - padLength; i < plaintext.length; i++) {\n    if (plaintext[i] !== padLength) return plaintext;\n  }\n  return plaintext.subarray(0, plaintext.length - padLength);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Firefox password store (NSS): `key4.db` holds the wrapped keys, `logins.json`\n * the encrypted credentials.\n *\n * Three things here are easy to get wrong, and each was found by running this\n * against a real 969-login profile rather than by reading the format:\n *\n *  1. **Modern Firefox encrypts login fields with AES-256-CBC, not 3DES.** The\n *     algorithm is named per field, so it must be dispatched on, not assumed.\n *  2. **The PBES2 IV is stored as 14 bytes**; the real AES IV is `04 0e` followed\n *     by those 14. Passing the raw 14 bytes fails outright.\n *  3. **`nssPrivate` holds several wrapped keys that share one CKA_ID** — a\n *     24-byte legacy 3DES key and a 32-byte AES key, under the same id. So the\n *     key must be chosen by the length its cipher needs, not by id alone.\n */\n\nimport { createDecipheriv, createHash, createHmac, pbkdf2Sync } from 'crypto';\nimport { existsSync, readFileSync, readdirSync } from 'fs';\nimport { homedir } from 'os';\nimport * as path from 'path';\nimport { child, oidToString, parseDer, readInteger, stripPadding, type DerNode } from './der';\nimport { toBuffer, withDatabaseCopy } from './sqlite';\nimport type { PasswordStoreEntry } from './types';\n\nconst OID_PBES2 = '1.2.840.113549.1.5.13';\nconst OID_PBKDF2 = '1.2.840.113549.1.5.12';\nconst OID_3DES_CBC = '1.2.840.113549.3.7';\nconst OID_AES256_CBC = '2.16.840.1.101.3.4.1.42';\n\n/** Cipher parameters keyed by the OID a field declares. */\nconst FIELD_CIPHERS: Record<string, { algorithm: string; keyLength: number; blockSize: number }> = {\n  [OID_AES256_CBC]: { algorithm: 'aes-256-cbc', keyLength: 32, blockSize: 16 },\n  [OID_3DES_CBC]: { algorithm: 'des-ede3-cbc', keyLength: 24, blockSize: 8 },\n};\n\nconst sha1 = (...parts: Buffer[]): Buffer => {\n  const hash = createHash('sha1');\n  for (const part of parts) hash.update(part);\n  return hash.digest();\n};\n\nconst hmacSha1 = (key: Buffer, ...parts: Buffer[]): Buffer => {\n  const hmac = createHmac('sha1', key);\n  for (const part of parts) hmac.update(part);\n  return hmac.digest();\n};\n\n/**\n * Undo one NSS password-based encryption blob.\n *\n * `algorithm` is the AlgorithmIdentifier SEQUENCE; `ciphertext` the OCTET STRING\n * beside it. Handles both the modern PBES2/AES form and the legacy\n * pbeWithSha1AndTripleDES form, because a long-lived profile can still hold the\n * latter.\n */\nexport function pbeDecrypt(algorithm: DerNode, ciphertext: Buffer, globalSalt: Buffer, masterPassword: Buffer): Buffer {\n  const algorithmOid = oidToString(child(algorithm, 0).content);\n  const parameters = child(algorithm, 1);\n\n  if (algorithmOid === OID_PBES2) {\n    const keyDerivation = child(parameters, 0);\n    if (oidToString(child(keyDerivation, 0).content) !== OID_PBKDF2) {\n      throw new Error('firefox: PBES2 with an unexpected key-derivation function');\n    }\n\n    const kdfParameters = child(keyDerivation, 1);\n    const salt = child(kdfParameters, 0).content;\n    const iterations = readInteger(child(kdfParameters, 1));\n    const keyLength = readInteger(child(kdfParameters, 2));\n\n    const storedIv = child(parameters, 1, 1).content;\n    // NSS stores 14 IV bytes and reconstructs the DER OCTET STRING header in\n    // front of them to make the 16 AES needs.\n    const iv = storedIv.length === 14 ? Buffer.concat([Buffer.from([0x04, 0x0e]), storedIv]) : storedIv;\n\n    const key = pbkdf2Sync(sha1(globalSalt, masterPassword), salt, iterations, keyLength, 'sha256');\n    const decipher = createDecipheriv('aes-256-cbc', key, iv);\n    decipher.setAutoPadding(false);\n    return stripPadding(Buffer.concat([decipher.update(ciphertext), decipher.final()]), 16);\n  }\n\n  // Legacy: pbeWithSha1AndTripleDES-CBC. Key and IV both fall out of one\n  // HMAC ladder over the global salt and this entry's salt.\n  const entrySalt = child(parameters, 0).content;\n  const hashedPassword = sha1(globalSalt, masterPassword);\n  const paddedSalt = Buffer.concat([Buffer.alloc(Math.max(0, 20 - entrySalt.length)), entrySalt]).subarray(0, 20);\n  const combined = sha1(hashedPassword, entrySalt);\n  const firstHalf = hmacSha1(combined, paddedSalt, entrySalt);\n  const tk = hmacSha1(combined, paddedSalt);\n  const secondHalf = hmacSha1(combined, tk, entrySalt);\n  const material = Buffer.concat([firstHalf, secondHalf]);\n\n  const decipher = createDecipheriv('des-ede3-cbc', material.subarray(0, 24), material.subarray(material.length - 8));\n  decipher.setAutoPadding(false);\n  return stripPadding(Buffer.concat([decipher.update(ciphertext), decipher.final()]), 8);\n}\n\n/**\n * Unwrap every key in `key4.db`.\n *\n * Returns the raw key material, longest first, so a caller asking for 32 bytes\n * gets the AES key and one asking for 24 gets a 3DES-sized key — the two\n * routinely share a CKA_ID, which makes id alone useless as a discriminator.\n */\nasync function unwrapKeys(key4Path: string, masterPassword: Buffer): Promise<Buffer[]> {\n  const { meta, privateRows } = await withDatabaseCopy(key4Path, db => ({\n    meta: db.all(\"SELECT item1, item2 FROM metaData WHERE id = 'password'\")[0],\n    privateRows: db.all('SELECT a11 FROM nssPrivate'),\n  }));\n\n  const globalSalt = toBuffer(meta?.item1);\n  const passwordCheck = toBuffer(meta?.item2);\n  if (!globalSalt || !passwordCheck) throw new Error('firefox: key4.db has no password metadata');\n\n  // Confirms the (empty) master password before anything else is attempted, so\n  // a profile with a real master password fails with a clear reason.\n  const check = parseDer(passwordCheck);\n  const checkText = pbeDecrypt(child(check, 0), child(check, 1).content, globalSalt, masterPassword).toString('utf-8');\n  if (checkText !== 'password-check') {\n    throw new Error('firefox: profile is protected by a primary password');\n  }\n\n  const keys: Buffer[] = [];\n  for (const row of privateRows) {\n    const wrapped = toBuffer(row.a11);\n    if (!wrapped) continue;\n    try {\n      const node = parseDer(wrapped);\n      keys.push(pbeDecrypt(child(node, 0), child(node, 1).content, globalSalt, masterPassword));\n    } catch {\n      // One unusable key entry should not cost us the others.\n    }\n  }\n  return keys.sort((a, b) => b.length - a.length);\n}\n\n/** Decrypt one base64 ASN.1 field from logins.json. Exported for tests. */\nexport function decryptField(encoded: string, keys: Buffer[]): string {\n  const node = parseDer(Buffer.from(encoded, 'base64'));\n  const cipherOid = oidToString(child(node, 1, 0).content);\n  const spec = FIELD_CIPHERS[cipherOid];\n  if (!spec) throw new Error(`firefox: unsupported field cipher ${cipherOid}`);\n\n  // Exact length first. `length >= keyLength` alone would hand a 3DES field the\n  // first 24 bytes of the 32-byte AES key — which decrypts to garbage rather\n  // than failing, so nothing downstream would notice. Only fall back to a longer\n  // key when no key is exactly the right size.\n  const key =\n    keys.find(candidate => candidate.length === spec.keyLength) ??\n    keys.find(candidate => candidate.length > spec.keyLength);\n  if (!key) throw new Error(`firefox: no key of at least ${spec.keyLength} bytes`);\n\n  const decipher = createDecipheriv(spec.algorithm, key.subarray(0, spec.keyLength), child(node, 1, 1).content);\n  decipher.setAutoPadding(false);\n  const plaintext = Buffer.concat([decipher.update(child(node, 2).content), decipher.final()]);\n  return stripPadding(plaintext, spec.blockSize).toString('utf-8');\n}\n\nexport function firefoxProfileRoots(): string[] {\n  const home = homedir();\n  if (process.platform === 'darwin') return [path.join(home, 'Library', 'Application Support', 'Firefox', 'Profiles')];\n  if (process.platform === 'win32') {\n    const appData = process.env.APPDATA ?? path.join(home, 'AppData', 'Roaming');\n    return [path.join(appData, 'Mozilla', 'Firefox', 'Profiles')];\n  }\n  return [path.join(home, '.mozilla', 'firefox')];\n}\n\n/** Every credential this machine's Firefox profiles have saved. */\nexport async function getFirefoxLogins(): Promise<PasswordStoreEntry[]> {\n  const entries: PasswordStoreEntry[] = [];\n\n  for (const root of firefoxProfileRoots()) {\n    if (!existsSync(root)) continue;\n\n    for (const directory of readdirSync(root, { withFileTypes: true })) {\n      if (!directory.isDirectory()) continue;\n      const profile = path.join(root, directory.name);\n      const loginsPath = path.join(profile, 'logins.json');\n      const key4Path = path.join(profile, 'key4.db');\n      if (!existsSync(loginsPath) || !existsSync(key4Path)) continue;\n\n      let keys: Buffer[];\n      try {\n        keys = await unwrapKeys(key4Path, Buffer.alloc(0));\n      } catch {\n        continue; // Primary password set, or an unreadable key store.\n      }\n\n      let logins: { encryptedUsername?: string; encryptedPassword?: string; hostname?: string; formSubmitURL?: string }[];\n      try {\n        logins = JSON.parse(readFileSync(loginsPath, 'utf-8')).logins ?? [];\n      } catch {\n        continue;\n      }\n\n      for (const login of logins) {\n        if (!login.encryptedPassword) continue;\n        try {\n          entries.push({\n            url: login.hostname || login.formSubmitURL || '',\n            user: login.encryptedUsername ? decryptField(login.encryptedUsername, keys) : null,\n            pass: decryptField(login.encryptedPassword, keys),\n            success: true,\n            source: 'Firefox',\n          });\n        } catch {\n          entries.push({\n            url: login.hostname || login.formSubmitURL || '',\n            user: null,\n            pass: null,\n            success: false,\n            source: 'Firefox',\n          });\n        }\n      }\n    }\n  }\n\n  return entries;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Decide which saved credentials are Epic MyChart logins.\n *\n * Two independent checks, combined as a union:\n *\n *   1. **Directory match** — the hostname is one of the ~1300 known instances in\n *      `mychart-instances.json`. Offline, exact, and free, so it runs against\n *      every entry and short-circuits the network entirely for most real hits.\n *   2. **Redirect probe** — for hosts the directory does not know, follow the\n *      saved URL's redirects and look for Epic's login markup. This is what\n *      catches a health system that renamed or merged: the browser holds the\n *      password against the *old* domain, and the 302 chain lands on the new\n *      one, which the directory does know.\n *\n * An entry that passes neither is dropped. A host we cannot reach is a host we\n * cannot log into either, so offering it would only produce a failed login —\n * and the user can always type the account in by hand, or re-run the import once\n * the portal is back up.\n */\n\nimport { createHash } from 'crypto';\nimport rawInstances from '../scrapers/list-all-mycharts/mychart-instances.json';\nimport { scraperFetch } from '../scrapers/http';\nimport type { MyChartCandidate, MyChartConfidence, PasswordStoreEntry } from './types';\n\n/** Hostnames worth probing even though the directory has never heard of them. */\nconst NAME_HINTS = /mychart|patientportal|patient-portal|patientgateway|myhealth|healthportal|epicmychart/i;\n\n/** How many redirect hops to follow before giving up on a saved URL. */\nconst MAX_REDIRECTS = 6;\n\n/** Epic's login page marker, present on every instance we have captured. */\nconst LOGIN_MARKERS = ['mainLoginContent', 'Authentication/Login'];\n\ninterface DirectoryEntry {\n  name: string;\n  hostname: string;\n}\n\nlet directoryCache: Map<string, DirectoryEntry> | null = null;\n\n/** Hostname → instance, built once from the bundled directory. */\nfunction directory(): Map<string, DirectoryEntry> {\n  if (directoryCache) return directoryCache;\n  const map = new Map<string, DirectoryEntry>();\n  for (const raw of rawInstances as { name: string; url: string }[]) {\n    try {\n      map.set(new URL(raw.url).hostname.toLowerCase(), { name: raw.name, hostname: new URL(raw.url).hostname.toLowerCase() });\n    } catch {\n      // A malformed directory row should not break the lookup table.\n    }\n  }\n  directoryCache = map;\n  return map;\n}\n\nfunction hostnameOf(url: string): string | null {\n  try {\n    return new URL(url).hostname.toLowerCase();\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Trim a saved URL back to the MyChart mount point.\n *\n * Browsers save whatever page the form was on — `/accesscheck.asp`,\n * `/Authentication/PasswordReset`, `/app/activation/credentials`. Keeping the\n * first path segment keeps the Epic mount (`/MyChart`, `/mychart-prd`) while\n * dropping the rest.\n */\nfunction toMountUrl(url: string): string | null {\n  try {\n    const parsed = new URL(url);\n    const [, first = ''] = parsed.pathname.split('/');\n    parsed.pathname = first ? `/${first}` : '/';\n    parsed.search = '';\n    parsed.hash = '';\n    return parsed.toString();\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Follow the redirect chain by hand and report where it ends up.\n *\n * `scraperFetch` deliberately does not follow redirects — it owns the per-host\n * permit, and holding one across a whole chain could deadlock — so each hop is\n * its own call, exactly as `MyChartRequest.makeRequest` does it.\n */\nasync function probe(url: string): Promise<{ finalUrl: string; isLogin: boolean } | null> {\n  let current = url;\n\n  for (let hop = 0; hop < MAX_REDIRECTS; hop++) {\n    let response: Response;\n    try {\n      response = await scraperFetch(current, { redirect: 'manual' });\n    } catch {\n      return null;\n    }\n\n    const location = response.headers.get('location');\n    if (response.status >= 300 && response.status < 400 && location) {\n      try {\n        current = new URL(location, current).toString();\n      } catch {\n        return null;\n      }\n      continue;\n    }\n\n    if (!response.ok) return { finalUrl: current, isLogin: false };\n\n    let body = '';\n    try {\n      body = await response.text();\n    } catch {\n      return { finalUrl: current, isLogin: false };\n    }\n    return { finalUrl: current, isLogin: LOGIN_MARKERS.some(marker => body.includes(marker)) };\n  }\n\n  return { finalUrl: current, isLogin: false };\n}\n\n/** Stable id for a credential, so the UI can refer to one without echoing it. */\nfunction candidateKey(hostname: string, user: string | null, pass: string): string {\n  return createHash('sha256').update(`${hostname}\u0000${user ?? ''}\u0000${pass}`).digest('hex').slice(0, 16);\n}\n\n/**\n * Classify decrypted store entries into confirmed MyChart candidates.\n *\n * `probeUnknownHosts: false` makes this entirely offline: no outbound requests,\n * and only hostnames the bundled directory already knows are returned.\n */\nexport async function classifyMyChartEntries(\n  entries: PasswordStoreEntry[],\n  options: { probeUnknownHosts?: boolean } = {},\n): Promise<MyChartCandidate[]> {\n  const probeUnknownHosts = options.probeUnknownHosts ?? true;\n  const known = directory();\n\n  // Only decrypted rows with a password can become an account.\n  const usable = entries.filter(entry => entry.success && entry.pass);\n\n  const resolved: MyChartCandidate[] = [];\n  const toProbe: PasswordStoreEntry[] = [];\n\n  for (const entry of usable) {\n    const host = hostnameOf(entry.url);\n    if (!host) continue;\n\n    const match = known.get(host);\n    if (match) {\n      resolved.push({\n        ...entry,\n        pass: entry.pass!,\n        hostname: host,\n        confidence: 'directory',\n        instanceName: match.name,\n        key: candidateKey(host, entry.user, entry.pass!),\n      });\n      continue;\n    }\n\n    // Not a known instance. Probing every saved password would mean ~1000\n    // outbound requests, so only URLs that read like a patient portal qualify.\n    if (NAME_HINTS.test(entry.url)) toProbe.push(entry);\n  }\n\n  // Nothing to probe when host checks are off — directory hits are the answer.\n  if (!probeUnknownHosts) return dedupe(resolved);\n\n  for (const entry of toProbe) {\n    const host = hostnameOf(entry.url)!;\n    const mount = toMountUrl(entry.url);\n    const outcome = mount ? await probe(mount) : null;\n    if (!outcome) continue; // Host did not respond; we could not log in either.\n\n    const finalHost = hostnameOf(outcome.finalUrl) ?? host;\n    // A redirect can land on a host the directory *does* know — that is the\n    // renamed-health-system case, and it is a directory match, not a probe one.\n    const redirectedInto = known.get(finalHost);\n    if (!redirectedInto && !outcome.isLogin) continue;\n\n    resolved.push({\n      ...entry,\n      pass: entry.pass!,\n      hostname: finalHost,\n      confidence: redirectedInto ? 'directory' : 'probed',\n      ...(redirectedInto ? { instanceName: redirectedInto.name } : {}),\n      key: candidateKey(finalHost, entry.user, entry.pass!),\n    });\n  }\n\n  return dedupe(resolved);\n}\n\n/**\n * Collapse duplicates on the **resolved** hostname.\n *\n * Deduping on the saved URL would keep an old domain and the domain it\n * redirects into as two separate accounts for the same login. Username is\n * compared case-insensitively because MyChart logins are.\n */\nfunction dedupe(candidates: MyChartCandidate[]): MyChartCandidate[] {\n  const rank: Record<MyChartConfidence, number> = { directory: 0, probed: 1 };\n  const best = new Map<string, MyChartCandidate>();\n\n  for (const candidate of candidates) {\n    const id = `${candidate.hostname}|${(candidate.user ?? '').toLowerCase()}|${candidate.pass}`;\n    const existing = best.get(id);\n    if (!existing || rank[candidate.confidence] < rank[existing.confidence]) best.set(id, candidate);\n  }\n\n  return [...best.values()].sort(\n    (a, b) => rank[a.confidence] - rank[b.confidence] || a.hostname.localeCompare(b.hostname),\n  );\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Read MyChart credentials the user has already saved in their browser.\n *\n * Strictly read-only, on this machine only: nothing here writes to a browser\n * store or to the OS keychain, and no credential leaves the process. Reading\n * the macOS Keychain puts up the system's own \"wants to access\" prompt, which\n * is the consent gate for the whole feature.\n *\n * Upstream of the decryption work: bojangabric/browser-password-extractor (MIT).\n * The Firefox path has been substantially rewritten — see `firefox.ts`.\n */\n\nimport { readdirSync } from 'fs';\nimport { chromiumProfileRoots, getChromiumLogins } from './chromium';\nimport { firefoxProfileRoots, getFirefoxLogins } from './firefox';\nimport { classifyMyChartEntries } from './myChartFilter';\nimport type { MyChartCandidate, PasswordStoreEntry, PasswordStoreEntryWithKey } from './types';\n\nexport type { MyChartCandidate, PasswordStoreEntry, PasswordStoreEntryWithKey } from './types';\n\n/** True when this platform has a password store we know how to read. */\nexport function isSupportedPlatform(): boolean {\n  return process.platform === 'darwin' || process.platform === 'win32';\n}\n\n/**\n * Browsers whose saved passwords macOS will not let this process read.\n *\n * macOS shields some browsers' data folders from other apps. The refusal is an\n * EPERM on reading the folder, which the scan otherwise swallows exactly like\n * \"nothing saved\". Only the user can lift it, by giving the app this process\n * runs under Full Disk Access, so the caller has to tell them how.\n */\nexport function blockedBrowsers(): string[] {\n  if (process.platform !== 'darwin') return [];\n  const roots = [...chromiumProfileRoots(), ...firefoxProfileRoots().map(root => ({ name: 'Firefox', root }))];\n  return roots.filter(({ root }) => isPermissionDenied(root)).map(({ name }) => name);\n}\n\nfunction isPermissionDenied(directory: string): boolean {\n  try {\n    readdirSync(directory);\n    return false;\n  } catch (error) {\n    return (error as NodeJS.ErrnoException).code === 'EPERM';\n  }\n}\n\n/**\n * Every credential in every supported browser, decrypted, unfiltered.\n *\n * Exported for diagnostics; product code wants `findMyChartCandidates`, which\n * narrows to health portals.\n */\nexport async function getAllBrowserLogins(): Promise<PasswordStoreEntry[]> {\n  if (!isSupportedPlatform()) return [];\n  // Independent stores, so a slow Keychain prompt on one need not hold the other.\n  const [chromium, firefox] = await Promise.all([\n    getChromiumLogins().catch(() => [] as PasswordStoreEntry[]),\n    getFirefoxLogins().catch(() => [] as PasswordStoreEntry[]),\n  ]);\n  return [...chromium, ...firefox];\n}\n\n/**\n * The saved logins confirmed to be MyChart accounts, each tagged with how it\n * was confirmed. Anything we could not confirm is dropped — see\n * `myChartFilter.ts`.\n */\nexport async function findMyChartCandidates(\n  options: { probeUnknownHosts?: boolean } = {},\n): Promise<MyChartCandidate[]> {\n  return classifyMyChartEntries(await getAllBrowserLogins(), options);\n}\n\n/**\n * Confirmed MyChart accounts, in the shape the CLI's\n * `--read-login-from-browser` has always expected.\n */\nexport async function getMyChartAccounts(): Promise<PasswordStoreEntryWithKey[]> {\n  return findMyChartCandidates();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Whether an HTML body is the login page an EXPIRED session gets bounced to.\n *\n * Deliberately much stricter than `looksLikeLoginPage` in `../auth/login.ts`:\n * that one answers \"could this be a MyChart login page?\" during mount\n * discovery, where matching an authenticated page costs nothing. Here a false\n * positive would declare a live session dead and trigger a re-login, so only\n * markers that never appear on post-login pages count —\n * `__RequestVerificationToken` is on every page and the Epic license line is\n * in every footer, which is exactly why the loose check can't be reused for\n * expiry detection.\n */\nexport function looksLikeSignedOutPage(html: string): boolean {\n  const bodyLower = html.toLowerCase();\n  return bodyLower.includes('isprelogin')          // <body class=\"… isPrelogin\">\n    || bodyLower.includes('login with passkey')     // real instances\n    || bodyLower.includes('sign in with passkey')\n    || bodyLower.includes('forgot login information')\n    || bodyLower.includes('loginpagecontroller')    // the login page's own JS\n    || bodyLower.includes('authentication/login/dologin'); // the login form action\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Silent session renewal — the one place an expired MyChart session is\n * re-logged-in and put back on the right patient.\n *\n * This is deliberately a LEAF module: it imports nothing from the scraper\n * layer, so both of its callers — `makeAuthenticatedRequest` (renews when a\n * request bounces to the login page) and `sessionStore` (renews proactively\n * when a keepalive heartbeat finds the session dead) — can import it\n * statically without a cycle. It used to live inside\n * `makeAuthenticatedRequest`, which forced two `await import()` cycle\n * breakers; the graph is now acyclic:\n *\n *   makeAuthenticatedRequest ─┐\n *                             ├─→ sessionRenewal ─→ (nothing)\n *   sessionStore ─────────────┘\n *   proxyContext ─→ makeAuthenticatedRequest\n *\n * What makes the leaf possible is that both capabilities renewal needs travel\n * ON the request object itself: `reauthenticate` (wired by each client at\n * login) and `restoreProxyContext` (armed by proxyContext whenever the active\n * patient is recorded, alongside `activeProxyTarget`). Renewal calls them; it\n * doesn't need to know where they come from.\n */\n\nimport type { MyChartRequest } from './myChartRequest';\nimport { logger } from '../../../shared/logger';\n\n// Per-request-object renewal state. WeakMap rather than fields on the class so\n// the transport stays serialization-clean.\ntype RenewalState = { renewPromise: Promise<boolean> | null };\nconst renewalStates = new WeakMap<MyChartRequest, RenewalState>();\n\nfunction stateFor(mychartRequest: MyChartRequest): RenewalState {\n  let state = renewalStates.get(mychartRequest);\n  if (!state) {\n    state = { renewPromise: null };\n    renewalStates.set(mychartRequest, state);\n  }\n  return state;\n}\n\n/**\n * Renew an expired session via the request's `reauthenticate` hook, then\n * restore the active proxy patient if the session had been switched to one.\n *\n * Single-flight per request object: concurrent callers all await the same\n * renewal.\n */\nexport async function renewMyChartSession(mychartRequest: MyChartRequest): Promise<boolean> {\n  const state = stateFor(mychartRequest);\n  state.renewPromise ??= doRenew(mychartRequest).finally(() => {\n      state.renewPromise = null;\n    });\n  return state.renewPromise;\n}\n\nasync function doRenew(mychartRequest: MyChartRequest): Promise<boolean> {\n  const reauthenticate = mychartRequest.reauthenticate;\n  if (!reauthenticate) {\n    logger.debug(`MyChart session for ${mychartRequest.hostname} expired and no reauthenticate hook is wired.`);\n    return false;\n  }\n\n  logger.warn(`MyChart session for ${mychartRequest.hostname} expired — attempting automatic re-login.`);\n  let loggedIn = false;\n  try {\n    loggedIn = await reauthenticate();\n  } catch (error) {\n    logger.error(`Automatic re-login for ${mychartRequest.hostname} threw:`, error);\n    return false;\n  }\n  if (!loggedIn) {\n    logger.warn(`Automatic re-login for ${mychartRequest.hostname} was not possible.`);\n    return false;\n  }\n\n  // Re-login resets MyChart's server-side proxy context to the account holder.\n  // If this session had been deliberately switched to another patient's\n  // record, put it back BEFORE any caller retries — a renewed session that\n  // silently reads the wrong patient's chart is the one failure this app must\n  // never produce. `restoreProxyContext` is armed together with\n  // `activeProxyTarget` (see proxyContext); it re-runs the verified switch\n  // with autoRenew: false, so it can only ever fail, never re-enter this\n  // renewal. A recorded non-self target with no restore closure fails the\n  // renewal outright — never retry on the wrong chart.\n  const target = mychartRequest.activeProxyTarget;\n  if (target && !target.isSelf) {\n    const restore = mychartRequest.restoreProxyContext;\n    if (!restore) {\n      logger.error(\n        `Re-login for ${mychartRequest.hostname} succeeded but no restore hook is armed for the active patient record ('${target.displayName}').`,\n      );\n      return false;\n    }\n    try {\n      await restore();\n    } catch (error) {\n      logger.error(\n        `Re-login for ${mychartRequest.hostname} succeeded but restoring the active patient record ('${target.displayName}') failed:`,\n        error,\n      );\n      return false;\n    }\n  }\n\n  logger.info(`MyChart session for ${mychartRequest.hostname} renewed.`);\n  return true;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Unified in-memory session store and keepalive for MyChart sessions.\n *\n * Used by both the CLI and the web app. Each session is a token -> MyChartRequest\n * mapping. The keepalive calls /Home/KeepAlive and /keepalive.asp every 30s\n * (matching MyChart's own JS) to prevent session expiry.\n *\n * Usage:\n *   import { sessionStore } from './sessionStore';\n *   sessionStore.set('my-token', mychartRequest);\n *   const req = sessionStore.get('my-token');\n *   const stop = sessionStore.startKeepalive();\n *   // ... later\n *   stop();\n */\n\nimport type { MyChartRequest } from './myChartRequest';\nimport { renewMyChartSession } from './sessionRenewal';\nimport { logger } from '../../../shared/logger';\n\nconst KEEPALIVE_INTERVAL_MS = 30 * 1000; // 30 seconds, matches MyChart's own JS interval\n\ninterface SessionEntry {\n  request: MyChartRequest;\n  hostname: string;\n  status: 'logged_in' | 'need_2fa' | 'expired' | 'error';\n  createdAt: Date;\n}\n\nconst KEEPALIVE_MAX_ERRORS = 3;\n\nclass SessionStore {\n  private readonly sessions = new Map<string, SessionEntry>();\n  private intervalHandle: ReturnType<typeof setInterval> | null = null;\n  private keepAliveCounter = 0;\n  private readonly keepAliveErrors = new Map<string, number>();\n  private autoTokenCounter = 0;\n\n  /** Store a session. */\n  set(token: string, request: MyChartRequest, opts?: { hostname?: string; status?: SessionEntry['status'] }) {\n    this.sessions.set(token, {\n      request,\n      hostname: opts?.hostname ?? request.hostname,\n      status: opts?.status ?? 'logged_in',\n      createdAt: new Date(),\n    });\n  }\n\n  /** Get the MyChartRequest for a token. Returns undefined if not found. */\n  get(token: string): MyChartRequest | undefined {\n    return this.sessions.get(token)?.request;\n  }\n\n  /** Get the full session entry. */\n  getEntry(token: string): SessionEntry | undefined {\n    return this.sessions.get(token);\n  }\n\n  /** Update session status. */\n  setStatus(token: string, status: SessionEntry['status']) {\n    const entry = this.sessions.get(token);\n    if (entry) entry.status = status;\n  }\n\n  /** Delete a session. */\n  delete(token: string) {\n    this.sessions.delete(token);\n    this.keepAliveErrors.delete(token);\n  }\n\n  /** Check if a session exists. */\n  has(token: string): boolean {\n    return this.sessions.has(token);\n  }\n\n  /**\n   * Remove every entry pointing at this request. Clients call this when they\n   * discard a session (account removed, session cleared) so the keepalive\n   * stops pinging — and stops renewing — something nobody holds anymore.\n   */\n  unregister(request: MyChartRequest) {\n    for (const [token, entry] of this.sessions) {\n      if (entry.request === request) this.delete(token);\n    }\n  }\n\n  /** Get all sessions. */\n  all(): Map<string, SessionEntry> {\n    return this.sessions;\n  }\n\n  /** Get all logged-in sessions. */\n  active(): [string, SessionEntry][] {\n    return Array.from(this.sessions).filter(([, e]) => e.status === 'logged_in');\n  }\n\n  /** Number of sessions. */\n  get size(): number {\n    return this.sessions.size;\n  }\n\n  /**\n   * Start the keepalive interval. Pings keepalive endpoints for all active sessions.\n   * Returns a stop function to cancel the interval.\n   */\n  startKeepalive(): () => void {\n    if (this.intervalHandle) {\n      return () => this.stopKeepalive();\n    }\n    logger.debug(`[keepalive] Starting keepalive (every ${KEEPALIVE_INTERVAL_MS / 1000}s)`);\n    this.intervalHandle = setInterval(() => void this.runKeepalive(), KEEPALIVE_INTERVAL_MS);\n    // The heartbeat must never be the thing holding a process open — a CLI run\n    // that finished its scrape should exit, not ping forever. unref doesn't\n    // exist on React Native's timers, where there is no process to hold open.\n    const handle = this.intervalHandle as unknown as { unref?: () => void };\n    if (typeof handle.unref === 'function') handle.unref();\n    return () => this.stopKeepalive();\n  }\n\n  /**\n   * Idempotently enroll a request in the keepalive heartbeat.\n   *\n   * Called by makeAuthenticatedRequest after every successful authenticated\n   * request, so any session actively being used stays alive between uses\n   * without the client having to manage intervals itself. If the request is\n   * already registered (under any token — the CLI and tests register under\n   * their own), its entry is just marked logged_in again, which is also how a\n   * renewed session re-enters the ping rotation after being marked expired.\n   */\n  registerForKeepalive(request: MyChartRequest) {\n    for (const entry of this.sessions.values()) {\n      if (entry.request === request) {\n        entry.status = 'logged_in';\n        this.startKeepalive();\n        return;\n      }\n    }\n    this.autoTokenCounter++;\n    this.set(`auto:${request.hostname}:${this.autoTokenCounter}`, request);\n    this.startKeepalive();\n  }\n\n  /** Stop the keepalive interval. */\n  stopKeepalive() {\n    if (this.intervalHandle) {\n      clearInterval(this.intervalHandle);\n      this.intervalHandle = null;\n      logger.debug('[keepalive] Stopped');\n    }\n  }\n\n  /** Run a single keepalive cycle. Pings /Home for each active session. */\n  async runKeepalive() {\n    const activeSessions = this.active();\n    const allSessions = Array.from(this.sessions.entries());\n    const statusSummary = allSessions.map(([, e]) => `${e.hostname}:${e.status}`).join(', ');\n    logger.debug(`[keepalive] Cycle start | total=${this.sessions.size} active=${activeSessions.length} | ${statusSummary || 'none'}`);\n\n    for (const [token, entry] of activeSessions) {\n      await this.pingSession(token, entry);\n    }\n  }\n\n  /**\n   * Ping a single session using MyChart's actual keepalive endpoints.\n   * MyChart's JS calls both /Home/KeepAlive and /keepalive.asp every 30s.\n   * Each returns \"1\" if alive, \"0\" if expired.\n   */\n  private async pingSession(token: string, entry: SessionEntry) {\n    const label = token.length > 12 ? token.slice(0, 8) + '...' : token;\n    const host = entry.hostname;\n    this.keepAliveCounter++;\n    const cnt = this.keepAliveCounter;\n    const sessionAge = Math.round((Date.now() - entry.createdAt.getTime()) / 1000);\n    try {\n      const infoBefore = entry.request.getCookieInfo();\n      logger.debug(`[keepalive] ${label} (${host}): ping #${cnt} | age=${sessionAge}s cookies=${infoBefore.count} [${infoBefore.names.join(', ')}]`);\n\n      const start = Date.now();\n      const [dotNetResp, aspResp] = await Promise.all([\n        entry.request.makeRequest({\n          path: `/Home/KeepAlive?cnt=${cnt}`,\n          followRedirects: false,\n        }),\n        entry.request.makeRequest({\n          path: `/keepalive.asp?cnt=${cnt}`,\n          followRedirects: false,\n        }),\n      ]);\n      const elapsed = Date.now() - start;\n\n      const dotNetBody = await dotNetResp.text();\n      const aspBody = await aspResp.text();\n      const dotNetStatus = dotNetResp.status;\n      const aspStatus = aspResp.status;\n      const dotNetLocation = dotNetResp.headers.get('Location') ?? '';\n      const aspLocation = aspResp.headers.get('Location') ?? '';\n\n      logger.debug(\n        `[keepalive] ${label} (${host}): response in ${elapsed}ms | ` +\n        `KeepAlive: status=${dotNetStatus} body=\"${dotNetBody.trim().slice(0, 50)}\" location=\"${dotNetLocation}\" | ` +\n        `keepalive.asp: status=${aspStatus} body=\"${aspBody.trim().slice(0, 50)}\" location=\"${aspLocation}\"`\n      );\n\n      // \"0\" means session explicitly expired.\n      // Only trust /Home/KeepAlive — keepalive.asp returns \"0\" on many modern MyChart\n      // instances even when the session is alive (endpoint may not exist → 404/empty).\n      // If keepalive.asp also returns \"0\" we log it, but it doesn't drive expiry alone.\n      if (dotNetBody.trim() === '0') {\n        logger.warn(`[keepalive] ${label} (${host}): EXPIRED — /Home/KeepAlive returned \"0\" (keepalive.asp=${aspBody.trim()})`);\n        entry.status = await this.tryRenew(entry) ? 'logged_in' : 'expired';\n        return;\n      }\n      if (aspBody.trim() === '0') {\n        logger.warn(`[keepalive] ${label} (${host}): keepalive.asp returned \"0\" but /Home/KeepAlive returned \"${dotNetBody.trim()}\" — treating as alive`);\n      }\n\n      if (dotNetStatus === 200 || aspStatus === 200) {\n        this.keepAliveErrors.delete(token);\n        const infoAfter = entry.request.getCookieInfo();\n        logger.debug(`[keepalive] ${label} (${host}): ALIVE | cookies: ${infoBefore.count} -> ${infoAfter.count}`);\n        return;\n      }\n\n      // Neither endpoint returned 200 — likely a redirect to login page\n      logger.warn(\n        `[keepalive] ${label} (${host}): EXPIRED — neither endpoint returned 200 | ` +\n        `KeepAlive: ${dotNetStatus} -> \"${dotNetLocation}\" | keepalive.asp: ${aspStatus} -> \"${aspLocation}\"`\n      );\n      entry.status = await this.tryRenew(entry) ? 'logged_in' : 'expired';\n    } catch (err) {\n      const errorCount = (this.keepAliveErrors.get(token) ?? 0) + 1;\n      this.keepAliveErrors.set(token, errorCount);\n      const errMsg = (err as Error).message;\n      const errStack = (err as Error).stack ?? '';\n      logger.error(\n        `[keepalive] ${label} (${host}): network error (${errorCount}/${KEEPALIVE_MAX_ERRORS}) — ${errMsg}\\n` +\n        errStack.split('\\n').slice(0, 3).join('\\n')\n      );\n      if (errorCount >= KEEPALIVE_MAX_ERRORS) {\n        logger.error(`[keepalive] ${label} (${host}): marking as ERROR after ${KEEPALIVE_MAX_ERRORS} consecutive failures`);\n        entry.status = 'error';\n        this.keepAliveErrors.delete(token);\n      }\n    }\n  }\n\n  /**\n   * When a heartbeat reports the session dead, try to renew it on the spot via\n   * the request's reauthenticate hook — keeping the session alive \"as long as\n   * possible\" includes logging back in when a hospital expires it despite the\n   * pings (absolute timeouts exist server-side). Single-flighted with any\n   * concurrent scraper-triggered renewal by renewMyChartSession.\n   */\n  private async tryRenew(entry: SessionEntry): Promise<boolean> {\n    if (!entry.request.reauthenticate) return false;\n    try {\n      return await renewMyChartSession(entry.request);\n    } catch (err) {\n      logger.error(`[keepalive] ${entry.hostname}: renewal attempt failed —`, err);\n      return false;\n    }\n  }\n}\n\n/**\n * Singleton session store via globalThis.\n * Next.js bundles each API route separately, so a plain module-level singleton\n * creates separate instances per bundle. Using globalThis ensures all bundles\n * (API routes, instrumentation, etc.) share the same SessionStore.\n */\nconst globalKey = '__mychart_session_store__' as const;\nexport const sessionStore: SessionStore =\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  (globalThis as any)[globalKey] ??= new SessionStore();\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * makeAuthenticatedRequest — MyChartRequest.makeRequest for post-login calls.\n *\n * MyChart answers an expired session by bouncing the request to the login\n * page: a 302 to /Authentication/Login that a redirect-following client turns\n * into a 200 HTML login page. A scraper that doesn't check lands in one of two\n * failure modes: `.json()` throws on the HTML, or — far worse for a health\n * app — a token-extraction guard quietly returns an empty result and an\n * expired session renders as \"this patient has no allergies\".\n *\n * This wrapper is the one place that failure is handled. It detects the login\n * bounce, silently re-logs-in through the `reauthenticate` hook the client\n * wired onto the request (single-flight — a 30-category scrape whose session\n * dies mid-run triggers ONE re-login, not thirty), restores the active proxy\n * patient if the session had been switched to one, retries the original\n * request exactly once, and keeps the session registered for the 30-second\n * keepalive heartbeat so expiry stays rare in the first place. Only when all\n * of that fails does the caller see a typed `SessionExpiredError` — never a\n * fake-empty result.\n *\n * Division of labor with `makeRequest`: the raw method stays the transport for\n * everything pre-login — mount discovery, DoLogin, 2FA, terms, the keepalive\n * pings themselves — which is also what makes this wrapper safe: the re-login\n * path is built entirely from raw calls (plus `autoRenew: false` wrapped\n * calls), so a renewal can never end up awaiting its own single-flight\n * promise.\n */\n\nimport type { MyChartRequest } from './myChartRequest';\nimport type { RequestConfig } from './types';\nimport { looksLikeSignedOutPage } from './signedOutPage';\nimport { sessionStore } from './sessionStore';\nimport { renewMyChartSession } from './sessionRenewal';\n\n// Re-exported for callers that treat this module as the session-expiry\n// surface (the npm package's index, tests). The implementation lives in\n// sessionRenewal.ts — a leaf module — so this file, sessionStore and\n// proxyContext form an acyclic graph.\nexport { renewMyChartSession } from './sessionRenewal';\n\n/**\n * An expired MyChart session that could not be renewed automatically — either\n * no `reauthenticate` hook is wired, the hook failed (password changed,\n * interactive 2FA required), or the renewed session was bounced again.\n * Clients catch this at their boundary and tell the user to sign in again.\n */\nexport class SessionExpiredError extends Error {\n  constructor(message?: string) {\n    super(message ?? 'The MyChart session has expired and could not be renewed automatically. Sign in again to continue.');\n    this.name = 'SessionExpiredError';\n  }\n}\n\nexport type AuthenticatedRequestOptions = {\n  /**\n   * When false, a login bounce throws SessionExpiredError immediately instead\n   * of attempting a re-login. This is how the renewal path calls back into\n   * wrapped code (proxy-context restore) without any chance of waiting on its\n   * own in-flight renewal. Defaults to true. Callers forward a possibly-undefined\n   * value straight through and the read is `=== false`, so an explicit undefined\n   * is identical to an absent key.\n   */\n  autoRenew?: boolean | undefined;\n};\n\nconst LOGIN_URL_RE = /\\/authentication\\/login/i;\n\nconst REDIRECT_STATUSES = [301, 302, 303, 307, 308];\n\n/**\n * Rebuild a Response whose body has been read, so callers can still call\n * `.text()` / `.json()` as if nothing happened. `Response.url` is read-only\n * and empty on constructed responses, so it's carried over explicitly.\n */\nfunction rebuildResponse(original: Response, bodyText: string): Response {\n  const rebuilt = new Response(bodyText, {\n    status: original.status,\n    statusText: original.statusText,\n    headers: original.headers,\n  });\n  Object.defineProperty(rebuilt, 'url', { value: original.url });\n  return rebuilt;\n}\n\n/**\n * Make the request and decide whether the response is actually the login page.\n *\n * Three signals, cheapest first:\n *  1. The final URL is /Authentication/Login — covers both the Node path\n *     (makeRequest recursed through the 302 chain) and iOS (the platform fetch\n *     auto-follows, so only the final URL survives).\n *  2. An unfollowed redirect whose Location is the login page, for callers\n *     that pass `followRedirects: false`.\n *  3. A 200 HTML body bearing markers that only ever appear on the login page\n *     (see looksLikeSignedOutPage) — the fallback for platforms where the URL\n *     isn't reported. Reading the body is fine (MyChart bodies are small); the\n *     response is rebuilt so the caller can still consume it. Non-HTML\n *     responses (JSON, PDFs, images) are never touched.\n */\nasync function requestDetectingSignOut(\n  mychartRequest: MyChartRequest,\n  config: RequestConfig,\n): Promise<{ response: Response; signedOut: boolean }> {\n  const response = await mychartRequest.makeRequest(config);\n\n  if (LOGIN_URL_RE.test(response.url ?? '')) {\n    return { response, signedOut: true };\n  }\n\n  if (REDIRECT_STATUSES.includes(response.status)) {\n    const location = response.headers.get('Location') ?? '';\n    if (LOGIN_URL_RE.test(location)) {\n      return { response, signedOut: true };\n    }\n  }\n\n  const contentType = response.headers.get('content-type') ?? '';\n  if (response.status === 200 && contentType.includes('text/html')) {\n    const text = await response.text();\n    return { response: rebuildResponse(response, text), signedOut: looksLikeSignedOutPage(text) };\n  }\n\n  return { response, signedOut: false };\n}\n\n/**\n * Keep the session alive between requests: register it with the shared\n * keepalive (30s /Home/KeepAlive pings, matching MyChart's own JS) after any\n * successful authenticated request. Registration is idempotent, and the\n * interval never holds a process open (see sessionStore).\n */\nfunction registerKeepalive(mychartRequest: MyChartRequest) {\n  if (mychartRequest.disableAutoKeepalive) return;\n  sessionStore.registerForKeepalive(mychartRequest);\n}\n\n/**\n * Drop-in replacement for `mychartRequest.makeRequest(config)` for every\n * post-login call. Same config, same Response back; the login-bounce handling\n * documented at the top of this file happens in between.\n */\nexport async function makeAuthenticatedRequest(\n  mychartRequest: MyChartRequest,\n  config: RequestConfig,\n  options?: AuthenticatedRequestOptions,\n): Promise<Response> {\n  const first = await requestDetectingSignOut(mychartRequest, config);\n  if (!first.signedOut) {\n    registerKeepalive(mychartRequest);\n    return first.response;\n  }\n\n  if (options?.autoRenew === false) {\n    throw new SessionExpiredError();\n  }\n\n  const renewed = await renewMyChartSession(mychartRequest);\n  if (!renewed) {\n    throw new SessionExpiredError();\n  }\n\n  const second = await requestDetectingSignOut(mychartRequest, config);\n  if (second.signedOut) {\n    throw new SessionExpiredError(\n      'The MyChart session expired, and the request was signed out again immediately after a successful re-login.',\n    );\n  }\n  registerKeepalive(mychartRequest);\n  return second.response;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { getRequestVerificationTokenFromBody } from '../../core/util';\n\n/**\n * Fetch the request verification token that every `/api/conversations/*` and\n * `/api/medicaladvicerequests/*` POST has to carry, by loading the communication\n * center page it is embedded in.\n *\n * Leaf module on purpose: every messaging module needs this, and several of them\n * import each other, so it lives apart from any of them to keep the graph acyclic.\n *\n * Returns undefined when the page has no token — callers decide what that means.\n */\nexport async function getVerificationToken(mychartRequest: MyChartRequest): Promise<string | undefined> {\n  const res = await makeAuthenticatedRequest(mychartRequest, { path: '/app/communication-center' });\n  const html = await res.text();\n  return getRequestVerificationTokenFromBody(html);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * An error whose full explanation names chart data: a family member, a\n * document, a provider, what MyChart's page said. `message` says what went\n * wrong without any of it, and is all that error reporting (Sentry, analytics)\n * reads. `detailedMessage` is the full explanation, shown to Claude and the user.\n */\nexport class DetailedError extends Error {\n  readonly detailedMessage: string;\n\n  constructor(message: string, detailed: string) {\n    super(message);\n    this.detailedMessage = detailed;\n  }\n}\n\n/** What to show Claude or the user for anything thrown: the detailed message when there is one. */\nexport function detailedMessage(err: unknown): string {\n  if (!(err instanceof Error)) return String(err);\n  const detailed = (err as Partial<DetailedError>).detailedMessage;\n  return typeof detailed === 'string' ? detailed : err.message;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Attaching files to an outgoing message or reply.\n *\n * The portal's composer (`epic.px.client.message-composer` with\n * `epic.px.client.file-upload`) does it in two steps before the send: it\n * checks each file against `GetComposeSettings`' `attachmentSettings`, then\n * posts them as multipart to `DocumentUpload/UploadFile` — mount-relative, not\n * under `/api/` — and puts the `DocumentId` of each into the send body's\n * `documentIds`. The upload fields are the composer's own:\n * `{ isPending: true, addDCSToCache: true, dcsSource: \"820\" }`.\n */\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport type { FilePayload } from '../../core/filePayload';\nimport { DetailedError } from '../../../../shared/detailedError';\n\n/** `GetComposeSettings`' `attachmentSettings`. File sizes are in KB. */\nexport interface AttachmentSettings {\n  canAttach: boolean;\n  maxNumberOfAttachments: number;\n  docAndImageSettings: { maxFileSize: number; allowedFileExtensions: string[] };\n  videoSettings: { maxFileSize: number; allowedFileExtensions: string[] };\n}\n\nasync function getAttachmentSettings(\n  mychartRequest: MyChartRequest,\n  token: string,\n  organizationId = '',\n): Promise<AttachmentSettings | undefined> {\n  const res = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/conversations/GetComposeSettings',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json; charset=utf-8',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify({ organizationId }),\n  });\n  if (!res.ok) return undefined;\n  const data = await res.json().catch(() => null) as { attachmentSettings?: AttachmentSettings } | null;\n  return data?.attachmentSettings ?? undefined;\n}\n\n// The composer's own filename check: an extension, and none of these.\nconst FORBIDDEN_NAME_CHARS = /[/\\\\:*?\"<>|]/;\n\nfunction extensionOf(fileName: string): string {\n  const dot = fileName.lastIndexOf('.');\n  return dot === -1 ? '' : fileName.slice(dot + 1).toUpperCase();\n}\n\n/**\n * Why these files can't go on this instance, or undefined when they can.\n * Mirrors the composer's validation, so a file it would refuse is refused here\n * with its reason rather than sent to be rejected by the server.\n */\nexport function checkAttachments(files: readonly FilePayload[], settings: AttachmentSettings): string | undefined {\n  if (!settings.canAttach) return 'This MyChart does not allow attachments on messages.';\n  if (files.length > settings.maxNumberOfAttachments) {\n    return `This MyChart allows at most ${settings.maxNumberOfAttachments} attachment(s) per message; got ${files.length}.`;\n  }\n  const docs = settings.docAndImageSettings;\n  const videos = settings.videoSettings;\n  const allowed = (list: string[]) => list.map((e) => e.toUpperCase());\n  const docExts = allowed(docs.allowedFileExtensions);\n  const videoExts = allowed(videos.allowedFileExtensions);\n  for (const file of files) {\n    const ext = extensionOf(file.fileName);\n    if (!ext || FORBIDDEN_NAME_CHARS.test(file.fileName)) {\n      return `\"${file.fileName}\" needs a file extension and none of / \\\\ : * ? \" < > | in its name.`;\n    }\n    const sizeKb = file.bytes.length / 1024;\n    const limitKb = docExts.includes(ext) ? docs.maxFileSize : videoExts.includes(ext) ? videos.maxFileSize : undefined;\n    if (limitKb === undefined) {\n      return `\"${file.fileName}\": this MyChart accepts only ${[...docExts, ...videoExts].join(', ')} files.`;\n    }\n    if (sizeKb > limitKb) {\n      return `\"${file.fileName}\" is ${Math.ceil(sizeKb)} KB; this MyChart's limit for ${ext} files is ${limitKb} KB.`;\n    }\n  }\n  return undefined;\n}\n\nconst encoder = new TextEncoder();\n\n/** A `multipart/form-data` body laid out the way a browser's FormData is. */\nexport function buildUploadBody(\n  files: readonly FilePayload[],\n  organizationId: string,\n): { body: Uint8Array<ArrayBuffer>; contentType: string } {\n  const boundary = `----OpenRecordFormBoundary${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;\n  const parts: Uint8Array[] = [];\n  const quote = (s: string) => s.replace(/[\"\\r\\n]/g, (c) => encodeURIComponent(c));\n\n  for (const file of files) {\n    parts.push(encoder.encode(\n      `--${boundary}\\r\\n` +\n      `Content-Disposition: form-data; name=\"__file__[]\"; filename=\"${quote(file.fileName)}\"\\r\\n` +\n      `Content-Type: ${file.mimeType || 'application/octet-stream'}\\r\\n\\r\\n`,\n    ));\n    parts.push(file.bytes);\n    parts.push(encoder.encode('\\r\\n'));\n  }\n  const fields: Array<[string, string]> = [\n    ['AddDCSToCache', 'true'],\n    ['IsPending', 'true'],\n    ['DCSSource', '820'],\n    ['TargetPatientID', ''],\n    ['OrganizationId', organizationId],\n  ];\n  for (const [name, value] of fields) {\n    parts.push(encoder.encode(`--${boundary}\\r\\nContent-Disposition: form-data; name=\"${name}\"\\r\\n\\r\\n${value}\\r\\n`));\n  }\n  parts.push(encoder.encode(`--${boundary}--\\r\\n`));\n\n  const body = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));\n  let offset = 0;\n  for (const part of parts) {\n    body.set(part, offset);\n    offset += part.length;\n  }\n  return { body, contentType: `multipart/form-data; boundary=${boundary}` };\n}\n\ntype UploadResponse = { Success?: boolean; Data?: Array<{ DocumentId?: string }> | null };\n\nfunction parseUploadResponse(text: string): UploadResponse | null {\n  try {\n    return JSON.parse(text) as UploadResponse;\n  } catch {\n    return null;\n  }\n}\n\n/** Upload files for a message, returning their `DocumentId`s in order. Throws on any failure. */\nasync function uploadAttachments(\n  mychartRequest: MyChartRequest,\n  token: string,\n  files: readonly FilePayload[],\n  organizationId = '',\n): Promise<string[]> {\n  const { body, contentType } = buildUploadBody(files, organizationId);\n  const res = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/DocumentUpload/UploadFile',\n    method: 'POST',\n    headers: {\n      'Content-Type': contentType,\n      'Accept': 'application/json',\n      '__RequestVerificationToken': token,\n    },\n    body,\n  });\n  const text = await res.text();\n  const data = parseUploadResponse(text);\n  const ids = (data?.Data ?? []).map((d) => d.DocumentId ?? '');\n  if (!res.ok || !data?.Success || ids.length !== files.length || ids.some((id) => !id)) {\n    throw new DetailedError(\n      `Attachment upload failed with status ${res.status} (${ids.filter(Boolean).length} of ${files.length} files stored).`,\n      `Attachment upload failed with status ${res.status}: ${JSON.stringify(text.slice(0, 500))}`,\n    );\n  }\n  return ids;\n}\n\n/**\n * Check then upload, the composer's order. Returns the `documentIds` for the\n * send body, or the reason nothing was uploaded.\n */\nexport async function prepareAttachments(\n  mychartRequest: MyChartRequest,\n  token: string,\n  files: readonly FilePayload[],\n  organizationId = '',\n): Promise<{ documentIds: string[] } | { error: string }> {\n  if (files.length === 0) return { documentIds: [] };\n  const settings = await getAttachmentSettings(mychartRequest, token, organizationId);\n  if (!settings) return { error: 'Could not load this MyChart\\'s attachment settings (GetComposeSettings).' };\n  const refusal = checkAttachments(files, settings);\n  if (refusal) return { error: refusal };\n  try {\n    return { documentIds: await uploadAttachments(mychartRequest, token, files, organizationId) };\n  } catch (e) {\n    return { error: (e as Error).message };\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Send a new message (medical advice request) to a provider in MyChart.\n *\n * Flow:\n * 1. Get request verification token from /app/communication-center\n * 2. GetSubtopics - get available message topics/categories\n * 3. GetMedicalAdviceRequestRecipients - get list of providers\n * 4. GetViewers - get patient viewer info (wprId)\n * 5. GetComposeId - get unique compose ID\n * 6. With attachments: GetComposeSettings, then DocumentUpload/UploadFile\n * 7. SendMedicalAdviceRequest - send the message\n * 8. RemoveComposeId - cleanup\n */\n\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport type { FilePayload } from '../../core/filePayload';\nimport { getVerificationToken } from './communicationCenterToken';\nimport { prepareAttachments } from './messageUpload';\nimport { logger } from '../../../../shared/logger';\n\nexport type MessageRecipient = {\n  recipientType: number;\n  displayName: string;\n  specialty: string;\n  userId: string;\n  departmentId: string;\n  poolId: string;\n  providerId: string;\n  organizationId: string;\n  pcpTypeDisplayName?: string;\n  photoUrl?: string;\n  /** Out-of-context flag; absent on most instances, required on some. */\n  oocContext?: number;\n};\n\nexport type MessageTopic = {\n  displayName: string;\n  value: string;\n};\n\nexport type SendNewMessageParams = {\n  /** The provider to send the message to */\n  recipient: MessageRecipient;\n  /** The topic/category of the message */\n  topic: MessageTopic;\n  /** The subject line of the message */\n  subject: string;\n  /** The message body text */\n  messageBody: string;\n  /** Organization ID (usually empty string for default org) */\n  organizationId?: string;\n  /** Files to attach; uploaded before the send. */\n  attachments?: readonly FilePayload[];\n};\n\nexport type SendNewMessageResult = {\n  success: boolean;\n  conversationId?: string;\n  error?: string;\n};\n\n/** Helper to make authenticated JSON POST requests to MyChart API */\nasync function makeApiRequest(\n  mychartRequest: MyChartRequest,\n  path: string,\n  body: unknown,\n  token: string,\n): Promise<{ status: number; json: unknown; text: string }> {\n  const res = await makeAuthenticatedRequest(mychartRequest, {\n    path,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json; charset=utf-8',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify(body),\n  });\n  const text = await res.text();\n  let json: unknown = null;\n  try {\n    json = JSON.parse(text);\n  } catch {\n    // not JSON\n  }\n  return { status: res.status, json, text };\n}\n\n/** Re-exported for the public API surface; the implementation is the shared leaf module. */\nexport { getVerificationToken };\n\n/** Get available message topics/subtopics */\nexport async function getMessageTopics(\n  mychartRequest: MyChartRequest,\n  token: string,\n  organizationId = '',\n): Promise<MessageTopic[]> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/medicaladvicerequests/GetSubtopics',\n    { organizationId },\n    token,\n  );\n  const data = result.json as { topicList?: MessageTopic[] } | null;\n  return data?.topicList ?? [];\n}\n\n/** Get list of providers who can receive messages */\nexport async function getMessageRecipients(\n  mychartRequest: MyChartRequest,\n  token: string,\n  organizationId = '',\n): Promise<MessageRecipient[]> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/medicaladvicerequests/GetMedicalAdviceRequestRecipients',\n    { organizationId },\n    token,\n  );\n  // Some instances return a bare array; others wrap it in an object.\n  if (Array.isArray(result.json)) {\n    return result.json as MessageRecipient[];\n  }\n  const data = result.json as Record<string, unknown> | null;\n  const list =\n    data?.recipients ??\n    data?.recipientList ??\n    data?.Providers ??\n    data?.providers ??\n    data?.ProviderList ??\n    data?.providerList;\n  return Array.isArray(list) ? (list as MessageRecipient[]) : [];\n}\n\n/** Get the viewer (patient) wprId needed for sending */\nasync function getViewerWprId(\n  mychartRequest: MyChartRequest,\n  token: string,\n  organizationId = '',\n): Promise<string | undefined> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/medicaladvicerequests/GetViewers',\n    { organizationId },\n    token,\n  );\n  const data = result.json as {\n    viewers?: Array<{ wprId: string; isSelf: boolean }>;\n  } | null;\n  const selfViewer = data?.viewers?.find((v) => v.isSelf);\n  return selfViewer?.wprId;\n}\n\n/** Get a compose ID for a new message */\nasync function getComposeId(\n  mychartRequest: MyChartRequest,\n  token: string,\n): Promise<string | undefined> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/GetComposeId',\n    {},\n    token,\n  );\n  if (typeof result.json === 'string') {\n    return result.json;\n  }\n  return undefined;\n}\n\n/** Remove a compose ID after sending */\nasync function removeComposeId(\n  mychartRequest: MyChartRequest,\n  token: string,\n  composeId: string,\n): Promise<void> {\n  await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/RemoveComposeId',\n    { composeId },\n    token,\n  );\n}\n\nconst SEND_PATH = '/api/medicaladvicerequests/SendMedicalAdviceRequest';\n\n/**\n * The body `sendNewMessage` posts to `SEND_PATH`, split out so tests can send\n * the real shape rather than a hand-copied one that drifts from it.\n *\n * `recipientType` and `oocContext` are harmless on instances that ignore them\n * and required on some, so they always go out.\n */\nexport function buildSendPayload(\n  params: SendNewMessageParams,\n  session: { wprId: string; composeId: string; documentIds?: string[] },\n): Record<string, unknown> {\n  return {\n    recipient: {\n      recipientType: params.recipient.recipientType,\n      displayName: params.recipient.displayName,\n      userId: params.recipient.userId,\n      poolId: params.recipient.poolId,\n      providerId: params.recipient.providerId,\n      departmentId: params.recipient.departmentId,\n      oocContext: params.recipient.oocContext ?? 0,\n    },\n    topic: {\n      title: params.topic.displayName,\n      value: params.topic.value,\n    },\n    conversationId: '',\n    organizationId: params.organizationId ?? '',\n    viewers: [{ wprId: session.wprId }],\n    messageBody: [params.messageBody],\n    messageSubject: params.subject,\n    documentIds: session.documentIds ?? [],\n    includeOtherViewers: false,\n    composeId: session.composeId,\n  };\n}\n\n/**\n * Per-instance Epic quirk: the send endpoint answers HTTP 200 with an empty\n * conversation id, and files nothing, for message bodies over this length.\n * Measured, and modelled by fake-mychart — see the behavioral contract in\n * `fake-mychart/README.md`. Other instances may accept more; the\n * 200-without-id branch below still catches any silent drop regardless of\n * cause.\n */\nconst MAX_MESSAGE_BODY_LENGTH = 500;\n/** Cap on raw response-body text kept for diagnostics. */\nconst MAX_LOGGED_BODY = 2000;\n\n/**\n * Send a new message to a provider.\n *\n * This creates a new conversation (medical advice request). Never reports\n * success without a durable conversation id: some Epic instances answer\n * HTTP 200 with an empty body when they silently drop the request (e.g.\n * under-populated recipient or an over-limit body) — treated as\n * indeterminate, not success, because the caller cannot safely retry.\n */\nexport async function sendNewMessage(\n  mychartRequest: MyChartRequest,\n  params: SendNewMessageParams,\n): Promise<SendNewMessageResult> {\n  if (params.messageBody.length > MAX_MESSAGE_BODY_LENGTH) {\n    return {\n      success: false,\n      error: `Message body is ${params.messageBody.length} characters; an Epic instance we've tested silently drops bodies over ${MAX_MESSAGE_BODY_LENGTH}. Shorten the message or split it into multiple sends.`,\n    };\n  }\n  const organizationId = params.organizationId ?? '';\n\n  // Step 1: Get verification token\n  const token = await getVerificationToken(mychartRequest);\n  if (!token) {\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  // Step 2: Get viewer wprId\n  const wprId = await getViewerWprId(mychartRequest, token, organizationId);\n  if (!wprId) {\n    return { success: false, error: 'Could not get viewer wprId' };\n  }\n\n  // Step 3: Get compose ID\n  const composeId = await getComposeId(mychartRequest, token);\n  if (!composeId) {\n    return { success: false, error: 'Could not get compose ID' };\n  }\n\n  const prepared = await prepareAttachments(mychartRequest, token, params.attachments ?? [], organizationId);\n  if ('error' in prepared) {\n    await removeComposeId(mychartRequest, token, composeId);\n    return { success: false, error: prepared.error };\n  }\n\n  // Step 4: Send the message\n  const result = await makeApiRequest(\n    mychartRequest,\n    SEND_PATH,\n    buildSendPayload(params, { wprId, composeId, documentIds: prepared.documentIds }),\n    token,\n  );\n\n  // Step 5: Cleanup compose ID\n  await removeComposeId(mychartRequest, token, composeId);\n\n  if (result.status === 200 && typeof result.json === 'string' && result.json.length > 0) {\n    return { success: true, conversationId: result.json };\n  }\n  if (result.status === 200) {\n    // Some Epic instances answer 200 with an empty string when they silently\n    // drop the request (e.g. under-populated recipient). Treat as\n    // indeterminate, never success — and log the raw response for debugging.\n    const rawBody = result.text.slice(0, MAX_LOGGED_BODY);\n    logger.error(\n      '[sendMessage] indeterminate send: HTTP 200 without a conversation id. ' +\n      `path=${SEND_PATH} ` +\n      `body=${JSON.stringify(rawBody)}`,\n    );\n    return {\n      success: false,\n      error: 'Send returned HTTP 200 but no conversation id — indeterminate; ' +\n        'the message may not exist.',\n    };\n  }\n  return {\n    success: false,\n    error: `Send failed with status ${result.status}: ` +\n      JSON.stringify(result.text.slice(0, MAX_LOGGED_BODY)),\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Send a reply to an existing conversation in MyChart.\n *\n * Flow:\n * 1. Get request verification token from /app/communication-center\n * 2. GetConversationDetails - refuse a thread whose replyFlags.canReply is false\n * 3. GetViewers - get patient viewer info (wprId)\n * 4. GetComposeId - get unique compose ID\n * 5. With attachments: GetComposeSettings, then DocumentUpload/UploadFile\n * 6. SendReply - send the reply\n * 7. RemoveComposeId - cleanup\n */\n\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport type { FilePayload } from '../../core/filePayload';\nimport { getVerificationToken } from './communicationCenterToken';\nimport { prepareAttachments } from './messageUpload';\n\nexport type SendReplyParams = {\n  /** The conversation ID (hthId) to reply to */\n  conversationId: string;\n  /** The reply message body text */\n  messageBody: string;\n  /** Organization ID (usually empty string for default org) */\n  organizationId?: string;\n  /** Files to attach; uploaded before the send. */\n  attachments?: readonly FilePayload[];\n};\n\nexport type SendReplyResult = {\n  success: boolean;\n  conversationId?: string;\n  error?: string;\n};\n\n/** Helper to make authenticated JSON POST requests to MyChart API */\nasync function makeApiRequest(\n  mychartRequest: MyChartRequest,\n  path: string,\n  body: unknown,\n  token: string,\n): Promise<{ status: number; json: unknown }> {\n  const res = await makeAuthenticatedRequest(mychartRequest, {\n    path,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json; charset=utf-8',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify(body),\n  });\n  const text = await res.text();\n  let json: unknown = null;\n  try {\n    json = JSON.parse(text);\n  } catch {\n    // not JSON\n  }\n  return { status: res.status, json };\n}\n\n/**\n * Why the thread can't take a reply, or `undefined` when it can. MyChart\n * answers SendReply to a closed thread with 200 and an empty id and files\n * nothing, so the check has to happen before the send.\n */\nasync function replyRefusal(\n  mychartRequest: MyChartRequest,\n  token: string,\n  conversationId: string,\n): Promise<string | undefined> {\n  // The read endpoints key the thread on `id`, not `conversationId`.\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/GetConversationDetails',\n    { id: conversationId, maxReadMessages: 1, PageNonce: '' },\n    token,\n  );\n  if (result.status !== 200) {\n    return `Could not read conversation ${conversationId} to check it accepts replies (status ${result.status})`;\n  }\n  // A literal `null` is MyChart saying the active patient has no such conversation.\n  if (result.json === null || typeof result.json !== 'object') {\n    return `MyChart has no conversation ${conversationId} on the active patient record — take the id from get_messages`;\n  }\n  const flags = (result.json as { replyFlags?: { canReply?: unknown } }).replyFlags;\n  if (flags?.canReply !== false) return undefined;\n  return `MyChart does not accept replies on conversation ${conversationId}. ` +\n    'Nothing was sent; send_message starts a new conversation instead.';\n}\n\n/** Get the viewer (patient) wprId needed for sending */\nasync function getViewerWprId(\n  mychartRequest: MyChartRequest,\n  token: string,\n  organizationId = '',\n): Promise<string | undefined> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/medicaladvicerequests/GetViewers',\n    { organizationId },\n    token,\n  );\n  const data = result.json as {\n    viewers?: Array<{ wprId: string; isSelf: boolean }>;\n  } | null;\n  const selfViewer = data?.viewers?.find((v) => v.isSelf);\n  return selfViewer?.wprId;\n}\n\n/** Get a compose ID for a new message */\nasync function getComposeId(\n  mychartRequest: MyChartRequest,\n  token: string,\n): Promise<string | undefined> {\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/GetComposeId',\n    {},\n    token,\n  );\n  if (typeof result.json === 'string') {\n    return result.json;\n  }\n  return undefined;\n}\n\n/** Remove a compose ID after sending */\nasync function removeComposeId(\n  mychartRequest: MyChartRequest,\n  token: string,\n  composeId: string,\n): Promise<void> {\n  await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/RemoveComposeId',\n    { composeId },\n    token,\n  );\n}\n\n/**\n * Send a reply to an existing conversation.\n */\nexport async function sendReply(\n  mychartRequest: MyChartRequest,\n  params: SendReplyParams,\n): Promise<SendReplyResult> {\n  const organizationId = params.organizationId ?? '';\n\n  // Step 1: Get verification token\n  const token = await getVerificationToken(mychartRequest);\n  if (!token) {\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  // Step 2: Refuse a thread that does not take replies\n  const refusal = await replyRefusal(mychartRequest, token, params.conversationId);\n  if (refusal) {\n    return { success: false, error: refusal };\n  }\n\n  // Step 3: Get viewer wprId\n  const wprId = await getViewerWprId(mychartRequest, token, organizationId);\n  if (!wprId) {\n    return { success: false, error: 'Could not get viewer wprId' };\n  }\n\n  // Step 4: Get compose ID\n  const composeId = await getComposeId(mychartRequest, token);\n  if (!composeId) {\n    return { success: false, error: 'Could not get compose ID' };\n  }\n\n  // Step 5: Upload attachments\n  const prepared = await prepareAttachments(mychartRequest, token, params.attachments ?? [], organizationId);\n  if ('error' in prepared) {\n    await removeComposeId(mychartRequest, token, composeId);\n    return { success: false, error: prepared.error };\n  }\n\n  // Step 6: Send the reply\n  const sendBody = {\n    conversationId: params.conversationId,\n    organizationId,\n    viewers: [{ wprId }],\n    messageBody: [params.messageBody],\n    documentIds: prepared.documentIds,\n    includeOtherViewers: false,\n    composeId,\n  };\n\n  const result = await makeApiRequest(\n    mychartRequest,\n    '/api/conversations/SendReply',\n    sendBody,\n    token,\n  );\n\n  // Step 7: Cleanup compose ID\n  await removeComposeId(mychartRequest, token, composeId);\n\n  if (result.status === 200 && typeof result.json === 'string' && result.json.length > 0) {\n    return { success: true, conversationId: result.json };\n  }\n  // What a closed thread answers (200, empty string, nothing filed). The\n  // canReply check above should stop that first; this keeps a silent drop from\n  // ever reading as success.\n  if (result.status === 200 && result.json === '') {\n    return {\n      success: false,\n      error: 'MyChart accepted the reply but filed nothing (HTTP 200, empty conversation id).',\n    };\n  }\n\n  return {\n    success: false,\n    error: `Reply failed with status ${result.status}: ${JSON.stringify(result.json)}`,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The raw envelope every read scraper returns.\n *\n * A scraper's job is to talk to MyChart and hand back exactly what MyChart\n * sent. Deciding what a caller gets to see is the processor's job\n * (`scrapers/myChart/processors/`). Half the scrapers issue more than one\n * request — labs is four list calls plus two or three per order, billing is a\n * page scrape plus three JSON calls per account, past visits pages — so \"the\n * raw HTTP response\" is a list of requests, not one body.\n *\n * `raw` output mode returns {@link unwrapRaw} of this: the single body when\n * there was one request, the whole envelope otherwise.\n *\n * A request MyChart did not answer properly — a 5xx, a WAF block page, the\n * ASP.NET error page a November 2025 instance bounces a failed request to —\n * is recorded and then THROWN as a {@link MyChartResponseError}, in every\n * output mode. It used to be recorded and left for the processor to notice,\n * and five of twenty-nine did; for the rest, a 500 read as `{}`, projected to\n * `[]`, and rendered as \"no allergies on file\". The same care that keeps an\n * expired session from reading as an empty chart applies to a server error.\n * A scraper whose request is genuinely best-effort opts out per call with\n * `tolerateFailure`, and its processor is then the one reporting the gap.\n */\n\nimport type { MyChartRequest } from './myChartRequest';\nimport type { RequestConfig } from './types';\nimport { makeAuthenticatedRequest, type AuthenticatedRequestOptions } from './makeAuthenticatedRequest';\nimport { requireVerificationToken } from './util';\nimport { DetailedError } from '../../../shared/detailedError';\n\nexport interface RawRequestRecord {\n  /** The path as sent, minus the `noCache` cache-buster. */\n  path: string;\n  method: 'GET' | 'POST';\n  /**\n   * The body we posted, when it matters for reading the response (an order\n   * key, a CSN, a page cursor). JSON bodies are recorded parsed.\n   */\n  requestBody?: unknown;\n  status: number;\n  contentType: string;\n  /** Parsed JSON when the response was JSON, otherwise the text. */\n  body: unknown;\n  /**\n   * `token` marks the activity-page fetch made only to obtain the antiforgery\n   * token. It is part of the exchange, so it is recorded, but it is not the\n   * payload: {@link unwrapRaw} looks past it.\n   */\n  purpose?: 'token';\n  /**\n   * Why the answer was not the data, when it was not\n   * ({@link describeResponseFailure}). Set on every failed record, tolerated\n   * or thrown, so a processor reading a tolerated record can tell Epic's\n   * 200 error page from data without repeating the classification.\n   */\n  failure?: string;\n}\n\nexport interface RawResponse {\n  requests: RawRequestRecord[];\n}\n\n/**\n * MyChart answered a request with something other than the data: a non-2xx\n * status, its own error page, or a WAF's block page. Thrown by\n * {@link RawCollector.send} after the answer is recorded, so the envelope a\n * tolerant caller keeps still shows what came back. Clients surface the\n * detailed message as-is; nothing about it is an empty chart.\n */\nexport class MyChartResponseError extends DetailedError {\n  readonly method: string;\n  readonly path: string;\n  readonly status: number;\n\n  constructor(record: RawRequestRecord, reason: string, excerpt: string, notServedActivity?: string) {\n    const lead = `MyChart answered ${record.method} ${record.path} with ${reason}`;\n    const rest =\n      '. The request failed; nothing was read, so this is not an empty result. ' +\n      'Retry later, and if it keeps failing the instance may be down or blocking this request shape.' +\n      // Both facts, not a verdict: a Home landing plus a 500 is what an\n      // instance that does not serve the activity answers (1 of 4 real\n      // accounts, one activity), but a WAF block or a passing 500 after the\n      // same landing reads identically here, and retrying does help those.\n      (notServedActivity\n        ? ` GET ${notServedActivity} had also landed on the Home page instead of the activity, which is how an ` +\n          'instance that does not serve it answers — if this keeps failing, this MyChart most likely has no such page.'\n        : '');\n    // What the page said only in the detailed message: a MyChart page can carry the patient's name.\n    super(lead + rest, lead + (excerpt ? `: \"${excerpt}\"` : '') + rest);\n    this.name = 'MyChartResponseError';\n    this.method = record.method;\n    this.path = record.path;\n    this.status = record.status;\n  }\n}\n\n/**\n * ASP.NET's error pages. A November 2025 instance answers a failed request\n * with a 302 to `/Home/FiveHundred` (or `/Home/FourOhFour`), which 302s on to\n * `/Home/Error?code=14`, a 200 HTML page — so after the redirects are\n * followed, the only trace of the failure is the URL the response came from.\n * An August 2025 instance answers a bare 500 instead, which the status catches.\n */\nconst ASPNET_ERROR_PAGE_RE = /\\/home\\/(error|fivehundred|fourohfour)(?:[/?#]|$)/i;\n\n/** F5's block page: HTTP 200, `text/html`, and this text where the data should be. */\nconst WAF_BLOCK_RE = /Request Rejected|The requested URL was rejected/i;\n\nfunction isAspNetErrorPage(url: string | null | undefined): boolean {\n  if (!url) return false;\n  let pathname = url;\n  try {\n    pathname = new URL(url).pathname;\n  } catch {\n    // A relative Location header: test it as-is.\n  }\n  return ASPNET_ERROR_PAGE_RE.test(pathname);\n}\n\n/**\n * Why a response is not the data it was asked for, or null when it might be.\n * Cheapest signal first. A redirect a caller asked to see for itself\n * (`followRedirects: false`) is only a failure when it points at the error\n * page; where it points otherwise is the caller's to read.\n *\n * The error-page check reads `response.url`, so it needs the transport to\n * report where the final response came from. Node and Bun do. On device the\n * transport is `expo/fetch` (`scrapers/http.ts`), whose `FetchResponse.url`\n * is the native response URL (`metadata.url`, checked in Expo SDK 57) — and\n * `makeRequest` follows redirects itself with `redirect: 'manual'`, so the\n * response being classified is always the last hop's own, not a\n * platform-followed one.\n */\nexport function describeResponseFailure(\n  response: Response,\n  text: string,\n  config: Pick<RequestConfig, 'followRedirects'>,\n): string | null {\n  const contentType = response.headers.get('content-type') ?? '';\n  if (response.status >= 300 && response.status < 400 && config.followRedirects === false) {\n    const location = response.headers.get('Location') ?? '';\n    return isAspNetErrorPage(location)\n      ? `HTTP ${response.status} to its error page ${location}`\n      : null;\n  }\n  if (response.status < 200 || response.status >= 300) {\n    return `HTTP ${response.status}${contentType ? ` (${contentType})` : ''}`;\n  }\n  if (isAspNetErrorPage(response.url)) {\n    return `HTTP ${response.status} from its error page ${response.url}`;\n  }\n  if (contentType.includes('text/html') && WAF_BLOCK_RE.test(text.slice(0, 2000))) {\n    return (\n      `HTTP ${response.status} and a WAF block page in place of the data — the request was rejected ` +\n      'by the web application firewall in front of MyChart, not answered by MyChart'\n    );\n  }\n  return null;\n}\n\n/** Whether a followed activity-page GET ended on `/Home` — a URL the transport reports, so '' when it cannot. */\nfunction landedOnHome(url: string): boolean {\n  try {\n    return /\\/home\\/?$/i.test(new URL(url).pathname);\n  } catch {\n    return false;\n  }\n}\n\n/**\n * The first line or so of a body, tags stripped, for an error message. This\n * is page text — an error page's apology, a WAF's support id — never chart\n * data: a failed answer carries none, which is the point. It does reach\n * whatever logs the error message.\n */\nfunction excerptOf(text: string): string {\n  const plain = text\n    .replace(/<script[\\s\\S]*?<\\/script>/gi, ' ')\n    .replace(/<style[\\s\\S]*?<\\/style>/gi, ' ')\n    .replace(/<[^>]+>/g, ' ')\n    .replace(/\\s+/g, ' ')\n    .trim();\n  return plain.length > 160 ? `${plain.slice(0, 157)}...` : plain;\n}\n\n/** Strip the cache-busting `noCache=<random>` query param scrapers append. */\nexport function displayPath(path: string): string {\n  return path\n    .replace(/([?&])noCache=[^&]*&?/, '$1')\n    .replace(/[?&]$/, '');\n}\n\nfunction parseRequestBody(config: RequestConfig): unknown {\n  if (config.body === undefined) return undefined;\n  if (typeof config.body !== 'string') return `<${config.body.length} bytes>`;\n  const contentType = config.headers?.['Content-Type'] ?? config.headers?.['content-type'] ?? '';\n  if (contentType.includes('json')) {\n    try {\n      return JSON.parse(config.body);\n    } catch {\n      return config.body;\n    }\n  }\n  return config.body;\n}\n\nexport interface SendOptions {\n  /** Marks the activity-page fetch made only for its antiforgery token. */\n  purpose?: 'token';\n  /**\n   * Record a failed answer and return it instead of throwing. Only for a\n   * request whose failure the scraper's processor reports as a gap\n   * (`externalProvidersUnavailable`), never for the payload.\n   */\n  tolerateFailure?: boolean;\n}\n\n/**\n * Records every request a scraper makes so the envelope is the untouched\n * record of the exchange. Wraps `makeAuthenticatedRequest`, so the session\n * expiry handling and the active-patient restore still apply to every call.\n */\nexport class RawCollector {\n  readonly requests: RawRequestRecord[] = [];\n  /**\n   * The activity page the last {@link pageToken} asked for, when the instance\n   * redirected it to Home instead. Not a failure by itself: a mistyped or\n   * guessed activity path lands on Home too and its API still answers. Only\n   * when the API then fails does it say why — the activity is not served here.\n   */\n  private tokenPageLandedOnHome: string | null = null;\n\n  constructor(\n    private readonly request: MyChartRequest,\n    private readonly options?: AuthenticatedRequestOptions,\n  ) {}\n\n  /**\n   * Issue a request (named `send`, not `fetch`: http.unit.test.ts greps the\n   * scrapers for bare `fetch(` calls, and this is not a second network path —\n   * it wraps makeAuthenticatedRequest), record it, and return the response\n   * plus its body: parsed JSON when the body parses as JSON, otherwise the\n   * text. The Response has already been read; use the returned body.\n   *\n   * An answer that is not the data ({@link describeResponseFailure}) is\n   * recorded and then thrown as a {@link MyChartResponseError}. With\n   * `tolerateFailure` it is recorded and returned with `failure` set instead —\n   * for a request that is best-effort by design (an optional endpoint, a\n   * speculative probe), whose processor then reports the gap honestly. Never\n   * for the payload: a tolerated 500 on the payload is the empty chart this\n   * exists to prevent.\n   */\n  async send(\n    config: RequestConfig,\n    options: SendOptions = {},\n  ): Promise<{ response: Response; body: unknown; text: string; failure: MyChartResponseError | null }> {\n    const response = await makeAuthenticatedRequest(this.request, config, this.options);\n    const text = await response.text();\n    const contentType = response.headers.get('content-type') ?? '';\n    let body: unknown = text;\n    if (text.length > 0) {\n      try {\n        body = JSON.parse(text);\n      } catch {\n        body = text;\n      }\n    }\n    const record: RawRequestRecord = {\n      path: displayPath(config.path ?? config.url ?? ''),\n      method: config.method ?? 'GET',\n      ...(config.body !== undefined ? { requestBody: parseRequestBody(config) } : {}),\n      status: response.status,\n      contentType,\n      body,\n      ...(options.purpose ? { purpose: options.purpose } : {}),\n    };\n    this.requests.push(record);\n\n    const reason = describeResponseFailure(response, text, config);\n    if (reason) record.failure = reason;\n    const notServed = record.method === 'POST' && this.tokenPageLandedOnHome ? this.tokenPageLandedOnHome : undefined;\n    // An API that answered proves the activity is served, whatever its page did.\n    if (!reason && record.method === 'POST') this.tokenPageLandedOnHome = null;\n    const failure = reason ? new MyChartResponseError(record, reason, excerptOf(text), notServed) : null;\n    if (failure && !options.tolerateFailure) throw failure;\n    return { response, body, text, failure };\n  }\n\n  /**\n   * Fetch an activity page and return its antiforgery token. Throws when the\n   * page has none — the API behind it would refuse every call anyway.\n   */\n  async pageToken(pagePath: string): Promise<string> {\n    const page = await this.send({ path: pagePath }, { purpose: 'token' });\n    this.tokenPageLandedOnHome = landedOnHome(page.response.url) ? pagePath : null;\n    return requireVerificationToken(page.text, pagePath);\n  }\n\n  /** POST a JSON body with the antiforgery token, the way the React `/api/*` routes expect. */\n  async postJson(path: string, token: string, body: unknown = {}, options: SendOptions = {}): Promise<unknown> {\n    const result = await this.send(\n      {\n        path,\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json', __RequestVerificationToken: token },\n        body: JSON.stringify(body),\n      },\n      options,\n    );\n    return result.body;\n  }\n\n  /** The envelope so far. */\n  toRaw(): RawResponse {\n    return { requests: this.requests };\n  }\n}\n\n/**\n * What `raw` mode returns: the one payload body when the scraper made one\n * payload request (token-page fetches do not count), the whole envelope when\n * it made several. A CLI user asking for the raw medications payload wants\n * MyChart's JSON, not a wrapper around it and the page that carried the token.\n */\nexport function unwrapRaw(raw: RawResponse): unknown {\n  const payloads = raw.requests.filter((r) => r.purpose !== 'token');\n  return payloads.length === 1 ? payloads[0]!.body : raw;\n}\n\n/**\n * Whether a recorded request is the endpoint `name` names: its path (query\n * string aside, case aside) is `name`, or ends with `/name`. Whole segments\n * only — `Load` never matches `LoadExternal`, `GetFlowsheets` never matches\n * `GetFlowsheetReadings`. A substring match here once returned the outside\n * providers as the whole care team whenever `LoadExternal` answered first,\n * because parallel requests land in the envelope in whatever order they\n * resolved.\n */\nfunction isRequestFor(record: RawRequestRecord, name: string): boolean {\n  const pathname = record.path.split('?')[0]!.toLowerCase();\n  const needle = name.toLowerCase().replace(/^\\/+/, '');\n  return pathname === `/${needle}` || pathname === needle || pathname.endsWith(`/${needle}`);\n}\n\n/** The first recorded request for the endpoint `name` (a path, or its trailing segments). */\nexport function findRequest(raw: RawResponse, name: string): RawRequestRecord | undefined {\n  return raw.requests.find((r) => isRequestFor(r, name));\n}\n\n/** Every recorded request for the endpoint `name`. */\nexport function findRequests(raw: RawResponse, name: string): RawRequestRecord[] {\n  return raw.requests.filter((r) => isRequestFor(r, name));\n}\n\n/** The body of the first request for the endpoint `name`, or undefined. */\nexport function bodyOf(raw: RawResponse, name: string): unknown {\n  return findRequest(raw, name)?.body;\n}\n\n/** Whether a recorded request came back as the data: recorded, no `failure`, 2xx. */\nexport function answered(record: RawRequestRecord | undefined): record is RawRequestRecord {\n  return record !== undefined && record.failure === undefined && record.status >= 200 && record.status < 300;\n}\n\n/**\n * The body of the first request for `name` when it answered, otherwise\n * `undefined` — for a processor reading a request its scraper tolerated\n * (`tolerateFailure`). Reading `bodyOf` there would turn a recorded 500 into\n * `{}` and then into empty fields; this returns nothing, and the processor\n * reports the gap under a name (`contactInformationUnavailable`,\n * `unavailable: ['GetStatementList']`) instead of as empty data.\n */\nexport function okBodyOf(raw: RawResponse, name: string): unknown {\n  const record = findRequest(raw, name);\n  return answered(record) ? record.body : undefined;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Readers for untyped payloads.\n *\n * Processors run against whatever an Epic release actually sent, not against\n * what a type says it sent, so a field an instance omits has to come out as an\n * empty value rather than a crash mid-scrape. These never throw.\n */\n\n/** A payload with no response type: a bare record. */\nexport function rec(value: unknown): Record<string, unknown>;\n/**\n * A payload we have a response type for: `rec<LoadAllergies>(body)`.\n *\n * Those types live in each scraper's `mychart.types.ts` and record what real\n * instances answered, with every field optional — three instances out of ~750,\n * and the next one is free to omit any of it. So this checks the field *names*\n * (a typo, or a field no instance ever sent, does not compile) without\n * promising a value is there: it still has to come out through `text()` /\n * `num()` / `list()`. `as LoadAllergies` would check the same names and then\n * claim the values too, which is the crash these readers exist to prevent.\n */\nexport function rec<T>(value: unknown): T;\nexport function rec(value: unknown): unknown {\n  return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {};\n}\n\nexport function list(value: unknown): unknown[] {\n  return Array.isArray(value) ? value : [];\n}\n\nexport function text(value: unknown): string {\n  return typeof value === 'string' ? value : '';\n}\n\n/** A string, or null when MyChart sent nothing. Distinguishes \"\" from absent. */\nexport function textOrNull(value: unknown): string | null {\n  return typeof value === 'string' ? value : null;\n}\n\nexport function bool(value: unknown): boolean {\n  return value === true;\n}\n\n/** A boolean, or null when MyChart sent nothing. */\nexport function boolOrNull(value: unknown): boolean | null {\n  return typeof value === 'boolean' ? value : null;\n}\n\n/** A finite number, or null. */\nexport function num(value: unknown): number | null {\n  return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\n/** A list of strings, dropping anything that is not one. */\nexport function strings(value: unknown): string[] {\n  return list(value).filter((v): v is string => typeof v === 'string');\n}\n\n/** Epic's `/Date(1761851400000)/` as epoch millis, or null. */\nexport function epicInstantMs(value: unknown): number | null {\n  const match = /\\/Date\\((-?\\d+)\\)\\//.exec(text(value));\n  return match ? Number(match[1]) : null;\n}\n\n/** Epoch millis as ISO-8601 UTC, or null. */\nexport function isoFromMs(ms: number | null): string | null {\n  return ms === null ? null : new Date(ms).toISOString();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Markup to plain text, for the `<field>Text` fields.\n *\n * Markup never leaves `raw` (rule 9 in `docs/processor-layer-proposal.md`).\n * This produces the text the other modes carry, via `html-to-text`: block\n * elements become line breaks, headings sit on their own lines, list items\n * become bullets, tables become aligned columns. cheerio's `.text()` is not\n * enough on its own — it drops every block boundary, so a note's paragraphs,\n * list items and table cells run together into one line.\n *\n * The converter parses to a tree and never re-emits markup, so nothing it\n * returns is ever rendered as HTML downstream.\n */\n\nimport { convert, type HtmlToTextOptions } from 'html-to-text';\n\nconst OPTIONS: HtmlToTextOptions = {\n  wordwrap: false,\n  preserveNewlines: false,\n  selectors: [\n    // MyChart's notes are prose, not shouting: keep headings as written.\n    ...['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((selector) => ({ selector, options: { uppercase: false } })),\n    // A link's href is portal plumbing; its text is the content.\n    { selector: 'a', options: { ignoreHref: true } },\n    { selector: 'img', format: 'skip' },\n    { selector: 'ul', options: { itemPrefix: '- ' } },\n    { selector: 'ol', options: { itemPrefix: '- ' } },\n    // Lab and visit tables read as columns; header cells stay as written.\n    { selector: 'table', format: 'dataTable', options: { uppercaseHeaderCells: false } },\n  ],\n};\n\n/**\n * Trailing spaces on a line, non-breaking ones included.\n *\n * A blank line in Epic's message formatter is a paragraph holding a single\n * `&nbsp;`, and the converter hands that back as a line containing U+00A0 —\n * invisible, but not empty, so a body read as `\"...day.\\n\\u00a0\\nYour...\"`\n * rather than having the blank line the sender typed. Same story wherever\n * MyChart pads a cell or a heading out with spaces.\n */\nconst TRAILING_SPACE = /[^\\S\\r\\n]+$/gm;\n\n/** HTML (a fragment or a whole document) as plain text. */\nexport function htmlToText(html: string): string {\n  if (!html) return '';\n  return convert(html, OPTIONS).replace(TRAILING_SPACE, '').trim();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Conversations (inbox) processor. Field decisions:\n * docs/processor-layer-proposal.md, `get_messages`.\n *\n * The scraper records one `GetConversationList` answer per page. This merges\n * the pages into one list in inbox order, de-duplicated by `hthId`, with the\n * unread count from the first page and the paging summary from the last.\n *\n * The message element shape is shared with `get_message_thread`, so the\n * per-message projection and the name resolution live here and the thread\n * processor imports them.\n *\n * `senderName` follows the order the portal's own `getAuthorInfo` uses: a\n * `wprKey` resolves through `viewers`, an `empKey` through the conversation's\n * `userOverrideNames` and then the shared `users` map, and `displayName` is\n * the last resort. On every captured instance `displayName` is `\"\"` on every\n * message, so without the maps every message would be anonymous.\n *\n * Concise is the inbox as a list of threads — id, subject, who, when, and the\n * flags that change what a reader does next — and never the messages: the\n * listing only ever inlines the newest five of a thread, and a reader who\n * wants the messages takes the `hthId` to `get_message_thread`.\n */\n\nimport { findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { htmlToText } from '../../processors/htmlText';\nimport { bool, boolOrNull, list, num, rec, text, textOrNull } from '../../processors/read';\nimport type { Attachment, GetConversationList, Message, User, Viewer } from './mychart.types';\nimport type { ConversationStandard, ConversationsConcise, ConversationsStandard, MessageConcise, MessageDirectory, MessageStandard } from './standardized.types';\n\nexport type { ConversationStandard, ConversationsStandard, MessageAttachmentConcise, MessageAttachmentStandard, MessageConcise, MessageDirectory, MessageStandard } from './standardized.types';\n\n/** Read the three name maps off a conversation payload (or the listing that carries it). */\nexport function messageDirectory(...sources: unknown[]): MessageDirectory {\n  const directory: MessageDirectory = { users: {}, viewers: {}, userOverrideNames: {} };\n  for (const source of sources) {\n    const s = rec(source);\n    Object.assign(directory.users, rec(s.users));\n    Object.assign(directory.viewers, rec(s.viewers));\n    Object.assign(directory.userOverrideNames, rec(s.userOverrideNames));\n  }\n  return directory;\n}\n\n/**\n * MyChart identifies an author by key, not by role: staff carry an `empKey`,\n * patient-side viewers a `wprKey`. An author with a staff key is never the\n * patient, and one with only a viewer key always is.\n */\nexport function isFromPatient(author: unknown): boolean {\n  const a = rec(author);\n  return !text(a.empKey) && !!text(a.wprKey);\n}\n\nexport function senderName(author: unknown, directory: MessageDirectory): string {\n  const a = rec(author);\n  const wprKey = text(a.wprKey);\n  const empKey = text(a.empKey);\n  const displayName = text(a.displayName);\n  if (wprKey) return text(rec<Viewer>(directory.viewers[wprKey]).name) || displayName;\n  if (empKey) {\n    return text(directory.userOverrideNames[empKey]) || text(rec<User>(directory.users[empKey]).name) || displayName;\n  }\n  return displayName;\n}\n\nexport function messageStandard(value: unknown, directory: MessageDirectory): MessageStandard {\n  const m = rec<Message>(value);\n  const author = rec(m.author);\n  return {\n    wmgId: textOrNull(m.wmgId),\n    deliveryInstantISO: textOrNull(m.deliveryInstantISO),\n    senderName: senderName(author, directory),\n    isFromPatient: isFromPatient(author),\n    isUnread: boolOrNull(m.isUnread),\n    bodyText: htmlToText(text(m.body)),\n    author: { empKey: textOrNull(author.empKey), wprKey: textOrNull(author.wprKey) },\n    attachments: list(m.attachments).map((attachment) => {\n      const a = rec<Attachment>(attachment);\n      return { name: textOrNull(a.name), fileExtension: textOrNull(a.fileExtension), dcsId: textOrNull(a.dcsId), type: num(a.type) };\n    }),\n    tasks: list(m.tasks),\n    suggestedActions: list(m.suggestedActions),\n  };\n}\n\nexport function messageConcise(m: MessageStandard): MessageConcise {\n  return {\n    deliveryInstantISO: m.deliveryInstantISO,\n    senderName: m.senderName,\n    isFromPatient: m.isFromPatient,\n    bodyText: m.bodyText,\n    attachments: m.attachments.map((a) => ({ name: a.name, dcsId: a.dcsId })),\n  };\n}\n\nfunction conversationStandard(value: unknown, listing: GetConversationList): ConversationStandard {\n  const c = rec(value);\n  // The listing's `users` / `viewers` are shared; `userOverrideNames` is per conversation.\n  const directory = messageDirectory({ users: listing.users, viewers: listing.viewers }, { userOverrideNames: c.userOverrideNames });\n  const messages = list(c.messages).map((m) => messageStandard(m, directory));\n  // Pages arrive ascending by deliveryInstantISO; the newest is the max either way.\n  const latest = messages.reduce<string | null>(\n    (best, m) => (m.deliveryInstantISO !== null && (best === null || m.deliveryInstantISO > best) ? m.deliveryInstantISO : best),\n    null,\n  );\n  const audience = list(c.audience).map((a) => ({ name: textOrNull(rec(a).name) }));\n  const unread = boolOrNull(rec(c.tags).Unread);\n  return {\n    hthId: textOrNull(c.hthId),\n    subject: textOrNull(c.subject),\n    audience,\n    audienceNames: audience.map((a) => a.name ?? ''),\n    latestMessageInstantISO: latest,\n    tags: { Unread: unread },\n    hasUnreadMessages: unread,\n    hasUrgentMsgs: boolOrNull(c.hasUrgentMsgs),\n    hasMoreMessages: boolOrNull(c.hasMoreMessages),\n    previewText: textOrNull(c.previewText),\n    hasAttachments: boolOrNull(c.hasAttachments),\n    hasTasks: boolOrNull(c.hasTasks),\n    messageType: textOrNull(c.messageType),\n    messages,\n  };\n}\n\nexport const conversationsProcessor: Processor<ConversationsStandard> = {\n  standard(raw: RawResponse): ConversationsStandard {\n    const requests = findRequests(raw, 'GetConversationList');\n    const pages = requests.map((r) => rec<GetConversationList>(r.body));\n    const first = pages[0] ?? {};\n    const last = pages[pages.length - 1] ?? {};\n\n    const seen = new Set<string>();\n    const conversations: ConversationStandard[] = [];\n    for (const page of pages) {\n      for (const value of list(page.conversations)) {\n        const conversation = conversationStandard(value, page);\n        const key = conversation.hthId ?? '';\n        if (key && seen.has(key)) continue;\n        if (key) seen.add(key);\n        conversations.push(conversation);\n      }\n    }\n\n    const summary = rec(last.localSummary);\n    // The scraper stops with `hasMoreConversations` still set in two cases: at\n    // its page cap, and when a page ends at the very instant it asked to start\n    // from (asking again would loop forever). Only the cap leaves threads\n    // unread; the second is the server repeating itself, so the inbox is whole.\n    const askedFrom = text(rec(rec(requests[requests.length - 1]?.requestBody).localLoadParams).loadStartInstantISO);\n    const stoppedRepeating = text(summary.oldestLoadedInstantISO) === askedFrom;\n    return {\n      legacyXUnreadCount: num(first.legacyXUnreadCount),\n      truncated: bool(summary.hasMoreConversations) && list(last.conversations).length > 0 && !stoppedRepeating,\n      conversations,\n      localSummary: {\n        hasMoreConversations: boolOrNull(summary.hasMoreConversations),\n        oldestLoadedInstantISO: textOrNull(summary.oldestLoadedInstantISO),\n      },\n    };\n  },\n\n  concise(standard): ConversationsConcise {\n    return {\n      legacyXUnreadCount: standard.legacyXUnreadCount,\n      truncated: standard.truncated,\n      conversations: standard.conversations.map((c) => ({\n        hthId: c.hthId,\n        subject: c.subject,\n        audienceNames: c.audienceNames,\n        latestMessageInstantISO: c.latestMessageInstantISO,\n        hasUnreadMessages: c.hasUnreadMessages,\n        hasUrgentMsgs: c.hasUrgentMsgs,\n        hasAttachments: c.hasAttachments,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The inbox: every conversation on the active patient record.\n *\n * `GetConversationList` answers 50 conversations per page (measured on the one\n * instance with more than 50) and says so with `localSummary.hasMoreConversations`.\n * The portal loads the next page by re-posting with `localLoadParams` set to\n * `{ loadStartInstantISO: <oldestLoadedInstantISO of the page it has>,\n * loadEndInstantISO: '', pagingInfo: <the page's pagingInfo> }`, and this\n * scraper does the same until the summary says there is nothing older. Every\n * page is recorded; the processor merges them.\n */\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { logger } from '../../../../shared/logger';\nimport { list, num, rec, text } from '../../processors/read';\nimport { conversationsProcessor, type ConversationsStandard } from './conversations.processor';\n\nexport type {\n  ConversationsStandard,\n  ConversationStandard,\n  MessageStandard,\n  MessageConcise,\n  MessageAttachmentStandard,\n  MessageAttachmentConcise,\n  MessageDirectory,\n} from './conversations.processor';\nexport { conversationsProcessor } from './conversations.processor';\n\n/** Bound the paging loop, so a server that never clears `hasMoreConversations` can't spin forever. */\nexport const MAX_PAGES = 40;\n\n/**\n * `GET /app/communication-center` for the token every `/api/conversations/*`\n * POST has to carry, then `POST /api/conversations/GetConversationList` with\n * the request the portal's inbox sends, once per page.\n */\nexport async function fetchConversationsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/communication-center');\n\n  let localLoadParams: Record<string, unknown> = { loadStartInstantISO: '', loadEndInstantISO: '', pagingInfo: 1 };\n  for (let page = 1; ; page++) {\n    const { body } = await collector.send({\n      path: '/api/conversations/GetConversationList',\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json; charset=utf-8',\n        __RequestVerificationToken: token,\n      },\n      body: JSON.stringify({\n        tag: 1,\n        localLoadParams,\n        externalLoadParams: {},\n        searchQuery: '',\n        PageNonce: '',\n      }),\n    });\n\n    const payload = rec(body);\n    const summary = rec(payload.localSummary);\n    if (summary.hasMoreConversations !== true) break;\n    if (page === MAX_PAGES) {\n      logger.debug(`Stopped paging the inbox after ${MAX_PAGES} pages`);\n      break;\n    }\n    // A page that carried nothing, or that ends where the last one did, would\n    // ask for the same instant forever: treat it as the end of the inbox.\n    const oldest = text(summary.oldestLoadedInstantISO);\n    if (!oldest || list(payload.conversations).length === 0 || oldest === localLoadParams.loadStartInstantISO) break;\n    localLoadParams = { loadStartInstantISO: oldest, loadEndInstantISO: '', pagingInfo: num(summary.pagingInfo) ?? 0 };\n  }\n\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function listConversations(mychartRequest: MyChartRequest): Promise<ConversationsStandard> {\n  return conversationsProcessor.standard(await fetchConversationsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `/Home` print header: `Name: … | DOB: … | MRN: … | PCP: …`.\n *\n * Shared by the profile processor and by the proxy-context verification in\n * `proxy/proxyContext.ts`, which reads the same header to confirm which\n * patient MyChart is on.\n */\n\nimport * as cheerio from 'cheerio';\nimport { logger } from '../../../../shared/logger';\n\nexport type ProfileData = {\n  name: string;\n  dob: string;\n  mrn: string;\n  pcp: string;\n};\n\nexport function parseProfileHtml(body: string): ProfileData | null {\n  const $ = cheerio.load(body);\n  const printheaderDiv = $('.printheader').text();\n\n  // Full format: Name | DOB | MRN | PCP (most MyChart instances)\n  const fullRegex = /Name: (.+) \\| DOB: (\\d{1,2}\\/\\d{1,2}\\/\\d{4}) \\| MRN: (\\d+) \\| PCP: (.*)/;\n  const fullMatch = fullRegex.exec(printheaderDiv);\n  if (fullMatch) {\n    return {\n      // All four capture groups are non-optional, so they exist on any match.\n      name: fullMatch[1]!.trim(),\n      dob: fullMatch[2]!,\n      mrn: fullMatch[3]!,\n      pcp: fullMatch[4]!.trim(),\n    };\n  }\n\n  // Partial format: Name | DOB only (e.g. MyChart Central at central.mychart.org)\n  const partialRegex = /Name: (.+?) \\| DOB: (\\d{1,2}\\/\\d{1,2}\\/\\d{4})/;\n  const partialMatch = partialRegex.exec(printheaderDiv);\n  if (partialMatch) {\n    // Try to pick up MRN and PCP if present after DOB with different formats\n    const afterDob = printheaderDiv.slice(partialMatch.index + partialMatch[0].length);\n    const mrnMatch = /MRN:\\s*(\\d+)/.exec(afterDob);\n    const pcpMatch = /PCP:\\s*(.*)/.exec(afterDob);\n    return {\n      // Both capture groups are non-optional, so they exist on any match.\n      name: partialMatch[1]!.trim(),\n      dob: partialMatch[2]!,\n      mrn: mrnMatch?.[1] || '',\n      pcp: pcpMatch?.[1]?.trim() || '',\n    };\n  }\n\n  logger.debug('Could not parse profile from /Home page, no regex match', printheaderDiv.trim());\n  return null;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Profile processor. Field decisions: docs/processor-layer-proposal.md, `get_profile`.\n *\n * Two sources: the `/Home` page's print header (name, DOB, MRN, PCP — parsed,\n * so derived) and `GetContactInformation` (the rest). The contact call is\n * optional on some instances, so every field from it is nullable — and the\n * scraper tolerates its failure, so a failed answer is reported as\n * `contactInformationUnavailable` rather than as a patient with no phone.\n */\n\nimport { findRequest, okBodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { rec, strings, text, textOrNull } from '../../processors/read';\nimport type { GetContactInformation } from './mychart.types';\nimport type { AddressStandard, ProfileStandard } from './standardized.types';\n\nexport type { AddressStandard, ProfileStandard, TemporaryAddressStandard } from './standardized.types';\nimport { parseProfileHtml } from './profileHtml';\n\nfunction address(value: unknown): AddressStandard {\n  const a = rec(value);\n  return {\n    FormattedValues: strings(a.FormattedValues),\n    Street: textOrNull(a.Street),\n    City: textOrNull(a.City),\n    State: { Title: textOrNull(rec(a.State).Title) },\n    Zip: textOrNull(a.Zip),\n    Country: { Title: textOrNull(rec(a.Country).Title) },\n    HouseNumber: textOrNull(a.HouseNumber),\n    Building: textOrNull(a.Building),\n    Floor: textOrNull(a.Floor),\n    Unit: textOrNull(a.Unit),\n    PhoneNumber: textOrNull(a.PhoneNumber),\n  };\n}\n\nexport const profileProcessor: Processor<ProfileStandard> = {\n  standard(raw: RawResponse): ProfileStandard {\n    const home = text(findRequest(raw, '/Home')?.body);\n    const header = parseProfileHtml(home) ?? { name: '', dob: '', mrn: '', pcp: '' };\n    const contactBody = okBodyOf(raw, 'GetContactInformation');\n    const contact = rec<GetContactInformation>(contactBody);\n    const secure = rec(contact.SecureCommunicationInfo);\n    const temporary = rec(contact.TemporaryAddress);\n    return {\n      ...header,\n      SecureCommunicationInfo: {\n        EmailAddress: textOrNull(secure.EmailAddress),\n        MobilePhone: textOrNull(secure.MobilePhone),\n      },\n      HomePhone: textOrNull(contact.HomePhone),\n      WorkPhone: textOrNull(contact.WorkPhone),\n      PreferredDevice: textOrNull(contact.PreferredDevice),\n      PermanentAddress: address(contact.PermanentAddress),\n      TemporaryAddress: {\n        ...address(temporary),\n        StartDateDisplay: textOrNull(temporary.StartDateDisplay),\n        EndDateDisplay: textOrNull(temporary.EndDateDisplay),\n        StartDateISO: textOrNull(temporary.StartDateISO),\n        EndDateISO: textOrNull(temporary.EndDateISO),\n      },\n      contactInformationUnavailable: contactBody === undefined,\n    };\n  },\n  concise(standard) {\n    return {\n      name: standard.name,\n      dob: standard.dob,\n      mrn: standard.mrn,\n      pcp: standard.pcp,\n      EmailAddress: standard.SecureCommunicationInfo.EmailAddress,\n      contactInformationUnavailable: standard.contactInformationUnavailable,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { makeAuthenticatedRequest, SessionExpiredError, type AuthenticatedRequestOptions } from '../../core/makeAuthenticatedRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { getRequestVerificationTokenFromBody } from '../../core/util';\nimport { logger } from '../../../../shared/logger';\nimport { rec, textOrNull } from '../../processors/read';\nimport type { GetContactInformation } from './mychart.types';\nimport { parseProfileHtml, type ProfileData } from './profileHtml';\nimport { profileProcessor, type ProfileStandard } from './profile.processor';\n\nexport { parseProfileHtml, type ProfileData } from './profileHtml';\nexport type { ProfileStandard, AddressStandard, TemporaryAddressStandard } from './profile.processor';\nexport { profileProcessor } from './profile.processor';\n\n/**\n * The print-header identity read on its own: name, DOB, MRN, PCP. This is the\n * lightweight primitive the proxy-context verification uses to confirm which\n * patient MyChart is on, so it keeps its historical `null` on a session that\n * could not be renewed rather than throwing mid-verification.\n */\nexport async function getMyChartProfile(\n  mychartRequest: MyChartRequest,\n  options?: AuthenticatedRequestOptions,\n): Promise<ProfileData | null> {\n  // followRedirects: false so a redirect to somewhere other than the login\n  // page (some instances bounce /Home through a landing route) can be followed\n  // and parsed explicitly. A login redirect is handled by the wrapper — renewed\n  // when possible, otherwise surfaced here as the historical `null`.\n  let resp: Response;\n  try {\n    resp = await makeAuthenticatedRequest(mychartRequest, { path: '/Home', followRedirects: false }, options);\n  } catch (error) {\n    if (error instanceof SessionExpiredError) {\n      logger.debug('[profile] Session expired and could not be renewed');\n      return null;\n    }\n    throw error;\n  }\n\n  if ([301, 302].includes(resp.status)) {\n    const location = resp.headers.get('Location') || '';\n    logger.debug(`[profile] /Home returned ${resp.status} → ${location}`);\n    // The wrapper only recognizes /Authentication/Login as a session bounce.\n    // Keep the historical looser check here too: an instance sending /Home to\n    // any login-ish URL means \"not signed in\", and following it would parse a\n    // login page into a bogus profile.\n    if (location.toLowerCase().includes('login')) {\n      logger.debug('[profile] Session expired — redirected to login page');\n      return null;\n    }\n    // Non-login redirect: follow it and parse\n    const followResp = await makeAuthenticatedRequest(\n      mychartRequest,\n      { url: new URL(location, mychartRequest.protocol + '://' + mychartRequest.hostname).href },\n      options,\n    );\n    const body = await followResp.text();\n    logger.debug(`[profile] Followed redirect to ${location}, response URL: ${followResp.url}, status: ${followResp.status}`);\n    return parseProfileHtml(body);\n  }\n\n  logger.debug(`[profile] /Home returned ${resp.status}, URL: ${resp.url}`);\n  const body = await resp.text();\n  return parseProfileHtml(body);\n}\n\n/**\n * `GET /Home` (the print header) plus `GET /PersonalInformation` for a token\n * and `POST /PersonalInformation/GetContactInformation`. The contact endpoint\n * is missing on some instances, so a failure there is recorded (when there\n * was a response) and otherwise tolerated — the header is the point.\n */\nexport async function fetchProfileRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  await collector.send({ path: '/Home' });\n  try {\n    await fetchContactInformation(collector);\n  } catch (error) {\n    if (error instanceof SessionExpiredError) throw error;\n    logger.debug('[profile] contact information unavailable:', (error as Error).message);\n  }\n  return collector.toRaw();\n}\n\nasync function fetchContactInformation(collector: RawCollector): Promise<unknown> {\n  const page = await collector.send({ path: '/PersonalInformation' }, { tolerateFailure: true });\n  const token = getRequestVerificationTokenFromBody(page.text);\n  if (!token) {\n    logger.debug('could not find request verification token');\n    return null;\n  }\n  const result = await collector.send(\n    {\n      path: '/PersonalInformation/GetContactInformation?noCache=' + Math.random(),\n      headers: {\n        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n        __RequestVerificationToken: token,\n      },\n      method: 'POST',\n      body: 'useLoginUserEpt=false',\n    },\n    { tolerateFailure: true },\n  );\n  return result.body;\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getProfile(mychartRequest: MyChartRequest): Promise<ProfileStandard> {\n  return profileProcessor.standard(await fetchProfileRaw(mychartRequest));\n}\n\n/** The account email alone, from `GetContactInformation`; `null` when the endpoint is unavailable. */\nexport async function getEmail(mychartRequest: MyChartRequest): Promise<string | null> {\n  const collector = new RawCollector(mychartRequest);\n  const body = await fetchContactInformation(collector);\n  return textOrNull(rec(rec<GetContactInformation>(body).SecureCommunicationInfo).EmailAddress);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as cheerio from 'cheerio';\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { makeAuthenticatedRequest, SessionExpiredError, type AuthenticatedRequestOptions } from '../core/makeAuthenticatedRequest';\nimport { getMyChartProfile } from '../chart/profile/profile';\nimport { logger } from '../../../shared/logger';\nimport { bool, list, rec, text } from '../processors/read';\nimport type { ProxySwitch } from './mychart.types';\nimport { DetailedError } from '../../../shared/detailedError';\n\nexport type ProxyTarget = {\n  /**\n   * Epic's identifier for the patient record: a long opaque `WP-…` string,\n   * different on every organization and meaningless outside the session that\n   * produced it. Never parse or construct one.\n   *\n   * The account holder's own record carries a real id like any other — it is\n   * **not** blank. Identify it with `isSelf`, never by inspecting the id.\n   * (Confirmed on UCSF, Renown and Carson Tahoe; see PR #206.)\n   */\n  id: string;\n  displayName: string;\n  isSelf: boolean;\n  isSelected: boolean;\n  /**\n   * Whether `isSelected` actually came from the portal, or is just a default.\n   * The `EpicPx.ReactContext.personalizations.proxySubjects` script block does\n   * not carry a selection flag, so targets recovered from it report\n   * `selectionKnown: false` and `isSelected: false`. Consumers must not read\n   * `isSelected === false` as \"this record is not active\" unless\n   * `selectionKnown` is true.\n   */\n  selectionKnown: boolean;\n  linkUrl: string;\n  source: 'proxy-switch-json' | 'home-html';\n};\n\n/**\n * How to name the record you want. Exactly one of these is needed.\n *\n * Prefer `self: true` over an id when returning to the account holder — proxy\n * ids are opaque and organization-specific, and the portal's own `IsSelf` flag\n * is the only portable way to name that record.\n */\nexport type ProxyTargetSelector = {\n  /** The account holder's own record, whatever its id happens to be. */\n  self?: boolean;\n  /** An opaque id from `discoverProxyTargets`. */\n  id?: string;\n  /** Display name; rejected if more than one record shares it. */\n  displayName?: string;\n};\n\n/** Max redirects to follow before giving up on a proxy-switch chain. */\nconst MAX_SWITCH_REDIRECTS = 5;\n\n/**\n * Display names some instances use for the account holder's own entry instead\n * of the person's actual name. These can't be compared against the scraped\n * profile name, so identity verification treats them as \"no opinion\".\n */\nconst GENERIC_SELF_LABELS = new Set(['me', 'myself', 'you', 'self', 'my record', 'my chart']);\n\n/** Name suffixes that carry no identity signal. */\nconst NAME_SUFFIXES = new Set(['jr', 'sr', 'ii', 'iii', 'iv', 'v', 'md', 'do', 'phd']);\n\nfunction isDebugEnabled(): boolean {\n  return process.env.MYCHART_DEBUG_PROXY_CONTEXT === '1';\n}\n\nfunction debugLog(message: string, details?: unknown): void {\n  if (!isDebugEnabled()) return;\n  if (details === undefined) {\n    logger.debug(`[proxy-context] ${message}`);\n    return;\n  }\n  logger.debug(`[proxy-context] ${message}`, details);\n}\n\nfunction summarizeTargets(targets: ProxyTarget[]): string {\n  return targets\n    .map((target) => `${target.displayName}${target.isSelected ? '*' : ''}${target.isSelf ? ' (self)' : ''}`)\n    .join(', ');\n}\n\nfunction normalize(value: string): string {\n  return value.trim().toLowerCase();\n}\n\n/**\n * The deployment prefix, ready to concatenate. Root-mounted instances have no\n * prefix at all (`firstPathPart` is null), so they get the empty string rather\n * than a literal `/null`.\n */\nfunction mountPath(mychartRequest: MyChartRequest): string {\n  return mychartRequest.firstPathPart ? `/${mychartRequest.firstPathPart}` : '';\n}\n\nfunction absoluteUrl(mychartRequest: MyChartRequest, value: string): string {\n  if (value.startsWith('http://') || value.startsWith('https://')) return value;\n  return new URL(value, `${mychartRequest.protocol}://${mychartRequest.hostname}`).href;\n}\n\nfunction normalizeLinkUrl(mychartRequest: MyChartRequest, value: string, id: string, isSelf: boolean): string {\n  if (value && value !== '#') {\n    if (value.startsWith('http://') || value.startsWith('https://')) return value;\n    return value.startsWith('/') ? value : `${mountPath(mychartRequest)}/${value}`;\n  }\n  if (isSelf) {\n    return `${mountPath(mychartRequest)}/inside.asp?mode=self`;\n  }\n  return `${mountPath(mychartRequest)}/inside.asp?mode=proxyswitch&action=switchcontext&src=0&eid=${encodeURIComponent(id)}`;\n}\n\nfunction dedupeTargets(targets: ProxyTarget[]): ProxyTarget[] {\n  const seen = new Set<string>();\n  const deduped: ProxyTarget[] = [];\n\n  for (const target of targets) {\n    const key = `${target.id}::${target.displayName}::${target.isSelf}`;\n    if (seen.has(key)) continue;\n    seen.add(key);\n    deduped.push(target);\n  }\n\n  return deduped;\n}\n\nfunction parseProxyTargetsFromJson(mychartRequest: MyChartRequest, json: ProxySwitch): ProxyTarget[] {\n  return dedupeTargets(\n    list(json.ProxySubjectList)\n      .map((value) => {\n        const entry = rec(value);\n        const id = text(entry.Id);\n        const isSelf = bool(entry.IsSelf);\n        return {\n          id,\n          displayName: text(entry.DisplayName),\n          isSelf,\n          isSelected: bool(entry.IsSelected),\n          selectionKnown: true,\n          linkUrl: normalizeLinkUrl(mychartRequest, text(entry.LinkUrl), id, isSelf),\n          source: 'proxy-switch-json' as const,\n        };\n      })\n      .filter((entry) => entry.displayName)\n  );\n}\n\nfunction parseProxyTargetsFromHomeHtml(mychartRequest: MyChartRequest, html: string): ProxyTarget[] {\n  const $ = cheerio.load(html);\n  const targets: ProxyTarget[] = [];\n\n  $('.proxySubjectLink').each((_, el) => {\n    const link = $(el);\n    const displayName = link.find('.proxySelectorDropDownNameEllipsis').first().text().trim();\n    const id = (link.attr('data-id') || '').trim();\n    const href = link.attr('href') || '';\n    const isSelected = link.hasClass('currentContext');\n    // Self is NOT \"the one without an id\" — the account holder's record has a\n    // real id too. What distinguishes it is that its link does not carry the\n    // switch-context query, which is the one thing the confirmed `/ProxySwitch`\n    // payload tells us about link shape: proxies get `mode=proxyswitch&…&eid=`,\n    // self gets a bare page URL.\n    const looksLikeProxySwitch = /mode=proxyswitch|[?&]eid=/i.test(href);\n    const isSelf = href.includes('mode=self')\n      || /access your record/i.test(link.attr('aria-label') || '')\n      || (!!href && !looksLikeProxySwitch);\n\n    if (!displayName) return;\n    targets.push({\n      id,\n      displayName,\n      isSelf,\n      isSelected,\n      // The anchor markup marks the active record with `currentContext`, so the\n      // absence of that class is a real \"not selected\", not a missing signal.\n      selectionKnown: true,\n      linkUrl: normalizeLinkUrl(mychartRequest, href, id, isSelf),\n      source: 'home-html',\n    });\n  });\n\n  // Last-resort fallback: the React personalization payload. It lists the\n  // records but says nothing about which one is active, hence selectionKnown.\n  const scriptRegex = /EpicPx\\.ReactContext\\.personalizations\\.proxySubjects\\.push\\((\\{[\\s\\S]*?\\})\\);/g;\n  let match: RegExpExecArray | null;\n  while ((match = scriptRegex.exec(html)) !== null) {\n    const block = match[1]!; // the regex's one capture group is non-optional\n    const displayName = (/displayName:\"([^\"]+)\"/.exec(block))?.[1] || '';\n    const id = (/\\{type:\"INTERNAL\",value:\"([^\"]+)\"\\}/.exec(block))?.[1] || '';\n    if (!displayName) continue;\n    // Prefer an explicit self flag (`isSelf:!0` once minified). Falling back to\n    // \"has no id\" is a last resort and is known to be wrong wherever the\n    // account holder carries a real id, which is every instance measured so far.\n    const selfFlag = /\\bisSelf:\\s*(!0|true)/.test(block);\n    const isSelf = selfFlag || !id;\n    targets.push({\n      id,\n      displayName,\n      isSelf,\n      isSelected: false,\n      selectionKnown: false,\n      linkUrl: normalizeLinkUrl(mychartRequest, '', id, isSelf),\n      source: 'home-html',\n    });\n  }\n\n  return dedupeTargets(targets);\n}\n\nasync function loadHomeHtml(mychartRequest: MyChartRequest, options?: AuthenticatedRequestOptions): Promise<string> {\n  const resp = await makeAuthenticatedRequest(mychartRequest, { path: '/Home' }, options);\n  return resp.text();\n}\n\nasync function followProxySwitchChain(mychartRequest: MyChartRequest, startPathOrUrl: string): Promise<void> {\n  let currentUrl = absoluteUrl(mychartRequest, startPathOrUrl);\n  let resp = await mychartRequest.makeRequest({ url: currentUrl, followRedirects: false });\n  debugLog(`switch url=${currentUrl} status=${resp.status}`);\n\n  let hops = 0;\n  while ([301, 302].includes(resp.status)) {\n    if (hops >= MAX_SWITCH_REDIRECTS) {\n      // Bailing out quietly here used to leave the caller to fail later with\n      // the confusing \"could not be confirmed\" error. Say what went wrong.\n      throw new Error(\n        `Proxy switch redirect chain exceeded ${MAX_SWITCH_REDIRECTS} hops (last url ${currentUrl}).`\n      );\n    }\n    const location = resp.headers.get('Location');\n    debugLog('redirect location=', location || null);\n    if (!location) break;\n    currentUrl = new URL(location, currentUrl).href;\n    resp = await mychartRequest.makeRequest({ url: currentUrl, followRedirects: false });\n    hops += 1;\n    debugLog(`redirect follow url=${currentUrl} status=${resp.status}`);\n  }\n\n  const finalHome = await mychartRequest.makeRequest({ path: '/Home', followRedirects: false });\n  debugLog(`final home url=${finalHome.url} status=${finalHome.status}`);\n}\n\nfunction resolveTarget(targets: ProxyTarget[], target: ProxyTargetSelector): ProxyTarget {\n  // Returning to the account holder is the most common thing a caller does\n  // after switching away, and it must not depend on knowing an opaque\n  // organization-specific id. `isSelf` is the portal's own marker for it.\n  //\n  // `id: ''` is accepted as a spelling of the same request: no observed\n  // instance issues a blank id, so it cannot collide with a real record, and on\n  // any instance that did use blank-for-self it resolves to the same entry.\n  if (target.self === true || target.id === '') {\n    const matches = targets.filter((entry) => entry.isSelf);\n    if (matches.length !== 1) {\n      throw new Error(\n        `Could not resolve the account holder's own record: ${matches.length} of ${targets.length} ` +\n        `discovered records are flagged as self.`\n      );\n    }\n    return matches[0]!;\n  }\n\n  if (target.id !== undefined) {\n    const matches = targets.filter((entry) => entry.id === target.id);\n    if (matches.length !== 1) {\n      throw new Error(`Could not resolve proxy target by id '${target.id}'.`);\n    }\n    return matches[0]!;\n  }\n\n  if (target.displayName) {\n    const wanted = normalize(target.displayName);\n    const matches = targets.filter((entry) => normalize(entry.displayName) === wanted);\n    if (matches.length === 0) {\n      throw new DetailedError(\n        'No patient record has that displayName.',\n        `Could not resolve proxy target by displayName '${target.displayName}'.`,\n      );\n    }\n    if (matches.length > 1) {\n      throw new DetailedError(\n        'More than one patient record has that displayName. Use its id instead.',\n        `Ambiguous proxy target displayName '${target.displayName}'.`,\n      );\n    }\n    return matches[0]!;\n  }\n\n  throw new Error('Proxy target must include self, id or displayName.');\n}\n\nfunction nameTokens(value: string): string[] {\n  return value\n    // Linked-account (Happy Together) labels carry the org in parentheses, e.g.\n    // \"Bart (Springfield General)\"; the org is not part of the name.\n    .replace(/\\([^)]*\\)/g, ' ')\n    .toLowerCase()\n    .normalize('NFD')\n    .replace(/[\\u0300-\\u036f]/g, '')\n    .replace(/[^a-z0-9\\s]/g, ' ')\n    .split(/\\s+/)\n    .filter((token) => token.length > 1 && !NAME_SUFFIXES.has(token));\n}\n\n/** \"Bart\" vs \"Bartholomew\": a short form of the same given name. */\nfunction isShortFormOf(a: string, b: string): boolean {\n  const [shorter, longer] = a.length <= b.length ? [a, b] : [b, a];\n  return shorter.length >= 3 && longer.startsWith(shorter);\n}\n\n/**\n * Compare the profile name scraped after a switch against the display name of\n * the record we asked for.\n *\n * Deliberately three-valued. MyChart's proxy list and its profile page do not\n * agree on how a name is written — the list says \"Bart Simpson\" where the\n * profile says \"Bartholomew JoJo Simpson\" — so a two-valued match/mismatch\n * would reject perfectly good switches. `unknown` is the honest answer whenever\n * the two names share a surname but not a recognizable given name: that is\n * either a nickname or a sibling, and this function cannot tell which. The\n * caller disambiguates by checking the profile against the *other* known\n * records (see `switchProxyTarget`).\n *\n * `mismatch` is reserved for names with nothing in common, which is what\n * landing on an unrelated patient actually looks like.\n */\nexport function compareProfileNames(expected: string, actual: string): 'match' | 'mismatch' | 'unknown' {\n  if (!expected || !actual) return 'unknown';\n  if (GENERIC_SELF_LABELS.has(normalize(expected)) || GENERIC_SELF_LABELS.has(normalize(actual))) {\n    return 'unknown';\n  }\n\n  const a = nameTokens(expected);\n  const b = nameTokens(actual);\n  if (a.length === 0 || b.length === 0) return 'unknown';\n\n  const setA = new Set(a);\n  const setB = new Set(b);\n  // Dropped middle names: \"Homer Simpson\" vs \"Homer Jay Simpson\".\n  if (a.every((token) => setB.has(token)) || b.every((token) => setA.has(token))) return 'match';\n\n  const surnameShared = a[a.length - 1] === b[b.length - 1];\n  if (surnameShared && isShortFormOf(a[0]!, b[0]!)) return 'match'; // both non-empty per the check above\n\n  // Reordered renderings (\"Simpson, Homer Jay\").\n  const shared = a.filter((token) => setB.has(token));\n  if (shared.length >= 2) return 'match';\n\n  // Same surname, unfamiliar given name — a nickname we don't know how to\n  // expand, or a family member. Not enough to condemn the switch on its own.\n  if (surnameShared) return 'unknown';\n\n  return 'mismatch';\n}\n\nexport async function discoverProxyTargets(\n  mychartRequest: MyChartRequest,\n  options?: AuthenticatedRequestOptions,\n): Promise<ProxyTarget[]> {\n  try {\n    const resp = await makeAuthenticatedRequest(mychartRequest, {\n      path: `/ProxySwitch?noCache=${Math.random()}`,\n      headers: {\n        Accept: 'application/json, text/javascript, */*; q=0.01',\n        'X-Requested-With': 'XMLHttpRequest',\n      },\n    }, options);\n\n    if (resp.ok) {\n      const json = rec<ProxySwitch>(await resp.json());\n      const targets = parseProxyTargetsFromJson(mychartRequest, json);\n      if (targets.length > 0) {\n        debugLog(`discovered targets source=proxy-switch-json count=${targets.length} [${summarizeTargets(targets)}]`);\n        return targets;\n      }\n    }\n  } catch (error) {\n    // An unrenewable expired session is a real answer, not a reason to fall\n    // through to the HTML surface — that would just attempt a second re-login\n    // and then parse a login page into \"no proxy targets\".\n    if (error instanceof SessionExpiredError) throw error;\n    debugLog('proxy-switch-json discovery failed', error instanceof Error ? error.message : String(error));\n  }\n\n  const html = await loadHomeHtml(mychartRequest, options);\n  const targets = parseProxyTargetsFromHomeHtml(mychartRequest, html);\n  debugLog(`discovered targets source=home-html count=${targets.length} [${summarizeTargets(targets)}]`);\n  return targets;\n}\n\nexport async function verifyActiveProxyTarget(\n  mychartRequest: MyChartRequest,\n  options?: { proxyTargets?: ProxyTarget[] } & AuthenticatedRequestOptions\n): Promise<{\n  profileName: string | null;\n  profileDob: string | null;\n  proxyTargets: ProxyTarget[];\n  selectedTarget: ProxyTarget | null;\n  /** False when discovery could not tell which record is active at all. */\n  selectionKnown: boolean;\n}> {\n  const renewOptions = { autoRenew: options?.autoRenew };\n  const [profile, proxyTargets] = await Promise.all([\n    getMyChartProfile(mychartRequest, renewOptions),\n    options?.proxyTargets ? Promise.resolve(options.proxyTargets) : discoverProxyTargets(mychartRequest, renewOptions),\n  ]);\n\n  const selectionKnown = proxyTargets.some((entry) => entry.selectionKnown);\n  const selectedTarget = proxyTargets.find((entry) => entry.selectionKnown && entry.isSelected) ?? null;\n  const result = {\n    profileName: profile?.name || null,\n    profileDob: profile?.dob || null,\n    proxyTargets,\n    selectedTarget,\n    selectionKnown,\n  };\n\n  debugLog(`verified profile name=${result.profileName ?? 'null'} dob=${result.profileDob ?? 'null'}`);\n  debugLog(`selected target after verification=${selectedTarget ? `${selectedTarget.displayName}${selectedTarget.isSelected ? '*' : ''}` : 'null'} selectionKnown=${selectionKnown}`);\n  return result;\n}\n\n/** Strings a human might type to mean \"the account holder's own record\". */\nconst SELF_QUERIES = new Set(['self', 'me', 'myself', 'my record', 'account holder']);\n\n/**\n * Resolve a human-supplied string to exactly one record.\n *\n * Accepts, in order of precedence: a self alias (\"me\", \"self\"), an exact id, an\n * exact display name, or a unique case-insensitive partial name. Ambiguity is\n * always an error listing the candidates — guessing which patient was meant is\n * precisely the failure this codebase must never produce.\n */\nexport function findProxyTarget(targets: ProxyTarget[], query: string): ProxyTarget {\n  const wanted = normalize(query);\n  if (!wanted) throw new Error('Patient query is empty.');\n\n  const describe = () => targets.map((t) => `'${t.displayName}'${t.isSelf ? ' (you)' : ''}`).join(', ');\n\n  if (SELF_QUERIES.has(wanted)) {\n    const selves = targets.filter((entry) => entry.isSelf);\n    if (selves.length === 1) return selves[0]!;\n    // Only one record is reachable at all, so it IS the account holder —\n    // whether or not the portal bothered to flag it. This matters because the\n    // HTML and script discovery surfaces are inferred rather than captured: a\n    // single-record account whose markup we misparse must not get locked out\n    // of a tool that has nothing to do with proxy access.\n    if (targets.length === 1) return targets[0]!;\n    throw new DetailedError(\n      `Could not identify the account holder's own record among the ${targets.length} records this account can access.`,\n      `Could not identify the account holder's own record among: ${describe()}.`,\n    );\n  }\n\n  // Ids are opaque and exact — check them before any name matching so a record\n  // can always be named unambiguously even if display names collide.\n  const byId = targets.filter((entry) => entry.id === query.trim());\n  if (byId.length === 1) return byId[0]!;\n\n  const exact = targets.filter((entry) => normalize(entry.displayName) === wanted);\n  if (exact.length === 1) return exact[0]!;\n  if (exact.length > 1) {\n    const rest = ' more than one patient record. Use --patient with the record id instead.';\n    throw new DetailedError(`That name matches${rest}`, `'${query}' matches${rest}`);\n  }\n\n  const partial = targets.filter((entry) => normalize(entry.displayName).includes(wanted));\n  if (partial.length === 1) return partial[0]!;\n  if (partial.length > 1) {\n    throw new DetailedError(\n      `That name matches ${partial.length} patient records. Be more specific, or use the record id from list_proxy_targets.`,\n      `'${query}' matches ${partial.length} patient records (${partial.map((t) => `'${t.displayName}'`).join(', ')}). Be more specific.`,\n    );\n  }\n\n  throw new DetailedError(\n    'No patient record matches that name. list_proxy_targets lists every record this account can access.',\n    `No patient record matches '${query}'. Available: ${describe()}.`,\n  );\n}\n\nexport type ProxyContextCheck = {\n  /** Every record this account can reach. Empty for single-record accounts. */\n  targets: ProxyTarget[];\n  /** The record the caller asked for. Null when the account has no proxy access. */\n  wanted: ProxyTarget | null;\n  /** The record the portal is actually on, as best we can determine. */\n  current: ProxyTarget | null;\n  /** True when the portal is already on `wanted`. */\n  active: boolean;\n  /**\n   * How `current` was established: the portal's own selection flag, or by\n   * matching the scraped profile name when the portal doesn't report one.\n   * 'unknown' means neither worked and `active` must not be trusted.\n   */\n  determinedBy: 'selection-flag' | 'profile-name' | 'unknown';\n};\n\n/**\n * Report whether the portal is already on a given patient, WITHOUT changing\n * anything.\n *\n * This is the read-only counterpart to `switchProxyTarget`, for callers that\n * want to verify before acting rather than mutate a session as a side effect of\n * reading. Passing no query asks about the account holder.\n *\n * Where the portal reports a selection, that's used. Where it doesn't — the\n * script-block discovery surface never does — the active record is inferred by\n * comparing the scraped profile against each known record, which is stronger\n * evidence than a flag anyway.\n */\nexport async function checkProxyContext(\n  mychartRequest: MyChartRequest,\n  query?: string,\n  options?: { discoveredTargets?: ProxyTarget[] } & AuthenticatedRequestOptions\n): Promise<ProxyContextCheck> {\n  const renewOptions = { autoRenew: options?.autoRenew };\n  const targets = options?.discoveredTargets ?? await discoverProxyTargets(mychartRequest, renewOptions);\n  if (targets.length === 0) {\n    return { targets, wanted: null, current: null, active: true, determinedBy: 'unknown' };\n  }\n\n  const wanted = findProxyTarget(targets, query ?? 'me');\n\n  const flagged = targets.find((entry) => entry.selectionKnown && entry.isSelected);\n  if (flagged) {\n    return {\n      targets,\n      wanted,\n      current: flagged,\n      active: flagged.id === wanted.id,\n      determinedBy: 'selection-flag',\n    };\n  }\n\n  // No selection flag: ask the profile page who we are.\n  const profile = await getMyChartProfile(mychartRequest, renewOptions);\n  const profileName = profile?.name || '';\n  const byName = profileName\n    ? targets.filter((entry) => compareProfileNames(entry.displayName, profileName) === 'match')\n    : [];\n\n  const namedCurrent = byName.length === 1 ? byName[0] : undefined;\n  if (namedCurrent) {\n    return {\n      targets,\n      wanted,\n      current: namedCurrent,\n      active: namedCurrent.id === wanted.id,\n      determinedBy: 'profile-name',\n    };\n  }\n\n  return { targets, wanted, current: null, active: false, determinedBy: 'unknown' };\n}\n\n/**\n * Run `fn` with the portal pointed at `target`.\n *\n * MyChart has no per-request patient parameter — the active record is\n * server-side session state, reached only by following a switch URL. That makes\n * \"which patient am I reading?\" invisible at the call site and, because\n * sessions are resumed from cached cookies, it can persist across processes.\n * This wrapper puts the target back at the call site: state the patient you\n * mean, every time, and let the switching be an implementation detail.\n *\n * Passing no target means the account holder — explicitly, not \"whoever the\n * session happens to be pointed at\". The switch is skipped when the portal\n * already reports the wanted record as active, so the common case costs one\n * discovery request rather than a full switch.\n *\n * Accounts with no proxy access have no proxy surface at all; there `fn` simply\n * runs.\n */\n/**\n * Record which patient record this session is on, and arm the restore hook\n * session renewal uses to put it back after a silent re-login. Set together\n * on purpose: renewal fails closed if it ever finds a recorded non-self\n * target without a restore hook (see sessionRenewal.ts). The hook re-runs the\n * verified switch with autoRenew: false, so it can only ever fail, never\n * re-enter renewal.\n */\nfunction recordActiveTarget(\n  mychartRequest: MyChartRequest,\n  resolved: Pick<ProxyTarget, 'id' | 'isSelf' | 'displayName'>,\n): void {\n  mychartRequest.activeProxyTarget = {\n    id: resolved.id,\n    isSelf: resolved.isSelf,\n    displayName: resolved.displayName,\n  };\n  mychartRequest.restoreProxyContext = async () => {\n    await switchProxyTarget(\n      mychartRequest,\n      resolved.isSelf ? { self: true } : { id: resolved.id },\n      { autoRenew: false },\n    );\n  };\n}\n\nexport async function withProxyTarget<T>(\n  mychartRequest: MyChartRequest,\n  target: ProxyTargetSelector | string | undefined,\n  fn: () => Promise<T>\n): Promise<T> {\n  const discovered = await discoverProxyTargets(mychartRequest);\n\n  if (discovered.length === 0) {\n    if (typeof target === 'string' || (target && (target.id !== undefined || target.displayName))) {\n      throw new Error('This account has access to only one patient record, so a patient cannot be selected.');\n    }\n    return fn();\n  }\n\n  const resolved = typeof target === 'string'\n    ? findProxyTarget(discovered, target)\n    : resolveTarget(discovered, target ?? { self: true });\n\n  // Already there — don't pay for a redirect chain we don't need. Still record\n  // the intent: if the session expires inside fn(), automatic renewal must\n  // know which record to restore even though no switch happened on this call.\n  if (resolved.selectionKnown && resolved.isSelected) {\n    recordActiveTarget(mychartRequest, resolved);\n  } else {\n    await switchProxyTarget(\n      mychartRequest,\n      resolved.isSelf ? { self: true } : { id: resolved.id },\n      { discoveredTargets: discovered }\n    );\n  }\n\n  return fn();\n}\n\nexport async function switchProxyTarget(\n  mychartRequest: MyChartRequest,\n  target: ProxyTargetSelector,\n  options?: { discoveredTargets?: ProxyTarget[] } & AuthenticatedRequestOptions\n): Promise<{ target: ProxyTarget; verifiedProfileName: string | null; verifiedDob: string | null }> {\n  const renewOptions = { autoRenew: options?.autoRenew };\n  const discovered = options?.discoveredTargets ?? await discoverProxyTargets(mychartRequest, renewOptions);\n  if (discovered.length === 0) {\n    throw new Error('No proxy targets were discovered for this session.');\n  }\n\n  const resolved = resolveTarget(discovered, target);\n  debugLog('chosen target=', resolved);\n\n  if (resolved.isSelf) {\n    const explicitSelf = target.self === true\n      || (target.id !== undefined && (target.id === '' || target.id === resolved.id))\n      || (!!target.displayName && normalize(target.displayName) === normalize(resolved.displayName));\n    if (!explicitSelf) {\n      throw new Error('Refusing to switch to self without an explicit self target request.');\n    }\n  }\n\n  await followProxySwitchChain(mychartRequest, resolved.linkUrl);\n  const refreshedTargets = await discoverProxyTargets(mychartRequest, renewOptions);\n  const verified = await verifyActiveProxyTarget(mychartRequest, { proxyTargets: refreshedTargets, autoRenew: options?.autoRenew });\n  const selected = verified.selectedTarget;\n\n  // Compare the patient the portal is now showing us against the one we asked\n  // for. Never trust `IsSelected` alone — scraping the wrong patient's chart is\n  // the worst failure mode this app has.\n  const identity = compareProfileNames(resolved.displayName, verified.profileName || '');\n\n  // The sharpest signal available: the profile we landed on matches a\n  // *different* record in the list. That is a switch that went to the wrong\n  // patient — most often a sibling, whom a surname comparison alone would wave\n  // through — and it is never acceptable.\n  if (identity !== 'match' && verified.profileName) {\n    // The same person's record linked from another org (\"Marge (Springfield General)\" next to\n    // \"Marge (Shelbyville Clinic)\") is not an impostor.\n    const impostor = refreshedTargets.find((entry) =>\n      entry.id !== resolved.id\n      && compareProfileNames(entry.displayName, resolved.displayName) !== 'match'\n      && compareProfileNames(entry.displayName, verified.profileName!) === 'match');\n    if (impostor) {\n      throw new DetailedError(\n        'Proxy switch landed on the wrong patient: the portal is showing another record on this account, ' +\n        'not the one asked for.',\n        `Proxy switch landed on the wrong patient: asked for '${resolved.displayName}', ` +\n        `portal is showing '${verified.profileName}' (${impostor.displayName}).`,\n      );\n    }\n  }\n\n  if (identity === 'mismatch') {\n    throw new DetailedError(\n      \"Proxy switch landed on the wrong patient: the portal's profile does not match the record asked for.\",\n      `Proxy switch landed on the wrong patient: asked for '${resolved.displayName}', ` +\n      `portal reports '${verified.profileName}'.`,\n    );\n  }\n\n  // Remember which record this session is now on. Automatic session renewal\n  // (sessionRenewal.ts) reads this to restore the context after a re-login,\n  // which resets MyChart to the account holder server-side.\n  const recordSwitch = () => recordActiveTarget(mychartRequest, resolved);\n\n  if (verified.selectionKnown) {\n    const confirmed = resolved.isSelf ? !!selected?.isSelf : !!selected && selected.id === resolved.id;\n    if (!confirmed) {\n      throw new Error('Proxy target switch could not be confirmed after redirect chain.');\n    }\n    recordSwitch();\n    return {\n      target: selected!,\n      verifiedProfileName: verified.profileName,\n      verifiedDob: verified.profileDob,\n    };\n  }\n\n  // Discovery could not report a selection flag (the script-block fallback).\n  // The profile name is then the only evidence available, so require it.\n  if (identity !== 'match') {\n    const lead = 'Proxy target switch could not be confirmed: the portal does not report which record is active, ';\n    throw new DetailedError(\n      lead + 'and its profile name could not be matched against the record asked for.',\n      lead + `and the profile name ('${verified.profileName ?? 'unknown'}') could not be matched against ` +\n      `'${resolved.displayName}'.`,\n    );\n  }\n\n  const refreshed = refreshedTargets.find((entry) => entry.id === resolved.id) ?? resolved;\n  recordSwitch();\n  return {\n    target: { ...refreshed, isSelected: true },\n    verifiedProfileName: verified.profileName,\n    verifiedDob: verified.profileDob,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { TOTP } from 'totp-generator';\n\n/**\n * Generate a TOTP code from a Base32-encoded secret.\n * MyChart uses standard 6-digit, 30-second TOTP codes.\n */\nexport async function generateTotpCode(secret: string, timestamp?: number): Promise<string> {\n  // Clean up the secret: remove spaces, uppercase\n  const cleanSecret = secret.replace(/\\s+/g, '').toUpperCase();\n  const options = timestamp !== undefined ? { timestamp } : {};\n  const { otp } = await TOTP.generate(cleanSecret, options);\n  return otp;\n}\n\n/**\n * Parse an otpauth:// URI (from a QR code) and extract the secret.\n * Format: otpauth://totp/Label?secret=BASE32SECRET&issuer=Issuer\n */\nexport function parseTotpUri(uri: string): { secret: string; issuer: string; account: string } {\n  const url = new URL(uri);\n  const secret = url.searchParams.get('secret') || '';\n  const issuer = url.searchParams.get('issuer') || '';\n  const account = decodeURIComponent(url.pathname.replace('/totp/', '').replace(/^\\//, ''));\n  return { secret, issuer, account };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Session-scoped CSRF tokens (`__RequestVerificationToken`).\n *\n * MyChart's `/api/*` endpoints reject a POST that arrives without an\n * antiforgery token. Chart scrapers harvest one from the hidden input on their\n * own category page, but the flows that have no category page — TOTP and\n * passkey enrollment, the eUnity imaging handoff — ask `/Home/CSRFToken` for a\n * token directly, and that endpoint is one of the least consistent surfaces\n * across Epic instances. It answers with any of:\n *\n *   - JSON: `{\"Token\": \"...\"}`, or the same key camel-cased, or\n *     `RequestVerificationToken` in either casing\n *   - the bare token as the entire response body\n *   - a full HTML page with the usual hidden input\n *   - an empty 200 (seen on at least one live instance), which is why the\n *     `/Home` page fallback exists\n *\n * Getting this wrong doesn't fail loudly — it produces a token-less POST that\n * the instance answers with ASP.NET's redirect dance, which reads downstream as\n * \"this account has no imaging\" rather than as an error. Three copies of the\n * parsing had drifted apart before this module existed; keep it as the one.\n */\n\nimport { makeAuthenticatedRequest } from './makeAuthenticatedRequest';\nimport type { MyChartRequest } from './myChartRequest';\nimport { getRequestVerificationTokenFromBody } from './util';\nimport { logger } from '../../../shared/logger';\n\n/** JSON keys instances use for the token, in the order we try them. */\nconst JSON_TOKEN_KEYS = [\n  'Token',\n  'token',\n  'RequestVerificationToken',\n  'requestVerificationToken',\n] as const;\n\n/**\n * A bare-string body has to clear this length to be believed. It rules out\n * short error strings (\"0\", \"null\") without excluding any real token — Epic's\n * are base64-ish and dozens of characters long.\n */\nconst MIN_BARE_TOKEN_LENGTH = 10;\n\n/**\n * The token out of a JSON envelope, or undefined when the body is a JSON\n * object that carries none. Returns null when the body isn't a JSON object at\n * all, which is the signal to go on and try the other shapes.\n */\nfunction tokenFromJsonEnvelope(trimmed: string): string | undefined | null {\n  if (!trimmed.startsWith('{')) return null;\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(trimmed);\n  } catch {\n    return null; // Starts with '{' but isn't JSON — treat it as an opaque body.\n  }\n  if (parsed === null || typeof parsed !== 'object') return null;\n\n  const record = parsed as Record<string, unknown>;\n  for (const key of JSON_TOKEN_KEYS) {\n    const value = record[key];\n    if (typeof value === 'string' && value) {\n      logger.debug('Got CSRF token from JSON response');\n      return value;\n    }\n  }\n  return undefined;\n}\n\n/** Pull the token out of a `/Home/CSRFToken` body, whatever shape it arrived in. */\nfunction parseTokenFromCsrfEndpoint(body: string): string | undefined {\n  const trimmed = body.trim();\n\n  // A JSON envelope either carries the token under a known key or carries none.\n  // It must never fall through to the bare-string branch below: `{\"error\":\"x\"}`\n  // has no angle brackets and clears the length bar, so the whole envelope\n  // would be sent as the token and every /api/* POST would be rejected.\n  const fromJson = tokenFromJsonEnvelope(trimmed);\n  if (fromJson !== null) return fromJson;\n\n  // The entire body is the token.\n  if (trimmed && !trimmed.includes('<') && trimmed.length > MIN_BARE_TOKEN_LENGTH) {\n    logger.debug('Got CSRF token as plain string');\n    return trimmed;\n  }\n\n  return getRequestVerificationTokenFromBody(body);\n}\n\n/**\n * Fetch a CSRF token good for this session's `/api/*` POSTs, without going\n * through any particular category page.\n *\n * Returns null when no token can be had — including when the session has been\n * bounced to Terms & Conditions, where `/Home` would only bounce again, so the\n * fallback is deliberately skipped. Callers must treat null as a hard failure:\n * a POST sent without the header is rejected in a way that is easy to misread\n * as an empty chart.\n */\nexport async function fetchSessionCsrfToken(mychartRequest: MyChartRequest): Promise<string | null> {\n  const res = await makeAuthenticatedRequest(mychartRequest, {\n    // Cache-busted so no proxy between us and the instance can serve a stale token.\n    path: '/Home/CSRFToken?noCache=' + Math.random(),\n  });\n  logger.debug('CSRFToken response status:', res.status);\n\n  const body = await res.text();\n\n  const lowered = body.toLowerCase();\n  if (lowered.includes('termsconditions') || lowered.includes('terms and conditions')) {\n    logger.debug('CSRF token request landed on Terms & Conditions page');\n    return null;\n  }\n\n  const token = parseTokenFromCsrfEndpoint(body);\n  if (token) return token;\n\n  logger.debug('CSRFToken endpoint returned no token (length:', body.length, '), trying /Home page fallback');\n  try {\n    const homeRes = await makeAuthenticatedRequest(mychartRequest, { path: '/Home' });\n    const homeToken = getRequestVerificationTokenFromBody(await homeRes.text());\n    if (homeToken) {\n      logger.debug('Got CSRF token from /Home page fallback');\n      return homeToken;\n    }\n    logger.debug('Could not extract CSRF token from /Home page either');\n  } catch (err) {\n    logger.debug('/Home page fallback failed:', err);\n  }\n\n  return null;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { fetchSessionCsrfToken } from '../core/csrf';\nimport { generateTotpCode } from './totp';\nimport { logger } from '../../../shared/logger';\n\nexport interface SetupTotpResult {\n  secret: string | null;\n  error?: string;\n}\n\n// Deliberately status-only: the headers carry Set-Cookie and the bodies of\n// these endpoints carry the TOTP secret, so neither is safe to log.\nfunction logUnexpectedResponse(label: string, resp: Response) {\n  logger.debug(`  ${label} unexpected status: ${resp.status}`);\n}\n\nfunction fail(error: string): SetupTotpResult {\n  return { secret: null, error };\n}\n\n/**\n * Set up TOTP authenticator app on a MyChart account.\n *\n * Flow (discovered via Playwright on a MyChart instance):\n * 1. POST /api/secondary-validation/GetTwoFactorInfo — check current 2FA settings\n * 2. POST /api/secondary-validation/VerifyPasswordAndUpdateContact — verify password\n * 3. POST /api/secondary-validation/TotpQrCode — get QR code data with secret\n * 4. POST /api/secondary-validation/VerifyCode — verify setup with generated code\n * 5. POST /api/secondary-validation/UpdateTwoFactorTotpOptInStatus — finalize opt-in\n *\n * Returns the TOTP secret if setup succeeds, or null with an error message if it fails.\n */\nexport async function setupTotp(mychartRequest: MyChartRequest, password: string): Promise<SetupTotpResult> {\n\n  // Get CSRF token for API requests\n  const csrfToken = await fetchSessionCsrfToken(mychartRequest);\n  if (!csrfToken) {\n    logger.debug('  Could not get CSRF token.');\n    return fail('Could not get CSRF token. The session may have expired.');\n  }\n\n  const apiHeaders: Record<string, string> = {\n    'Content-Type': 'application/json',\n    '__RequestVerificationToken': csrfToken,\n  };\n\n  // Step 1: Check current 2FA settings\n  logger.debug('  Checking current 2FA settings...');\n  const twoFactorInfoResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/GetTwoFactorInfo',\n    method: 'POST',\n    headers: apiHeaders,\n    body: '{}',\n  });\n  if (twoFactorInfoResp.status !== 200) {\n    logUnexpectedResponse('GetTwoFactorInfo', twoFactorInfoResp);\n    if (twoFactorInfoResp.status === 500) {\n      return fail('This MyChart instance does not support authenticator app setup. You can still use SMS/email 2FA codes.');\n    }\n    return fail(`Failed to check 2FA settings (HTTP ${twoFactorInfoResp.status}). The session may have expired.`);\n  }\n  const twoFactorInfo = await twoFactorInfoResp.json();\n  logger.debug('  2FA info keys:', Object.keys(twoFactorInfo).join(', '));\n\n  // Check if TOTP is already enabled\n  if (twoFactorInfo.IsTotpEnabled || twoFactorInfo.isTotpEnabled) {\n    logger.debug('  TOTP authenticator app is already enabled on this account.');\n    logger.debug('  To get the secret, you need to disable and re-enable TOTP in MyChart settings.');\n    return fail('TOTP is already enabled on this MyChart account. To re-configure, disable it in MyChart settings first.');\n  }\n\n  // Step 2: Verify password\n  logger.debug('  Verifying password...');\n  const verifyResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/VerifyPasswordAndUpdateContact',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ Password: password }),\n  });\n  if (verifyResp.status !== 200) {\n    logUnexpectedResponse('VerifyPasswordAndUpdateContact', verifyResp);\n    return fail(`Password verification failed (HTTP ${verifyResp.status}).`);\n  }\n  const verifyResult = await verifyResp.json();\n  logger.debug('  VerifyPassword result. IsPasswordValid:', verifyResult.IsPasswordValid ?? verifyResult.isPasswordValid);\n\n  if (verifyResult.IsPasswordValid === false || verifyResult.isPasswordValid === false) {\n    logger.debug('  Password verification failed.');\n    return fail('Password verification failed. The saved password may be incorrect.');\n  }\n  logger.debug('  Password verified.');\n\n  // Step 3: Get QR code / TOTP secret\n  logger.debug('  Requesting TOTP setup...');\n  const qrResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/TotpQrCode',\n    method: 'POST',\n    headers: apiHeaders,\n    body: '{}',\n  });\n  if (qrResp.status !== 200) {\n    logUnexpectedResponse('TotpQrCode', qrResp);\n    return fail(`Failed to get TOTP QR code (HTTP ${qrResp.status}).`);\n  }\n  const qrResult = await qrResp.json();\n  logger.debug('  TotpQrCode response keys:', Object.keys(qrResult).join(', '));\n\n  // The secret key may be in various fields depending on the MyChart version\n  const secret = qrResult.encodedSecretKey || qrResult.EncodedSecretKey || qrResult.SecretKey || qrResult.secretKey || qrResult.Secret || qrResult.secret || qrResult.ManualEntryKey || qrResult.manualEntryKey;\n\n  if (!secret) {\n    // Never log the response itself — this is the payload that carries the\n    // shared secret. The key list above is what a new field name shows up in.\n    logger.debug('  Could not extract TOTP secret from response (no recognized secret field).');\n    return fail('Could not extract TOTP secret from server response.');\n  }\n\n  logger.debug('  Got TOTP secret (length:', secret.length, ')');\n\n  // Step 4: Verify the setup by generating and submitting a TOTP code\n  logger.debug('  Verifying TOTP setup...');\n  const code = await generateTotpCode(secret);\n  logger.debug('  Generated verification code.');\n\n  const verifyTotpResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/VerifyCode',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ Code: code }),\n  });\n  const verifyTotpText = await verifyTotpResp.text();\n  logger.debug('  VerifyCode response status:', verifyTotpResp.status, 'success:', verifyTotpText.includes('\"Success\":true'));\n\n  if (verifyTotpResp.status !== 200) {\n    logger.debug('  TOTP code verification failed.');\n    return fail(`TOTP code verification failed (HTTP ${verifyTotpResp.status}).`);\n  }\n\n  // Step 5: Finalize the opt-in\n  logger.debug('  Finalizing TOTP opt-in...');\n  const optInResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/UpdateTwoFactorTotpOptInStatus',\n    method: 'POST',\n    headers: apiHeaders,\n    body: '{}',\n  });\n  logger.debug('  OptIn response status:', optInResp.status);\n\n  if (optInResp.status !== 200) {\n    logUnexpectedResponse('UpdateTwoFactorTotpOptInStatus', optInResp);\n    return fail(`Failed to finalize TOTP opt-in (HTTP ${optInResp.status}).`);\n  }\n\n  logger.debug('  TOTP setup complete! Authenticator app is now enabled.');\n  return { secret };\n}\n\n/**\n * Disable TOTP authenticator app on a MyChart account.\n *\n * Flow:\n * 1. POST /api/secondary-validation/VerifyPasswordAndUpdateContact — verify password\n * 2. POST /api/secondary-validation/VerifyCode — verify with current TOTP code\n * 3. POST /api/secondary-validation/UpdateTwoFactorTotpOptInStatus — finalize opt-out\n */\nexport async function disableTotp(mychartRequest: MyChartRequest, password: string, totpSecret: string): Promise<boolean> {\n  const csrfToken = await fetchSessionCsrfToken(mychartRequest);\n  if (!csrfToken) {\n    logger.debug('  Could not get CSRF token.');\n    return false;\n  }\n\n  const apiHeaders: Record<string, string> = {\n    'Content-Type': 'application/json',\n    '__RequestVerificationToken': csrfToken,\n  };\n\n  // Step 1: Verify password\n  logger.debug('  Verifying password...');\n  const verifyResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/VerifyPasswordAndUpdateContact',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ Password: password }),\n  });\n  const verifyResult = await verifyResp.json();\n\n  if (verifyResult.IsPasswordValid === false || verifyResult.isPasswordValid === false) {\n    logger.debug('  Password verification failed.');\n    return false;\n  }\n  logger.debug('  Password verified.');\n\n  // Step 2: Verify with current TOTP code\n  logger.debug('  Generating TOTP code for verification...');\n  const code = await generateTotpCode(totpSecret);\n  logger.debug('  Generated code.');\n\n  const verifyCodeResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/VerifyCode',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ Code: code }),\n  });\n\n  if (verifyCodeResp.status !== 200) {\n    logger.debug('  TOTP code verification failed (status:', verifyCodeResp.status, ')');\n    return false;\n  }\n\n  // Step 3: Finalize opt-out\n  logger.debug('  Disabling TOTP...');\n  const optOutResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/secondary-validation/UpdateTwoFactorTotpOptInStatus',\n    method: 'POST',\n    headers: apiHeaders,\n    body: '{}',\n  });\n  logger.debug('  OptOut response status:', optOutResp.status);\n\n  logger.debug('  TOTP disabled! Authenticator app has been removed.');\n  return true;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\n// Stored relative to the user's current working directory so secrets\n// live in the user's project, not inside node_modules. Override with\n// `MYCHART_TOTP_DIR=/abs/path` if needed.\nconst TOTP_DIR = process.env.MYCHART_TOTP_DIR\n  ? path.resolve(process.env.MYCHART_TOTP_DIR)\n  : path.join(process.cwd(), '.totp-secrets');\n\nfunction getSecretPath(hostname: string): string {\n  return path.join(TOTP_DIR, `${hostname}.txt`);\n}\n\nexport async function saveTotpSecret(hostname: string, secret: string): Promise<void> {\n  await fs.promises.mkdir(TOTP_DIR, { recursive: true });\n  await fs.promises.writeFile(getSecretPath(hostname), secret, 'utf-8');\n  console.log(`  TOTP secret saved to .totp-secrets/${hostname}.txt`);\n}\n\nexport async function loadTotpSecret(hostname: string): Promise<string | null> {\n  try {\n    const secret = await fs.promises.readFile(getSecretPath(hostname), 'utf-8');\n    return secret.trim();\n  } catch {\n    return null;\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { serializeCredential, deserializeCredential, type PasskeyCredential } from '../../scrapers/myChart/auth/softwareAuthenticator';\n\n// Stored relative to the user's current working directory so credentials\n// live in the user's project, not inside node_modules (which gets nuked\n// on reinstall). Override with `MYCHART_PASSKEY_DIR=/abs/path` if needed.\nconst PASSKEY_DIR = process.env.MYCHART_PASSKEY_DIR\n  ? path.resolve(process.env.MYCHART_PASSKEY_DIR)\n  : path.join(process.cwd(), '.passkey-credentials');\n\nfunction getCredentialPath(hostname: string): string {\n  return path.join(PASSKEY_DIR, `${hostname}.json`);\n}\n\nexport async function savePasskeyCredential(hostname: string, credential: PasskeyCredential): Promise<void> {\n  await fs.promises.mkdir(PASSKEY_DIR, { recursive: true });\n  const basePath = getCredentialPath(hostname);\n\n  // Never overwrite an existing credential — archive it first\n  try {\n    await fs.promises.access(basePath);\n    // File exists — rename to hostname.TIMESTAMP.json\n    const ts = new Date().toISOString().replace(/[:.]/g, '-');\n    const archivePath = path.join(PASSKEY_DIR, `${hostname}.${ts}.json`);\n    await fs.promises.rename(basePath, archivePath);\n    console.log(`  Archived previous passkey to ${hostname}.${ts}.json`);\n  } catch {\n    // No existing file — nothing to archive\n  }\n\n  await fs.promises.writeFile(basePath, serializeCredential(credential), 'utf-8');\n  console.log(`  Passkey credential saved to .passkey-credentials/${hostname}.json`);\n}\n\nexport async function loadPasskeyCredential(hostname: string): Promise<PasskeyCredential | null> {\n  try {\n    const json = await fs.promises.readFile(getCredentialPath(hostname), 'utf-8');\n    return deserializeCredential(json.trim());\n  } catch {\n    return null;\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { PasskeyCredential } from './softwareAuthenticator';\nimport type { LoginResult } from './login';\n\n// How many times we'll bump the WebAuthn signature counter and retry a passkey\n// login before giving up. The server's counter only ever moves a little ahead\n// of ours, so a handful of attempts is plenty; the cap just bounds the work if\n// the passkey is genuinely invalid (every attempt would fail regardless).\nexport const MAX_SIGN_COUNT_BUMPS = 10;\n\n/**\n * Run a passkey login, recovering from WebAuthn signature-counter desync.\n *\n * MyChart enforces a strictly-increasing signature counter on each passkey\n * assertion. Our locally-stored counter can fall behind the server's — a prior\n * login advanced the server but the bumped value was never persisted (e.g. the\n * login was treated as failed, or the process exited first), or the same\n * passkey was used from another device. When that happens the first assertion\n * is rejected because its counter is too low, and the previous behaviour was to\n * give up immediately.\n *\n * Here we treat an `invalid_login` as a possible counter mismatch: bump the\n * counter and retry, up to `maxBumps` times. `attempt` is expected to run the\n * real login (which increments `credential.signCount` while building the\n * assertion), so on success `credential.signCount` holds the value the server\n * accepted and the caller can persist it. Non-counter outcomes (`logged_in`,\n * `need_2fa`, `error`) return immediately — bumping wouldn't help those.\n *\n * `credential` is mutated in place (its `signCount` is advanced); callers\n * should persist it after a successful return.\n *\n * Shared by the CLI (`npm-package/cli/cli.ts`) and the Expo app\n * (`expo-app/src/lib/scrapers/session-manager.ts`) — both auto-login with a\n * locally-stored passkey credential and hit the same desync.\n */\nexport async function passkeyLoginWithCounterRetry(\n  attempt: (credential: PasskeyCredential) => Promise<LoginResult>,\n  credential: PasskeyCredential,\n  maxBumps: number = MAX_SIGN_COUNT_BUMPS,\n): Promise<LoginResult> {\n  const startCount = credential.signCount;\n  let result: LoginResult | undefined;\n\n  for (let bump = 0; bump <= maxBumps; bump++) {\n    // attempt() (via createAssertion) increments signCount before signing, so\n    // setting it to startCount + bump means the server sees startCount + bump +\n    // 1 — a strictly increasing sequence across retries with no gaps or repeats.\n    credential.signCount = startCount + bump;\n    result = await attempt(credential);\n\n    // Anything other than a counter rejection is final.\n    if (result.state !== 'invalid_login') return result;\n  }\n\n  return result!;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Non-interactive MyChart login ladder, shared by every client's session\n * renewal hook (and usable for first login too).\n *\n * Order: saved passkey (with WebAuthn signature-counter retry) → username +\n * password → TOTP-secret 2FA. Anything requiring a human — an emailed code, a\n * password prompt — is out of scope by definition: this exists so\n * `makeAuthenticatedRequest` can renew an expired session mid-scrape without\n * anyone at the keyboard. When no silent path works it says so rather than\n * blocking.\n *\n * The CLI, desktop extension and mobile app each store credentials\n * differently; they supply them (and persistence callbacks) via params, and\n * `wireSilentReauthentication` turns the result into the `reauthenticate` hook\n * the wrapper calls.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { myChartUserPassLogin, myChartPasskeyLogin, complete2faFlow } from './login';\nimport { passkeyLoginWithCounterRetry } from './passkeyLoginRetry';\nimport { generateTotpCode } from './totp';\nimport type { PasskeyCredential } from './softwareAuthenticator';\nimport { logger } from '../../../shared/logger';\n\n/**\n * Every optional here is `| undefined` on purpose: each client reads these out of\n * its own credential store, where \"nothing saved\" surfaces as an explicit\n * undefined, and every read below is a truthiness or `??` check — so an absent\n * key and an undefined one mean the same thing.\n */\nexport type SilentLoginParams = {\n  hostname: string;\n  username?: string | undefined;\n  password?: string | undefined;\n  /** TOTP secret for non-interactive 2FA. Without it, a 2FA challenge fails the login. */\n  totpSecret?: string | null | undefined;\n  /**\n   * Locally stored passkey. Mutated in place — a login advances its WebAuthn\n   * signature counter — so persist it from `onPasskeyUsed` or the next login\n   * starts a counter-desync recovery dance.\n   *\n   * (No transport parameter: scrapers/http.ts picks the platform's transport —\n   * native-cookie fetch on device, jar-driven fetch on Node/Bun — on its own.)\n   */\n  passkey?: PasskeyCredential | null | undefined;\n  /** 'http' for local fake-mychart; defaults to https. */\n  protocol?: string | undefined;\n  /** A passkey login succeeded — persist the bumped signature counter. */\n  onPasskeyUsed?: ((credential: PasskeyCredential) => void | Promise<void>) | undefined;\n  /** The passkey was rejected as invalid (not a network error) — safe to delete. */\n  onPasskeyInvalid?: ((credential: PasskeyCredential) => void | Promise<void>) | undefined;\n};\n\nexport type SilentLoginOutcome =\n  | { state: 'logged_in'; mychartRequest: MyChartRequest }\n  | { state: 'failed'; reason: string };\n\nexport async function silentLogin(params: SilentLoginParams): Promise<SilentLoginOutcome> {\n  const { hostname, protocol } = params;\n\n  if (params.passkey) {\n    const credential = params.passkey;\n    try {\n      const result = await passkeyLoginWithCounterRetry(\n        (cred) => myChartPasskeyLogin({ hostname, credential: cred, protocol }),\n        credential,\n      );\n      if (result.state === 'logged_in') {\n        await params.onPasskeyUsed?.(credential);\n        return { state: 'logged_in', mychartRequest: result.mychartRequest };\n      }\n      logger.warn(`Passkey login for ${hostname} failed (${result.state}), falling back to password`);\n      if (result.state === 'invalid_login') {\n        // Genuinely rejected, not a network blip — counter retry already ruled\n        // out a signature-counter desync.\n        await params.onPasskeyInvalid?.(credential);\n      }\n    } catch (error) {\n      // Network/timeout errors keep the passkey — it may be perfectly valid.\n      logger.warn(`Passkey login for ${hostname} threw (${(error as Error).message}), falling back to password`);\n    }\n  }\n\n  if (!params.username || !params.password) {\n    return { state: 'failed', reason: params.passkey ? 'passkey login failed and no password is available' : 'no stored credentials' };\n  }\n\n  const userPass = await myChartUserPassLogin({\n    hostname,\n    user: params.username,\n    pass: params.password,\n    skipSendCode: !!params.totpSecret,\n    protocol,\n  });\n\n  if (userPass.state === 'logged_in') {\n    return { state: 'logged_in', mychartRequest: userPass.mychartRequest };\n  }\n\n  if (userPass.state === 'need_2fa') {\n    if (!params.totpSecret) {\n      return { state: 'failed', reason: '2FA required and no TOTP secret is stored' };\n    }\n    const code = await generateTotpCode(params.totpSecret);\n    const twoFa = await complete2faFlow({\n      mychartRequest: userPass.mychartRequest,\n      code,\n      isTOTP: true,\n    });\n    if (twoFa.state === 'logged_in') {\n      // complete2faFlow returns its own request object — that is the one\n      // carrying the authenticated cookies.\n      return { state: 'logged_in', mychartRequest: twoFa.mychartRequest };\n    }\n    return { state: 'failed', reason: `TOTP code rejected (${twoFa.state})` };\n  }\n\n  return { state: 'failed', reason: `login failed (${userPass.state}${userPass.error ? `: ${userPass.error}` : ''})` };\n}\n\n/**\n * Wire a request's `reauthenticate` hook to the silent login ladder.\n *\n * `getParams` runs at renewal time, not wiring time, so it can re-read\n * credential stores that may have changed since login (a passkey registered\n * mid-session, an updated password). On success the fresh session state is\n * adopted onto the SAME request object — everything holding a reference keeps\n * working — and `onRenewed` runs so the client can re-persist its cookie\n * cache.\n */\nexport function wireSilentReauthentication(\n  mychartRequest: MyChartRequest,\n  getParams: () => SilentLoginParams | Promise<SilentLoginParams>,\n  onRenewed?: (mychartRequest: MyChartRequest) => void | Promise<void>,\n): void {\n  mychartRequest.reauthenticate = async () => {\n    const params = await getParams();\n    const outcome = await silentLogin(params);\n    if (outcome.state !== 'logged_in') {\n      logger.warn(`Silent re-login for ${mychartRequest.hostname} failed: ${outcome.reason}`);\n      return false;\n    }\n    mychartRequest.adoptStateFrom(outcome.mychartRequest);\n    await onRenewed?.(mychartRequest);\n    return true;\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Whether this client is on the version we publish.\n *\n * Reads a small JSON manifest from our own site — `versions` and `updateUrls`,\n * keyed by the things that ship. Four keys because they version separately: the\n * extension is on 2.x while the CLI is on 1.x, so a single \"the version\" would\n * be wrong for someone. The update URL travels in the document so an installed\n * client can be sent somewhere new without needing the update it is announcing.\n *\n * Best-effort throughout: unreachable, 404, not JSON, malformed, not semver —\n * all `null`, meaning \"couldn't tell\". Never a throw, and never a claim of\n * being up to date, which is a different fact.\n */\n\nimport { compareVersions, validate } from 'compare-versions';\n\nimport { scraperFetch } from '../http';\n\nexport const VERSION_MANIFEST_URL = 'https://openrecord.fanpierlabs.com/mcpb_version.json';\n\nexport const VERSION_TARGETS = ['scrapers', 'cli', 'mcpb', 'app'] as const;\nexport type VersionTarget = (typeof VERSION_TARGETS)[number];\n\nexport interface VersionManifest {\n  versions: Record<VersionTarget, string>;\n  updateUrls: Record<VersionTarget, string>;\n}\n\nexport interface VersionCheck {\n  target: VersionTarget;\n  currentVersion: string;\n  latestVersion: string;\n  updateAvailable: boolean;\n  updateUrl: string;\n}\n\nfunction hasEveryTarget(value: unknown): value is Record<VersionTarget, string> {\n  if (typeof value !== 'object' || value === null) return false;\n  const record = value as Record<string, unknown>;\n  return VERSION_TARGETS.every((t) => typeof record[t] === 'string' && record[t] !== '');\n}\n\n/**\n * Validate a parsed document, or return null. Exported because the generator's\n * test checks the committed file with it — the document a client will accept is\n * the one this accepts, and a copy of these rules in a test would only prove\n * the copy agrees with itself.\n */\nexport function parseVersionManifest(value: unknown): VersionManifest | null {\n  if (typeof value !== 'object' || value === null) return null;\n  const doc = value as Record<string, unknown>;\n  if (!hasEveryTarget(doc.versions) || !hasEveryTarget(doc.updateUrls)) return null;\n  return { versions: doc.versions, updateUrls: doc.updateUrls };\n}\n\nexport async function fetchVersionManifest(\n  url: string = VERSION_MANIFEST_URL,\n): Promise<VersionManifest | null> {\n  try {\n    const response = await scraperFetch(url, { headers: { Accept: 'application/json' } });\n    return response.ok ? parseVersionManifest(await response.json()) : null;\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Whether `currentVersion` is behind what we publish for `target`.\n *\n * Runs even when telemetry is off: it sends nothing but the GET itself, and a\n * user who never hears about a fix keeps running the broken scraper.\n */\nexport async function checkVersion(options: {\n  currentVersion: string;\n  target: VersionTarget;\n  /** Skip the fetch and check against a manifest already in hand. */\n  manifest?: VersionManifest;\n  /** Override the manifest location. Tests and staging only. */\n  url?: string;\n}): Promise<VersionCheck | null> {\n  const manifest = options.manifest ?? (await fetchVersionManifest(options.url));\n  if (!manifest) return null;\n\n  const latestVersion = manifest.versions[options.target];\n  // `compareVersions` throws on anything that isn't semver, and both sides can\n  // be — a local build stamped `dev`, a manifest field that is a string but not\n  // a version. The call site is `void checkVersion(...)`, so that would be an\n  // unhandled rejection.\n  if (!validate(options.currentVersion) || !validate(latestVersion)) return null;\n\n  return {\n    target: options.target,\n    currentVersion: options.currentVersion,\n    latestVersion,\n    updateAvailable: compareVersions(options.currentVersion, latestVersion) < 0,\n    updateUrl: manifest.updateUrls[options.target],\n  };\n}\n\n/** The one-line notice a client prints, so no two clients word it differently. */\nexport function formatUpdateNotice(check: VersionCheck): string {\n  return `Update available: v${check.currentVersion} → v${check.latestVersion} — ${check.updateUrl}`;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The one generic markdown renderer behind the `standard` and `concise` modes.\n *\n * Generic on purpose: a per-capability template is a second place for a field\n * to go missing. Whatever is in the object is on the page, in the object's key\n * order, so `standard` markdown and `json` are provably the same data.\n *\n * Rendering rules:\n *   - scalars → `- **key**: value`\n *   - arrays of scalars → `- **key**: a, b, c` (`(none)` when empty)\n *   - arrays of flat objects → a table; anything with nested values, long or\n *     multi-line strings → one sub-section per element\n *   - nested objects → a sub-section\n *   - multi-line strings → a paragraph with hard line breaks, so a note reads\n *     as a note rather than one run-on line\n *   - `null` / `undefined` → `(none)`; booleans and numbers verbatim\n */\n\nimport { markdownTable } from 'markdown-table';\n\nconst MAX_TABLE_CELL = 60;\n\ntype Scalar = string | number | boolean | null | undefined;\n\nfunction isScalar(value: unknown): value is Scalar {\n  return value === null || value === undefined || ['string', 'number', 'boolean'].includes(typeof value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n  return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction scalarText(value: Scalar): string {\n  if (value === null || value === undefined) return '(none)';\n  if (typeof value === 'string') return value.trim() === '' ? '(empty)' : value;\n  return String(value);\n}\n\nfunction cell(value: unknown): string {\n  const text = isScalar(value)\n    ? scalarText(value)\n    : Array.isArray(value)\n      ? value.map((v) => (isScalar(v) ? scalarText(v) : JSON.stringify(v))).join(', ')\n      : JSON.stringify(value);\n  return text.replace(/\\|/g, '\\\\|').replace(/\\r?\\n/g, '<br>');\n}\n\n/** A value that can sit in a table cell: a short scalar, or a short list of them. */\nfunction isTabular(value: unknown): boolean {\n  if (isScalar(value)) return typeof value !== 'string' || value.length <= MAX_TABLE_CELL;\n  if (Array.isArray(value)) return value.every(isScalar) && value.join(', ').length <= MAX_TABLE_CELL;\n  return false;\n}\n\nfunction heading(level: number, text: string): string {\n  return `${'#'.repeat(Math.min(level, 6))} ${text}`;\n}\n\nfunction paragraph(text: string): string {\n  return text\n    .split(/\\r?\\n/)\n    .map((line) => line.trimEnd())\n    .join('  \\n');\n}\n\nfunction renderTable(rows: Record<string, unknown>[]): string[] {\n  const columns: string[] = [];\n  for (const row of rows) for (const key of Object.keys(row)) if (!columns.includes(key)) columns.push(key);\n  // markdown-table owns the table syntax; `cell` owns what goes in a cell.\n  // Delimiters are not aligned: padding every cell to the widest one in its\n  // column turns a 20-visit table into mostly spaces.\n  return markdownTable(\n    [columns, ...rows.map((row) => columns.map((c) => cell(row[c])))],\n    { alignDelimiters: false },\n  ).split('\\n');\n}\n\nfunction renderArray(key: string, items: unknown[], level: number, out: string[]): void {\n  if (items.length === 0) {\n    out.push(`- **${key}**: (none)`);\n    return;\n  }\n  if (items.every(isScalar)) {\n    out.push(`- **${key}**: ${items.map((v) => scalarText(v)).join(', ')}`);\n    return;\n  }\n  out.push('', heading(level, `${key} (${items.length})`), '');\n  const records = items.filter(isRecord);\n  if (records.length === items.length && records.every((r) => Object.values(r).every(isTabular))) {\n    out.push(...renderTable(records));\n    return;\n  }\n  items.forEach((item, index) => {\n    if (isRecord(item)) {\n      out.push(heading(level + 1, `${key} ${index + 1}`), '');\n      renderObject(item, level + 1, out);\n      out.push('');\n    } else if (Array.isArray(item)) {\n      renderArray(`${key} ${index + 1}`, item, level + 1, out);\n    } else {\n      out.push(`- ${scalarText(item as Scalar)}`);\n    }\n  });\n}\n\nfunction renderObject(value: Record<string, unknown>, level: number, out: string[]): void {\n  const entries = Object.entries(value);\n  if (entries.length === 0) {\n    out.push('(empty)');\n    return;\n  }\n  for (const [key, child] of entries) {\n    if (isScalar(child)) {\n      if (typeof child === 'string' && child.includes('\\n')) {\n        out.push(`- **${key}**:`, '', paragraph(child), '');\n      } else {\n        out.push(`- **${key}**: ${scalarText(child)}`);\n      }\n    } else if (Array.isArray(child)) {\n      renderArray(key, child, level + 1, out);\n    } else if (isRecord(child)) {\n      out.push('', heading(level + 1, key), '');\n      renderObject(child, level + 1, out);\n    }\n  }\n}\n\n/**\n * Render any JSON-serializable value as markdown. The optional title is an\n * `#` heading; sections of the value start at `##` either way.\n */\nexport function renderMarkdown(value: unknown, title?: string): string {\n  const out: string[] = [];\n  if (title) out.push(heading(1, title), '');\n  if (isScalar(value)) {\n    out.push(typeof value === 'string' && value.includes('\\n') ? paragraph(value) : scalarText(value));\n  } else if (Array.isArray(value)) {\n    renderArray(title ?? 'items', value, 2, out);\n  } else if (isRecord(value)) {\n    renderObject(value, 1, out);\n  }\n  return out\n    .join('\\n')\n    .replace(/\\n{3,}/g, '\\n\\n')\n    .trim() + '\\n';\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The processor contract and the four output modes.\n *\n * A scraper returns a {@link RawResponse}; its processor turns that into what\n * a caller asked for:\n *\n *   raw       — the HTTP body, untouched ({@link unwrapRaw})\n *   json      — the *standard object*: everything with any chance of being\n *               useful, MyChart's own field names, markup stripped into\n *               `<field>Text` fields, always-empty and UI-only fields removed\n *   standard  — the standard object rendered as markdown\n *   concise   — a projection of the standard object rendered as markdown\n *\n * `standard` and `json` are one object rendered two ways, and `concise` is a\n * projection of that same object, so a field can never be in one and not the\n * other. The rules every processor follows are in\n * `docs/processor-layer-proposal.md`; the ones that bite:\n *\n *   - A MyChart field is never edited in place or shadowed. A computed value\n *     gets a new name (`body` stays MyChart's, `bodyText` is the derived one).\n *   - Membership in a mode is decided by the field's NAME, never its value.\n *     A field on the list is emitted even when empty, so \"no allergies on\n *     file\" survives.\n *   - Errors pass through: a literal `null` from an unknown id, a scrape\n *     error, a WAF page — the processor returns it as-is in every mode.\n */\n\nimport { unwrapRaw, type RawResponse } from '../core/rawResponse';\nimport { renderMarkdown } from './markdown';\n\nexport type OutputMode = 'raw' | 'standard' | 'concise' | 'json';\n\nexport const OUTPUT_MODES: readonly OutputMode[] = ['raw', 'standard', 'concise', 'json'];\n\n/**\n * What a programmatic caller gets when it says nothing. The library and the\n * CLI want data; the model-facing clients (MCPB, mobile agent) pass `concise`\n * themselves.\n */\nexport const DEFAULT_OUTPUT_MODE: OutputMode = 'json';\n\nexport function isOutputMode(value: unknown): value is OutputMode {\n  return typeof value === 'string' && (OUTPUT_MODES as readonly string[]).includes(value);\n}\n\nexport interface Processor<S = unknown> {\n  /** Build the standard object from the envelope. Pure. */\n  standard(raw: RawResponse): S;\n  /** Project the standard object to the concise field list. Pure. */\n  concise(standard: S): unknown;\n}\n\n/** Identity on both sides: for payloads that are already the designed shape. */\nexport function passthroughProcessor<S>(pick: (raw: RawResponse) => S): Processor<S> {\n  return { standard: pick, concise: (s) => s };\n}\n\n/**\n * Render one capability's envelope in the requested mode.\n *\n * A scraper that returned something that is not the expected shape — the\n * standard object comes back `null` — is passed through in every mode rather\n * than rendered into nothing.\n */\nexport function renderOutput<S>(processor: Processor<S>, raw: RawResponse, mode: OutputMode): unknown {\n  switch (mode) {\n    case 'raw':\n      return unwrapRaw(raw);\n    case 'json':\n      return processor.standard(raw);\n    case 'standard':\n      return renderMarkdown(processor.standard(raw));\n    case 'concise': {\n      const standard = processor.standard(raw);\n      return renderMarkdown(standard === null || standard === undefined ? standard : processor.concise(standard));\n    }\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Client-facing proxy (multi-patient) helpers shared by the Claude Desktop\n * extension and the mobile app.\n *\n * Both clients expose the same two agent tools — `list_proxy_targets` and\n * `switch_proxy_target` — and gate every other data tool behind\n * `assertProxyReadContext`. The semantics deliberately mirror the CLI's\n * conservative stance (see `npm-package/cli/cli.ts`): reads assert which\n * patient they are about and refuse on a mismatch; only an explicit switch\n * changes MyChart's server-side active patient.\n *\n * The error messages name the agent tools (`switch_proxy_target`,\n * `list_proxy_targets`) so a model that hits a refusal knows exactly which\n * call fixes it. Both clients register the tools under those names.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport {\n  checkProxyContext,\n  compareProfileNames,\n  discoverProxyTargets,\n  findProxyTarget,\n  switchProxyTarget,\n  verifyActiveProxyTarget,\n  type ProxyTarget,\n  type ProxyContextCheck,\n} from './proxyContext';\nimport { DetailedError, detailedMessage } from '../../../shared/detailedError';\n\ntype PatientRecordSummary = {\n  /** Opaque organization-specific record id. Never parse or construct one. */\n  id: string;\n  name: string;\n  is_self: boolean;\n  /** null when the portal does not report which record is active. */\n  is_active: boolean | null;\n};\n\nexport type ListProxyTargetsResult = {\n  count: number;\n  patients: PatientRecordSummary[];\n  /** Display name of the record data tools currently read, when known. */\n  active_patient: string | null;\n  /** Name on the profile page right now — independent evidence of the above. */\n  profile_name: string | null;\n  message: string;\n};\n\nexport type SwitchProxyTargetResult = {\n  switched_to: string;\n  is_self: boolean;\n  verified_profile_name: string | null;\n  verified_dob: string | null;\n  message: string;\n};\n\n/**\n * One proxy discovery per session, shared by every guarded call.\n *\n * Keyed on the request object itself: a re-login (keepalive reconnect, process\n * restart restoring cookies from disk) constructs a fresh MyChartRequest, so\n * stale knowledge about the active patient can never outlive the session it\n * was learned from. Storing the promise rather than the result lets a burst of\n * parallel reads (the mobile app fires its 16 memory categories at once) share\n * a single discovery instead of racing 16 of them.\n */\nconst discoveryCache = new WeakMap<MyChartRequest, Promise<ProxyTarget[]>>();\n\nfunction cachedDiscovery(mychartRequest: MyChartRequest): Promise<ProxyTarget[]> {\n  let pending = discoveryCache.get(mychartRequest);\n  if (!pending) {\n    pending = discoverProxyTargets(mychartRequest);\n    discoveryCache.set(mychartRequest, pending);\n    // A failed discovery must not poison the session — drop it so the next\n    // call retries instead of rejecting forever.\n    pending.catch(() => discoveryCache.delete(mychartRequest));\n  }\n  return pending;\n}\n\n/**\n * List every patient record the account can reach and which one is active.\n * Read-only. Also primes the discovery cache for subsequent guarded reads.\n */\nexport async function runListProxyTargets(mychartRequest: MyChartRequest): Promise<ListProxyTargetsResult> {\n  const targets = await discoverProxyTargets(mychartRequest);\n  discoveryCache.set(mychartRequest, Promise.resolve(targets));\n\n  if (targets.length === 0) {\n    return {\n      count: 0,\n      patients: [],\n      active_patient: null,\n      profile_name: null,\n      message:\n        'This account has access to only its own record — there are no family-member (proxy) records to switch between.',\n    };\n  }\n\n  const verified = await verifyActiveProxyTarget(mychartRequest, { proxyTargets: targets });\n\n  // Prefer the portal's own selection flag; where the discovery surface does\n  // not carry one (the script-block fallback), fall back to matching the\n  // profile page against exactly one known record.\n  let active = verified.selectedTarget;\n  if (!active && verified.profileName) {\n    const byName = targets.filter(\n      (target) => compareProfileNames(target.displayName, verified.profileName!) === 'match',\n    );\n    if (byName.length === 1) active = byName[0]!;\n  }\n\n  return {\n    count: targets.length,\n    patients: targets.map((target) => ({\n      id: target.id,\n      name: target.displayName,\n      is_self: target.isSelf,\n      is_active: target.selectionKnown ? target.isSelected : null,\n    })),\n    active_patient: active ? active.displayName : null,\n    profile_name: verified.profileName,\n    message: [\n      active\n        ? `Data tools on this account currently read ${active.displayName}'s record.`\n        : 'This MyChart instance does not report which record is active (is_active: null).',\n      // Some instances list the account holder's own record even when there\n      // is nothing to switch to — a single-entry list is still \"no proxy access\".\n      targets.length === 1\n        ? 'No other patient records are accessible from this account.'\n        : 'To read a different patient, call switch_proxy_target with their name — data tools never switch on their own.',\n    ].join(' '),\n  };\n}\n\n/**\n * Deliberately switch MyChart's server-side active patient. The one mutation\n * in this module; verified against the profile page by the underlying\n * `switchProxyTarget`, so landing on the wrong patient fails instead of\n * silently returning the wrong chart.\n */\nexport async function runSwitchProxyTarget(\n  mychartRequest: MyChartRequest,\n  patient: string,\n): Promise<SwitchProxyTargetResult> {\n  if (!patient?.trim()) {\n    throw new Error(\n      'Pass the patient to switch to — a name from list_proxy_targets, or \"me\" for the account holder\\'s own record.',\n    );\n  }\n\n  const targets = await discoverProxyTargets(mychartRequest);\n  if (targets.length === 0) {\n    throw new Error('This account has access to only its own record — there is nothing to switch.');\n  }\n\n  const wanted = findProxyTarget(targets, patient);\n  const result = await switchProxyTarget(\n    mychartRequest,\n    wanted.isSelf ? { self: true } : { id: wanted.id },\n    { discoveredTargets: targets },\n  );\n\n  // The cached discovery now reports a stale selection — rediscover lazily.\n  discoveryCache.delete(mychartRequest);\n\n  return {\n    switched_to: result.target.displayName,\n    is_self: result.target.isSelf,\n    verified_profile_name: result.verifiedProfileName,\n    verified_dob: result.verifiedDob,\n    message:\n      `Every data tool on this account now reads ${result.target.displayName}'s record` +\n      `${result.target.isSelf ? \" (the account holder's own chart)\" : ''}.` +\n      (result.target.isSelf ? '' : ' Switch back with patient: \"me\" when done.'),\n  };\n}\n\n/**\n * Assert that MyChart is on the patient a read (or write) is about, WITHOUT\n * changing anything.\n *\n * No `patient` means the account holder — explicitly, not \"whoever the session\n * happens to be pointed at\" — because sessions are resumed from cached cookies\n * and would otherwise inherit whichever patient an earlier invocation left\n * behind. On a mismatch this throws with the exact switch_proxy_target call\n * that fixes it; it never switches on its own.\n *\n * Failure handling mirrors the CLI: when a specific patient was asked for,\n * any inability to verify is a refusal; when nobody asked, a discovery or\n * parsing miss must not break an ordinary read that has nothing to do with\n * proxy access (most accounts have none, and two of the three discovery\n * surfaces are inferred rather than captured from a real instance).\n */\nexport async function assertProxyReadContext(\n  mychartRequest: MyChartRequest,\n  patient?: string,\n): Promise<void> {\n  const wantedQuery = patient?.trim() ? patient.trim() : undefined;\n\n  let check: ProxyContextCheck;\n  try {\n    const targets = await cachedDiscovery(mychartRequest);\n    check = await checkProxyContext(mychartRequest, wantedQuery, { discoveredTargets: targets });\n  } catch (err) {\n    if (wantedQuery) {\n      const lead = 'Could not verify which patient record is active: ';\n      throw new DetailedError(lead + (err as Error).message, lead + detailedMessage(err));\n    }\n    return;\n  }\n\n  // Single-record account: no proxy surface, nothing to assert.\n  if (!check.wanted) {\n    if (wantedQuery) {\n      throw new Error(\n        'This account has access to only one patient record, so `patient` cannot be used. ' +\n          \"Omit it to read the account holder's own record.\",\n      );\n    }\n    return;\n  }\n\n  if (check.active) return;\n\n  const current = check.current\n    ? 'another patient record'\n    : 'an unknown patient record (this MyChart instance does not report which record is active)';\n  const fix = check.wanted.isSelf ? 'patient: \"me\"' : 'the same patient this call passed';\n  const currentName = check.current\n    ? `'${check.current.displayName}'`\n    : 'an unknown patient (this MyChart instance does not report which record is active)';\n  throw new DetailedError(\n    `Refusing to read: MyChart is currently on ${current}, not the one this call is about. ` +\n      'The active patient is server-side MyChart state and reading never changes it. ' +\n      `Call switch_proxy_target with ${fix} to switch deliberately, then retry. ` +\n      'list_proxy_targets shows every record this account can access, and which is active.',\n    `Refusing to read: MyChart is currently on ${currentName}, but this call is about ` +\n      `'${check.wanted.displayName}'. The active patient is server-side MyChart state and reading never ` +\n      `changes it. Call switch_proxy_target with patient: ${JSON.stringify(check.wanted.displayName)} to ` +\n      'switch deliberately, then retry. list_proxy_targets shows every record this account can access.',\n  );\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** Coercion of the untyped arguments a client hands a capability. */\n\nimport type { CapabilityArgs } from './types';\n\n/**\n * Read a string argument.\n *\n * Args arrive untyped — a model emits JSON, the CLI parses `--arg name=value` —\n * but the expected type is NOT a mystery: every param is declared in the\n * registry with a `type`, and these accessors are used for the ones declared\n * `'string'`. So this enforces that declaration rather than guessing what the\n * caller meant.\n *\n * A number or boolean converts, because that conversion is lossless and\n * unambiguous, and a model answering `12345` for a `csn` is ordinary. Anything\n * structural (object, array) is a caller error and throws by name: these values\n * become message bodies, refill comments and search terms that go to a\n * patient's provider, and there is no honest rendering of an object as one.\n * `String()` used to send the literal \"[object Object]\"; JSON-stringifying it\n * instead would just be a tidier way to send the wrong thing.\n */\nfunction argString(v: unknown, name: string): string {\n  if (typeof v === 'string') return v;\n  if (typeof v === 'number' || typeof v === 'boolean' || typeof v === 'bigint') return String(v);\n  throw new Error(\n    `Argument \"${name}\" must be a string; received ${Array.isArray(v) ? 'an array' : `a ${typeof v}`}.`,\n  );\n}\n\nfunction str(args: CapabilityArgs, name: string, fallback = ''): string {\n  const v = args[name];\n  if (v === undefined || v === null) return fallback;\n  return argString(v, name);\n}\n\nexport function requireStr(args: CapabilityArgs, name: string): string {\n  const v = str(args, name).trim();\n  if (!v) throw new Error(`Missing required argument \"${name}\".`);\n  return v;\n}\n\nexport function optStr(args: CapabilityArgs, name: string): string | undefined {\n  const v = args[name];\n  if (v === undefined || v === null || v === '') return undefined;\n  return argString(v, name);\n}\n\nexport function num(args: CapabilityArgs, name: string, fallback: number): number {\n  const v = args[name];\n  if (v === undefined || v === null || v === '') return fallback;\n  const n = Number(v);\n  return Number.isFinite(n) ? n : fallback;\n}\n\n/**\n * Read a `'string[]'` argument. A lone string is one item, never split: a\n * path may contain a comma. (The CLI splits `--arg name=a,b` itself.)\n */\nexport function strList(args: CapabilityArgs, name: string): string[] {\n  const v = args[name];\n  if (v === undefined || v === null || v === '') return [];\n  const items = Array.isArray(v) ? v.map((item) => argString(item, name)) : [argString(v, name)];\n  return items.map((item) => item.trim()).filter(Boolean);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The parameters every client offers on top of a capability's own, and the\n * accessors that read them back.\n *\n * Declared once here rather than per-capability: they are identical on every\n * entry, and `executeCapability` — not any `run` — is what applies them.\n */\n\nimport {\n  DEFAULT_OUTPUT_MODE,\n  OUTPUT_MODES,\n  isOutputMode,\n  type OutputMode,\n} from '../../scrapers/myChart/processors/processor';\nimport type { CapabilityArgs, CapabilityParam } from './types';\n\n/**\n * Which connected MyChart account the call is for.\n *\n * This is the one parameter every capability takes in every client, and it was\n * the last one still hand-written per client — the extension called it\n * `account` and required it, the mobile app called it `instance` and didn't.\n * That is precisely the drift this registry exists to kill, so it is declared\n * here and the parity test checks for it like any other parameter.\n *\n * `instance` stays an accepted alias: the mobile app's alerts generator and\n * alert cards pass it programmatically, and a saved chat may contain it.\n */\nexport const ACCOUNT_PARAM: CapabilityParam = {\n  name: 'account',\n  type: 'string',\n  description:\n    'MyChart hostname identifying which connected account to use — the `account` value from the ' +\n    'client\\'s account list. Optional when only one account is connected.',\n};\n\n/** Accepted spellings of {@link ACCOUNT_PARAM}, newest first. */\nexport const ACCOUNT_PARAM_NAMES: readonly string[] = [ACCOUNT_PARAM.name, 'instance'];\n\n/** Read the account selector out of a client's arguments, whichever name it used. */\nexport function readAccountArg(args: CapabilityArgs): string | undefined {\n  for (const name of ACCOUNT_PARAM_NAMES) {\n    const value = args[name];\n    if (typeof value === 'string' && value.trim()) return value.trim();\n  }\n  return undefined;\n}\n\n\n/**\n * The output mode a caller asked for, defaulting to {@link DEFAULT_OUTPUT_MODE}.\n * An unknown value is an error rather than a silent fallback: a caller that\n * typed `mode: 'summary'` and got JSON back would not know it was ignored.\n */\nexport function readOutputMode(args: CapabilityArgs): OutputMode {\n  const value = args[MODE_PARAM.name];\n  if (value === undefined || value === null || value === '') return DEFAULT_OUTPUT_MODE;\n  if (isOutputMode(value)) return value;\n  throw new Error(`Unknown mode ${JSON.stringify(value)}. Expected one of: ${OUTPUT_MODES.join(', ')}.`);\n}\n\n/**\n * How a read capability's payload is rendered. Declared once, like\n * {@link PATIENT_PARAM}: every client offers it on every capability that\n * {@link acceptsModeParam}, and {@link executeCapability} applies it.\n */\nexport const MODE_PARAM: CapabilityParam = {\n  name: 'mode',\n  type: 'string',\n  description:\n    'Output mode: `concise` (markdown, the interesting fields), `standard` (markdown, every ' +\n    'useful field), `json` (the standard fields as JSON), or `raw` (the untouched MyChart ' +\n    'response, large).',\n};\n\n/**\n * What a model-facing client passes when the model said nothing. The MCPB and\n * the mobile agent hand the payload straight to a context window, and a 200 KB\n * visits payload is what started the processor layer; `concise` is the right\n * default there, and the model can still ask for any other mode by name.\n * Programmatic callers (the library, the CLI) get {@link DEFAULT_OUTPUT_MODE}.\n */\nexport const MODEL_FACING_OUTPUT_MODE: OutputMode = 'concise';\n\n/** {@link MODE_PARAM} with the client's default stated, for tool descriptions. */\nexport function describeModeParam(defaultMode: OutputMode): string {\n  return `${MODE_PARAM.description} Default: ${defaultMode}.`;\n}\n\n/**\n * The patient parameter every chart-touching capability accepts on top of its\n * own. Not declared per-capability — it is the same on all of them, and the\n * assertion is applied by {@link executeCapability} rather than by any `run`.\n */\nexport const PATIENT_PARAM: CapabilityParam = {\n  name: 'patient',\n  type: 'string',\n  description:\n    \"Which patient's record this call is about, for accounts with MyChart proxy access to family \" +\n    \"members' charts — a name from list_proxy_targets. Omit for the account holder's own record. \" +\n    'If MyChart is currently on a different patient the call fails (with instructions) rather than ' +\n    'switching silently.',\n};\n\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Capabilities that need no MyChart account at all.\n *\n * Two questions, asked by every client before it dispatches, and by the parity\n * test that checks they all ask them. They live in their own module rather\n * than in `index.ts` so `registry/` and `params.ts` can import them without\n * importing the registry that imports `registry/`.\n */\n\nimport type { Capability } from './types';\n\n/**\n * Whether this capability runs with no MyChart account.\n *\n * A public capability takes no `account` parameter, needs no session, and must\n * not be run once per connected account the way every other capability is.\n */\nexport function isPublicCapability(capability: Capability): boolean {\n  return capability.kind === 'public';\n}\n\n/**\n * Whether this capability takes `ACCOUNT_PARAM`.\n *\n * Every capability that touches MyChart does; the `public` ones do not, and\n * offering it on them would be worse than noise — a model told a tool takes an\n * `account` will ask a person to connect one before it will look up an NPI.\n */\nexport function acceptsAccountParam(capability: Capability): boolean {\n  return !isPublicCapability(capability);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Health summary processor. Field decisions: docs/processor-layer-proposal.md, `get_health_summary`.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, textOrNull } from '../../processors/read';\nimport type { FetchH2GHeader, FetchHealthSummary, LastVisit } from './mychart.types';\nimport type { HealthSummaryStandard, MeasurementStandard, VisitPointerStandard } from './standardized.types';\n\nexport type { HealthSummaryStandard, MeasurementStandard, VisitPointerStandard } from './standardized.types';\n\nfunction measurement(value: unknown): MeasurementStandard {\n  const m = rec(value);\n  return { value: textOrNull(m.value), dateRecorded: textOrNull(m.dateRecorded) };\n}\n\nfunction visitPointer(value: unknown): VisitPointerStandard {\n  const v = rec<LastVisit>(value);\n  return { date: textOrNull(v.date), visitType: textOrNull(v.visitType) };\n}\n\nexport const healthSummaryProcessor: Processor<HealthSummaryStandard> = {\n  standard(raw: RawResponse): HealthSummaryStandard {\n    const summary = rec<FetchHealthSummary>(bodyOf(raw, 'FetchHealthSummary'));\n    const h2g = rec<FetchH2GHeader>(bodyOf(raw, 'FetchH2GHeader'));\n    const header = rec(summary.header);\n    return {\n      header: {\n        patientAge: textOrNull(header.patientAge),\n        bloodType: textOrNull(header.bloodType),\n        height: measurement(header.height),\n        weight: measurement(header.weight),\n      },\n      patientFirstName: textOrNull(summary.patientFirstName),\n      isPatientAdmitted: boolOrNull(summary.isPatientAdmitted),\n      conditionList: list(summary.conditionList),\n      journeyList: list(summary.journeyList),\n      actionPlans: list(summary.actionPlans),\n      lastVisit: visitPointer(h2g.lastVisit),\n      nextVisit: visitPointer(h2g.nextVisit),\n    };\n  },\n  concise(standard) {\n    return {\n      header: standard.header,\n      isPatientAdmitted: standard.isPatientAdmitted,\n      lastVisit: standard.lastVisit,\n      nextVisit: standard.nextVisit,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { healthSummaryProcessor, type HealthSummaryStandard } from './healthSummary.processor';\n\nexport type { HealthSummaryStandard, MeasurementStandard, VisitPointerStandard } from './healthSummary.processor';\nexport { healthSummaryProcessor } from './healthSummary.processor';\n\n/**\n * `GET /app/health-summary` for the token, then\n * `POST /api/health-summary/FetchHealthSummary` and `POST /api/health-summary/FetchH2GHeader`.\n */\nexport async function fetchHealthSummaryRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/health-summary');\n  await Promise.all([\n    collector.postJson('/api/health-summary/FetchHealthSummary', token, {}),\n    collector.postJson('/api/health-summary/FetchH2GHeader', token, {}),\n  ]);\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getHealthSummary(mychartRequest: MyChartRequest): Promise<HealthSummaryStandard> {\n  return healthSummaryProcessor.standard(await fetchHealthSummaryRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Medications processor. Field decisions: docs/processor-layer-proposal.md, `get_medications`.\n *\n * `LoadMedicationsPage` nests prescriptions under\n * `communityMembers[].prescriptionList.prescriptions[]` and repeats a ~20-field\n * organization object three times per row. Prescriptions are flattened into\n * one list with `organizationName` lifted onto each; the per-list pharmacy\n * work (pickups, deliveries, refills due) is kept per organization under\n * `prescriptionLists`.\n *\n * `medicationKey` is NOT a MyChart field — the captured skeleton has `id` —\n * so only `id` is surfaced (docs/processor-layer-todo.md §2).\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, strings, textOrNull } from '../../processors/read';\nimport type { CostDetail, LoadMedicationsPage } from './mychart.types';\nimport type { CostDetailsStandard, MedicationsStandard, PrescriptionListStandard, PrescriptionStandard, RefillDetailsStandard } from './standardized.types';\n\nexport type { CostDetailsStandard, LastDispenseStandard, MedicationsStandard, OwningPharmacyStandard, PrescriptionListStandard, PrescriptionStandard, RefillDetailsStandard } from './standardized.types';\n\nfunction costDetails(value: unknown): CostDetailsStandard {\n  const c = rec<CostDetail>(value);\n  return { formattedCopay: textOrNull(c.formattedCopay), copay: num(c.copay), isCopayPending: boolOrNull(c.isCopayPending) };\n}\n\nfunction refillDetails(value: unknown): RefillDetailsStandard | null {\n  if (value === null || value === undefined) return null;\n  const r = rec(value);\n  const last = rec(r.lastDispense);\n  const delivery = rec(last.delivery);\n  const pharmacy = rec(r.owningPharmacy);\n  return {\n    isRefillable: boolOrNull(r.isRefillable),\n    refillsRemaining: textOrNull(r.refillsRemaining),\n    hasRefillsRemaining: boolOrNull(r.hasRefillsRemaining),\n    refillStatus: num(r.refillStatus),\n    refillExpirationDate: textOrNull(r.refillExpirationDate),\n    refillWarningCode: textOrNull(r.refillWarningCode),\n    scheduledFillDate: textOrNull(r.scheduledFillDate),\n    externalFillRequestDate: textOrNull(r.externalFillRequestDate),\n    nextDispenseDate: textOrNull(r.nextDispenseDate),\n    writtenDispenseQuantity: textOrNull(r.writtenDispenseQuantity),\n    writtenDispenseUnit: textOrNull(r.writtenDispenseUnit),\n    writtenDispenseAmount: textOrNull(r.writtenDispenseAmount),\n    daySupply: textOrNull(r.daySupply),\n    lastDispense: {\n      dispenseQuantity: textOrNull(last.dispenseQuantity),\n      dispenseUnit: textOrNull(last.dispenseUnit),\n      dispenseAmount: textOrNull(last.dispenseAmount),\n      dispenseDate: textOrNull(last.dispenseDate),\n      isRxReady: boolOrNull(last.isRxReady),\n      dispenseType: num(last.dispenseType),\n      costDetails: costDetails(last.costDetails),\n      delivery: {\n        formattedShipDate: textOrNull(delivery.formattedShipDate),\n        formattedAddress: strings(delivery.formattedAddress),\n        shipmentTrackingInfo: list(delivery.shipmentTrackingInfo),\n      },\n    },\n    costDetails: costDetails(r.costDetails),\n    owningPharmacy: {\n      name: textOrNull(pharmacy.name),\n      phoneNumber: textOrNull(pharmacy.phoneNumber),\n      formattedAddress: strings(pharmacy.formattedAddress),\n      hours: list(pharmacy.hours),\n      isPreferred: boolOrNull(pharmacy.isPreferred),\n    },\n  };\n}\n\nfunction prescription(value: unknown, organizationName: string | null): PrescriptionStandard {\n  const p = rec(value);\n  const friendly = rec(p.patientFriendlyName);\n  return {\n    id: textOrNull(p.id),\n    name: textOrNull(p.name),\n    patientFriendlyName: {\n      text: textOrNull(friendly.text),\n      caption: textOrNull(friendly.caption),\n      captionType: textOrNull(friendly.captionType),\n    },\n    sig: textOrNull(p.sig),\n    sigTranslationFromOrder: textOrNull(p.sigTranslationFromOrder),\n    dateToDisplay: textOrNull(p.dateToDisplay),\n    dateDisplayKey: textOrNull(p.dateDisplayKey),\n    formattedDateNoted: textOrNull(p.formattedDateNoted),\n    startDate: textOrNull(p.startDate),\n    lastUpdateInstant: textOrNull(p.lastUpdateInstant),\n    hasFutureStartDate: boolOrNull(p.hasFutureStartDate),\n    prescriptionNumber: textOrNull(p.prescriptionNumber),\n    authorizingProvider: { name: textOrNull(rec(p.authorizingProvider).name) },\n    orderingProvider: { name: textOrNull(rec(p.orderingProvider).name) },\n    isPatientReported: boolOrNull(p.isPatientReported),\n    isClinicReported: boolOrNull(p.isClinicReported),\n    isPendingUpdate: boolOrNull(p.isPendingUpdate),\n    pendingUpdateType: num(p.pendingUpdateType),\n    isAnticoagulationMed: boolOrNull(p.isAnticoagulationMed),\n    isFrequencyPRN: boolOrNull(p.isFrequencyPRN),\n    criticalMedMessage: textOrNull(p.criticalMedMessage),\n    classList: strings(p.classList),\n    varianceComment: textOrNull(p.varianceComment),\n    previousTakingDiffSig: textOrNull(p.previousTakingDiffSig),\n    previousTakingDiffSigInstant: textOrNull(p.previousTakingDiffSigInstant),\n    previousTakingDiffSigCSN: textOrNull(p.previousTakingDiffSigCSN),\n    refillDetails: refillDetails(p.refillDetails),\n    organizationName,\n  };\n}\n\nexport const medicationsProcessor: Processor<MedicationsStandard> = {\n  standard(raw: RawResponse): MedicationsStandard {\n    const body = rec<LoadMedicationsPage>(bodyOf(raw, 'LoadMedicationsPage'));\n    const prescriptions: PrescriptionStandard[] = [];\n    const prescriptionLists: PrescriptionListStandard[] = [];\n    for (const member of list(body.communityMembers)) {\n      const m = rec(member);\n      const organizationName = textOrNull(rec(m.organization).organizationName);\n      const pl = rec(m.prescriptionList);\n      for (const rx of list(pl.prescriptions)) prescriptions.push(prescription(rx, organizationName));\n      prescriptionLists.push({\n        organizationName,\n        numRefillsDueSoon: num(pl.numRefillsDueSoon),\n        previousTakingValuesDate: textOrNull(pl.previousTakingValuesDate),\n        pickups: list(pl.pickups),\n        deliveries: list(pl.deliveries),\n        inProgressWorkRequests: list(pl.inProgressWorkRequests),\n      });\n    }\n    return { getPatientFirstName: textOrNull(body.getPatientFirstName), prescriptions, prescriptionLists };\n  },\n  concise(standard) {\n    return {\n      prescriptions: standard.prescriptions.map((p) => ({\n        id: p.id,\n        name: p.name,\n        patientFriendlyName: p.patientFriendlyName.text,\n        sig: p.sig,\n        dateToDisplay: p.dateToDisplay,\n        dateDisplayKey: p.dateDisplayKey,\n        authorizingProvider: p.authorizingProvider.name,\n        isPatientReported: p.isPatientReported,\n        isRefillable: p.refillDetails?.isRefillable ?? null,\n        refillsRemaining: p.refillDetails?.refillsRemaining ?? null,\n        hasRefillsRemaining: p.refillDetails?.hasRefillsRemaining ?? null,\n        owningPharmacy: p.refillDetails?.owningPharmacy.name ?? null,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { medicationsProcessor, type MedicationsStandard } from './medications.processor';\n\nexport type {\n  MedicationsStandard,\n  PrescriptionStandard,\n  PrescriptionListStandard,\n  RefillDetailsStandard,\n  OwningPharmacyStandard,\n  LastDispenseStandard,\n  CostDetailsStandard,\n} from './medications.processor';\nexport { medicationsProcessor } from './medications.processor';\n\n/** `GET /Clinical/Medications` for the token, then `POST /api/medications/LoadMedicationsPage`. */\nexport async function fetchMedicationsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Clinical/Medications');\n  await collector.postJson('/api/medications/LoadMedicationsPage', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getMedications(mychartRequest: MyChartRequest): Promise<MedicationsStandard> {\n  return medicationsProcessor.standard(await fetchMedicationsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Allergies processor. Field decisions: docs/processor-layer-proposal.md, `get_allergies`.\n *\n * The captured account had no allergies, so the `dataList` element shape is\n * unverified and passed through whole (rule 10). An empty list is emitted in\n * every mode: \"no allergies on file\" is the answer most readers want.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, num, rec, textOrNull } from '../../processors/read';\nimport type { LoadAllergies } from './mychart.types';\nimport type { AllergiesStandard } from './standardized.types';\n\nexport type { AllergiesStandard } from './standardized.types';\n\nexport const allergiesProcessor: Processor<AllergiesStandard> = {\n  standard(raw: RawResponse): AllergiesStandard {\n    const body = rec<LoadAllergies>(bodyOf(raw, 'LoadAllergies'));\n    return {\n      dataList: list(body.dataList),\n      allergiesStatus: num(body.allergiesStatus),\n      dateOfBirth: textOrNull(body.dateOfBirth),\n    };\n  },\n  concise(standard) {\n    return { dataList: standard.dataList, allergiesStatus: standard.allergiesStatus };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { allergiesProcessor, type AllergiesStandard } from './allergies.processor';\n\nexport type { AllergiesStandard } from './allergies.processor';\nexport { allergiesProcessor } from './allergies.processor';\n\n/** `GET /Clinical/Allergies` for the token, then `POST /api/allergies/LoadAllergies`. */\nexport async function fetchAllergiesRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Clinical/Allergies');\n  await collector.postJson('/api/allergies/LoadAllergies', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getAllergies(mychartRequest: MyChartRequest): Promise<AllergiesStandard> {\n  return allergiesProcessor.standard(await fetchAllergiesRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Health issues processor. Field decisions: docs/processor-layer-proposal.md, `get_health_issues`.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, textOrNull } from '../../processors/read';\nimport type { LoadHealthIssuesData } from './mychart.types';\nimport type { HealthIssuesStandard } from './standardized.types';\n\nexport type { HealthIssueStandard, HealthIssuesStandard } from './standardized.types';\n\nexport const healthIssuesProcessor: Processor<HealthIssuesStandard> = {\n  standard(raw: RawResponse): HealthIssuesStandard {\n    const body = rec<LoadHealthIssuesData>(bodyOf(raw, 'LoadHealthIssuesData'));\n    return {\n      dataList: list(body.dataList).map((entry) => {\n        const e = rec(entry);\n        const item = rec(e.healthIssueItem);\n        return {\n          healthIssueItem: {\n            name: textOrNull(item.name),\n            formattedDateNoted: textOrNull(item.formattedDateNoted),\n            id: textOrNull(item.id),\n            isReadOnly: boolOrNull(item.isReadOnly),\n          },\n          externalItems: list(e.externalItems),\n          externalOrgs: list(e.externalOrgs),\n          hasLocalInstance: boolOrNull(e.hasLocalInstance),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    return {\n      dataList: standard.dataList.map((d) => ({\n        name: d.healthIssueItem.name,\n        formattedDateNoted: d.healthIssueItem.formattedDateNoted,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { healthIssuesProcessor, type HealthIssuesStandard } from './healthIssues.processor';\n\nexport type { HealthIssuesStandard, HealthIssueStandard } from './healthIssues.processor';\nexport { healthIssuesProcessor } from './healthIssues.processor';\n\n/** `GET /Clinical/HealthIssues` for the token, then `POST /api/HealthIssues/LoadHealthIssuesData`. */\nexport async function fetchHealthIssuesRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Clinical/HealthIssues');\n  await collector.postJson('/api/HealthIssues/LoadHealthIssuesData', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getHealthIssues(mychartRequest: MyChartRequest): Promise<HealthIssuesStandard> {\n  return healthIssuesProcessor.standard(await fetchHealthIssuesRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Vitals processor. Field decisions: docs/processor-layer-proposal.md, `get_vitals`.\n *\n * MyChart splits Track My Health across two endpoints: `GetFlowsheets` (the\n * episodes and their row metadata, no values) and `GetFlowsheetReadings`\n * (the readings, paged backwards). The scraper records every page; this joins\n * them back into one flowsheet per episode, de-duplicating the boundary\n * instant that consecutive pages both carry.\n */\n\nimport { findRequest, findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, strings, text, textOrNull } from '../../processors/read';\nimport type { GetFlowsheetReadings, GetFlowsheets } from './mychart.types';\nimport type { FlowsheetRowStandard, FlowsheetStandard, VitalReadingStandard, VitalsStandard } from './standardized.types';\n\nexport type { FlowsheetRowGroupStandard, FlowsheetRowStandard, FlowsheetStandard, VitalReadingStandard, VitalsStandard } from './standardized.types';\n\n/** At most one decimal, no trailing zero: 155.6 stays, 150.0 becomes 150. */\nfunction oneDecimal(n: number): string {\n  return String(Number(n.toFixed(1)));\n}\n\n/**\n * `numericValue` is in Epic's base unit — weight in OUNCES, height in INCHES,\n * temperature in °F — while `unitsDisplayName` names the unit the MyChart UI\n * shows. Verified on a real instance: a 150 lb weight arrives as 2400 beside\n * `lbs`, a 5' 10\" height as 70 beside `ft` (README). Convert into the display\n * unit. Any other unit — including `kg` / `cm`, which no captured instance has\n * sent — passes the number through untouched rather than modelling a guess.\n */\nexport function displayValue(n: number, unitsDisplayName: string | null | undefined): string {\n  switch ((unitsDisplayName ?? '').trim().toLowerCase()) {\n    case 'lbs':\n    case 'lb':\n      return oneDecimal(n / 16);\n    case 'ft': {\n      // Round the total first so 71.96 in is 6' 0\", not 5' 12\".\n      const total = Number(n.toFixed(1));\n      const feet = Math.floor(total / 12);\n      return `${feet}' ${oneDecimal(total - feet * 12)}\"`;\n    }\n    default:\n      return String(n);\n  }\n}\n\n/**\n * MyChart sends BOTH value fields on every reading: string rows (Blood\n * Pressure, \"145/95\") carry `stringValue`, while numeric rows (Pulse, Weight)\n * carry the number in `numericValue` and still include `stringValue` as an\n * EMPTY string. Take the first field that actually holds something, and put a\n * number into the row's display unit.\n */\nexport function readingValue(reading: Record<string, unknown>, unitsDisplayName?: string | null): string {\n  const s = text(reading.stringValue).trim();\n  if (s) return s;\n  const n = num(reading.numericValue);\n  return n === null ? '' : displayValue(n, unitsDisplayName);\n}\n\nfunction row(value: unknown): FlowsheetRowStandard {\n  const r = rec(value);\n  return {\n    id: textOrNull(r.id),\n    name: textOrNull(r.name),\n    unitsDisplayName: textOrNull(r.unitsDisplayName),\n    rowType: textOrNull(r.rowType),\n    valueType: textOrNull(r.valueType),\n    decimalPlaces: num(r.decimalPlaces),\n  };\n}\n\nfunction readingStandard(value: unknown, unitsDisplayName: string | null | undefined): VitalReadingStandard {\n  const r = rec(value);\n  return {\n    rowId: textOrNull(r.rowId),\n    instantTakenIso: textOrNull(r.instantTakenIso),\n    timeZone: textOrNull(r.timeZone),\n    stringValue: textOrNull(r.stringValue),\n    numericValue: num(r.numericValue),\n    value: readingValue(r, unitsDisplayName),\n    isAbnormal: boolOrNull(r.isAbnormal),\n    entryType: textOrNull(r.entryType),\n    documentationSource: textOrNull(r.documentationSource),\n  };\n}\n\nexport const vitalsProcessor: Processor<VitalsStandard> = {\n  standard(raw: RawResponse): VitalsStandard {\n    const listBody = rec<GetFlowsheets>(findRequest(raw, 'GetFlowsheets')?.body);\n    const pages = findRequests(raw, 'GetFlowsheetReadings');\n    const flowsheets: FlowsheetStandard[] = [];\n\n    for (const fs of list(listBody.flowsheets)) {\n      const definition = rec(fs);\n      const episodeId = text(definition.episodeId);\n      const ownPages = pages.filter((p) => text(rec(p.requestBody).episodeId) === episodeId);\n\n      // Row metadata from the definition, backfilled from the readings pages\n      // when GetFlowsheets omitted it.\n      const rows = new Map<string, FlowsheetRowStandard>();\n      const addRows = (source: unknown) => {\n        for (const r of list(source)) {\n          const parsed = row(r);\n          if (parsed.id && !rows.has(parsed.id)) rows.set(parsed.id, parsed);\n        }\n      };\n      addRows(definition.rows);\n      for (const page of ownPages) addRows(rec(rec<GetFlowsheetReadings>(page.body).flowsheet).rows);\n\n      const seen = new Set<string>();\n      const readings: VitalReadingStandard[] = [];\n      for (const page of ownPages) {\n        for (const r of list(rec(rec<GetFlowsheetReadings>(page.body).flowsheet).readings)) {\n          const parsed = readingStandard(r, rows.get(text(rec(r).rowId))?.unitsDisplayName);\n          const key = `${parsed.rowId ?? ''}\\u0000${parsed.instantTakenIso ?? ''}`;\n          if (seen.has(key)) continue;\n          seen.add(key);\n          readings.push(parsed);\n        }\n      }\n\n      flowsheets.push({\n        name: textOrNull(definition.name),\n        status: textOrNull(definition.status),\n        startDateIso: textOrNull(definition.startDateIso),\n        endDateIso: textOrNull(definition.endDateIso),\n        instructions: textOrNull(definition.instructions),\n        rows: [...rows.values()],\n        rowGroups: list(definition.rowGroups).map((g) => ({\n          id: textOrNull(rec(g).id),\n          name: textOrNull(rec(g).name),\n          rowIds: strings(rec(g).rowIds),\n        })),\n        readings,\n      });\n    }\n    return { flowsheets };\n  },\n\n  /** Per vital type: name, units, the latest reading, the count, and every abnormal reading. */\n  concise(standard) {\n    return {\n      flowsheets: standard.flowsheets.map((fs) => ({\n        name: fs.name,\n        rows: fs.rows.map((r) => {\n          const own = fs.readings\n            .filter((reading) => reading.rowId === r.id)\n            .sort((a, b) => (a.instantTakenIso ?? '').localeCompare(b.instantTakenIso ?? ''));\n          const latest = own[own.length - 1];\n          return {\n            name: r.name,\n            unitsDisplayName: r.unitsDisplayName,\n            readingCount: own.length,\n            latestReading: latest ? { instantTakenIso: latest.instantTakenIso, value: latest.value, isAbnormal: latest.isAbnormal } : null,\n            abnormalReadings: own\n              .filter((reading) => reading.isAbnormal === true)\n              .map((reading) => ({ instantTakenIso: reading.instantTakenIso, value: reading.value })),\n          };\n        }),\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { logger } from '../../../../shared/logger';\nimport { list, rec, text } from '../../processors/read';\nimport type { GetFlowsheetReadings, GetFlowsheets } from './mychart.types';\nimport { vitalsProcessor, type VitalsStandard } from './vitals.processor';\n\nexport type {\n  VitalsStandard,\n  FlowsheetStandard,\n  FlowsheetRowStandard,\n  FlowsheetRowGroupStandard,\n  VitalReadingStandard,\n} from './vitals.processor';\nexport { vitalsProcessor, readingValue, displayValue } from './vitals.processor';\n\n/** End-of-day tomorrow, formatted as MyChart expects (no timezone suffix). */\nfunction defaultEndInstantIso(): string {\n  const d = new Date();\n  d.setDate(d.getDate() + 1);\n  const p = (n: number) => String(n).padStart(2, '0');\n  return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}T23:59:59`;\n}\n\n// NOTE: numReadings caps distinct reading INSTANTS (flowsheet columns), not\n// individual readings. At 200 this silently truncated history to the most recent\n// 200 instants — ~693 readings across 7 vital types, which looked like plenty and\n// hid the cap for months.\nconst PAGE_SIZE = 1000;\nconst MAX_PAGES = 100; // safety bound for accounts with long histories\n\n/**\n * Track My Health vitals (Blood Pressure, Weight, Pulse, etc.).\n *\n * MyChart splits this across TWO endpoints:\n *   1. GetFlowsheets        → flowsheet definitions (episodeId + row metadata; NO values)\n *   2. GetFlowsheetReadings → the actual readings for an episode, paginated\n *\n * Every page is recorded; the processor joins them back into one flowsheet\n * per episode.\n */\nexport async function fetchVitalsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/track-my-health');\n\n  const listBody = rec<GetFlowsheets>(await collector.postJson('/api/track-my-health/GetFlowsheets', token, { organizationId: '' }));\n\n  for (const fs of list(listBody.flowsheets)) {\n    const episodeId = text(rec(fs).episodeId);\n    if (!episodeId) continue;\n\n    let endInstantIso = defaultEndInstantIso();\n    for (let page = 0; page < MAX_PAGES; page++) {\n      const body = rec<GetFlowsheetReadings>(\n        await collector.postJson('/api/track-my-health/GetFlowsheetReadings', token, {\n          episodeId,\n          endInstantIso,\n          numReadings: PAGE_SIZE,\n        }),\n      );\n      const data = rec(body.flowsheet);\n      if (Object.keys(data).length === 0) break;\n\n      let oldestInstant: string | undefined;\n      for (const r of list(data.readings)) {\n        const instant = text(rec(r).instantTakenIso);\n        if (instant && (oldestInstant === undefined || instant < oldestInstant)) oldestInstant = instant;\n      }\n\n      // Deliberately NOT keyed off hasMoreData: MyChart reports it false while\n      // older readings still exist, which is what capped history at one page.\n      // Walk back from the oldest instant this page returned and stop only when\n      // a request fails to reach any further back.\n      if (!oldestInstant || oldestInstant >= endInstantIso) break;\n      endInstantIso = oldestInstant;\n    }\n  }\n\n  logger.debug(`vitals: ${collector.requests.length} requests recorded`);\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getVitals(mychartRequest: MyChartRequest): Promise<VitalsStandard> {\n  return vitalsProcessor.standard(await fetchVitalsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Immunizations processor. Field decisions: docs/processor-layer-proposal.md, `get_immunizations`.\n *\n * The per-organization nesting is flattened; the organization survives as\n * `organizationName` on each row (the rest of the organization object is the\n * org blob, dropped).\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, rec, strings, textOrNull } from '../../processors/read';\nimport type { LoadImmunizations } from './mychart.types';\nimport type { ImmunizationStandard, ImmunizationsStandard } from './standardized.types';\n\nexport type { ImmunizationStandard, ImmunizationsStandard } from './standardized.types';\n\nexport const immunizationsProcessor: Processor<ImmunizationsStandard> = {\n  standard(raw: RawResponse): ImmunizationsStandard {\n    const body = rec<LoadImmunizations>(bodyOf(raw, 'LoadImmunizations'));\n    const immunizations: ImmunizationStandard[] = [];\n    for (const group of list(body.organizationImmunizationList)) {\n      const g = rec(group);\n      const organizationName = textOrNull(rec(g.organization).organizationName);\n      for (const imm of list(g.orgImmunizations)) {\n        const i = rec(imm);\n        immunizations.push({\n          name: textOrNull(i.name),\n          formattedAdministeredDates: strings(i.formattedAdministeredDates),\n          id: textOrNull(i.id),\n          organizationName,\n        });\n      }\n    }\n    return { immunizations };\n  },\n  concise(standard) {\n    return {\n      immunizations: standard.immunizations.map((i) => ({\n        name: i.name,\n        formattedAdministeredDates: i.formattedAdministeredDates,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { immunizationsProcessor, type ImmunizationsStandard } from './immunizations.processor';\n\nexport type { ImmunizationsStandard, ImmunizationStandard } from './immunizations.processor';\nexport { immunizationsProcessor } from './immunizations.processor';\n\n/** `GET /Clinical/Immunizations` for the token, then `POST /api/immunizations/LoadImmunizations`. */\nexport async function fetchImmunizationsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Clinical/Immunizations');\n  await collector.postJson('/api/immunizations/LoadImmunizations', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getImmunizations(mychartRequest: MyChartRequest): Promise<ImmunizationsStandard> {\n  return immunizationsProcessor.standard(await fetchImmunizationsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Preventive care processor. Field decisions: docs/processor-layer-proposal.md, `get_preventive_care`.\n *\n * The payload is `POST /HealthAdvisories/GetTopics`, whose envelope is\n * `{ HealthAdvisoryViewModelList, HealthAdvisorySettings }` — captured live on\n * one instance (`/MyChart-PRD`, 13 topics). Topics pass through whole under a\n * derived `dueStatus`, rather than through a fixed field list: one instance is\n * not enough evidence to fix that list, and a list built from one capture\n * silently drops whatever a second Epic release adds.\n *\n * **`HealthAdvisoryViewModelList` absent is not \"no screenings due\".** The\n * controller reads a non-empty `Text` as the error surface and a null list as\n * \"none\" (`healthadvisoriescontroller.min.js`), so a null or empty list is a\n * real answer and anything else — a failed request, an error `Text`, an\n * envelope without the key — is named in `unavailable` instead. That\n * distinction is the whole bug this file was rewritten for: `/HealthAdvisories`\n * is a client-rendered shell (zero `<table>` elements in 111KB of page), and\n * parsing it for a table returned `items: []` for a chart that has 13\n * advisories.\n *\n * There is deliberately no HTML parser here any more. One existed, for \"an\n * instance that still renders the table server-side\" — but no such instance has\n * ever been seen, so it could only ever produce items from a page shape nobody\n * has captured, which is the same class of answer this file exists to stop\n * making. `unavailable` is the honest answer when the endpoint does not answer.\n * The day a server-rendered instance turns up, its capture says what to write.\n */\n\nimport { answered, findRequest, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, rec, text } from '../../processors/read';\nimport type { HealthAdvisoriesGetTopics } from './mychart.types';\nimport type { PreventiveCareStandard, PreventiveCareStatus } from './standardized.types';\n\nexport type { PreventiveCareItemStandard, PreventiveCareStandard, PreventiveCareStatus } from './standardized.types';\n\nexport const ADVISORIES_PAGE_PATH = '/HealthAdvisories';\nexport const GET_TOPICS_PATH = '/HealthAdvisories/GetTopics';\n\nconst STATUS_BY_CODE: Record<string, PreventiveCareStatus> = {\n  '100_OVERDUE': 'overdue',\n  '200_DUE': 'due',\n  '300_DUESOON': 'due_soon',\n  '400_POSTPONED': 'postponed',\n  '500_NOTDUE': 'not_due',\n  '600_ADDRESSED': 'addressed',\n  '700_SATISFIED': 'satisfied',\n  '800_AGED_OUT': 'aged_out',\n  '900_EXCLUDED': 'excluded',\n};\n\n/** `StatusCode` → {@link PreventiveCareStatus}. Epic's custom `<code>^<text>` form has no known meaning. */\nexport function statusFromCode(code: unknown): PreventiveCareStatus {\n  return STATUS_BY_CODE[text(code).trim().toUpperCase()] ?? 'unknown';\n}\n\n/** Concise keeps the screening, where it stands and the two dates that say why. */\nconst CONCISE_FIELDS = ['Name', 'dueStatus', 'Status', 'FormattedDueDate', 'FormattedLastDoneDate'] as const;\n\nexport const preventiveCareProcessor: Processor<PreventiveCareStandard> = {\n  standard(raw: RawResponse): PreventiveCareStandard {\n    const topics = findRequest(raw, GET_TOPICS_PATH);\n    const envelope = answered(topics) ? rec<HealthAdvisoriesGetTopics>(topics.body) : {};\n\n    // The controller's own test for the error surface: a non-empty `Text`.\n    // A successful response carries no `Text` key at all, so no capture has it\n    // and it is read off the untyped body.\n    const known =\n      answered(topics) && text(rec(topics.body).Text).length === 0 && 'HealthAdvisoryViewModelList' in envelope;\n\n    if (!known) return { items: [], settings: {}, unavailable: [GET_TOPICS_PATH] };\n\n    return {\n      items: list(envelope.HealthAdvisoryViewModelList).map((topic) => {\n        const t = rec(topic);\n        return { ...t, dueStatus: statusFromCode(t.StatusCode) };\n      }),\n      settings: rec(envelope.HealthAdvisorySettings),\n      unavailable: [],\n    };\n  },\n\n  concise(standard) {\n    return {\n      items: standard.items.map((item) =>\n        Object.fromEntries(CONCISE_FIELDS.map((field) => [field, item[field] ?? ''])),\n      ),\n      unavailable: standard.unavailable,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport {\n  ADVISORIES_PAGE_PATH,\n  GET_TOPICS_PATH,\n  preventiveCareProcessor,\n  type PreventiveCareStandard,\n} from './preventiveCare.processor';\n\nexport type { PreventiveCareStandard, PreventiveCareItemStandard, PreventiveCareStatus } from './preventiveCare.processor';\nexport {\n  preventiveCareProcessor,\n  statusFromCode,\n  GET_TOPICS_PATH,\n} from './preventiveCare.processor';\n\n/**\n * `GET /HealthAdvisories` for the token, then `POST /HealthAdvisories/GetTopics`.\n *\n * The page used to be the whole scraper, and on a real instance it is an empty\n * client-rendered shell — `<div id=\"hm-list-activity\">` with a comment in it,\n * and not one `<table>`, `<tr>` or `<td>` in 111KB. Parsing it for a table\n * returned \"no screenings due\" for a chart with thirteen advisories. The\n * advisories come from the legacy `Area/Controller/Action` endpoint the\n * activity's own controller calls (`healthadvisoriescontroller.min.js`):\n *\n *   POST /HealthAdvisories/GetTopics   → { HealthAdvisoryViewModelList, HealthAdvisorySettings }\n *\n * form-encoded with `registryID`, which the standalone activity passes as the\n * empty string. Verified against the live instance: the antiforgery token is\n * required (without it, and with it in the query string, the endpoint answers\n * 500) and works either as the `__RequestVerificationToken` header or in the\n * form body — the header, as `Insurance/Coverages/GetPayors` sends it. Nothing\n * else in the request matters there: absent, lowercased and bogus `registryID`\n * all returned the same thirteen topics, as did dropping `X-Requested-With`.\n * `registryID` is sent as the controller sends it rather than trimmed to what\n * one instance ignores.\n *\n * The failure is tolerated rather than thrown so the answer is a named gap\n * rather than an exception: the processor reports\n * `unavailable: ['/HealthAdvisories/GetTopics']`, which a caller can tell apart\n * from a chart with nothing due. The page is fetched only for its token —\n * there is nothing else on it to read.\n */\nexport async function fetchPreventiveCareRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken(ADVISORIES_PAGE_PATH);\n\n  await collector.send(\n    {\n      path: GET_TOPICS_PATH,\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n        'X-Requested-With': 'XMLHttpRequest',\n        __RequestVerificationToken: token,\n      },\n      body: new URLSearchParams({ registryID: '' }).toString(),\n    },\n    { tolerateFailure: true },\n  );\n\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getPreventiveCare(mychartRequest: MyChartRequest): Promise<PreventiveCareStandard> {\n  return preventiveCareProcessor.standard(await fetchPreventiveCareRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Medical history processor. Field decisions: docs/processor-layer-proposal.md, `get_medical_history`.\n *\n * The scraper used to drop the whole `socialHistory` block (smoking, alcohol);\n * it is one of the first things any history asks, so it is here in both modes.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, rec, strings, textOrNull } from '../../processors/read';\nimport type { LoadHistoriesViewModel } from './mychart.types';\nimport type { MedicalHistoryStandard } from './standardized.types';\n\nexport type { DiagnosisStandard, FamilyMemberStandard, MedicalHistoryStandard, SurgeryStandard } from './standardized.types';\n\nexport const medicalHistoryProcessor: Processor<MedicalHistoryStandard> = {\n  standard(raw: RawResponse): MedicalHistoryStandard {\n    const body = rec<LoadHistoriesViewModel>(bodyOf(raw, 'LoadHistoriesViewModel'));\n    const medical = rec(body.medicalHistory);\n    const surgical = rec(body.surgicalHistory);\n    const family = rec(body.familyHistoryAndStatus);\n    const social = rec(body.socialHistory);\n    const smoking = rec(social.smokingHistory);\n    const smokeless = rec(social.smokelessHistory);\n    const alcohol = rec(social.alcoholHistory);\n    return {\n      medicalHistory: {\n        diagnoses: list(medical.diagnoses).map((d) => ({\n          diagnosisName: textOrNull(rec(d).diagnosisName),\n          diagnosisDate: textOrNull(rec(d).diagnosisDate),\n        })),\n        medicalHistoryNotes: textOrNull(medical.medicalHistoryNotes),\n      },\n      surgicalHistory: {\n        surgeries: list(surgical.surgeries).map((s) => ({\n          surgeryName: textOrNull(rec(s).surgeryName),\n          surgeryDate: textOrNull(rec(s).surgeryDate),\n        })),\n        surgicalHistoryNotes: textOrNull(surgical.surgicalHistoryNotes),\n      },\n      familyHistoryAndStatus: {\n        familyMembers: list(family.familyMembers).map((m) => {\n          const member = rec(m);\n          return {\n            relationshipToPatientName: textOrNull(member.relationshipToPatientName),\n            conditions: strings(member.conditions),\n            statusName: textOrNull(member.statusName),\n            nameOrAlias: textOrNull(member.nameOrAlias),\n            sexName: textOrNull(member.sexName),\n            relativeAge: textOrNull(member.relativeAge),\n            relativeAgeEnd: textOrNull(member.relativeAgeEnd),\n          };\n        }),\n        familyHistoryNotes: textOrNull(family.familyHistoryNotes),\n        familyStatusNotes: textOrNull(family.familyStatusNotes),\n      },\n      socialHistory: {\n        smokingHistory: {\n          smokingTobaccoStatus: textOrNull(smoking.smokingTobaccoStatus),\n          tobaccoUse: textOrNull(smoking.tobaccoUse),\n          smokingTobaccoTypes: strings(smoking.smokingTobaccoTypes),\n          smokingTobaccoQuitDate: textOrNull(smoking.smokingTobaccoQuitDate),\n        },\n        smokelessHistory: {\n          smokelessTobaccoStatus: textOrNull(smokeless.smokelessTobaccoStatus),\n          smokelessTobaccoTypes: strings(smokeless.smokelessTobaccoTypes),\n          smokelessQuitDate: textOrNull(smokeless.smokelessQuitDate),\n        },\n        alcoholHistory: {\n          alcoholUse: textOrNull(alcohol.alcoholUse),\n          alcoholAmount: textOrNull(alcohol.alcoholAmount),\n          alcoholUnit: textOrNull(alcohol.alcoholUnit),\n        },\n        socialHistoryNotes: textOrNull(social.socialHistoryNotes),\n      },\n    };\n  },\n  concise(standard) {\n    return {\n      diagnoses: standard.medicalHistory.diagnoses,\n      surgeries: standard.surgicalHistory.surgeries,\n      familyMembers: standard.familyHistoryAndStatus.familyMembers.map((m) => ({\n        relationshipToPatientName: m.relationshipToPatientName,\n        statusName: m.statusName,\n        conditions: m.conditions,\n      })),\n      smokingTobaccoStatus: standard.socialHistory.smokingHistory.smokingTobaccoStatus,\n      tobaccoUse: standard.socialHistory.smokingHistory.tobaccoUse,\n      alcoholUse: standard.socialHistory.alcoholHistory.alcoholUse,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { medicalHistoryProcessor, type MedicalHistoryStandard } from './medicalHistory.processor';\n\nexport type {\n  MedicalHistoryStandard,\n  DiagnosisStandard,\n  SurgeryStandard,\n  FamilyMemberStandard,\n} from './medicalHistory.processor';\nexport { medicalHistoryProcessor } from './medicalHistory.processor';\n\n/** `GET /app/histories` for the token, then `POST /api/histories/LoadHistoriesViewModel`. */\nexport async function fetchMedicalHistoryRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/histories');\n  await collector.postJson('/api/histories/LoadHistoriesViewModel', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getMedicalHistory(mychartRequest: MyChartRequest): Promise<MedicalHistoryStandard> {\n  return medicalHistoryProcessor.standard(await fetchMedicalHistoryRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Goals processor. Field decisions: docs/processor-layer-proposal.md, `get_goals`.\n *\n * Two things the endpoints do that a naive read gets wrong, both observed on\n * four live instances:\n *\n * 1. **`LoadPatientGoals` always returns one goal.** Three of the four\n *    accounts, none of which has ever set a health goal, answered with a\n *    single element whose every field is blank (`goalId: \"\"`, `goalType: 0`,\n *    `readings: []`). It is the empty editable slot the activity renders, not\n *    a goal: `epic.px.client.goals` decides whether the patient has any with\n *    `patientGoals.length > 0 && !isNullOrEmpty(patientGoals[0].text)`, and its\n *    `setPatientGoal` reducer *deletes* an element whose `text` is `''`. So\n *    `text` is the display field, and an element without one is dropped here\n *    the same way — otherwise every patient in the product has exactly one\n *    nameless goal.\n * 2. **`LoadCareTeamGoals` takes `{ FullLoad: true }` for the whole list.**\n *    The bare `{}` the scraper used to post is the health-summary widget's\n *    abbreviated load. Both answered `[]` on all four accounts, so this is\n *    correctness in the request rather than a fix to an observed loss.\n *\n * Element shapes stay pass-through (rule 10): every captured `careTeamGoals`\n * was `[]`, and the only captured `patientGoals` element is the empty slot, so\n * no real element's field set has been seen. `source` is the one added field.\n *\n * A failing endpoint is named in `unavailable` rather than reported as an\n * empty list — one instance answers `LoadPatientGoals` with HTTP 500 on every\n * request, and \"you have set no goals\" is the wrong thing to say about that.\n */\n\nimport { findRequest, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, rec, text } from '../../processors/read';\nimport type { LoadCareTeamGoals, LoadPatientGoals } from './mychart.types';\nimport type { GoalsStandard } from './standardized.types';\n\nexport type { GoalSource, GoalsStandard } from './standardized.types';\n\nexport const LOAD_CARE_TEAM_GOALS_PATH = '/api/goals/LoadCareTeamGoals';\nexport const LOAD_PATIENT_GOALS_PATH = '/api/goals/LoadPatientGoals';\n\n/**\n * The empty editable slot MyChart returns for a patient with no goals: no\n * display text. The React activity treats exactly this as \"no goals\".\n */\nfunction isEmptyPatientGoalSlot(goal: Record<string, unknown>): boolean {\n  return text(goal.text).trim() === '';\n}\n\nexport const goalsProcessor: Processor<GoalsStandard> = {\n  standard(raw: RawResponse): GoalsStandard {\n    const unavailable: string[] = [];\n\n    function envelope(path: string): unknown {\n      const record = findRequest(raw, path);\n      if (!record || record.failure || record.status < 200 || record.status >= 300) {\n        unavailable.push(path);\n        return {};\n      }\n      return record.body;\n    }\n\n    const careTeam = rec<LoadCareTeamGoals>(envelope(LOAD_CARE_TEAM_GOALS_PATH));\n    const patient = rec<LoadPatientGoals>(envelope(LOAD_PATIENT_GOALS_PATH));\n\n    return {\n      careTeamGoals: list(careTeam.careTeamGoals).map((g) => ({ ...rec(g), source: 'care_team' as const })),\n      patientGoals: list(patient.patientGoals)\n        .map((g) => rec(g))\n        .filter((g) => !isEmptyPatientGoalSlot(g))\n        .map((g) => ({ ...g, source: 'patient' as const })),\n      unavailable,\n    };\n  },\n  concise: (standard) => standard,\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse, type MyChartResponseError } from '../../core/rawResponse';\nimport {\n  LOAD_CARE_TEAM_GOALS_PATH,\n  LOAD_PATIENT_GOALS_PATH,\n  goalsProcessor,\n  type GoalsStandard,\n} from './goals.processor';\n\nexport type { GoalsStandard, GoalSource } from './goals.processor';\nexport { goalsProcessor, LOAD_CARE_TEAM_GOALS_PATH, LOAD_PATIENT_GOALS_PATH } from './goals.processor';\n\n/**\n * `GET /app/goals` for the token, then `POST /api/goals/LoadCareTeamGoals` and\n * `POST /api/goals/LoadPatientGoals`. Real MyChart keys each list by its own\n * name (`careTeamGoals` / `patientGoals`); see the processor for what is and is\n * not known about the elements.\n *\n * `FullLoad: true` is the goals *activity's* request for care-team goals, as\n * against the bare `{}` the health-summary widget sends for its abbreviated\n * list (`epic.px.client.goals`). Neither the whole list nor the abbreviated one\n * is a superset of the other by construction, so the activity's is the one to\n * ask for.\n *\n * Neither call alone is allowed to fail the whole read: one captured instance\n * answers `LoadPatientGoals` with HTTP 500 every time while care-team goals\n * load fine, so each is tolerated and the processor names a failed endpoint\n * rather than calling it empty. Both failing is a failed read, though — there\n * is nothing loaded to return — and throws the first failure.\n */\nexport async function fetchGoalsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/goals');\n  const failures: MyChartResponseError[] = [];\n  for (const [path, body] of [\n    [LOAD_CARE_TEAM_GOALS_PATH, { FullLoad: true }],\n    [LOAD_PATIENT_GOALS_PATH, {}],\n  ] as const) {\n    const request = { path, method: 'POST' as const, headers: { 'Content-Type': 'application/json', __RequestVerificationToken: token }, body: JSON.stringify(body) };\n    const { failure } = await collector.send(request, { tolerateFailure: true });\n    if (failure) failures.push(failure);\n  }\n  if (failures.length === 2) throw failures[0]!;\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getGoals(mychartRequest: MyChartRequest): Promise<GoalsStandard> {\n  return goalsProcessor.standard(await fetchGoalsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Profile` group — the standing facts about a patient's health. */\n\nimport { fetchProfileRaw, profileProcessor } from '../../../scrapers/myChart/chart/profile/profile';\nimport { fetchHealthSummaryRaw, healthSummaryProcessor } from '../../../scrapers/myChart/chart/healthSummary/healthSummary';\nimport { fetchMedicationsRaw, medicationsProcessor } from '../../../scrapers/myChart/chart/medications/medications';\nimport { fetchAllergiesRaw, allergiesProcessor } from '../../../scrapers/myChart/chart/allergies/allergies';\nimport { fetchHealthIssuesRaw, healthIssuesProcessor } from '../../../scrapers/myChart/chart/healthIssues/healthIssues';\nimport { fetchVitalsRaw, vitalsProcessor } from '../../../scrapers/myChart/chart/vitals/vitals';\nimport { fetchImmunizationsRaw, immunizationsProcessor } from '../../../scrapers/myChart/chart/immunizations/immunizations';\nimport { fetchPreventiveCareRaw, preventiveCareProcessor } from '../../../scrapers/myChart/chart/preventiveCare/preventiveCare';\nimport { fetchMedicalHistoryRaw, medicalHistoryProcessor } from '../../../scrapers/myChart/chart/medicalHistory/medicalHistory';\nimport { fetchGoalsRaw, goalsProcessor } from '../../../scrapers/myChart/chart/goals/goals';\nimport type { CapabilityImpl } from '../types';\n\nexport const PROFILE_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_profile',\n    title: 'Patient profile',\n    description: 'Patient profile (name, date of birth, medical record number, primary care provider) plus the account email address.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchProfileRaw(request),\n    processor: profileProcessor,\n  },\n  {\n    id: 'get_health_summary',\n    title: 'Health summary',\n    description: 'Health summary — vitals snapshot, blood type, smoking status and similar top-level facts.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchHealthSummaryRaw(request),\n    processor: healthSummaryProcessor,\n  },\n  {\n    id: 'get_medications',\n    title: 'Medications',\n    description: 'Current medications with dosage, instructions, prescriber and pharmacy.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchMedicationsRaw(request),\n    processor: medicationsProcessor,\n  },\n  {\n    id: 'get_allergies',\n    title: 'Allergies',\n    description: 'Known allergies with reaction and severity.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchAllergiesRaw(request),\n    processor: allergiesProcessor,\n  },\n  {\n    id: 'get_health_issues',\n    title: 'Health issues',\n    description: 'Active health issues / problem list.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchHealthIssuesRaw(request),\n    processor: healthIssuesProcessor,\n  },\n  {\n    id: 'get_vitals',\n    title: 'Vitals',\n    description: 'Vitals and tracked flowsheet readings (weight, blood pressure, heart rate, glucose, etc.).',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchVitalsRaw(request),\n    processor: vitalsProcessor,\n  },\n  {\n    id: 'get_immunizations',\n    title: 'Immunizations',\n    description: 'Vaccination history.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchImmunizationsRaw(request),\n    processor: immunizationsProcessor,\n  },\n  {\n    id: 'get_preventive_care',\n    title: 'Preventive care',\n    description: 'Preventive care recommendations — overdue and upcoming screenings.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchPreventiveCareRaw(request),\n    processor: preventiveCareProcessor,\n  },\n  {\n    id: 'get_medical_history',\n    title: 'Medical history',\n    description: 'Past medical, surgical, family and social history.',\n    kind: 'read',\n    group: 'Profile',\n    params: [],\n    run: (request) => fetchMedicalHistoryRaw(request),\n    processor: medicalHistoryProcessor,\n  },\n  {\n    id: 'get_goals',\n    title: 'Goals',\n    description: 'Care team goals and patient-set goals.',\n    kind: 'read',\n    group: 'Profile',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchGoalsRaw(request),\n    processor: goalsProcessor,\n  },\n\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Visit notes and report content processors. Field decisions:\n * docs/processor-layer-proposal.md, `get_visit_notes` and\n * `get_note_content` / `get_visit_avs`.\n *\n * `GetVisitNotes` answers a literal JSON `null` for an unknown CSN, and\n * `LoadReportContent` does the same for an unknown note; both pass through as\n * `null` (rule 7). MyChart's spelling (`lrpID`, `hnoID`, `hnoDAT`, `magicID`)\n * is kept on every pass-through field (rule 2); the only derived fields are\n * `csn` (the request body's CSN, so the result names its visit) and\n * `reportContentText` (the HTML stripped to text, rule 9).\n */\n\nimport { findRequest, type RawResponse } from '../../core/rawResponse';\nimport { htmlToText } from '../../processors/htmlText';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, text, textOrNull } from '../../processors/read';\nimport type { GetVisitNotes } from './mychart.types';\nimport type { NoteContentStandard, VisitNotesStandard } from './standardized.types';\n\nexport type { NoteContentStandard, VisitNoteStandard, VisitNotesStandard } from './standardized.types';\n\nexport const visitNotesProcessor: Processor<VisitNotesStandard | null> = {\n  standard(raw: RawResponse): VisitNotesStandard | null {\n    const request = findRequest(raw, 'GetVisitNotes');\n    const body = request?.body;\n    if (body === null || body === undefined) return null;\n    const b = rec<GetVisitNotes>(body);\n    return {\n      csn: text(rec(request?.requestBody).CSN),\n      lrpID: textOrNull(b.lrpID),\n      depPhoneNumber: textOrNull(b.depPhoneNumber),\n      isAtLeastOneNoteSensitive: boolOrNull(b.isAtLeastOneNoteSensitive),\n      noteList: list(b.noteList).map((entry) => {\n        const n = rec(entry);\n        const provider = rec(n.provider);\n        return {\n          hnoID: textOrNull(n.hnoID),\n          hnoDAT: textOrNull(n.hnoDAT),\n          displayName: textOrNull(n.displayName),\n          iso: textOrNull(n.iso),\n          provider: { name: textOrNull(provider.name), magicID: textOrNull(provider.magicID) },\n          isAddendum: boolOrNull(n.isAddendum),\n          isNoteSensitive: boolOrNull(n.isNoteSensitive),\n          attachments: list(n.attachments),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    if (standard === null) return null;\n    return {\n      csn: standard.csn,\n      lrpID: standard.lrpID,\n      noteList: standard.noteList.map((n) => ({\n        hnoID: n.hnoID,\n        hnoDAT: n.hnoDAT,\n        displayName: n.displayName,\n        iso: n.iso,\n        provider: { name: n.provider.name },\n      })),\n    };\n  },\n};\n\n/** Shared by `get_note_content` (OPEN_NOTES) and `get_visit_avs` (AMB_AVS). */\nexport const noteContentProcessor: Processor<NoteContentStandard | null> = {\n  standard(raw: RawResponse): NoteContentStandard | null {\n    const body = findRequest(raw, 'LoadReportContent')?.body;\n    if (body === null || body === undefined) return null;\n    return { reportContentText: htmlToText(text(rec(body).reportContent)) };\n  },\n  concise(standard) {\n    return standard;\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport {\n  noteContentProcessor,\n  visitNotesProcessor,\n  type NoteContentStandard,\n  type VisitNotesStandard,\n} from './notes.processor';\n\nexport type { VisitNotesStandard, VisitNoteStandard, NoteContentStandard } from './notes.processor';\nexport { visitNotesProcessor, noteContentProcessor } from './notes.processor';\n\n/**\n * The CSRF token. Uses /Visits/VisitsList for consistency with the sibling\n * visits scraper.\n */\nconst VISITS_PAGE = '/Visits/VisitsList';\n\n/**\n * Surface F5 Volterra WAF rejections (200 OK with a text/html \"Request\n * Rejected\" body) as a clear error rather than letting the caller find an\n * HTML string where JSON was expected. Any other non-JSON answer is reported\n * as a probably-expired session.\n */\nexport function requireJsonBody(\n  result: { response: Response; text: string },\n  endpoint: string,\n): void {\n  const contentType = result.response.headers.get('content-type') || '';\n  if (contentType.includes('json')) return;\n  const server = result.response.headers.get('server') || '';\n  const bodyPreview = result.text.slice(0, 200);\n  if (server.includes('volt') || bodyPreview.includes('Request Rejected')) {\n    throw new Error(\n      `MyChart WAF (${server || 'unknown'}) rejected ${endpoint}. ` +\n        `The session is likely valid but the WAF blocked this request shape. ` +\n        `Try refreshing your MyChart login.`,\n    );\n  }\n  throw new Error(\n    `Expected JSON from ${endpoint} but got ${contentType || 'no content-type'}. Session may have expired.`,\n  );\n}\n\nasync function postJsonChecked(collector: RawCollector, path: string, token: string, body: unknown): Promise<void> {\n  const result = await collector.send({\n    path,\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json', __requestverificationtoken: token },\n    body: JSON.stringify(body),\n  });\n  requireJsonBody(result, path);\n}\n\n/** `POST /api/visit-notes/GetVisitNotes` `{ CSN, FromPvdPage }` — the notes attached to a past visit. */\nexport async function fetchVisitNotesRaw(mychartRequest: MyChartRequest, csn: string): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken(VISITS_PAGE + '?noCache=' + Math.random());\n  await postJsonChecked(collector, '/api/visit-notes/GetVisitNotes', token, { CSN: csn, FromPvdPage: true });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. `null` for an unknown CSN. */\nexport async function getVisitNotes(mychartRequest: MyChartRequest, csn: string): Promise<VisitNotesStandard | null> {\n  return visitNotesProcessor.standard(await fetchVisitNotesRaw(mychartRequest, csn));\n}\n\n/**\n * `POST /api/report-content/LoadReportContent` with `OPEN_NOTES` — one note's\n * rendered HTML. `lrpId` is shared by every note of a visit; `hnoId`/`hnoDat`\n * identify the note.\n */\nexport async function fetchNoteContentRaw(\n  mychartRequest: MyChartRequest,\n  params: { csn: string; lrpId: string; hnoId: string; hnoDat: string },\n): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken(VISITS_PAGE + '?noCache=' + Math.random());\n  await postJsonChecked(collector, '/api/report-content/LoadReportContent', token, {\n    reportMnemonic: 'OPEN_NOTES',\n    reportID: params.lrpId,\n    contextID: params.hnoId,\n    contextDAT: params.hnoDat,\n    contextINI: 'HNO',\n    csn: params.csn,\n    isFullReportPage: false,\n    uniqueClass: 'EID-1',\n    nonce: '',\n  });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getNoteContent(\n  mychartRequest: MyChartRequest,\n  params: { csn: string; lrpId: string; hnoId: string; hnoDat: string },\n): Promise<NoteContentStandard | null> {\n  return noteContentProcessor.standard(await fetchNoteContentRaw(mychartRequest, params));\n}\n\n/** Same endpoint with `AMB_AVS` — the After Visit Summary for a past visit. */\nexport async function fetchVisitAvsRaw(mychartRequest: MyChartRequest, csn: string): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken(VISITS_PAGE + '?noCache=' + Math.random());\n  await postJsonChecked(collector, '/api/report-content/LoadReportContent', token, {\n    reportMnemonic: 'AMB_AVS',\n    reportID: '',\n    csn,\n    isFullReportPage: false,\n    uniqueClass: 'EID-1',\n    nonce: '',\n  });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getVisitAVS(mychartRequest: MyChartRequest, csn: string): Promise<NoteContentStandard | null> {\n  return noteContentProcessor.standard(await fetchVisitAvsRaw(mychartRequest, csn));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Visits processors. Field decisions: docs/processor-layer-proposal.md,\n * `get_upcoming_visits` and `get_past_visits`.\n *\n * Both endpoints return the same ~160-field visit view model, so one\n * `visitStandard` mapper serves both. `LoadUpcoming` answers three buckets\n * (in progress / next N days / later) which are flattened into one list with\n * `bucket` on each row; `LoadPast` answers one page per organization and the\n * scraper records every page, so the per-organization merge happens here.\n *\n * `status` is derived from the seven status booleans in most-specific-first\n * order (PR #380): a canceled visit reported as \"completed\" is a lie about\n * care the patient never received. `IsPastVisit` is never consulted — it is\n * false on rows `LoadPast` itself returned (#377).\n */\n\nimport { findRequest, findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { bool, boolOrNull, epicInstantMs, isoFromMs, list, num, rec, strings, text, textOrNull } from '../../processors/read';\nimport type { Specialty, VisitDepartment, VisitOrganization, VisitProvider, VisitsLoadPast, VisitsLoadUpcoming } from './mychart.types';\nimport type { PastVisitsStandard, UpcomingVisitStandard, UpcomingVisitsStandard, VisitBucket, VisitConcise, VisitDepartmentStandard, VisitProviderStandard, VisitStandard, VisitStatus } from './standardized.types';\n\nexport type { PastVisitsStandard, UpcomingVisitStandard, UpcomingVisitsStandard, VisitBucket, VisitConcise, VisitDepartmentStandard, VisitDiagnosisStandard, VisitPreadmissionLocationStandard, VisitProcedureStandard, VisitProviderStandard, VisitStandard, VisitStatus } from './standardized.types';\n\n/**\n * The epoch-millis timestamp of a raw visit: its `Instant` (`/Date(ms)/`),\n * falling back to `PrimaryDate`. Null when neither parses, so a caller can\n * keep paginating (or sort the row last) rather than stop on an odd row.\n */\nexport function visitInstantMs(visit: Record<string, unknown>): number | null {\n  const ms = epicInstantMs(visit.Instant);\n  if (ms !== null) return ms;\n  const primary = text(visit.PrimaryDate);\n  if (primary) {\n    const t = Date.parse(primary);\n    if (!Number.isNaN(t)) return t;\n  }\n  return null;\n}\n\n/** `status`, in PR #380's order. `isPast` is \"this row came from `LoadPast`\". */\nexport function visitStatus(visit: Record<string, unknown>, isPast: boolean): VisitStatus {\n  if (bool(visit.IsCanceled)) return 'canceled';\n  if (bool(visit.IsNoShow)) return 'no_show';\n  if (bool(visit.LeftWithoutSeen)) return 'left_without_being_seen';\n  if (bool(visit.InProgress)) return 'in_progress';\n  if (bool(visit.IsArrived)) return 'arrived';\n  if (isPast) return 'completed';\n  if (bool(visit.IsCancelRequestSent)) return 'cancel_requested';\n  if (bool(visit.IsConfirmed)) return 'confirmed';\n  return 'scheduled';\n}\n\nfunction isObject(value: unknown): boolean {\n  return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction textOrNumber(value: unknown): string | number | null {\n  return typeof value === 'string' ? value : num(value);\n}\n\nfunction named(value: unknown): { Name: string | null } {\n  return { Name: textOrNull(rec(value).Name) };\n}\n\nfunction instructions(value: unknown): Array<{ Text: string | null }> {\n  return list(value).map((i) => ({ Text: textOrNull(rec(i).Text) }));\n}\n\nfunction department(value: unknown): VisitDepartmentStandard {\n  const d = rec<VisitDepartment>(value);\n  return {\n    Name: textOrNull(d.Name),\n    Address: strings(d.Address),\n    PhoneNumber: textOrNull(d.PhoneNumber),\n    Specialty: { Title: textOrNull(rec<Specialty>(d.Specialty).Title) },\n    Instructions: instructions(d.Instructions),\n    ArrivalLocation: textOrNull(d.ArrivalLocation),\n    TimeZone: textOrNull(d.TimeZone),\n  };\n}\n\nfunction provider(value: unknown): VisitProviderStandard {\n  const p = rec<VisitProvider>(value);\n  const d = p.Department;\n  return {\n    Name: textOrNull(p.Name),\n    Department: isObject(d)\n      ? { Name: textOrNull(rec(d).Name), Address: strings(rec(d).Address), PhoneNumber: textOrNull(rec(d).PhoneNumber) }\n      : null,\n  };\n}\n\n/**\n * One raw visit row → the standard visit. `isPast` feeds `status`.\n * `containerOrganizationName` is the `LoadPast` organization container's\n * name, used only when the row carries no `Organization.OrganizationName`\n * of its own — the same fact, one level up.\n */\nexport function visitStandard(value: unknown, isPast: boolean, containerOrganizationName: string | null = null): VisitStandard {\n  const v = rec(value);\n  const admission = v.AdmissionDateRange;\n  const preadmission = v.PreadmissionLocation;\n  const telemedicine = v.Telemedicine;\n  const evisit = v.EVisit;\n  const copay = v.Copay;\n  return {\n    Csn: textOrNull(v.Csn),\n    CsnForECheckIn: textOrNull(v.CsnForECheckIn),\n    Id: textOrNull(v.Id),\n    ReferenceID: textOrNull(v.ReferenceID),\n\n    Instant: textOrNull(v.Instant),\n    instantISO: isoFromMs(epicInstantMs(v.Instant)),\n    PrimaryDate: textOrNull(v.PrimaryDate),\n    TimeZone: textOrNull(v.TimeZone),\n    IsTimeToBeDetermined: boolOrNull(v.IsTimeToBeDetermined),\n    IsHideVisitTime: boolOrNull(v.IsHideVisitTime),\n    DurationInMinutes: num(v.DurationInMinutes),\n    HasDuration: boolOrNull(v.HasDuration),\n    ArrivalTime: textOrNull(v.ArrivalTime),\n    EarlyArrivalReason: textOrNull(v.EarlyArrivalReason),\n    AdmissionDateRange: isObject(admission)\n      ? { Start: textOrNull(rec(admission).Start), End: textOrNull(rec(admission).End) }\n      : null,\n    DischargeDate: textOrNull(v.DischargeDate),\n    RescheduledDatString: textOrNull(v.RescheduledDatString),\n\n    VisitTypeName: textOrNull(v.VisitTypeName),\n    IsUsingFallbackVisitTypeName: boolOrNull(v.IsUsingFallbackVisitTypeName),\n    EncounterType: num(v.EncounterType),\n    EncounterIsSurgery: boolOrNull(v.EncounterIsSurgery),\n    EncounterIsEDVisit: boolOrNull(v.EncounterIsEDVisit),\n    IsPreadmission: boolOrNull(v.IsPreadmission),\n    IsHovPreadmission: boolOrNull(v.IsHovPreadmission),\n    IsResidentialMed: boolOrNull(v.IsResidentialMed),\n    ChiefComplaint: textOrNull(v.ChiefComplaint),\n    Diagnoses: list(v.Diagnoses).map((d) => ({\n      Code: textOrNull(rec(d).Code),\n      Description: textOrNull(rec(d).Description),\n    })),\n    SurgicalProcedures: list(v.SurgicalProcedures).map((p) => ({\n      Name: textOrNull(rec(p).Name),\n      Instructions: textOrNull(rec(p).Instructions),\n      Providers: list(rec(p).Providers).map(named),\n    })),\n    Cases: list(v.Cases).map((c) => ({\n      CaseId: textOrNull(rec(c).CaseId),\n      Description: textOrNull(rec(c).Description),\n    })),\n    ComponentVisits: list(v.ComponentVisits).map((c) => ({\n      Csn: textOrNull(rec(c).Csn),\n      VisitTypeName: textOrNull(rec(c).VisitTypeName),\n      PrimaryDate: textOrNull(rec(c).PrimaryDate),\n    })),\n    HasComponentVisits: boolOrNull(v.HasComponentVisits),\n    PatientNextStepInstructions: textOrNull(v.PatientNextStepInstructions),\n    EpisodeDetails: { GestationalAge: textOrNull(rec(v.EpisodeDetails).GestationalAge) },\n    SurgeryTimeOfDay: textOrNumber(v.SurgeryTimeOfDay),\n\n    PrimaryProviderName: textOrNull(v.PrimaryProviderName),\n    PrimaryProvider: isObject(v.PrimaryProvider) ? named(v.PrimaryProvider) : null,\n    Providers: list(v.Providers).map(provider),\n    OtherProviders: list(v.OtherProviders).map(named),\n    GuestPatientFirstName: textOrNull(v.GuestPatientFirstName),\n\n    PrimaryDepartment: department(v.PrimaryDepartment),\n    PreadmissionLocation: isObject(preadmission)\n      ? {\n          Name: textOrNull(rec(preadmission).Name),\n          Address: strings(rec(preadmission).Address),\n          PhoneNumber: textOrNull(rec(preadmission).PhoneNumber),\n          Instructions: instructions(rec(preadmission).Instructions),\n          ArrivalLocation: textOrNull(rec(preadmission).ArrivalLocation),\n        }\n      : null,\n    organizationName: textOrNull(rec(v.Organization).OrganizationName) ?? containerOrganizationName,\n\n    IsCanceled: boolOrNull(v.IsCanceled),\n    IsNoShow: boolOrNull(v.IsNoShow),\n    LeftWithoutSeen: boolOrNull(v.LeftWithoutSeen),\n    InProgress: boolOrNull(v.InProgress),\n    IsArrived: boolOrNull(v.IsArrived),\n    IsConfirmed: boolOrNull(v.IsConfirmed),\n    IsCancelRequestSent: boolOrNull(v.IsCancelRequestSent),\n    status: visitStatus(v, isPast),\n    ConfirmationStatus: num(v.ConfirmationStatus),\n    ArrivalStatus: num(v.ArrivalStatus),\n\n    Telemedicine: isObject(telemedicine)\n      ? {\n          IsTelemedicine: boolOrNull(rec(telemedicine).IsTelemedicine),\n          TelemedicineMode: num(rec(telemedicine).TelemedicineMode),\n        }\n      : null,\n    TelehealthMode: num(v.TelehealthMode),\n    EVisit: isObject(evisit) ? { IsEVisit: boolOrNull(rec(evisit).IsEVisit) } : null,\n    IsInHomeVisit: boolOrNull(v.IsInHomeVisit),\n\n    Copay: isObject(copay) ? { Amount: textOrNull(rec(copay).Amount), IsPaid: boolOrNull(rec(copay).IsPaid) } : null,\n    HasPaymentInfo: boolOrNull(v.HasPaymentInfo),\n    IsFullyPaid: boolOrNull(v.IsFullyPaid),\n\n    IsClinicalNoteAvailable: boolOrNull(v.IsClinicalNoteAvailable),\n    IsNotesOnly: boolOrNull(v.IsNotesOnly),\n    IsClinicalInformationAvailable: boolOrNull(v.IsClinicalInformationAvailable),\n    IsVisitSummaryEnabled: boolOrNull(v.IsVisitSummaryEnabled),\n    HasDownloadSummaryLink: boolOrNull(v.HasDownloadSummaryLink),\n    IsNotViewed: boolOrNull(v.IsNotViewed),\n    IsVisitAmbulatory: boolOrNull(v.IsVisitAmbulatory),\n  };\n}\n\n/** The concise field list, shared by both capabilities. */\nfunction visitConcise(visit: VisitStandard): VisitConcise {\n  return {\n    Csn: visit.Csn,\n    PrimaryDate: visit.PrimaryDate,\n    IsTimeToBeDetermined: visit.IsTimeToBeDetermined,\n    IsHideVisitTime: visit.IsHideVisitTime,\n    AdmissionDateRange: visit.AdmissionDateRange,\n    DischargeDate: visit.DischargeDate,\n    VisitTypeName: visit.VisitTypeName,\n    ChiefComplaint: visit.ChiefComplaint,\n    Diagnoses: visit.Diagnoses,\n    SurgicalProcedures: visit.SurgicalProcedures.map((p) => ({ Name: p.Name })),\n    PrimaryProviderName: visit.PrimaryProviderName,\n    PrimaryDepartment: { Name: visit.PrimaryDepartment.Name },\n    organizationName: visit.organizationName,\n    status: visit.status,\n    IsClinicalNoteAvailable: visit.IsClinicalNoteAvailable,\n    IsVisitSummaryEnabled: visit.IsVisitSummaryEnabled,\n  };\n}\n\n/** Sort key: the standard row's instant, or null for \"sort last\". */\nfunction standardInstantMs(visit: VisitStandard): number | null {\n  return visitInstantMs({ Instant: visit.Instant, PrimaryDate: visit.PrimaryDate });\n}\n\n/** Stable sort with nulls last; `direction` 1 = ascending, -1 = descending. */\nfunction sortByInstant<T extends VisitStandard>(visits: T[], direction: 1 | -1): T[] {\n  return visits\n    .map((visit, index) => ({ visit, index, ms: standardInstantMs(visit) }))\n    .sort((a, b) => {\n      if (a.ms === null && b.ms === null) return a.index - b.index;\n      if (a.ms === null) return 1;\n      if (b.ms === null) return -1;\n      return (a.ms - b.ms) * direction || a.index - b.index;\n    })\n    .map((entry) => entry.visit);\n}\n\nconst UPCOMING_BUCKETS: ReadonlyArray<[key: keyof VisitsLoadUpcoming, bucket: VisitBucket]> = [\n  ['InProgressVisits', 'in_progress'],\n  ['NextNDaysVisits', 'soon'],\n  ['LaterVisitsList', 'later'],\n];\n\nexport const upcomingVisitsProcessor: Processor<UpcomingVisitsStandard | null> = {\n  standard(raw: RawResponse): UpcomingVisitsStandard | null {\n    const body = findRequest(raw, 'LoadUpcoming')?.body;\n    // Errors pass through (rule 7): a literal null is returned as null.\n    if (body === null || body === undefined) return null;\n    const container = rec<VisitsLoadUpcoming>(body);\n    const visits: UpcomingVisitStandard[] = [];\n    for (const [key, bucket] of UPCOMING_BUCKETS) {\n      for (const row of list(container[key])) visits.push({ ...visitStandard(row, false), bucket });\n    }\n    const sorted = sortByInstant(visits, 1);\n    return { count: sorted.length, visits: sorted };\n  },\n  concise(standard) {\n    if (standard === null) return null;\n    return {\n      count: standard.count,\n      visits: standard.visits.map((visit) => ({ ...visitConcise(visit), bucket: visit.bucket })),\n    };\n  },\n};\n\n/**\n * A row's identity across pages. A stuck continuation cursor hands back the\n * page just fetched; the scraper stops on it but the page is still in the\n * envelope, so the same visit must not be counted twice.\n */\nfunction visitKey(orgId: string, visit: Record<string, unknown>): string | null {\n  const parts = [text(visit.Id), text(visit.Csn), text(visit.Instant), text(visit.PrimaryDate)];\n  if (parts.every((p) => p === '')) return null;\n  return [orgId, ...parts].join('\u0000');\n}\n\nexport const pastVisitsProcessor: Processor<PastVisitsStandard | null> = {\n  standard(raw: RawResponse): PastVisitsStandard | null {\n    const pages = findRequests(raw, 'LoadPast');\n    if (pages.length === 0) return null;\n    // Errors pass through (rule 7): a literal null first page is returned as null.\n    if (pages[0]!.body === null) return null;\n\n    const visits: VisitStandard[] = [];\n    const seen = new Set<string>();\n    // Last-fetched page wins per organization: a page's HasMoreData describes\n    // what lies beyond THAT page.\n    const hasMoreByOrg = new Map<string, boolean>();\n\n    for (const page of pages) {\n      const orgs = rec(rec<VisitsLoadPast>(page.body).List);\n      for (const [orgId, orgPage] of Object.entries(orgs)) {\n        const org = rec(orgPage);\n        const orgName = textOrNull(rec<VisitOrganization>(org.Organization).OrganizationName);\n        hasMoreByOrg.set(orgId, bool(org.HasMoreData));\n        for (const row of list(org.List)) {\n          const key = visitKey(orgId, rec(row));\n          if (key !== null) {\n            if (seen.has(key)) continue;\n            seen.add(key);\n          }\n          visits.push(visitStandard(row, true, orgName));\n        }\n      }\n    }\n\n    const sorted = sortByInstant(visits, -1);\n    return {\n      count: sorted.length,\n      // True only when MyChart said an organization had more and the walk\n      // stopped anyway — i.e. the page cap was hit.\n      hasOlderVisits: [...hasMoreByOrg.values()].some(Boolean),\n      visits: sorted,\n    };\n  },\n  concise(standard) {\n    if (standard === null) return null;\n    return {\n      count: standard.count,\n      hasOlderVisits: standard.hasOlderVisits,\n      visits: standard.visits.map(visitConcise),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { logger } from '../../../../shared/logger';\nimport { bool, rec, text } from '../../processors/read';\nimport { requireJsonBody } from '../notes/notes';\nimport type { VisitsLoadPast } from './mychart.types';\nimport {\n  pastVisitsProcessor,\n  upcomingVisitsProcessor,\n  type PastVisitsStandard,\n  type UpcomingVisitsStandard,\n} from './visits.processor';\n\nexport type {\n  VisitStandard,\n  VisitConcise,\n  VisitStatus,\n  VisitBucket,\n  UpcomingVisitStandard,\n  UpcomingVisitsStandard,\n  PastVisitsStandard,\n  VisitDiagnosisStandard,\n  VisitProcedureStandard,\n  VisitProviderStandard,\n  VisitDepartmentStandard,\n  VisitPreadmissionLocationStandard,\n} from './visits.processor';\nexport {\n  upcomingVisitsProcessor,\n  pastVisitsProcessor,\n  visitStandard,\n  visitStatus,\n  visitInstantMs,\n} from './visits.processor';\n\nconst VISITS_PAGE = '/Visits/VisitsList';\n\n/**\n * `GET /Visits/VisitsList` for the token, then `POST /Visits/VisitsList/LoadUpcoming`.\n *\n * The POST carries no body and no Content-Type: an empty-string body still\n * makes Node's undici add `Content-Type: text/plain`, which trips F5 Volterra\n * WAF rules on some deployments.\n */\nexport async function fetchUpcomingVisitsRaw(myChartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(myChartRequest);\n  const token = await collector.pageToken(VISITS_PAGE + '?noCache=' + Math.random());\n  const result = await collector.send({\n    path: '/Visits/VisitsList/LoadUpcoming?timeZone=America%2FNew_York&ComponentNumber=5&noCache=' + Math.random(),\n    method: 'POST',\n    headers: { __requestverificationtoken: token },\n  });\n  requireJsonBody(result, '/Visits/VisitsList/LoadUpcoming');\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function upcomingVisits(myChartRequest: MyChartRequest): Promise<UpcomingVisitsStandard | null> {\n  return upcomingVisitsProcessor.standard(await fetchUpcomingVisitsRaw(myChartRequest));\n}\n\n// Hard cap on how many LoadPast pages one call will request. MyChart returns\n// 10 visits per organization per page, so 50 pages covers ~500 visits per\n// organization, while still guaranteeing termination on accounts with huge\n// histories. `hasOlderVisits` says when it was hit.\nconst MAX_PAST_VISIT_PAGES = 50;\n\n/**\n * `oldestRenderedDate` is required on the query string, and MyChart does\n * nothing with it (#190) — the request that carries \"1970\" and the one that\n * carries \"two years ago\" come back with the same 10 visits. In Epic's own\n * page it is the browser reporting how far down it has already rendered, not\n * a filter. Pinned to the epoch so it can never be mistaken for one.\n */\nconst OLDEST_RENDERED_DATE = new Date(0).toISOString();\n\n/**\n * Fetch every `LoadPast` page and record each one.\n *\n * Each response carries `HasMoreData` per organization and a top-level\n * `SerializedIndex` continuation token that must be echoed back to get the\n * next 10 (issue #189), so the walk runs to exhaustion: it stops when no\n * organization has more data, when the token is missing or stops advancing,\n * or at `MAX_PAST_VISIT_PAGES`. The pages are NOT merged here — the processor\n * does that — so `raw` mode is the envelope of every page fetched.\n */\nexport async function fetchPastVisitsRaw(myChartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(myChartRequest);\n  const token = await collector.pageToken(VISITS_PAGE + '?noCache=' + Math.random());\n\n  let serializedIndex: string | undefined;\n  let pagesFetched = 0;\n  while (pagesFetched < MAX_PAST_VISIT_PAGES) {\n    let path =\n      '/Visits/VisitsList/LoadPast?loadpast=1&searchString=&oldestRenderedDate=' +\n      OLDEST_RENDERED_DATE +\n      '&ComponentNumber=7&noCache=' +\n      Math.random();\n    if (serializedIndex) path += '&serializedIndex=' + encodeURIComponent(serializedIndex);\n\n    // Same WAF-safe shape as LoadUpcoming: no body, no Content-Type.\n    const result = await collector.send({ path, method: 'POST', headers: { __requestverificationtoken: token } });\n    requireJsonBody(result, '/Visits/VisitsList/LoadPast');\n    pagesFetched++;\n\n    const page = rec<VisitsLoadPast>(result.body);\n    // A non-container response (a literal null, a login interstitial that\n    // happened to be JSON) cannot be paged; it is in the envelope as-is.\n    if (!page.List) break;\n\n    // Called rather than passed by reference: `rec` is overloaded, and a bare\n    // reference resolves to the typed overload with nothing to infer from.\n    const orgs = Object.values(rec(page.List)).map((org) => rec(org));\n    if (!orgs.some((org) => bool(org.HasMoreData))) break;\n\n    const next = text(page.SerializedIndex);\n    if (!next || next === serializedIndex) break; // no cursor, or a stuck one\n    serializedIndex = next;\n  }\n\n  if (pagesFetched >= MAX_PAST_VISIT_PAGES) {\n    logger.debug(`pastVisits: hit page cap (${MAX_PAST_VISIT_PAGES}); some older visits may be omitted`);\n  }\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function pastVisits(myChartRequest: MyChartRequest): Promise<PastVisitsStandard | null> {\n  return pastVisitsProcessor.standard(await fetchPastVisitsRaw(myChartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Visits` group — appointments, the notes written at them, and the AVS. */\n\nimport {\n  fetchUpcomingVisitsRaw,\n  fetchPastVisitsRaw,\n  upcomingVisitsProcessor,\n  pastVisitsProcessor,\n} from '../../../scrapers/myChart/chart/visits/visits';\nimport {\n  fetchVisitNotesRaw,\n  fetchNoteContentRaw,\n  fetchVisitAvsRaw,\n  visitNotesProcessor,\n  noteContentProcessor,\n} from '../../../scrapers/myChart/chart/notes/notes';\nimport { requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const VISIT_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_upcoming_visits',\n    title: 'Upcoming visits',\n    description: 'Upcoming appointments.',\n    kind: 'read',\n    group: 'Visits',\n    params: [],\n    run: (request) => fetchUpcomingVisitsRaw(request),\n    processor: upcomingVisitsProcessor,\n  },\n  {\n    id: 'get_past_visits',\n    title: 'Past visits',\n    description:\n      'Every past visit MyChart holds, newest first. `hasOlderVisits` says whether the page cap stopped the walk before the end.',\n    kind: 'read',\n    group: 'Visits',\n    params: [],\n    run: (request) => fetchPastVisitsRaw(request),\n    processor: pastVisitsProcessor,\n  },\n  {\n    id: 'get_visit_notes',\n    title: 'Visit notes',\n    description:\n      'List the clinical notes (operative, progress, anesthesia, …) attached to a past visit. Returns lrpID and, per note, hnoID and hnoDAT — pass those to get_note_content.',\n    kind: 'read',\n    group: 'Visits',\n    params: [{ name: 'csn', type: 'string', description: 'Visit CSN (encounter id) from get_past_visits.', required: true }],\n    run: (request, args) => fetchVisitNotesRaw(request, requireStr(args, 'csn')),\n    processor: visitNotesProcessor,\n  },\n  {\n    id: 'get_note_content',\n    title: 'Note content',\n    description: 'Fetch the rendered content of a single clinical note listed by get_visit_notes.',\n    kind: 'read',\n    group: 'Visits',\n    params: [\n      { name: 'csn', type: 'string', description: 'Visit CSN from get_past_visits.', required: true },\n      { name: 'lrp_id', type: 'string', description: 'lrpID from get_visit_notes.', required: true },\n      { name: 'hno_id', type: 'string', description: 'hnoID of the chosen note.', required: true },\n      { name: 'hno_dat', type: 'string', description: 'hnoDAT of the chosen note.', required: true },\n    ],\n    run: (request, args) =>\n      fetchNoteContentRaw(request, {\n        csn: requireStr(args, 'csn'),\n        lrpId: requireStr(args, 'lrp_id'),\n        hnoId: requireStr(args, 'hno_id'),\n        hnoDat: requireStr(args, 'hno_dat'),\n      }),\n    processor: noteContentProcessor,\n  },\n  {\n    id: 'get_visit_avs',\n    title: 'After Visit Summary',\n    description: 'The After Visit Summary for a past visit.',\n    kind: 'read',\n    group: 'Visits',\n    params: [{ name: 'csn', type: 'string', description: 'Visit CSN from get_past_visits.', required: true }],\n    run: (request, args) => fetchVisitAvsRaw(request, requireStr(args, 'csn')),\n    processor: noteContentProcessor,\n  },\n\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../core/makeAuthenticatedRequest';\nimport * as cheerio from 'cheerio';\nimport * as tough from 'tough-cookie';\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport type { RawCollector } from '../core/rawResponse';\nimport type { RequestConfig } from '../core/types';\nimport { fetchSessionCsrfToken } from '../core/csrf';\nimport { scraperFetch } from '../../http';\nimport { logger } from '../../../shared/logger';\n\nexport interface FdiContext {\n  fdi: string;\n  ord: string;\n}\n\nexport interface ImagingViewerSession {\n  /** The SAML URL from FdiData - opens the image viewer when navigated to in a browser */\n  samlUrl: string;\n  /** The eUnity viewer URL (only available after following SAML chain) */\n  viewerUrl?: string;\n  /** JSESSIONID cookie for eUnity (only available after following SAML chain) */\n  jsessionId?: string;\n}\n\n/**\n * Extract `data-fdi-context` (containing fdi and ord params) from report content HTML.\n * This is embedded in the HTML returned by the LoadReportContent API when the report\n * has an associated image viewer link.\n */\nexport function extractFdiContext(reportContentHtml: string): FdiContext | null {\n  const $ = cheerio.load(reportContentHtml);\n  const fdiElement = $('[data-fdi-context]');\n  if (fdiElement.length === 0) return null;\n\n  try {\n    const raw = fdiElement.attr('data-fdi-context');\n    if (!raw) return null;\n    const parsed = JSON.parse(raw);\n    if (parsed.fdi && parsed.ord) {\n      return { fdi: parsed.fdi, ord: parsed.ord };\n    }\n  } catch {\n    // data-fdi-context wasn't valid JSON\n  }\n  return null;\n}\n\n/**\n * Extract the fdi/ord pair from a result's `fdiLink.redirectUrl`.\n *\n * Some instances (observed on Mass General Brigham) never embed a\n * `data-fdi-context` attribute in the report HTML — instead each result\n * carries a structured `fdiLink` whose redirectUrl is\n * `/Extensibility/Redirection/FdiRedirection?fdi=…&ord=…`, the same pair the\n * FdiData API takes. The tokens are MyChart's own `WP-…` encoding and contain\n * no `%` escapes, so URLSearchParams returns them verbatim.\n */\nexport function extractFdiContextFromFdiLink(redirectUrl: string): FdiContext | null {\n  const queryStart = redirectUrl.indexOf('?');\n  if (queryStart < 0) return null;\n  const params = new URLSearchParams(redirectUrl.slice(queryStart + 1));\n  const fdi = params.get('fdi');\n  const ord = params.get('ord');\n  if (!fdi || !ord) return null;\n  return { fdi, ord };\n}\n\n/** What `/api/report-content/LoadReportContent` answers. Read it through `rec<ReportContent>()`. */\nexport type ReportContent = {\n  reportContent?: string;\n  reportCss?: string;\n  baseFontSize?: number;\n  stylesheets?: string[];\n}\n\n/**\n * Call the FdiData API to get the SAML URL that leads to the eUnity image viewer.\n *\n * Flow: MyChart → FdiData → SAML STS URL → (browser follows SAML chain) → eUnity viewer\n *\n * With a `collector`, the FdiData exchange is recorded in the caller's raw\n * envelope (the CSRF token fetch is not — it is session plumbing, not data).\n */\nexport async function getImageViewerSamlUrl(\n  mychartRequest: MyChartRequest,\n  fdiContext: FdiContext,\n  collector?: RawCollector,\n): Promise<ImagingViewerSession | null> {\n  const token = await fetchSessionCsrfToken(mychartRequest);\n  if (!token) {\n    logger.debug('Could not get CSRF token for FdiData');\n    return null;\n  }\n\n  const config: RequestConfig = {\n    path: `/Extensibility/Redirection/FdiData?fdi=${encodeURIComponent(fdiContext.fdi)}&ord=${encodeURIComponent(fdiContext.ord)}&patientIndex=undefined&noCache=${Math.random()}`,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded',\n    },\n    body: `__RequestVerificationToken=${encodeURIComponent(token)}`,\n    followRedirects: false,\n  };\n\n  let status: number;\n  let ok: boolean;\n  let data: unknown;\n  if (collector) {\n    // Best-effort: an order without a working viewer is still an order, so a\n    // failed FdiData exchange is recorded and reported as \"no viewer\".\n    const recorded = await collector.send(config, { tolerateFailure: true });\n    ({ status, ok } = recorded.response);\n    data = recorded.body;\n  } else {\n    const res = await makeAuthenticatedRequest(mychartRequest, config);\n    ({ status, ok } = res);\n    data = ok ? ((await res.json()) as unknown) : undefined;\n  }\n\n  if (!ok) {\n    logger.debug('FdiData request failed:', status);\n    return null;\n  }\n\n  const url = (data as { url?: unknown } | null)?.url;\n  if (typeof url !== 'string' || !url) {\n    logger.debug('FdiData response missing URL');\n    return null;\n  }\n\n  return { samlUrl: url };\n}\n\n/**\n * Follow the SAML chain from the STS URL to get an eUnity viewer session.\n *\n * Chain: STS URL → HTML form with SAMLResponse → POST to redirect endpoint →\n *        meta-refresh to selfauth → 302 redirect chain → eUnity server\n *\n * Uses its own cookie jar, and returns it alongside viewerUrl and jsessionId\n * so callers can keep making authenticated requests to eUnity.\n *\n * TODO: this should be the session's jar, not a second one. The original\n * reason given was to avoid \"polluting\" the MyChart jar, which doesn't hold —\n * tough-cookie scopes every cookie to its domain, so eUnity's cookies could\n * never have reached MyChart requests in the first place. The real difference\n * is the other direction: starting empty means the first hop, which is on the\n * MyChart host, goes out without the session cookies it would otherwise carry.\n * It works today because the STS URL is itself an authenticated token, but\n * unifying is a change to the live imaging path and wants a real-instance test\n * rather than a drive-by.\n */\nexport async function followSamlChain(\n  _mychartRequest: MyChartRequest,\n  samlUrl: string\n): Promise<{ viewerUrl: string; jsessionId: string; cookieJar: tough.CookieJar; viewerBody: string } | null> {\n  const jar = new tough.CookieJar();\n\n  // Helper: make a request against this chain's jar, manually following\n  // redirects. Headers, the per-host permit and the deadline come from scraperFetch.\n  // The SAML loop below carries `body`/`contentType` as locals that are undefined\n  // on the GET hops, so they're `| undefined` rather than merely optional.\n  async function req(url: string, opts: { method?: string | undefined; body?: string | undefined; contentType?: string | undefined } = {}) {\n    const headers: Record<string, string> = {};\n    if (opts.contentType) headers['Content-Type'] = opts.contentType;\n    return scraperFetch(url, {\n      method: opts.method || 'GET',\n      redirect: 'manual',\n      headers,\n      // A bodyless hop omits the key rather than sending `body: undefined`.\n      ...(opts.body !== undefined ? { body: opts.body } : {}),\n    }, { cookieJar: jar });\n  }\n\n  async function makeViewerResult(viewerUrl: string, viewerBody: string) {\n    const eunityOrigin = new URL(viewerUrl).origin;\n    const jsessionCookies = await jar.getCookies(eunityOrigin);\n    const jsession = jsessionCookies.find(c => c.key === 'JSESSIONID');\n    return { viewerUrl, jsessionId: jsession?.value ?? '', cookieJar: jar, viewerBody };\n  }\n\n  try {\n    let url = samlUrl;\n    let method = 'GET';\n    let body: string | undefined;\n    let contentType: string | undefined;\n    let maxSteps = 15;\n\n    while (maxSteps > 0) {\n      maxSteps--;\n      const res = await req(url, { method, body, contentType });\n\n      // HTTP redirect — follow it\n      if ([301, 302, 303, 307].includes(res.status)) {\n        const loc = res.headers.get('location');\n        if (!loc) break;\n        url = new URL(loc, url).href;\n        logger.debug(`  [SAML] ${res.status} -> ${url}`);\n        method = 'GET';\n        body = undefined;\n        contentType = undefined;\n\n        // Check if we've reached eUnity (detected by /e/viewer path)\n        if (url.includes('/e/viewer') || url.includes('/eUnity/viewer')) {\n          const viewerRes = await req(url);\n          return await makeViewerResult(url, viewerRes.status === 200 ? await viewerRes.text() : '');\n        }\n        continue;\n      }\n\n      // 200 response — check for meta-refresh or auto-submit form\n      if (res.status === 200) {\n        const html = await res.text();\n        logger.debug(`  [SAML] 200 at ${url} (${html.length} chars)`);\n        if (html.length < 3000) logger.debug(`  [SAML] Body: ${html.substring(0, 2000)}`);\n\n        // Check for meta-refresh: <meta http-equiv=\"refresh\" content=\"0;URL='https://...'\">\n        const metaMatch = (/http-equiv=\"refresh\"\\s+content=\"[^\"]*URL='([^']+)'/i.exec(html)) ??\n                          (/http-equiv=\"refresh\"\\s+content=\"[^\"]*url=([^\"'\\s>]+)/i.exec(html));\n        if (metaMatch) {\n          url = new URL(metaMatch[1]!, url).href; // both patterns have one mandatory capture group; noUncheckedIndexedAccess\n          method = 'GET';\n          body = undefined;\n          contentType = undefined;\n          continue;\n        }\n\n        // Check for JavaScript redirect (e.g. window.location.href = '...')\n        // The redirecttoviewer page uses JS to redirect to eUnity\n        const jsRedirectMatch = /(?:window|document)\\.location\\.href\\s*=\\s*(?:url\\d*|'([^']+)'|\"([^\"]+)\")/i.exec(html);\n        if (jsRedirectMatch) {\n          // If it's a variable reference (url2, url3), extract the URL from the var declaration\n          let targetUrl = jsRedirectMatch[1] || jsRedirectMatch[2];\n          if (!targetUrl) {\n            // Variable reference — look for the var declaration\n            const varMatch = /var\\s+url\\s*=\\s*'([^']+)'/.exec(html);\n            if (varMatch) {\n              targetUrl = varMatch[1]!.replace(/&amp;/g, '&'); // pattern has one mandatory capture group; noUncheckedIndexedAccess\n            }\n          }\n          if (targetUrl) {\n            url = new URL(targetUrl, url).href;\n            method = 'GET';\n            body = undefined;\n            contentType = undefined;\n            logger.debug(`  [SAML] JS redirect -> ${url}`);\n            continue;\n          }\n        }\n\n        // Check for auto-submit SAML form\n        const $ = cheerio.load(html);\n        const form = $('form');\n        if (form.length > 0) {\n          const action = form.attr('action');\n          if (action) {\n            const formData = new URLSearchParams();\n            form.find('input[type=\"hidden\"]').each((_, el) => {\n              const name = $(el).attr('name');\n              const value = $(el).attr('value');\n              if (name) formData.set(name, value || '');\n            });\n            url = new URL(action, url).href;\n            method = 'POST';\n            body = formData.toString();\n            contentType = 'application/x-www-form-urlencoded';\n            continue;\n          }\n        }\n\n        if (url.includes('/e/viewer') || url.includes('/eUnity/viewer')) {\n          return await makeViewerResult(url, html);\n        }\n\n        // Reached a page that's not eUnity and has no redirect\n        logger.debug('SAML chain stopped at:', url);\n        break;\n      }\n\n      // Other status\n      logger.debug(`SAML chain unexpected status ${res.status} at ${url}`);\n      break;\n    }\n\n    logger.debug('SAML chain did not reach eUnity viewer');\n    return null;\n  } catch (err) {\n    logger.debug('Error following SAML chain:', (err as Error).message);\n    return null;\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Lab results processor. Field decisions: docs/processor-layer-proposal.md, `get_lab_results`.\n *\n * The scraper records four `GetList` calls (one per group type; the ones the\n * instance does not serve come back 500, faithfully) and then, per order, a\n * `GetDetails`, a `GetMultipleHistoricalResultComponents` and, when the\n * result names a report, a `LoadReportContent`. This joins the three onto\n * the order by the request bodies the scraper posted (`orderKey`, `orderID`,\n * `reportID` + `assumedVariables`) and lifts the encounter context off the\n * `GetList` group.\n *\n * `abnormalFlagCategoryValue` is in `raw` only: it is the literal `\"Unknown\"`\n * on every captured component, out-of-range ones included (#375). Neither\n * mode derives an abnormal verdict; `valueText`, `numericValue` and the\n * reference range pass through and that judgement is the client's.\n */\n\nimport { findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { ReportContent } from '../../eunity/imagingViewer';\nimport { htmlToText } from '../../processors/htmlText';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, strings, text, textOrNull } from '../../processors/read';\nimport type { DetailsResult, FdiLink, GetMultipleHistoricalResultComponents, ImageStudy, Narrative, ReferenceRange, Scan, TestResultDetails, TestResultList } from './mychart.types';\nimport type { HistoricalComponentStandard, HistoricalPointStandard, LabComponentStandard, LabOrderConcise, LabOrderStandard, LabResultStandard, LabResultsStandard, OrderMetadataStandard, ReferenceRangeStandard, SignedTextStandard, StudyResultStandard } from './standardized.types';\n\nexport type { HistoricalComponentStandard, HistoricalPointStandard, ImageStudyStandard, LabComponentStandard, LabOrderConcise, LabOrderStandard, LabResultStandard, LabResultsStandard, OrderMetadataStandard, ProviderCommentStandard, ReferenceRangeStandard, ResultingLabStandard, ScanStandard, SignedTextStandard, StudyResultStandard } from './standardized.types';\n\n/** How many trend points the concise view keeps per component. */\nexport const CONCISE_TREND_POINTS = 8;\n\nfunction scalarOrNull(value: unknown): string | number | null {\n  return typeof value === 'string' || typeof value === 'number' ? value : null;\n}\n\nfunction referenceRange(value: unknown): ReferenceRangeStandard {\n  const r = rec<ReferenceRange>(value);\n  return {\n    formattedReferenceRange: textOrNull(r.formattedReferenceRange),\n    low: num(r.low),\n    high: num(r.high),\n    displayLow: textOrNull(r.displayLow),\n    displayHigh: textOrNull(r.displayHigh),\n    lowerBoundExclusive: boolOrNull(r.lowerBoundExclusive),\n    upperBoundExclusive: boolOrNull(r.upperBoundExclusive),\n  };\n}\n\nfunction signedText(value: unknown): SignedTextStandard {\n  const s = rec<Narrative>(value);\n  return { contentAsString: textOrNull(s.contentAsString), signingInstantTimestamp: textOrNull(s.signingInstantTimestamp) };\n}\n\nfunction component(value: unknown): LabComponentStandard {\n  const c = rec(value);\n  const info = rec(c.componentInfo);\n  const resultInfo = rec(c.componentResultInfo);\n  const rawValue = textOrNull(resultInfo.value);\n  return {\n    componentInfo: {\n      componentID: textOrNull(info.componentID),\n      name: textOrNull(info.name),\n      commonName: textOrNull(info.commonName),\n      units: textOrNull(info.units),\n    },\n    componentResultInfo: {\n      valueText: rawValue,\n      numericValue: num(resultInfo.numericValue),\n      isValueRtf: boolOrNull(resultInfo.isValueRtf),\n      referenceRange: referenceRange(resultInfo.referenceRange),\n    },\n    componentComments: { contentAsString: textOrNull(rec(c.componentComments).contentAsString) },\n  };\n}\n\nfunction orderMetadata(value: unknown): OrderMetadataStandard {\n  const m = rec<NonNullable<DetailsResult['orderMetadata']>>(value);\n  const lab = rec(m.resultingLab);\n  return {\n    prioritizedInstantISO: textOrNull(m.prioritizedInstantISO),\n    prioritizedInstantDisplay: textOrNull(m.prioritizedInstantDisplay),\n    resultTimestampDisplay: textOrNull(m.resultTimestampDisplay),\n    latestUpdateInstantISO: textOrNull(m.latestUpdateInstantISO),\n    collectionTimestampsDisplay: textOrNull(m.collectionTimestampsDisplay),\n    specimensDisplay: textOrNull(m.specimensDisplay),\n    resultStatus: textOrNull(m.resultStatus),\n    orderProviderName: textOrNull(m.orderProviderName),\n    authorizingProviderName: textOrNull(m.authorizingProviderName),\n    readingProviderName: textOrNull(m.readingProviderName),\n    resultType: scalarOrNull(m.resultType),\n    associatedDiagnoses: strings(m.associatedDiagnoses),\n    resultingLab: {\n      name: textOrNull(lab.name),\n      address: strings(lab.address),\n      phoneNumber: textOrNull(lab.phoneNumber),\n      labDirector: textOrNull(lab.labDirector),\n      cliaNumber: textOrNull(lab.cliaNumber),\n      accreditationType: textOrNull(lab.accreditationType),\n    },\n  };\n}\n\nfunction studyResult(value: unknown): StudyResultStandard {\n  const s = rec<NonNullable<DetailsResult['studyResult']>>(value);\n  return {\n    narrative: signedText(s.narrative),\n    impression: signedText(s.impression),\n    addenda: list(s.addenda).map(signedText),\n    transcriptions: list(s.transcriptions),\n    ecgDiagnosis: list(s.ecgDiagnosis),\n    hasStudyContent: boolOrNull(s.hasStudyContent),\n    isFullResultText: boolOrNull(s.isFullResultText),\n    isCupidAddendum: boolOrNull(s.isCupidAddendum),\n  };\n}\n\nfunction result(value: unknown, reports: Map<string, string>): LabResultStandard {\n  const r = rec<DetailsResult>(value);\n  const report = rec(r.reportDetails);\n  const reportID = textOrNull(report.reportID);\n  const reportHtml = reportHtmlForResult(reports, r);\n  return {\n    name: textOrNull(r.name),\n    key: textOrNull(r.key),\n    isAbnormal: boolOrNull(r.isAbnormal),\n    hasComment: boolOrNull(r.hasComment),\n    warningType: textOrNull(r.warningType),\n    warningMessage: textOrNull(r.warningMessage),\n    orderMetadata: orderMetadata(r.orderMetadata),\n    resultComponents: list(r.resultComponents).map(component),\n    studyResult: studyResult(r.studyResult),\n    resultNote: signedText(r.resultNote),\n    resultLetter: signedText(r.resultLetter),\n    providerComments: list(r.providerComments).map((c) => ({\n      commentText: textOrNull(rec(c).commentText),\n      providerName: textOrNull(rec(c).providerName),\n      commentDate: textOrNull(rec(c).commentDate),\n    })),\n    reportDetails: { reportID, isDownloadablePDFReport: boolOrNull(report.isDownloadablePDFReport) },\n    reportContentText: reportHtml === null ? null : htmlToText(reportHtml),\n    imageStudies: list(r.imageStudies).map((study) => {\n      const s = rec<ImageStudy>(study);\n      return {\n        studyDescription: textOrNull(s.studyDescription),\n        modality: textOrNull(s.modality),\n        studyDate: textOrNull(s.studyDate),\n        numberOfImages: num(s.numberOfImages),\n      };\n    }),\n    scans: list(r.scans).map((scan) => {\n      const s = rec<Scan>(scan);\n      return { scanType: textOrNull(s.scanType), scanDate: textOrNull(s.scanDate) };\n    }),\n    fdiLink: { redirectUrl: textOrNull(rec<FdiLink>(r.fdiLink).redirectUrl) },\n  };\n}\n\nfunction historicalComponent(value: unknown): HistoricalComponentStandard {\n  const h = rec(value);\n  return {\n    name: textOrNull(h.name),\n    commonName: textOrNull(h.commonName),\n    units: textOrNull(h.units),\n    oldestResultISO: textOrNull(h.oldestResultISO),\n    historicalResultData: list(h.historicalResultData).map((p) => ({\n      dateISO: textOrNull(rec(p).dateISO),\n      value: textOrNull(rec(p).value),\n      numericValue: num(rec(p).numericValue),\n      isValueRtf: boolOrNull(rec(p).isValueRtf),\n      referenceRange: referenceRange(rec(p).referenceRange),\n    })),\n  };\n}\n\n/**\n * `reportID` is the id of a report *template* (Epic's LRP record), and every\n * result of the same kind names the same one — on Mass General Brigham three\n * procedure results years apart all posted one `reportID`. What tells\n * the reports apart is the order in `assumedVariables`, so the join key is\n * the whole identity the scraper posted. Keying on `reportID` alone handed\n * every such result the first one's report.\n */\nfunction reportKey(reportID: string, vars: Record<string, unknown>): string {\n  return JSON.stringify([reportID, text(vars.ordId), text(vars.ordDat)]);\n}\n\n/**\n * The recorded `LoadReportContent` bodies keyed by the report identity the\n * scraper posted. A report that failed (non-JSON body) reads as no report.\n */\nexport function reportHtmlByReport(raw: RawResponse): Map<string, string> {\n  const reports = new Map<string, string>();\n  for (const request of findRequests(raw, 'LoadReportContent')) {\n    const body = rec(request.requestBody);\n    const reportID = text(body.reportID);\n    const html = textOrNull(rec<ReportContent>(request.body).reportContent);\n    if (!reportID || html === null) continue;\n    const key = reportKey(reportID, rec(body.assumedVariables));\n    if (!reports.has(key)) reports.set(key, html);\n  }\n  return reports;\n}\n\n/** The report HTML recorded for one raw `GetDetails` result, or null when it names none. */\nexport function reportHtmlForResult(reports: Map<string, string>, rawResult: unknown): string | null {\n  const details = rec(rec(rawResult).reportDetails);\n  const reportID = text(details.reportID);\n  if (!reportID) return null;\n  return reports.get(reportKey(reportID, rec(details.reportVars))) ?? null;\n}\n\n/** The raw `GetDetails` results recorded for the order with `key`, in the order MyChart sent them. */\nexport function rawResultsForOrder(raw: RawResponse, key: string | null): unknown[] {\n  if (!key) return [];\n  // Mirrors `standard()`'s `key: textOrNull(body.key) ?? orderKey`.\n  const details = findRequests(raw, 'test-results/GetDetails').find(\n    (d) => text(rec<TestResultDetails>(d.body).key) === key || text(rec(d.requestBody).orderKey) === key,\n  );\n  return list(rec<TestResultDetails>(details?.body).results);\n}\n\n/** The `GetList` groups across every recorded page, keyed by order key (first wins). */\nfunction resultGroupsByKey(raw: RawResponse): Map<string, Record<string, unknown>> {\n  const groups = new Map<string, Record<string, unknown>>();\n  for (const page of findRequests(raw, 'test-results/GetList')) {\n    for (const group of list(rec<TestResultList>(page.body).newResultGroups)) {\n      const g = rec(group);\n      const key = text(g.key);\n      if (key && !groups.has(key)) groups.set(key, g);\n    }\n  }\n  return groups;\n}\n\n/** The 8 most recent points, sorted by `dateISO` before capping so the cap keeps the newest whatever order the instance sent (#380). */\nexport function recentTrendPoints(points: HistoricalPointStandard[]): Array<{ dateISO: string | null; value: string | null }> {\n  return [...points]\n    .sort((a, b) => (a.dateISO ?? '').localeCompare(b.dateISO ?? ''))\n    .slice(-CONCISE_TREND_POINTS)\n    .map((p) => ({ dateISO: p.dateISO, value: p.value }));\n}\n\nexport function conciseLabOrder(order: LabOrderStandard): LabOrderConcise {\n  return {\n    orderName: order.orderName,\n    results: order.results.map((r) => ({\n      name: r.name,\n      prioritizedInstantISO: r.orderMetadata.prioritizedInstantISO,\n      resultStatus: r.orderMetadata.resultStatus,\n      orderProviderName: r.orderMetadata.orderProviderName,\n      resultComponents: r.resultComponents.map((c) => ({\n        name: c.componentInfo.name,\n        commonName: c.componentInfo.commonName,\n        units: c.componentInfo.units,\n        valueText: c.componentResultInfo.valueText,\n        formattedReferenceRange: c.componentResultInfo.referenceRange.formattedReferenceRange,\n        contentAsString: c.componentComments.contentAsString,\n      })),\n      narrative: r.studyResult.narrative.contentAsString,\n      impression: r.studyResult.impression.contentAsString,\n      addenda: r.studyResult.addenda.map((a) => a.contentAsString),\n      resultNote: r.resultNote.contentAsString,\n      resultLetter: r.resultLetter.contentAsString,\n      reportContentText: r.reportContentText,\n    })),\n    historicalResults: Object.fromEntries(\n      Object.entries(order.historicalResults).map(([componentID, h]) => [\n        componentID,\n        { name: h.name, historicalResultData: recentTrendPoints(h.historicalResultData) },\n      ]),\n    ),\n  };\n}\n\nexport const labResultsProcessor: Processor<LabResultsStandard> = {\n  standard(raw: RawResponse): LabResultsStandard {\n    const groups = resultGroupsByKey(raw);\n    const reports = reportHtmlByReport(raw);\n    const trends = findRequests(raw, 'GetMultipleHistoricalResultComponents');\n\n    const orders: LabOrderStandard[] = [];\n    for (const details of findRequests(raw, 'test-results/GetDetails')) {\n      const orderKey = text(rec(details.requestBody).orderKey);\n      // A body that is not the order (a WAF page, a literal null for an\n      // unknown key) projects to an all-null order under the key we asked\n      // for; the body itself is in `raw`.\n      const body = rec<TestResultDetails>(details.body);\n      const group = groups.get(orderKey) ?? {};\n      const trend = trends.find((t) => text(rec(t.requestBody).orderID) === orderKey);\n      const historicalResults: Record<string, HistoricalComponentStandard> = {};\n      for (const [componentID, h] of Object.entries(rec(rec<GetMultipleHistoricalResultComponents>(trend?.body).historicalResults))) {\n        historicalResults[componentID] = historicalComponent(h);\n      }\n      orders.push({\n        orderName: textOrNull(body.orderName),\n        key: textOrNull(body.key) ?? (orderKey || null),\n        isInpatient: boolOrNull(group.isInpatient),\n        isEDVisit: boolOrNull(group.isEDVisit),\n        formattedAdmitDate: textOrNull(group.formattedAdmitDate),\n        formattedDischargeDate: textOrNull(group.formattedDischargeDate),\n        results: list(body.results).map((r) => result(r, reports)),\n        historicalResults,\n      });\n    }\n    return { orders };\n  },\n  concise(standard) {\n    return { orders: standard.orders.map(conciseLabOrder) };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Imaging results processor. Field decisions: docs/processor-layer-proposal.md, `get_imaging_results`.\n *\n * Imaging is the lab envelope filtered to imaging orders, plus the handle\n * `download_imaging_study` takes. The filter is a heuristic — an order-name\n * keyword match or imaging-shaped content — and `isImagingByName` /\n * `isImagingByContent` are its audit trail. `image_id` packs the fdi/ord\n * pair found in the report HTML's `data-fdi-context` or in\n * `fdiLink.redirectUrl`; the FdiData response (`samlUrl`) is a single-use\n * viewer entry that expires within minutes, so it stays in `raw`.\n *\n * Today's top-level copies (`reportText`, `narrative`, `impression`,\n * `resultDate`, `orderProvider`) were duplicates of the lab fields and are\n * not carried over.\n */\n\nimport { Base64 } from 'js-base64';\n\nimport type { RawResponse } from '../../core/rawResponse';\nimport { extractFdiContext, extractFdiContextFromFdiLink, type FdiContext } from '../../eunity/imagingViewer';\nimport type { Processor } from '../../processors/processor';\nimport { rec, textOrNull } from '../../processors/read';\nimport type { DetailsResult, FdiLink } from './mychart.types';\nimport type { ImagingOrderConcise, ImagingOrderStandard, ImagingResultsStandard } from './standardized.types';\n\nexport type { ImagingOrderConcise, ImagingOrderStandard, ImagingResultsStandard } from './standardized.types';\nimport {\n  conciseLabOrder,\n  labResultsProcessor,\n  rawResultsForOrder,\n  reportHtmlByReport,\n  reportHtmlForResult,\n  type LabOrderStandard,\n} from './labResults.processor';\n\nconst IMAGING_KEYWORDS = [\n  'x-ray', 'xray', 'xr ', 'mri', 'ct ', 'ct,', 'imaging', 'radiology', 'ultrasound',\n  'fluoroscop', 'arthrogram', 'mammogram', 'oct,', 'oct ', 'pathology', 'excision',\n];\n\nexport function isImagingByName(orderName: string | null): boolean {\n  const lower = (orderName ?? '').toLowerCase();\n  return IMAGING_KEYWORDS.some((keyword) => lower.includes(keyword));\n}\n\n/** Structured images, a narrative or impression, or a report: the shapes only an imaging (or pathology) result has. */\nfunction isImagingByContent(order: LabOrderStandard): boolean {\n  return order.results.some(\n    (r) =>\n      r.imageStudies.length > 0 ||\n      r.scans.length > 0 ||\n      Boolean(r.studyResult.narrative.contentAsString) ||\n      Boolean(r.studyResult.impression.contentAsString) ||\n      Boolean(r.reportDetails.reportID),\n  );\n}\n\nexport function isImagingOrder(order: LabOrderStandard): boolean {\n  return isImagingByName(order.orderName) || isImagingByContent(order);\n}\n\n/**\n * The fdi/ord pair for an order: from the `data-fdi-context` in a result's\n * recorded report HTML, else from the structured `fdiLink` some instances\n * (Mass General Brigham) serve instead. The first result that yields one wins.\n */\nexport function fdiContextForOrder(raw: RawResponse, order: LabOrderStandard): FdiContext | null {\n  const reports = reportHtmlByReport(raw);\n  // Everything the join needs is on the raw result, `fdiLink` included, so\n  // nothing here depends on `standard()` keeping `results` 1:1 with the envelope.\n  for (const rawResult of rawResultsForOrder(raw, order.key)) {\n    const html = reportHtmlForResult(reports, rawResult);\n    const redirectUrl = textOrNull(rec<FdiLink>(rec<DetailsResult>(rawResult).fdiLink).redirectUrl);\n    const fdi = (html ? extractFdiContext(html) : null) ?? (redirectUrl ? extractFdiContextFromFdiLink(redirectUrl) : null);\n    if (fdi) return fdi;\n  }\n  return null;\n}\n\n/**\n * Same encoding as `encodeImageId` in `shared/capabilities/imaging.ts` — duplicated\n * rather than imported because capabilities imports this scraper, and the\n * two must stay byte-for-byte equal so `download_imaging_study` decodes it.\n */\nexport function imageIdFor(fdi: FdiContext): string {\n  return Base64.encodeURI(JSON.stringify({ fdi: fdi.fdi, ord: fdi.ord }));\n}\n\nexport const imagingResultsProcessor: Processor<ImagingResultsStandard> = {\n  standard(raw: RawResponse): ImagingResultsStandard {\n    const orders: ImagingOrderStandard[] = [];\n    for (const order of labResultsProcessor.standard(raw).orders) {\n      const byName = isImagingByName(order.orderName);\n      const byContent = isImagingByContent(order);\n      if (!byName && !byContent) continue;\n      const fdi = fdiContextForOrder(raw, order);\n      orders.push({\n        index: orders.length,\n        image_id: fdi ? imageIdFor(fdi) : null,\n        hasViewableImages: fdi !== null,\n        isImagingByName: byName,\n        isImagingByContent: byContent,\n        ...order,\n      });\n    }\n    return { orders };\n  },\n  concise(standard) {\n    const orders: ImagingOrderConcise[] = standard.orders.map((order) => {\n      const lab = conciseLabOrder(order);\n      return {\n        index: order.index,\n        image_id: order.image_id,\n        hasViewableImages: order.hasViewableImages,\n        orderName: lab.orderName,\n        results: lab.results.map((r, i) => ({ ...r, imageStudies: order.results[i]?.imageStudies ?? [] })),\n        historicalResults: lab.historicalResults,\n      };\n    });\n    return { orders };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { SessionExpiredError } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { followSamlChain, getImageViewerSamlUrl } from '../../eunity/imagingViewer';\nimport { list, rec, text } from '../../processors/read';\nimport type { TestResultDetails, TestResultList } from './mychart.types';\nimport { logger } from '../../../../shared/logger';\nimport { labResultsProcessor, type LabResultsStandard } from './labResults.processor';\nimport { fdiContextForOrder, imagingResultsProcessor, isImagingOrder, type ImagingResultsStandard } from './imagingResults.processor';\n\nexport type {\n  LabResultsStandard,\n  LabOrderStandard,\n  LabOrderConcise,\n  LabResultStandard,\n  LabComponentStandard,\n  ReferenceRangeStandard,\n  SignedTextStandard,\n  StudyResultStandard,\n  ResultingLabStandard,\n  OrderMetadataStandard,\n  ProviderCommentStandard,\n  ImageStudyStandard,\n  ScanStandard,\n  HistoricalPointStandard,\n  HistoricalComponentStandard,\n} from './labResults.processor';\nexport { labResultsProcessor, recentTrendPoints, CONCISE_TREND_POINTS } from './labResults.processor';\nexport type { ImagingResultsStandard, ImagingOrderStandard, ImagingOrderConcise } from './imagingResults.processor';\nexport {\n  imagingResultsProcessor,\n  isImagingByName,\n  imageIdFor,\n} from './imagingResults.processor';\n\nconst TEST_RESULTS_PAGE = '/app/test-results';\n\n/**\n * The group types `GetList` is asked for. Every captured instance accepts 0\n * and 1 — each answering the SAME combined list of labs, imaging and\n * procedures, which is why orders are de-duplicated by key — and rejects 2\n * and 3 with a 500. The accepted pair is the payload; the rest are\n * speculative probes kept for an instance that might differ.\n */\nconst ACCEPTED_GROUP_TYPES = [0, 1];\nconst SPECULATIVE_GROUP_TYPES = [2, 3];\n\n/**\n * One `/api/test-results/GetList` page, or the failure when this instance\n * did not answer for that group type. A failure is recorded with its status\n * (a thrown transport error is not) and handed back, so the caller can tell a\n * rejected speculative probe — expected — from the accepted pair both\n * failing, which is the payload failing. A `SessionExpiredError` still\n * propagates: reporting a dead session as \"unsupported group type\" turns it\n * into an empty chart.\n */\nasync function fetchResultGroupList(\n  collector: RawCollector,\n  groupType: number,\n  token: string,\n): Promise<{ page: unknown } | { failure: Error }> {\n  try {\n    const { body, failure } = await collector.send(\n      {\n        path: '/api/test-results/GetList',\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json', __RequestVerificationToken: token },\n        body: JSON.stringify({ groupType, searchString: '', maxResults: 1000, isCurAdmFilterEnabled: false }),\n      },\n      { tolerateFailure: true },\n    );\n    return failure ? { failure } : { page: body };\n  } catch (err) {\n    if (err instanceof SessionExpiredError) throw err;\n    logger.debug(`test-results GetList failed for groupType ${groupType}:`, (err as Error).message);\n    return { failure: err as Error };\n  }\n}\n\n/** The trend body is best-effort: a failure is recorded (when there was a response) and otherwise tolerated. */\nasync function fetchHistoricalResults(collector: RawCollector, orderKey: string, token: string): Promise<void> {\n  try {\n    await collector.postJson(\n      '/api/past-results/GetMultipleHistoricalResultComponents',\n      token,\n      {\n        orderID: orderKey,\n        selectedComponentIDs: [],\n        isInitialLoad: true,\n        startTime: '',\n        endTime: '',\n        organizationID: '',\n        isCustomFilterEnabled: false,\n        PageNonce: '',\n      },\n      { tolerateFailure: true },\n    );\n  } catch (err) {\n    if (err instanceof SessionExpiredError) throw err;\n    logger.debug(`historical results failed for ${orderKey}:`, (err as Error).message);\n  }\n}\n\n/**\n * Every request behind `get_lab_results`, recorded on `collector`: the page\n * token, `GetList` for group types 0-3, then per unique order key\n * `GetDetails`, `LoadReportContent` for each result that names a report, and\n * `GetMultipleHistoricalResultComponents`. The join is the processor's.\n */\nasync function collectLabResults(collector: RawCollector): Promise<void> {\n  const token = await collector.pageToken(TEST_RESULTS_PAGE);\n  const seenKeys = new Set<string>();\n  // The accepted group types answer the same list, so one of them answering\n  // is the whole list and the other failing costs nothing. Both failing is\n  // the payload failing: the instance has not said \"no results\", and the\n  // first failure is the one to report. A rejected speculative probe is\n  // expected and never an error.\n  const acceptedFailures: Error[] = [];\n\n  for (const groupType of [...ACCEPTED_GROUP_TYPES, ...SPECULATIVE_GROUP_TYPES]) {\n    const outcome = await fetchResultGroupList(collector, groupType, token);\n    if ('failure' in outcome) {\n      if (ACCEPTED_GROUP_TYPES.includes(groupType)) acceptedFailures.push(outcome.failure);\n      continue;\n    }\n    const page = outcome.page;\n\n    // Outside the swallow: these are results the instance says exist, so a\n    // failure here would return a short list indistinguishable from a\n    // complete one — \"you have 39 results\" when you have 60.\n    for (const group of list(rec<TestResultList>(page).newResultGroups)) {\n      const key = text(rec(group).key);\n      if (!key || seenKeys.has(key)) continue;\n      seenKeys.add(key);\n\n      const details = rec<TestResultDetails>(await collector.postJson('/api/test-results/GetDetails', token, { orderKey: key, organizationID: '', PageNonce: '' }));\n      logger.debug('got detail back:', details.orderName);\n\n      for (const result of list(details.results)) {\n        const reportDetails = rec(rec(result).reportDetails);\n        const reportID = text(reportDetails.reportID);\n        if (!reportID) continue;\n        const vars = rec(reportDetails.reportVars);\n        await collector.postJson('/api/report-content/LoadReportContent', token, {\n          reportID,\n          assumedVariables: { ordId: vars.ordId ?? '', ordDat: vars.ordDat ?? '' },\n          isFullReportPage: false,\n          uniqueClass: 'EID-4',\n          nonce: '',\n        });\n      }\n\n      await fetchHistoricalResults(collector, key, token);\n    }\n  }\n\n  if (acceptedFailures.length === ACCEPTED_GROUP_TYPES.length) throw acceptedFailures[0]!;\n}\n\nexport async function fetchLabResultsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  await collectLabResults(collector);\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function listLabResults(mychartRequest: MyChartRequest): Promise<LabResultsStandard> {\n  return labResultsProcessor.standard(await fetchLabResultsRaw(mychartRequest));\n}\n\n/**\n * The lab requests plus, for every imaging order with a viewer context, the\n * `FdiData` exchange that mints the (single-use, short-lived) SAML URL. With\n * `followSaml`, the chain is walked to the eUnity viewer and the final hop is\n * recorded too, since it goes through its own cookie jar rather than the\n * session's request path.\n */\nexport async function fetchImagingResultsRaw(\n  mychartRequest: MyChartRequest,\n  options?: { followSaml?: boolean },\n): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  await collectLabResults(collector);\n\n  const labs = labResultsProcessor.standard(collector.toRaw());\n  for (const order of labs.orders) {\n    if (!isImagingOrder(order)) continue;\n    const fdi = fdiContextForOrder(collector.toRaw(), order);\n    if (!fdi) continue;\n    try {\n      const session = await getImageViewerSamlUrl(mychartRequest, fdi, collector);\n      if (session && options?.followSaml) {\n        const viewer = await followSamlChain(mychartRequest, session.samlUrl);\n        if (viewer) {\n          collector.requests.push({ path: viewer.viewerUrl, method: 'GET', status: 200, contentType: 'text/html', body: viewer.viewerBody });\n        }\n      }\n    } catch (err) {\n      if (err instanceof SessionExpiredError) throw err;\n      logger.debug('Error getting viewer URL:', (err as Error).message);\n    }\n  }\n\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getImagingResults(\n  mychartRequest: MyChartRequest,\n  options?: { followSaml?: boolean },\n): Promise<ImagingResultsStandard> {\n  return imagingResultsProcessor.standard(await fetchImagingResultsRaw(mychartRequest, options));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Minimal AMF3 (Action Message Format 3) binary reader.\n *\n * Decodes the raw AMF3 typed-object stream eUnity's AmfServicesServlet\n * returns (see docs/EUNITY_PROTOCOL.md — no AMF0 envelope, no Flex\n * RemotingMessage). This is the counterpart of the shared Amf3Writer\n * (shared/amf3Writer.ts), and exists so the getStudyListMeta response can\n * be parsed *structurally* — Study → Series → Image — instead of scanning the\n * binary for UID-shaped strings and guessing which is which. The guessing\n * broke on Mass General Brigham multi-slice studies, where a series'\n * frameOfReferenceUID was mistaken for the series UID and every download\n * came back CLOERROR (\"Failed to find image in any supplied providers\").\n *\n * Implements the full AMF3 value grammar (spec §3): reference tables for\n * strings, complex objects and traits; sealed + dynamic objects; dates,\n * arrays, byte arrays, vectors and dictionaries. Externalizable classes\n * carry custom binary bodies that cannot be skipped generically, so only the\n * ones eUnity actually sends are supported (flex.messaging.io.ArrayCollection\n * and ObjectProxy wrap a single AMF3 value; StudyListRequest and\n * StudyListResponse have their own layouts, below); an unknown externalizable\n * class throws, and callers fall back to their own recovery path.\n *\n * This is the repo's ONLY AMF3 reader, and every caller decodes strictly —\n * there is no lenient mode. Resilience belongs at the call site, where each\n * caller knows what a failed decode should cost:\n *\n * - getStudyListMeta responses (imagingDirectDownload.ts): a throw falls back\n *   to the heuristic UID scan. A misdecoded UID must surface as an error,\n *   never as a plausible-but-wrong download request.\n * - CLO wrapper metadata (clo-image-parser/clo_to_bitmap.ts parseWrapper and\n *   sortByPatientPosition.ts): a throw falls back to text-based photometric\n *   detection / the server's image order. The image still renders; only\n *   windowing or slice order degrades, and the fallback logs itself.\n *\n * The writer test (__tests__/imagingDirectDownload.unit.test.ts) also decodes\n * frames with this class. What keeps that from being an encoder checked\n * against its own mirror image is the pinned GOLDEN_FRAME_HEX fixture there:\n * the exact bytes of a frame a real eUnity server accepted. A shared\n * misreading of the AMF3 spec between writer and reader cannot survive a\n * byte-for-byte comparison against a server-verified capture.\n */\n\n/** A decoded AMF3 typed object. Sealed and dynamic members become plain properties. */\nexport interface Amf3Object {\n  /** The AMF3 class name ('' for anonymous objects). */\n  __class: string;\n  [member: string]: unknown;\n}\n\n/** A decoded externalizable object (e.g. ArrayCollection wrapping an array). */\nexport interface Amf3Externalizable {\n  __class: string;\n  /** Distinguishes the wrapper from a sealed object that happens to have a `value` member. */\n  __externalizable: true;\n  /** The value produced by the class's registered body reader. */\n  value: unknown;\n}\n\ninterface Traits {\n  className: string;\n  externalizable: boolean;\n  dynamic: boolean;\n  members: string[];\n}\n\n/**\n * Body readers for externalizable classes. Each consumes the class's custom\n * serialization from the stream and returns the decoded value.\n */\nconst EXTERNALIZABLE_READERS: Record<string, (r: Amf3Reader) => unknown> = {\n  // ArrayCollection and ObjectProxy both externalize as exactly one wrapped AMF3 value.\n  'flex.messaging.io.ArrayCollection': (r) => r.readValue(),\n  'flex.messaging.io.ObjectProxy': (r) => r.readValue(),\n  // StudyListRequest externalizes as: a 4-byte big-endian format header\n  // (value 2), a method-qualifier string (\"getStudyList\"), a version string\n  // (\"1.2.0\"), then the payload object. Mirrors the layout\n  // buildGetStudyListMetaRequest emits (imagingDirectDownload.ts); the writer\n  // test decodes its frames back through this reader.\n  'com.clientoutlook.web.metaservices.StudyListRequest': (r) => ({\n    header: r.readBE32(),\n    qualifier: r.readValue(),\n    version: r.readValue(),\n    payload: r.readValue(),\n  }),\n  // StudyListResponse externalizes as: a 4-byte big-endian format header\n  // (observed value 2, matching the StudyListRequest the writer builds), a\n  // DataRequestStatus value, a version string (\"1.0.0\"), a second 4-byte\n  // big-endian word (opaque; observed 0xEB), then the payload object whose\n  // members include studyList/relevantStudyList. Observed on Mass General\n  // Brigham's eUnity (getStudyListMeta). A response that deviates throws,\n  // and the caller falls back to the heuristic UID scan.\n  'com.clientoutlook.web.metaservices.StudyListResponse': (r) => ({\n    header: r.readBE32(),\n    status: r.readValue(),\n    version: r.readValue(),\n    flags: r.readBE32(),\n    payload: r.readValue(),\n  }),\n};\n\nexport class Amf3Reader {\n  private pos = 0;\n  private readonly strings: string[] = [];\n  private readonly objects: unknown[] = [];\n  private readonly traitsTable: Traits[] = [];\n\n  constructor(private readonly buf: Buffer) {}\n\n  /** Bytes consumed so far. */\n  get offset(): number {\n    return this.pos;\n  }\n\n  private byte(): number {\n    if (this.pos >= this.buf.length) throw new Error('AMF3: unexpected end of buffer');\n    return this.buf[this.pos++]!; // bounds-checked above; noUncheckedIndexedAccess\n  }\n\n  /** Variable-length 29-bit unsigned integer (1–4 bytes; the 4th byte contributes 8 bits). */\n  private readU29(): number {\n    let value = 0;\n    for (let i = 0; i < 3; i++) {\n      const b = this.byte();\n      if ((b & 0x80) === 0) return (value << 7) | b;\n      value = (value << 7) | (b & 0x7f);\n    }\n    return (value << 8) | this.byte();\n  }\n\n  /** Raw 4-byte big-endian word (used inside externalizable bodies). */\n  readBE32(): number {\n    if (this.pos + 4 > this.buf.length) throw new Error('AMF3: unexpected end of buffer');\n    const v = this.buf.readUInt32BE(this.pos);\n    this.pos += 4;\n    return v;\n  }\n\n  private readDoubleValue(): number {\n    if (this.pos + 8 > this.buf.length) throw new Error('AMF3: unexpected end of buffer');\n    const v = this.buf.readDoubleBE(this.pos);\n    this.pos += 8;\n    return v;\n  }\n\n  /** String value without the 0x06 marker (used for member/class names too). */\n  readStringValue(): string {\n    const u29 = this.readU29();\n    if ((u29 & 1) === 0) {\n      const ref = u29 >> 1;\n      if (ref >= this.strings.length) throw new Error(`AMF3: string reference ${ref} out of range`);\n      return this.strings[ref]!; // ref bounds-checked above\n    }\n    const len = u29 >> 1;\n    if (this.pos + len > this.buf.length) throw new Error('AMF3: unexpected end of buffer');\n    const s = this.buf.toString('utf-8', this.pos, this.pos + len);\n    this.pos += len;\n    // The empty string is never added to the reference table (spec §1.3.2).\n    if (len > 0) this.strings.push(s);\n    return s;\n  }\n\n  /** Read one complete AMF3 value from the current position. */\n  readValue(): unknown {\n    const marker = this.byte();\n    switch (marker) {\n      case 0x00: return undefined;\n      case 0x01: return null;\n      case 0x02: return false;\n      case 0x03: return true;\n      case 0x04: {\n        // U29 sign-extended from 29 bits\n        const u = this.readU29();\n        return u & 0x10000000 ? u - 0x20000000 : u;\n      }\n      case 0x05: return this.readDoubleValue();\n      case 0x06: return this.readStringValue();\n      case 0x07: // xml-doc — string-shaped, but referenced via the object table\n      case 0x0b: { // xml\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const len = u29 >> 1;\n        const s = this.buf.toString('utf-8', this.pos, this.pos + len);\n        this.pos += len;\n        this.objects.push(s);\n        return s;\n      }\n      case 0x08: { // date\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const d = new Date(this.readDoubleValue());\n        this.objects.push(d);\n        return d;\n      }\n      case 0x09: return this.readArray();\n      case 0x0a: return this.readObject();\n      case 0x0c: { // byte array\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const len = u29 >> 1;\n        if (this.pos + len > this.buf.length) throw new Error('AMF3: unexpected end of buffer');\n        const bytes = Buffer.from(this.buf.subarray(this.pos, this.pos + len));\n        this.pos += len;\n        this.objects.push(bytes);\n        return bytes;\n      }\n      case 0x0d: // vector<int>\n      case 0x0e: { // vector<uint>\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const count = u29 >> 1;\n        this.byte(); // fixed-length flag\n        const items: number[] = [];\n        this.objects.push(items);\n        for (let i = 0; i < count; i++) {\n          const v = this.buf.readUInt32BE(this.pos);\n          this.pos += 4;\n          items.push(marker === 0x0d && v > 0x7fffffff ? v - 0x100000000 : v);\n        }\n        return items;\n      }\n      case 0x0f: { // vector<double>\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const count = u29 >> 1;\n        this.byte(); // fixed-length flag\n        const items: number[] = [];\n        this.objects.push(items);\n        for (let i = 0; i < count; i++) items.push(this.readDoubleValue());\n        return items;\n      }\n      case 0x10: { // vector<object>\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const count = u29 >> 1;\n        this.byte(); // fixed-length flag\n        this.readStringValue(); // object type name\n        const items: unknown[] = [];\n        this.objects.push(items);\n        for (let i = 0; i < count; i++) items.push(this.readValue());\n        return items;\n      }\n      case 0x11: { // dictionary\n        const u29 = this.readU29();\n        if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n        const count = u29 >> 1;\n        this.byte(); // weak-keys flag\n        const dict = new Map<unknown, unknown>();\n        this.objects.push(dict);\n        for (let i = 0; i < count; i++) {\n          const key = this.readValue();\n          dict.set(key, this.readValue());\n        }\n        return dict;\n      }\n      default:\n        throw new Error(`AMF3: unsupported marker 0x${marker.toString(16)} at offset ${this.pos - 1}`);\n    }\n  }\n\n  private readArray(): unknown {\n    const u29 = this.readU29();\n    if ((u29 & 1) === 0) return this.objects[u29 >> 1];\n    const denseCount = u29 >> 1;\n    const arr: unknown[] & { associative?: Record<string, unknown> } = [];\n    // Added to the reference table before contents are read (supports cycles).\n    this.objects.push(arr);\n    // Associative portion: (name, value) pairs terminated by the empty string.\n    for (;;) {\n      const key = this.readStringValue();\n      if (key === '') break;\n      (arr.associative ??= {})[key] = this.readValue();\n    }\n    for (let i = 0; i < denseCount; i++) arr.push(this.readValue());\n    return arr;\n  }\n\n  private readObject(): unknown {\n    const u29 = this.readU29();\n    if ((u29 & 1) === 0) {\n      const ref = u29 >> 1;\n      if (ref >= this.objects.length) throw new Error(`AMF3: object reference ${ref} out of range`);\n      return this.objects[ref];\n    }\n\n    let traits: Traits;\n    if ((u29 & 2) === 0) {\n      const ref = u29 >> 2;\n      if (ref >= this.traitsTable.length) throw new Error(`AMF3: traits reference ${ref} out of range`);\n      traits = this.traitsTable[ref]!; // ref bounds-checked above\n    } else {\n      traits = {\n        externalizable: (u29 & 4) !== 0,\n        dynamic: (u29 & 8) !== 0,\n        className: this.readStringValue(),\n        members: [],\n      };\n      this.traitsTable.push(traits);\n      if (!traits.externalizable) {\n        const memberCount = u29 >> 4;\n        for (let i = 0; i < memberCount; i++) traits.members.push(this.readStringValue());\n      }\n    }\n\n    if (traits.externalizable) {\n      const reader = EXTERNALIZABLE_READERS[traits.className];\n      if (!reader) {\n        throw new Error(`AMF3: no reader registered for externalizable class ${traits.className}`);\n      }\n      const ext: Amf3Externalizable = { __class: traits.className, __externalizable: true, value: undefined };\n      this.objects.push(ext);\n      ext.value = reader(this);\n      return ext;\n    }\n\n    const obj: Amf3Object = { __class: traits.className };\n    // Added to the reference table before members are read (supports cycles).\n    this.objects.push(obj);\n    for (const member of traits.members) obj[member] = this.readValue();\n    if (traits.dynamic) {\n      for (;;) {\n        const key = this.readStringValue();\n        if (key === '') break;\n        obj[key] = this.readValue();\n      }\n    }\n    return obj;\n  }\n}\n\n/** Decode a buffer containing exactly one AMF3 value (the eUnity response shape). */\nexport function decodeAmf3(buf: Buffer): unknown {\n  return new Amf3Reader(buf).readValue();\n}\n\n/** True for values produced from externalizable classes (ArrayCollection etc.). */\nexport function isAmf3Externalizable(v: unknown): v is Amf3Externalizable {\n  return typeof v === 'object' && v !== null &&\n    (v as { __externalizable?: unknown }).__externalizable === true;\n}\n\n/**\n * Unwrap ArrayCollection/ObjectProxy-style externalizable wrappers so callers\n * can treat `series`/`images` members uniformly as arrays.\n */\nexport function unwrapAmf3(v: unknown): unknown {\n  return isAmf3Externalizable(v) ? v.value : v;\n}\n\n/**\n * Depth-first walk over a decoded AMF3 tree, yielding every typed object with\n * the given class name. Reference-shared objects are visited once.\n */\nexport function collectAmf3Objects(root: unknown, className: string): Amf3Object[] {\n  const found: Amf3Object[] = [];\n  const seen = new Set<object>();\n  const visit = (v: unknown): void => {\n    if (typeof v !== 'object' || v === null) return;\n    if (seen.has(v)) return;\n    seen.add(v);\n    if (Array.isArray(v)) {\n      for (const item of v) visit(item);\n      return;\n    }\n    if (v instanceof Map) {\n      for (const [k, val] of v) {\n        visit(k);\n        visit(val);\n      }\n      return;\n    }\n    if (Buffer.isBuffer(v) || v instanceof Date) return;\n    const obj = v as Record<string, unknown>;\n    if (obj.__class === className) found.push(obj as Amf3Object);\n    for (const key of Object.keys(obj)) {\n      if (key === '__class') continue;\n      visit(obj[key]);\n    }\n  };\n  visit(root);\n  return found;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Anatomical ordering for multi-slice imaging series (CT and MRI stacks).\n *\n * eUnity hands back one image per (series, instance) pair, and\n * `downloadImagingStudyDirect` fetches them in parallel batches — so the raw\n * image list arrives in whatever order the image server answered, which is not\n * even download order, let alone scan order. Each image's CLO wrapper carries\n * the DICOM patient position (`calibration.orientation.positionPatient`), so a\n * stack can be re-ordered the way the scanner swept it: pick the axis the\n * series actually travels along and sort by it.\n *\n * This used to live in the CLI's hand-written `get-imaging` handler, which\n * made the CLI the only client whose CT stacks read head-to-foot. It runs in\n * the shared download path now so every client gets a readable stack.\n */\n\nimport { inflateSync } from 'zlib';\nimport { Amf3Reader } from '../../../shared/amf3Reader';\n\nconst CLOHEADERZ01_MAGIC = Buffer.from('CLOHEADERZ01');\n\n/**\n * Below this much variation (in mm) across a series, the positions are noise\n * or absent, and the original order is kept.\n */\nconst MIN_AXIS_RANGE_MM = 0.1;\n\nexport interface PatientPosition {\n  x: number;\n  y: number;\n  z: number;\n}\n\n/**\n * Read `calibration.orientation.positionPatient` out of a CLO wrapper.\n * Returns null for anything that is not a parsable wrapper with a position —\n * a missing position must never break an image download.\n */\nexport function readPatientPosition(wrapperData: Uint8Array): PatientPosition | null {\n  try {\n    const buf = Buffer.isBuffer(wrapperData) ? wrapperData : Buffer.from(wrapperData);\n    if (buf.length < 16 || !buf.subarray(0, 12).equals(CLOHEADERZ01_MAGIC)) return null;\n    // Strict decode (shared/amf3Reader.ts — the repo's one AMF3 reader). A\n    // wrapper it can't parse throws, the catch below returns null, and the\n    // series keeps the server's order rather than being sorted on garbage.\n    const meta = new Amf3Reader(inflateSync(buf.subarray(16))).readValue() as\n      | { calibration?: { orientation?: { positionPatient?: Record<string, unknown> } } }\n      | undefined;\n    const pos = meta?.calibration?.orientation?.positionPatient;\n    if (!pos || typeof pos !== 'object') return null;\n    return {\n      x: Number(pos.position_x ?? 0),\n      y: Number(pos.position_y ?? 0),\n      z: Number(pos.position_z ?? 0),\n    };\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Re-order each multi-slice series by patient position along its dominant\n * axis. Series stay grouped in first-appearance order; single-image series,\n * images without a wrapper, and series whose positions don't vary are left\n * exactly where they were. The sort is stable, so unparsable slices keep\n * their relative order.\n */\n// `wrapperData` is `| undefined` in the constraint so that callers holding a\n// possibly-undefined buffer still match — the body only ever tests it for\n// falsiness, and narrowing the constraint would drop the caller's own fields.\nexport function sortImagesByPatientPosition<T extends { seriesUID: string; wrapperData?: Uint8Array | undefined }>(\n  images: readonly T[],\n): T[] {\n  const groups = new Map<string, T[]>();\n  for (const image of images) {\n    let group = groups.get(image.seriesUID);\n    if (!group) groups.set(image.seriesUID, (group = []));\n    group.push(image);\n  }\n\n  const out: T[] = [];\n  for (const group of groups.values()) {\n    if (group.length > 1) {\n      const positioned = group.map((image) => ({\n        image,\n        // Missing/unparsable positions sort as the origin, like the rest of\n        // the CLO pipeline treats absent metadata.\n        pos: (image.wrapperData && readPatientPosition(image.wrapperData)) || { x: 0, y: 0, z: 0 },\n      }));\n      const range = (axis: keyof PatientPosition) => {\n        const values = positioned.map((p) => p.pos[axis]);\n        return Math.max(...values) - Math.min(...values);\n      };\n      const rx = range('x');\n      const ry = range('y');\n      const rz = range('z');\n      if (Math.max(rx, ry, rz) > MIN_AXIS_RANGE_MM) {\n        const axis: keyof PatientPosition = rx >= ry && rx >= rz ? 'x' : ry >= rz ? 'y' : 'z';\n        positioned.sort((a, b) => a.pos[axis] - b.pos[axis]);\n        out.push(...positioned.map((p) => p.image));\n        continue;\n      }\n    }\n    out.push(...group);\n  }\n  return out;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The repo's only AMF3 (Action Message Format 3) writer.\n *\n * Two very different things encode AMF3 here, and both must agree byte-for-byte\n * with what a real ClientOutlook/eUnity server accepts:\n *\n * - the scraper, building `AmfServicesServlet` request frames\n *   (`scrapers/myChart/eunity/imagingDirectDownload.ts`)\n * - fake-mychart, answering those frames and synthesizing the CLO wrappers its\n *   image servlet serves — plus `generate_clo.ts`, which writes the committed\n *   `.clo` fixtures fake-mychart serves for single-wrapper series\n *\n * They used to be three separate copies of this class, and they drifted: the\n * fixture writer emitted no string reference table (so a reader bug in\n * reference handling could not be caught by any fixture) and named the wrapper\n * root class `ImageDescription` where real servers send\n * `com.clientoutlook.data.ImageDescription`. Nothing failed, because every\n * reader in the repo matches on member names and never on the class name.\n *\n * The counterpart reader is `amf3Reader.ts` beside this file, shared by the\n * eUnity client and the CLO decoder. That the two are not\n * mirror images of one shared misreading is pinned by `GOLDEN_FRAME_HEX` in\n * `scrapers/myChart/eunity/__tests__/imagingDirectDownload.unit.test.ts`: the\n * exact bytes of a request frame a real eUnity server accepted.\n *\n * Two writing styles are supported, because the callers genuinely differ:\n *\n * - **callback style** (`writeTypedObject(className, members, [w => …])`) —\n *   exact control over every marker, which is what request frames and faithful\n *   server responses need (integer vs double is observable on the wire).\n * - **value style** (`writeValue(literal)`) — a plain JS object tree using the\n *   `_class` / `_externalizable` / `_value` conventions, for fixture-shaped\n *   code where readability beats marker-level control. Wrap a number in\n *   {@link amf3Double} where the double marker is load-bearing.\n */\n\n/** A number that must go out as an AMF3 double, even when it is integral. */\nexport interface Amf3Double {\n  readonly __amf3Double: number;\n}\n\n/** Force the double marker (0x05) for a value {@link Amf3Writer.writeValue} would otherwise write as an integer. */\nexport function amf3Double(value: number): Amf3Double {\n  return { __amf3Double: value };\n}\n\nfunction isAmf3Double(v: unknown): v is Amf3Double {\n  return typeof v === 'object' && v !== null && typeof (v as Amf3Double).__amf3Double === 'number';\n}\n\n/** An object literal for {@link Amf3Writer.writeValue}. `_class` names the AMF3 class; every other key is a sealed member. */\nexport interface Amf3ObjectLiteral {\n  /** AMF3 class name ('' or absent for an anonymous object). */\n  _class?: string;\n  /** Marks an externalizable class whose body is exactly one wrapped value (ArrayCollection, ObjectProxy). */\n  _externalizable?: boolean;\n  /** The wrapped value, for `_externalizable` literals. */\n  _value?: Amf3Value;\n  [member: string]: Amf3Value | undefined;\n}\n\n/** Anything {@link Amf3Writer.writeValue} can encode. */\nexport type Amf3Value =\n  | null\n  | undefined\n  | boolean\n  | number\n  | string\n  | Buffer\n  | Amf3Double\n  | Amf3Value[]\n  | Amf3ObjectLiteral;\n\n/** An externalizable ArrayCollection literal — how eUnity wraps every object list. */\nexport function amf3ArrayCollection(items: Amf3Value[]): Amf3ObjectLiteral {\n  return { _class: 'flex.messaging.io.ArrayCollection', _externalizable: true, _value: items };\n}\n\nexport class Amf3Writer {\n  private readonly buf: number[] = [];\n  private readonly stringTable: string[] = [];\n\n  /** Variable-length 29-bit unsigned integer (1–4 bytes; the 4th byte contributes 8 bits). */\n  private writeU29(value: number) {\n    if (value < 0x80) {\n      this.buf.push(value);\n    } else if (value < 0x4000) {\n      this.buf.push(((value >> 7) & 0x7f) | 0x80, value & 0x7f);\n    } else if (value < 0x200000) {\n      this.buf.push(((value >> 14) & 0x7f) | 0x80, ((value >> 7) & 0x7f) | 0x80, value & 0x7f);\n    } else {\n      this.buf.push(\n        ((value >> 22) & 0x7f) | 0x80,\n        ((value >> 15) & 0x7f) | 0x80,\n        ((value >> 8) & 0x7f) | 0x80,\n        value & 0xff,\n      );\n    }\n  }\n\n  writeNull() { this.buf.push(0x01); }\n  writeFalse() { this.buf.push(0x02); }\n  writeTrue() { this.buf.push(0x03); }\n\n  /**\n   * AMF3 integer. Negative values go out as their 29-bit two's complement\n   * (-1 → 0x1FFFFFFF), which is how real wrappers carry the ImagePhaseInfo\n   * \"undefined\" sentinels; a spec-correct reader sign-extends them back.\n   */\n  writeInteger(value: number) { this.buf.push(0x04); this.writeU29(value & 0x1fffffff); }\n\n  writeDouble(value: number) {\n    this.buf.push(0x05);\n    const b = Buffer.alloc(8);\n    b.writeDoubleBE(value);\n    this.buf.push(...b);\n  }\n\n  writeString(str: string) { this.buf.push(0x06); this.writeStringValue(str); }\n\n  /** AMF3 byte array — how real wrappers carry a VOI LUT table. */\n  writeByteArray(bytes: Buffer) {\n    this.buf.push(0x0c);\n    this.writeU29((bytes.length << 1) | 1);\n    for (const b of bytes) this.buf.push(b);\n  }\n\n  /**\n   * String value without the 0x06 marker; maintains the reference table.\n   * Class names and member names go through here too, exactly as the reader\n   * pushes them onto its own table — the two orders must stay in step.\n   */\n  private writeStringValue(str: string) {\n    if (str === '') {\n      // The empty string is never a reference (spec §1.3.2): U29 = 1, length 0.\n      this.writeU29(1);\n      return;\n    }\n    const ref = this.stringTable.indexOf(str);\n    if (ref >= 0) {\n      this.writeU29(ref << 1); // reference: index << 1, inline bit clear\n      return;\n    }\n    this.stringTable.push(str);\n    const bytes = Buffer.from(str, 'utf-8');\n    this.writeU29((bytes.length << 1) | 1);\n    this.buf.push(...bytes);\n  }\n\n  /** Raw 4-byte big-endian word (externalizable bodies such as StudyListRequest use these). */\n  writeBE32(value: number) {\n    this.buf.push((value >> 24) & 0xff, (value >> 16) & 0xff, (value >> 8) & 0xff, value & 0xff);\n  }\n\n  /**\n   * Sealed typed object: class name, member names, then member values in order.\n   * Traits bits: 0x03 | (memberCount << 4).\n   */\n  writeTypedObject(className: string, members: string[], values: ((w: Amf3Writer) => void)[]) {\n    this.buf.push(0x0a);\n    this.writeU29(0x03 | (members.length << 4));\n    this.writeStringValue(className);\n    for (const name of members) this.writeStringValue(name);\n    for (const value of values) value(this);\n  }\n\n  /**\n   * Dynamic object: sealed members followed by key/value pairs, terminated by\n   * the empty string. Traits bits: 0x0B (inline traits + dynamic) | (sealedCount << 4).\n   */\n  writeDynamicObject(\n    className: string,\n    sealedMembers: string[],\n    sealedValues: ((w: Amf3Writer) => void)[],\n    dynamicPairs: [string, (w: Amf3Writer) => void][],\n  ) {\n    this.buf.push(0x0a);\n    this.writeU29(0x0b | (sealedMembers.length << 4));\n    this.writeStringValue(className);\n    for (const name of sealedMembers) this.writeStringValue(name);\n    for (const value of sealedValues) value(this);\n    for (const [key, value] of dynamicPairs) {\n      this.writeStringValue(key);\n      value(this);\n    }\n    this.writeStringValue('');\n  }\n\n  /**\n   * Externalizable object: class name followed by a custom binary body.\n   * Traits bits: 0x07 (inline object + inline traits + externalizable).\n   */\n  writeExternalizableObject(className: string, body: (w: Amf3Writer) => void) {\n    this.buf.push(0x0a);\n    this.writeU29(0x07);\n    this.writeStringValue(className);\n    body(this);\n  }\n\n  /** Dense array with an empty associative section. */\n  writeArray(items: ((w: Amf3Writer) => void)[]) {\n    this.buf.push(0x09);\n    this.writeU29((items.length << 1) | 1);\n    this.writeStringValue('');\n    for (const item of items) item(this);\n  }\n\n  /** ArrayCollection — how eUnity wraps every object list. */\n  writeArrayCollection(items: ((w: Amf3Writer) => void)[]) {\n    this.writeExternalizableObject('flex.messaging.io.ArrayCollection', (w) => w.writeArray(items));\n  }\n\n  /**\n   * Write a plain JS value tree (the value style described at the top of this\n   * file). Integral numbers in AMF3 integer range take the integer marker —\n   * wrap them with {@link amf3Double} where the double marker matters.\n   */\n  writeValue(value: Amf3Value) {\n    if (value === null || value === undefined) {\n      this.writeNull();\n    } else if (Buffer.isBuffer(value)) {\n      this.writeByteArray(value);\n    } else if (typeof value === 'boolean') {\n      if (value) this.writeTrue();\n      else this.writeFalse();\n    } else if (isAmf3Double(value)) {\n      this.writeDouble(value.__amf3Double);\n    } else if (typeof value === 'number') {\n      if (Number.isInteger(value) && value >= -0x10000000 && value < 0x20000000) this.writeInteger(value);\n      else this.writeDouble(value);\n    } else if (typeof value === 'string') {\n      this.writeString(value);\n    } else if (Array.isArray(value)) {\n      this.writeArray(value.map((item) => (w: Amf3Writer) => w.writeValue(item)));\n    } else {\n      this.writeObjectLiteral(value);\n    }\n  }\n\n  private writeObjectLiteral(obj: Amf3ObjectLiteral) {\n    const className = obj._class ?? '';\n    if (obj._externalizable) {\n      // The only externalizable body shape real CLO wrappers use: exactly one\n      // wrapped AMF3 value (ArrayCollection, ObjectProxy).\n      this.writeExternalizableObject(className, (w) => w.writeValue(obj._value));\n      return;\n    }\n    const members = Object.keys(obj).filter((key) => key !== '_class');\n    this.writeTypedObject(\n      className,\n      members,\n      members.map((key) => (w: Amf3Writer) => w.writeValue(obj[key])),\n    );\n  }\n\n  toBuffer(): Buffer {\n    return Buffer.from(this.buf);\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Direct HTTP image downloader for eUnity DICOM viewer.\n *\n * Downloads images from eUnity WITHOUT Playwright by:\n * 1. Following the SAML chain (built-in fetch) to get JSESSIONID on eunitypg\n * 2. Calling AmfServicesServlet to initialize the session for a study\n * 3. Calling CustomImageServlet to download pixel data\n *\n * The eUnity server uses a proprietary AMF protocol:\n * - Request/response type: com.clientoutlook.web.metaservices.AmfServicesMessage\n * - messageType = \"call\" for requests, \"response\" for responses\n * - body = AmfServicesRequest for requests, AmfServicesResponse for responses\n *\n * Protocol reverse-engineered from eUnity's Dart/WASM viewer network traffic.\n */\nimport type * as tough from 'tough-cookie';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { type FdiContext, followSamlChain, getImageViewerSamlUrl } from './imagingViewer';\nimport { scraperFetch } from '../../http';\nimport { sortImagesByPatientPosition } from '../clo-image-parser/sortByPatientPosition';\nimport { logger } from '../../../shared/logger';\nimport { type Amf3Object, collectAmf3Objects, decodeAmf3, unwrapAmf3 } from '../../../shared/amf3Reader';\nimport { Amf3Writer } from '../../../shared/amf3Writer';\nimport { detailedMessage } from '../../../shared/detailedError';\n\n// ─── AMF3 Request Construction ───\n\n/**\n * Build an AMF3 call to AmfServicesServlet.\n *\n * Protocol (reverse-engineered from captured browser traffic):\n * - Outer object: com.clientoutlook.web.metaservices.AmfServicesMessage\n *   - messageID: incrementing string ID (e.g. \"HTTPSimpleLoader_1\")\n *   - messageType: \"call\"\n *   - body: com.clientoutlook.web.metaservices.AmfServicesRequest\n *     - service: service class name (e.g. \"StudyService\")\n *     - method: method name (e.g. \"getStudyListMeta\")\n *     - parameters: array of method arguments (NOT \"args\")\n *\n * Member order matters for AMF3 sealed objects: messageID comes BEFORE messageType.\n */\nfunction buildAmfCall(\n  messageID: string,\n  service: string,\n  method: string,\n  parameters: ((w: Amf3Writer) => void)[],\n): Buffer {\n  // Callback params are numbered by nesting depth (w1, w2, …): each callback\n  // writes to exactly the writer it is handed, so the code stays correct by\n  // construction even if a writer method ever hands down a sub-writer.\n  const w = new Amf3Writer();\n  w.writeTypedObject(\n    'com.clientoutlook.web.metaservices.AmfServicesMessage',\n    ['messageID', 'messageType', 'body'],\n    [\n      (w1) => w1.writeString(messageID),\n      (w1) => w1.writeString('call'),\n      (w1) => w1.writeTypedObject(\n        'com.clientoutlook.web.metaservices.AmfServicesRequest',\n        ['service', 'method', 'parameters'],\n        [\n          (w2) => w2.writeString(service),\n          (w2) => w2.writeString(method),\n          (w2) => w2.writeArray(parameters),\n        ],\n      ),\n    ],\n  );\n  return w.toBuffer();\n}\n\n/**\n * Build the getStudyListMeta AMF request.\n *\n * This is the first call the WASM viewer makes after getting a JSESSIONID.\n * It initializes the server-side session for a specific study, which is\n * required before CustomImageServlet will serve image data (otherwise 403).\n *\n * The single parameter is a StudyListRequest — an Externalizable AMF3 object\n * with a custom binary format containing:\n *   - 4-byte BE header (value 2)\n *   - String \"getStudyList\" (method qualifier)\n *   - String \"1.2.0\" (version)\n *   - Anonymous dynamic object with:\n *     - notUsed: true\n *     - requestedPHI: ArrayCollection wrapping RequestedPHI objects\n *     - environment: Environment object\n *\n * Reverse-engineered from captured browser AMF traffic (748 bytes).\n */\nexport function buildGetStudyListMetaRequest(\n  accession: string,\n  serviceInstance: string,\n  patientId: string,\n): Buffer {\n  // Callback params are numbered by nesting depth (w1…w6): each callback\n  // writes to exactly the writer it is handed, so the code stays correct by\n  // construction even if a writer method ever hands down a sub-writer.\n  return buildAmfCall('HTTPSimpleLoader_1', 'StudyService', 'getStudyListMeta', [\n    (w1) => {\n      // StudyListRequest is Externalizable — custom binary format\n      w1.writeExternalizableObject(\n        'com.clientoutlook.web.metaservices.StudyListRequest',\n        (w2) => {\n          // 4-byte big-endian header (observed value: 2)\n          w2.writeBE32(2);\n          // Method qualifier string\n          w2.writeString('getStudyList');\n          // Version string\n          w2.writeString('1.2.0');\n          // Anonymous sealed object with 3 members and empty class name.\n          // NOT dynamic — the browser uses plain sealed traits (0x33 = 3 members, no dynamic flag).\n          w2.writeTypedObject(\n            '', // empty class name = anonymous object\n            ['notUsed', 'requestedPHI', 'environment'],\n            [\n              // notUsed: true\n              (w3) => w3.writeTrue(),\n              // requestedPHI: ArrayCollection wrapping RequestedPHI objects\n              (w3) => {\n                // ArrayCollection is Externalizable — wraps a standard AMF3 array\n                w3.writeExternalizableObject(\n                  'flex.messaging.io.ArrayCollection',\n                  (w4) => {\n                    w4.writeArray([\n                      (w5) => {\n                        // RequestedPHI sealed object (8 members)\n                        w5.writeTypedObject(\n                          'com.clientoutlook.data.RequestedPHI',\n                          [\n                            'patientId',\n                            'studyUID',\n                            'accessionNumber',\n                            'serviceInstanceParameter',\n                            'serviceInstanceProperties',\n                            'serviceInstance',\n                            'originalServiceInstanceParameter',\n                            'originalServiceInstance',\n                          ],\n                          [\n                            (w6) => w6.writeString(patientId),        // e.g. \"<MRN>$$$<site>\"\n                            (w6) => w6.writeNull(),                    // studyUID: null\n                            (w6) => w6.writeString(accession),         // e.g. \"E48330984\"\n                            (w6) => w6.writeString(''),                // serviceInstanceParameter: empty\n                            (w6) => w6.writeNull(),                    // serviceInstanceProperties: null\n                            (w6) => w6.writeString(serviceInstance),   // e.g. \"EXAMPLEstudystrategy\"\n                            (w6) => w6.writeString(''),                // originalServiceInstanceParameter: empty\n                            (w6) => w6.writeString(serviceInstance),   // originalServiceInstance: same\n                          ],\n                        );\n                      },\n                    ]);\n                  },\n                );\n              },\n              // environment: Environment sealed object (6 members)\n              (w3) => {\n                w3.writeTypedObject(\n                  'com.clientoutlook.data.hangingprotocol.Environment',\n                  ['levelValue', 'level', 'user', 'roles', 'device', 'numberOfScreens'],\n                  [\n                    (w4) => w4.writeNull(),           // levelValue: null\n                    (w4) => w4.writeInteger(0),        // level: 0\n                    (w4) => w4.writeNull(),           // user: null\n                    (w4) => w4.writeNull(),           // roles: null\n                    (w4) => w4.writeString('WEB'),    // device: \"WEB\"\n                    (w4) => w4.writeString('1'),      // numberOfScreens: \"1\"\n                  ],\n                );\n              },\n            ],\n          );\n        },\n      );\n    },\n  ]);\n}\n\n// ─── AMF3 Response Parsing ───\n\ninterface AmfResponse {\n  code: number;\n  response: string | null;\n}\n\n/**\n * Parse the outer AmfServicesMessage response to extract code and response text.\n * Returns null if the response can't be parsed.\n */\nexport function parseAmfResponse(buf: Buffer): AmfResponse | null {\n  // Look for the response pattern: AmfServicesResponse followed by code (integer) and response (string or null)\n  const text = buf.toString('latin1');\n  const codeIdx = text.indexOf('code');\n  if (codeIdx < 0) return null;\n\n  // After \"code\" member name, look for integer marker (0x04) followed by U29 value\n  // The response member follows\n  let pos = buf.indexOf(Buffer.from('code'), 0);\n  if (pos < 0) return null;\n  pos += 4; // skip \"code\"\n\n  // Skip the second member name (either inline or reference)\n  // Look for the AMF3 integer marker after both member names\n  // Find position of the integer marker for code value\n  while (pos < buf.length && buf[pos] !== 0x04 && buf[pos] !== 0x01) pos++;\n  if (pos >= buf.length) return null;\n\n  let code = -1;\n  let response: string | null = null;\n\n  if (buf[pos] === 0x04) { // Integer\n    pos++;\n    // Byte reads are `!`-asserted: positions are bounded by the scan loop above; noUncheckedIndexedAccess.\n    code = buf[pos]! & 0x7F;\n    pos++;\n  }\n\n  // Next value is the response (string or null)\n  if (pos < buf.length) {\n    if (buf[pos] === 0x01) { // null\n      response = null;\n    } else if (buf[pos] === 0x06) { // string\n      pos++;\n      // Read U29 string length\n      let len: number;\n      if (buf[pos]! < 0x80) {\n        len = buf[pos]! >> 1;\n        pos++;\n      } else {\n        len = ((buf[pos]! & 0x7F) << 7) | buf[pos + 1]!;\n        len >>= 1;\n        pos += 2;\n      }\n      if (len > 0 && pos + len <= buf.length) {\n        response = buf.toString('utf-8', pos, pos + len);\n      }\n    }\n  }\n\n  return { code, response };\n}\n\n// ─── Study Params Extraction ───\n\nexport interface EunityStudyParams {\n  accession: string;\n  serviceInstance: string;\n  patientId: string;\n}\n\n/**\n * Extract study parameters from the eUnity viewer URL and/or page HTML body.\n *\n * The viewer URL may contain study params as query parameters, or the `arg`\n * parameter may be an encrypted blob (Example Health System). In the encrypted case, the\n * params are embedded in the viewer HTML as a JSON config object:\n *   \"accessionNumber\":\"E48330984\"\n *   \"serviceInstance\":\"EXAMPLEstudystrategy\"\n *   \"patientId\":\"<MRN>$$$<site>\"\n *\n * Known URL formats:\n * - Encrypted arg: <eunity-host>/e/viewer?CLOAccessKeyID=...&arg=<encrypted>\n * - Plain arg: <eunity-host>/e/viewer?CLOAccessKeyID=...&arg=accession%3D...\n * - Direct params: <eunity-host>/eUnity/viewer/?accession=...\n */\nexport function parseEunityStudyParams(viewerUrl: string, viewerBody?: string): EunityStudyParams | null {\n  let accession = '';\n  let serviceInstance = '';\n  let patientId = '';\n\n  // Strategy 1: Try URL query parameters\n  try {\n    const url = new URL(viewerUrl);\n    const p = url.searchParams;\n\n    accession = p.get('accession') || p.get('accessionNumber') || '';\n    serviceInstance = p.get('serviceInstance') || '';\n    patientId = p.get('patientId') || p.get('PatID') || '';\n\n    // Try parsing the 'arg' parameter as a query string\n    const arg = p.get('arg');\n    if (arg && !accession) {\n      try {\n        const argParams = new URLSearchParams(arg);\n        if (!accession) accession = argParams.get('accession') || argParams.get('accessionNumber') || '';\n        if (!serviceInstance) serviceInstance = argParams.get('serviceInstance') || '';\n        if (!patientId) patientId = argParams.get('patientId') || argParams.get('PatID') || '';\n      } catch { /* encrypted arg, not a query string */ }\n\n      // Try pipe-delimited\n      if (!accession && arg.includes('|')) {\n        const parts = arg.split('|');\n        if (parts.length >= 3) {\n          // Length checked above; `!` for noUncheckedIndexedAccess.\n          accession = parts[0]!;\n          serviceInstance = parts[1]!;\n          patientId = parts[2]!;\n        }\n      }\n    }\n  } catch { /* invalid URL */ }\n\n  // Strategy 2: Parse the viewer HTML body for the JSON config\n  // The eUnity viewer embeds study params in a large JS config object\n  if ((!accession || !serviceInstance || !patientId) && viewerBody) {\n    // Extract accessionNumber from JSON: \"accessionNumber\":\"E48330984\"\n    if (!accession) {\n      const accMatch = /\"accessionNumber\"\\s*:\\s*\"([^\"]+)\"/.exec(viewerBody);\n      if (accMatch) accession = accMatch[1]!;\n    }\n\n    // Extract serviceInstance from JSON: \"serviceInstance\":\"EXAMPLEstudystrategy\"\n    if (!serviceInstance) {\n      const siMatch = /\"serviceInstance\"\\s*:\\s*\"([^\"]+)\"/.exec(viewerBody);\n      if (siMatch) serviceInstance = siMatch[1]!;\n    }\n\n    // Extract patientId from JSON: \"patientId\":\"<MRN>$$$<site>\"\n    if (!patientId) {\n      const pidMatch = /\"patientId\"\\s*:\\s*\"([^\"]+)\"/.exec(viewerBody);\n      if (pidMatch) patientId = pidMatch[1]!;\n    }\n  }\n\n  if (accession && serviceInstance && patientId) {\n    return { accession, serviceInstance, patientId };\n  }\n\n  logger.debug(`      [PARAMS] Could not extract study params`);\n  logger.debug(`      [PARAMS] accession=${accession}, serviceInstance=${serviceInstance}, patientId=${patientId}`);\n  return null;\n}\n\n// ─── AMF Response Series Parsing ───\n\ninterface ParsedStudyInfo {\n  studyUID: string;\n  series: Array<{\n    seriesUID: string;\n    instanceUID: string;\n    seriesDescription: string;\n  }>;\n}\n\n\n/**\n * Parse the getStudyListMeta response *structurally* with the AMF3 reader:\n * decode the typed-object tree and walk Study → series → images, so every\n * (seriesUID, instanceUID) pair and series description is exact.\n *\n * This is the primary parser. The positional heuristic below remains as the\n * fallback for responses the reader can't decode (e.g. an externalizable\n * class we haven't seen). The heuristic mispaired UIDs on Mass General\n * Brigham multi-slice studies — it took a frameOfReferenceUID for the series UID and\n * the real series UIDs for instances, so every CustomImageServlet request\n * came back CLOERROR \"Failed to find image in any supplied providers\".\n *\n * @param accession When the response carries several studies (priors in\n * relevantStudyList), picks the one whose accessionNumber matches; otherwise\n * the first study with image series wins.\n */\nexport function parseStudySeriesFromAmfStructured(amfBuf: Buffer, accession?: string): ParsedStudyInfo | null {\n  let root: unknown;\n  try {\n    root = decodeAmf3(amfBuf);\n  } catch (err) {\n    logger.debug(`      [AMF-PARSE] Structured decode failed: ${(err as Error).message}`);\n    return null;\n  }\n\n  const studies = collectAmf3Objects(root, 'com.clientoutlook.data.Study');\n  if (studies.length === 0) return null;\n\n  const seriesOf = (study: Amf3Object): Amf3Object[] => {\n    const arr = unwrapAmf3(study.series);\n    if (!Array.isArray(arr)) return [];\n    return arr.filter((s): s is Amf3Object =>\n      typeof s === 'object' && s !== null && typeof (s as Amf3Object).uid === 'string' && !!(s as Amf3Object).uid);\n  };\n\n  const study =\n    (accession ? studies.find((s) => s.accessionNumber === accession && seriesOf(s).length > 0) : undefined) ??\n    studies.find((s) => seriesOf(s).length > 0) ??\n    studies[0];\n  // An empty study list previously crashed on `study.uid`; null is this\n  // function's failure value for a response it can't use.\n  if (!study) return null;\n\n  const studyUID = study.uid;\n  if (typeof studyUID !== 'string' || !studyUID) return null;\n\n  const series: ParsedStudyInfo['series'] = [];\n  let seriesCount = 0;\n  for (const s of seriesOf(study)) {\n    seriesCount++;\n    const seriesUID = s.uid as string;\n    const description = typeof s.description === 'string' && s.description.trim()\n      ? s.description.trim()\n      : `Series ${seriesCount}`;\n\n    const images = unwrapAmf3(s.images);\n    const instances = (Array.isArray(images) ? images : [])\n      .filter((img): img is Amf3Object =>\n        typeof img === 'object' && img !== null && typeof (img as Amf3Object).uid === 'string' && !!(img as Amf3Object).uid)\n      .sort((a, b) => (Number(a.instanceNumber) || 0) - (Number(b.instanceNumber) || 0));\n\n    for (const img of instances) {\n      series.push({ seriesUID, instanceUID: img.uid as string, seriesDescription: description });\n    }\n    logger.debug(`      [AMF-PARSE] ${description}: ${instances.length} instances`);\n  }\n\n  if (series.length === 0) return null;\n  logger.debug(`      [AMF-PARSE] Structured parse: ${series.length} (seriesUID, instanceUID) entries across ${seriesCount} series`);\n  return { studyUID, series };\n}\n\n/**\n * Parse the study/series/instance tree from a getStudyListMeta response:\n * structured AMF3 decode first, positional heuristic as fallback.\n *\n * The fallback is loud on purpose. The heuristic is the parser that mispaired\n * UIDs on Mass General Brigham multi-slice studies and produced a silent\n * zero-image result, so when it runs, the log says so — a future zero-image\n * report must be diagnosable to \"the strict reader couldn't decode this\n * response\" in one step rather than rediscovered from scratch.\n */\nfunction parseStudySeries(amfBuf: Buffer, accession: string): ParsedStudyInfo | null {\n  const structured = parseStudySeriesFromAmfStructured(amfBuf, accession);\n  if (structured) return structured;\n  logger.warn(\n    '      [AMF-PARSE] Structured AMF3 decode failed; falling back to the positional UID heuristic. ' +\n    'UID pairing may be wrong on multi-slice studies — capture this response and extend amf3Reader.ts.',\n  );\n  return parseStudySeriesFromAmf(amfBuf);\n}\n\n/**\n * Parse the AMF getStudyListMeta response to extract study UID and series info.\n *\n * Positional-heuristic fallback for responses {@link parseStudySeriesFromAmfStructured}\n * can't decode.\n *\n * The AMF response contains a structured list where series UIDs appear as boundaries,\n * followed by their instance UIDs. For multi-slice studies (CT scans), each series\n * has many instance UIDs (one per slice).\n *\n * Strategy:\n * 1. Find all DICOM UIDs in the binary (pattern: 1.X.X.X.X...)\n * 2. Filter out DICOM standard SOP Class UIDs (1.2.840.10008.*)\n * 3. Identify the study UID\n * 4. Detect series UIDs: UIDs that appear multiple times in the binary are typically\n *    series UIDs (they appear in headers and as references). UIDs appearing exactly\n *    once are typically instance UIDs.\n * 5. Walk UIDs in position order, using series UIDs as group boundaries\n * 6. Each series entry includes ALL its instance UIDs for complete multi-slice support\n */\nexport function parseStudySeriesFromAmf(amfBuf: Buffer): ParsedStudyInfo | null {\n  const text = amfBuf.toString('latin1');\n\n  // Find all DICOM UIDs with positions (including duplicates for frequency analysis)\n  const uidPattern = /1\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+){2,}/g;\n  const uidOccurrences: Array<{ uid: string; pos: number }> = [];\n  const uidFrequency = new Map<string, number>();\n  const firstPosition = new Map<string, number>();\n  let match;\n  while ((match = uidPattern.exec(text)) !== null) {\n    const uid = match[0];\n    // 1.2.840.10008.* = DICOM standard SOP Class UIDs (universal spec, not institution-specific)\n    // These are type identifiers like \"CT Image Storage\" that appear as metadata,\n    // not study/series/instance UIDs. Defined in the DICOM standard PS3.4.\n    if (uid.startsWith('1.2.840.10008.')) continue;\n    uidOccurrences.push({ uid, pos: match.index });\n    uidFrequency.set(uid, (uidFrequency.get(uid) || 0) + 1);\n    if (!firstPosition.has(uid)) firstPosition.set(uid, match.index);\n  }\n\n  if (uidOccurrences.length === 0) return null;\n\n  const uniqueUIDs = [...new Set(uidOccurrences.map(o => o.uid))];\n  logger.debug(`      [AMF-PARSE] ${uniqueUIDs.length} unique study-related UIDs from ${uidOccurrences.length} occurrences`);\n\n  // Study UID: the first UID in the response (AMF always starts with study-level data)\n  const studyUID = uniqueUIDs[0]!; // uidOccurrences checked non-empty above; noUncheckedIndexedAccess\n\n  // Detect series vs instance UIDs using positional structure analysis.\n  //\n  // The AMF binary lists UIDs in order: series UID, then its instance UIDs.\n  // Within the UID stream, we can detect series boundaries by grouping\n  // consecutive UIDs by their \"parent\" (all segments except the last).\n  // Single-UID sub-groups are series UIDs; multi-UID runs are instances.\n  //\n  // For UIDs with very different roots (e.g., COR/SAG vs NONCONTRAST),\n  // we first split by major root boundary, then analyze within each root.\n\n  const orderedUIDs = [...firstPosition.entries()]\n    .filter(([uid]) => uid !== studyUID)\n    .sort((a, b) => a[1] - b[1])\n    .map(([uid]) => uid);\n\n  // Sub-group by \"parent\" (drop last segment)\n  const getParent = (uid: string) => uid.split('.').slice(0, -1).join('.');\n  const subGroups: Array<{ parent: string; uids: string[] }> = [];\n  let currentParent = '';\n  let currentGroup: string[] = [];\n\n  for (const uid of orderedUIDs) {\n    const parent = getParent(uid);\n    if (parent !== currentParent) {\n      if (currentGroup.length > 0) {\n        subGroups.push({ parent: currentParent, uids: currentGroup });\n      }\n      currentParent = parent;\n      currentGroup = [uid];\n    } else {\n      currentGroup.push(uid);\n    }\n  }\n  if (currentGroup.length > 0) {\n    subGroups.push({ parent: currentParent, uids: currentGroup });\n  }\n\n  // Walk sub-groups to identify series and instance relationships.\n  // Single-UID sub-groups are series UIDs; multi-UID sub-groups are their instances.\n  const candidateSeriesUIDs: string[] = [];\n  const seriesInstances = new Map<string, Set<string>>();\n  let currentSeriesUID = '';\n\n  for (const sg of subGroups) {\n    if (sg.uids.length === 1) {\n      // Single UID — likely a series UID (or a standalone instance like Scout)\n      const uid = sg.uids[0]!; // length === 1 checked above; noUncheckedIndexedAccess\n      // If the previous \"series\" had no instances, it was actually an instance itself\n      // Add it to the current series\n      if (currentSeriesUID && seriesInstances.get(currentSeriesUID)!.size === 0) {\n        // Previous single was actually an instance, not a series\n        // Retroactively add it as an instance of the series before it\n        const prevSeries = candidateSeriesUIDs[candidateSeriesUIDs.length - 2];\n        if (prevSeries) {\n          const oldSeries = candidateSeriesUIDs.pop()!;\n          seriesInstances.get(prevSeries)!.add(oldSeries);\n          seriesInstances.delete(oldSeries);\n        }\n      }\n      currentSeriesUID = uid;\n      candidateSeriesUIDs.push(uid);\n      seriesInstances.set(uid, new Set());\n    } else {\n      // Multi-UID sub-group — these are instances of the current series\n      if (currentSeriesUID) {\n        for (const uid of sg.uids) {\n          seriesInstances.get(currentSeriesUID)!.add(uid);\n        }\n      }\n    }\n  }\n\n  // Check if the positional analysis produced useful results.\n  // For small studies (X-rays) where all UIDs have unique parents,\n  // every UID becomes a \"series\" with 0 instances — fall back to legacy parser.\n  //\n  // Also fall back when: the remaining UIDs (excluding study UID) form clean pairs\n  // but the positional analysis collapsed them into too few series. This happens when\n  // UIDs share a common parent prefix (e.g., 1.3.51.0.7.X) but are actually\n  // alternating series/instance pairs.\n  const totalInstances = [...seriesInstances.values()].reduce((sum, s) => sum + s.size, 0);\n  const expectedPairCount = Math.floor(orderedUIDs.length / 2);\n  const actualSeriesWithImages = [...seriesInstances.values()].filter(s => s.size > 0).length;\n\n  if (candidateSeriesUIDs.length === 0 || totalInstances === 0) {\n    logger.debug(`      [AMF-PARSE] Positional analysis found ${candidateSeriesUIDs.length} series with ${totalInstances} instances, falling back to pair-based parsing`);\n    return parseStudySeriesFromAmfLegacy(amfBuf);\n  }\n\n  // If positional analysis collapsed many UIDs into one series with few instances,\n  // and pair-based parsing would produce more series, fall back to pairs.\n  // This catches X-ray studies (2-6 views) where UIDs share a parent prefix\n  // but are actually separate series+instance pairs.\n  // Don't fall back for CT/MRI with many instances per series (>10).\n  const maxInstancesPerSeries = Math.max(...[...seriesInstances.values()].map(s => s.size));\n  if (expectedPairCount >= 2 && actualSeriesWithImages <= 1 && maxInstancesPerSeries <= 10 && expectedPairCount > actualSeriesWithImages) {\n    logger.debug(`      [AMF-PARSE] Positional analysis found ${actualSeriesWithImages} series with images but ${expectedPairCount} pairs expected, falling back to pair-based parsing`);\n    return parseStudySeriesFromAmfLegacy(amfBuf);\n  }\n\n  logger.debug(`      [AMF-PARSE] Detected ${candidateSeriesUIDs.length} series via positional analysis`);\n\n  // Extract series descriptions from nearby readable strings\n  const descriptionPattern = /[\\x20-\\x7e]{3,100}/g;\n  const readableStrings: Array<{ text: string; pos: number }> = [];\n  let strMatch;\n  while ((strMatch = descriptionPattern.exec(text)) !== null) {\n    const s = strMatch[0].trim();\n    if (/^\\d+\\.\\d+\\.\\d+/.test(s)) continue;\n    if (s.includes('com.clientoutlook') || s.includes('flex.messaging')) continue;\n    if (s.includes('AmfServices') || s.includes('HTTPSimpleLoader')) continue;\n    if (s.includes('getStudyList') || s.includes('StudyService')) continue;\n    if (/^[\\d.]+$/.test(s)) continue;\n    readableStrings.push({ text: s, pos: strMatch.index });\n  }\n\n  // Build the result — flatten each series' instances into individual entries\n  // for backward compatibility with the download loop\n  const series: ParsedStudyInfo['series'] = [];\n  let seriesIdx = 0;\n  for (let si = 0; si < candidateSeriesUIDs.length; si++) {\n    const seriesUID = candidateSeriesUIDs[si]!; // si bounded by loop; noUncheckedIndexedAccess\n    const instances = seriesInstances.get(seriesUID)!;\n    const seriesPos = firstPosition.get(seriesUID) ?? 0;\n    // Search for descriptions between this series and the next one\n    const nextSeriesPos = si + 1 < candidateSeriesUIDs.length\n      ? (firstPosition.get(candidateSeriesUIDs[si + 1]!) ?? text.length)\n      : text.length;\n\n    // Find series description: look for readable strings between this series and the next\n    let bestDesc = `Series ${++seriesIdx}`;\n    let bestScore = 0;\n    for (const rs of readableStrings) {\n      if (rs.pos < seriesPos || rs.pos > nextSeriesPos) continue;\n      // Prefer strings that look like series names (short, no UIDs, not too generic)\n      const s = rs.text;\n      if (s.length < 3 || s.length > 50) continue;\n      // Score: prefer shorter, more descriptive strings\n      let score = 10;\n      if (/^[A-Z]/.test(s)) score += 5; // Starts with uppercase\n      if (s.includes(' ')) score += 3; // Has spaces (human-readable)\n      if (/\\d+x\\d+|\\d+mm/i.test(s)) score += 3; // Resolution-like\n      if (s.length < 20) score += 2;\n      if (score > bestScore) {\n        bestScore = score;\n        bestDesc = s;\n      }\n    }\n\n    if (instances.size === 0) {\n      // Series with no detected instances — add a self-referencing entry\n      series.push({ seriesUID, instanceUID: seriesUID, seriesDescription: bestDesc });\n    } else {\n      // Add an entry for EACH instance UID — the download loop iterates these\n      const sortedInstances = [...instances].sort((a, b) => {\n        // DICOM UIDs are decimal digit runs joined by dots (see uidPattern),\n        // so the trailing component sorts as a base-10 number.\n        const aNum = parseInt(a.split('.').pop()!, 10) || 0;\n        const bNum = parseInt(b.split('.').pop()!, 10) || 0;\n        return aNum - bNum;\n      });\n\n      for (const instanceUID of sortedInstances) {\n        series.push({ seriesUID, instanceUID, seriesDescription: bestDesc });\n      }\n    }\n\n    logger.debug(`      [AMF-PARSE] ${bestDesc}: ${instances.size} instances`);\n  }\n\n  logger.debug(`      [AMF-PARSE] Total: ${series.length} (seriesUID, instanceUID) entries across ${candidateSeriesUIDs.length} series`);\n\n  return { studyUID, series };\n}\n\n/**\n * Legacy pair-based parser for simple studies (X-rays with few series).\n * Used as fallback when the frequency-based series detection doesn't find\n * enough high-frequency UIDs.\n */\nfunction parseStudySeriesFromAmfLegacy(amfBuf: Buffer): ParsedStudyInfo | null {\n  const text = amfBuf.toString('latin1');\n\n  const uidPattern = /1\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+){2,}/g;\n  const allUIDs: string[] = [];\n  const uidPositions: Map<string, number> = new Map();\n  let match;\n  while ((match = uidPattern.exec(text)) !== null) {\n    if (!uidPositions.has(match[0]) && !match[0].startsWith('1.2.840.10008.')) {\n      allUIDs.push(match[0]);\n      uidPositions.set(match[0], match.index);\n    }\n  }\n\n  if (allUIDs.length === 0) return null;\n\n  // Study UID: the first UID in the response (AMF always starts with study-level data)\n  const studyUID = allUIDs[0]!; // allUIDs.length checked non-zero above; noUncheckedIndexedAccess\n  const otherUIDs = allUIDs.filter(uid => uid !== studyUID);\n\n  if (otherUIDs.length === 0) return { studyUID, series: [] };\n\n  const descriptionPattern = /[\\x20-\\x7e]{3,100}/g;\n  const readableStrings: Array<{ text: string; pos: number }> = [];\n  let strMatch;\n  while ((strMatch = descriptionPattern.exec(text)) !== null) {\n    const s = strMatch[0].trim();\n    if (/^\\d+\\.\\d+\\.\\d+/.test(s)) continue;\n    if (s.includes('com.clientoutlook') || s.includes('flex.messaging')) continue;\n    if (s.includes('AmfServices') || s.includes('HTTPSimpleLoader')) continue;\n    if (s.includes('getStudyList') || s.includes('StudyService')) continue;\n    if (/^[\\d.]+$/.test(s)) continue;\n    readableStrings.push({ text: s, pos: strMatch.index });\n  }\n\n  const series: ParsedStudyInfo['series'] = [];\n  for (let i = 0; i + 1 < otherUIDs.length; i += 2) {\n    const seriesUID = otherUIDs[i]!; // i + 1 < length per loop condition; noUncheckedIndexedAccess\n    const instanceUID = otherUIDs[i + 1]!;\n    const seriesPos = uidPositions.get(seriesUID) ?? 0;\n\n    let bestDesc = `Series ${Math.floor(i / 2) + 1}`;\n    let bestDist = Infinity;\n    for (const rs of readableStrings) {\n      const dist = Math.abs(rs.pos - seriesPos);\n      if (dist < bestDist && dist < 500 && rs.text.length >= 3 && rs.text.length <= 80) {\n        bestDist = dist;\n        bestDesc = rs.text;\n      }\n    }\n\n    series.push({ seriesUID, instanceUID, seriesDescription: bestDesc });\n  }\n\n  return { studyUID, series };\n}\n\n// ─── Session Initialization ───\n\n/**\n * Extract the real serviceInstance from an AMF response buffer.\n * The server may return a different serviceInstance than the one we sent\n * (e.g., \"MyChart\" → \"UCSFVNAEDGEBundle\" for CT scans). The browser uses\n * this real value for a second AMF init call and all CustomImageServlet requests.\n */\nexport function extractServiceInstanceFromAmf(amfBuf: Buffer, originalServiceInstance: string): string | null {\n  const text = amfBuf.toString('latin1');\n\n  // Strategy 1: Look for a serviceInstance value near the \"serviceInstance\" or\n  // \"ServiceInstance\" field name in the binary. The value typically follows\n  // within 50 bytes of the field name.\n  const fieldPositions: number[] = [];\n  let idx = 0;\n  while ((idx = text.indexOf('erviceInstance', idx)) !== -1) {\n    fieldPositions.push(idx);\n    idx++;\n  }\n\n  for (const pos of fieldPositions) {\n    // Look at readable strings within 50 bytes after the field name\n    const region = text.substring(pos, pos + 100);\n    // Match capitalized identifiers that look like serviceInstance values\n    // (not field names like \"ServiceInstance\", \"ServiceInstanceParameter\")\n    const valuePattern = /([A-Z][A-Za-z0-9]{5,}(?:Bundle|Strategy|strategy))/g;\n    let match;\n    while ((match = valuePattern.exec(region)) !== null) {\n      const val = match[1]!; // pattern has one mandatory capture group; noUncheckedIndexedAccess\n      if (val !== originalServiceInstance && !val.startsWith('ServiceInstance')) {\n        return val;\n      }\n    }\n  }\n\n  // Strategy 2: Look for known serviceInstance patterns anywhere in the binary.\n  // These are institution-specific identifiers that end in \"Bundle\" or contain \"strategy\".\n  const globalPattern = /([A-Z][A-Za-z0-9]{4,}Bundle|[A-Z][A-Za-z0-9]{4,}[Ss]trategy)/g;\n  let match;\n  while ((match = globalPattern.exec(text)) !== null) {\n    const val = match[1]!; // pattern has one mandatory capture group; noUncheckedIndexedAccess\n    if (val !== originalServiceInstance) {\n      return val;\n    }\n  }\n\n  return null;\n}\n\n/**\n * Initialize an eUnity session by calling AmfServicesServlet with getStudyListMeta.\n * This is required before CustomImageServlet will serve images (otherwise 403).\n *\n * Some studies (e.g., CT scans) use a different serviceInstance than the one in the\n * viewer URL. The browser handles this by making two AMF calls:\n * 1. First with the viewer's serviceInstance (e.g., \"MyChart\")\n * 2. Second with the real serviceInstance from the response (e.g., \"UCSFVNAEDGEBundle\")\n *\n * Returns { amfBuf, effectiveServiceInstance } on success.\n */\nasync function initializeAmfSession(\n  cookieJar: tough.CookieJar,\n  baseUrl: string,\n  accession: string,\n  serviceInstance: string,\n  patientId: string,\n): Promise<{ amfBuf: Buffer; effectiveServiceInstance: string } | null> {\n  const amfReq = buildGetStudyListMetaRequest(accession, serviceInstance, patientId);\n\n  const res = await scraperFetch(`${baseUrl}/e/AmfServicesServlet`, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/octet-stream' },\n    body: amfReq as unknown as BodyInit,\n  }, { cookieJar });\n\n  if (!res.ok) {\n    logger.debug(`      [AMF] Request failed: ${res.status}`);\n    return null;\n  }\n\n  const amfBuf = Buffer.from(await res.arrayBuffer());\n  const parsed = parseAmfResponse(amfBuf);\n\n  // Deliberately NOT `parsed?.code !== 0`: with no parse, `undefined !== 0` is\n  // true and would flip this into the error branch. \"No parse\" must stay\n  // \"no error\" here; only a parsed non-zero code is an upstream error.\n  if (parsed && parsed.code !== 0) {\n    logger.debug(`      [AMF] Error code=${parsed.code}: ${parsed.response ?? '(null)'}`);\n  }\n\n  if (parsed?.code === 0) {\n    logger.debug(`      [AMF] Session initialized successfully (${amfBuf.length} bytes)`);\n  }\n\n  // Check if the response contains a different serviceInstance\n  const realSI = extractServiceInstanceFromAmf(amfBuf, serviceInstance);\n  let effectiveServiceInstance = serviceInstance;\n\n  if (realSI && realSI !== serviceInstance) {\n    logger.debug(`      [AMF] Server returned different serviceInstance: ${realSI} (was ${serviceInstance})`);\n    logger.debug(`      [AMF] Making second AMF call with real serviceInstance...`);\n\n    // Make a second AMF call with the real serviceInstance (like the browser does)\n    const amfReq2 = buildGetStudyListMetaRequest(accession, realSI, patientId);\n    const res2 = await scraperFetch(`${baseUrl}/e/AmfServicesServlet`, {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/octet-stream' },\n      body: amfReq2 as unknown as BodyInit,\n    }, { cookieJar });\n\n    if (res2.ok) {\n      const amfBuf2 = Buffer.from(await res2.arrayBuffer());\n      const parsed2 = parseAmfResponse(amfBuf2);\n      if (parsed2?.code === 0) {\n        logger.debug(`      [AMF] Second session initialized successfully (${amfBuf2.length} bytes)`);\n        // Return the FIRST AMF response (has full study/series data) but with the real serviceInstance\n        return { amfBuf, effectiveServiceInstance: realSI };\n      }\n    }\n    // Even if second call fails, use the real serviceInstance\n    effectiveServiceInstance = realSI;\n  }\n\n  return { amfBuf, effectiveServiceInstance };\n}\n\n// ─── eUnity Session ───\n\nexport interface EunitySession {\n  cookieJar: tough.CookieJar;\n  baseUrl: string;\n  studyUID: string;\n  serviceInstance: string;\n  series: Array<{ seriesUID: string; instanceUID: string; seriesDescription: string }>;\n}\n\n/**\n * Initialize an eUnity session: SAML chain + AMF init + parse series.\n * Returns the authenticated session with cookies and parsed series list.\n * The cookies can be reused for individual image downloads via downloadSingleImage().\n */\nexport async function initEunitySession(\n  mychartRequest: MyChartRequest,\n  fdiContext: FdiContext,\n): Promise<EunitySession | null> {\n  const viewerSession = await getImageViewerSamlUrl(mychartRequest, fdiContext);\n  if (!viewerSession?.samlUrl) return null;\n\n  const session = await followSamlChain(mychartRequest, viewerSession.samlUrl);\n  if (!session) return null;\n\n  const studyParams = parseEunityStudyParams(session.viewerUrl, session.viewerBody);\n  if (!studyParams) return null;\n\n  const baseUrl = new URL(session.viewerUrl).origin;\n  const amfResult = await initializeAmfSession(\n    session.cookieJar, baseUrl,\n    studyParams.accession, studyParams.serviceInstance, studyParams.patientId,\n  );\n  if (!amfResult) return null;\n\n  const { amfBuf, effectiveServiceInstance } = amfResult;\n  const studyInfo = parseStudySeries(amfBuf, studyParams.accession);\n  if (!studyInfo || studyInfo.series.length === 0) return null;\n\n  return {\n    cookieJar: session.cookieJar,\n    baseUrl,\n    studyUID: studyInfo.studyUID,\n    serviceInstance: effectiveServiceInstance,\n    series: studyInfo.series,\n  };\n}\n\n/**\n * Download a single image from an initialized eUnity session.\n * Returns the raw CLO pixel + wrapper data for conversion.\n */\nexport async function downloadSingleImage(\n  eunitySession: EunitySession,\n  seriesUID: string,\n  objectUID: string,\n): Promise<{ pixelData: Buffer; wrapperData?: Buffer } | null> {\n  const { data } = await downloadImage(eunitySession.cookieJar, eunitySession.baseUrl, {\n    studyUID: eunitySession.studyUID,\n    seriesUID,\n    objectUID,\n    serviceInstance: eunitySession.serviceInstance,\n    format: 'CLOWRAPPER',\n  });\n\n  if (data.length < 256 || (data.length > 8 && data.toString('ascii', 0, 8) === 'CLOERROR')) {\n    return null;\n  }\n\n  const CLOCLHAAR_MAGIC = Buffer.from('CLOCLHAAR');\n  const haarIdx = data.indexOf(CLOCLHAAR_MAGIC);\n  if (haarIdx < 0) return null;\n\n  // No leading wrapper means the key is absent, not present-and-undefined.\n  return {\n    pixelData: Buffer.from(data.subarray(haarIdx)),\n    ...(haarIdx > 0 ? { wrapperData: Buffer.from(data.subarray(0, haarIdx)) } : {}),\n  };\n}\n\n// ─── Image Download ───\n\nexport interface SeriesInfo {\n  seriesUID: string;\n  description: string;\n  instanceCount: number;\n}\n\nexport interface DirectDownloadResult {\n  studyName: string;\n  images: DirectDownloadedImage[];\n  errors: string[];\n  /** Parsed series info from the AMF response */\n  seriesList?: SeriesInfo[];\n}\n\nexport interface DirectDownloadedImage {\n  filePath: string;\n  sizeBytes: number;\n  seriesUID: string;\n  instanceUID: string;\n  seriesDescription: string;\n  accessionNumber: string;\n  format: string;\n  pixelData?: Buffer;\n  wrapperData?: Buffer;\n}\n\nexport interface DirectDownloadOptions {\n  skipFileWrite?: boolean;\n  /** Number of parallel downloads (default: 5). */\n  concurrency?: number;\n}\n\n/**\n * Progressive refinement levels for CLOPIXEL requests.\n *\n * The eUnity viewer uses Haar wavelet progressive loading:\n * - Level 1 (0,3,1): Approximation coefficients — lowest resolution base layer\n * - Level 2 (2,3,2): Additional wavelet detail — medium resolution\n * - Level 3 (2,4,3): Final wavelet detail — full resolution\n *\n * Each level response adds detail that's composited on the client side.\n * All three levels together represent the full image quality.\n * Observed from browser WASM viewer network traffic.\n */\nconst PROGRESSIVE_LEVELS = ['0,3,1', '2,3,2', '2,4,3'];\n\n/**\n * Download an image from CustomImageServlet.\n * NOTE: image/CLJPEG format is NOT supported by the Example Health System eUnity server (returns CLOERROR).\n * Use CLOWRAPPER format to get metadata + low-res preview.\n */\nasync function downloadImage(\n  cookieJar: tough.CookieJar,\n  baseUrl: string,\n  params: {\n    studyUID: string;\n    seriesUID: string;\n    objectUID: string;\n    frameNumber?: number;\n    serviceInstance: string;\n    format?: 'CLOPIXEL' | 'CLOWRAPPER';\n    level?: string;\n  }\n): Promise<{ data: Buffer; contentType: string }> {\n  const format = params.format ?? 'CLOWRAPPER';\n  const level = params.level ?? '0';\n\n  let requestType: string;\n  let contentType: string;\n  let haveImageData: string;\n\n  switch (format) {\n    case 'CLOPIXEL':\n      requestType = 'CLOPIXEL';\n      contentType = 'image/CLHAAR';\n      haveImageData = 'partialps';\n      break;\n    case 'CLOWRAPPER':\n      requestType = 'CLOWRAPPER';\n      contentType = 'image/CLWAVE;image/CLHAAR;image/CLJPEG';\n      haveImageData = 'partialnops';\n      break;\n  }\n\n  const body = new URLSearchParams({\n    requestType,\n    contentType,\n    studyUID: params.studyUID,\n    seriesUID: params.seriesUID,\n    objectUID: params.objectUID,\n    frameNumber: String(params.frameNumber ?? 1),\n    locale: 'en_US',\n    haveImageData,\n    serializeType: 'zlib',\n    compressionVersion: '3',\n    serviceInstance: params.serviceInstance,\n    level,\n  }).toString();\n\n  const res = await scraperFetch(`${baseUrl}/e/CustomImageServlet`, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },\n    body,\n  }, { cookieJar });\n\n  if (!res.ok) {\n    throw new Error(`CustomImageServlet failed: ${res.status} ${res.statusText}`);\n  }\n\n  const responseType = res.headers.get('content-type') || '';\n  const data = Buffer.from(await res.arrayBuffer());\n  return { data, contentType: responseType };\n}\n\n/**\n * Download all progressive CLOPIXEL levels for maximum quality.\n *\n * The eUnity viewer uses Haar wavelet progressive refinement — each level\n * adds more detail to the image. All 3 levels are needed for full quality.\n * Returns an array of {level, data} for each successfully downloaded level.\n */\nasync function downloadProgressiveClopixel(\n  cookieJar: tough.CookieJar,\n  baseUrl: string,\n  params: {\n    studyUID: string;\n    seriesUID: string;\n    objectUID: string;\n    serviceInstance: string;\n    frameNumber?: number;\n  },\n): Promise<Array<{ level: string; data: Buffer }>> {\n  const results: Array<{ level: string; data: Buffer }> = [];\n\n  for (const level of PROGRESSIVE_LEVELS) {\n    try {\n      const { data } = await downloadImage(cookieJar, baseUrl, {\n        ...params,\n        format: 'CLOPIXEL',\n        level,\n      });\n\n      // Check for CLOERROR in response\n      if (data.length > 8 && data.toString('ascii', 0, 8) === 'CLOERROR') {\n        logger.debug(`        [PIXEL] Level ${level}: server returned CLOERROR, stopping`);\n        break;\n      }\n\n      results.push({ level, data });\n      logger.debug(`        [PIXEL] Level ${level}: ${(data.length / 1024).toFixed(0)} KB`);\n    } catch (err) {\n      logger.debug(`        [PIXEL] Level ${level} failed: ${(err as Error).message}`);\n      break;\n    }\n  }\n\n  return results;\n}\n\nfunction isCloFormat(buf: Buffer): boolean {\n  return buf.length > 3 && buf.toString('ascii', 0, 3) === 'CLO';\n}\n\n// ─── Self-Contained Download Entry Point ───\n\n/**\n * Download all images from an imaging study using direct HTTP requests.\n *\n * This is the main entry point for the CLI `--action get-imaging` flow.\n * It handles the entire pipeline automatically:\n * 1. Gets a fresh SAML URL from FdiData\n * 2. Follows the SAML chain to get an authenticated eUnity session\n * 3. Extracts study parameters (accession, serviceInstance, patientId) from the viewer URL\n * 4. Calls AmfServicesServlet getStudyListMeta to initialize the session and get series info\n * 5. Downloads CLO image data for each series via CustomImageServlet\n *\n * Returns the download results including file paths, sizes, and any errors.\n */\nexport async function downloadImagingStudyDirect(\n  mychartRequest: MyChartRequest,\n  fdiContext: FdiContext,\n  studyName: string,\n  outputDir: string,\n  options?: DirectDownloadOptions,\n): Promise<DirectDownloadResult> {\n  const result: DirectDownloadResult = {\n    studyName,\n    images: [],\n    errors: [],\n  };\n\n  try {\n    // Step 1: Get SAML URL from FdiData\n    logger.debug('      Getting SAML URL for direct download...');\n    const viewerSession = await getImageViewerSamlUrl(mychartRequest, fdiContext);\n    if (!viewerSession?.samlUrl) {\n      result.errors.push('Could not get SAML URL from FdiData');\n      return result;\n    }\n\n    // Step 2: Follow SAML chain to eUnity\n    logger.debug('      Following SAML chain...');\n    const session = await followSamlChain(mychartRequest, viewerSession.samlUrl);\n    if (!session) {\n      result.errors.push('Failed to follow SAML chain to eUnity');\n      return result;\n    }\n    logger.debug(`      Got eUnity session (JSESSIONID: ${session.jsessionId?.substring(0, 12)}...)`);\n\n    // Step 3: Extract study params from viewer URL\n    const studyParams = parseEunityStudyParams(session.viewerUrl, session.viewerBody);\n    if (!studyParams) {\n      result.errors.push(`Could not extract study params from viewer URL: ${session.viewerUrl}`);\n      return result;\n    }\n    logger.debug(`      Study params: accession=${studyParams.accession}, serviceInstance=${studyParams.serviceInstance}`);\n\n    const baseUrl = new URL(session.viewerUrl).origin;\n    const skipFileWrite = options?.skipFileWrite ?? false;\n    if (!skipFileWrite) {\n      await fs.promises.mkdir(outputDir, { recursive: true });\n    }\n\n    // Step 4: Initialize AMF session (required before CustomImageServlet will serve images)\n    logger.debug('      Initializing AMF session...');\n    const amfResult = await initializeAmfSession(\n      session.cookieJar,\n      baseUrl,\n      studyParams.accession,\n      studyParams.serviceInstance,\n      studyParams.patientId,\n    );\n\n    if (!amfResult) {\n      result.errors.push('AMF session initialization failed');\n      return result;\n    }\n\n    const { amfBuf: amfResponse, effectiveServiceInstance } = amfResult;\n    if (effectiveServiceInstance !== studyParams.serviceInstance) {\n      logger.debug(`      Using effective serviceInstance: ${effectiveServiceInstance}`);\n      studyParams.serviceInstance = effectiveServiceInstance;\n    }\n\n    // Step 5: Parse series info from AMF response — structured AMF3 decode\n    // first, positional heuristic as loud fallback\n    const studyInfo = parseStudySeries(amfResponse, studyParams.accession);\n    if (!studyInfo || studyInfo.series.length === 0) {\n      result.errors.push('Could not parse series info from AMF response');\n      return result;\n    }\n    logger.debug(`      Found ${studyInfo.series.length} series, studyUID: ${studyInfo.studyUID.substring(0, 30)}...`);\n\n    // Build series list summary\n    const seriesMap = new Map<string, { description: string; count: number }>();\n    for (const s of studyInfo.series) {\n      const existing = seriesMap.get(s.seriesUID);\n      if (existing) {\n        existing.count++;\n      } else {\n        seriesMap.set(s.seriesUID, { description: s.seriesDescription, count: 1 });\n      }\n    }\n    result.seriesList = [...seriesMap.entries()].map(([seriesUID, { description, count }]) => ({\n      seriesUID,\n      description,\n      instanceCount: count,\n    }));\n\n    // Step 6: Download every image — each (seriesUID, instanceUID) pair is a\n    // separate image. Downloaded in parallel batches for speed (CT scans can\n    // have 700+ slices). Instances that answer CLOERROR are skipped, never\n    // returned as images: eUnity's instance list can carry pseudo-instances\n    // (the viewer's \"SeriesSelector\" entries) that hold no pixel data.\n    const concurrency = options?.concurrency ?? 5;\n    const safeName = studyName.replace(/[^a-zA-Z0-9_-]/g, '_').substring(0, 80);\n    const CLOCLHAAR_MAGIC = Buffer.from('CLOCLHAAR');\n    let completed = 0;\n\n    async function downloadOne(series: NonNullable<typeof studyInfo>['series'][0]): Promise<void> {\n      try {\n        const { data } = await downloadImage(session!.cookieJar, baseUrl, {\n          studyUID: studyInfo!.studyUID,\n          seriesUID: series.seriesUID,\n          objectUID: series.instanceUID,\n          serviceInstance: studyParams!.serviceInstance,\n          format: 'CLOWRAPPER',\n        });\n\n        completed++;\n        if (data.length < 256 || (data.length > 8 && data.toString('ascii', 0, 8) === 'CLOERROR')) {\n          if (completed % 50 === 0) {\n            logger.debug(`      [${completed} tried] Progress...`);\n          }\n          return;\n        }\n\n        const safeDesc = series.seriesDescription.replace(/[^a-zA-Z0-9_-]/g, '_');\n\n        if (skipFileWrite) {\n          const haarIdx = data.indexOf(CLOCLHAAR_MAGIC);\n          if (haarIdx < 0) return;\n          const wrapperMetadata = haarIdx > 0 ? data.subarray(0, haarIdx) : undefined;\n          const embeddedPixelData = data.subarray(haarIdx);\n          result.images.push({\n            filePath: '',\n            sizeBytes: embeddedPixelData.length,\n            seriesUID: series.seriesUID,\n            instanceUID: series.instanceUID,\n            seriesDescription: series.seriesDescription,\n            accessionNumber: studyParams!.accession,\n            format: 'CLHAAR',\n            pixelData: Buffer.from(embeddedPixelData),\n            ...(wrapperMetadata ? { wrapperData: Buffer.from(wrapperMetadata) } : {}),\n          });\n        } else {\n          const ext = isCloFormat(data) ? '.clo' : '.bin';\n          const fileName = `${safeName}_${safeDesc}_wrapper${ext}`;\n          const filePath = path.join(outputDir, fileName);\n          await fs.promises.writeFile(filePath, data);\n\n          const pixelLevels = await downloadProgressiveClopixel(session!.cookieJar, baseUrl, {\n            studyUID: studyInfo!.studyUID,\n            seriesUID: series.seriesUID,\n            objectUID: series.instanceUID,\n            serviceInstance: studyParams!.serviceInstance,\n          });\n\n          result.images.push({\n            filePath,\n            sizeBytes: data.length,\n            seriesUID: series.seriesUID,\n            instanceUID: series.instanceUID,\n            seriesDescription: series.seriesDescription,\n            accessionNumber: studyParams!.accession,\n            format: isCloFormat(data) ? 'CLHAAR' : 'UNKNOWN',\n          });\n\n          for (const pl of pixelLevels) {\n            const levelTag = pl.level.replace(/,/g, '-');\n            const pixelFileName = `${safeName}_${safeDesc}_pixel_L${levelTag}${isCloFormat(pl.data) ? '.clo' : '.bin'}`;\n            const pixelFilePath = path.join(outputDir, pixelFileName);\n            await fs.promises.writeFile(pixelFilePath, pl.data);\n\n            result.images.push({\n              filePath: pixelFilePath,\n              sizeBytes: pl.data.length,\n              seriesUID: series.seriesUID,\n              instanceUID: series.instanceUID,\n              seriesDescription: `${series.seriesDescription} (pixel L${levelTag})`,\n              accessionNumber: studyParams!.accession,\n              format: isCloFormat(pl.data) ? `CLHAAR_PIXEL_L${levelTag}` : 'UNKNOWN',\n            });\n          }\n        }\n\n        if (completed % 50 === 0) {\n          logger.debug(`      [${completed} tried] Downloaded ${(data.length / 1024).toFixed(0)} KB - ${series.seriesDescription}`);\n        }\n      } catch (err) {\n        completed++;\n        result.errors.push(`${series.seriesDescription}: ${detailedMessage(err)}`);\n      }\n    }\n\n    logger.debug(`      Downloading ${studyInfo.series.length} instances (concurrency: ${concurrency})...`);\n    for (let i = 0; i < studyInfo.series.length; i += concurrency) {\n      const batch = studyInfo.series.slice(i, i + concurrency);\n      await Promise.all(batch.map((s) => downloadOne(s)));\n    }\n    logger.debug(`      Downloaded ${result.images.length} images (${studyInfo.series.length} instances tried)`);\n    if (result.images.length === 0 && result.errors.length === 0) {\n      result.errors.push(\n        `No downloadable images: all ${studyInfo.series.length} instances returned empty or error responses from the image server.`,\n      );\n    }\n  } catch (err) {\n    result.errors.push(`Fatal: ${detailedMessage(err)}`);\n  }\n\n  // The parallel batches above complete in whatever order the image server\n  // answers, so this list is not even download order. Re-order each\n  // multi-slice series anatomically so every client hands back a stack that\n  // reads the way the scanner swept it.\n  result.images = sortImagesByPatientPosition(result.images);\n\n  return result;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `image_id` token and the payload shape a downloaded study comes back as.\n *\n * Both are part of the public surface — clients round-trip the token and do\n * their own CLO→image encoding on the payload — so they live beside the\n * registry rather than inside the imaging scraper.\n */\n\nimport { Base64 } from 'js-base64';\n\nimport type { FdiContext } from '../../scrapers/myChart/eunity/imagingViewer';\n\n/**\n * Pack an {@link FdiContext} into one opaque `image_id` token.\n *\n * A single copy-paste value is easier for a model to round-trip from\n * get_imaging_results into download_imaging_study than two separate fields,\n * and base64url avoids delimiter collisions — `fdi`/`ord` are arbitrary\n * URL-encoded tokens that can contain a colon or comma.\n *\n * `js-base64` because Hermes has neither `Buffer` nor `btoa`; `encodeURI` is\n * its unpadded base64url, byte-for-byte Node's `toString('base64url')`.\n */\nexport function encodeImageId(fdiContext: FdiContext): string {\n  return Base64.encodeURI(JSON.stringify({ fdi: fdiContext.fdi, ord: fdiContext.ord }));\n}\n\n/**\n * Inverse of {@link encodeImageId}. Throws if the token is malformed.\n *\n * `Base64.decode` checks no alphabet, and the shape check below is what\n * catches a bad token — corruption inside the alphabet decodes to garbage.\n */\nexport function decodeImageId(imageId: string): FdiContext {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(Base64.decode(imageId));\n  } catch {\n    throw new Error('Invalid image_id — expected the image_id value from a get_imaging_results entry.');\n  }\n  if (\n    !parsed ||\n    typeof parsed !== 'object' ||\n    typeof (parsed as FdiContext).fdi !== 'string' ||\n    typeof (parsed as FdiContext).ord !== 'string'\n  ) {\n    throw new Error('Invalid image_id — expected the image_id value from a get_imaging_results entry.');\n  }\n  return { fdi: (parsed as FdiContext).fdi, ord: (parsed as FdiContext).ord };\n}\n\n/** The raw, still-encoded images of one study. Clients encode them themselves. */\nexport interface StudyImagePayload {\n  studyName: string;\n  /** How many image instances the study contains in total. */\n  totalImages: number;\n  images: Array<{\n    index: number;\n    seriesUID: string;\n    seriesDescription: string;\n    /** Raw CLO pixel data. Convert with the client's own CLO→image path. */\n    pixelData?: Uint8Array;\n    /** Raw CLO wrapper (calibration/window metadata) for the same image. */\n    wrapperData?: Uint8Array;\n  }>;\n  errors: string[];\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Results` group — labs, imaging reports, and the pictures behind them. */\n\nimport {\n  fetchLabResultsRaw,\n  fetchImagingResultsRaw,\n  getImagingResults,\n  labResultsProcessor,\n  imagingResultsProcessor,\n} from '../../../scrapers/myChart/chart/labs/labResults';\nimport { downloadImagingStudyDirect } from '../../../scrapers/myChart/eunity/imagingDirectDownload';\nimport type { FdiContext } from '../../../scrapers/myChart/eunity/imagingViewer';\nimport { num, optStr } from '../args';\nimport { decodeImageId, type StudyImagePayload } from '../imaging';\nimport type { CapabilityImpl } from '../types';\n\nexport const RESULT_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_lab_results',\n    title: 'Lab results',\n    description: 'Lab results with reference ranges and prior values for trending.',\n    kind: 'read',\n    group: 'Results',\n    params: [],\n    run: (request) => fetchLabResultsRaw(request),\n    processor: labResultsProcessor,\n  },\n  {\n    id: 'get_imaging_results',\n    title: 'Imaging results',\n    description:\n      'Imaging result metadata (X-ray, MRI, CT, ultrasound, …) with reports. Entries that have viewable pictures carry an `image_id` — pass that to download_imaging_study to get the actual images.',\n    kind: 'read',\n    group: 'Results',\n    params: [],\n    // The processor mints `image_id` (one opaque token for the { fdi, ord }\n    // pair — a single copy-paste value is far easier for a model to hand\n    // back than two fields it can mix up) and `index`, the fallback handle.\n    run: (request) => fetchImagingResultsRaw(request),\n    processor: imagingResultsProcessor,\n  },\n  {\n    id: 'download_imaging_study',\n    aliases: ['get_xray_image'],\n    title: 'Download imaging study',\n    description:\n      'Download every picture in one imaging study. Identify the study with the `image_id` from get_imaging_results (or its 0-based `imaging_index`). Images are downloaded and decoded on the user’s own device.',\n    kind: 'read',\n    group: 'Results',\n    rendersMedia: true,\n    params: [\n      { name: 'image_id', type: 'string', description: 'The `image_id` from the chosen get_imaging_results entry. Copy it verbatim.' },\n      { name: 'imaging_index', type: 'number', description: 'Alternative to image_id: the 0-based index of the study in get_imaging_results.', min: 0 },\n      { name: 'study_name', type: 'string', description: 'Human-readable study name used to label the output. Optional.' },\n    ],\n    run: async (request, args): Promise<StudyImagePayload> => {\n      let fdiContext: FdiContext;\n      let studyName = optStr(args, 'study_name');\n\n      const imageId = optStr(args, 'image_id');\n      if (imageId) {\n        fdiContext = decodeImageId(imageId);\n      } else if (args.imaging_index !== undefined && args.imaging_index !== null && args.imaging_index !== '') {\n        const index = num(args, 'imaging_index', -1);\n        if (!Number.isInteger(index) || index < 0) {\n          throw new Error('imaging_index must be a non-negative integer from get_imaging_results.');\n        }\n        const { orders } = await getImagingResults(request);\n        const study = orders[index];\n        if (!study) throw new Error(`No imaging result at index ${index} (this account has ${orders.length}).`);\n        if (!study.image_id) throw new Error(`The imaging result at index ${index} has no viewable images.`);\n        fdiContext = decodeImageId(study.image_id);\n        studyName = studyName ?? study.orderName ?? undefined;\n      } else {\n        throw new Error('Pass either image_id (from get_imaging_results) or imaging_index.');\n      }\n\n      const result = await downloadImagingStudyDirect(request, fdiContext, studyName ?? 'study', '', {\n        skipFileWrite: true,\n      });\n\n      return {\n        studyName: result.studyName,\n        totalImages: result.images.length,\n        images: result.images.map((img, index) => ({\n          index,\n          seriesUID: img.seriesUID,\n          seriesDescription: img.seriesDescription,\n          // An image with no pixel or wrapper buffer omits the key rather than\n          // reporting it as present-and-undefined.\n          ...(img.pixelData !== undefined ? { pixelData: img.pixelData } : {}),\n          ...(img.wrapperData !== undefined ? { wrapperData: img.wrapperData } : {}),\n        })),\n        errors: result.errors,\n      };\n    },\n  },\n\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Conversation thread processor. Field decisions:\n * docs/processor-layer-proposal.md, `get_message_thread`.\n *\n * The scraper records `GetConversationDetails` and then every\n * `GetConversationMessages` page it walked backwards through. This merges the\n * pages into one list ascending by `deliveryInstantISO`, de-duplicated by\n * `wmgId`, and resolves names through the maps `GetConversationDetails`\n * carries (the pages only carry `userOverrideNames`).\n *\n * `truncated` is derived from the LAST page the scraper recorded: the paging\n * loop only stops on a non-empty page that still says `hasMoreMessages` when\n * it hit its page cap. A page that is empty, `null`, or says there is nothing\n * older is the end of the thread, not a truncation.\n *\n * A literal JSON `null` from `GetConversationDetails` is MyChart saying it\n * has no such conversation on the active patient record; it passes through\n * as `null` in every mode (rule 7).\n */\n\nimport { findRequest, findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { bool, boolOrNull, list, num, rec, textOrNull } from '../../processors/read';\nimport type { GetConversationDetails, GetConversationMessages } from './mychart.types';\nimport type { ConversationThreadConcise, ConversationThreadStandard } from './standardized.types';\n\nexport type { ConversationThreadConcise, ConversationThreadStandard } from './standardized.types';\nimport {\n  messageConcise,\n  messageDirectory,\n  messageStandard,\n  type MessageStandard,\n} from './conversations.processor';\n\nexport const conversationThreadProcessor: Processor<ConversationThreadStandard | null> = {\n  standard(raw: RawResponse): ConversationThreadStandard | null {\n    const detailsRequest = findRequest(raw, 'GetConversationDetails');\n    const detailsBody = detailsRequest?.body;\n    if (detailsBody === null || typeof detailsBody !== 'object' || Array.isArray(detailsBody)) return null;\n    const details = rec<GetConversationDetails>(detailsBody);\n    const pages = findRequests(raw, 'GetConversationMessages');\n\n    const directory = messageDirectory(details, ...pages.map((p) => p.body));\n\n    const seen = new Set<string>();\n    const merged: MessageStandard[] = [];\n    for (const source of [details, ...pages.map((p) => rec<GetConversationMessages>(p.body))]) {\n      for (const m of list(source.messages)) {\n        const parsed = messageStandard(m, directory);\n        const key = parsed.wmgId ?? '';\n        if (key && seen.has(key)) continue;\n        if (key) seen.add(key);\n        merged.push(parsed);\n      }\n    }\n    merged.sort((a, b) => (a.deliveryInstantISO ?? '').localeCompare(b.deliveryInstantISO ?? ''));\n\n    const last = pages.length > 0 ? pages[pages.length - 1]!.body : details;\n    const lastPage = rec<GetConversationMessages>(last);\n    const truncated =\n      last !== null && typeof last === 'object' && bool(lastPage.hasMoreMessages) && list(lastPage.messages).length > 0;\n\n    const replyFlags = rec(details.replyFlags);\n    return {\n      hthId: textOrNull(details.hthId),\n      subject: textOrNull(details.subject),\n      audience: list(details.audience).map((a) => ({ name: textOrNull(rec(a).name) })),\n      totalMessages: num(details.totalMessages),\n      numUnread: num(details.numUnread),\n      truncated,\n      messages: merged,\n      replyFlags: { canReply: boolOrNull(replyFlags.canReply), cannotReplyReason: num(replyFlags.cannotReplyReason) },\n      hasPreviouslyViewed: boolOrNull(details.hasPreviouslyViewed),\n      hasAttachments: boolOrNull(details.hasAttachments),\n      hasUrgentMsgs: boolOrNull(details.hasUrgentMsgs),\n      hasTasks: boolOrNull(details.hasTasks),\n      messageType: textOrNull(details.messageType),\n      previewText: textOrNull(details.previewText),\n    };\n  },\n\n  concise(standard): ConversationThreadConcise | null {\n    if (standard === null) return null;\n    return {\n      hthId: standard.hthId,\n      subject: standard.subject,\n      audience: standard.audience,\n      totalMessages: standard.totalMessages,\n      numUnread: standard.numUnread,\n      truncated: standard.truncated,\n      replyFlags: standard.replyFlags,\n      messages: standard.messages.map(messageConcise),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * One conversation, every message in it.\n *\n * `GetConversationMessages` answered 500 `{\"Message\":\"An error has occurred.\"}`\n * on every instance anyone checked, which looked exactly like a dead endpoint.\n * It wasn't: **the read endpoints key the thread on `id`**, and we were sending\n * `conversationId`. Parameter names here are per-endpoint, not per-area — the\n * *mutating* siblings (`SendReply`, `DeleteConversation`) really do take\n * `conversationId`, which is where the guess came from. With `id` both read\n * endpoints answer 200 on all four instances there are credentials for:\n *\n *   POST /api/conversations/GetConversationDetails\n *        { id, messageId?, organizationId?, maxReadMessages?, PageNonce }\n *   POST /api/conversations/GetConversationMessages\n *        { id, organizationId?, startInstantISO?, maxReadMessages?, PageNonce }\n *\n * Both answer with the conversation object: `messages` ascending by\n * `deliveryInstantISO` (oldest first) and `hasMoreMessages` saying whether\n * older ones exist before `messages[0]`. Details additionally carries\n * `subject`, `totalMessages` and the `users` / `viewers` name maps, so it is\n * the seed here and GetConversationMessages pages backwards from it.\n *\n * `startInstantISO` is an exclusive upper bound — the response holds the newest\n * `maxReadMessages` messages strictly older than it — and omitting it means\n * \"now\", i.e. the newest page. `maxReadMessages` is the page size, defaulting\n * to 5 server-side, which is also all the listing ever inlines.\n *\n * Neither `organizationId` nor a real `PageNonce` is required, but the\n * `__RequestVerificationToken` header is: without it the endpoint 500s.\n *\n * The two endpoints REJECT a bad id differently, which is the trap here.\n * GetConversationMessages answers 500; GetConversationDetails answers **200\n * with a literal JSON `null`** — same as GetVisitNotes and GetLetterDetails do\n * for unknown ids. The `null` is recorded and passes through the processor as\n * `null` (rule 7) rather than being read as a thread with nothing in it.\n *\n * The web UI's own request shape is in\n * `scripts/lib/pxbuild/epic.px.client.communication-center.js` on any instance\n * — see `scrapers/SCRAPING.md`.\n */\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { logger } from '../../../../shared/logger';\nimport { list, rec, text } from '../../processors/read';\nimport { conversationThreadProcessor, type ConversationThreadStandard } from './messageThreads.processor';\n\nexport type { ConversationThreadStandard, ConversationThreadConcise } from './messageThreads.processor';\nexport { conversationThreadProcessor } from './messageThreads.processor';\n\n/**\n * Messages per request. The UI asks for 5 at a time; a chattier page size costs\n * the same round trip and keeps a long thread from turning into 20 of them.\n */\nconst PAGE_SIZE = 100;\n\n/** Bound the paging loop, so a server that never clears `hasMoreMessages` can't spin forever. */\nexport const MAX_PAGES = 50;\n\n/**\n * `GET /app/communication-center` for the token, `POST GetConversationDetails`\n * for the seed page, then `POST GetConversationMessages` backwards while the\n * last page says older messages exist. Every page is recorded; the processor\n * merges them.\n *\n * A non-2xx answer throws (`RawCollector.send` refuses it): a 500 here is an\n * error, and an error read as an empty thread looks exactly like a\n * conversation with nothing in it.\n */\nexport async function fetchConversationThreadRaw(mychartRequest: MyChartRequest, conversationId: string): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/communication-center');\n\n  const post = async (action: 'GetConversationDetails' | 'GetConversationMessages', body: Record<string, unknown>) => {\n    const { body: payload } = await collector.send({\n      path: `/api/conversations/${action}`,\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        Accept: 'application/json',\n        __RequestVerificationToken: token,\n      },\n      body: JSON.stringify({ ...body, PageNonce: '' }),\n    });\n    return payload;\n  };\n\n  const details = await post('GetConversationDetails', { id: conversationId, maxReadMessages: PAGE_SIZE });\n  // `null` is MyChart saying it has no such conversation; nothing to page.\n  if (details === null || typeof details !== 'object') return collector.toRaw();\n\n  let page = rec(details);\n  let oldestInstant = text(rec(list(page.messages)[0]).deliveryInstantISO);\n  let pages = 0;\n  while (page.hasMoreMessages === true) {\n    if (pages === MAX_PAGES) {\n      logger.debug(`Stopped paging conversation ${conversationId} after ${MAX_PAGES} pages`);\n      break;\n    }\n    pages++;\n\n    // Exclusive bound: ask for the messages immediately older than the oldest one held.\n    const older = await post('GetConversationMessages', {\n      id: conversationId,\n      startInstantISO: oldestInstant,\n      maxReadMessages: PAGE_SIZE,\n    });\n    page = rec(older);\n\n    // An empty page with `hasMoreMessages` still set would ask for the same\n    // instant forever, so it is the end of the thread.\n    const messages = list(page.messages);\n    if (messages.length === 0) break;\n    oldestInstant = text(rec(messages[0]).deliveryInstantISO);\n  }\n\n  return collector.toRaw();\n}\n\n/**\n * The standard object — what `mode: 'json'` returns. `null` when MyChart has\n * no such conversation on the active patient record.\n */\nexport async function getConversationMessages(\n  mychartRequest: MyChartRequest,\n  conversationId: string,\n): Promise<ConversationThreadStandard | null> {\n  return conversationThreadProcessor.standard(await fetchConversationThreadRaw(mychartRequest, conversationId));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * A file name safe to create under any directory, from a name MyChart gave\n * us. Attachment names come straight off the record, so they can hold path\n * separators, control characters, or nothing at all; `fallback` (e.g.\n * `attachment.pdf`) names the file when nothing usable is left.\n */\nexport function safeFileName(name: string, fallback: string): string {\n  const cleaned = name\n    .replace(/[/\\\\:*?\"<>|]+/g, '_')\n    // eslint-disable-next-line no-control-regex\n    .replace(/[\\x00-\\x1f]+/g, '')\n    .replace(/\\s+/g, ' ')\n    .replace(/^[. ]+/, '')\n    .trim()\n    .substring(0, 120);\n  return cleaned || fallback;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Epic's DCS blob store: the two-step every downloadable file in MyChart goes\n * through, whichever activity filed it.\n *\n *   POST /api/documents/viewer/GetDocumentDetails[Legacy]\n *        { dcsId, fileExtension, organizationId, useOldMobileLink }\n *   GET  <downloadUrl>   /Documents/ViewDocument/Download[OrStream]?dcsid=…&displayName=…&dcsExt=…\n *\n * Two producers reach it — a message attachment (`chart/messages/messageAttachment.ts`)\n * and a Document Center document (`chart/documents/documentDownload.ts`) — and\n * they differ only in how they find a `dcsId`, never in what happens after. The\n * exchange lives here so the traps below are checked in one place; the third\n * producer gets them for free.\n *\n * **The variants are the same store.** `GetDocumentDetails` and its `…Legacy`\n * sibling answered identically on a live account across every file type —\n * same bytes, same length, same `mimeType` and `displayName` — differing only\n * in `legacyEncryption` and whether the link is `Download` or\n * `DownloadOrStream`. Each portal hook sends its own `useOldMobileLink` (the\n * Document Center `true`, the message viewer `false`), and no measurement\n * showed it changing the answer; each caller sends what its own hook sends\n * rather than the fake agreement of a value nobody verified.\n *\n * **`fileExtension` is ignored.** Measured five ways on one live instance —\n * correct, empty, omitted, wrong, and `dcsId` alone — every variant returned\n * the same file. A caller that has the extension passes it (it is what the\n * portal sends); a caller that would have to go and look one up should not.\n *\n * Three traps, none of them a status code, all checked on the payload:\n *   - an id the record does not hold answers **200 with a literal JSON `null`**\n *   - a document MyChart holds but will not release answers with `downloadUrl`\n *     and `token` both empty (1 of 42 on the captured account), and its\n *     `previewUrl` then streams **200 with an empty body**\n *   - a bogus download link answers **200 with an empty body and no\n *     Content-Type**\n */\nimport { makeAuthenticatedRequest } from './makeAuthenticatedRequest';\nimport type { MyChartRequest } from './myChartRequest';\nimport type { RequestConfig } from './types';\nimport { describeResponseFailure, type RawCollector } from './rawResponse';\nimport { safeFileName } from './safeFileName';\nimport { rec, text } from '../processors/read';\nimport type { GetDocumentDetailsLegacy } from './mychart.types';\n\n/** Why a `dcsId` produced no file. Callers word the refusal in their own terms. */\nexport type DcsFailure =\n  /** A literal `null`: this record holds no such document. */\n  | { reason: 'no_such_document' }\n  /** Held, but MyChart serves no file for it — `downloadUrl` and `token` empty. */\n  | { reason: 'not_released'; displayName: string }\n  /** MyChart answered the download with something that is not the file. */\n  | { reason: 'download_failed'; displayName: string; detail: string };\n\nexport interface DcsFile {\n  /** `Content-Disposition`'s name, made safe. */\n  fileName: string;\n  mimeType: string;\n  bytes: Uint8Array;\n  /** MyChart's own name for the file, before it was made safe. */\n  displayName: string;\n}\n\nexport class DcsDocumentError extends Error {\n  constructor(readonly failure: DcsFailure, message: string) {\n    super(message);\n    this.name = 'DcsDocumentError';\n  }\n}\n\nexport interface DcsRequest {\n  dcsId: string;\n  /** Ignored by MyChart; send what the portal's own hook would send. */\n  fileExtension: string;\n  organizationId: string;\n  /** The Document Center sends `true`, the message viewer `false`. */\n  useOldMobileLink: boolean;\n  /** `true` picks `GetDocumentDetailsLegacy`, as the message viewer does. */\n  legacy: boolean;\n}\n\n/**\n * `Content-Disposition: attachment; filename=\"Visit Summary.pdf\"` — the name a\n * browser would save, extension included. Preferred over building one from\n * `displayName`, whose extension is inconsistent: it carried `.pdf` on some\n * documents and nothing on others, while the header had it every time.\n */\nfunction dispositionFileName(header: string): string {\n  const match = /filename\\*?=(?:UTF-8'')?\"?([^\";]+)\"?/i.exec(header);\n  return match ? decodeURIComponent(match[1]!.trim()) : '';\n}\n\n/** `?dcsExt=PDF` off the download link, lower-cased, for the fallback name. */\nfunction extensionFrom(downloadUrl: string): string {\n  const match = /[?&]dcsExt=([^&]+)/i.exec(downloadUrl);\n  return match ? decodeURIComponent(match[1]!).replace(/[^a-zA-Z0-9]/g, '').toLowerCase() : '';\n}\n\n/**\n * Fetch one DCS blob. Records the details POST into `collector` (so `raw` mode\n * shows the exchange) and throws {@link DcsDocumentError} with a machine-\n * readable `failure` when there is no file — the caller owns the wording,\n * because only it knows what the id it was given is called.\n */\nexport async function fetchDcsFile(\n  mychartRequest: MyChartRequest,\n  collector: RawCollector,\n  token: string,\n  request: DcsRequest,\n): Promise<DcsFile> {\n  const details = await collector.postJson(\n    `/api/documents/viewer/GetDocumentDetails${request.legacy ? 'Legacy' : ''}`,\n    token,\n    {\n      dcsId: request.dcsId,\n      fileExtension: request.fileExtension,\n      organizationId: request.organizationId,\n      useOldMobileLink: request.useOldMobileLink,\n    },\n  );\n  if (details === null || typeof details !== 'object') {\n    throw new DcsDocumentError({ reason: 'no_such_document' }, `MyChart has no document ${request.dcsId} on the active patient record.`);\n  }\n\n  const body = rec<GetDocumentDetailsLegacy>(details);\n  const displayName = text(body.displayName) || text(body.fileDescription);\n  const downloadUrl = text(body.downloadUrl);\n  if (!downloadUrl) {\n    throw new DcsDocumentError(\n      { reason: 'not_released', displayName },\n      `MyChart serves no file for document ${request.dcsId}.`,\n    );\n  }\n\n  const config: RequestConfig = { path: downloadUrl.startsWith('/') ? downloadUrl : `/${downloadUrl}` };\n  const response = await makeAuthenticatedRequest(mychartRequest, config);\n  const bytes = new Uint8Array(await response.arrayBuffer());\n  const contentType = response.headers.get('content-type') ?? '';\n  const declaredMime = text(body.mimeType);\n\n  const fail = (detail: string) => {\n    throw new DcsDocumentError({ reason: 'download_failed', displayName, detail }, detail);\n  };\n  const failure = describeResponseFailure(response, new TextDecoder().decode(bytes.subarray(0, 4096)), config);\n  if (failure) fail(failure);\n  if (bytes.length === 0) fail('an empty body');\n  // A web page where a file should be. `text/html` is a real document type —\n  // an e-signed document is HTML, 8 of 42 on the captured account — so this\n  // only fires when MyChart itself did not say the file was HTML.\n  if (contentType.includes('text/html') && !declaredMime.includes('html')) fail('a web page instead of the file');\n\n  const extension = extensionFrom(downloadUrl);\n  const named = dispositionFileName(response.headers.get('content-disposition') ?? '')\n    || (displayName && extension ? `${displayName}.${extension}` : displayName);\n  return {\n    fileName: safeFileName(named, extension ? `document.${extension}` : 'document'),\n    mimeType: declaredMime || contentType.split(';')[0]!.trim(),\n    bytes,\n    displayName,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * One file attached to a message: the bytes MyChart holds for it.\n *\n * The thread endpoints only describe an attachment — `name`, `fileExtension`,\n * a `dcsId` — and never carry its content. The bytes come from Epic's DCS blob\n * store, the same one Document Center documents use; the exchange and its\n * traps are in [`core/dcsDocument.ts`](../../core/dcsDocument.ts). This module\n * owns the half that is attachment-specific: finding the attachment on its\n * thread, refusing the kinds that do not go through DCS, and wording a refusal\n * in terms of the conversation the caller named.\n *\n * The portal's message viewer (`useDcsDocument` with `legacyEncryption`)\n * sends `GetDocumentDetailsLegacy` and `useOldMobileLink: false`, so that is\n * what this sends. Measured across PDF, PNG and JPG attachments on two\n * instances; the legacy and non-legacy variants returned identical bytes on a\n * third, differing only in `legacyEncryption` and the link's name.\n *\n * Only `MessageDocType.DCS` (`type: 2`) attachments go this way; every one\n * captured so far is. An ETX attachment (`type: 1`, a clinical reference the\n * portal renders as a popup via `GetClinicalReferenceDetails`) and a\n * community-jump attachment (`legacyUrlForCommunityJump`, another\n * organization's portal) have not been observed on any instance, so they are\n * refused with a reason rather than guessed at.\n */\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector } from '../../core/rawResponse';\nimport { DcsDocumentError, fetchDcsFile } from '../../core/dcsDocument';\nimport { safeFileName } from '../../core/safeFileName';\nimport type { FilePayload } from '../../core/filePayload';\nimport { list, rec, text } from '../../processors/read';\nimport { fetchConversationThreadRaw } from './messageThreads';\nimport { DetailedError } from '../../../../shared/detailedError';\n\n/**\n * A downloaded attachment: the file, and what the thread said about it.\n * `fileName` is the name the thread lists (e.g. `results.pdf`) made safe;\n * `mimeType` is from the details call, falling back to the download's\n * Content-Type.\n */\nexport interface MessageAttachmentFile extends FilePayload {\n  conversationId: string;\n  /** The attachment's `dcsId`, the handle `get_message_thread` shows. */\n  dcsId: string;\n  /** MyChart's extension for it, upper-case (`PDF`, `PNG`, `JPG`). */\n  fileExtension: string;\n}\n\n/** `attachment.pdf` — what an attachment the thread left unnamed is called. */\nfunction extensionFallback(fileExtension: string): string {\n  const extension = fileExtension.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n  return extension ? `attachment.${extension}` : 'attachment';\n}\n\n/** What the thread says about one attachment, as MyChart sent it. */\ninterface ThreadAttachment {\n  dcsId: string;\n  etxId: string;\n  name: string;\n  fileExtension: string;\n  type: number;\n  organizationId: string;\n  legacyUrlForCommunityJump: string;\n}\n\nconst DCS_DOC_TYPE = 2;\n\nfunction threadAttachments(threadRaw: { requests: Array<{ body: unknown }> }): ThreadAttachment[] {\n  const out: ThreadAttachment[] = [];\n  for (const request of threadRaw.requests) {\n    for (const message of list(rec(request.body).messages)) {\n      for (const value of list(rec(message).attachments)) {\n        const a = rec(value);\n        out.push({\n          dcsId: text(a.dcsId),\n          etxId: text(a.etxId),\n          name: text(a.name),\n          fileExtension: text(a.fileExtension),\n          type: typeof a.type === 'number' ? a.type : -1,\n          organizationId: text(a.organizationId),\n          legacyUrlForCommunityJump: text(a.legacyUrlForCommunityJump),\n        });\n      }\n    }\n  }\n  // A message can appear on the details page and on a paged response.\n  return out.filter((a, i) => out.findIndex((b) => b.dcsId === a.dcsId && b.name === a.name) === i);\n}\n\nfunction describeAvailable(attachments: ThreadAttachment[], withNames: boolean): string {\n  if (attachments.length === 0) return 'That conversation has no attachments.';\n  const id = (a: ThreadAttachment) => a.dcsId || a.etxId || '?';\n  return withNames\n    ? `The attachments on that conversation are: ${attachments.map((a) => `${a.name || '(unnamed)'} (attachment_id ${id(a)})`).join(', ')}.`\n    : `The attachment_ids on that conversation are: ${attachments.map(id).join(', ')}.`;\n}\n\n/**\n * Download the attachment `attachmentId` (its `dcsId`) from conversation\n * `conversationId`. Reads the thread first, so the attachment's own\n * `fileExtension` and `organizationId` go into the details call exactly as\n * the portal would send them, and so an id from the wrong conversation is a\n * clear refusal rather than a mystery download.\n */\nexport async function downloadMessageAttachment(\n  mychartRequest: MyChartRequest,\n  conversationId: string,\n  attachmentId: string,\n): Promise<MessageAttachmentFile> {\n  const threadRaw = await fetchConversationThreadRaw(mychartRequest, conversationId);\n  const details = threadRaw.requests.find((r) => r.path.includes('GetConversationDetails'));\n  if (!details || details.body === null || typeof details.body !== 'object') {\n    throw new Error(\n      `No conversation ${conversationId} on the active patient record. Check the id from get_messages, and that the right patient is active.`,\n    );\n  }\n\n  const attachments = threadAttachments(threadRaw);\n  const attachment = attachments.find((a) => a.dcsId === attachmentId || (a.etxId !== '' && a.etxId === attachmentId));\n  if (!attachment) {\n    const lead = `No attachment ${attachmentId} on conversation ${conversationId}. `;\n    throw new DetailedError(lead + describeAvailable(attachments, false), lead + describeAvailable(attachments, true));\n  }\n  if (attachment.legacyUrlForCommunityJump) {\n    const rest = \" is held by another organization's portal (a community link), which this account cannot download from here.\";\n    throw new DetailedError(`Attachment ${attachmentId}${rest}`, `${attachment.name}${rest}`);\n  }\n  if (attachment.type !== DCS_DOC_TYPE || !attachment.dcsId) {\n    const rest = ` is not a downloadable document (MyChart type ${attachment.type}); only file attachments (type ${DCS_DOC_TYPE}) are supported.`;\n    throw new DetailedError(`Attachment ${attachmentId}${rest}`, `${attachment.name}${rest}`);\n  }\n\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/communication-center');\n\n  try {\n    const file = await fetchDcsFile(mychartRequest, collector, token, {\n      dcsId: attachment.dcsId,\n      fileExtension: attachment.fileExtension,\n      organizationId: attachment.organizationId,\n      useOldMobileLink: false,\n      legacy: true,\n    });\n    return {\n      conversationId,\n      dcsId: attachment.dcsId,\n      fileExtension: attachment.fileExtension,\n      // The thread's own name (`results.pdf`) beats the store's `displayName`,\n      // which is a system name like `MyChart_Document_1` — and when the thread\n      // named it nothing, the extension alone beats that system name too.\n      fileName: safeFileName(attachment.name, extensionFallback(attachment.fileExtension)),\n      mimeType: file.mimeType,\n      bytes: file.bytes,\n    };\n  } catch (error) {\n    if (!(error instanceof DcsDocumentError)) throw error;\n    const { failure } = error;\n    if (failure.reason === 'no_such_document') {\n      throw new Error(\n        `MyChart has no document ${attachment.dcsId} on the active patient record, although the thread lists it. ` +\n          'Check that the right patient is active.',\n      );\n    }\n    if (failure.reason === 'not_released') {\n      const rest = '; it may not be downloadable from the portal either.';\n      throw new DetailedError(\n        `MyChart returned no download link for attachment ${attachmentId}${rest}`,\n        `MyChart returned no download link for ${attachment.name}${rest}`,\n      );\n    }\n    const rest = ` with ${failure.detail}; nothing was downloaded.`;\n    throw new DetailedError(\n      `MyChart answered the download of attachment ${attachmentId}${rest}`,\n      `MyChart answered the download of ${attachment.name}${rest}`,\n    );\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Message recipients and topics processors. Field decisions:\n * docs/processor-layer-proposal.md, `get_message_recipients` and\n * `get_message_topics`.\n *\n * `GetMedicalAdviceRequestRecipients` is a bare array on every captured\n * instance; the scraper it replaced also tolerated six wrapper keys, which\n * are honoured here so an instance that wraps the list does not read as\n * \"nobody to message\".\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, num, rec, textOrNull } from '../../processors/read';\nimport type { GetMedicalAdviceRequestRecipients, GetSubTopics } from './mychart.types';\nimport type { MessageRecipientsStandard, MessageTopicsStandard } from './standardized.types';\n\nexport type { MessageRecipientStandard, MessageRecipientsStandard, MessageTopicStandard, MessageTopicsStandard } from './standardized.types';\n\nconst WRAPPER_KEYS = ['recipients', 'recipientList', 'Providers', 'providers', 'ProviderList', 'providerList'];\n\n/** The recipient list, whether the instance sent it bare or under one of the known wrapper keys. */\nexport function recipientList(body: unknown): unknown[] {\n  if (Array.isArray(body)) return body;\n  const wrapper = rec(body);\n  for (const key of WRAPPER_KEYS) {\n    if (Array.isArray(wrapper[key])) return wrapper[key] as unknown[];\n  }\n  return [];\n}\n\nexport const messageRecipientsProcessor: Processor<MessageRecipientsStandard> = {\n  standard(raw: RawResponse): MessageRecipientsStandard {\n    return {\n      recipients: recipientList(bodyOf(raw, 'GetMedicalAdviceRequestRecipients')).map((value) => {\n        const r = rec<GetMedicalAdviceRequestRecipients[number]>(value);\n        return {\n          displayName: textOrNull(r.displayName),\n          specialty: textOrNull(r.specialty),\n          pcpTypeDisplayName: textOrNull(r.pcpTypeDisplayName),\n          recipientType: num(r.recipientType),\n          oocContext: num(r.oocContext),\n          userId: textOrNull(r.userId),\n          departmentId: textOrNull(r.departmentId),\n          poolId: textOrNull(r.poolId),\n          providerId: textOrNull(r.providerId),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    return {\n      recipients: standard.recipients.map((r) => ({\n        displayName: r.displayName,\n        specialty: r.specialty,\n        pcpTypeDisplayName: r.pcpTypeDisplayName,\n      })),\n    };\n  },\n};\n\nexport const messageTopicsProcessor: Processor<MessageTopicsStandard> = {\n  standard(raw: RawResponse): MessageTopicsStandard {\n    const body = rec<GetSubTopics>(bodyOf(raw, 'GetSubtopics'));\n    return {\n      topicList: list(body.topicList).map((value) => ({\n        displayName: textOrNull(rec(value).displayName),\n        value: textOrNull(rec(value).value),\n      })),\n    };\n  },\n  concise: (standard) => standard,\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Read side of composing a message: who can be written to and about what.\n * `sendMessage.ts` keeps its own `getMessageRecipients` / `getMessageTopics`\n * for the send flow; these are the capability-facing fetches that record the\n * exchange.\n */\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { MissingVerificationTokenError } from '../../core/util';\nimport { getVerificationToken } from './communicationCenterToken';\nimport {\n  messageRecipientsProcessor,\n  messageTopicsProcessor,\n  type MessageRecipientsStandard,\n  type MessageTopicsStandard,\n} from './recipients.processor';\n\nexport type {\n  MessageRecipientStandard,\n  MessageRecipientsStandard,\n  MessageTopicStandard,\n  MessageTopicsStandard,\n} from './recipients.processor';\nexport { messageRecipientsProcessor, messageTopicsProcessor, recipientList } from './recipients.processor';\n\nconst COMMUNICATION_CENTER = '/app/communication-center';\n\nasync function requireMessagingToken(mychartRequest: MyChartRequest): Promise<string> {\n  const token = await getVerificationToken(mychartRequest);\n  if (!token) throw new MissingVerificationTokenError(COMMUNICATION_CENTER);\n  return token;\n}\n\nasync function postMedicalAdvice(collector: RawCollector, action: string, token: string, organizationId: string): Promise<void> {\n  await collector.send({\n    path: `/api/medicaladvicerequests/${action}`,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json; charset=utf-8',\n      __RequestVerificationToken: token,\n    },\n    body: JSON.stringify({ organizationId }),\n  });\n}\n\n/** `POST /api/medicaladvicerequests/GetMedicalAdviceRequestRecipients`, with the communication-center token. */\nexport async function fetchMessageRecipientsRaw(mychartRequest: MyChartRequest, organizationId = ''): Promise<RawResponse> {\n  const token = await requireMessagingToken(mychartRequest);\n  const collector = new RawCollector(mychartRequest);\n  await postMedicalAdvice(collector, 'GetMedicalAdviceRequestRecipients', token, organizationId);\n  return collector.toRaw();\n}\n\n/** `POST /api/medicaladvicerequests/GetSubtopics`, with the communication-center token. */\nexport async function fetchMessageTopicsRaw(mychartRequest: MyChartRequest, organizationId = ''): Promise<RawResponse> {\n  const token = await requireMessagingToken(mychartRequest);\n  const collector = new RawCollector(mychartRequest);\n  await postMedicalAdvice(collector, 'GetSubtopics', token, organizationId);\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function listMessageRecipients(mychartRequest: MyChartRequest, organizationId = ''): Promise<MessageRecipientsStandard> {\n  return messageRecipientsProcessor.standard(await fetchMessageRecipientsRaw(mychartRequest, organizationId));\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function listMessageTopics(mychartRequest: MyChartRequest, organizationId = ''): Promise<MessageTopicsStandard> {\n  return messageTopicsProcessor.standard(await fetchMessageTopicsRaw(mychartRequest, organizationId));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { getVerificationToken } from './communicationCenterToken';\nimport { logger } from '../../../../shared/logger';\n\nexport type DeleteMessageResult = {\n  success: boolean;\n  error?: string;\n}\n\nexport async function deleteMessage(mychartRequest: MyChartRequest, conversationId: string): Promise<DeleteMessageResult> {\n  const token = await getVerificationToken(mychartRequest);\n\n  if (!token) {\n    logger.debug('Could not find request verification token for delete message');\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/conversations/DeleteConversation',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify({ conversationId }),\n  });\n\n  if (resp.status === 200) {\n    return { success: true };\n  }\n\n  const text = await resp.text();\n  return { success: false, error: `Delete failed with status ${resp.status}: ${text}` };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { DetailedError } from './detailedError';\n\n/**\n * Resolve a human-supplied name to exactly one item, or refuse.\n *\n * Models are handed display names, not opaque ids, so every tool that takes a\n * \"which one did you mean\" argument needs the same lookup: exact match first,\n * then a unique partial match, and an error listing the candidates when more\n * than one survives. Picking a provider or a medication on the patient's\n * behalf is exactly the guess this codebase must never make.\n *\n * **Exact-before-partial is the whole point.** A substring-only matcher rejects\n * a perfectly correct name as ambiguous whenever another entry contains it:\n *\n *     resolveUnique(['Dr. Smith', 'Dr. Smithson'], 'Dr. Smith')\n *\n * every entry containing \"smith\" matches, so the caller is told to \"be more\n * specific\" about a name that could not have been more specific. Checking for\n * an exact match first settles it. `findProxyTarget` in\n * `scrapers/myChart/proxyContext.ts` has always done this for patient records;\n * this is the same rule for everything else.\n */\n\n/** Honorifics that carry no identifying information in a provider name. */\nconst TITLE_WORDS = new Set([\n  'dr', 'dr.', 'mr', 'mr.', 'mrs', 'mrs.', 'ms', 'ms.',\n  'md', 'md.', 'do', 'do.', 'np', 'pa', 'rn',\n]);\n\nfunction normalize(text: string): string {\n  return text.toLowerCase().replace(/\\s+/g, ' ').trim();\n}\n\nfunction nameTokens(query: string): string[] {\n  const all = normalize(query).split(/[\\s,]+/).filter(Boolean);\n  const withoutTitles = all.filter((t) => !TITLE_WORDS.has(t));\n  // A query that is *nothing but* an honorific (\"Dr\") still narrows the list,\n  // and reporting \"multiple providers match\" beats claiming no name was given.\n  return withoutTitles.length > 0 ? withoutTitles : all;\n}\n\nexport interface ResolveUniqueOptions<T> {\n  /** The display name to match against, and the one shown in errors. */\n  getName: (item: T) => string;\n  /**\n   * Other names the same item answers to — a medication's brand name against\n   * its generic, say. Matched like the display name; never shown in errors,\n   * since listing both names for one item reads as two items.\n   */\n  getAlternateNames?: (item: T) => string[];\n  /** Singular noun for the error messages, e.g. \"recipient\", \"medication\". */\n  label: string;\n  /**\n   * Strip honorifics (Dr., MD, RN) before matching. On for people, off for\n   * things — a medication called \"DO NOT SUBSTITUTE\" should keep its words.\n   */\n  stripTitles?: boolean;\n}\n\n/**\n * Resolve `query` to exactly one item.\n *\n * @throws when the query is empty, matches nothing, or matches more than one\n * item. The detailed message lists the available names, so the caller can\n * retry with something specific instead of guessing; the message names none,\n * since they are the patient's providers or medications.\n */\nexport function resolveUnique<T>(items: T[], query: string, opts: ResolveUniqueOptions<T>): T {\n  const { getName, label } = opts;\n  const available = () => items.map(getName).join(', ');\n  const namesOf = (item: T): string[] =>\n    [getName(item), ...(opts.getAlternateNames?.(item) ?? [])].filter(Boolean).map(normalize);\n\n  const wanted = normalize(query);\n  if (!wanted) {\n    throw new DetailedError(`No ${label} name given.`, `No ${label} name given. Available: ${available()}`);\n  }\n\n  // 1. Exact match, case- and whitespace-insensitive. A correct name always\n  //    wins, no matter how many other entries happen to contain it.\n  const exact = items.filter((item) => namesOf(item).includes(wanted));\n  if (exact.length === 1) return exact[0]!;\n  if (exact.length > 1) {\n    throw new DetailedError(\n      `${exact.length} ${label}s have that name. They cannot be told apart by name.`,\n      `More than one ${label} is called \"${query}\": ${exact.map(getName).join(', ')}. ` +\n        'They cannot be told apart by name.',\n    );\n  }\n\n  // 2. Every token present somewhere in one of the names, in any order.\n  const tokens = opts.stripTitles === false ? [wanted] : nameTokens(query);\n  const partial = items.filter((item) =>\n    namesOf(item).some((name) => tokens.every((token) => name.includes(token))),\n  );\n\n  if (partial.length === 0) {\n    throw new DetailedError(`No ${label} matches that name.`, `No ${label} matching \"${query}\". Available: ${available()}`);\n  }\n  if (partial.length > 1) {\n    throw new DetailedError(\n      `${partial.length} ${label}s match that name. Be more specific.`,\n      `Multiple ${label}s match \"${query}\": ${partial.map(getName).join(', ')}. Be more specific.`,\n    );\n  }\n  return partial[0]!; // lengths 0 and >1 were ruled out above\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Resolving a name a caller typed to exactly one MyChart entity.\n *\n * The shared `resolveUnique` does the work — exact match first, then a unique\n * partial, and an error listing the candidates otherwise. These wrappers exist\n * so the messaging capabilities read clearly and so consumers of the npm\n * package can reach the same logic.\n */\n\nimport { resolveUnique } from '../resolveUnique';\nimport type { MessageRecipient, MessageTopic } from '../../scrapers/myChart/chart/messages/sendMessage';\n\n// package can reach the same logic.\n\n/** Resolve a provider name to exactly one recipient, or throw with the options. */\nexport function resolveRecipient(recipients: MessageRecipient[], query: string): MessageRecipient {\n  return resolveUnique(recipients, query, { getName: (r) => r.displayName, label: 'recipient' });\n}\n\n/**\n * Resolve a topic name, falling back to the first available topic.\n *\n * Unlike a recipient, an unmatched topic is not worth refusing over: MyChart\n * requires a topic on every message and the category is cosmetic, so stranding\n * the patient's message over it would help nobody. The fallback is *reported*\n * rather than silent — `send_message` returns the topic it actually used, so\n * the reply can say which one, instead of the substitution being invisible at\n * the call site.\n */\nexport function resolveTopic(\n  topics: MessageTopic[],\n  query: string | undefined,\n): { topic: MessageTopic; substituted: boolean } {\n  const firstTopic = topics[0];\n  if (!firstTopic) throw new Error('No message topics are available on this MyChart.');\n  const wanted = (query ?? '').toLowerCase().trim();\n  if (!wanted) return { topic: firstTopic, substituted: false };\n  const match = topics.find((t) => t.displayName.toLowerCase().includes(wanted));\n  return match ? { topic: match, substituted: false } : { topic: firstTopic, substituted: true };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Messages` group — the inbox, and sending into it. */\n\nimport { fetchConversationsRaw, conversationsProcessor } from '../../../scrapers/myChart/chart/messages/conversations';\nimport { fetchConversationThreadRaw, conversationThreadProcessor } from '../../../scrapers/myChart/chart/messages/messageThreads';\nimport { downloadMessageAttachment, type MessageAttachmentFile } from '../../../scrapers/myChart/chart/messages/messageAttachment';\nimport {\n  fetchMessageRecipientsRaw,\n  fetchMessageTopicsRaw,\n  messageRecipientsProcessor,\n  messageTopicsProcessor,\n} from '../../../scrapers/myChart/chart/messages/recipients';\nimport {\n  sendNewMessage,\n  getMessageRecipients,\n  getMessageTopics,\n  getVerificationToken,\n} from '../../../scrapers/myChart/chart/messages/sendMessage';\nimport { sendReply } from '../../../scrapers/myChart/chart/messages/sendReply';\nimport { deleteMessage } from '../../../scrapers/myChart/chart/messages/deleteMessage';\nimport type { MyChartRequest } from '../../../scrapers/myChart/core/myChartRequest';\nimport type { FilePayload } from '../../../scrapers/myChart/core/filePayload';\nimport { optStr, requireStr, strList } from '../args';\nimport { resolveRecipient, resolveTopic } from '../resolve';\nimport type { CapabilityArgs, CapabilityContext, CapabilityImpl, CapabilityParam } from '../types';\n\nasync function messagingToken(request: MyChartRequest): Promise<string> {\n  const token = await getVerificationToken(request);\n  if (!token) throw new Error('Could not get a MyChart verification token for messaging.');\n  return token;\n}\n\nconst ATTACHMENTS_PARAM: CapabilityParam = {\n  name: 'attachments',\n  type: 'string[]',\n  description:\n    'Files to attach: local file paths, e.g. a path a download tool returned (from the CLI, comma-separated). ' +\n    'Allowed types, sizes and count are whatever this MyChart permits; a file it would refuse is an error before anything is sent.',\n};\n\nasync function readAttachments(args: CapabilityArgs, ctx: CapabilityContext | undefined): Promise<FilePayload[]> {\n  const refs = strList(args, ATTACHMENTS_PARAM.name);\n  if (refs.length === 0) return [];\n  const readFile = ctx?.readFile;\n  if (!readFile) throw new Error('This client cannot attach files to messages yet.');\n  return Promise.all(refs.map((ref) => readFile(ref)));\n}\n\nexport const MESSAGE_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_messages',\n    title: 'Messages',\n    description:\n      'Every conversation in the inbox: its id, subject, who it is with, when the latest message arrived, and ' +\n      'whether it is unread, urgent or has attachments. The messages themselves come from get_message_thread.',\n    kind: 'read',\n    group: 'Messages',\n    params: [],\n    run: (request) => fetchConversationsRaw(request),\n    processor: conversationsProcessor,\n  },\n  {\n    id: 'get_message_thread',\n    title: 'Message thread',\n    description:\n      'Every message in one conversation: text, date, sender, and for each attachment its name and dcsId. ' +\n      'An attachment\\'s content is a separate call — get_message_attachment with that dcsId.',\n    kind: 'read',\n    group: 'Messages',\n    params: [{ name: 'conversation_id', type: 'string', description: 'Conversation id from get_messages.', required: true }],\n    run: async (request, args) => {\n      const conversationId = requireStr(args, 'conversation_id');\n      const raw = await fetchConversationThreadRaw(request, conversationId);\n      // GetConversationDetails answers an unknown id with a literal JSON null\n      // (same as GetVisitNotes). Saying so beats rendering an empty thread.\n      if (raw.requests.find((r) => r.path.includes('GetConversationDetails'))?.body === null) {\n        throw new Error(\n          `No conversation ${conversationId} on the active patient record. Check the id from get_messages, and that the right patient is active.`,\n        );\n      }\n      return raw;\n    },\n    processor: conversationThreadProcessor,\n  },\n  {\n    id: 'get_message_attachment',\n    title: 'Message attachment',\n    description:\n      'Download one file attached to a message — a PDF, photo or other document a provider or the patient attached. Identify it by the conversation_id from get_messages and the attachment_id (the attachment’s dcsId) from get_message_thread. The file is saved on the user’s own device; images are also shown inline.',\n    kind: 'read',\n    group: 'Messages',\n    returnsFile: true,\n    params: [\n      { name: 'conversation_id', type: 'string', description: 'Conversation id from get_messages.', required: true },\n      { name: 'attachment_id', type: 'string', description: 'The attachment’s dcsId from get_message_thread. Copy it verbatim.', required: true },\n    ],\n    run: (request, args): Promise<MessageAttachmentFile> =>\n      downloadMessageAttachment(request, requireStr(args, 'conversation_id'), requireStr(args, 'attachment_id')),\n  },\n  {\n    id: 'get_message_recipients',\n    title: 'Message recipients',\n    description: 'Providers and departments that can receive a new message.',\n    kind: 'read',\n    group: 'Messages',\n    params: [],\n    run: (request) => fetchMessageRecipientsRaw(request),\n    processor: messageRecipientsProcessor,\n  },\n  {\n    id: 'get_message_topics',\n    title: 'Message topics',\n    description: 'Topics/categories a new message can be filed under.',\n    kind: 'read',\n    group: 'Messages',\n    // send_message resolves the topic itself and reports any substitution, so\n    // listing them up front is rarely a step anyone needs to take.\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchMessageTopicsRaw(request),\n    processor: messageTopicsProcessor,\n  },\n  {\n    id: 'send_message',\n    title: 'Send a message',\n    description:\n      'Send a new message to a provider or department. Names are matched against get_message_recipients — an ambiguous name is an error rather than a guess.',\n    kind: 'write',\n    group: 'Messages',\n    params: [\n      { name: 'recipient_name', type: 'string', description: 'Provider or department name, as shown by get_message_recipients.', required: true },\n      { name: 'topic', type: 'string', description: 'Topic name, e.g. \"Medical Question\". Defaults to the first available topic.' },\n      { name: 'subject', type: 'string', description: 'Subject line.', required: true },\n      { name: 'message', type: 'string', description: 'Body of the message.', required: true },\n      ATTACHMENTS_PARAM,\n    ],\n    run: async (request, args, ctx) => {\n      const attachments = await readAttachments(args, ctx);\n      const token = await messagingToken(request);\n      const [recipients, topics] = await Promise.all([\n        getMessageRecipients(request, token),\n        getMessageTopics(request, token),\n      ]);\n      const recipient = resolveRecipient(recipients, requireStr(args, 'recipient_name'));\n      const { topic, substituted } = resolveTopic(topics, optStr(args, 'topic'));\n      const result = await sendNewMessage(request, {\n        recipient,\n        topic,\n        subject: requireStr(args, 'subject'),\n        messageBody: requireStr(args, 'message'),\n        attachments,\n      });\n      // Say who it went to and under which topic. The topic can be a\n      // substitution when the requested one doesn't exist on this instance,\n      // and a silent substitution is one the patient never gets told about.\n      return {\n        ...result,\n        sent_to: recipient.displayName,\n        topic_used: topic.displayName,\n        ...(substituted\n          ? { topic_substituted: `No topic matched \"${optStr(args, 'topic')}\"; used \"${topic.displayName}\" instead.` }\n          : {}),\n      };\n    },\n  },\n  {\n    id: 'send_reply',\n    title: 'Reply to a message',\n    description: 'Reply in an existing conversation.',\n    kind: 'write',\n    group: 'Messages',\n    params: [\n      { name: 'conversation_id', type: 'string', description: 'Conversation id from get_messages.', required: true },\n      { name: 'message', type: 'string', description: 'Reply text.', required: true },\n      ATTACHMENTS_PARAM,\n    ],\n    run: async (request, args, ctx) =>\n      sendReply(request, {\n        conversationId: requireStr(args, 'conversation_id'),\n        messageBody: requireStr(args, 'message'),\n        attachments: await readAttachments(args, ctx),\n      }),\n  },\n  {\n    id: 'delete_message',\n    title: 'Delete a conversation',\n    description: 'Delete a message conversation from the inbox.',\n    kind: 'write',\n    group: 'Messages',\n    lessFrequentlyUsed: true,\n    params: [{ name: 'conversation_id', type: 'string', description: 'Conversation id from get_messages.', required: true }],\n    run: (request, args) => deleteMessage(request, requireStr(args, 'conversation_id')),\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Epic's day numbers — the `dte`/`Dat`/`DTE` integers that appear all over\n * MyChart's payloads.\n *\n * Epic runs on MUMPS, whose `$HOROLOG` counts whole days from 1840-12-31\n * rather than from the Unix epoch, so a MyChart date field is usually a plain\n * integer: 0 is 1840-12-31, 47117 is 1970-01-01, and (verified against a live\n * scheduling response) 67821 is 2026-09-08. Billing calls it `dte`, the visit\n * list calls it `Dat`, the anonymous scheduler calls it `Dte` and\n * `SearchRangeStartDte` — same number every time.\n *\n * Two framings exist because MyChart itself uses both:\n *\n * - **UTC** (`toEpicDte` / `fromEpicDte`) — for a day number that came off the\n *   wire alongside a UTC instant, so the two agree.\n * - **Local** (`toEpicDteLocal` / `fromEpicDteLocal`) — for a day number the\n *   browser would have produced from the user's wall clock. Epic's own pages\n *   send the local calendar date, and deriving it from UTC skips the rest of\n *   the current day for anyone west of Greenwich in the evening: at 9pm\n *   Pacific, UTC is already tomorrow.\n *\n * Pick the one that matches where the date came from; they differ by a day\n * near the edges, which is exactly when it matters.\n */\n\n/** 1840-12-31, the MUMPS `$HOROLOG` epoch, as a Unix timestamp in ms. */\nexport const EPIC_EPOCH_UTC = Date.UTC(1840, 11, 31);\n\nconst MS_PER_DAY = 86_400_000;\n\n/**\n * UTC midnight for a calendar date, built field by field.\n *\n * `Date.UTC(year, …)` maps years 0-99 onto 1900-1999; `setUTCFullYear` does\n * not, and Epic day numbers run back past 1841.\n */\nfunction utcMidnightMs(year: number, month: number, day: number): number {\n  const at = new Date(0);\n  at.setUTCFullYear(year, month, day);\n  at.setUTCHours(0, 0, 0, 0);\n  return at.valueOf();\n}\n\n/** The day number for the **UTC** calendar date of `date`. Time of day is ignored. */\nexport function toEpicDte(date: Date): number {\n  const ms = utcMidnightMs(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n  return Math.round((ms - EPIC_EPOCH_UTC) / MS_PER_DAY);\n}\n\n/** The day number for the **local** calendar date of `date`. Time of day is ignored. */\nexport function toEpicDteLocal(date: Date): number {\n  const ms = utcMidnightMs(date.getFullYear(), date.getMonth(), date.getDate());\n  return Math.round((ms - EPIC_EPOCH_UTC) / MS_PER_DAY);\n}\n\n/** The instant of **UTC** midnight on the day `dte` names. */\nexport function fromEpicDte(dte: number): Date {\n  return new Date(EPIC_EPOCH_UTC + dte * MS_PER_DAY);\n}\n\n/** The instant of **local** midnight on the day `dte` names. */\nexport function fromEpicDteLocal(dte: number): Date {\n  const utc = fromEpicDte(dte);\n  const local = new Date(0);\n  local.setFullYear(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());\n  local.setHours(0, 0, 0, 0);\n  return local;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `/Billing/Summary` page: one `.ba_card` per guarantor account. Both\n * the scraper (to know which accounts to fetch details for) and the\n * processor (to build the account rows from the recorded page) parse it, so\n * it lives apart from either.\n */\n\nimport * as cheerio from 'cheerio';\nimport { logger } from '../../../../shared/logger';\nimport type { BillingAccount } from './types';\n\n/**\n * The pay-online path the summary page carries in its inline config\n * (`\"URLMakePayment\": \"~/Billing/Payment?ID=…\\u0026Context=…\"`), as a path\n * relative to the instance root. On the four live instances checked, this is\n * where the link lives — `GetVisits`' `URLMakePayment` is null on all of them.\n */\nexport function parsePaymentPath(html: string): string | null {\n  const match = /\"URLMakePayment\":\\s*\"([^\"]+)\"/.exec(html);\n  if (!match) return null;\n  const path = match[1]!.replace(/^~/, '').replaceAll('\\\\u0026', '&');\n  return path.startsWith('/') ? path : `/${path}`;\n}\n\nexport function parsePaymentUrl(html: string): { id: string; context: string } | null {\n  const regex = /\"URLMakePayment\":\\s*\"([^\"]+)\"/;\n  const match = regex.exec(html);\n  if (match) {\n    // Remove the leading '~/'\n    const urlStr = match[1]!.replace(/^~\\//, ''); // the one capture group is non-optional\n    // Split into path and query string\n    let [, queryString] = urlStr.split('?');\n    if (!queryString) {\n      logger.debug('returning null');\n      return null;\n    }\n    queryString = queryString.replaceAll('\\\\u0026', '&');\n\n    if (queryString) {\n      const params = new URLSearchParams(queryString);\n      const id = params.get('ID');\n      const context = params.get('Context');\n      if (id && context) {\n        return { id, context };\n      }\n    }\n  }\n  logger.debug('returning null');\n  return null;\n}\n\n/**\n * \"$1,234.56\" → 1234.56. Anything that is not a digit, a sign or a decimal\n * point is formatting; a plain `parseFloat` stopped at the thousands comma\n * and read \"$1,234.56\" as 1.\n */\nexport function parseAmount(display: string): number | undefined {\n  const cleaned = display.replace(/[^0-9.-]/g, '');\n  if (!cleaned) return undefined;\n  const amount = Number(cleaned);\n  return Number.isFinite(amount) ? amount : undefined;\n}\n\n/**\n * The accounts on the summary page. `hostname` only serves to resolve a\n * relative detail link far enough to read its query string, so any host does.\n */\nexport function parseBillingAccountsHtml(html: string, hostname = 'mychart.invalid'): BillingAccount[] {\n  const $ = cheerio.load(html);\n  const billing_accounts = $('.ba_card');\n  const accounts: BillingAccount[] = [];\n\n  for (const billing_account of billing_accounts.toArray()) {\n    const guarantorText = $('p.ba_card_header_account_idAndType', billing_account).text().trim();\n    const guarantorNumber = (/Guarantor #(\\d+)/.exec(guarantorText))?.[1] || 'unknown';\n    const patientName = (/\\((.*)\\)/.exec(guarantorText))?.[1] || 'unknown';\n    const amountdue = $('p.ba_card_status_due_amount', billing_account).text().trim();\n    const amountDueNum = amountdue ? parseAmount(amountdue) : undefined;\n\n    const link = $('p.ba_card_status_recentPaymentLabel a', billing_account).attr('href');\n    let ID, Context;\n    if (link) {\n      ID = new URL(link, 'https://' + hostname).searchParams.get('ID');\n      Context = new URL(link, 'https://' + hostname).searchParams.get('Context');\n    }\n    // Fallback: look for any link to /Billing/Details within the card (e.g. \"View Account Details\" link)\n    if (!ID || !Context) {\n      const detailsLink = $('a[href*=\"Billing/Details\"]', billing_account).attr('href');\n      if (detailsLink) {\n        const detailsUrl = new URL(detailsLink, 'https://' + hostname);\n        ID = detailsUrl.searchParams.get('ID');\n        Context = detailsUrl.searchParams.get('Context');\n      }\n    }\n    if (!ID || !Context) {\n      const paymentUrl = parsePaymentUrl(html);\n      ID = paymentUrl?.id;\n      Context = paymentUrl?.context;\n    }\n    if (!ID || !Context) continue;\n\n    accounts.push({ guarantorNumber, patientName, amountDue: amountDueNum, id: ID, context: Context });\n  }\n  return accounts;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Billing processor. Field decisions: docs/processor-layer-proposal.md, `get_billing`.\n *\n * The scraper records the summary page and then, per guarantor account,\n * `GetVisits`, `GetStatementList`, `LoadPaymentList` and the details page.\n * Those are GETs keyed by `id`/`context` in their query strings, so the join\n * here re-parses the summary cards and matches each recorded request to its\n * account by those parameters. `id`, `context` and `EncID` are internal —\n * visible in `raw` as the request paths and the details page.\n *\n * `GetVisits` spreads charges across nine overlapping lists whose population\n * differs by Epic release; reading one loses charges and reading all\n * double-counts (#380). They are merged most-specific-first and\n * de-duplicated on (`HospitalAccountId`, `StartDate`, `Description`,\n * `SelfAmountDueRaw`), with `category` naming the list a row came from.\n *\n * `GetVisits` also pages, returning the rows past the first page unhydrated\n * and priced at a fabricated `\"$0.00\"`. The scraper posts each of those back\n * to `GetMoreVisits`, one per request; {@link hydratedRows} collects the\n * answers and the merge swaps each stub for its real row. No caller ever\n * sees the placeholder: a stub that did not load is listed in\n * `unloadedVisits` instead, and `notice` says the visit list is incomplete.\n */\n\nimport { answered, findRequest, findRequests, type RawRequestRecord, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { htmlToText } from '../../processors/htmlText';\nimport { boolOrNull, list, num, rec, text, textOrNull } from '../../processors/read';\nimport type { BillingGetVisits, DataStatement, GetStatementList, LoadPaymentList, Statement } from './mychart.types';\nimport type { BillingAccountStandard, BillingCoverageInfoStandard, BillingPaymentStandard, BillingProcedureGroupStandard, BillingProcedureStandard, BillingStandard, BillingStatementStandard, BillingUnloadedVisitStandard, BillingVisitCategory, BillingVisitStandard } from './standardized.types';\n\nexport type { BillingAccountStandard, BillingCoverageInfoStandard, BillingPaymentStandard, BillingProcedureGroupStandard, BillingProcedureStandard, BillingStandard, BillingStatementStandard, BillingUnloadedReason, BillingUnloadedVisitStandard, BillingVisitCategory, BillingVisitStandard } from './standardized.types';\nimport { parseBillingAccountsHtml, parsePaymentPath } from './summaryHtml';\nimport type { BillingAccount } from './types';\n\n/** Most specific first, so a row in both \"bad debt\" and \"unified\" is reported as bad debt. */\nexport const VISIT_LIST_CATEGORIES: readonly BillingVisitCategory[] = [\n  'BadDebtVisitList',\n  'PaymentPlanVisitList',\n  'AdvanceBillVisitList',\n  'ContestedVisitList',\n  'AdjustmentVisitList',\n  'InformationalVisitList',\n  'NoBalanceVisitList',\n  'VisitList',\n  'UnifiedVisitList',\n];\n\nfunction scalarOrNull(value: unknown): string | number | null {\n  return typeof value === 'string' || typeof value === 'number' ? value : null;\n}\n\n/**\n * Whether `GetVisits` populated a charge row, read off `LevelOfDetailLoaded`.\n *\n * Epic pages this endpoint and lazy-loads the rows past the first page. An\n * unhydrated row is not empty, it is fabricated: `Description` is the\n * `\"{VisitType} at {Facility}\"` template with both slots blank, the procedure\n * and coverage lists are null, and every amount is the string `\"$0.00\"` even\n * on a visit charged thousands. The scraper posts those rows back to\n * `GetMoreVisits` and this merges the answers in, so a caller sees real\n * money; this predicate is how both sides agree on what still needs filling.\n *\n * Levels observed on the wire: `0` on every stub, `2` on every populated row.\n */\nexport function isStubRow(row: unknown): boolean {\n  return num(rec(row).LevelOfDetailLoaded) === 0;\n}\n\n/**\n * The `listOfAccounts[i].EncAccountID` value(s) a `GetMoreVisits` body\n * posted, in index order. The scraper posts one per request, so this is\n * normally a single handle; the index in the field name is still honoured\n * rather than parse order, because it is what ASP.NET binds on.\n */\nexport function postedHydrateKeys(requestBody: unknown): string[] {\n  if (typeof requestBody !== 'string') return [];\n  const indexed: Array<{ i: number; id: string }> = [];\n  for (const [field, value] of new URLSearchParams(requestBody)) {\n    const match = /^listOfAccounts\\[(\\d+)\\]\\.EncAccountID$/.exec(field);\n    if (match) indexed.push({ i: Number(match[1]), id: value });\n  }\n  return indexed.sort((a, b) => a.i - b.i).map((entry) => entry.id);\n}\n\nexport interface Hydration {\n  /** The hydrated row for each stub, keyed by the stub's encrypted handle. */\n  rows: Map<string, Record<string, unknown>>;\n  /** Handles whose own request succeeded and came back with no row. */\n  empty: Set<string>;\n}\n\n/**\n * The hydrated rows from every `GetMoreVisits` answer, keyed by the encrypted\n * handle of the stub each one answers — and the handles MyChart answered\n * with nothing at all.\n *\n * The answer carries nothing to join on — a stub's `HospitalAccountId` is an\n * encrypted handle (`WP-24…`), its hydrated row's is the plain account number\n * (`4820015507`), and no field on the hydrated row carries the handle back.\n * So the handle a row answers is read off the request it came back to: the\n * recorded `requestBody`. The scraper posts one stub per request, which makes\n * that pairing exact — one handle in, one row out.\n *\n * The pairing puts real money on a row, so it is checked rather than\n * trusted: {@link hydratedFor} drops a pair whose `StartDate` disagrees.\n *\n * An answer that succeeded and carried no populated row is MyChart declining\n * that stub, not a failure: one live instance answered the same two of 15\n * stubs with `Success: true` and an empty list on every attempt, alone or\n * batched, and Epic's own \"load all\" returned them as dateless placeholders.\n * One handle per request is what lets that answer name its stub.\n */\nfunction hydratedRows(raw: RawResponse): Hydration {\n  const hydration: Hydration = { rows: new Map(), empty: new Set() };\n  for (const record of findRequests(raw, 'GetMoreVisits')) {\n    if (!answered(record)) continue;\n    const posted = postedHydrateKeys(record.requestBody);\n    const body = rec(record.body);\n    const rows = list(rec(body.Data).UnifiedVisitList);\n    if (body.Success === true && !rows.some((row) => !isStubRow(row))) {\n      for (const handle of posted) hydration.empty.add(handle);\n      continue;\n    }\n    rows.forEach((row, i) => {\n      const handle = posted[i];\n      const r = rec(row);\n      if (!handle || isStubRow(r)) return;\n      hydration.rows.set(handle, r);\n    });\n  }\n  return hydration;\n}\n\n/**\n * The hydrated row answering one stub, or null when it does not agree with\n * the stub on the service date. The date is the one field a stub already has\n * right, so a row that came back to the wrong request fails to match instead\n * of quietly attaching one visit's charges to another.\n */\nfunction hydratedFor(\n  stub: Record<string, unknown>,\n  hydrated: Map<string, Record<string, unknown>>,\n): Record<string, unknown> | null {\n  const row = hydrated.get(text(stub.HospitalAccountId));\n  if (!row) return null;\n  return num(row.StartDate) === num(stub.StartDate) ? row : null;\n}\n\nfunction payment(value: unknown): BillingPaymentStandard {\n  const p = rec(value);\n  const receipt = p.Receipt === null || p.Receipt === undefined ? null : rec(p.Receipt);\n  return {\n    FormattedDateDisplay: textOrNull(p.FormattedDateDisplay),\n    Description: textOrNull(p.Description),\n    SubText: textOrNull(p.SubText),\n    PaymentAmountDisplay: textOrNull(p.PaymentAmountDisplay),\n    UndistributedAmountDisplay: textOrNull(p.UndistributedAmountDisplay),\n    Receipt: receipt === null ? null : { DisplayNumber: textOrNull(receipt.DisplayNumber), SerialNumber: textOrNull(receipt.SerialNumber) },\n  };\n}\n\nfunction procedure(value: unknown): BillingProcedureStandard {\n  const p = rec(value);\n  const description = textOrNull(p.Description);\n  return {\n    DescriptionText: description === null ? null : htmlToText(description),\n    Amount: textOrNull(p.Amount),\n    SelfAmountDue: textOrNull(p.SelfAmountDue),\n    InsuranceAmountDue: textOrNull(p.InsuranceAmountDue),\n    IsContested: boolOrNull(p.IsContested),\n    HasAmountDue: boolOrNull(p.HasAmountDue),\n    PaymentList: list(p.PaymentList).map(payment),\n    SelfBadDebtAmount: textOrNull(p.SelfBadDebtAmount),\n    HasBadDebtAmount: boolOrNull(p.HasBadDebtAmount),\n    AdjustmentsOnly: boolOrNull(p.AdjustmentsOnly),\n    BillingSystem: num(p.BillingSystem),\n  };\n}\n\nfunction procedureGroup(value: unknown): BillingProcedureGroupStandard {\n  const g = rec(value);\n  return {\n    Description: textOrNull(g.Description),\n    Amount: textOrNull(g.Amount),\n    ProcedureList: list(g.ProcedureList).map(procedure),\n    PaymentList: list(g.PaymentList).map(payment),\n    EstPlanPaymentList: list(g.EstPlanPaymentList).map(payment),\n  };\n}\n\nfunction coverageInfo(value: unknown): BillingCoverageInfoStandard {\n  const c = rec(value);\n  return {\n    CoverageName: textOrNull(c.CoverageName),\n    Billed: textOrNull(c.Billed),\n    Covered: textOrNull(c.Covered),\n    PendingInsurance: textOrNull(c.PendingInsurance),\n    RemainingResponsibility: textOrNull(c.RemainingResponsibility),\n    Copay: textOrNull(c.Copay),\n    Deductible: textOrNull(c.Deductible),\n    Coinsurance: textOrNull(c.Coinsurance),\n    NotCovered: textOrNull(c.NotCovered),\n    Benefits: list(c.Benefits).map((b) => ({ Name: textOrNull(rec(b).Name), Amount: textOrNull(rec(b).Amount) })),\n  };\n}\n\nfunction visit(value: unknown, category: BillingVisitCategory): BillingVisitStandard {\n  const v = rec(value);\n  const estimate = v.EstimateInfo === null || v.EstimateInfo === undefined ? null : rec(v.EstimateInfo);\n  const agency = rec(v.AgencyInformation);\n  return {\n    category,\n    StartDateDisplay: textOrNull(v.StartDateDisplay),\n    DateRangeDisplay: textOrNull(v.DateRangeDisplay),\n    Description: textOrNull(v.Description),\n    Patient: textOrNull(v.Patient),\n    Provider: textOrNull(v.Provider),\n    HospitalAccountDisplay: textOrNull(v.HospitalAccountDisplay),\n    HospitalAccountId: textOrNull(v.HospitalAccountId),\n    PrimaryPayer: textOrNull(v.PrimaryPayer),\n    ChargeAmount: textOrNull(v.ChargeAmount),\n    InsurancePaymentAmount: textOrNull(v.InsurancePaymentAmount),\n    InsuranceAmountDue: textOrNull(v.InsuranceAmountDue),\n    InsuranceEstimatedPaymentAmount: textOrNull(v.InsuranceEstimatedPaymentAmount),\n    InsuranceAmountDueRaw: num(v.InsuranceAmountDueRaw),\n    SelfPaymentAmount: textOrNull(v.SelfPaymentAmount),\n    SelfAmountDue: textOrNull(v.SelfAmountDue),\n    SelfAmountDueRaw: num(v.SelfAmountDueRaw),\n    SelfAdjustmentAmount: textOrNull(v.SelfAdjustmentAmount),\n    SelfDiscountAmount: textOrNull(v.SelfDiscountAmount),\n    SelfBadDebtAmount: textOrNull(v.SelfBadDebtAmount),\n    SelfBadDebtAmountRaw: num(v.SelfBadDebtAmountRaw),\n    SelfPaymentPlanAmountDue: textOrNull(v.SelfPaymentPlanAmountDue),\n    SelfPaymentPlanAmountDueRaw: num(v.SelfPaymentPlanAmountDueRaw),\n    NotOnPlanAmount: textOrNull(v.NotOnPlanAmount),\n    NotOnPlanAmountRaw: num(v.NotOnPlanAmountRaw),\n    ContestedChargeAmount: textOrNull(v.ContestedChargeAmount),\n    ContestedPaymentAmount: textOrNull(v.ContestedPaymentAmount),\n    SurchargeAmount: textOrNull(v.SurchargeAmount),\n    TaxOrSurcharge: num(v.TaxOrSurcharge),\n    IsPatientNotResponsible: boolOrNull(v.IsPatientNotResponsible),\n    PatientNotResponsibleYet: boolOrNull(v.PatientNotResponsibleYet),\n    IsOnPaymentPlan: boolOrNull(v.IsOnPaymentPlan),\n    IsNotOnPaymentPlan: boolOrNull(v.IsNotOnPaymentPlan),\n    IsBadDebtHAR: boolOrNull(v.IsBadDebtHAR),\n    IsBadDebtVisit: boolOrNull(v.IsBadDebtVisit),\n    IsContestedHAR: boolOrNull(v.IsContestedHAR),\n    IsClosedHospitalAccount: boolOrNull(v.IsClosedHospitalAccount),\n    AdjustmentsOnly: boolOrNull(v.AdjustmentsOnly),\n    PatFriendlyAccountStatusAccessibleText: textOrNull(v.PatFriendlyAccountStatusAccessibleText),\n    EstimateInfo: estimate === null ? null : { EstimateAmount: textOrNull(estimate.EstimateAmount), EstimateStatus: num(estimate.EstimateStatus) },\n    AgencyInformation: { Name: textOrNull(agency.Name), PhoneNumber: textOrNull(agency.PhoneNumber) },\n    AgencyInformationDescription: textOrNull(v.AgencyInformationDescription),\n    ProcedureList: list(v.ProcedureList).map(procedure),\n    ProcedureGroupList: list(v.ProcedureGroupList).map(procedureGroup),\n    CoverageInfoList: list(v.CoverageInfoList).map(coverageInfo),\n  };\n}\n\nfunction unloadedVisit(stub: Record<string, unknown>, category: BillingVisitCategory, hydration: Hydration): BillingUnloadedVisitStandard {\n  return {\n    category,\n    StartDate: num(stub.StartDate),\n    StartDateDisplay: textOrNull(stub.StartDateDisplay),\n    BillingSystemDisplay: textOrNull(stub.BillingSystemDisplay),\n    reason: hydration.empty.has(text(stub.HospitalAccountId)) || hydration.empty.has(text(stub.EmptyVisitEstimateID))\n      ? 'returned_empty'\n      : 'not_loaded',\n  };\n}\n\n/**\n * The nine `GetVisits` lists as one, most specific category first,\n * de-duplicated — with every stub replaced by the row `GetMoreVisits`\n * returned for it.\n *\n * The swap happens before de-duplication because a stub and its hydrated self\n * do not look alike: the identity includes `Description` and\n * `SelfAmountDueRaw`, which are exactly the fields hydration fills in.\n *\n * A stub that did not load goes to `unloadedVisits`, never `visits`: its\n * every amount is a fabricated `\"$0.00\"` that reads exactly like a settled\n * visit, so a caller summing `visits` must not see it. The rows that did load\n * are still returned — one visit MyChart will not serve is no reason to lose\n * the rest of the account.\n */\nexport function mergeVisitLists(\n  data: Record<string, unknown>,\n  hydration: Hydration = { rows: new Map(), empty: new Set() },\n): { visits: BillingVisitStandard[]; unloadedVisits: BillingUnloadedVisitStandard[] } {\n  const seen = new Set<string>();\n  const visits: BillingVisitStandard[] = [];\n  const unloadedVisits: BillingUnloadedVisitStandard[] = [];\n  for (const category of VISIT_LIST_CATEGORIES) {\n    for (const row of list(data[category])) {\n      let r = rec(row);\n      if (isStubRow(r)) r = hydratedFor(r, hydration.rows) ?? r;\n      const identity = `${text(r.HospitalAccountId)}|${num(r.StartDate) ?? ''}|${text(r.Description)}|${num(r.SelfAmountDueRaw) ?? ''}`;\n      if (seen.has(identity)) continue;\n      seen.add(identity);\n      if (isStubRow(r)) unloadedVisits.push(unloadedVisit(r, category, hydration));\n      else visits.push(visit(r, category));\n    }\n  }\n  return { visits, unloadedVisits };\n}\n\n/** The sentence `notice` carries, or null when every account loaded every row. */\nfunction unloadedNotice(accounts: BillingAccountStandard[]): string | null {\n  const parts = accounts\n    .filter((a) => a.unloadedVisits.length > 0)\n    .map((a) => {\n      const dates = a.unloadedVisits.map((v) => v.StartDateDisplay ?? 'unknown date').join(', ');\n      return `${a.unloadedVisits.length} of ${a.visits.length + a.unloadedVisits.length} charge rows on guarantor account ${a.guarantorNumber} (service dates ${dates})`;\n    });\n  if (parts.length === 0) return null;\n  const declined = accounts.some((a) => a.unloadedVisits.some((v) => v.reason === 'returned_empty'));\n  const failed = accounts.some((a) => a.unloadedVisits.some((v) => v.reason === 'not_loaded'));\n  return (\n    `MyChart did not load ${parts.join('; ')}. They are listed under unloadedVisits and left out of visits, ` +\n    'so the visit list is incomplete — their charges are unknown, not $0.00. The account balances come from ' +\n    'the billing summary and are not affected.' +\n    (declined ? \" For rows marked returned_empty, MyChart answered with no detail; its own billing page can't show them either.\" : '') +\n    (failed ? ' Rows marked not_loaded failed to load and may load on a retry.' : '')\n  );\n}\n\n/** `20251130` → `2025-11-30`; null for anything else. */\nexport function statementDateISO(dateDisplay: unknown): string | null {\n  const match = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(text(dateDisplay));\n  return match ? `${match[1]}-${match[2]}-${match[3]}` : null;\n}\n\nexport function statement(value: unknown): BillingStatementStandard {\n  const s = rec<Statement>(value);\n  return {\n    dateISO: statementDateISO(s.DateDisplay),\n    // No live capture has this field; only the hand-written fixture does.\n    FormattedDateDisplay: textOrNull(rec(value).FormattedDateDisplay),\n    DateDisplay: textOrNull(s.DateDisplay),\n    Description: textOrNull(s.Description),\n    SubText: textOrNull(s.SubText),\n    StatementAmountDisplay: textOrNull(s.StatementAmountDisplay),\n    IsRead: boolOrNull(s.IsRead),\n    IsDetailBill: boolOrNull(s.IsDetailBill),\n    IsPaperless: boolOrNull(s.IsPaperless),\n    ServiceDateStart: scalarOrNull(s.ServiceDateStart),\n    ServiceDateEnd: scalarOrNull(s.ServiceDateEnd),\n    RecordID: textOrNull(s.RecordID),\n  };\n}\n\nfunction queryParams(path: string): URLSearchParams {\n  const q = path.indexOf('?');\n  return new URLSearchParams(q < 0 ? '' : path.slice(q + 1));\n}\n\n/** The recorded request for `fragment` whose `id`/`context` query params name this account. */\nfunction accountRequest(raw: RawResponse, source: BillingAccount, fragment: string): RawRequestRecord | undefined {\n  return findRequests(raw, fragment).find((r) => {\n    const params = queryParams(r.path);\n    const id = params.get('id') ?? params.get('ID');\n    const context = params.get('context') ?? params.get('Context');\n    return id === source.id && context === source.context;\n  });\n}\n\nfunction account(raw: RawResponse, source: BillingAccount, hydration: Hydration): BillingAccountStandard {\n  const data = rec(rec<BillingGetVisits>(accountRequest(raw, source, 'GetVisits')?.body).Data);\n  const { visits, unloadedVisits } = mergeVisitLists(data, hydration);\n  const alert = rec(data.PartialPaymentPlanAlert);\n  const banner = rec(alert.Banner);\n  const agency = rec(data.SharedAgencyInformation);\n  const unavailable: string[] = [];\n  function tolerated(fragment: string): unknown {\n    const record = accountRequest(raw, source, fragment);\n    if (!answered(record)) {\n      unavailable.push(fragment);\n      return {};\n    }\n    return record.body;\n  }\n  const statementsBody = rec<GetStatementList>(tolerated('GetStatementList'));\n  const paymentsBody = rec<LoadPaymentList>(tolerated('LoadPaymentList'));\n  return {\n    guarantorNumber: source.guarantorNumber,\n    patientName: source.patientName,\n    amountDueNumber: source.amountDue ?? null,\n    paymentUrl: paymentPathFor(raw, source),\n    visits,\n    unloadedVisits,\n    VisitListAmount: textOrNull(data.VisitListAmount),\n    BadDebtVisitListAmount: textOrNull(data.BadDebtVisitListAmount),\n    PaymentPlanVisitListAmount: textOrNull(data.PaymentPlanVisitListAmount),\n    NotPaymentPlanVisitListAmount: textOrNull(data.NotPaymentPlanVisitListAmount),\n    AdvanceBillVisitListAmount: textOrNull(data.AdvanceBillVisitListAmount),\n    AdjustmentVisitListAmount: textOrNull(data.AdjustmentVisitListAmount),\n    VisitAutoPayVisitListAmount: textOrNull(data.VisitAutoPayVisitListAmount),\n    ContestedVisitListAmount: textOrNull(data.ContestedVisitListAmount),\n    PaymentPlanVisitListAutoPayAmount: textOrNull(data.PaymentPlanVisitListAutoPayAmount),\n    PaymentPlanVisitListScheduledDate: scalarOrNull(data.PaymentPlanVisitListScheduledDate),\n    EstimatedPaymentPlanBalance: scalarOrNull(data.EstimatedPaymentPlanBalance),\n    PaymentPlanVisitListPostResolutionAmount: textOrNull(data.PaymentPlanVisitListPostResolutionAmount),\n    CanMakePayment: boolOrNull(data.CanMakePayment),\n    URLMakePayment: textOrNull(data.URLMakePayment),\n    HasUnconvertedPBVisits: boolOrNull(data.HasUnconvertedPBVisits),\n    HasVisits: boolOrNull(data.HasVisits),\n    PartialPaymentPlanAlert: {\n      Code: num(alert.Code),\n      Banner: { HeaderText: textOrNull(banner.HeaderText), DetailText: textOrNull(banner.DetailText) },\n    },\n    UndistributedPayments: list(data.UndistributedPayments),\n    SharedAgencyInformation: { Name: textOrNull(agency.Name), PhoneNumber: textOrNull(agency.PhoneNumber) },\n    statements: [\n      ...list(rec<DataStatement>(statementsBody.DataStatement).StatementList),\n      ...list(rec<DataStatement>(statementsBody.DataDetailBill).StatementList),\n    ].map(statement),\n    payments: list(rec(paymentsBody.Data).PaymentList).map(payment),\n    unavailable,\n  };\n}\n\n/** The summary page's pay-online path, when it names this account's id. */\nfunction paymentPathFor(raw: RawResponse, source: BillingAccount): string | null {\n  const summary = text(findRequest(raw, '/Billing/Summary')?.body);\n  const path = parsePaymentPath(summary);\n  if (!path) return null;\n  const id = new URLSearchParams(path.split('?')[1] ?? '').get('ID');\n  return id === null || id === source.id ? path : null;\n}\n\nexport const billingProcessor: Processor<BillingStandard> = {\n  standard(raw: RawResponse): BillingStandard {\n    const summary = text(findRequest(raw, '/Billing/Summary')?.body);\n    const hydration = hydratedRows(raw);\n    const accounts = parseBillingAccountsHtml(summary).map((source) => account(raw, source, hydration));\n    const cents = accounts.reduce((sum, a) => sum + Math.round((a.amountDueNumber ?? 0) * 100), 0);\n    return { totalDue: cents / 100, notice: unloadedNotice(accounts), accounts };\n  },\n  concise(standard) {\n    return {\n      totalDue: standard.totalDue,\n      notice: standard.notice,\n      accounts: standard.accounts.map((a) => ({\n        guarantorNumber: a.guarantorNumber,\n        patientName: a.patientName,\n        amountDueNumber: a.amountDueNumber,\n        visits: a.visits.map((v) => ({\n          StartDateDisplay: v.StartDateDisplay,\n          DateRangeDisplay: v.DateRangeDisplay,\n          Description: v.Description,\n          Patient: v.Patient,\n          Provider: v.Provider,\n          PrimaryPayer: v.PrimaryPayer,\n          ChargeAmount: v.ChargeAmount,\n          InsurancePaymentAmount: v.InsurancePaymentAmount,\n          InsuranceAmountDue: v.InsuranceAmountDue,\n          SelfPaymentAmount: v.SelfPaymentAmount,\n          SelfAmountDue: v.SelfAmountDue,\n          category: v.category,\n        })),\n        statements: a.statements.map((s) => ({\n          dateISO: s.dateISO,\n          FormattedDateDisplay: s.FormattedDateDisplay,\n          Description: s.Description,\n          StatementAmountDisplay: s.StatementAmountDisplay,\n          IsRead: s.IsRead,\n          RecordID: s.RecordID,\n        })),\n        payments: a.payments.map((p) => ({\n          FormattedDateDisplay: p.FormattedDateDisplay,\n          Description: p.Description,\n          PaymentAmountDisplay: p.PaymentAmountDisplay,\n        })),\n        unloadedVisits: a.unloadedVisits.map((v) => ({ StartDateDisplay: v.StartDateDisplay, reason: v.reason })),\n        unavailable: a.unavailable,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest, SessionExpiredError } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { getRequestVerificationTokenFromBody } from '../../core/util';\nimport { list, rec, text } from '../../processors/read';\nimport { subYears, addYears } from 'date-fns';\nimport type { BillingAccount, PaymentListResponse, StatementItem, StatementListResponse } from './types';\nimport type { BillingGetVisits } from './mychart.types';\nimport { logger } from '../../../../shared/logger';\nimport { toEpicDteLocal } from '../../../../shared/epicDate';\nimport type { FilePayload } from '../../core/filePayload';\nimport { safeFileName } from '../../core/safeFileName';\nimport { parseBillingAccountsHtml } from './summaryHtml';\nimport { VISIT_LIST_CATEGORIES, billingProcessor, isStubRow, statementDateISO, type BillingStandard } from './bills.processor';\nimport { DetailedError } from '../../../../shared/detailedError';\n\nexport { parsePaymentUrl, parseBillingAccountsHtml, parseAmount } from './summaryHtml';\nexport type {\n  BillingStandard,\n  BillingAccountStandard,\n  BillingVisitStandard,\n  BillingUnloadedVisitStandard,\n  BillingUnloadedReason,\n  BillingVisitCategory,\n  BillingStatementStandard,\n  BillingPaymentStandard,\n  BillingProcedureStandard,\n  BillingProcedureGroupStandard,\n  BillingCoverageInfoStandard,\n} from './bills.processor';\nexport { billingProcessor, mergeVisitLists, VISIT_LIST_CATEGORIES } from './bills.processor';\n\n// Two jobs live here: the `get_billing` read (fetchBillingRaw + the\n// processor) and the `download_billing_statement` file download, which\n// re-walks the summary and statement lists to find the one statement asked for.\n\nfunction accountQuery(account: BillingAccount): string {\n  return `id=${account.id}&context=${account.context}`;\n}\n\n/** A window wide enough to cover a lifetime of visits; the search is bounded by explicit dates. */\nfunction visitsPath(account: BillingAccount): string {\n  const date100YearsAgo = subYears(new Date(), 100);\n  const date1YearFromNow = addYears(new Date(), 1);\n  return `/Billing/Details/GetVisits?noCache=${Math.random()}&${accountQuery(account)}&filterOption=1&searchStartDTE=${toEpicDteLocal(date100YearsAgo)}&searchStopDTE=${toEpicDteLocal(date1YearFromNow)}&cid=`;\n}\n\nfunction paymentListPath(account: BillingAccount): string {\n  return `/Billing/Details/LoadPaymentList?noCache=${Math.random()}&${accountQuery(account)}&searchStartDTE=&searchEndDTE=&cid=`;\n}\n\nfunction statementListPath(account: BillingAccount): string {\n  return `/Billing/Details/GetStatementList?noCache=${Math.random()}&${accountQuery(account)}&cid=`;\n}\n\nfunction detailsPagePath(account: BillingAccount): string {\n  return `/Billing/Details?ID=${account.id}&Context=${account.context}`;\n}\n\nconst GET_MORE_VISITS_PATH = '/Billing/Details/GetMoreVisits';\n\n/**\n * The hydrate key for one stub, in the three shapes Epic's own client builds\n * (`AccountDetailsController.__processSingleListResponse`): a hospital\n * account, a hospital account billed under a specific provider, or a\n * standalone estimate.\n */\ntype HydrateKey = { EncAccountID: string } & Record<string, string>;\n\nfunction hydrateKey(row: Record<string, unknown>): HydrateKey | null {\n  const har = text(row.HospitalAccountId);\n  const estimate = text(row.EmptyVisitEstimateID);\n  if (!har && estimate) return { EncAccountID: estimate, IsPes: 'true', IsHar: 'false' };\n  if (!har) return null;\n  const provider = text(row.ProviderId);\n  return provider\n    ? { EncAccountID: har, IsPes: 'false', IsHar: 'true', EncPBSerID: provider }\n    : { EncAccountID: har, IsPes: 'false', IsHar: 'true' };\n}\n\n/**\n * `listOfAccounts` as ASP.NET model binding wants it —\n * `listOfAccounts[0].EncAccountID=…&listOfAccounts[0].IsHar=true&…` — which\n * is the encoding captured off the real request, not an inference.\n */\nfunction moreVisitsBody(account: BillingAccount, keys: HydrateKey[]): string {\n  const params = new URLSearchParams({ id: account.id ?? '', context: account.context ?? '' });\n  keys.forEach((key, i) => {\n    for (const [field, value] of Object.entries(key)) params.append(`listOfAccounts[${i}].${field}`, value);\n  });\n  return params.toString();\n}\n\n/**\n * Hydrate every stub in a `GetVisits` body — one `GetMoreVisits` POST per\n * stub, fanned out under the per-host limiter.\n *\n * Epic's own client batches these, and a batch is where the trouble is: the\n * answer carries nothing to join on (a stub's `HospitalAccountId` is an\n * encrypted handle, the hydrated row's is the plain account number, and no\n * field on the hydrated row carries the handle back), so a batched answer can\n * only be paired with its request by position. One stub per request makes\n * the correspondence a fact instead of an assumption: the single row that\n * comes back is the answer to the single handle that was posted, and a\n * request that fails names exactly the visit it failed for.\n *\n * Best-effort here, but not silently: a stub still unloaded once the answers\n * are merged goes to `unloadedVisits` with a `notice`, never to `visits`,\n * because a stub's fabricated `\"$0.00\"` is indistinguishable from a settled\n * visit. A request that fails, or answers without `Success: true`, is tried\n * once more first, so `not_loaded` means it failed twice. An empty success is\n * not retried: on the one instance that sends it, it was the same answer\n * every time.\n */\nasync function hydrateStubs(\n  collector: RawCollector,\n  account: BillingAccount,\n  visitsBody: unknown,\n  token: string | undefined,\n): Promise<void> {\n  const data = rec(rec<BillingGetVisits>(visitsBody).Data);\n  const byHandle = new Map<string, HydrateKey>();\n  for (const category of VISIT_LIST_CATEGORIES) {\n    for (const row of list(data[category])) {\n      if (!isStubRow(row)) continue;\n      const key = hydrateKey(rec(row));\n      if (key) byHandle.set(key.EncAccountID, key);\n    }\n  }\n  if (byHandle.size === 0) return;\n  if (!token) {\n    logger.debug(`Billing: ${byHandle.size} unhydrated charge rows but no antiforgery token; leaving them.`);\n    return;\n  }\n\n  await Promise.all(\n    [...byHandle.values()].map(async (key) => {\n      for (let attempt = 1; attempt <= 2; attempt++) {\n        const { failure, body } = await collector.send(\n          {\n            path: `${GET_MORE_VISITS_PATH}?noCache=${Math.random()}`,\n            method: 'POST',\n            headers: {\n              'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n              'X-Requested-With': 'XMLHttpRequest',\n              __RequestVerificationToken: token,\n            },\n            body: moreVisitsBody(account, [key]),\n          },\n          { tolerateFailure: true },\n        );\n        if (!failure && rec(body).Success === true) return;\n        logger.debug(`Billing: GetMoreVisits attempt ${attempt} failed for ${account.guarantorNumber}: ${failure?.message ?? 'Success was not true'}`);\n      }\n    }),\n  );\n}\n\n/**\n * `GET /Billing/Summary`, then per account the details page, `GetVisits`,\n * one `GetMoreVisits` per lazy-loaded row, `GetStatementList` and\n * `LoadPaymentList`.\n *\n * The details page is fetched *first* because it carries both the `EncID` the\n * statement download needs and the antiforgery token `GetMoreVisits` requires.\n * The summary is parsed here only to learn which accounts to fetch; the\n * processor re-parses the recorded page to build the account rows.\n *\n * The supplementary calls are best-effort — a statement-list outage should\n * not cost the caller the charge history — and a non-OK response is still\n * recorded. The summary and the visit list are the payload: a failure there\n * throws.\n */\nexport async function fetchBillingRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const summary = await collector.send({ path: '/Billing/Summary' });\n\n  for (const account of parseBillingAccountsHtml(summary.text, mychartRequest.hostname)) {\n    let token: string | undefined;\n    try {\n      const details = await collector.send({ path: detailsPagePath(account) }, { tolerateFailure: true });\n      token = getRequestVerificationTokenFromBody(details.text);\n    } catch (err) {\n      if (err instanceof SessionExpiredError) throw err;\n      logger.debug('Failed to fetch billing details page:', (err as Error).message);\n    }\n\n    const visits = await collector.send({ path: visitsPath(account) });\n    try {\n      await hydrateStubs(collector, account, visits.body, token);\n    } catch (err) {\n      if (err instanceof SessionExpiredError) throw err;\n      logger.debug('Failed to hydrate billing charge rows:', (err as Error).message);\n    }\n\n    for (const path of [statementListPath(account), paymentListPath(account)]) {\n      try {\n        await collector.send({ path }, { tolerateFailure: true });\n      } catch (err) {\n        if (err instanceof SessionExpiredError) throw err;\n        logger.debug('Failed to fetch billing details:', (err as Error).message);\n      }\n    }\n  }\n\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getBillingHistory(mychartRequest: MyChartRequest): Promise<BillingStandard> {\n  return billingProcessor.standard(await fetchBillingRaw(mychartRequest));\n}\n\nexport async function getPaymentList(mychartRequest: MyChartRequest, billingAccount: BillingAccount): Promise<PaymentListResponse> {\n  const paymentListResponse = await makeAuthenticatedRequest(mychartRequest, { path: paymentListPath(billingAccount) });\n  return await paymentListResponse.json() as PaymentListResponse;\n}\n\nexport async function getStatementList(mychartRequest: MyChartRequest, billingAccount: BillingAccount): Promise<StatementListResponse> {\n  const statementsResponse = await makeAuthenticatedRequest(mychartRequest, { path: statementListPath(billingAccount) });\n  return await statementsResponse.json() as StatementListResponse;\n}\n\nexport async function getEncBillingId(mychartRequest: MyChartRequest, billingAccount: BillingAccount) {\n  const res = await makeAuthenticatedRequest(mychartRequest, { path: detailsPagePath(billingAccount) });\n  const body = await res.text();\n  const match = /EncID\"\\s*:\\s*\"([^\"]*)\"/.exec(body);\n  if (!match) {\n    logger.debug('unable to find end id');\n  }\n  return match?.[1];\n}\n\nexport async function saveStatementPdf(mychartRequest: MyChartRequest, encId: string, statement: StatementItem) {\n  const path = `/Billing/Details/DownloadFromBlob/?type=1&id=${statement.RecordID}&earId=${encId}&billSys=${statement.EncBillingSystem}&fileKey=${statement.ImagePath}&token=${encodeURIComponent(statement.Token)}&fileName=Statement_${statement.DateDisplay}&DocExt=PDF&PesId=&cid=`;\n\n  const statementPdf = await makeAuthenticatedRequest(mychartRequest, { path: path });\n  const pdfArrayBuffer = await statementPdf.arrayBuffer();\n\n  // Convert ArrayBuffer to a Node.js Buffer\n  return Buffer.from(pdfArrayBuffer);\n}\n\n/** What `download_billing_statement` returns: the PDF plus the statement it is. */\nexport interface BillingStatementPdf extends FilePayload {\n  statement: {\n    RecordID: string;\n    dateISO: string | null;\n    FormattedDateDisplay: string | null;\n    Description: string | null;\n    StatementAmountDisplay: string | null;\n    IsDetailBill: boolean | null;\n  };\n}\n\n/**\n * Find the statement whose `RecordID` a caller copied out of `get_billing`,\n * and which guarantor account it belongs to. Both lists are searched, because\n * the itemized bills (`DataDetailBill`) download the same way as statements.\n */\nasync function findStatement(\n  mychartRequest: MyChartRequest,\n  recordId: string,\n): Promise<{ account: BillingAccount; statement: StatementItem }> {\n  const summary = await makeAuthenticatedRequest(mychartRequest, { path: '/Billing/Summary' });\n  const accounts = parseBillingAccountsHtml(await summary.text(), mychartRequest.hostname);\n  const seen: string[] = [];\n  const seenByAccount: string[] = [];\n  for (const account of accounts) {\n    const statementList = await getStatementList(mychartRequest, account);\n    const statements = [\n      ...(statementList.DataStatement?.StatementList ?? []),\n      ...(statementList.DataDetailBill?.StatementList ?? []),\n    ];\n    const statement = statements.find((s) => s.RecordID === recordId);\n    if (statement) return { account, statement };\n    const ids = statements.map((s) => s.RecordID).filter(Boolean);\n    seen.push(...ids);\n    if (ids.length) seenByAccount.push(`account ${account.guarantorNumber}: ${ids.join(', ')}`);\n  }\n  const lead = `No billing statement has RecordID \"${recordId}\". get_billing lists each statement's RecordID; `;\n  if (!seen.length) throw new Error(lead + 'this login has no statements on any account.');\n  throw new DetailedError(\n    lead + `the RecordIDs on this login are ${seen.join(', ')}.`,\n    lead + `the statements on this login are — ${seenByAccount.join('; ')}.`,\n  );\n}\n\n/**\n * One statement or itemized bill as the PDF MyChart serves for it.\n *\n * The bytes are checked for the `%PDF` signature rather than trusted: a\n * stale token or a bad `EncID` comes back from `DownloadFromBlob` as an HTML\n * error page with status 200, and handing that to a caller as a `.pdf` is the\n * silent failure this exists to prevent.\n */\nexport async function downloadBillingStatement(\n  mychartRequest: MyChartRequest,\n  recordId: string,\n): Promise<BillingStatementPdf> {\n  const { account, statement } = await findStatement(mychartRequest, recordId);\n  const encId = await getEncBillingId(mychartRequest, account);\n  if (!encId) {\n    throw new DetailedError(\n      \"MyChart's billing details page for this statement's account carried no EncID, which the statement download needs.\",\n      `MyChart's billing details page for account ${account.guarantorNumber} carried no EncID, which the statement download needs.`,\n    );\n  }\n  const bytes = await saveStatementPdf(mychartRequest, encId, statement);\n  if (bytes.subarray(0, 4).toString() !== '%PDF') {\n    throw new DetailedError(\n      `MyChart did not return a PDF for statement ${recordId} (${bytes.length} bytes).`,\n      `MyChart did not return a PDF for statement ${recordId} (${bytes.length} bytes, starting \"${bytes.subarray(0, 40).toString().replace(/\\s+/g, ' ')}\").`,\n    );\n  }\n  return {\n    fileName: safeFileName(`Statement_${statement.DateDisplay || recordId}.pdf`, 'statement.pdf'),\n    mimeType: 'application/pdf',\n    bytes,\n    statement: {\n      RecordID: statement.RecordID,\n      dateISO: statementDateISO(statement.DateDisplay),\n      FormattedDateDisplay: statement.FormattedDateDisplay ?? null,\n      Description: statement.Description ?? null,\n      StatementAmountDisplay: statement.StatementAmountDisplay ?? null,\n      IsDetailBill: statement.IsDetailBill ?? null,\n    },\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Insurance processor. Field decisions: docs/processor-layer-proposal.md, `get_insurance`.\n *\n * `GET /Insurance` carries no coverage at all. The page is a shell — its whole\n * body is `<div id=\"coverages-list\"></div>` — and `$$WP.Insurance.CoveragesController`\n * in `bundles/insurance-controllers` fills it from:\n *\n *   POST /Insurance/Coverages/GetCoverages   → { ActiveCoverages: [...], … }\n *\n * form-encoded, with the antiforgery token off the `/Insurance` page. The\n * scraper that read the page's markup could therefore only ever return an\n * empty list from a real instance, whatever the patient's coverage was; the\n * selectors it used (`.coverage-card`, `.plan-name`, `.member-id`) exist\n * nowhere in Epic's markup and were written against the fake.\n *\n * Captured on four live instances (three November 2025, one August 2025). The\n * coverage element's field set was identical on all four, and one of the four\n * genuinely has no coverage on file — which is how the difference between \"no\n * coverage\" and \"we could not read the page\" is now an observed distinction\n * rather than a guess about a sentence in some HTML.\n *\n * MyChart returns coverages in five buckets by where they are in the\n * submission workflow. They are kept apart rather than concatenated: a\n * coverage waiting to be verified by the organization is not one a clinic can\n * bill today, and flattening them is how a pending card reads as active.\n *\n * Each coverage passes through whole with `bucket` added. The interface names\n * the keys the captures showed, but nothing is dropped for being empty on\n * them: four accounts that never uploaded an insurance card say nothing about\n * whether `FrontDocument` is ever populated, and `standard` is not the place to\n * decide a caller does not need the card image, the FHIR id or a date of birth.\n */\n\nimport { findRequest, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, num, rec, textOrNull } from '../../processors/read';\nimport type { ActiveCoverage, InsuranceGetCoverages } from './mychart.types';\nimport type { CoverageBucket, InsuranceCoverageStandard, InsuranceStandard } from './standardized.types';\n\nexport type { CoverageBucket, InsuranceCoverageStandard, InsuranceStandard } from './standardized.types';\n\nexport const GET_COVERAGES_PATH = '/Insurance/Coverages/GetCoverages';\n\n/** The five buckets `GetCoverages` splits its coverages into, in MyChart's own order. */\nexport const COVERAGE_BUCKETS: readonly CoverageBucket[] = [\n  'ActiveCoverages',\n  'CoveragesPendingSubmission',\n  'CoveragesPendingDeletion',\n  'CoveragesInReview',\n  'CoveragesInVerification',\n] as const;\n\n/**\n * The element whole, with `bucket` added — the same pass-through the goals\n * processor uses. The named reads below only normalize the documented keys to\n * `null` when MyChart sent a non-string/number/boolean; every other key MyChart\n * sent survives verbatim, because \"empty on four accounts\" is not a reason to\n * drop a field (CLAUDE.md) and a card image the caller cannot reach is a field\n * dropped.\n */\nfunction coverage(value: unknown, bucket: CoverageBucket): InsuranceCoverageStandard {\n  const c = rec<ActiveCoverage>(value);\n  return {\n    ...c,\n    CoverageId: textOrNull(c.CoverageId),\n    CoverageName: textOrNull(c.CoverageName),\n    PayorId: textOrNull(c.PayorId),\n    PayorName: textOrNull(c.PayorName),\n    PlanName: textOrNull(c.PlanName),\n    SubscriberId: textOrNull(c.SubscriberId),\n    SubscriberName: textOrNull(c.SubscriberName),\n    SubscriberIsSelf: boolOrNull(c.SubscriberIsSelf),\n    MemberId: textOrNull(c.MemberId),\n    MemberName: textOrNull(c.MemberName),\n    GroupNumber: textOrNull(c.GroupNumber),\n    FormattedEffectiveDate: textOrNull(c.FormattedEffectiveDate),\n    FormattedEndDate: textOrNull(c.FormattedEndDate),\n    Future: boolOrNull(c.Future),\n    Termed: boolOrNull(c.Termed),\n    Comments: textOrNull(c.Comments),\n    SuspendedText: textOrNull(c.SuspendedText),\n    Status: num(c.Status),\n    CoverageType: num(c.CoverageType),\n    CvgCoveredStatus: num(c.CvgCoveredStatus),\n    CvgReason: num(c.CvgReason),\n    bucket,\n  };\n}\n\nexport const insuranceProcessor: Processor<InsuranceStandard> = {\n  standard(raw: RawResponse): InsuranceStandard {\n    const record = findRequest(raw, GET_COVERAGES_PATH);\n    if (!record || record.status < 200 || record.status >= 300) {\n      throw new Error(`${GET_COVERAGES_PATH} returned HTTP ${record?.status ?? 'nothing'}`);\n    }\n\n    // The same 200-with-an-empty-body an unrecognized encounter context gets\n    // from the sibling GetPayors endpoint on this controller. It is not an\n    // error and it is not \"no coverage on file\"; reporting it as the latter is\n    // the whole failure this capability exists to avoid.\n    if (record.body === '') {\n      throw new Error(\n        `${GET_COVERAGES_PATH} returned an empty body, which is how MyChart answers an ` +\n          'unrecognized encounter context. Refusing to report \"no insurance on file\" from it.',\n      );\n    }\n\n    const envelope = rec<InsuranceGetCoverages>(record.body);\n    // Every bucket is an array on a real response, including on the captured\n    // account with no coverage at all. None of them being an array means the\n    // session expired into the login page, or this instance does not serve the\n    // Insurance activity — neither of which is an answer about insurance.\n    if (!COVERAGE_BUCKETS.some((bucket) => Array.isArray(envelope[bucket]))) {\n      throw new Error(\n        `${GET_COVERAGES_PATH} returned none of the coverage lists (${COVERAGE_BUCKETS.join(', ')}). ` +\n          'Refusing to report \"no insurance on file\" from a response shape we don\\'t recognize.',\n      );\n    }\n\n    const buckets = Object.fromEntries(\n      COVERAGE_BUCKETS.map((bucket) => {\n        const value = envelope[bucket];\n        return [bucket, (Array.isArray(value) ? value : []).map((c) => coverage(c, bucket))];\n      }),\n    ) as Record<CoverageBucket, InsuranceCoverageStandard[]>;\n\n    return {\n      ...buckets,\n      hasNoCoverages: COVERAGE_BUCKETS.every((bucket) => buckets[bucket].length === 0),\n      IsProxyContext: boolOrNull(envelope.IsProxyContext),\n      Settings: rec(envelope.Settings),\n    };\n  },\n\n  concise(standard) {\n    const brief = (c: InsuranceCoverageStandard) => ({\n      CoverageName: c.CoverageName,\n      PayorName: c.PayorName,\n      MemberId: c.MemberId,\n      GroupNumber: c.GroupNumber,\n      FormattedEffectiveDate: c.FormattedEffectiveDate,\n      bucket: c.bucket,\n    });\n    return {\n      // One list in concise: which bucket a coverage came from rides on the\n      // coverage, so four empty headings do not crowd out the one that matters.\n      coverages: COVERAGE_BUCKETS.flatMap((bucket) => standard[bucket].map(brief)),\n      hasNoCoverages: standard.hasNoCoverages,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { GET_COVERAGES_PATH, insuranceProcessor, type InsuranceStandard } from './insurance.processor';\n\nexport type { InsuranceStandard, InsuranceCoverageStandard, CoverageBucket } from './insurance.processor';\nexport { insuranceProcessor, COVERAGE_BUCKETS, GET_COVERAGES_PATH } from './insurance.processor';\n\n/**\n * The patient's insurance coverages.\n *\n * `GET /Insurance` is a shell page — the coverage list is an empty\n * `<div id=\"coverages-list\">` that `$$WP.Insurance.CoveragesController` fills\n * over AJAX, so scraping the page's markup returns nothing on every real\n * instance. The page is still fetched, because it carries the antiforgery\n * token the POST requires, and it is recorded as `purpose: 'token'` so `raw`\n * mode unwraps to the coverage payload rather than to a page of markup.\n *\n * The four form fields are the controller's own (`_loadCoverages`):\n * `isStandAlone` is true on the standalone Insurance activity, and the three\n * `encounter*` fields carry the pre-visit verification context when the same\n * component runs inside eCheck-In. All three are empty here, exactly as the\n * standalone page sends them.\n */\nexport async function fetchInsuranceRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Insurance');\n\n  await collector.send({\n    path: GET_COVERAGES_PATH,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n      'X-Requested-With': 'XMLHttpRequest',\n      __RequestVerificationToken: token,\n    },\n    body: new URLSearchParams({\n      isStandAlone: 'true',\n      encounterCsn: '',\n      encounterDepartmentId: '',\n      encounterDTE: '',\n    }).toString(),\n  });\n\n  return collector.toRaw();\n}\n\n/**\n * The standard object — what `mode: 'json'` returns. Throws rather than\n * reporting \"no insurance on file\" when the endpoint did not answer with a\n * recognizable envelope.\n */\nexport async function getInsurance(mychartRequest: MyChartRequest): Promise<InsuranceStandard> {\n  return insuranceProcessor.standard(await fetchInsuranceRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Insurance benefits processor. Field decisions: this folder's README.md.\n *\n * `GetBenefitsSummary` is the \"Insurance benefits\" card on the billing\n * activity: how much of the deductible and the out-of-pocket maximum has been\n * used, how much is left, and when the accumulator resets. `moop` is Epic's\n * name for maximum out-of-pocket and keeps it (rule 2).\n *\n * The endpoint is keyed by GUARANTOR ACCOUNT, not by coverage — its two\n * arguments are the `id` and `context` the billing summary page carries per\n * account — so a patient with two guarantor accounts has two of these, and the\n * standard object is a list of accounts rather than a single card. The\n * guarantor number and patient name on each row are read off the same summary\n * card the request was addressed from, so a reader can tell the two apart;\n * nothing in the response itself identifies the account.\n *\n * Each limit carries two buckets, `accountBucket` and `patientBucket`, and\n * they stay apart. On the one captured account `accountBucket` was entirely\n * blank — empty-string amounts, `rollPeriod: \"0\"` — while `patientBucket`\n * carried the real numbers, which is exactly the case rule 6 covers: a field\n * that is populated on some responses and not others is emitted every time,\n * and the processor never looks at the value to decide.\n *\n * Shape captured on ONE real instance (N=1). Everything below is a field name\n * that capture showed; nothing is projected that has not been seen.\n */\n\nimport { answered, findRequest, findRequests, type RawRequestRecord, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, num, rec, text, textOrNull } from '../../processors/read';\nimport type { AccountBucket, Deductible, GetBenefitsSummary } from './mychart.types';\nimport type { BenefitBucketStandard, BenefitLimitStandard, InsuranceBenefitsAccountStandard, InsuranceBenefitsStandard } from './standardized.types';\n\nexport type { BenefitBucketStandard, BenefitLimitStandard, InsuranceBenefitsAccountStandard, InsuranceBenefitsStandard } from './standardized.types';\nimport { parseAmount, parseBillingAccountsHtml } from '../bills/summaryHtml';\nimport type { BillingAccount } from '../bills/types';\n\nexport const GET_BENEFITS_SUMMARY_PATH = '/api/billing-details/GetBenefitsSummary';\n\nfunction amount(value: unknown): number | null {\n  return parseAmount(text(value)) ?? null;\n}\n\nfunction bucket(value: unknown): BenefitBucketStandard {\n  const b = rec<AccountBucket>(value);\n  return {\n    isLimit: boolOrNull(b.isLimit),\n    type: textOrNull(b.type),\n    totalAmount: textOrNull(b.totalAmount),\n    usedAmount: textOrNull(b.usedAmount),\n    remainingAmount: textOrNull(b.remainingAmount),\n    totalAmountNumber: amount(b.totalAmount),\n    usedAmountNumber: amount(b.usedAmount),\n    remainingAmountNumber: amount(b.remainingAmount),\n    usedRatio: num(b.usedRatio),\n    isTotalZero: boolOrNull(b.isTotalZero),\n    rollPeriodEndDate: textOrNull(b.rollPeriodEndDate),\n    rollPeriod: textOrNull(b.rollPeriod),\n    numberOfPeriods: num(b.numberOfPeriods),\n    usedOnPrevLevel: textOrNull(b.usedOnPrevLevel),\n  };\n}\n\nfunction limit(value: unknown): BenefitLimitStandard | null {\n  if (value === null || typeof value !== 'object' || Array.isArray(value)) return null;\n  const l = rec<Deductible>(value);\n  return {\n    type: textOrNull(l.type),\n    network: textOrNull(l.network),\n    name: textOrNull(l.name),\n    accountBucket: bucket(l.accountBucket),\n    patientBucket: bucket(l.patientBucket),\n  };\n}\n\n/**\n * The recorded `GetBenefitsSummary` whose posted `guarantorId` names this\n * account. The calls differ only in their bodies — same path, same method —\n * so the request body is the only discriminator, which is why the collector\n * records it.\n */\nfunction benefitsRequestFor(raw: RawResponse, source: BillingAccount): RawRequestRecord | undefined {\n  return findRequests(raw, GET_BENEFITS_SUMMARY_PATH).find(\n    (r) => rec(r.requestBody).guarantorId === source.id,\n  );\n}\n\nfunction account(body: unknown, source: BillingAccount): InsuranceBenefitsAccountStandard {\n  const b = rec<GetBenefitsSummary>(body);\n  return {\n    guarantorNumber: source.guarantorNumber,\n    patientName: source.patientName,\n    coverageName: textOrNull(b.coverageName),\n    payerName: textOrNull(b.payerName),\n    lastUpdatedText: textOrNull(b.lastUpdatedText),\n    helpText: textOrNull(b.helpText),\n    coverageId: textOrNull(b.coverageId),\n    benefitsPatientId: textOrNull(b.benefitsPatientId),\n    queryKey: textOrNull(b.queryKey),\n    noCoverageAvailable: boolOrNull(b.noCoverageAvailable),\n    hasAmbiguousCoverages: boolOrNull(b.hasAmbiguousCoverages),\n    hasRTEUpdateInProgress: boolOrNull(b.hasRTEUpdateInProgress),\n    canAccessInsuranceHub: boolOrNull(b.canAccessInsuranceHub),\n    canAccessInsuranceSummary: boolOrNull(b.canAccessInsuranceSummary),\n    canAccessCustomerService: boolOrNull(b.canAccessCustomerService),\n    canAccessAnyLinks: boolOrNull(b.canAccessAnyLinks),\n    insuranceHubUrl: textOrNull(b.insuranceHubUrl),\n    payerPhoneNumber: textOrNull(b.payerPhoneNumber),\n    deductible: limit(b.deductible),\n    moop: limit(b.moop),\n    insuranceLimit: limit(b.insuranceLimit),\n  };\n}\n\nexport const insuranceBenefitsProcessor: Processor<InsuranceBenefitsStandard> = {\n  standard(raw: RawResponse): InsuranceBenefitsStandard {\n    const summary = text(findRequest(raw, '/Billing/Summary')?.body);\n    const accounts: InsuranceBenefitsAccountStandard[] = [];\n    const unavailable: string[] = [];\n\n    for (const source of parseBillingAccountsHtml(summary)) {\n      const record = benefitsRequestFor(raw, source);\n      if (!answered(record)) {\n        // The scraper tolerates a per-account failure so one guarantor\n        // account's outage does not cost the other's deductible; naming it\n        // here is what keeps that from reading as \"you have no deductible\".\n        unavailable.push(source.guarantorNumber);\n        continue;\n      }\n      accounts.push(account(record.body, source));\n    }\n\n    return {\n      accounts,\n      // Never claimed over an account we could not read: an unavailable\n      // account's accumulators are unknown, which is not \"none\".\n      hasNoBenefits: unavailable.length === 0 && accounts.every((a) => a.noCoverageAvailable === true),\n      unavailable,\n    };\n  },\n\n  concise(standard) {\n    const brief = (b: BenefitBucketStandard) => ({\n      type: b.type,\n      totalAmount: b.totalAmount,\n      usedAmount: b.usedAmount,\n      remainingAmount: b.remainingAmount,\n      rollPeriodEndDate: b.rollPeriodEndDate,\n    });\n    const briefLimit = (l: BenefitLimitStandard | null) =>\n      l === null\n        ? null\n        : {\n            name: l.name,\n            network: l.network,\n            // Both sides, always. The captured account had the numbers on one\n            // of them and blanks on the other, and which one that is differs\n            // by payer — dropping the blank is membership by value (rule 6).\n            accountBucket: brief(l.accountBucket),\n            patientBucket: brief(l.patientBucket),\n          };\n    return {\n      accounts: standard.accounts.map((a) => ({\n        guarantorNumber: a.guarantorNumber,\n        patientName: a.patientName,\n        payerName: a.payerName,\n        coverageName: a.coverageName,\n        lastUpdatedText: a.lastUpdatedText,\n        noCoverageAvailable: a.noCoverageAvailable,\n        deductible: briefLimit(a.deductible),\n        moop: briefLimit(a.moop),\n        insuranceLimit: briefLimit(a.insuranceLimit),\n      })),\n      hasNoBenefits: standard.hasNoBenefits,\n      unavailable: standard.unavailable,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { SessionExpiredError } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { parseBillingAccountsHtml } from '../bills/summaryHtml';\nimport type { BillingAccount } from '../bills/types';\nimport {\n  GET_BENEFITS_SUMMARY_PATH,\n  insuranceBenefitsProcessor,\n  type InsuranceBenefitsStandard,\n} from './insuranceBenefits.processor';\n\nexport type {\n  InsuranceBenefitsStandard,\n  InsuranceBenefitsAccountStandard,\n  BenefitLimitStandard,\n  BenefitBucketStandard,\n} from './insuranceBenefits.processor';\nexport {\n  insuranceBenefitsProcessor,\n  GET_BENEFITS_SUMMARY_PATH,\n} from './insuranceBenefits.processor';\n\nfunction detailsPagePath(account: BillingAccount): string {\n  return `/Billing/Details?ID=${account.id}&Context=${account.context}`;\n}\n\n/**\n * The patient's benefit accumulators — deductible and out-of-pocket maximum.\n *\n * `GET /Billing/Summary` for the guarantor accounts, then per account the\n * `/Billing/Details` page for its antiforgery token and\n * `POST /api/billing-details/GetBenefitsSummary`. The two arguments the POST\n * takes are that account's own `id` and `context` off the summary card, under\n * the names `guarantorId` and `billingSystem` — the endpoint is keyed by\n * guarantor account rather than by coverage, which is why this walks the\n * billing summary at all.\n *\n * It is a React `/api/*` route, so the token rides in the\n * `__RequestVerificationToken` header with a JSON body, not in a form field.\n *\n * The summary page is the payload: without it there are no accounts to ask\n * about, so a failure there throws. Each account's own pair of requests is\n * tolerated, so one guarantor account's outage does not cost the other's\n * deductible, and the processor names the ones that did not answer. Every\n * account failing is a failed read — there is nothing loaded to return, and\n * an empty accumulator list is precisely the wrong answer — so the first\n * failure is thrown.\n */\nexport async function fetchInsuranceBenefitsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const summary = await collector.send({ path: '/Billing/Summary' });\n  const accounts = parseBillingAccountsHtml(summary.text, mychartRequest.hostname);\n\n  const failures: Error[] = [];\n  for (const account of accounts) {\n    try {\n      const token = await collector.pageToken(detailsPagePath(account));\n      const { failure } = await collector.send(\n        {\n          path: GET_BENEFITS_SUMMARY_PATH,\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json', __RequestVerificationToken: token },\n          body: JSON.stringify({ guarantorId: account.id, billingSystem: account.context }),\n        },\n        { tolerateFailure: true },\n      );\n      if (failure) failures.push(failure);\n    } catch (err) {\n      // The token page throws on its own — a failed page, or one carrying no\n      // token — and a dead session is not this account's problem to absorb.\n      if (err instanceof SessionExpiredError) throw err;\n      failures.push(err as Error);\n    }\n  }\n  if (accounts.length > 0 && failures.length === accounts.length) throw failures[0]!;\n\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getInsuranceBenefits(mychartRequest: MyChartRequest): Promise<InsuranceBenefitsStandard> {\n  return insuranceBenefitsProcessor.standard(await fetchInsuranceBenefitsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Insurance payer catalogue processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_insurance_payers`.\n *\n * The scraper records `POST /Insurance/Coverages/GetPayors`. Payers pass\n * through under MyChart's own `Payors` name with MyChart's own field names and\n * values; `requiredFields` / `optionalFields` are derived from `Fields`.\n *\n * A response without a `Payors` array THROWS, and so does the **empty body**\n * MyChart answers an unrecognized encounter context with — a 200 with no\n * content type at all, which `JSON.parse` never sees and a status check never\n * catches. Both would otherwise render as \"this organization accepts no\n * insurance\", which is the same class of silent-empty failure that got the\n * first care-team scraper withdrawn (#313).\n *\n * `Fields` maps a coverage-form field name to 1 (shown, optional) or 2 (shown,\n * required): the legacy controller reads `> 0` to show a field and `> 1` to\n * require it (`_buildFieldsViewModelFromPayor`). The map passes through as\n * MyChart sent it; the two derived lists name what those numbers mean, and a\n * level of 0 appears in neither.\n *\n * `SortKey` and `NameUTF8` (null on every entry of all four captured\n * instances) and `SampleCardImages` (empty on every entry of all four) are not\n * surfaced: always empty, so their shapes are unknown.\n */\n\nimport { findRequest, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, num, rec, textOrNull } from '../../processors/read';\nimport type { InsuranceGetPayors } from './mychart.types';\nimport type { InsurancePayerStandard, InsurancePayersStandard } from './standardized.types';\n\nexport type { InsurancePayerStandard, InsurancePayersStandard } from './standardized.types';\n\nexport const GET_PAYORS_PATH = '/Insurance/Coverages/GetPayors';\n\n/** `Fields` with non-numeric and level-0 entries dropped: 0 means MyChart does not show the field. */\nfunction fieldLevels(value: unknown): Record<string, number> {\n  const out: Record<string, number> = {};\n  for (const [name, level] of Object.entries(rec(value))) {\n    const parsed = num(level);\n    if (parsed !== null && parsed > 0) out[name] = parsed;\n  }\n  return out;\n}\n\nfunction payer(value: unknown): InsurancePayerStandard {\n  const p = rec(value);\n  const Fields = fieldLevels(p.Fields);\n  return {\n    ID: textOrNull(p.ID),\n    Name: textOrNull(p.Name),\n    Fields,\n    requiredFields: Object.keys(Fields).filter((name) => Fields[name]! > 1),\n    optionalFields: Object.keys(Fields).filter((name) => Fields[name]! === 1),\n    CanUpload: boolOrNull(p.CanUpload),\n    IsNonConfiguredPayer: boolOrNull(p.IsNonConfiguredPayer),\n  };\n}\n\nexport const insurancePayersProcessor: Processor<InsurancePayersStandard> = {\n  standard(raw: RawResponse): InsurancePayersStandard {\n    const record = findRequest(raw, 'Insurance/Coverages/GetPayors');\n    if (!record || record.status < 200 || record.status >= 300) {\n      throw new Error(`${GET_PAYORS_PATH} returned HTTP ${record?.status ?? 'nothing'}`);\n    }\n\n    // An unrecognized encounter context is answered with a 200 and an empty\n    // body — no error, no content type. `send` records that as the empty\n    // string, which is neither an envelope nor a failure a status check sees.\n    if (record.body === '') {\n      throw new Error(\n        `${GET_PAYORS_PATH} returned an empty body, which is how MyChart answers an ` +\n          'unrecognized encounter context. Refusing to report an empty payer catalogue from it.',\n      );\n    }\n\n    const payors = rec<InsuranceGetPayors>(record.body).Payors;\n    if (!Array.isArray(payors)) {\n      throw new Error(\n        `${GET_PAYORS_PATH} returned no Payors array. Refusing to report an empty payer ` +\n          'catalogue from a response shape we don\\'t recognize (the session may have expired, ' +\n          'or this instance does not serve the Insurance activity).',\n      );\n    }\n\n    return { Payors: payors.map(payer) };\n  },\n\n  concise(standard) {\n    return {\n      Payors: standard.Payors.map((p) => ({\n        Name: p.Name,\n        requiredFields: p.requiredFields,\n        IsNonConfiguredPayer: p.IsNonConfiguredPayer,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { insurancePayersProcessor, type InsurancePayersStandard } from './insurancePayers.processor';\n\nexport type { InsurancePayersStandard, InsurancePayerStandard } from './insurancePayers.processor';\nexport { insurancePayersProcessor, GET_PAYORS_PATH } from './insurancePayers.processor';\n\n/**\n * The organization's insurance payer catalogue — the payers MyChart offers\n * when a patient adds a coverage.\n *\n * This is a legacy jQuery activity, not one of the React `/app/*` ones. The\n * React insurance activity's `POST /api/insurance/LoadPayers` is *not* the\n * endpoint: none of the four captured instances serves that activity at all\n * (`GET /app/insurance` answers 200 with the Home page), and LoadPayers\n * answers 500 there whatever it is sent — the bundle calls it with no request\n * data, so no payload fixes it. `$$WP.Insurance.CoveragesController` in\n * `bundles/insurance-controllers` loads the payer dropdown from:\n *\n *   POST /Insurance/Coverages/GetPayors   → { Payors: [...] }\n *\n * form-encoded with `encounterCsn` and `encounterDepartmentId`, both empty on\n * the standalone Insurance page (they carry the pre-visit insurance\n * verification context when the same component runs inside eCheck-In). The\n * antiforgery token off the `/Insurance` activity page is required exactly as\n * on `/api/*`.\n *\n * The catalogue is organization-level as far as the capture can show: no\n * patient identifier in the request, an identical list with a real department\n * id, and zero payer ids shared between the four organizations. See\n * `scrapers/myChart/api-surface-gaps.md`, \"Insurance payer catalogue\".\n *\n * Two answers are recorded rather than raised here, because reading either as\n * \"no payers\" is the failure this capability has to avoid, and both are the\n * processor's to reject: an expired session serves the login page, and an\n * encounter context the instance does not recognize is answered with a 200\n * and an **empty body**.\n */\nexport async function fetchInsurancePayersRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Insurance');\n\n  await collector.send({\n    path: '/Insurance/Coverages/GetPayors',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n      'X-Requested-With': 'XMLHttpRequest',\n      __RequestVerificationToken: token,\n    },\n    body: new URLSearchParams({ encounterCsn: '', encounterDepartmentId: '' }).toString(),\n  });\n\n  return collector.toRaw();\n}\n\n/**\n * The standard object — what `mode: 'json'` returns. Throws rather than\n * reporting an empty catalogue when the endpoint did not answer with a\n * recognizable envelope.\n */\nexport async function getInsurancePayers(mychartRequest: MyChartRequest): Promise<InsurancePayersStandard> {\n  return insurancePayersProcessor.standard(await fetchInsurancePayersRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Billing` group — what was charged, and who is covering it. */\n\nimport { fetchBillingRaw, billingProcessor, downloadBillingStatement } from '../../../scrapers/myChart/chart/bills/bills';\nimport { fetchInsuranceRaw, insuranceProcessor } from '../../../scrapers/myChart/chart/insurance/insurance';\nimport { fetchInsuranceBenefitsRaw, insuranceBenefitsProcessor } from '../../../scrapers/myChart/chart/insuranceBenefits/insuranceBenefits';\nimport { fetchInsurancePayersRaw, insurancePayersProcessor } from '../../../scrapers/myChart/chart/insurancePayers/insurancePayers';\nimport { requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const BILLING_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_billing',\n    title: 'Billing',\n    description: 'Billing history and account balances.',\n    kind: 'read',\n    group: 'Billing',\n    params: [],\n    run: (request) => fetchBillingRaw(request),\n    processor: billingProcessor,\n  },\n  {\n    id: 'download_billing_statement',\n    title: 'Download billing statement',\n    description:\n      'Download one billing statement or itemized bill as the PDF MyChart serves for it. Identify it with the `RecordID` of a statement from get_billing. The file is saved on the user’s own device and the path returned.',\n    kind: 'read',\n    group: 'Billing',\n    returnsFile: true,\n    params: [\n      { name: 'record_id', type: 'string', required: true, description: 'The `RecordID` of the chosen statement from get_billing. Copy it verbatim.' },\n    ],\n    run: (request, args) => downloadBillingStatement(request, requireStr(args, 'record_id')),\n  },\n  {\n    id: 'get_insurance',\n    title: 'Insurance',\n    description:\n      'Insurance coverages on file: payer, plan, member and group numbers, effective dates. ' +\n      'Not the deductible or out-of-pocket maximum — those are get_insurance_benefits.',\n    kind: 'read',\n    group: 'Billing',\n    params: [],\n    run: (request) => fetchInsuranceRaw(request),\n    processor: insuranceProcessor,\n  },\n  {\n    id: 'get_insurance_benefits',\n    title: 'Insurance benefits',\n    description:\n      'How much of the deductible and the out-of-pocket maximum has been used, how much is left, ' +\n      'and when each resets. MyChart keys these to a billing guarantor account rather than to a ' +\n      'coverage, so a patient with two accounts gets one set per account. For the coverages ' +\n      'themselves — payer, plan, member id — use get_insurance.',\n    kind: 'read',\n    group: 'Billing',\n    params: [],\n    run: (request) => fetchInsuranceBenefitsRaw(request),\n    processor: insuranceBenefitsProcessor,\n  },\n  {\n    id: 'get_insurance_payers',\n    title: 'Insurance payers accepted',\n    description:\n      \"The insurance payers this organization's MyChart offers when adding a coverage — the \" +\n      \"organization's configured payer catalogue, the same for every patient on the instance. \" +\n      \"Not the patient's own coverage (that is get_insurance) and not an in-network guarantee.\",\n    kind: 'read',\n    group: 'Billing',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchInsurancePayersRaw(request),\n    processor: insurancePayersProcessor,\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Care team processor. Field decisions: docs/processor-layer-proposal.md, `get_care_team`.\n *\n * The scraper records `POST /Clinical/CareTeam/Load` and `LoadExternal`. The\n * two lists are merged under MyChart's own `ProvidersList` name with a derived\n * `fromExternalList` on every row (distinct from `IsExternal`, which the\n * internal list can also set).\n *\n * A `Load` response without a `ProvidersList` array THROWS. The previous\n * version of this scraper was withdrawn (#313) for guessing at the envelope,\n * because a wrong guess here does not fail visibly: it renders to the patient\n * as \"you have no care team\". A non-2xx status, a login page in place of\n * JSON, or an unrecognized envelope are all errors, never an empty team.\n *\n * `LoadExternal` is optional per deployment (Care Everywhere), so a failure\n * there — a recorded non-JSON or non-envelope response, or no recorded\n * request at all because the call threw — sets `externalProvidersUnavailable`\n * rather than failing the whole read. A partial care team presented as the\n * whole one is the failure that flag exists to prevent.\n *\n * `AboutMeBlurb` (`[]` on every provider of four instances) and\n * `Organizations` / `SchedulableVisitTypes` (`null` on all four) are not\n * surfaced: their shapes are unknown.\n *\n * `NationalProviderID` is a trap rather than an unknown: it is named like an\n * NPI but holds that NPI Epic-encrypted (a `WP-$…$…` blob, empty when the\n * provider has none), so a caller who passed it to `lookup_npi` — as that\n * capability's own docs once told them to — always failed the check digit. It\n * is raw-only: nothing takes it as input, and it says nothing `npi` does not.\n * The NPI itself comes from the scraper's third call: the row's `ID` sent to\n * `/api/Providers/GetProviderBioPrivate` (the page's own \"provider details\"\n * request) answers with the bio, `npi` in plain digits included. The derived\n * `npi` is that value, matched back to its row by the request body's `id`, and\n * `null` where the bio was not fetched (the page would not link it either),\n * did not answer, or carried an empty `npi` (nurses and medical assistants).\n */\n\nimport { findRequests, type RawRequestRecord, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, textOrNull } from '../../processors/read';\nimport type { CareTeamLoad, GetProviderBioPrivate } from './mychart.types';\nimport type { CareTeamProviderStandard, CareTeamStandard } from './standardized.types';\n\nexport type { CareTeamProviderStandard, CareTeamStandard } from './standardized.types';\n\nfunction provider(value: unknown, fromExternalList: boolean, bios: RawRequestRecord[]): CareTeamProviderStandard {\n  const p = rec(value);\n  const ID = textOrNull(p.ID);\n  return {\n    Name: textOrNull(p.Name),\n    Relation: textOrNull(p.Relation),\n    Specialty: textOrNull(p.Specialty),\n    IsExternal: boolOrNull(p.IsExternal),\n    fromExternalList,\n    npi: npiOf(ID, bios),\n    ID,\n    DepartmentID: textOrNull(p.DepartmentID),\n    CanMessage: boolOrNull(p.CanMessage),\n  };\n}\n\n/** The `npi` of the bio that answered for this row's `ID`, or null. An empty `npi` is null too: MyChart sends `\"\"` for \"none\". */\nfunction npiOf(ID: string | null, bios: RawRequestRecord[]): string | null {\n  if (ID === null) return null;\n  const bio = bios.find((r) => rec(r.requestBody).id === ID);\n  if (!bio || bio.failure !== undefined || bio.status < 200 || bio.status >= 300) return null;\n  const npi = textOrNull(rec<GetProviderBioPrivate>(bio.body).npi);\n  return npi === '' ? null : npi;\n}\n\n/** The `ProvidersList` array of a recorded response, or null when the response is not a recognizable envelope. */\nfunction providersListOf(body: unknown): unknown[] | null {\n  const envelope = rec<CareTeamLoad>(body);\n  return Array.isArray(envelope.ProvidersList) ? envelope.ProvidersList : null;\n}\n\nexport const careTeamProcessor: Processor<CareTeamStandard> = {\n  standard(raw: RawResponse): CareTeamStandard {\n    const load = findRequests(raw, 'Clinical/CareTeam/Load')[0];\n    const internal = load ? providersListOf(load.body) : null;\n    if (!load || load.status < 200 || load.status >= 300) {\n      throw new Error(`/Clinical/CareTeam/Load returned HTTP ${load?.status ?? 'nothing'}`);\n    }\n    if (internal === null) {\n      throw new Error(\n        '/Clinical/CareTeam/Load returned no ProvidersList array. Refusing to report an ' +\n          'empty care team from a response shape we don\\'t recognize (the session may have ' +\n          'expired, or this instance does not serve the Care Team activity).',\n      );\n    }\n\n    const loadExternal = findRequests(raw, 'Clinical/CareTeam/LoadExternal')[0];\n    const external =\n      loadExternal && !loadExternal.failure && loadExternal.status >= 200 && loadExternal.status < 300\n        ? providersListOf(loadExternal.body)\n        : null;\n\n    const bios = findRequests(raw, 'Providers/GetProviderBioPrivate');\n\n    return {\n      DescriptiveTitle: textOrNull(rec<CareTeamLoad>(load.body).DescriptiveTitle),\n      externalProvidersUnavailable: external === null,\n      ProvidersList: [\n        ...internal.map((p) => provider(p, false, bios)),\n        ...list(external).map((p) => provider(p, true, bios)),\n      ],\n    };\n  },\n\n  concise(standard) {\n    return {\n      externalProvidersUnavailable: standard.externalProvidersUnavailable,\n      ProvidersList: standard.ProvidersList.map((p) => ({\n        Name: p.Name,\n        Relation: p.Relation,\n        Specialty: p.Specialty,\n        IsExternal: p.IsExternal,\n        fromExternalList: p.fromExternalList,\n        npi: p.npi,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { SessionExpiredError } from '../../core/makeAuthenticatedRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { rec } from '../../processors/read';\nimport { logger } from '../../../../shared/logger';\nimport { careTeamProcessor, type CareTeamStandard } from './careTeam.processor';\n\nexport type { CareTeamStandard, CareTeamProviderStandard } from './careTeam.processor';\nexport { careTeamProcessor } from './careTeam.processor';\n\n/**\n * Care Team.\n *\n * This is a legacy jQuery/Handlebars activity, not one of the React `/app/*`\n * ones, so it does not live under `/api/*` and its envelope is PascalCase\n * rather than the camelCase the `/api` routes use:\n *\n *   POST /Clinical/CareTeam/Load          → this organization's providers\n *   POST /Clinical/CareTeam/LoadExternal  → outside / Care Everywhere providers\n *\n * Both are POST-only — a GET is refused with the instance's ASP.NET error\n * surface (a bare 500 on the August 2025 release, a 302 to `/Home/FiveHundred`\n * on November 2025) rather than serving the data — and every parameter the\n * page's own JS sends (`hfrId`, `sources`, `actions`, `isPrimaryStandalone`)\n * is optional: a bare POST with `{}` returns exactly what the page's own\n * parameters return. Both require the antiforgery token from the activity\n * page, like the `/api/*` routes do. Field names and types were verified\n * against four live instances spanning both captured Epic releases; see\n * `scrapers/myChart/api-surface-gaps.md`, \"Shipped: Care Team\".\n *\n * Neither call depends on the other. Care Everywhere is optional per\n * deployment, so a failure on the outside-provider arm is not fatal: a failed\n * response is recorded as it came, and a call that throws (anything but an\n * expired session) is logged and leaves no `LoadExternal` record, which the\n * processor reports as `externalProvidersUnavailable`.\n *\n * Then one more call per provider, the one the page's own \"provider details\"\n * link leads to:\n *\n *   POST /api/Providers/GetProviderBioPrivate  { id: <the row's ID> }\n *\n * The care team's `NationalProviderID` is an Epic-encrypted token, but this\n * React endpoint takes the row's (equally encrypted) `ID` and answers with the\n * provider's bio, `npi` in plain digits included — the server holds the key,\n * so the server is asked. It is called only where the page itself would link\n * (`CanViewProviderDetails`, and not `HasNoProviderRecord`), and an unknown or\n * foreign id is a 500 `{\"Message\":\"An error has occurred.\"}`, recorded rather\n * than thrown: a missing bio costs one provider's `npi`, not the care team.\n * See README.md for the capture.\n */\nexport async function fetchCareTeamRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Clinical/CareTeam');\n\n  const [load, loadExternal] = await Promise.all([\n    collector.postJson('/Clinical/CareTeam/Load', token, {}),\n    collector.postJson('/Clinical/CareTeam/LoadExternal', token, {}, { tolerateFailure: true }).catch((err: unknown) => {\n      if (err instanceof SessionExpiredError) throw err;\n      logger.debug(`Could not read external care team providers: ${String(err)}`);\n      return undefined;\n    }),\n  ]);\n\n  const ids = [...providersOf(load), ...providersOf(loadExternal)].map(detailsIdOf).filter((id): id is string => id !== null);\n  await Promise.all(\n    ids.map((id) =>\n      collector.postJson('/api/Providers/GetProviderBioPrivate', token, { id }, { tolerateFailure: true }).catch((err: unknown) => {\n        if (err instanceof SessionExpiredError) throw err;\n        logger.debug(`Could not read a care team provider's bio: ${String(err)}`);\n      }),\n    ),\n  );\n\n  return collector.toRaw();\n}\n\nfunction providersOf(body: unknown): unknown[] {\n  const list = rec(body).ProvidersList;\n  return Array.isArray(list) ? list : [];\n}\n\n/** The row's `ID` when the page would link it to `/app/providers/details?id=<ID>` (the conditions are `careteam.min.js`'s), else null. */\nfunction detailsIdOf(provider: unknown): string | null {\n  const p = rec(provider);\n  const links = p.CanViewProviderDetails === true && p.HasNoProviderRecord !== true;\n  return links && typeof p.ID === 'string' && p.ID !== '' ? p.ID : null;\n}\n\n/**\n * The standard object — what `mode: 'json'` returns. Throws rather than\n * reporting an empty team when `Load` did not answer with a recognizable\n * envelope.\n */\nexport async function getCareTeam(mychartRequest: MyChartRequest): Promise<CareTeamStandard> {\n  return careTeamProcessor.standard(await fetchCareTeamRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Referrals processor. Field decisions: docs/processor-layer-proposal.md, `get_referrals`.\n *\n * `dte` (Epic day count of `creationDate`) is internal; `canSendMessage` and\n * `shouldRedirect` are page config. Everything else on the captured element\n * is kept under MyChart's own names.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, textOrNull } from '../../processors/read';\nimport type { ListReferrals } from './mychart.types';\nimport type { ReferralsStandard } from './standardized.types';\n\nexport type { ReferralStandard, ReferralsStandard } from './standardized.types';\n\nexport const referralsProcessor: Processor<ReferralsStandard> = {\n  standard(raw: RawResponse): ReferralsStandard {\n    const body = rec<ListReferrals>(bodyOf(raw, 'listReferrals'));\n    return {\n      canSeeAuthorizations: boolOrNull(body.canSeeAuthorizations),\n      referralList: list(body.referralList).map((value) => {\n        const r = rec(value);\n        return {\n          statusString: textOrNull(r.statusString),\n          status: textOrNull(r.status),\n          referredToProviderName: textOrNull(r.referredToProviderName),\n          referredToFacility: textOrNull(r.referredToFacility),\n          referredByProviderName: textOrNull(r.referredByProviderName),\n          start: textOrNull(r.start),\n          end: textOrNull(r.end),\n          creationDate: textOrNull(r.creationDate),\n          internalId: textOrNull(r.internalId),\n          externalId: textOrNull(r.externalId),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    return {\n      referralList: standard.referralList.map((r) => ({\n        statusString: r.statusString,\n        referredToProviderName: r.referredToProviderName,\n        referredToFacility: r.referredToFacility,\n        referredByProviderName: r.referredByProviderName,\n        start: r.start,\n        end: r.end,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { referralsProcessor, type ReferralsStandard } from './referrals.processor';\n\nexport type { ReferralsStandard, ReferralStandard } from './referrals.processor';\nexport { referralsProcessor } from './referrals.processor';\n\n/** `GET /app/referrals` for the token, then `POST /api/referrals/listReferrals`. */\nexport async function fetchReferralsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/referrals');\n  await collector.postJson('/api/referrals/listReferrals', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getReferrals(mychartRequest: MyChartRequest): Promise<ReferralsStandard> {\n  return referralsProcessor.standard(await fetchReferralsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Letters processors. Field decisions: docs/processor-layer-proposal.md,\n * `get_letters` and `get_letter_details`.\n *\n * `GetLettersList` carries an author directory (`users`, keyed by `empId`)\n * beside the letters; the name is resolved onto each letter as the derived\n * `providerName` and `empId` is kept so the resolution is checkable. `users`\n * itself is not in standard (its other field, `photoUrl`, is an asset).\n * `departments` was `{}` on capture and passes through whole (rule 10).\n *\n * The list is sorted newest first with unparseable dates last — what the\n * scraper did before, now processor work.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport { parseMyChartDate, sortNewestFirstByDate } from '../../core/util';\nimport { htmlToText } from '../../processors/htmlText';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, text, textOrNull } from '../../processors/read';\nimport type { GetLettersList } from './mychart.types';\nimport type { LetterDetailsStandard, LetterStandard, LettersStandard } from './standardized.types';\n\nexport type { LetterDetailsStandard, LetterStandard, LettersStandard } from './standardized.types';\n\nexport const lettersProcessor: Processor<LettersStandard> = {\n  standard(raw: RawResponse): LettersStandard {\n    const body = rec<GetLettersList>(bodyOf(raw, 'GetLettersList'));\n    const users = rec(body.users);\n    const letters: LetterStandard[] = list(body.letters).map((entry) => {\n      const l = rec(entry);\n      const empId = textOrNull(l.empId);\n      const user = rec(empId === null ? undefined : users[empId]);\n      return {\n        hnoId: textOrNull(l.hnoId),\n        csn: textOrNull(l.csn),\n        dateISO: textOrNull(l.dateISO),\n        reason: textOrNull(l.reason),\n        viewed: boolOrNull(l.viewed),\n        empId,\n        providerName: textOrNull(user.name),\n      };\n    });\n    return {\n      letters: sortNewestFirstByDate(letters, (l) => parseMyChartDate(l.dateISO)),\n      departments: rec(body.departments),\n    };\n  },\n  concise(standard) {\n    return {\n      letters: standard.letters.map((l) => ({\n        hnoId: l.hnoId,\n        csn: l.csn,\n        dateISO: l.dateISO,\n        reason: l.reason,\n        viewed: l.viewed,\n        providerName: l.providerName,\n      })),\n    };\n  },\n};\n\n/** A literal `null` (unknown hnoId) passes through as `null` (rule 7). */\nexport const letterDetailsProcessor: Processor<LetterDetailsStandard | null> = {\n  standard(raw: RawResponse): LetterDetailsStandard | null {\n    const body = bodyOf(raw, 'GetLetterDetails');\n    if (body === null || body === undefined) return null;\n    return { bodyHTMLText: htmlToText(text(rec(body).bodyHTML)) };\n  },\n  concise(standard) {\n    return standard;\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport {\n  letterDetailsProcessor,\n  lettersProcessor,\n  type LetterDetailsStandard,\n  type LettersStandard,\n} from './letters.processor';\n\nexport type { LettersStandard, LetterStandard, LetterDetailsStandard } from './letters.processor';\nexport { lettersProcessor, letterDetailsProcessor } from './letters.processor';\n\n/** `GET /app/letters` for the token, then `POST /api/letters/GetLettersList`. */\nexport async function fetchLettersRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/letters');\n  await collector.postJson('/api/letters/GetLettersList', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getLetters(mychartRequest: MyChartRequest): Promise<LettersStandard> {\n  return lettersProcessor.standard(await fetchLettersRaw(mychartRequest));\n}\n\n/**\n * `POST /api/letters/GetLetterDetails` `{ hnoId, csn }`. MyChart needs the\n * encounter (csn) alongside the note id; sending only one returns someone\n * else's letter or nothing at all.\n */\nexport async function fetchLetterDetailsRaw(mychartRequest: MyChartRequest, hnoId: string, csn: string): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/letters');\n  await collector.postJson('/api/letters/GetLetterDetails', token, { hnoId, csn });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. `null` for an unknown letter. */\nexport async function getLetterDetails(\n  mychartRequest: MyChartRequest,\n  hnoId: string,\n  csn: string,\n): Promise<LetterDetailsStandard | null> {\n  return letterDetailsProcessor.standard(await fetchLetterDetailsRaw(mychartRequest, hnoId, csn));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Documents processor. Field decisions: docs/processor-layer-proposal.md, `get_documents`.\n *\n * Every `LoadOtherDocuments` page in the envelope is concatenated, then sorted\n * newest first on `dateRaw` — the same key Epic's own Document Center sorts\n * on, because the server returns the pages in no particular order relative to\n * each other.\n *\n * `dateRaw` is an Epic day number, not a timestamp: it matched the `date`\n * string on all 42 documents of the one live account captured, so `dateISO`\n * is derived from it rather than from parsing `date`'s locale-shaped M/D/YYYY.\n */\n\nimport { findRequests, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, textOrNull } from '../../processors/read';\nimport type { LoadOtherDocuments } from './mychart.types';\nimport type { DocumentsStandard } from './standardized.types';\n\nexport type { DocumentStandard, DocumentsStandard } from './standardized.types';\nimport { fromEpicDte } from '../../../../shared/epicDate';\n\nfunction dateISO(dateRaw: string | null): string | null {\n  const dte = Number(dateRaw);\n  if (dateRaw === null || dateRaw === '' || !Number.isFinite(dte)) return null;\n  return fromEpicDte(dte).toISOString().slice(0, 10);\n}\n\nexport const documentsProcessor: Processor<DocumentsStandard> = {\n  standard(raw: RawResponse): DocumentsStandard {\n    const documents = findRequests(raw, 'LoadOtherDocuments')\n      .flatMap((page) => list(rec<LoadOtherDocuments>(page.body).documents))\n      .map((entry) => {\n        const d = rec(entry);\n        const dateRaw = textOrNull(d.dateRaw);\n        return {\n          dcsID: textOrNull(d.dcsID),\n          docID: textOrNull(d.docID),\n          docType: textOrNull(d.docType),\n          docDesc: textOrNull(d.docDesc),\n          docExt: textOrNull(d.docExt),\n          date: textOrNull(d.date),\n          dateRaw,\n          dateISO: dateISO(dateRaw),\n          blobCat: textOrNull(d.blobCat),\n          dat: textOrNull(d.dat),\n          new: boolOrNull(d.new),\n          wasESigned: boolOrNull(d.wasESigned),\n          isExpired: boolOrNull(d.isExpired),\n          downloadOnly: boolOrNull(d.downloadOnly),\n          onlyAllowedPreview: boolOrNull(d.onlyAllowedPreview),\n          pendingRequiredSignatures: boolOrNull(d.pendingRequiredSignatures),\n          pendingApprovalStatus: num(d.pendingApprovalStatus),\n          rejectionReasonFreetext: textOrNull(d.rejectionReasonFreetext),\n        };\n      });\n    documents.sort((a, b) => Number(b.dateRaw ?? 0) - Number(a.dateRaw ?? 0));\n    return { documents };\n  },\n  /**\n   * `dcsID` is deliberately not here. It is the download handle, but nothing\n   * takes it yet, and at 85-94 characters on a real instance it is both a\n   * third of concise's bytes and enough on its own to push every row out of\n   * table form (`MAX_TABLE_CELL` in processors/markdown.ts). It belongs back\n   * in concise the day a capability accepts it, the way `dcsId` joined the\n   * message projections once attachments could be fetched (#439).\n   */\n  concise(standard) {\n    return {\n      documents: standard.documents.map((d) => ({\n        docType: d.docType,\n        docDesc: d.docDesc,\n        docExt: d.docExt,\n        dateISO: d.dateISO,\n        new: d.new,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { list, rec } from '../../processors/read';\nimport type { LoadOtherDocuments } from './mychart.types';\nimport { logger } from '../../../../shared/logger';\nimport { documentsProcessor, type DocumentsStandard } from './documents.processor';\n\nexport type { DocumentsStandard, DocumentStandard } from './documents.processor';\nexport { documentsProcessor } from './documents.processor';\n\nconst LOAD_OTHER_DOCUMENTS = '/api/documents/viewer/LoadOtherDocuments';\n\n/**\n * Documents per page. Epic's own Document Center hides its \"Load more\" button\n * once a page comes back with fewer than 25, which is the only signal the\n * response carries — there is no count, no cursor and no `hasMore` flag.\n */\nconst PAGE_SIZE = 25;\n\n/** ~1000 documents. Guarantees termination if a page ever stops shrinking. */\nconst MAX_PAGES = 40;\n\n/**\n * `GET /app/document-center` for the token, then walk `LoadOtherDocuments`.\n *\n * **`isInitialLoad` is not optional.** The cursor is server-side session\n * state: `true` rewinds it and answers the first 25, anything else answers\n * the next 25 from wherever the session left off. Posting `{}` on a fresh\n * session therefore asks for the page after the last one — of a walk that\n * never started — and MyChart answers `{\"documents\":[]}` with a 200. That is\n * indistinguishable from an empty chart, and it is what this scraper sent\n * until now: an account with 42 documents read as none.\n *\n * The activity is `/app/document-center`; `/app/documents` is not a page on\n * any instance and redirects to Home, which still carries a usable token but\n * costs `RawCollector` its \"this activity is not served here\" signal.\n */\nexport async function fetchDocumentsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/document-center');\n\n  let pages = 0;\n  let count = PAGE_SIZE;\n  while (count === PAGE_SIZE && pages < MAX_PAGES) {\n    const body = await collector.postJson(LOAD_OTHER_DOCUMENTS, token, { isInitialLoad: pages === 0 });\n    count = list(rec<LoadOtherDocuments>(body).documents).length;\n    pages++;\n  }\n  if (count === PAGE_SIZE) {\n    logger.debug(`documents: hit page cap (${MAX_PAGES}); some older documents may be omitted`);\n  }\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getDocuments(mychartRequest: MyChartRequest): Promise<DocumentsStandard> {\n  return documentsProcessor.standard(await fetchDocumentsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * One Document Center document: the bytes MyChart holds for it.\n *\n * `get_documents` lists documents and hands back a `dcsID`; this fetches the\n * file, the way Epic's own row does — `useDcsDocument`\n * (`epic.px.client.document-viewer.js`), reached from\n * `epic.px.client.document-center.js` as\n * `{ dcsId: doc.dcsID, fileExtension: doc.docExt }` with `useOldMobileLink: true`\n * and no `legacyEncryption`, which is what picks `GetDocumentDetails` over the\n * `…Legacy` sibling the message viewer uses.\n *\n * The exchange itself, and the three traps in it, are in\n * [`core/dcsDocument.ts`](../../core/dcsDocument.ts) — attachments go through\n * the same store. All this adds is the id it was given and the wording of a\n * refusal, since only it knows the id came from `get_documents`.\n *\n * **It sends no extension**, where the portal sends `doc.docExt`. MyChart\n * ignores the field (measured five ways on one live instance: correct, empty,\n * omitted, wrong, and `dcsId` alone all returned the same 135,807-byte PDF),\n * and the only way to learn a document's extension is to walk the document\n * list — up to 40 requests, for a value the server never reads.\n */\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector } from '../../core/rawResponse';\nimport { DcsDocumentError, fetchDcsFile } from '../../core/dcsDocument';\nimport type { FilePayload } from '../../core/filePayload';\nimport { DetailedError } from '../../../../shared/detailedError';\n\n/** A downloaded document: the file, and what MyChart said about it. */\nexport interface DocumentFile extends FilePayload {\n  /** The `dcsID` from `get_documents` that was asked for. */\n  dcsID: string;\n  /** MyChart's own name for the file, before `fileName` made it safe. */\n  displayName: string;\n}\n\n/**\n * Download the document `documentId` — a `dcsID` from `get_documents` — from\n * the active patient record.\n */\nexport async function downloadDocument(\n  mychartRequest: MyChartRequest,\n  documentId: string,\n): Promise<DocumentFile> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/document-center');\n\n  try {\n    const file = await fetchDcsFile(mychartRequest, collector, token, {\n      dcsId: documentId,\n      fileExtension: '',\n      organizationId: '',\n      useOldMobileLink: true,\n      legacy: false,\n    });\n    return { ...file, dcsID: documentId };\n  } catch (error) {\n    if (!(error instanceof DcsDocumentError)) throw error;\n    const { failure } = error;\n    if (failure.reason === 'no_such_document') {\n      throw new Error(\n        `MyChart has no document ${documentId} on the active patient record. ` +\n          'Take the id from a `dcsID` in get_documents, copied verbatim, and check the right patient is active.',\n      );\n    }\n    const named = failure.displayName || documentId;\n    if (failure.reason === 'not_released') {\n      const rest =\n        ' for viewing in the portal only and serves no file for it, ' +\n        'so there is nothing to download. Opening it in MyChart itself is the only way to read it.';\n      throw new DetailedError(`MyChart offers document ${documentId}${rest}`, `MyChart offers ${named}${rest}`);\n    }\n    throw new DetailedError(\n      `MyChart answered the download of document ${documentId} with ${failure.detail}; nothing was downloaded.`,\n      `MyChart answered the download of ${named} with ${failure.detail}; nothing was downloaded.`,\n    );\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Upcoming orders processor. Field decisions: docs/processor-layer-proposal.md, `get_upcoming_orders`.\n *\n * Real `GetUpcomingOrders` responses are keyed MAPS — `orderList` holds the\n * orders by id with `orderGroupList` / `providerList` alongside — never a bare\n * `orders` array. Every captured account had all three maps empty, so the\n * order element is uncaptured and passes through whole (rule 10); `orderList`\n * is emitted as the map's values.\n *\n * `providerName` is derived by joining the order to `providerList`. Neither\n * the order's provider-key field nor the provider element's name field has\n * been captured, so the join is by value: any string field on the order that\n * is a key of `providerList` selects the entry, and the entry's `name` (or\n * `displayName`) is the provider's name. `null` until a capture shows the\n * real join.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { rec, text } from '../../processors/read';\nimport type { GetUpcomingOrders } from './mychart.types';\nimport type { UpcomingOrdersStandard } from './standardized.types';\n\nexport type { UpcomingOrderStandard, UpcomingOrdersStandard } from './standardized.types';\n\nexport function resolveProviderName(order: Record<string, unknown>, providerList: Record<string, unknown>): string | null {\n  for (const value of Object.values(order)) {\n    if (typeof value !== 'string' || !(value in providerList)) continue;\n    const entry = providerList[value];\n    if (typeof entry === 'string') return entry;\n    const name = text(rec(entry).name) || text(rec(entry).displayName);\n    if (name) return name;\n  }\n  return null;\n}\n\nexport const upcomingOrdersProcessor: Processor<UpcomingOrdersStandard> = {\n  standard(raw: RawResponse): UpcomingOrdersStandard {\n    const body = rec<GetUpcomingOrders>(bodyOf(raw, 'GetUpcomingOrders'));\n    const providerList = rec(body.providerList);\n    return {\n      orderList: Object.values(rec(body.orderList)).map((value) => {\n        const order = rec(value);\n        return { ...order, providerName: resolveProviderName(order, providerList) };\n      }),\n      orderGroupList: rec(body.orderGroupList),\n    };\n  },\n  /** Narrows to name, type, status, date and provider once the element is captured. */\n  concise(standard) {\n    return { orderList: standard.orderList };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { upcomingOrdersProcessor, type UpcomingOrdersStandard } from './upcomingOrders.processor';\n\nexport type { UpcomingOrdersStandard, UpcomingOrderStandard } from './upcomingOrders.processor';\nexport { upcomingOrdersProcessor } from './upcomingOrders.processor';\n\n/** `GET /app/upcoming-orders` for the token, then `POST /api/upcoming-orders/GetUpcomingOrders`. */\nexport async function fetchUpcomingOrdersRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/upcoming-orders');\n  await collector.postJson('/api/upcoming-orders/GetUpcomingOrders', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getUpcomingOrders(mychartRequest: MyChartRequest): Promise<UpcomingOrdersStandard> {\n  return upcomingOrdersProcessor.standard(await fetchUpcomingOrdersRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Questionnaires processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_questionnaires`.\n *\n * `GetQuestionnaireList` answers with four lists rather than one, and they are\n * kept apart under MyChart's own names because they are different answers:\n * `assignedQuestionnaires` were given to the patient to fill in,\n * `optionalQuestionnaires` are offered and never due, `questionnaireContextLists`\n * regroups assigned entries by whatever assigned them (an appointment, a care\n * journey, a letter), and `completedQuestionnaires` are done.\n *\n * The assigned and optional element shapes come from four live captures. Every\n * captured `completedQuestionnaires` was `[]`, so its elements pass through\n * whole (rule 10) until one is seen.\n *\n * `context` says what a questionnaire hangs off, so it stays; `isProxyAccessing`\n * describes the caller rather than the chart, and the six top-level flags\n * (`showSeriesText`, `showBackButton`, `showPretext`, `messageQnrExpired`,\n * `callingApp`, `sourceActivity`) describe the activity Epic was rendering.\n * `disablePastResponse` and `index` are the same kind of thing on an element.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, textOrNull } from '../../processors/read';\nimport type { AssignedQuestionnaire, GetQuestionnaireList, Questionnaire } from './mychart.types';\nimport type { AssignedQuestionnaireDetailStandard, AssignedQuestionnaireStandard, OptionalQuestionnaireStandard, QuestionnaireStandard, QuestionnairesStandard } from './standardized.types';\n\nexport type { AssignedQuestionnaireStandard, OptionalQuestionnaireStandard, QuestionnaireContextListStandard, QuestionnaireStandard, QuestionnairesStandard } from './standardized.types';\n\nfunction questionnaireOf(q: Questionnaire): QuestionnaireStandard {\n  return {\n    type: num(q.type),\n    isContextSpecific: boolOrNull(q.isContextSpecific),\n    preText: textOrNull(q.preText),\n    postText: textOrNull(q.postText),\n    isPreTextSmartText: boolOrNull(q.isPreTextSmartText),\n    isPostTextSmartText: boolOrNull(q.isPostTextSmartText),\n    status: num(q.status),\n    rootName: textOrNull(q.rootName),\n    id: textOrNull(q.id),\n    name: textOrNull(q.name),\n  };\n}\n\nfunction assignedOf(value: unknown): AssignedQuestionnaireStandard {\n  const entry = rec<AssignedQuestionnaire>(value);\n  return {\n    dueDateISO: textOrNull(entry.dueDateISO),\n    apptDateISO: textOrNull(entry.apptDateISO),\n    isHistory: boolOrNull(entry.isHistory),\n    seriesData: rec(entry.seriesData),\n    hxData: rec(entry.hxData),\n    displayNameOverride: textOrNull(entry.displayNameOverride),\n    isTravelScreening: boolOrNull(entry.isTravelScreening),\n    context: rec(entry.context),\n    questionnaire: assignedQuestionnaireOf(rec<Questionnaire>(entry.questionnaire)),\n  };\n}\n\nfunction assignedQuestionnaireOf(q: Questionnaire): AssignedQuestionnaireDetailStandard {\n  return { ...questionnaireOf(q), filterType: textOrNull(q.filterType) };\n}\nfunction optionalOf(value: unknown): OptionalQuestionnaireStandard {\n  const entry = rec(value);\n  return {\n    description: textOrNull(entry.description),\n    context: rec(entry.context),\n    questionnaire: questionnaireOf(rec<Questionnaire>(entry.questionnaire)),\n  };\n}\n\nexport const questionnairesProcessor: Processor<QuestionnairesStandard> = {\n  standard(raw: RawResponse): QuestionnairesStandard {\n    const body = rec<GetQuestionnaireList>(bodyOf(raw, 'GetQuestionnaireList'));\n    return {\n      assignedQuestionnaires: list(body.assignedQuestionnaires).map(assignedOf),\n      optionalQuestionnaires: list(body.optionalQuestionnaires).map(optionalOf),\n      questionnaireContextLists: list(body.questionnaireContextLists).map((value) => {\n        const contextList = rec(value);\n        return {\n          listContext: rec(contextList.listContext),\n          assignedQuestionnaires: list(contextList.assignedQuestionnaires).map(assignedOf),\n        };\n      }),\n      completedQuestionnaires: list(body.completedQuestionnaires),\n    };\n  },\n  concise(standard) {\n    const named = (q: QuestionnaireStandard) => ({ id: q.id, name: q.name, status: q.status });\n    const assigned = (a: AssignedQuestionnaireStandard) => ({\n      dueDateISO: a.dueDateISO,\n      displayNameOverride: a.displayNameOverride,\n      questionnaire: named(a.questionnaire),\n    });\n    return {\n      assignedQuestionnaires: standard.assignedQuestionnaires.map(assigned),\n      optionalQuestionnaires: standard.optionalQuestionnaires.map((o) => ({\n        description: o.description,\n        questionnaire: named(o.questionnaire),\n      })),\n      questionnaireContextLists: standard.questionnaireContextLists.map((l) => ({\n        assignedQuestionnaires: l.assignedQuestionnaires.map(assigned),\n      })),\n      completedQuestionnaires: standard.completedQuestionnaires,\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { questionnairesProcessor, type QuestionnairesStandard } from './questionnaires.processor';\n\nexport type {\n  QuestionnairesStandard,\n  QuestionnaireStandard,\n  AssignedQuestionnaireStandard,\n  OptionalQuestionnaireStandard,\n  QuestionnaireContextListStandard,\n} from './questionnaires.processor';\nexport { questionnairesProcessor } from './questionnaires.processor';\n\n/**\n * `GET /app/questionnaires` for the token, then `POST /api/questionnaire/GetQuestionnaireList`.\n *\n * The legacy `/Questionnaire` activity this used to call is dead — it answers\n * with Epic's `/Home/Error?code=15` page on all four accounts checked, so the\n * token fetch was the request that failed. The React route answers 200 with the\n * list on the same four, and Epic's own client posts it no request data at all,\n * so the body is `{}`. See README.md.\n */\nexport async function fetchQuestionnairesRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/questionnaires');\n  await collector.postJson('/api/questionnaire/GetQuestionnaireList', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getQuestionnaires(mychartRequest: MyChartRequest): Promise<QuestionnairesStandard> {\n  return questionnairesProcessor.standard(await fetchQuestionnairesRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Care journeys processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_care_journeys`.\n *\n * No captured skeleton: the element names the fake serves are fixture-only,\n * so each journey passes through whole (rule 10). Narrows to name, status and\n * provider once a capture exists.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { list, rec } from '../../processors/read';\n\nexport interface CareJourneysStandard {\n  careJourneys: unknown[];\n}\n\nexport const careJourneysProcessor: Processor<CareJourneysStandard> = {\n  standard(raw: RawResponse): CareJourneysStandard {\n    return { careJourneys: list(rec(bodyOf(raw, 'GetCareJourneys')).careJourneys) };\n  },\n  concise: (standard) => standard,\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { careJourneysProcessor, type CareJourneysStandard } from './careJourneys.processor';\n\nexport type { CareJourneysStandard } from './careJourneys.processor';\nexport { careJourneysProcessor } from './careJourneys.processor';\n\n/** `GET /app/care-journeys` for the token, then `POST /api/care-journeys/GetCareJourneys`. */\nexport async function fetchCareJourneysRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/care-journeys');\n  await collector.postJson('/api/care-journeys/GetCareJourneys', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getCareJourneys(mychartRequest: MyChartRequest): Promise<CareJourneysStandard> {\n  return careJourneysProcessor.standard(await fetchCareJourneysRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Activity feed processor. Field decisions: docs/processor-layer-proposal.md, `get_activity_feed`.\n *\n * `FetchItemFeed` groups items per patient record the account can see under\n * `singleItemFeedViewModels[]`, each with `feedItems` (newer releases split\n * some into `todayItems` / `forYouItems`; all three lists are kept under\n * their own names). `priorityInstant` is epoch milliseconds; the derived\n * `priorityInstantISO` is the readable form, `null` when the item has no\n * instant (MyChart sends `0`).\n *\n * The contact-info nag item's own fields (`phone`, `email`, …), every action's\n * portal link, and the icons are UI; `linkedAccountsViewModel` duplicates\n * `get_linked_accounts`.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { isoFromMs, list, num, rec, textOrNull } from '../../processors/read';\nimport type { FetchItemFeed, PrimaryAction } from './mychart.types';\nimport type { ActivityFeedStandard, FeedItemStandard } from './standardized.types';\n\nexport type { ActivityFeedStandard, FeedItemStandard, FeedViewModelStandard } from './standardized.types';\n\nfunction feedItem(value: unknown): FeedItemStandard {\n  const item = rec(value);\n  const priorityInstant = num(item.priorityInstant);\n  return {\n    identifier: textOrNull(item.identifier),\n    displayText: textOrNull(item.displayText),\n    titleDisplayText: textOrNull(item.titleDisplayText),\n    announcementBody: textOrNull(item.announcementBody),\n    type: textOrNull(item.type),\n    defaultType: textOrNull(item.defaultType),\n    topicId: num(item.topicId),\n    priority: num(item.priority),\n    priorityInstant,\n    priorityInstantISO: priorityInstant !== null && priorityInstant > 0 ? isoFromMs(priorityInstant) : null,\n    groupCount: num(item.groupCount),\n    primaryAction: { uriDisplayText: textOrNull(rec<PrimaryAction>(item.primaryAction).uriDisplayText) },\n  };\n}\n\nexport const activityFeedProcessor: Processor<ActivityFeedStandard> = {\n  standard(raw: RawResponse): ActivityFeedStandard {\n    const body = rec<FetchItemFeed>(bodyOf(raw, 'FetchItemFeed'));\n    return {\n      singleItemFeedViewModels: list(body.singleItemFeedViewModels).map((value) => {\n        const vm = rec(value);\n        return {\n          displayName: textOrNull(vm.displayName),\n          eptId: textOrNull(vm.eptId),\n          feedItems: list(vm.feedItems).map(feedItem),\n          todayItems: list(vm.todayItems).map(feedItem),\n          forYouItems: list(vm.forYouItems).map(feedItem),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    const item = (i: FeedItemStandard) => ({ displayText: i.displayText, priorityInstantISO: i.priorityInstantISO });\n    return {\n      singleItemFeedViewModels: standard.singleItemFeedViewModels.map((vm) => ({\n        displayName: vm.displayName,\n        feedItems: vm.feedItems.map(item),\n        todayItems: vm.todayItems.map(item),\n        forYouItems: vm.forYouItems.map(item),\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { activityFeedProcessor, type ActivityFeedStandard } from './activityFeed.processor';\n\nexport type { ActivityFeedStandard, FeedViewModelStandard, FeedItemStandard } from './activityFeed.processor';\nexport { activityFeedProcessor } from './activityFeed.processor';\n\n/** `GET /app/home` for the token, then `POST /api/item-feed/FetchItemFeed` `{ maxItems: 50, offset: 0 }`. */\nexport async function fetchActivityFeedRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/home');\n  await collector.postJson('/api/item-feed/FetchItemFeed', token, { maxItems: 50, offset: 0 });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getActivityFeed(mychartRequest: MyChartRequest): Promise<ActivityFeedStandard> {\n  return activityFeedProcessor.standard(await fetchActivityFeedRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Education materials processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_education_materials`.\n *\n * `GetPatEducationTitles` is a bare ARRAY of titles, so the standard object is\n * the list itself. Gamification (`numPoints`), thumbnails and the bedside-TV\n * flags are asset / UI / session context.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, textOrNull } from '../../processors/read';\nimport type { GetPatEducationTitles } from './mychart.types';\nimport type { EducationMaterialsStandard } from './standardized.types';\n\nexport type { EducationMaterialStandard, EducationMaterialsStandard } from './standardized.types';\n\nexport const educationMaterialsProcessor: Processor<EducationMaterialsStandard> = {\n  standard(raw: RawResponse): EducationMaterialsStandard {\n    return list(bodyOf(raw, 'GetPatEducationTitles')).map((value) => {\n      const m = rec<GetPatEducationTitles[number]>(value);\n      return {\n        displayName: textOrNull(m.displayName),\n        assignedDate: textOrNull(m.assignedDate),\n        elementId: textOrNull(m.elementId),\n        eduKey: textOrNull(m.eduKey),\n        numTopics: num(m.numTopics),\n        wasAssignedThisVisit: boolOrNull(m.wasAssignedThisVisit),\n        numPagesReviewed: num(m.numPagesReviewed),\n        numPagesUnderstood: num(m.numPagesUnderstood),\n        numPagesQuestions: num(m.numPagesQuestions),\n      };\n    });\n  },\n  concise(standard) {\n    return standard.map((m) => ({ displayName: m.displayName, assignedDate: m.assignedDate }));\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { educationMaterialsProcessor, type EducationMaterialsStandard } from './educationMaterials.processor';\n\nexport type { EducationMaterialsStandard, EducationMaterialStandard } from './educationMaterials.processor';\nexport { educationMaterialsProcessor } from './educationMaterials.processor';\n\n/** `GET /app/education` for the token, then `POST /api/education/GetPatEducationTitles`. */\nexport async function fetchEducationMaterialsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/education');\n  await collector.postJson('/api/education/GetPatEducationTitles', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getEducationMaterials(mychartRequest: MyChartRequest): Promise<EducationMaterialsStandard> {\n  return educationMaterialsProcessor.standard(await fetchEducationMaterialsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * EHI export processor. Field decisions: docs/processor-layer-proposal.md, `get_ehi_export`.\n *\n * `hideAdditionalComments` is form config; `__Status` and\n * `__UpdateableSettings` describe the server's own throttle and queue.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, textOrNull } from '../../processors/read';\nimport type { GetEhiETemplates } from './mychart.types';\nimport type { EhiExportStandard } from './standardized.types';\n\nexport type { EhiExportStandard, EhiTemplateStandard } from './standardized.types';\n\nexport const ehiExportProcessor: Processor<EhiExportStandard> = {\n  standard(raw: RawResponse): EhiExportStandard {\n    const body = rec<GetEhiETemplates>(bodyOf(raw, 'GetEHIETemplates'));\n    return {\n      existingEHIE: boolOrNull(body.existingEHIE),\n      isNoBuildEhie: boolOrNull(body.isNoBuildEhie),\n      ehieTemplates: list(body.ehieTemplates).map((value) => {\n        const t = rec(value);\n        return { name: textOrNull(t.name), description: textOrNull(t.description), id: textOrNull(t.id) };\n      }),\n    };\n  },\n  concise(standard) {\n    return { ehieTemplates: standard.ehieTemplates.map((t) => ({ name: t.name, description: t.description })) };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { ehiExportProcessor, type EhiExportStandard } from './ehiExport.processor';\n\nexport type { EhiExportStandard, EhiTemplateStandard } from './ehiExport.processor';\nexport { ehiExportProcessor } from './ehiExport.processor';\n\n/** `GET /app/release-of-information` for the token, then `POST /api/release-of-information/GetEHIETemplates`. */\nexport async function fetchEhiExportRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/app/release-of-information');\n  await collector.postJson('/api/release-of-information/GetEHIETemplates', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getEhiExportTemplates(mychartRequest: MyChartRequest): Promise<EhiExportStandard> {\n  return ehiExportProcessor.standard(await fetchEhiExportRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Linked accounts processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_linked_accounts`.\n *\n * `LoadCommunityLinks` returns `OrgList` as a map of ~50-field organization\n * records keyed by id; the standard object emits the map's values (the id is\n * on every row as `OrganizationId`). `LastEncounterDetail` is the one clinical\n * fact in the payload and is `null` on an organization with no visit.\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, num, rec, strings, textOrNull } from '../../processors/read';\nimport type { LoadCommunityLinks } from './mychart.types';\nimport type { LastEncounterDetailStandard, LinkedAccountsStandard } from './standardized.types';\n\nexport type { LastEncounterDetailStandard, LinkedAccountsStandard, LinkedOrganizationStandard } from './standardized.types';\n\nfunction lastEncounterDetail(value: unknown): LastEncounterDetailStandard | null {\n  if (value === null || typeof value !== 'object' || Array.isArray(value)) return null;\n  const d = rec(value);\n  return {\n    Patient: textOrNull(d.Patient),\n    Physician: textOrNull(d.Physician),\n    Department: textOrNull(d.Department),\n    Date: textOrNull(d.Date),\n    Time: textOrNull(d.Time),\n  };\n}\n\nexport const linkedAccountsProcessor: Processor<LinkedAccountsStandard> = {\n  standard(raw: RawResponse): LinkedAccountsStandard {\n    const body = rec<LoadCommunityLinks>(bodyOf(raw, 'LoadCommunityLinks'));\n    return {\n      HomeOrgName: textOrNull(body.HomeOrgName),\n      CEOptOut: boolOrNull(body.CEOptOut),\n      ForwardedLinks: list(body.ForwardedLinks),\n      OrgList: Object.values(rec(body.OrgList)).map((value) => {\n        const org = rec(value);\n        return {\n          OrganizationName: textOrNull(org.OrganizationName),\n          LastEncounterDetail: lastEncounterDetail(org.LastEncounterDetail),\n          OrganizationId: textOrNull(org.OrganizationId),\n          LinkType: num(org.LinkType),\n          UserActionStatus: num(org.UserActionStatus),\n          UserMyChartStatus: num(org.UserMyChartStatus),\n          DisplayAddress: strings(org.DisplayAddress),\n          LastAccessTokenDateTime: textOrNull(org.LastAccessTokenDateTime),\n          IsDisabled: boolOrNull(org.IsDisabled),\n          IsInvalidCeLink: boolOrNull(org.IsInvalidCeLink),\n          InvalidLinkReason: num(org.InvalidLinkReason),\n          InvalidLinkRetryDate: textOrNull(org.InvalidLinkRetryDate),\n          ErrorMessage: textOrNull(org.ErrorMessage),\n          NeedCeAuth: boolOrNull(org.NeedCeAuth),\n          LinkErrorCode: textOrNull(org.LinkErrorCode),\n        };\n      }),\n    };\n  },\n  concise(standard) {\n    return {\n      OrgList: standard.OrgList.map((org) => ({\n        OrganizationName: org.OrganizationName,\n        LastEncounterDetail: org.LastEncounterDetail,\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { linkedAccountsProcessor, type LinkedAccountsStandard } from './otherMyCharts.processor';\n\nexport type {\n  LinkedAccountsStandard,\n  LinkedOrganizationStandard,\n  LastEncounterDetailStandard,\n} from './otherMyCharts.processor';\nexport { linkedAccountsProcessor } from './otherMyCharts.processor';\n\n/**\n * `GET /Community/Manage` for the token, then the legacy form-encoded\n * `POST /Community/Shared/LoadCommunityLinks` with the lower-case\n * `__requestverificationtoken` header the page's own JS sends. The\n * cache-buster keeps a repeat call from being served a stale org list.\n */\nexport async function fetchLinkedAccountsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken('/Community/Manage');\n  await collector.send({\n    path: `/Community/Shared/LoadCommunityLinks?noCache=${Math.random()}`,\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n      __requestverificationtoken: token,\n    },\n    body: 'controllerType=2&showDXROrgInMO=false',\n  });\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getLinkedMyChartAccounts(mychartRequest: MyChartRequest): Promise<LinkedAccountsStandard> {\n  return linkedAccountsProcessor.standard(await fetchLinkedAccountsRaw(mychartRequest));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Care` group — everything the care team sends, orders, or assigns. */\n\nimport { fetchCareTeamRaw, careTeamProcessor } from '../../../scrapers/myChart/chart/careTeam/careTeam';\nimport { fetchReferralsRaw, referralsProcessor } from '../../../scrapers/myChart/chart/referrals/referrals';\nimport {\n  fetchLettersRaw,\n  fetchLetterDetailsRaw,\n  lettersProcessor,\n  letterDetailsProcessor,\n} from '../../../scrapers/myChart/chart/letters/letters';\nimport { fetchDocumentsRaw, documentsProcessor } from '../../../scrapers/myChart/chart/documents/documents';\nimport { downloadDocument } from '../../../scrapers/myChart/chart/documents/documentDownload';\nimport { fetchUpcomingOrdersRaw, upcomingOrdersProcessor } from '../../../scrapers/myChart/chart/upcomingOrders/upcomingOrders';\nimport { fetchQuestionnairesRaw, questionnairesProcessor } from '../../../scrapers/myChart/chart/questionnaires/questionnaires';\nimport { fetchCareJourneysRaw, careJourneysProcessor } from '../../../scrapers/myChart/chart/careJourneys/careJourneys';\nimport { fetchActivityFeedRaw, activityFeedProcessor } from '../../../scrapers/myChart/chart/activityFeed/activityFeed';\nimport { fetchEducationMaterialsRaw, educationMaterialsProcessor } from '../../../scrapers/myChart/chart/educationMaterials/educationMaterials';\nimport { fetchEhiExportRaw, ehiExportProcessor } from '../../../scrapers/myChart/chart/ehiExport/ehiExport';\nimport { fetchLinkedAccountsRaw, linkedAccountsProcessor } from '../../../scrapers/myChart/chart/otherMyCharts/otherMyCharts';\nimport { requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const CARE_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_care_team',\n    title: 'Care team',\n    description: 'Providers on the care team, including outside providers, each with their role, specialty and NPI.',\n    kind: 'read',\n    group: 'Care',\n    params: [],\n    run: (request) => fetchCareTeamRaw(request),\n    processor: careTeamProcessor,\n  },\n  {\n    id: 'get_referrals',\n    title: 'Referrals',\n    description: 'Active and past referrals.',\n    kind: 'read',\n    group: 'Care',\n    params: [],\n    run: (request) => fetchReferralsRaw(request),\n    processor: referralsProcessor,\n  },\n  {\n    id: 'get_letters',\n    title: 'Letters',\n    description: 'Letters from providers. Each entry carries the hnoId/csn needed by get_letter_details.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchLettersRaw(request),\n    processor: lettersProcessor,\n  },\n  {\n    id: 'get_letter_details',\n    title: 'Letter contents',\n    description: 'The full contents of one letter listed by get_letters.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [\n      { name: 'hno_id', type: 'string', description: 'hnoId from the chosen get_letters entry.', required: true },\n      { name: 'csn', type: 'string', description: 'csn from the chosen get_letters entry.', required: true },\n    ],\n    run: (request, args) => fetchLetterDetailsRaw(request, requireStr(args, 'hno_id'), requireStr(args, 'csn')),\n    processor: letterDetailsProcessor,\n  },\n  {\n    id: 'get_documents',\n    title: 'Documents',\n    description: 'Clinical documents and visit records.',\n    kind: 'read',\n    group: 'Care',\n    params: [],\n    run: (request) => fetchDocumentsRaw(request),\n    processor: documentsProcessor,\n  },\n  {\n    id: 'download_document',\n    title: 'Download document',\n    description:\n      'Download one Document Center document as the file MyChart serves for it — a PDF, an image (TIF/JPG/PNG) or an e-signed HTML document. ' +\n      'Identify it with the `dcsID` of a document from get_documents. The file is saved on the user’s own device and the path returned.',\n    kind: 'read',\n    group: 'Care',\n    returnsFile: true,\n    params: [\n      { name: 'document_id', type: 'string', required: true, description: 'The `dcsID` of the chosen document from get_documents. Copy it verbatim.' },\n    ],\n    run: (request, args) => downloadDocument(request, requireStr(args, 'document_id')),\n  },\n  {\n    id: 'get_upcoming_orders',\n    title: 'Upcoming orders',\n    description: 'Standing/upcoming orders — labs, imaging and procedures the care team has ordered.',\n    kind: 'read',\n    group: 'Care',\n    params: [],\n    run: (request) => fetchUpcomingOrdersRaw(request),\n    processor: upcomingOrdersProcessor,\n  },\n  {\n    id: 'get_questionnaires',\n    title: 'Questionnaires',\n    description: 'Open and completed questionnaires / health assessments.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchQuestionnairesRaw(request),\n    processor: questionnairesProcessor,\n  },\n  {\n    id: 'get_care_journeys',\n    title: 'Care journeys',\n    description: 'Care journeys and care plans.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchCareJourneysRaw(request),\n    processor: careJourneysProcessor,\n  },\n  {\n    id: 'get_activity_feed',\n    title: 'Activity feed',\n    description: 'Recent account activity feed items.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchActivityFeedRaw(request),\n    processor: activityFeedProcessor,\n  },\n  {\n    id: 'get_education_materials',\n    title: 'Education materials',\n    description: 'Patient education materials assigned by the care team.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchEducationMaterialsRaw(request),\n    processor: educationMaterialsProcessor,\n  },\n  {\n    id: 'get_ehi_export',\n    title: 'EHI export templates',\n    description: 'Electronic Health Information export templates this instance offers.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchEhiExportRaw(request),\n    processor: ehiExportProcessor,\n  },\n  {\n    id: 'get_linked_accounts',\n    title: 'Linked MyChart accounts',\n    description: 'MyChart accounts at other organizations that are linked to this one.',\n    kind: 'read',\n    group: 'Care',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchLinkedAccountsRaw(request),\n    processor: linkedAccountsProcessor,\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Emergency contacts processor. Field decisions: docs/processor-layer-proposal.md,\n * `get_emergency_contacts`.\n *\n * `GetRelationships` keys the list as `contacts`, with the name under\n * `formattedName`, the relationship under `relationToPatient` and the phone\n * numbers under `contactInformation.phoneNumbers`. `isEmergencyContact` is\n * sent by one captured instance only; where an instance omits it the field is\n * `null` (the page is the emergency-contacts page, so absent reads as true,\n * but the processor does not fill in a value MyChart did not send).\n */\n\nimport { bodyOf, type RawResponse } from '../../core/rawResponse';\nimport type { Processor } from '../../processors/processor';\nimport { boolOrNull, list, rec, strings, textOrNull } from '../../processors/read';\nimport type { GetRelationships } from './mychart.types';\nimport type { EmergencyContactsStandard } from './standardized.types';\n\nexport type { EmergencyContactStandard, EmergencyContactsStandard, PhoneNumberStandard } from './standardized.types';\n\nexport const emergencyContactsProcessor: Processor<EmergencyContactsStandard> = {\n  standard(raw: RawResponse): EmergencyContactsStandard {\n    const body = rec<GetRelationships>(bodyOf(raw, 'GetRelationships'));\n    return {\n      hideEmergencyContacts: boolOrNull(body.hideEmergencyContacts),\n      contacts: list(body.contacts).map((value) => {\n        const c = rec(value);\n        const info = rec(c.contactInformation);\n        return {\n          id: textOrNull(c.id),\n          formattedName: textOrNull(c.formattedName),\n          relationToPatient: { name: textOrNull(rec(c.relationToPatient).name) },\n          contactInformation: {\n            phoneNumbers: list(info.phoneNumbers).map((p) => ({\n              phoneNumber: textOrNull(rec(p).phoneNumber),\n              type: textOrNull(rec(p).type),\n            })),\n            emailAddress: textOrNull(info.emailAddress),\n            address: { formattedValues: strings(rec(info.address).formattedValues) },\n          },\n          isPrimaryContact: boolOrNull(c.isPrimaryContact),\n          isEmergencyContact: boolOrNull(c.isEmergencyContact),\n        };\n      }),\n    };\n  },\n  /** One phone number per contact. */\n  concise(standard) {\n    return {\n      contacts: standard.contacts.map((c) => ({\n        id: c.id,\n        formattedName: c.formattedName,\n        relationToPatient: c.relationToPatient,\n        contactInformation: { phoneNumbers: c.contactInformation.phoneNumbers.slice(0, 1) },\n      })),\n    };\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../../core/myChartRequest';\nimport { RawCollector, type RawResponse } from '../../core/rawResponse';\nimport { getRequestVerificationTokenFromBody } from '../../core/util';\nimport { emergencyContactsProcessor, type EmergencyContactsStandard } from './emergencyContacts.processor';\n\nexport type {\n  EmergencyContactsStandard,\n  EmergencyContactStandard,\n  PhoneNumberStandard,\n} from './emergencyContacts.processor';\nexport { emergencyContactsProcessor } from './emergencyContacts.processor';\n\nexport type EmergencyContactInput = {\n  name: string;\n  relationshipType: string;\n  phoneNumber: string;\n};\n\n/**\n * Callers build this from optional capability args, so a field the user didn't\n * supply arrives as an explicit undefined. `updateEmergencyContact` keys the\n * outbound body off `!== undefined`, so those fields stay out of the payload.\n */\nexport type EmergencyContactUpdateInput = {\n  id: string;\n  name?: string | undefined;\n  relationshipType?: string | undefined;\n  phoneNumber?: string | undefined;\n};\n\nexport type EmergencyContactResult = {\n  success: boolean;\n  error?: string;\n};\n\nconst PERSONAL_INFORMATION = '/app/personal-information';\n\n/** `GET /app/personal-information` for the token, then `POST /api/personalInformation/GetRelationships`. */\nexport async function fetchEmergencyContactsRaw(mychartRequest: MyChartRequest): Promise<RawResponse> {\n  const collector = new RawCollector(mychartRequest);\n  const token = await collector.pageToken(PERSONAL_INFORMATION);\n  await collector.postJson('/api/personalInformation/GetRelationships', token, {});\n  return collector.toRaw();\n}\n\n/** The standard object — what `mode: 'json'` returns. */\nexport async function getEmergencyContacts(mychartRequest: MyChartRequest): Promise<EmergencyContactsStandard> {\n  return emergencyContactsProcessor.standard(await fetchEmergencyContactsRaw(mychartRequest));\n}\n\n/** Token for the write endpoints below, or null when the page has none. */\nasync function getToken(mychartRequest: MyChartRequest): Promise<string | null> {\n  const pageResp = await makeAuthenticatedRequest(mychartRequest, { path: PERSONAL_INFORMATION });\n  const html = await pageResp.text();\n  return getRequestVerificationTokenFromBody(html) ?? null;\n}\n\nexport async function addEmergencyContact(\n  mychartRequest: MyChartRequest,\n  input: EmergencyContactInput\n): Promise<EmergencyContactResult> {\n  const token = await getToken(mychartRequest);\n\n  if (!token) {\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/personalInformation/AddRelationship',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify({\n      name: input.name,\n      relationshipType: input.relationshipType,\n      phoneNumber: input.phoneNumber,\n      isEmergencyContact: true,\n    }),\n  });\n\n  if (resp.status === 200) {\n    return { success: true };\n  }\n\n  const text = await resp.text();\n  return { success: false, error: `Add failed with status ${resp.status}: ${text}` };\n}\n\nexport async function updateEmergencyContact(\n  mychartRequest: MyChartRequest,\n  input: EmergencyContactUpdateInput\n): Promise<EmergencyContactResult> {\n  const token = await getToken(mychartRequest);\n\n  if (!token) {\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/personalInformation/UpdateRelationship',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify({\n      id: input.id,\n      ...(input.name !== undefined && { name: input.name }),\n      ...(input.relationshipType !== undefined && { relationshipType: input.relationshipType }),\n      ...(input.phoneNumber !== undefined && { phoneNumber: input.phoneNumber }),\n      isEmergencyContact: true,\n    }),\n  });\n\n  if (resp.status === 200) {\n    return { success: true };\n  }\n\n  const text = await resp.text();\n  return { success: false, error: `Update failed with status ${resp.status}: ${text}` };\n}\n\nexport async function removeEmergencyContact(\n  mychartRequest: MyChartRequest,\n  id: string\n): Promise<EmergencyContactResult> {\n  const token = await getToken(mychartRequest);\n\n  if (!token) {\n    return { success: false, error: 'Could not get verification token' };\n  }\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/personalInformation/RemoveRelationship',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      '__RequestVerificationToken': token,\n    },\n    body: JSON.stringify({ id }),\n  });\n\n  if (resp.status === 200) {\n    return { success: true };\n  }\n\n  const text = await resp.text();\n  return { success: false, error: `Remove failed with status ${resp.status}: ${text}` };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/** The `Emergency contacts` group — read, add, update, remove. */\n\nimport {\n  fetchEmergencyContactsRaw,\n  emergencyContactsProcessor,\n  addEmergencyContact,\n  updateEmergencyContact,\n  removeEmergencyContact,\n} from '../../../scrapers/myChart/chart/emergencyContacts/emergencyContacts';\nimport { optStr, requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const EMERGENCY_CONTACT_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'get_emergency_contacts',\n    title: 'Emergency contacts',\n    description: 'Emergency contacts on file.',\n    kind: 'read',\n    group: 'Emergency contacts',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: (request) => fetchEmergencyContactsRaw(request),\n    processor: emergencyContactsProcessor,\n  },\n  {\n    id: 'add_emergency_contact',\n    title: 'Add an emergency contact',\n    description: 'Add a new emergency contact to the record.',\n    kind: 'write',\n    group: 'Emergency contacts',\n    lessFrequentlyUsed: true,\n    params: [\n      { name: 'name', type: 'string', description: 'Contact’s full name.', required: true },\n      { name: 'relationship_type', type: 'string', description: 'Relationship, e.g. \"Spouse\", \"Parent\", \"Sibling\", \"Friend\".', required: true },\n      { name: 'phone_number', type: 'string', description: 'Contact phone number.', required: true },\n    ],\n    run: (request, args) =>\n      addEmergencyContact(request, {\n        name: requireStr(args, 'name'),\n        relationshipType: requireStr(args, 'relationship_type'),\n        phoneNumber: requireStr(args, 'phone_number'),\n      }),\n  },\n  {\n    id: 'update_emergency_contact',\n    title: 'Update an emergency contact',\n    description: 'Update an existing emergency contact. Only the fields you pass are changed.',\n    kind: 'write',\n    group: 'Emergency contacts',\n    lessFrequentlyUsed: true,\n    params: [\n      { name: 'id', type: 'string', description: 'Contact id from get_emergency_contacts.', required: true },\n      { name: 'name', type: 'string', description: 'New name.' },\n      { name: 'relationship_type', type: 'string', description: 'New relationship.' },\n      { name: 'phone_number', type: 'string', description: 'New phone number.' },\n    ],\n    run: (request, args) =>\n      updateEmergencyContact(request, {\n        id: requireStr(args, 'id'),\n        name: optStr(args, 'name'),\n        relationshipType: optStr(args, 'relationship_type'),\n        phoneNumber: optStr(args, 'phone_number'),\n      }),\n  },\n  {\n    id: 'remove_emergency_contact',\n    title: 'Remove an emergency contact',\n    description: 'Remove an emergency contact by id.',\n    kind: 'write',\n    group: 'Emergency contacts',\n    lessFrequentlyUsed: true,\n    params: [{ name: 'id', type: 'string', description: 'Contact id from get_emergency_contacts.', required: true }],\n    run: (request, args) => removeEmergencyContact(request, requireStr(args, 'id')),\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `Prescriptions` group.\n *\n * `request_refill` is declared and deliberately not implemented — see\n * `scrapers/myChart/chart/medications/REFILL.md` for the endpoint, what the\n * withdrawn scraper sent, and what a real implementation has to confirm first.\n */\n\nimport type { CapabilityImpl } from '../types';\n\nexport const PRESCRIPTION_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'request_refill',\n    title: 'Request a refill',\n    description:\n      'Request a refill for a current medication. NOT IMPLEMENTED: this reads nothing, changes ' +\n      'nothing and submits nothing — the refill request has never been watched reaching a real ' +\n      'pharmacy. Ask the patient to request the refill in MyChart directly.',\n    kind: 'write',\n    group: 'Prescriptions',\n    // A write nobody has ever watched land. The withdrawn scraper posted\n    // `{ medicationKey }` to `/api/medications/RequestRefill`; `medicationKey`\n    // is a field only fake-mychart has ever used, and the captured medications\n    // response names the prescription `id`. The fake answers `{success: true}`\n    // to anything, so the scraper passed its tests while quite possibly sending\n    // a body real MyChart ignores — and a refill that silently does not reach\n    // the pharmacy is a patient who stops taking a medication believing it is\n    // on the way. See REFILL.md for what a real implementation must establish.\n    notImplemented:\n      'request_refill is not implemented: it did nothing, read nothing and changed nothing. The ' +\n      'refill request has never been watched reaching a real pharmacy, so OpenRecord will not ' +\n      'pretend to submit one. Ask the patient to request the refill in MyChart directly. Do not ' +\n      'report this as a completed action.',\n    params: [\n      {\n        name: 'medication_name',\n        type: 'string',\n        description: 'Ignored until this is implemented. Medication name as shown by get_medications.',\n      },\n      {\n        name: 'medication_key',\n        type: 'string',\n        description: 'Ignored until this is implemented. Exact prescription `id` from get_medications.',\n      },\n    ],\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `Patients` group — MyChart proxy access to family members' charts.\n *\n * Thin wrappers over `scrapers/myChart/proxyTools.ts`, which owns the\n * semantics: reads assert which patient they are about and refuse on a\n * mismatch, and only an explicit switch changes MyChart's server-side\n * active patient. Everything below is exempt from that assertion — guarding\n * \"you must already be on patient X\" in front of the tools that list and\n * change X would make them unusable exactly when they are needed.\n */\n\nimport {\n  runListProxyTargets,\n  runSwitchProxyTarget,\n} from '../../../scrapers/myChart/proxy/proxyTools';\nimport { requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const PATIENT_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'list_proxy_targets',\n    aliases: ['list_patients', 'get_active_patient'],\n    title: 'List accessible patient records',\n    description:\n      'List every patient record this MyChart account can access — the account holder plus any family members reachable via proxy access (a parent viewing a child\\'s chart) — and which one is currently active. Data tools always read the ACTIVE record; use switch_proxy_target to change it. Accounts without proxy access return count: 0.',\n    kind: 'read',\n    group: 'Patients',\n    params: [],\n    run: (request) => runListProxyTargets(request),\n  },\n  {\n    id: 'switch_proxy_target',\n    aliases: ['switch_patient'],\n    title: 'Switch the active patient record',\n    description:\n      'Switch which patient\\'s record MyChart is showing (e.g. from the account holder\\'s own chart to a child\\'s). This changes server-side MyChart state: EVERY data tool on this account reads the newly active record afterwards. The switch is verified against the profile page and fails rather than landing on the wrong patient. Pass patient: \"me\" to return to the account holder\\'s own record when done.',\n    kind: 'write',\n    group: 'Patients',\n    params: [\n      {\n        name: 'patient',\n        type: 'string',\n        description: 'Patient name from list_proxy_targets, or \"me\" for the account holder\\'s own record.',\n        required: true,\n      },\n    ],\n    run: (request, args) => runSwitchProxyTarget(request, requireStr(args, 'patient')),\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport { makeAuthenticatedRequest } from '../core/makeAuthenticatedRequest';\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { fetchSessionCsrfToken } from '../core/csrf';\nimport {\n  createCredential,\n  type MyChartCreationOptions,\n  type PasskeyCredential,\n} from './softwareAuthenticator';\nimport { logger } from '../../../shared/logger';\n\n// Deliberately status-only: the headers carry Set-Cookie and the bodies of\n// these endpoints carry WebAuthn challenges, so neither is safe to log.\nfunction logUnexpectedResponse(label: string, resp: Response) {\n  logger.debug(`  ${label} unexpected status: ${resp.status}`);\n}\n\n/**\n * Register a new passkey on a MyChart account.\n *\n * Flow (discovered via Playwright on UCSF MyChart):\n * 1. POST /api/passkey-management/GenerateCreateRequest — get WebAuthn creation options\n * 2. Software authenticator creates credential (replaces navigator.credentials.create)\n * 3. POST /api/passkey-management/CreatePasskey — submit credential to server\n *\n * Requires an active, authenticated session (logged in via password + 2FA first).\n *\n * Returns the PasskeyCredential for local storage, or null if setup fails.\n */\nexport async function setupPasskey(mychartRequest: MyChartRequest): Promise<PasskeyCredential | null> {\n\n  // Get CSRF token for API requests\n  const csrfToken = await fetchSessionCsrfToken(mychartRequest);\n  if (!csrfToken) {\n    logger.debug('  Could not get CSRF token.');\n    return null;\n  }\n\n  const origin = `${mychartRequest.protocol}://${mychartRequest.hostname}`;\n  const apiHeaders: Record<string, string> = {\n    'Content-Type': 'application/json',\n    'Accept': 'application/json',\n    '__RequestVerificationToken': csrfToken,\n    'X-Requested-With': 'XMLHttpRequest',\n    'origin': origin,\n    'Sec-Fetch-Dest': 'empty',\n    'Sec-Fetch-Mode': 'cors',\n    'Sec-Fetch-Site': 'same-origin',\n  };\n\n  // Step 1: Get WebAuthn creation options\n  logger.debug('  Requesting passkey creation options...');\n  const createReqResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/passkey-management/GenerateCreateRequest',\n    method: 'POST',\n    headers: apiHeaders,\n    body: '{}',\n  });\n  if (createReqResp.status !== 200) {\n    logUnexpectedResponse('GenerateCreateRequest', createReqResp);\n    return null;\n  }\n  const createReqResult = await createReqResp.json();\n\n  if (!createReqResult.success && !createReqResult.Success) {\n    logger.debug('  GenerateCreateRequest failed. Keys:', Object.keys(createReqResult).join(', '));\n    return null;\n  }\n\n  const creationOptions: MyChartCreationOptions = createReqResult.data || createReqResult.Data;\n  if (!creationOptions?.challenge) {\n    logger.debug('  Invalid creation options — no challenge in the response.');\n    return null;\n  }\n\n  logger.debug('  Got creation options. RP:', creationOptions.rp.name,\n    ', User:', creationOptions.user.displayName,\n    ', Existing passkeys:', creationOptions.excludeCredentials.length);\n\n  // Step 2: Create credential using software authenticator\n  // Determine the index for the default name (one more than existing count)\n  const indexForDefaultName = creationOptions.excludeCredentials.length + 1;\n\n  const registrationResult = createCredential(creationOptions, origin, indexForDefaultName);\n  logger.debug('  Created software credential. ID:', registrationResult.credential.credentialId.substring(0, 20) + '...');\n\n  // Step 3: Submit credential to MyChart\n  logger.debug('  Registering passkey with MyChart...');\n  const createPasskeyResp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/passkey-management/CreatePasskey',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify(registrationResult.serverResponse),\n  });\n  if (createPasskeyResp.status !== 200) {\n    logUnexpectedResponse('CreatePasskey', createPasskeyResp);\n    return null;\n  }\n\n  const createPasskeyResult = await createPasskeyResp.json();\n  logger.debug('  CreatePasskey response keys:', Object.keys(createPasskeyResult).join(', '));\n\n  // Check for success — the response should contain passkey metadata\n  if (createPasskeyResult.rawId || createPasskeyResult.RawId || createPasskeyResult.success || createPasskeyResult.Success) {\n    logger.debug('  Passkey registered successfully!');\n    return registrationResult.credential;\n  }\n\n  // Some instances might return just the passkey object directly\n  if (createPasskeyResult.name || createPasskeyResult.Name) {\n    logger.debug('  Passkey registered successfully! Name:', createPasskeyResult.name || createPasskeyResult.Name);\n    return registrationResult.credential;\n  }\n\n  logger.debug('  Passkey registration may have failed. Check the response above.');\n  return registrationResult.credential; // Return anyway — the credential was created\n}\n\n/**\n * List passkeys registered on a MyChart account.\n */\nexport async function listPasskeys(mychartRequest: MyChartRequest): Promise<unknown[] | null> {\n  const csrfToken = await fetchSessionCsrfToken(mychartRequest);\n  if (!csrfToken) return null;\n\n  const origin = `${mychartRequest.protocol}://${mychartRequest.hostname}`;\n  const apiHeaders: Record<string, string> = {\n    'Content-Type': 'application/json',\n    'Accept': 'application/json',\n    '__RequestVerificationToken': csrfToken,\n    'X-Requested-With': 'XMLHttpRequest',\n    'origin': origin,\n    'Sec-Fetch-Dest': 'empty',\n    'Sec-Fetch-Mode': 'cors',\n    'Sec-Fetch-Site': 'same-origin',\n  };\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/passkey-management/LoadPasskeyInfo',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ hostname: mychartRequest.hostname }),\n  });\n\n  if (resp.status !== 200) {\n    logUnexpectedResponse('LoadPasskeyInfo', resp);\n    return null;\n  }\n\n  const result = await resp.json();\n  return result.passkeys || result.Passkeys || [];\n}\n\n/**\n * Delete a passkey from a MyChart account.\n */\nexport async function deletePasskey(mychartRequest: MyChartRequest, rawId: string): Promise<boolean> {\n  const csrfToken = await fetchSessionCsrfToken(mychartRequest);\n  if (!csrfToken) return false;\n\n  const origin = `${mychartRequest.protocol}://${mychartRequest.hostname}`;\n  const apiHeaders: Record<string, string> = {\n    'Content-Type': 'application/json',\n    'Accept': 'application/json',\n    '__RequestVerificationToken': csrfToken,\n    'X-Requested-With': 'XMLHttpRequest',\n    'origin': origin,\n    'Sec-Fetch-Dest': 'empty',\n    'Sec-Fetch-Mode': 'cors',\n    'Sec-Fetch-Site': 'same-origin',\n  };\n\n  const resp = await makeAuthenticatedRequest(mychartRequest, {\n    path: '/api/passkey-management/DeletePasskey',\n    method: 'POST',\n    headers: apiHeaders,\n    body: JSON.stringify({ rawId }),\n  });\n\n  if (resp.status !== 200) {\n    logUnexpectedResponse('DeletePasskey', resp);\n    return false;\n  }\n\n  logger.debug('  Passkey deleted successfully.');\n  return true;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `Account security` group.\n *\n * `account` kind: these change how the patient logs in, so no client offers\n * them to a model. They are reachable from the CLI's flags, the desktop\n * extension's setup surface and the mobile app's settings screen.\n */\n\nimport { setupPasskey, listPasskeys, deletePasskey } from '../../../scrapers/myChart/auth/setupPasskey';\nimport { serializeCredential } from '../../../scrapers/myChart/auth/softwareAuthenticator';\nimport { setupTotp, disableTotp } from '../../../scrapers/myChart/auth/setupTotp';\nimport { optStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const ACCOUNT_SECURITY_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'register_passkey',\n    title: 'Register a passkey',\n    description: 'Register a passkey on this MyChart account so future logins skip the password and the 2FA prompt.',\n    kind: 'account',\n    group: 'Account security',\n    // The whole group is a sign-in setting rather than a chart operation, and\n    // the CLI drives all five from dedicated flags (`--set-up-passkey`,\n    // `--set-up-totp`, …) that the help text lists in their own section.\n    lessFrequentlyUsed: true,\n    params: [],\n    run: async (request, _args, ctx) => {\n      const credential = await setupPasskey(request);\n      if (!credential) {\n        throw new Error('MyChart did not return a credential. Some instances disable passkey registration from the patient portal.');\n      }\n      const serialized = serializeCredential(credential);\n      await ctx?.savePasskey?.(serialized);\n      return { registered: true, saved: !!ctx?.savePasskey };\n    },\n  },\n  {\n    id: 'list_passkeys',\n    title: 'List passkeys',\n    description: 'List the passkeys registered on this MyChart account.',\n    kind: 'account',\n    group: 'Account security',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: async (request) => {\n      const passkeys = await listPasskeys(request);\n      if (!passkeys) throw new Error('MyChart would not list passkeys for this account.');\n      return { count: passkeys.length, passkeys };\n    },\n  },\n  {\n    id: 'delete_passkey',\n    title: 'Delete passkeys',\n    description: 'Delete a passkey from the MyChart account by rawId, or every registered passkey when no id is given.',\n    kind: 'account',\n    group: 'Account security',\n    lessFrequentlyUsed: true,\n    params: [{ name: 'raw_id', type: 'string', description: 'rawId from list_passkeys. Omit to delete every passkey on the account.' }],\n    run: async (request, args) => {\n      const rawId = optStr(args, 'raw_id');\n      const passkeys = (await listPasskeys(request)) ?? [];\n      const targets = (rawId ? passkeys.filter((p) => (p as { rawId?: string }).rawId === rawId) : passkeys)\n        .map((p) => (p as { rawId?: string }).rawId)\n        .filter((id): id is string => !!id);\n      if (targets.length === 0) {\n        throw new Error(rawId ? `No passkey with rawId ${rawId}.` : 'No passkeys are registered on this account.');\n      }\n      const deleted: string[] = [];\n      const failed: string[] = [];\n      for (const id of targets) {\n        if (await deletePasskey(request, id)) deleted.push(id);\n        else failed.push(id);\n      }\n      return { deleted, failed };\n    },\n  },\n  {\n    id: 'setup_totp',\n    title: 'Set up an authenticator app',\n    description: 'Turn on authenticator-app (TOTP) two-factor authentication and store the secret locally so future logins can generate their own codes.',\n    kind: 'account',\n    group: 'Account security',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: async (request, _args, ctx) => {\n      if (!ctx?.password) throw new Error('The account password is required to set up TOTP.');\n      const result = await setupTotp(request, ctx.password);\n      if (!result.secret) throw new Error(result.error || 'MyChart did not return a TOTP secret.');\n      await ctx.saveTotpSecret?.(result.secret);\n      return { enabled: true, saved: !!ctx.saveTotpSecret };\n    },\n  },\n  {\n    id: 'disable_totp',\n    title: 'Turn off the authenticator app',\n    description: 'Turn off authenticator-app (TOTP) two-factor authentication on this MyChart account.',\n    kind: 'account',\n    group: 'Account security',\n    lessFrequentlyUsed: true,\n    params: [],\n    run: async (request, _args, ctx) => {\n      if (!ctx?.password) throw new Error('The account password is required to disable TOTP.');\n      if (!ctx.totpSecret) throw new Error('No saved TOTP secret for this account — MyChart requires a current code to turn TOTP off.');\n      const ok = await disableTotp(request, ctx.password, ctx.totpSecret);\n      if (!ok) throw new Error('MyChart rejected the request to disable TOTP.');\n      return { enabled: false };\n    },\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * NPI Registry processors. Field decisions: `scrapers/npi/README.md`.\n *\n * The registry is not MyChart, but the processor-layer rules\n * (`docs/processor-layer-proposal.md`) are about a source's fields rather than\n * about Epic, so they apply unchanged: every field that passes through keeps\n * CMS's own snake_case name and value (rule 2), the four derived fields carry\n * new camelCase names no CMS field uses (rule 3), and membership is by field\n * name rather than by value (rule 6) — so `basic` carries the union of the\n * individual and organization key sets on every provider, and a reader never\n * has to know which of the two shapes came back.\n *\n * Rule 7 is the one that shows up most here: the API answers a refused query\n * with HTTP 200 and an `Errors` array, so that body is returned unchanged in\n * every mode rather than being turned into an empty result set. An unknown but\n * well-formed NPI comes back as zero results, which {@link npiLookupProcessor}\n * passes through as `null` for the same reason.\n *\n * Nothing is dropped for being uninteresting. `endpoints` (a provider's\n * Direct/FHIR addresses) and `other_names` pass through whole because their\n * element key sets vary between records (rule 10), and the two `*_epoch`\n * fields stay because they are NOT duplicates of the date strings beside\n * them — they disagreed on 102 of 883 sampled records, so collapsing them\n * would silently pick a day.\n */\n\nimport { unwrapRaw, type RawResponse } from '../myChart/core/rawResponse';\nimport type { Processor } from '../myChart/processors/processor';\nimport { bool, list, num, rec, textOrNull } from '../myChart/processors/read';\n\n// ── The standard object ─────────────────────────────────────────────────────\n\n/**\n * `basic`, as the union of the two record types' key sets. Rule 6: every name\n * is emitted on every provider, `null` where that record type has no such\n * field, so \"this organization named no authorized official\" and \"this is a\n * person\" are both readable without inspecting `enumeration_type` first.\n */\nexport interface NpiBasicStandard {\n  /** `A` on all 883 records sampled; a non-active provider would show here. */\n  status: string | null;\n  enumeration_date: string | null;\n  last_updated: string | null;\n  certification_date: string | null;\n  first_name: string | null;\n  middle_name: string | null;\n  last_name: string | null;\n  name_prefix: string | null;\n  name_suffix: string | null;\n  credential: string | null;\n  sex: string | null;\n  sole_proprietor: string | null;\n  organization_name: string | null;\n  organizational_subpart: string | null;\n  parent_organization_legal_business_name: string | null;\n  authorized_official_first_name: string | null;\n  authorized_official_middle_name: string | null;\n  authorized_official_last_name: string | null;\n  authorized_official_name_prefix: string | null;\n  authorized_official_name_suffix: string | null;\n  authorized_official_credential: string | null;\n  authorized_official_title_or_position: string | null;\n  authorized_official_telephone_number: string | null;\n}\n\nexport interface NpiTaxonomyStandard {\n  code: string | null;\n  desc: string | null;\n  primary: boolean;\n  license: string | null;\n  state: string | null;\n  /** Populated on 323 of 1368 sampled taxonomies, so not an always-empty field. */\n  taxonomy_group: string | null;\n}\n\nexport interface NpiAddressStandard {\n  address_purpose: string | null;\n  address_type: string | null;\n  address_1: string | null;\n  address_2: string | null;\n  city: string | null;\n  state: string | null;\n  postal_code: string | null;\n  country_code: string | null;\n  country_name: string | null;\n  telephone_number: string | null;\n  fax_number: string | null;\n}\n\nexport interface NpiIdentifierStandard {\n  identifier: string | null;\n  code: string | null;\n  desc: string | null;\n  issuer: string | null;\n  state: string | null;\n}\n\nexport interface NpiProviderStandard {\n  /** The handle every other lookup takes as input (rule 5). */\n  number: string | null;\n  /** `NPI-1` for a person, `NPI-2` for an organization or a subpart. */\n  enumeration_type: string | null;\n  /** Derived: the display name. CMS stores a person's in parts and no whole. */\n  providerName: string;\n  /** Derived: the primary taxonomy's `desc` — \"what kind of provider\". */\n  primarySpecialty: string;\n  /** Derived: the practice address on one line. */\n  primaryAddress: string;\n  /** Derived: that address's phone number. */\n  primaryPhone: string;\n  basic: NpiBasicStandard;\n  taxonomies: NpiTaxonomyStandard[];\n  addresses: NpiAddressStandard[];\n  practiceLocations: NpiAddressStandard[];\n  identifiers: NpiIdentifierStandard[];\n  /** Uncaptured element shape (person and organization keys differ); whole. */\n  other_names: unknown[];\n  /** Uncaptured element shape (14–18 keys across sampled records); whole. */\n  endpoints: unknown[];\n  /** Not a duplicate of `enumeration_date`: the two disagreed on 102/883. */\n  created_epoch: string | null;\n  last_updated_epoch: string | null;\n}\n\nexport interface NpiSearchStandard {\n  result_count: number | null;\n  results: NpiProviderStandard[];\n}\n\n/** One entry of the API's `Errors` array. */\nexport interface NpiRegistryApiError {\n  field?: unknown;\n  description?: unknown;\n  number?: unknown;\n}\n\n/** A refused query, passed through unchanged in every mode (rule 7). */\nexport interface NpiRegistryErrors {\n  Errors: NpiRegistryApiError[];\n}\n\nexport function isNpiRegistryErrors(value: unknown): value is NpiRegistryErrors {\n  return typeof value === 'object' && value !== null && Array.isArray((value as NpiRegistryErrors).Errors);\n}\n\n// ── Field mapping ───────────────────────────────────────────────────────────\n\nfunction joinWords(parts: Array<string | null>): string {\n  return parts.filter((p): p is string => typeof p === 'string' && p.trim() !== '').join(' ');\n}\n\nfunction toBasic(value: unknown): NpiBasicStandard {\n  const b = rec(value);\n  return {\n    status: textOrNull(b.status),\n    enumeration_date: textOrNull(b.enumeration_date),\n    last_updated: textOrNull(b.last_updated),\n    certification_date: textOrNull(b.certification_date),\n    first_name: textOrNull(b.first_name),\n    middle_name: textOrNull(b.middle_name),\n    last_name: textOrNull(b.last_name),\n    name_prefix: textOrNull(b.name_prefix),\n    name_suffix: textOrNull(b.name_suffix),\n    credential: textOrNull(b.credential),\n    sex: textOrNull(b.sex),\n    sole_proprietor: textOrNull(b.sole_proprietor),\n    organization_name: textOrNull(b.organization_name),\n    organizational_subpart: textOrNull(b.organizational_subpart),\n    parent_organization_legal_business_name: textOrNull(b.parent_organization_legal_business_name),\n    authorized_official_first_name: textOrNull(b.authorized_official_first_name),\n    authorized_official_middle_name: textOrNull(b.authorized_official_middle_name),\n    authorized_official_last_name: textOrNull(b.authorized_official_last_name),\n    authorized_official_name_prefix: textOrNull(b.authorized_official_name_prefix),\n    authorized_official_name_suffix: textOrNull(b.authorized_official_name_suffix),\n    authorized_official_credential: textOrNull(b.authorized_official_credential),\n    authorized_official_title_or_position: textOrNull(b.authorized_official_title_or_position),\n    authorized_official_telephone_number: textOrNull(b.authorized_official_telephone_number),\n  };\n}\n\nfunction toTaxonomy(value: unknown): NpiTaxonomyStandard {\n  const t = rec(value);\n  return {\n    code: textOrNull(t.code),\n    desc: textOrNull(t.desc),\n    primary: bool(t.primary),\n    license: textOrNull(t.license),\n    state: textOrNull(t.state),\n    taxonomy_group: textOrNull(t.taxonomy_group),\n  };\n}\n\nfunction toAddress(value: unknown): NpiAddressStandard {\n  const a = rec(value);\n  return {\n    address_purpose: textOrNull(a.address_purpose),\n    address_type: textOrNull(a.address_type),\n    address_1: textOrNull(a.address_1),\n    address_2: textOrNull(a.address_2),\n    city: textOrNull(a.city),\n    state: textOrNull(a.state),\n    postal_code: textOrNull(a.postal_code),\n    country_code: textOrNull(a.country_code),\n    country_name: textOrNull(a.country_name),\n    telephone_number: textOrNull(a.telephone_number),\n    fax_number: textOrNull(a.fax_number),\n  };\n}\n\nfunction toIdentifier(value: unknown): NpiIdentifierStandard {\n  const i = rec(value);\n  return {\n    identifier: textOrNull(i.identifier),\n    code: textOrNull(i.code),\n    desc: textOrNull(i.desc),\n    issuer: textOrNull(i.issuer),\n    state: textOrNull(i.state),\n  };\n}\n\n/**\n * The display name. An organization has one already; a person is stored in\n * parts and never as a whole, so this is the one place the parts are joined.\n * The credential trails after a comma, the way the registry's own result page\n * renders it.\n */\nfunction providerNameOf(basic: NpiBasicStandard, enumerationType: string | null): string {\n  if (enumerationType === 'NPI-2') return basic.organization_name ?? '';\n  const name = joinWords([basic.first_name, basic.middle_name, basic.last_name, basic.name_suffix]);\n  return basic.credential ? `${name}, ${basic.credential}` : name;\n}\n\n/**\n * The address a patient would go to: the `LOCATION` one, falling back to\n * whatever came first when a record has no `LOCATION` entry.\n */\nfunction primaryAddressOf(addresses: NpiAddressStandard[]): NpiAddressStandard | undefined {\n  return addresses.find((a) => a.address_purpose?.toUpperCase() === 'LOCATION') ?? addresses[0];\n}\n\nfunction addressLine(address: NpiAddressStandard | undefined): string {\n  if (!address) return '';\n  const street = joinWords([address.address_1, address.address_2]);\n  const region = joinWords([address.state, address.postal_code]);\n  return [street, address.city, region].filter((p) => p !== '').join(', ');\n}\n\nfunction toProviderStandard(value: unknown): NpiProviderStandard {\n  const r = rec(value);\n  const basic = toBasic(r.basic);\n  const enumerationType = textOrNull(r.enumeration_type);\n  const taxonomies = list(r.taxonomies).map(toTaxonomy);\n  const addresses = list(r.addresses).map(toAddress);\n  const primary = primaryAddressOf(addresses);\n\n  return {\n    number: textOrNull(r.number),\n    enumeration_type: enumerationType,\n    providerName: providerNameOf(basic, enumerationType),\n    primarySpecialty: (taxonomies.find((t) => t.primary) ?? taxonomies[0])?.desc ?? '',\n    primaryAddress: addressLine(primary),\n    primaryPhone: primary?.telephone_number ?? '',\n    basic,\n    taxonomies,\n    addresses,\n    practiceLocations: list(r.practiceLocations).map(toAddress),\n    identifiers: list(r.identifiers).map(toIdentifier),\n    other_names: list(r.other_names),\n    endpoints: list(r.endpoints),\n    created_epoch: textOrNull(r.created_epoch),\n    last_updated_epoch: textOrNull(r.last_updated_epoch),\n  };\n}\n\n/** The concise row: who, what kind, where, and the handle to look them up by. */\nfunction conciseProvider(provider: NpiProviderStandard) {\n  return {\n    number: provider.number,\n    providerName: provider.providerName,\n    enumeration_type: provider.enumeration_type,\n    primarySpecialty: provider.primarySpecialty,\n    primaryAddress: provider.primaryAddress,\n    primaryPhone: provider.primaryPhone,\n  };\n}\n\n// ── Processors ──────────────────────────────────────────────────────────────\n\n/**\n * The search payload. A refusal (`Errors`) passes through untouched in every\n * mode — its `description` is a complete sentence about what was wrong with\n * the query, which is worth far more to the caller than an empty result set.\n */\nexport const npiSearchProcessor: Processor<NpiSearchStandard | NpiRegistryErrors> = {\n  standard(raw: RawResponse): NpiSearchStandard | NpiRegistryErrors {\n    const body = unwrapRaw(raw);\n    if (isNpiRegistryErrors(body)) return body;\n    const b = rec(body);\n    return {\n      result_count: num(b.result_count),\n      results: list(b.results).map(toProviderStandard),\n    };\n  },\n  concise(standard) {\n    if (isNpiRegistryErrors(standard)) return standard;\n    return {\n      result_count: standard.result_count,\n      results: standard.results.map(conciseProvider),\n    };\n  },\n};\n\n/**\n * One NPI's provider, or `null` when the registry has nobody by that number.\n * A well-formed unknown NPI is answered with zero results rather than an\n * error, and `null` is how that reaches the caller in every mode (rule 7).\n */\nexport const npiLookupProcessor: Processor<NpiProviderStandard | NpiRegistryErrors | null> = {\n  standard(raw: RawResponse): NpiProviderStandard | NpiRegistryErrors | null {\n    const body = unwrapRaw(raw);\n    if (isNpiRegistryErrors(body)) return body;\n    const first = list(rec(body).results)[0];\n    return first === undefined ? null : toProviderStandard(first);\n  },\n  concise(standard) {\n    if (standard === null || isNpiRegistryErrors(standard)) return standard;\n    return conciseProvider(standard);\n  },\n};\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The NPI Registry — CMS's public directory of every US healthcare provider.\n *\n * A National Provider Identifier is the 10-digit number Medicare, insurers and\n * MyChart itself use to name a clinician or an organization. MyChart hands a\n * few of them out (the care team's provider bios carry `npi`; its\n * `NationalProviderID` field is an encrypted token) and names many more\n * providers without one (visits, notes, letters, message senders). This scraper goes in both directions:\n *\n *  - {@link fetchNpiLookupRaw} — an NPI, to the provider it belongs to.\n *  - {@link fetchNpiSearchRaw} — a name, specialty and/or place, to the\n *    providers that match.\n *\n * Network only, like every scraper under the processor layer: these return the\n * {@link RawResponse} envelope and `npiRegistry.processor.ts` decides what a\n * caller sees. The envelope type and its helpers live under `myChart/core/`\n * because that is where the processor layer put them; nothing in them is\n * Epic-specific, and reusing them is what lets the registry capabilities take\n * the same `mode` parameter as every MyChart read.\n *\n * `RawCollector` itself is not reused: it wraps `makeAuthenticatedRequest`,\n * whose whole job is MyChart session expiry and the active-patient restore.\n * There is no session here — the registry takes no key, no login and no\n * cookies — so these build the one record they make directly, still through\n * `scraperFetch` so the per-host permit and the test transport apply.\n *\n * ## Where the data comes from\n *\n * The registry's search page is a front end for a public JSON API at\n * `npiregistry.cms.hhs.gov/api/`. The same data is published as a bulk file —\n * about 1.1 GB zipped and ~10 GB of CSV, refreshed monthly with weekly deltas —\n * which is why nothing is bundled: it would not fit in any client, and the API\n * is live where the file is up to a month stale.\n *\n * ## What the API enforces (observed 2026-09, version 2.1)\n *\n *  - At most {@link NPI_REGISTRY_MAX_PAGE_SIZE} results per page. A larger\n *    `limit` is silently clamped, and `0` silently becomes the default 10.\n *  - `skip` pages through further results; the documented ceiling is\n *    {@link NPI_REGISTRY_MAX_SKIP}, so a query can yield 1,200 results at\n *    most. Narrow it rather than paging past that.\n *  - A trailing `*` wildcard is allowed on names after two or more leading\n *    characters (`Jo*` works, `J*` is refused).\n *  - `state` and `enumeration_type` are refused on their own; every other\n *    criterion may stand alone. No criteria at all is refused too.\n *  - Refusals come back as HTTP 200 with an `Errors` array rather than a\n *    non-2xx status. That body reaches the caller unchanged — see the\n *    processor's rule 7 note.\n */\n\nimport { scraperFetch } from '../http';\nimport type { RawRequestRecord, RawResponse } from '../myChart/core/rawResponse';\nimport {\n  npiLookupProcessor,\n  npiSearchProcessor,\n  type NpiProviderStandard,\n  type NpiRegistryErrors,\n  type NpiSearchStandard,\n} from './npiRegistry.processor';\n\nexport type {\n  NpiAddressStandard,\n  NpiBasicStandard,\n  NpiIdentifierStandard,\n  NpiProviderStandard,\n  NpiRegistryApiError,\n  NpiRegistryErrors,\n  NpiSearchStandard,\n  NpiTaxonomyStandard,\n} from './npiRegistry.processor';\nexport { isNpiRegistryErrors, npiLookupProcessor, npiSearchProcessor } from './npiRegistry.processor';\n\n/** The registry's JSON API. Overridable so a fake can stand in for it. */\nexport const NPI_REGISTRY_API_URL = 'https://npiregistry.cms.hhs.gov/api/';\n\n/** The only API version the registry currently serves. */\nexport const NPI_REGISTRY_API_VERSION = '2.1';\n\n/** The largest page the API will return; anything higher is clamped to this. */\nexport const NPI_REGISTRY_MAX_PAGE_SIZE = 200;\n\n/** The documented ceiling on `skip`. */\nexport const NPI_REGISTRY_MAX_SKIP = 1000;\n\n/** The API's default page size, used when a caller asks for none. */\nexport const NPI_REGISTRY_DEFAULT_PAGE_SIZE = 10;\n\n/** `NPI-1` is a person; `NPI-2` is an organization or one of its subparts. */\nexport type NpiProviderType = 'individual' | 'organization';\n\nexport interface NpiSearchQuery {\n  /** Exact, or a trailing `*` after two or more characters. Individuals only. */\n  firstName?: string;\n  /** Exact, or a trailing `*` after two or more characters. Individuals only. */\n  lastName?: string;\n  /** Exact, or a trailing `*` after two or more characters. Organizations only. */\n  organizationName?: string;\n  /** Matched against taxonomy descriptions, e.g. \"Cardiology\" or \"Dentist\". */\n  specialty?: string;\n  city?: string;\n  /** Two-letter code. The API refuses it without another criterion. */\n  state?: string;\n  /** Five or nine digits; a trailing `*` works here too. */\n  postalCode?: string;\n  /** Restrict to people or to organizations. Refused on its own by the API. */\n  type?: NpiProviderType;\n  /** 1–{@link NPI_REGISTRY_MAX_PAGE_SIZE}; defaults to the API's 10. */\n  limit?: number;\n  /** Offset into the results, for paging. */\n  skip?: number;\n}\n\nexport interface NpiRegistryOptions {\n  /** Where the API lives. Defaults to {@link NPI_REGISTRY_API_URL}. */\n  apiUrl?: string;\n}\n\n// ── NPI validation ──────────────────────────────────────────────────────────\n\n/**\n * Whether a string is a well-formed NPI: ten digits whose last one is the\n * right Luhn check digit.\n *\n * The check digit is computed over the number with the constant prefix\n * `80840` in front (the ISO card-issuer identifier assigned to CMS), which is\n * what makes an NPI verifiable offline. A typo or a transposed pair fails\n * this, so {@link fetchNpiLookupRaw} refuses a bad number before spending a\n * request on it.\n */\nexport function isValidNpi(value: string): boolean {\n  if (!/^\\d{10}$/.test(value)) return false;\n  const digits = `80840${value}`;\n  let sum = 0;\n  for (let i = digits.length - 1, position = 0; i >= 0; i--, position++) {\n    let d = Number(digits[i]);\n    if (position % 2 === 1) {\n      d *= 2;\n      if (d > 9) d -= 9;\n    }\n    sum += d;\n  }\n  return sum % 10 === 0;\n}\n\n// ── The request ─────────────────────────────────────────────────────────────\n\n/**\n * The query-string parameter for each field of {@link NpiSearchQuery}, in the\n * registry's own names.\n */\nconst QUERY_PARAMS: ReadonlyArray<readonly [keyof NpiSearchQuery, string]> = [\n  ['firstName', 'first_name'],\n  ['lastName', 'last_name'],\n  ['organizationName', 'organization_name'],\n  ['specialty', 'taxonomy_description'],\n  ['city', 'city'],\n  ['state', 'state'],\n  ['postalCode', 'postal_code'],\n];\n\nfunction clampPageSize(limit: number | undefined): number {\n  if (limit === undefined || !Number.isFinite(limit)) return NPI_REGISTRY_DEFAULT_PAGE_SIZE;\n  return Math.min(NPI_REGISTRY_MAX_PAGE_SIZE, Math.max(1, Math.floor(limit)));\n}\n\n/**\n * Build the search URL for a query. Exported so a test can check the mapping\n * without a transport, and so a caller can see exactly what will be sent.\n *\n * Throws before any request when the query names nothing to search for, so a\n * caller gets the same refusal the API would give without the round trip.\n * The API's other rules (state alone, wildcard length) are left to the API,\n * whose wording is the authority on them and reaches the caller intact.\n */\nexport function buildNpiSearchUrl(query: NpiSearchQuery, apiUrl: string = NPI_REGISTRY_API_URL): string {\n  const url = new URL(apiUrl);\n  url.searchParams.set('version', NPI_REGISTRY_API_VERSION);\n\n  let criteria = 0;\n  for (const [field, param] of QUERY_PARAMS) {\n    const value = query[field];\n    if (typeof value !== 'string') continue;\n    const trimmed = value.trim();\n    if (!trimmed) continue;\n    url.searchParams.set(param, trimmed);\n    criteria++;\n  }\n  if (query.type) {\n    url.searchParams.set('enumeration_type', query.type === 'organization' ? 'NPI-2' : 'NPI-1');\n  }\n  if (criteria === 0) {\n    throw new Error(\n      'NPI Registry search needs at least one of: firstName, lastName, organizationName, specialty, city, state, postalCode.',\n    );\n  }\n\n  url.searchParams.set('limit', String(clampPageSize(query.limit)));\n  const skip = query.skip !== undefined && Number.isFinite(query.skip) ? Math.max(0, Math.floor(query.skip)) : 0;\n  if (skip > 0) url.searchParams.set('skip', String(skip));\n\n  return url.toString();\n}\n\n/**\n * Make the one request and record it into the envelope, the way\n * `RawCollector.send` records a MyChart one: the parsed JSON when the body\n * parses, the text otherwise.\n *\n * Throws on a non-2xx status and on a body that is not JSON at all. Neither is\n * a refusal — the registry refuses with HTTP 200 and an `Errors` array, which\n * is data and passes through — so both mean the endpoint is not answering, and\n * recording an HTML maintenance page as a provider list would show a caller\n * \"no such doctor\".\n */\nasync function collect(url: string): Promise<RawResponse> {\n  const response = await scraperFetch(url, { headers: { Accept: 'application/json' } });\n  const text = await response.text();\n  if (!response.ok) {\n    throw new Error(`NPI Registry request failed: ${response.status} ${response.statusText}`);\n  }\n\n  let body: unknown;\n  try {\n    body = JSON.parse(text);\n  } catch {\n    throw new Error('NPI Registry response was not JSON — the endpoint shape changed.');\n  }\n\n  const record: RawRequestRecord = {\n    path: url,\n    method: 'GET',\n    status: response.status,\n    contentType: response.headers.get('content-type') ?? '',\n    body,\n  };\n  return { requests: [record] };\n}\n\n/** Search the registry by name, specialty and/or place. One page per call. */\nexport async function fetchNpiSearchRaw(\n  query: NpiSearchQuery,\n  options: NpiRegistryOptions = {},\n): Promise<RawResponse> {\n  return collect(buildNpiSearchUrl(query, options.apiUrl));\n}\n\n/**\n * Look up one NPI.\n *\n * Throws on a malformed number without making a request: a wrong length or a\n * failed check digit is a typo, and the registry would only say the same thing\n * more slowly. A well-formed number nobody holds is not an error — it comes\n * back as zero results and the processor renders that as `null`.\n */\nexport async function fetchNpiLookupRaw(npi: string, options: NpiRegistryOptions = {}): Promise<RawResponse> {\n  const number = npi.trim();\n  if (!isValidNpi(number)) {\n    throw new Error(`\"${npi}\" is not a valid NPI — expected ten digits with a correct check digit.`);\n  }\n  const url = new URL(options.apiUrl ?? NPI_REGISTRY_API_URL);\n  url.searchParams.set('version', NPI_REGISTRY_API_VERSION);\n  url.searchParams.set('number', number);\n  return collect(url.toString());\n}\n\n// ── The standard object — what `mode: 'json'` returns ───────────────────────\n\n/**\n * Find providers by name, specialty and/or place.\n *\n * Names match exactly unless they end in `*`, and the registry stores most of\n * them in upper case — matching is case-insensitive, so send what the patient\n * wrote. `specialty` matches against taxonomy descriptions, so \"Cardiology\"\n * finds \"Internal Medicine, Cardiovascular Disease\" but a made-up label finds\n * nothing. A refused query comes back as {@link NpiRegistryErrors}; narrow\n * with `isNpiRegistryErrors`.\n */\nexport async function searchNpiRegistry(\n  query: NpiSearchQuery,\n  options: NpiRegistryOptions = {},\n): Promise<NpiSearchStandard | NpiRegistryErrors> {\n  return npiSearchProcessor.standard(await fetchNpiSearchRaw(query, options));\n}\n\n/** Look up one NPI. `null` when the registry has nobody by that number. */\nexport async function lookupNpi(\n  npi: string,\n  options: NpiRegistryOptions = {},\n): Promise<NpiProviderStandard | NpiRegistryErrors | null> {\n  return npiLookupProcessor.standard(await fetchNpiLookupRaw(npi, options));\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `Providers` group — CMS's NPI Registry, in both directions.\n *\n * `public`-kind, and the first group in the registry that is: no MyChart\n * account, no login, no patient. Their `run` takes only arguments — see\n * `PublicCapabilityImpl` — so they are structurally unable to touch a chart,\n * which is why `executeCapability` exempts them from the active-patient\n * assertion rather than trusting each entry not to.\n *\n * Otherwise ordinary reads: the scrapers return a `RawResponse` and the\n * processors give them the same four modes every chart read has.\n */\n\nimport {\n  fetchNpiLookupRaw,\n  fetchNpiSearchRaw,\n  npiLookupProcessor,\n  npiSearchProcessor,\n  NPI_REGISTRY_MAX_PAGE_SIZE,\n  NPI_REGISTRY_MAX_SKIP,\n  type NpiSearchQuery,\n} from '../../../scrapers/npi/npiRegistry';\nimport { num, optStr, requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const PROVIDER_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'lookup_npi',\n    title: 'Look up an NPI',\n    description:\n      'Look up a US healthcare provider by National Provider Identifier — the 10-digit number MyChart, Medicare and insurers use to name a clinician or organization. Public data; no MyChart account needed.',\n    kind: 'public',\n    group: 'Providers',\n    params: [\n      {\n        name: 'npi',\n        type: 'string',\n        description:\n          'The 10-digit National Provider Identifier — get_care_team returns each provider\\'s as ' +\n          \"`npi` (its NationalProviderID field is an Epic-encrypted token, not an NPI). For a \" +\n          'provider named anywhere else in a chart, search_npi_registry turns a name into an NPI.',\n        required: true,\n      },\n    ],\n    run: (args) => fetchNpiLookupRaw(requireStr(args, 'npi')),\n    processor: npiLookupProcessor,\n  },\n  {\n    id: 'search_npi_registry',\n    title: 'Search the NPI Registry',\n    description:\n      \"Find US healthcare providers by name, specialty and/or place in CMS's public NPI Registry — the way to turn a provider name from a chart into an NPI, an address and a specialty. At least one search criterion is required. Public data; no MyChart account needed.\",\n    kind: 'public',\n    group: 'Providers',\n    params: [\n      {\n        name: 'first_name',\n        type: 'string',\n        description: \"An individual's first name. Exact, or a trailing `*` after two or more characters.\",\n      },\n      {\n        name: 'last_name',\n        type: 'string',\n        description: \"An individual's last name. Exact, or a trailing `*` after two or more characters.\",\n      },\n      {\n        name: 'organization_name',\n        type: 'string',\n        description:\n          \"An organization's legal business name. Exact, or a trailing `*` after two or more characters.\",\n      },\n      {\n        name: 'specialty',\n        type: 'string',\n        description: 'Matched against taxonomy descriptions, e.g. \"Cardiology\" or \"Dentist\".',\n      },\n      { name: 'city', type: 'string', description: 'City of the practice or mailing address.' },\n      {\n        name: 'state',\n        type: 'string',\n        description:\n          'Two-letter state code. The registry refuses this on its own — pair it with another criterion.',\n      },\n      {\n        name: 'postal_code',\n        type: 'string',\n        description: 'Five or nine digits; a trailing `*` works here too.',\n      },\n      {\n        name: 'type',\n        type: 'string',\n        description:\n          'Restrict to \"individual\" (a person) or \"organization\". Refused on its own by the registry.',\n      },\n      {\n        name: 'limit',\n        type: 'number',\n        description: `Results per page, 1–${NPI_REGISTRY_MAX_PAGE_SIZE}. Defaults to the registry's 10.`,\n        min: 1,\n        max: NPI_REGISTRY_MAX_PAGE_SIZE,\n      },\n      {\n        name: 'skip',\n        type: 'number',\n        description: `Offset into the results, for paging. At most ${NPI_REGISTRY_MAX_SKIP}; narrow the query rather than paging past it.`,\n        min: 0,\n        max: NPI_REGISTRY_MAX_SKIP,\n      },\n    ],\n    run: (args) => {\n      const query: NpiSearchQuery = {};\n      // Only the fields the caller actually gave: `buildNpiSearchUrl` counts\n      // them to decide whether the query names anything to search for, and an\n      // empty string is not a criterion.\n      const firstName = optStr(args, 'first_name');\n      if (firstName) query.firstName = firstName;\n      const lastName = optStr(args, 'last_name');\n      if (lastName) query.lastName = lastName;\n      const organizationName = optStr(args, 'organization_name');\n      if (organizationName) query.organizationName = organizationName;\n      const specialty = optStr(args, 'specialty');\n      if (specialty) query.specialty = specialty;\n      const city = optStr(args, 'city');\n      if (city) query.city = city;\n      const state = optStr(args, 'state');\n      if (state) query.state = state;\n      const postalCode = optStr(args, 'postal_code');\n      if (postalCode) query.postalCode = postalCode;\n\n      const type = optStr(args, 'type');\n      if (type) {\n        // A misspelled type is a caller error, not a reason to silently search\n        // both: \"organisation\" would otherwise widen the search rather than\n        // narrowing it, and the caller would never know.\n        if (type !== 'individual' && type !== 'organization') {\n          throw new Error(`Unknown type ${JSON.stringify(type)}. Expected \"individual\" or \"organization\".`);\n        }\n        query.type = type;\n      }\n      if (optNum(args.limit)) query.limit = num(args, 'limit', NPI_REGISTRY_MAX_PAGE_SIZE);\n      if (optNum(args.skip)) query.skip = num(args, 'skip', 0);\n\n      return fetchNpiSearchRaw(query);\n    },\n    processor: npiSearchProcessor,\n  },\n];\n\n/**\n * Whether a numeric argument was given at all.\n *\n * `NpiSearchQuery`'s fields are optional and `exactOptionalPropertyTypes` is\n * on, so an omitted `limit` has to stay an absent key rather than becoming\n * `undefined` — and the scraper's own defaults (the registry's 10, skip 0)\n * only apply to a key that isn't there.\n */\nfunction optNum(value: unknown): boolean {\n  return value !== undefined && value !== null && value !== '';\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Where an organization's MyChart login actually is, starting from the URL\n * Epic's directory publishes for it.\n *\n * Usually that URL is the portal. Sometimes it is the health system's own\n * website — UCSF's is `www.ucsfhealth.org/ucsfmychart/`, an information page —\n * and a search that hands back that hostname sends the user to a login that\n * can never succeed. Those pages nearly always link to the real portal, so:\n *\n *   1. follow the directory URL; if it lands on a MyChart login page, it's right;\n *   2. otherwise take the MyChart links on the page it landed on, and keep the\n *      first one that itself serves a MyChart login page;\n *   3. otherwise it's `down`: we couldn't confirm it was up when we checked,\n *      whatever the reason. The caller keeps Epic's URL.\n *\n * Every request is one an unauthenticated browser makes opening the page.\n */\n\nimport { extractMountsFromLinks, looksLikeLoginPage } from '../myChart/auth/login';\nimport { MyChartRequest } from '../myChart/core/myChartRequest';\n\nconst MAX_HOPS = 5;\n\n/** Links tried per page, in the ranking's order. */\nconst MAX_CANDIDATES = 5;\n\n/**\n * A health system's own MyChart page is mostly its site navigation\n * (`/locations`, `/contact-us`), which can fill every slot above before the one\n * portal link on another host is reached (UCHealth). So portal-looking links\n * further down get tried too — after, not instead: promoting them outright\n * picked Evangelical's bill-pay portal over the one its page signs in through.\n */\nconst READS_AS_PORTAL = /mychart|chart|portal|epic/i;\n\n/**\n * One organization's whole resolution. `scraperFetch` gives each request two\n * minutes, which across 1,400 organizations is a refresh nobody waits out.\n */\nconst RESOLVE_TIMEOUT_MS = 60_000;\n\nexport type LoginUrlResolution =\n  | { kind: 'login' }\n  | { kind: 'linked'; url: string }\n  | { kind: 'down'; reason: string };\n\nasync function fetchFollowing(url: string): Promise<{ finalUrl: string; status: number; html: string }> {\n  // One request object for the whole chain, so cookies set along the way are\n  // sent on the next hop the way a browser would.\n  const request = new MyChartRequest(new URL(url).host);\n  let current = url;\n  for (let hop = 0; hop < MAX_HOPS; hop++) {\n    const response = await request.makeRequest({ url: current, followRedirects: false });\n    const location = response.headers.get('location');\n    if (response.status >= 300 && response.status < 400 && location) {\n      current = new URL(location, current).href;\n      continue;\n    }\n    return { finalUrl: current, status: response.status, html: await response.text() };\n  }\n  throw new Error(`more than ${MAX_HOPS} redirects`);\n}\n\nasync function servesLoginPage(url: string): Promise<boolean> {\n  try {\n    const page = await fetchFollowing(url);\n    return page.status < 400 && looksLikeLoginPage(page.html);\n  } catch {\n    return false;\n  }\n}\n\nasync function resolve(directoryUrl: string): Promise<LoginUrlResolution> {\n  let page: Awaited<ReturnType<typeof fetchFollowing>>;\n  try {\n    page = await fetchFollowing(directoryUrl);\n  } catch (e) {\n    return { kind: 'down', reason: String((e as Error)?.message ?? e) };\n  }\n  if (page.status >= 400) return { kind: 'down', reason: `HTTP ${page.status}` };\n  if (looksLikeLoginPage(page.html)) return { kind: 'login' };\n\n  const ranked = extractMountsFromLinks(page.html, new URL(page.finalUrl).host);\n  const candidates = [\n    ...ranked.slice(0, MAX_CANDIDATES),\n    ...ranked\n      .slice(MAX_CANDIDATES)\n      .filter((m) => READS_AS_PORTAL.test(m.hostname) || READS_AS_PORTAL.test(m.firstPathPart ?? ''))\n      .slice(0, MAX_CANDIDATES),\n  ];\n  for (const { hostname, firstPathPart } of candidates) {\n    const mount = `https://${hostname}/${firstPathPart ? `${firstPathPart}/` : ''}`;\n    if (await servesLoginPage(`${mount}Authentication/Login`)) return { kind: 'linked', url: mount };\n  }\n  return { kind: 'down', reason: 'no MyChart login on the page or anything it links to' };\n}\n\nexport async function resolveLoginUrl(directoryUrl: string): Promise<LoginUrlResolution> {\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  try {\n    return await Promise.race([\n      resolve(directoryUrl),\n      new Promise<LoginUrlResolution>((done) => {\n        timer = setTimeout(() => done({ kind: 'down', reason: 'timed out' }), RESOLVE_TIMEOUT_MS);\n      }),\n    ]);\n  } finally {\n    if (timer) clearTimeout(timer);\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Epic's directory with every login URL checked — the deterministic code\n * behind `mychart-instances.json`. It writes that file on each MCPB release\n * (`fetch-mychart-instances.ts`), reruns monthly in the long-running clients\n * (`refreshMyChartDirectory`), and is what `mychart-cli --action\n * list-mycharts` prints.\n *\n * A crawl of all ~1,400 organizations — minutes, not seconds — so it never\n * runs inside a search; a search reads the last run's result.\n */\n\nimport { fetchMyChartDirectory, mergeDuplicates, type MyChartInstance } from './directory';\nimport { resolveLoginUrl, type LoginUrlResolution } from './resolveLoginUrl';\n\n/** Organizations resolved at once. `scraperFetch` still caps each host at ten. */\nconst CONCURRENCY = 24;\n\nexport interface ResolvedDirectory {\n  instances: MyChartInstance[];\n  /** Organizations whose `url` now differs from Epic's `loginUrl`. */\n  corrected: number;\n  /** Organizations we couldn't confirm were up, twice. They keep Epic's URL, marked `down`. */\n  down: { instance: MyChartInstance; reason: string }[];\n}\n\nasync function resolveAll(\n  instances: MyChartInstance[],\n  onResolved: (instance: MyChartInstance, resolution: LoginUrlResolution) => void,\n): Promise<void> {\n  const queue = [...instances];\n  await Promise.all(\n    Array.from({ length: CONCURRENCY }, async () => {\n      for (let instance = queue.shift(); instance; instance = queue.shift()) {\n        onResolved(instance, await resolveLoginUrl(instance.directoryUrl));\n      }\n    }),\n  );\n}\n\nexport async function fetchResolvedMyChartDirectory(\n  onProgress?: (done: number, total: number) => void,\n  directory: { directoryUrl?: string; mediaBase?: string } = {},\n): Promise<ResolvedDirectory> {\n  const instances = await fetchMyChartDirectory(directory);\n  const outcomes = new Map<MyChartInstance, LoginUrlResolution>();\n  await resolveAll(instances, (instance, resolution) => {\n    outcomes.set(instance, resolution);\n    onProgress?.(outcomes.size, instances.length);\n  });\n\n  // A blip during a release would otherwise mark a portal down for as long as\n  // that release is installed, so everything that looked down gets a second\n  // try once the crawl has finished.\n  const looksDown = instances.filter((i) => outcomes.get(i)?.kind === 'down');\n  await resolveAll(looksDown, (instance, resolution) => outcomes.set(instance, resolution));\n\n  const down: ResolvedDirectory['down'] = [];\n  for (const instance of instances) {\n    const resolution = outcomes.get(instance)!;\n    if (resolution.kind === 'linked') instance.url = resolution.url;\n    else if (resolution.kind === 'down') {\n      instance.down = true;\n      down.push({ instance, reason: resolution.reason });\n    }\n  }\n\n  // Again after resolving: two entries can share a portal only once corrected.\n  const merged = mergeDuplicates(instances);\n  return {\n    instances: merged,\n    corrected: merged.filter((i) => i.url !== i.directoryUrl).length,\n    down,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Searching the MyChart directory by name — the lookup every client needs\n * before it has an account to log into.\n *\n * The directory is ~1,400 instances; a person typing \"uchealth\" wants five.\n * This module is the ranking, and the list it ranks, in one place, because it used to exist twice: the Claude Desktop\n * extension shipped its own `instances.ts` searching only the bundled seed,\n * and the mobile app has its own picker search over the same list. Neither was\n * reachable from the CLI or the npm library, so \"find my health system\" was a\n * thing two clients could do and two could not.\n *\n * ## Which list\n *\n * A search reads the output of the deterministic refresh that writes\n * `mychart-instances.json` — Epic's directory, every login URL checked. Until\n * a newer run exists that is the checked-in file from the last release, and\n * the result says `source: 'bundled'`. A long-running client (the Claude Desktop extension,\n * the iOS app) reruns the refresh about monthly with\n * {@link refreshMyChartDirectory}, in the background — it is minutes of\n * requests, never part of a search — and from then on searches say\n * `source: 'refreshed'`, with when.\n *\n * ## The sandbox entry\n *\n * {@link SANDBOX_INSTANCE} is the deployed fake-mychart, so anyone can walk\n * the whole connect flow against Homer Simpson's fictional record without a\n * real Epic account. It is never a default suggestion — it only appears when\n * the query matches it — and its \"(test)\" suffix is there so nobody mistakes\n * it for a health system.\n *\n * The sandbox is a single small deployment that gets torn down whenever its\n * bill outweighs its use, so a search that matches it probes it first and\n * carries {@link SANDBOX_UNAVAILABLE_NOTE} on the match when it is down. A\n * client offering a dead sandbox sends someone through the whole connect flow\n * to a login that can never succeed, which is exactly how it was reported.\n */\n\nimport { scraperFetch } from '../http';\nimport { listMyCharts, toSeedEntry, type MyChartInstanceSeed } from './directory';\nimport { fetchResolvedMyChartDirectory } from './refreshDirectory';\n\n/**\n * How often a long-running client reruns the refresh. Epic's list changes by a\n * few entries a month, and a run is a few thousand requests.\n */\nexport const DIRECTORY_REFRESH_INTERVAL_MS = 30 * 24 * 60 * 60 * 1000;\n\n/** How many matches a search returns when the caller names no limit. */\nexport const DEFAULT_DIRECTORY_SEARCH_LIMIT = 10;\n\n/** The most a single search will return. */\nexport const MAX_DIRECTORY_SEARCH_LIMIT = 50;\n\n// A banner-shaped logo for the sandbox entry, matching the ~640x230 aspect of\n// Epic's real ones so it renders consistently in a picker. Inlined as a data\n// URI so it needs no network. `encodeURIComponent` rather than base64 because\n// this module loads in React Native and in a browser, neither of which has\n// `Buffer`.\nconst SANDBOX_LOGO_SVG =\n  '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 110\">' +\n  '<rect x=\"6\" y=\"18\" width=\"74\" height=\"74\" rx=\"14\" fill=\"#0d9488\"/>' +\n  '<rect x=\"35\" y=\"33\" width=\"16\" height=\"44\" rx=\"3\" fill=\"#ffffff\"/>' +\n  '<rect x=\"21\" y=\"47\" width=\"44\" height=\"16\" rx=\"3\" fill=\"#ffffff\"/>' +\n  '<text x=\"94\" y=\"50\" font-family=\"Helvetica,Arial,sans-serif\" font-size=\"30\" font-weight=\"700\" fill=\"#1e3a8a\">Springfield</text>' +\n  '<text x=\"94\" y=\"84\" font-family=\"Helvetica,Arial,sans-serif\" font-size=\"22\" font-weight=\"600\" fill=\"#0d9488\">General Hospital</text>' +\n  '</svg>';\n\n/**\n * The deployed fake-mychart, offered as if it were a health system so the\n * connect flow can be exercised end to end. Credentials are `homer` /\n * `donuts123` (`marge` for the 2FA path).\n */\nexport const SANDBOX_INSTANCE: MyChartInstanceSeed = {\n  name: 'Springfield General Hospital (test)',\n  url: 'https://fake-mychart.fanpierlabs.com/MyChart/',\n  logoUrl: `data:image/svg+xml;charset=utf-8,${encodeURIComponent(SANDBOX_LOGO_SVG)}`,\n  slgId: 'fake-mychart',\n  aliases: ['test', 'demo', 'sandbox', 'fake-mychart'],\n};\n\n/** What a client shows in place of the sandbox entry when it isn't serving. */\nexport const SANDBOX_UNAVAILABLE_NOTE =\n  'The test sandbox is currently down, so it cannot be used to connect an account. Email ryan@fanpierlabs.com to ask for it to be brought back up.';\n\n/** How long one reachability answer is reused before the next probe. */\nconst SANDBOX_PROBE_TTL_MS = 60_000;\n\n/** A probe that hasn't answered in this long counts as down. */\nconst SANDBOX_PROBE_TIMEOUT_MS = 4_000;\n\nlet sandboxProbe: { at: number; up: Promise<boolean> } | null = null;\n\n/** Drop the cached reachability answer. For tests. */\nexport function clearSandboxAvailabilityCache(): void {\n  sandboxProbe = null;\n}\n\nfunction isMyChartRedirect(response: Response): boolean {\n  if (response.status < 300 || response.status >= 400) return false;\n  const location = response.headers.get('Location');\n  if (!location) return false;\n  try {\n    return new URL(location, SANDBOX_INSTANCE.url).pathname.toLowerCase().startsWith('/mychart');\n  } catch {\n    return false;\n  }\n}\n\nasync function probeSandbox(): Promise<boolean> {\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  try {\n    // `scraperFetch` owns its own two-minute deadline and won't take a shorter\n    // one, so race it instead: nobody typing into a picker waits two minutes\n    // to be told the sandbox is gone. The losing fetch keeps running and holds\n    // one of this host's permits until it settles — harmless for a host nothing\n    // else talks to, so don't copy this for a real one.\n    const answered = await Promise.race([\n      scraperFetch(SANDBOX_INSTANCE.url, { redirect: 'manual' }, { cookieJar: null }),\n      new Promise<null>((resolve) => {\n        timer = setTimeout(() => resolve(null), SANDBOX_PROBE_TIMEOUT_MS);\n      }),\n    ]);\n    // Serving means answering the way MyChart does: a redirect that stays under\n    // the mount (`/MyChart/` → `/MyChart` → the login page). A parked domain\n    // answering 200, a redirect elsewhere, a 5xx, a DNS failure (what a\n    // torn-down deployment gives) or no answer at all is down.\n    return answered !== null && isMyChartRedirect(answered);\n  } catch {\n    return false;\n  } finally {\n    if (timer) clearTimeout(timer);\n  }\n}\n\n/**\n * Whether the fake-mychart sandbox is serving right now.\n *\n * Cached for {@link SANDBOX_PROBE_TTL_MS} and shared between concurrent\n * callers, so a picker firing a search per keystroke probes it about once.\n */\nexport function isSandboxAvailable(): Promise<boolean> {\n  if (sandboxProbe && Date.now() - sandboxProbe.at < SANDBOX_PROBE_TTL_MS) return sandboxProbe.up;\n  const probe = { at: Date.now(), up: probeSandbox() };\n  sandboxProbe = probe;\n  return probe.up;\n}\n\n/** One search hit, in the shape a picker or a model consumes. */\nexport interface MyChartDirectoryMatch {\n  /** The portal's hostname — what every client keys an account on. */\n  hostname: string;\n  /** Display name, e.g. \"UCHealth\". */\n  name: string;\n  /** Absolute logo URL (or a data URI, for the sandbox entry). */\n  logoUrl: string;\n  /** The portal's login URL. */\n  loginUrl: string;\n  /** Epic's directory id. Survives a rename; the name doesn't. */\n  slgId: string;\n  /** Other names the same organization is searched by. */\n  aliases: string[];\n  /**\n   * Why this entry can't be connected right now, when it can't. Only the\n   * sandbox entry ever carries it; a client shows the entry disabled with this\n   * text rather than dropping it, so \"where did the test hospital go?\" has an\n   * answer.\n   */\n  unavailable?: string;\n}\n\n/** Which list answered a search. */\nexport type MyChartDirectorySource = 'refreshed' | 'bundled';\n\nexport interface MyChartDirectorySearchResult {\n  /** The query as the caller wrote it. */\n  query: string;\n  source: MyChartDirectorySource;\n  /** When the refresh that answered ran (ISO 8601), for `source: 'refreshed'`. */\n  refreshedAt?: string;\n  count: number;\n  matches: MyChartDirectoryMatch[];\n}\n\nexport interface MyChartDirectorySearchOptions {\n  /** 1–{@link MAX_DIRECTORY_SEARCH_LIMIT}; defaults to 10. */\n  limit?: number | undefined;\n}\n\nfunction hostnameOf(url: string): string {\n  try {\n    return new URL(url).hostname.toLowerCase();\n  } catch {\n    return '';\n  }\n}\n\nfunction toMatch(instance: MyChartInstanceSeed): MyChartDirectoryMatch {\n  return {\n    hostname: hostnameOf(instance.url),\n    name: instance.name,\n    logoUrl: instance.logoUrl,\n    loginUrl: instance.url,\n    slgId: instance.slgId,\n    aliases: instance.aliases,\n  };\n}\n\n// ── The refreshed list ─────────────────────────────────────────────────────\n\n/** The last refresh's list, and when it ran; null until one. */\nlet refreshed: { entries: MyChartInstanceSeed[]; at: string } | null = null;\n\n/** Search the checked-in list again, as before any refresh. For tests. */\nexport function clearDirectoryCache(): void {\n  refreshed = null;\n}\n\n/**\n * Search a list a refresh produced — this process's, or one a client saved\n * from an earlier run — instead of the checked-in one. `refreshedAt` is when\n * that refresh ran; searches report it.\n */\nexport function useRefreshedMyCharts(entries: readonly MyChartInstanceSeed[], refreshedAt: string): void {\n  refreshed = { entries: [...entries], at: refreshedAt };\n}\n\n/**\n * Rerun the refresh that writes `mychart-instances.json` — fetch Epic's\n * directory, check every login URL — and search its result from now on.\n * Returns that result for the caller to save. Minutes of requests: run it in the background.\n */\nexport async function refreshMyChartDirectory(\n  directory: { directoryUrl?: string; mediaBase?: string } = {},\n): Promise<MyChartInstanceSeed[]> {\n  const { instances } = await fetchResolvedMyChartDirectory(undefined, directory);\n  const entries = instances.map(toSeedEntry);\n  useRefreshedMyCharts(entries, new Date().toISOString());\n  return entries;\n}\n\n// ── Ranking ────────────────────────────────────────────────────────────────\n\n/**\n * Rank the instances matching `query`, best first.\n *\n * Exact name, then a name that starts with the query, then a name containing\n * it, then an alias, then the hostname. The order is what makes \"mercy\" put\n * \"Mercy\" itself above the thirty organizations with \"Mercy\" in the middle of\n * their name; a plain `filter` returned them in directory order, which is\n * alphabetical and therefore arbitrary.\n *\n * Exported for the clients that already hold the list (the mobile picker\n * renders from its own cache) and to keep the ranking testable without a\n * transport.\n */\nexport function rankDirectoryMatches(\n  instances: readonly MyChartInstanceSeed[],\n  query: string,\n  limit: number = DEFAULT_DIRECTORY_SEARCH_LIMIT,\n): MyChartDirectoryMatch[] {\n  const q = query.trim().toLowerCase();\n  if (!q) return [];\n\n  const exact: MyChartDirectoryMatch[] = [];\n  const startsWith: MyChartDirectoryMatch[] = [];\n  const nameIncludes: MyChartDirectoryMatch[] = [];\n  const aliasIncludes: MyChartDirectoryMatch[] = [];\n  const hostnameIncludes: MyChartDirectoryMatch[] = [];\n\n  for (const instance of instances) {\n    const match = toMatch(instance);\n    const name = match.name.toLowerCase();\n    if (name === q) exact.push(match);\n    else if (name.startsWith(q)) startsWith.push(match);\n    else if (name.includes(q)) nameIncludes.push(match);\n    else if (match.aliases.some((alias) => alias.toLowerCase().includes(q))) aliasIncludes.push(match);\n    else if (match.hostname.includes(q)) hostnameIncludes.push(match);\n  }\n\n  return [...exact, ...startsWith, ...nameIncludes, ...aliasIncludes, ...hostnameIncludes].slice(\n    0,\n    Math.max(1, limit),\n  );\n}\n\n/**\n * Find the MyChart instances whose name, alias or hostname matches `query`.\n *\n * Reads the last refresh's list, or the checked-in one until there is one; the\n * result says which. Makes no request, except to check the sandbox entry when\n * the query turns it up. The result\n * says which one answered, because \"your health system isn't listed\" means\n * something different depending on whether the list was six months old.\n *\n * The {@link SANDBOX_INSTANCE} is searched alongside the real ones, and is\n * listed first so a query naming it outranks any real \"Springfield…\" match.\n * When a search turns it up, its reachability is probed and a match that\n * isn't serving comes back carrying {@link SANDBOX_UNAVAILABLE_NOTE}.\n */\nexport async function searchMyChartDirectory(\n  query: string,\n  options: MyChartDirectorySearchOptions = {},\n): Promise<MyChartDirectorySearchResult> {\n  const text = query.trim();\n  if (!text) {\n    throw new Error('Pass a query — a few letters of the health system name.');\n  }\n  const limit = Math.min(\n    MAX_DIRECTORY_SEARCH_LIMIT,\n    Math.max(1, Math.floor(options.limit ?? DEFAULT_DIRECTORY_SEARCH_LIMIT)),\n  );\n\n  const instances = refreshed?.entries ?? listMyCharts();\n\n  const matches = rankDirectoryMatches([SANDBOX_INSTANCE, ...instances], text, limit);\n\n  // Only pay for the probe when the query actually turned up the sandbox,\n  // which almost no real search does.\n  const sandbox = matches.find((match) => match.slgId === SANDBOX_INSTANCE.slgId);\n  if (sandbox && !(await isSandboxAvailable())) sandbox.unavailable = SANDBOX_UNAVAILABLE_NOTE;\n\n  return refreshed\n    ? { query: text, source: 'refreshed', refreshedAt: refreshed.at, count: matches.length, matches }\n    : { query: text, source: 'bundled', count: matches.length, matches };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The `Directory` group — Epic's list of every MyChart instance in the world.\n *\n * `public`-kind, like `Providers`: this is the lookup a person does *before*\n * they have an account, so requiring one would be a contradiction.\n *\n * It was the Claude Desktop extension's hand-written `search_mycharts` meta\n * tool, over a bundled snapshot, and only that client had it — the CLI, the\n * npm library and the mobile agent could not answer \"which MyChart does my\n * health system run?\" at all. Same tool name, same result shape; the search\n * itself now lives in `scrapers/list-all-mycharts/searchDirectory.ts` and\n * prefers Epic's live directory over the checked-in seed.\n */\n\nimport {\n  searchMyChartDirectory,\n  MAX_DIRECTORY_SEARCH_LIMIT,\n} from '../../../scrapers/list-all-mycharts/searchDirectory';\nimport { num, requireStr } from '../args';\nimport type { CapabilityImpl } from '../types';\n\nexport const DIRECTORY_CAPABILITIES: readonly CapabilityImpl[] = [\n  {\n    id: 'search_mycharts',\n    title: 'Search the MyChart directory',\n    description:\n      \"Look up a MyChart hostname for setup. Type a few letters of the user's health system name (e.g. \\\"uchealth\\\", \\\"mass general\\\"). Returns matching entries with their hostname, display name, login URL and logo. Pass the chosen `hostname` on to whatever this client uses to connect an account — except for an entry carrying `unavailable`, which cannot be connected right now: show the user that message instead of attempting setup.\",\n    kind: 'public',\n    group: 'Directory',\n    params: [\n      {\n        name: 'query',\n        type: 'string',\n        description:\n          'Substring of the health system name, one of its aliases, or its hostname. Case-insensitive.',\n        required: true,\n      },\n      {\n        name: 'limit',\n        type: 'number',\n        description: `Maximum results to return, 1–${MAX_DIRECTORY_SEARCH_LIMIT}. Defaults to 10.`,\n        min: 1,\n        max: MAX_DIRECTORY_SEARCH_LIMIT,\n      },\n    ],\n    // No processor: the search returns a finished object rather than a scraped\n    // response, so there is no raw envelope to project and no `mode` to offer.\n    run: (args) => {\n      const query = requireStr(args, 'query');\n      const given = args.limit;\n      const limit =\n        given === undefined || given === null || given === ''\n          ? undefined\n          : num(args, 'limit', MAX_DIRECTORY_SEARCH_LIMIT);\n      return searchMyChartDirectory(query, { limit });\n    },\n  },\n];\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The capability registry — the single source of truth for what OpenRecord can\n * do with a MyChart account.\n *\n * Every client (CLI, npm library, Claude Desktop extension, mobile app) derives\n * its tool/command list from `CAPABILITIES` instead of hand-maintaining its own.\n * Before this file existed the four lists had drifted — the mobile app was\n * missing visit notes, questionnaires, upcoming orders, EHI export, linked\n * accounts, message threads and every emergency-contact write; the CLI was\n * missing visit notes and those same writes — so the answer a patient got\n * depended on which client they happened to ask. `capabilities.test.ts` now\n * fails the build if any client stops covering an entry here.\n *\n * ## Shape of an entry\n *\n * A capability is a name, a parameter list, and a `run(request, args, ctx)`\n * that takes a logged-in {@link MyChartRequest} and returns JSON-serializable\n * data. Nothing in here knows about MCP, React Native, or argv — the clients\n * own their own presentation, and only their presentation. The entries\n * themselves live one file per group under `registry/`; this file is the\n * assembly, the lookup and the dispatch.\n *\n * ## Capabilities that need no account\n *\n * Not everything OpenRecord can do is a chart read. Looking a provider up in\n * the NPI Registry, or finding which MyChart a health system runs, is public\n * data — and each client used to hand-write its own version of that, which is\n * how the Claude Desktop extension ended up the only client able to search the\n * MyChart directory. Those live here too, as `kind: 'public'`: no `account`\n * parameter, no session, no patient assertion, and no client-side list.\n *\n * ## Adding one\n *\n * Add the entry to its group's file in `registry/` (a new group also goes in\n * {@link CAPABILITY_IMPLS} below, in the order it should be listed). Every\n * client picks it up automatically: the MCP server registers a tool, the mobile\n * agent lists it in its prompt, the CLI gains `--action <id>`, and the npm\n * client gains a `runCapability(id, …)` route. The only thing a client may\n * still need is bespoke presentation (see `rendersMedia`).\n */\n\nimport type { MyChartRequest } from '../../scrapers/myChart/core/myChartRequest';\nimport type { RawResponse } from '../../scrapers/myChart/core/rawResponse';\nimport { renderOutput } from '../../scrapers/myChart/processors/processor';\nimport { assertProxyReadContext } from '../../scrapers/myChart/proxy/proxyTools';\n\nimport { optStr } from './args';\nimport { readOutputMode } from './params';\nimport { isPublicCapability } from './public';\nimport type { Capability, CapabilityArgs, CapabilityContext, CapabilityImpl } from './types';\n\nimport { PROFILE_CAPABILITIES } from './registry/profile';\nimport { VISIT_CAPABILITIES } from './registry/visits';\nimport { RESULT_CAPABILITIES } from './registry/results';\nimport { MESSAGE_CAPABILITIES } from './registry/messages';\nimport { BILLING_CAPABILITIES } from './registry/billing';\nimport { CARE_CAPABILITIES } from './registry/care';\nimport { EMERGENCY_CONTACT_CAPABILITIES } from './registry/emergencyContacts';\nimport { PRESCRIPTION_CAPABILITIES } from './registry/prescriptions';\nimport { PATIENT_CAPABILITIES } from './registry/patients';\nimport { ACCOUNT_SECURITY_CAPABILITIES } from './registry/accountSecurity';\nimport { PROVIDER_CAPABILITIES } from './registry/providers';\nimport { DIRECTORY_CAPABILITIES } from './registry/directory';\n\nexport type {\n  Capability,\n  CapabilityArgs,\n  CapabilityContext,\n  CapabilityKind,\n  CapabilityParam,\n  FilePayload,\n} from './types';\nexport { encodeImageId, decodeImageId, type StudyImagePayload } from './imaging';\nexport type { MessageAttachmentFile } from '../../scrapers/myChart/chart/messages/messageAttachment';\nexport type { DocumentFile } from '../../scrapers/myChart/chart/documents/documentDownload';\nexport { resolveRecipient, resolveTopic } from './resolve';\nexport {\n  ACCOUNT_PARAM,\n  ACCOUNT_PARAM_NAMES,\n  MODE_PARAM,\n  MODEL_FACING_OUTPUT_MODE,\n  PATIENT_PARAM,\n  describeModeParam,\n  readAccountArg,\n  readOutputMode,\n} from './params';\nexport { acceptsAccountParam, isPublicCapability } from './public';\n\n/**\n * The registry, in listing order. The order of these arrays is the order every\n * client shows its tools in, so it is a presentation decision, not an\n * accident — see {@link capabilitiesByGroup}.\n */\nconst CAPABILITY_IMPLS: readonly CapabilityImpl[] = [\n  ...PROFILE_CAPABILITIES,\n  ...VISIT_CAPABILITIES,\n  ...RESULT_CAPABILITIES,\n  ...MESSAGE_CAPABILITIES,\n  ...BILLING_CAPABILITIES,\n  ...CARE_CAPABILITIES,\n  ...EMERGENCY_CONTACT_CAPABILITIES,\n  ...PRESCRIPTION_CAPABILITIES,\n  ...PATIENT_CAPABILITIES,\n  ...ACCOUNT_SECURITY_CAPABILITIES,\n  ...PROVIDER_CAPABILITIES,\n  ...DIRECTORY_CAPABILITIES,\n];\n\n// ── Lookup helpers ──────────────────────────────────────────────────────────\n\n/**\n * Every capability, as clients see them: no `run`. Reaching the implementation\n * is a compile error outside this module — see `CapabilityImpl`, which\n * `./types` exports and this file deliberately does not re-export.\n */\nexport const CAPABILITIES: readonly Capability[] = CAPABILITY_IMPLS;\n\n/** Capability ids in registry order. */\nexport const CAPABILITY_IDS: readonly string[] = CAPABILITIES.map((c) => c.id);\n\n/** The read + write capabilities — everything a model may be offered as a tool. */\nexport const AGENT_CAPABILITIES: readonly Capability[] = CAPABILITIES.filter((c) => c.kind !== 'account');\n\n/**\n * The capabilities a listing shows first — everything not marked\n * {@link Capability.lessFrequentlyUsed}.\n *\n * Nothing filters on this to decide what it will *run*; it only decides what a\n * listing leads with. The CLI's `--help` prints these and points at\n * `--help --show-all` for the rest.\n */\nexport const COMMON_CAPABILITIES: readonly Capability[] = CAPABILITIES.filter((c) => !c.lessFrequentlyUsed);\n\n/** The remainder — real, supported, and rarely what anyone wants. */\nexport const LESS_FREQUENTLY_USED_CAPABILITIES: readonly Capability[] = CAPABILITIES.filter(\n  (c) => c.lessFrequentlyUsed,\n);\n\n\n/** Ids of the capabilities that mutate the patient's MyChart record. */\nexport const WRITE_CAPABILITY_IDS: readonly string[] = CAPABILITIES.filter((c) => c.kind === 'write').map((c) => c.id);\n\n/**\n * The capabilities that need no MyChart account — public directories and\n * registries. Clients use this to decide what to offer, and what to run,\n * before anyone has connected anything.\n */\nexport const PUBLIC_CAPABILITIES: readonly Capability[] = CAPABILITIES.filter(isPublicCapability);\n\nexport const PUBLIC_CAPABILITY_IDS: readonly string[] = PUBLIC_CAPABILITIES.map((c) => c.id);\n\nconst BY_NAME = new Map<string, CapabilityImpl>();\nfor (const capability of CAPABILITY_IMPLS) {\n  BY_NAME.set(capability.id, capability);\n  for (const alias of capability.aliases ?? []) BY_NAME.set(alias, capability);\n}\n\n/** Look a capability up by id or alias. Returns undefined for unknown names. */\nexport function getCapability(idOrAlias: string): Capability | undefined {\n  return BY_NAME.get(idOrAlias);\n}\n\n/**\n * The same lookup, but keeping the implementation handle. Module-private:\n * {@link executeCapability} is the only caller, because it is the only place\n * allowed to reach `run`.\n */\nfunction getCapabilityImpl(idOrAlias: string): CapabilityImpl | undefined {\n  return BY_NAME.get(idOrAlias);\n}\n\n/** Capabilities grouped in registry order, for help text and tool listings. */\nexport function capabilitiesByGroup(\n  capabilities: readonly Capability[] = CAPABILITIES,\n): Array<{ group: string; capabilities: Capability[] }> {\n  const groups: Array<{ group: string; capabilities: Capability[] }> = [];\n  for (const capability of capabilities) {\n    let bucket = groups.find((g) => g.group === capability.group);\n    if (!bucket) {\n      bucket = { group: capability.group, capabilities: [] };\n      groups.push(bucket);\n    }\n    bucket.capabilities.push(capability);\n  }\n  return groups;\n}\n\n/**\n * Capabilities exempt from the active-patient assertion below.\n *\n * The `Patients` group is exempt because asserting \"you must already be on\n * patient X\" in front of the very tools that list and change X would make them\n * unusable exactly when they are needed. `account`-kind capabilities are exempt\n * because they act on the MyChart login, not on any one patient's chart, and\n * `public`-kind ones because they have no chart and no session to assert\n * against — see `PublicCapabilityImpl` in `./types`.\n */\nfunction needsPatientAssertion(capability: Capability): boolean {\n  return (\n    capability.group !== 'Patients' && capability.kind !== 'account' && !isPublicCapability(capability)\n  );\n}\n\n/**\n * Run a capability by id (or alias) against a logged-in session.\n *\n * Every chart-touching call first asserts which patient MyChart is on, via\n * `assertProxyReadContext`. `args.patient` names the patient the call is\n * about; omitting it means the account holder — explicitly, not \"whoever the\n * session happens to be pointed at\", because sessions resume from cached\n * cookies and would otherwise inherit whichever patient an earlier invocation\n * left behind. A mismatch throws with the `switch_proxy_target` call that\n * fixes it; reading never switches on its own.\n *\n * Doing this here rather than in each client's dispatch is the point of the\n * registry: one guard, and no client can forget it. Discovery is cached per\n * session inside `proxyTools`, so the assertion costs one request per session\n * rather than one per call.\n *\n * Throws a listing-friendly error for unknown names.\n */\nexport async function executeCapability(\n  request: MyChartRequest | null,\n  idOrAlias: string,\n  args: CapabilityArgs = {},\n  ctx?: CapabilityContext,\n): Promise<unknown> {\n  const capability = getCapabilityImpl(idOrAlias);\n  if (!capability) {\n    throw new Error(`Unknown capability \"${idOrAlias}\". Known capabilities: ${CAPABILITY_IDS.join(', ')}`);\n  }\n  // Before anything else, including the patient assertion: a capability with no\n  // scraper has nothing to assert about and no session to spend on it. Compared\n  // against undefined rather than for truthiness, because that is what narrows\n  // the union — everything past this line has a `run`.\n  if (capability.notImplemented !== undefined) return capability.notImplemented;\n\n  let result: unknown;\n  if (capability.kind === 'public') {\n    // Public capabilities are the reason `request` is nullable: they read the\n    // NPI Registry or Epic's instance directory, which no account owns. Their\n    // `run` cannot take a session, so there is nothing to assert and nothing\n    // that could read the wrong chart.\n    result = await capability.run(args);\n  } else {\n    // Everything else needs one. A client that lost track of which kind it was\n    // dispatching gets this rather than a `Cannot read properties of null`\n    // fifteen frames into a scraper.\n    if (!request) {\n      throw new Error(`\"${capability.id}\" needs a connected MyChart account; none was passed.`);\n    }\n    if (needsPatientAssertion(capability)) {\n      await assertProxyReadContext(request, optStr(args, 'patient'));\n    }\n    result = await capability.run(request, args, ctx);\n  }\n  if (!capability.processor) return result;\n  return renderOutput(capability.processor, result as RawResponse, readOutputMode(args));\n}\n\n/** Whether this capability accepts {@link MODE_PARAM} — i.e. it has a processor. */\nexport function acceptsModeParam(capability: Capability): boolean {\n  return getCapabilityImpl(capability.id)?.processor !== undefined;\n}\n\n/** Whether this capability accepts {@link PATIENT_PARAM} on top of its own. */\nexport function acceptsPatientParam(capability: Capability): boolean {\n  return needsPatientAssertion(capability);\n}\n\n/** One `name(param, param) — description` line per capability, for prompts and help. */\nexport function describeCapability(capability: Capability): string {\n  const params = capability.params.map((p) => (p.required ? p.name : `${p.name}?`)).join(', ');\n  return `${capability.id}(${params}) — ${capability.description}`;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Convert eUnity CLO (ClientOutlook) image files to raw grayscale bitmaps.\n *\n * CLO is a proprietary image format used by Mach7 Technologies' eUnity DICOM\n * viewer (formerly Client Outlook). It uses a 4-level Haar wavelet decomposition\n * with zstd compression for progressive image streaming. No public documentation\n * or open-source decoder exists — this was built entirely through reverse engineering.\n *\n * No dependency on sharp — pure TypeScript + fzstd + zlib.\n *\n * ## CLO Format\n *\n * Each image consists of two files:\n * - `*_pixel.clo` (CLOCLHAAR) — Haar wavelet pixel data\n * - `*_wrapper.clo` (CLOHEADERZ01) — AMF3-encoded DICOM metadata\n *\n * ### Pixel File Structure (CLOCLHAAR)\n *\n * 1. 96-byte header with image dimensions\n * 2. `35fa` marker records (16 bytes each) organizing the data:\n *    - Level 2: starts a new wavelet resolution group\n *    - Level 3: defines tile position (row/col in upper/lower 16 bits)\n *    - Level 5: points to zstd-compressed data blocks\n * 3. Zstd-compressed byte planes for each subband tile\n *\n * ### Wavelet Decomposition\n *\n * The image is decomposed into 4 Haar wavelet levels:\n * - **Group -1**: LL approximation (coarsest, ~1/16th resolution)\n * - **Group 0**: Coarsest detail subbands (LH, HL, HH)\n * - **Groups 1-3**: Progressively finer detail subbands (tiled at 256x256)\n *\n * Each subband is stored as two byte planes: LSB (block N) and MSB (block 65536+N),\n * combining to 16-bit values. Subbands: 0=LL, 1=LH (horizontal detail),\n * 2=HL (vertical detail), 3=HH (diagonal detail). Block 4 stores overflow bits.\n *\n * ### Reconstruction Pipeline\n *\n * 1. Parse pixel header → width, height\n * 2. Parse wrapper → DICOM metadata (photometric, VOI LUT, window center/width)\n * 3. Extract all tiles (scan for 35fa markers, decompress zstd blocks)\n * 4. Assemble LL coarsest approximation from MSB+LSB byte planes\n * 5. Progressive inverse Haar wavelet (lifting scheme) through each detail level\n * 6. Apply DICOM display pipeline (VOI LUT or window center/width)\n * 7. Normalize to 8-bit with optional MONOCHROME1 inversion\n *\n * ### Known Limitations\n *\n * - Detail coefficients are stored as unsigned magnitudes; the sign encoding is\n *   proprietary (implemented in eUnity's WASM/JS). Zigzag decoding recovers most\n *   signs but fine detail is slightly softer than native eUnity output.\n * - Text annotations (\"R\", \"DML\") from the wrapper are not rendered.\n * - Achieves 98%+ pixel-perfect match vs eUnity viewer output.\n */\n\nimport { readFileSync, existsSync } from \"fs\";\nimport { inflateSync } from \"zlib\";\nimport { decompress as zstdDecompress } from \"fzstd\";\nimport { Amf3Reader } from '../../../shared/amf3Reader';\nimport { logger } from '../../../shared/logger';\n\nconst CLOCLHAAR_MAGIC = Buffer.from(\"CLOCLHAAR###\");\nconst CLOHEADERZ01_MAGIC = Buffer.from(\"CLOHEADERZ01\");\nconst TILE_SIZE = 256;\n\n// ==================== Types ====================\n\nexport interface Bitmap {\n  pixels: Uint8Array;\n  width: number;\n  height: number;\n}\n\nexport interface Bitmap16 {\n  pixels: Uint16Array;\n  width: number;\n  height: number;\n}\n\n// ==================== Wrapper Parser ====================\n\nexport interface CloMetadata {\n  photometric?: string;\n  bits_stored?: number;\n  high_pixel_value?: number;\n  is_signed?: number;\n  window_center?: number;\n  window_width?: number;\n  presentation_lut_shape?: string;\n  rescale_slope?: number;\n  rescale_intercept?: number;\n  voi_lut?: Uint16Array;\n  voi_lut_start?: number;\n  voi_lut_bits?: number;\n}\n\nexport function parseWrapper(input: string | Buffer): CloMetadata {\n  const data = typeof input === 'string' ? readFileSync(input) : input;\n  if (Buffer.compare(data.subarray(0, 12), CLOHEADERZ01_MAGIC) !== 0) {\n    throw new Error(`Not a CLOHEADERZ01 file`);\n  }\n\n  let decompressed: Buffer;\n  try {\n    decompressed = inflateSync(data.subarray(16));\n  } catch (e) {\n    throw new Error(`Failed to decompress wrapper: ${e}`);\n  }\n\n  const metadata: CloMetadata = {};\n\n  // Decoded strictly (shared/amf3Reader.ts — the repo's one AMF3 reader): a\n  // wrapper this decoder can't fully parse costs the windowing metadata, and\n  // the text-based fallback below still recovers the photometric so the image\n  // renders.\n  try {\n    const result = new Amf3Reader(decompressed).readValue() as Record<string, any>;\n    if (result && typeof result === \"object\" && !Array.isArray(result)) {\n      if (typeof result.photometricInterpretation === \"string\") {\n        metadata.photometric = result.photometricInterpretation;\n      }\n      if (typeof result.bitsStored === \"number\" && result.bitsStored > 0) {\n        metadata.bits_stored = Math.floor(result.bitsStored);\n      }\n      if (typeof result.highPixelValue === \"number\" && result.highPixelValue > 0) {\n        metadata.high_pixel_value = Math.floor(result.highPixelValue);\n      }\n      if (typeof result.isSigned === \"number\") {\n        metadata.is_signed = Math.floor(result.isSigned);\n      }\n      // A window centre is signed — CT lung windows sit near -600, and dose\n      // report / scout frames commonly come through at -512. Only the width\n      // has to be positive.\n      if (typeof result.windowCenter === \"number\" && Number.isFinite(result.windowCenter)) {\n        metadata.window_center = result.windowCenter;\n      }\n      if (typeof result.windowWidth === \"number\" && result.windowWidth > 0) {\n        metadata.window_width = result.windowWidth;\n      }\n      if (typeof result.presentationLutShape === \"string\") {\n        metadata.presentation_lut_shape = result.presentationLutShape;\n      }\n      if (typeof result.rescaleSlope === \"number\") {\n        metadata.rescale_slope = result.rescaleSlope;\n      }\n      if (typeof result.rescaleIntercept === \"number\") {\n        metadata.rescale_intercept = result.rescaleIntercept;\n      }\n\n      // Extract VOI LUT\n      const voi = result.voiLut;\n      if (voi && Buffer.isBuffer(voi.lut)) {\n        const lutData = voi.lut as Buffer;\n        const elements = voi.elements || 0;\n        const start = voi.start || 0;\n        const bits = voi.bits || 16;\n        const isLE = voi.lutIsLittleEndian ?? 1;\n\n        if (elements > 0 && lutData.length >= elements * 2) {\n          const lut = new Uint16Array(elements);\n          for (let i = 0; i < elements; i++) {\n            lut[i] = isLE\n              ? lutData.readUInt16LE(i * 2)\n              : lutData.readUInt16BE(i * 2);\n          }\n          metadata.voi_lut = lut;\n          metadata.voi_lut_start = Math.floor(start);\n          metadata.voi_lut_bits = Math.floor(bits);\n        }\n      }\n    }\n  } catch (err) {\n    logger.warn(`[clo_to_bitmap] AMF3 parsing failed, falling back to text-based detection:`, (err as Error).message);\n  }\n\n  // Fallback: text-based detection\n  if (!metadata.photometric) {\n    const text = decompressed.toString(\"latin1\");\n    if (text.includes(\"MONOCHROME1\")) {\n      metadata.photometric = \"MONOCHROME1\";\n    } else if (text.includes(\"MONOCHROME2\")) {\n      metadata.photometric = \"MONOCHROME2\";\n    }\n  }\n\n  return metadata;\n}\n\n// ==================== Pixel File Parser ====================\n\nexport function parsePixelHeader(data: Buffer): { width: number; height: number } {\n  if (Buffer.compare(data.subarray(0, 12), CLOCLHAAR_MAGIC) !== 0) {\n    throw new Error(\"Not a CLOCLHAAR pixel file\");\n  }\n  if (data[16] !== 0x35 || data[17] !== 0xfa) {\n    throw new Error(\"Expected 35fa marker at offset 16\");\n  }\n  const width = data.readUInt32LE(24);\n  const height = data.readUInt32LE(28);\n  if (width === 0 || height === 0 || width > 65535 || height > 65535) {\n    throw new Error(`Invalid dimensions: ${width}x${height}`);\n  }\n  return { width, height };\n}\n\nexport type TileKey = string; // \"group,tileRow,tileCol,blockNum\"\nexport type TileMap = Map<TileKey, Uint8Array>;\n\nexport function tileKey(group: number, tileRow: number, tileCol: number, blockNum: number): TileKey {\n  return `${group},${tileRow},${tileCol},${blockNum}`;\n}\n\nexport function parseTileKey(key: TileKey): [number, number, number, number] {\n  // Keys are minted by tileKey() with exactly three commas; `!` for noUncheckedIndexedAccess.\n  const parts = key.split(\",\");\n  return [+parts[0]!, +parts[1]!, +parts[2]!, +parts[3]!];\n}\n\nexport function extractTiles(data: Buffer): TileMap {\n  const tiles: TileMap = new Map();\n  let pos = 96;\n  let groupIdx = -1;\n  let tileRow = 0;\n  let tileCol = 0;\n\n  while (pos < data.length - 4) {\n    if (data[pos] === 0x35 && data[pos + 1] === 0xfa) {\n      const level = data.readUInt16BE(pos + 2);\n      const val1 = data.readUInt32LE(pos + 4);\n      const val2 = data.readUInt32LE(pos + 8);\n\n      if (level === 2) {\n        groupIdx++;\n        tileRow = 0;\n        tileCol = 0;\n      } else if (level === 3) {\n        tileRow = (val2 >> 16) & 0xffff;\n        tileCol = val2 & 0xffff;\n      } else if (level === 5) {\n        const compressedSize = val1;\n        const blockNum = val2;\n        const dataPos = pos + 16;\n\n        if (\n          dataPos < data.length - 4 &&\n          data[dataPos] === 0x28 &&\n          data[dataPos + 1] === 0xb5 &&\n          data[dataPos + 2] === 0x2f &&\n          data[dataPos + 3] === 0xfd\n        ) {\n          try {\n            const compressed = new Uint8Array(\n              data.buffer,\n              data.byteOffset + dataPos,\n              compressedSize\n            );\n            const decompressed = zstdDecompress(compressed);\n            tiles.set(\n              tileKey(groupIdx, tileRow, tileCol, blockNum),\n              decompressed\n            );\n          } catch {\n            try {\n              const compressed = new Uint8Array(\n                data.buffer,\n                data.byteOffset + dataPos,\n                data.length - dataPos\n              );\n              const decompressed = zstdDecompress(compressed);\n              tiles.set(\n                tileKey(groupIdx, tileRow, tileCol, blockNum),\n                decompressed\n              );\n            } catch (err) {\n              logger.warn(`[clo_to_bitmap] Failed to decompress tile at group=${groupIdx} row=${tileRow} col=${tileCol} block=${blockNum}:`, (err as Error).message);\n            }\n          }\n          pos = dataPos + compressedSize;\n          continue;\n        }\n      }\n      pos += 16;\n    } else {\n      pos++;\n    }\n  }\n\n  return tiles;\n}\n\n// ==================== Wavelet Reconstruction ====================\n\nexport function computeWaveletLevels(width: number, height: number, numDetailGroups?: number): [number, number][] {\n  const levels: [number, number][] = [];\n  let cw = width;\n  let ch = height;\n  if (numDetailGroups !== undefined && numDetailGroups > 0) {\n    for (let i = 0; i < numDetailGroups; i++) {\n      cw = (cw + 1) >> 1;\n      ch = (ch + 1) >> 1;\n      levels.push([ch, cw]);\n    }\n  } else {\n    while (cw > TILE_SIZE || ch > TILE_SIZE) {\n      cw = (cw + 1) >> 1;\n      ch = (ch + 1) >> 1;\n      levels.push([ch, cw]);\n    }\n  }\n  levels.reverse();\n  return levels;\n}\n\nfunction assembleSubbandU16(\n  tiles: TileMap,\n  group: number,\n  lsbBlock: number,\n  msbBlock: number,\n  h: number,\n  w: number\n): Uint16Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  const total = h * w;\n  const lk0 = tileKey(group, 0, 0, lsbBlock);\n  const mk0 = tileKey(group, 0, 0, msbBlock);\n\n  if (tiles.has(lk0) && tiles.has(mk0)) {\n    const lsbData = tiles.get(lk0)!;\n    const msbData = tiles.get(mk0)!;\n    if (lsbData.length >= total && msbData.length >= total) {\n      const result = new Uint16Array(total);\n      for (let i = 0; i < total; i++) {\n        result[i] = msbData[i]! * 256 + lsbData[i]!;\n      }\n      return result;\n    }\n  }\n\n  const result = new Uint16Array(total);\n  const tilePositions: [number, number][] = [];\n  for (const key of tiles.keys()) {\n    const [g, tr, tc, bn] = parseTileKey(key);\n    if (g === group && bn === lsbBlock) {\n      tilePositions.push([tr, tc]);\n    }\n  }\n  if (tilePositions.length === 0) return result;\n\n  const nTileRows = Math.max(...tilePositions.map(([tr]) => tr)) + 1;\n  const nTileCols = Math.max(...tilePositions.map(([, tc]) => tc)) + 1;\n\n  const stdTileW = nTileCols === 1 ? w : TILE_SIZE;\n  const firstData = tiles.get(lk0);\n  let stdTileH = firstData ? Math.floor(firstData.length / stdTileW) : TILE_SIZE;\n  stdTileH = Math.max(stdTileH, 1);\n\n  for (let tr = 0; tr < nTileRows; tr++) {\n    for (let tc = 0; tc < nTileCols; tc++) {\n      const lk = tileKey(group, tr, tc, lsbBlock);\n      const mk = tileKey(group, tr, tc, msbBlock);\n      if (!tiles.has(lk) || !tiles.has(mk)) continue;\n\n      const tw = (tc === nTileCols - 1) ? (w - tc * stdTileW) : stdTileW;\n      const lsbData = tiles.get(lk)!;\n      const msbData = tiles.get(mk)!;\n      let th = tw > 0 ? Math.floor(lsbData.length / tw) : 0;\n      th = Math.min(th, h - tr * stdTileH);\n\n      const expected = th * tw;\n      if (lsbData.length >= expected && msbData.length >= expected) {\n        const r0 = tr * stdTileH;\n        const c0 = tc * stdTileW;\n        for (let r = 0; r < th; r++) {\n          for (let c = 0; c < tw; c++) {\n            const srcIdx = r * tw + c;\n            const dstIdx = (r0 + r) * w + (c0 + c);\n            result[dstIdx] = msbData[srcIdx]! * 256 + lsbData[srcIdx]!;\n          }\n        }\n      }\n    }\n  }\n\n  return result;\n}\n\nfunction getSubbandBytes(\n  tiles: TileMap,\n  group: number,\n  blockNum: number,\n  h: number,\n  w: number\n): Uint8Array {\n  const total = h * w;\n  const key0 = tileKey(group, 0, 0, blockNum);\n\n  if (tiles.has(key0)) {\n    const data = tiles.get(key0)!;\n    if (data.length >= total) {\n      return data.subarray(0, total);\n    }\n  }\n\n  const result = new Uint8Array(total);\n  const tilePositions: [number, number][] = [];\n  for (const key of tiles.keys()) {\n    const [g, tr, tc, bn] = parseTileKey(key);\n    if (g === group && bn === blockNum) {\n      tilePositions.push([tr, tc]);\n    }\n  }\n  if (tilePositions.length === 0) return result;\n\n  const nTileRows = Math.max(...tilePositions.map(([tr]) => tr)) + 1;\n  const nTileCols = Math.max(...tilePositions.map(([, tc]) => tc)) + 1;\n\n  const stdTileW = nTileCols === 1 ? w : TILE_SIZE;\n  const firstData = tiles.get(key0);\n  let stdTileH = firstData ? Math.floor(firstData.length / stdTileW) : TILE_SIZE;\n  stdTileH = Math.max(stdTileH, 1);\n\n  for (let tr = 0; tr < nTileRows; tr++) {\n    for (let tc = 0; tc < nTileCols; tc++) {\n      const key = tileKey(group, tr, tc, blockNum);\n      if (!tiles.has(key)) continue;\n\n      const data = tiles.get(key)!;\n      const tw = (tc === nTileCols - 1) ? (w - tc * stdTileW) : stdTileW;\n      let th = tw > 0 ? Math.floor(data.length / tw) : 0;\n      th = Math.min(th, h - tr * stdTileH);\n\n      for (let r = 0; r < th; r++) {\n        const srcStart = r * tw;\n        const dstRow = tr * stdTileH + r;\n        if (dstRow >= h) break;\n        const dstIdx = dstRow * w + tc * stdTileW;\n        result.set(data.subarray(srcStart, srcStart + tw), dstIdx);\n      }\n    }\n  }\n\n  return result;\n}\n\nexport function zigzagDecode(unsigned: Int32Array): Int32Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  const signed = new Int32Array(unsigned.length);\n  for (let i = 0; i < unsigned.length; i++) {\n    const n = unsigned[i]!;\n    signed[i] = n & 1 ? -((n + 1) >> 1) : n >> 1;\n  }\n  return signed;\n}\n\nfunction inverseHaarLevel(\n  ll: Uint16Array,\n  inH: number,\n  inW: number,\n  tiles: TileMap,\n  group: number,\n  outH: number,\n  outW: number\n): Uint16Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  // Get detail subband raw bytes\n  const lhLow = getSubbandBytes(tiles, group, 1, inH, inW);\n  const lhHigh = getSubbandBytes(tiles, group, 65537, inH, inW);\n  const hlLow = getSubbandBytes(tiles, group, 2, inH, inW);\n  const hlHigh = getSubbandBytes(tiles, group, 65538, inH, inW);\n  const hhLow = getSubbandBytes(tiles, group, 3, inH, inW);\n  const hhHigh = getSubbandBytes(tiles, group, 65539, inH, inW);\n  const overflow = getSubbandBytes(tiles, group, 4, inH, inW);\n\n  const n = inH * inW;\n\n  // Combine byte planes and apply overflow bits, then zigzag decode\n  const lhU = new Int32Array(n);\n  const hlU = new Int32Array(n);\n  const hhU = new Int32Array(n);\n  for (let i = 0; i < n; i++) {\n    const ov = overflow[i]!;\n    lhU[i] = (lhHigh[i]! * 256 + lhLow[i]!) | ((ov & 1) << 16);\n    hlU[i] = (hlHigh[i]! * 256 + hlLow[i]!) | (((ov >> 1) & 1) << 16);\n    hhU[i] = (hhHigh[i]! * 256 + hhLow[i]!) | (((ov >> 2) & 3) << 16);\n  }\n\n  const lh = zigzagDecode(lhU);\n  const hl = zigzagDecode(hlU);\n  const hh = zigzagDecode(hhU);\n\n  // Lifting scheme inverse Haar wavelet transform\n  const out00 = new Int32Array(n); // even row, even col\n  const out01 = new Int32Array(n); // even row, odd col\n  const out10 = new Int32Array(n); // odd row, even col\n  const out11 = new Int32Array(n); // odd row, odd col\n\n  for (let i = 0; i < n; i++) {\n    const s = ll[i]!; // LL (unsigned 16-bit)\n    const a = hl[i]!; // vertical detail\n    const b = lh[i]!; // horizontal detail\n    const c = hh[i]!; // diagonal detail\n\n    const z = s - (a >> 1);\n    const lInit = b - (c >> 1);\n    const aa = z - (lInit >> 1);\n    out00[i] = aa;\n    out01[i] = lInit + aa;\n    const lUpd = lInit + c;\n    const nVal = a + z - (lUpd >> 1);\n    out10[i] = nVal;\n    out11[i] = lUpd + nVal;\n  }\n\n  // Interleave into output\n  const output = new Int32Array(outH * outW);\n  const actualH = Math.min(inH * 2, outH);\n  const actualW = Math.min(inW * 2, outW);\n  const nEvenRows = (actualH + 1) >> 1;\n  const nOddRows = actualH >> 1;\n  const nEvenCols = (actualW + 1) >> 1;\n  const nOddCols = actualW >> 1;\n\n  // out00 → even rows, even cols\n  for (let r = 0; r < nEvenRows; r++) {\n    for (let c = 0; c < nEvenCols; c++) {\n      output[(r * 2) * outW + (c * 2)] = out00[r * inW + c]!;\n    }\n  }\n  // out01 → even rows, odd cols\n  for (let r = 0; r < nEvenRows; r++) {\n    for (let c = 0; c < nOddCols; c++) {\n      output[(r * 2) * outW + (c * 2 + 1)] = out01[r * inW + c]!;\n    }\n  }\n  // out10 → odd rows, even cols\n  for (let r = 0; r < nOddRows; r++) {\n    for (let c = 0; c < nEvenCols; c++) {\n      output[(r * 2 + 1) * outW + (c * 2)] = out10[r * inW + c]!;\n    }\n  }\n  // out11 → odd rows, odd cols\n  for (let r = 0; r < nOddRows; r++) {\n    for (let c = 0; c < nOddCols; c++) {\n      output[(r * 2 + 1) * outW + (c * 2 + 1)] = out11[r * inW + c]!;\n    }\n  }\n\n  // Handle odd output dimensions\n  if (outH > actualH && actualH > 0) {\n    for (let c = 0; c < outW; c++) {\n      output[actualH * outW + c] = output[(actualH - 1) * outW + c]!;\n    }\n  }\n  if (outW > actualW && actualW > 0) {\n    for (let r = 0; r < outH; r++) {\n      output[r * outW + actualW] = output[r * outW + actualW - 1]!;\n    }\n  }\n\n  // Convert to uint16\n  const result = new Uint16Array(outH * outW);\n  for (let i = 0; i < outH * outW; i++) {\n    result[i] = output[i]! & 0xffff;\n  }\n  return result;\n}\n\nexport function applyVoiLut(img16: Uint16Array, h: number, w: number, metadata: CloMetadata): Uint16Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  if (metadata.voi_lut) {\n    const start = metadata.voi_lut_start || 0;\n    const elements = metadata.voi_lut.length;\n    const result = new Uint16Array(h * w);\n    for (let i = 0; i < h * w; i++) {\n      let idx = img16[i]! - start;\n      if (idx < 0) idx = 0;\n      if (idx >= elements) idx = elements - 1;\n      result[i] = metadata.voi_lut[idx]!;\n    }\n    return result;\n  }\n\n  if (typeof metadata.window_center === \"number\" && metadata.window_width && metadata.window_width > 0) {\n    // The window is expressed in output units (Hounsfield for CT), but img16\n    // holds *stored* values. Run each pixel through the modality LUT first\n    // rather than comparing the two directly — with a typical intercept of\n    // -1024, a narrow soft-tissue window (centre 50, width 150) against raw\n    // stored values clips everything above 125, saturating the tissue to white\n    // and leaving only air with any gradation.\n    const slope = metadata.rescale_slope || 1;\n    const intercept = metadata.rescale_intercept ?? 0;\n    const lower = metadata.window_center - metadata.window_width / 2;\n    const upper = metadata.window_center + metadata.window_width / 2;\n    const bits = metadata.voi_lut_bits || 16;\n    const maxOut = (1 << bits) - 1;\n    const result = new Uint16Array(h * w);\n    for (let i = 0; i < h * w; i++) {\n      const value = img16[i]! * slope + intercept;\n      const v = (value - lower) / (upper - lower) * maxOut;\n      result[i] = Math.max(0, Math.min(maxOut, Math.round(v)));\n    }\n    return result;\n  }\n\n  return img16;\n}\n\nexport function to8bit(img: Uint16Array, invert: boolean): Uint8Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  let maxVal = 1;\n  for (let i = 0; i < img.length; i++) {\n    if (img[i]! > maxVal) maxVal = img[i]!;\n  }\n  const result = new Uint8Array(img.length);\n  for (let i = 0; i < img.length; i++) {\n    let v = Math.round(img[i]! / maxVal * 255);\n    if (v < 0) v = 0;\n    if (v > 255) v = 255;\n    if (invert) v = 255 - v;\n    result[i] = v;\n  }\n  return result;\n}\n\nexport function to16bit(img: Uint16Array, invert: boolean): Uint16Array {\n  // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n  let maxVal = 1;\n  for (let i = 0; i < img.length; i++) {\n    if (img[i]! > maxVal) maxVal = img[i]!;\n  }\n  const result = new Uint16Array(img.length);\n  for (let i = 0; i < img.length; i++) {\n    let v = Math.round(img[i]! / maxVal * 65535);\n    if (v < 0) v = 0;\n    if (v > 65535) v = 65535;\n    if (invert) v = 65535 - v;\n    result[i] = v;\n  }\n  return result;\n}\n\nfunction reconstructImageCore(\n  tiles: TileMap,\n  width: number,\n  height: number,\n  metadata: CloMetadata\n): { img16: Uint16Array; invert: boolean } {\n  if (!tiles.has(tileKey(-1, 0, 0, 65536))) {\n    throw new Error(\"Missing LL approximation block\");\n  }\n\n  // Count actual detail groups from tile data (groups >= 0 are detail levels)\n  const detailGroups = new Set<number>();\n  for (const key of tiles.keys()) {\n    const [g] = parseTileKey(key);\n    if (g >= 0) detailGroups.add(g);\n  }\n  const numDetailGroups = detailGroups.size;\n\n  const levels = computeWaveletLevels(width, height, numDetailGroups);\n  if (levels.length === 0) {\n    throw new Error(\"Image too small for wavelet decomposition\");\n  }\n\n  // levels.length was checked non-zero above; `!` for noUncheckedIndexedAccess.\n  const [ch, cw] = levels[0]!;\n\n  // Assemble LL (coarsest approximation)\n  let current = assembleSubbandU16(tiles, -1, 0, 65536, ch, cw);\n  let curH = ch;\n  let curW = cw;\n\n  // Progressive inverse Haar\n  for (let lvlIdx = 0; lvlIdx < levels.length; lvlIdx++) {\n    const group = lvlIdx;\n    let nextH: number, nextW: number;\n    if (lvlIdx + 1 < levels.length) {\n      [nextH, nextW] = levels[lvlIdx + 1]!;\n    } else {\n      nextH = height;\n      nextW = width;\n    }\n\n    let hasDetail = false;\n    for (const key of tiles.keys()) {\n      const [g, , , bn] = parseTileKey(key);\n      if (g === group && bn === 1) {\n        hasDetail = true;\n        break;\n      }\n    }\n\n    if (!hasDetail) {\n      const upscaled = new Uint16Array(nextH * nextW);\n      for (let r = 0; r < nextH; r++) {\n        const srcR = Math.min(Math.floor(r * curH / nextH), curH - 1);\n        for (let c = 0; c < nextW; c++) {\n          const srcC = Math.min(Math.floor(c * curW / nextW), curW - 1);\n          upscaled[r * nextW + c] = current[srcR * curW + srcC]!;\n        }\n      }\n      current = upscaled;\n      curH = nextH;\n      curW = nextW;\n      continue;\n    }\n\n    current = inverseHaarLevel(current, curH, curW, tiles, group, nextH, nextW);\n    curH = nextH;\n    curW = nextW;\n  }\n\n  // Apply display pipeline\n  const invert = metadata.photometric === \"MONOCHROME1\";\n  const displayed = applyVoiLut(current, curH, curW, metadata);\n  return { img16: displayed, invert };\n}\n\nfunction reconstructImage(\n  tiles: TileMap,\n  width: number,\n  height: number,\n  metadata: CloMetadata\n): Uint8Array {\n  const { img16, invert } = reconstructImageCore(tiles, width, height, metadata);\n  return to8bit(img16, invert);\n}\n\nfunction reconstructImage16(\n  tiles: TileMap,\n  width: number,\n  height: number,\n  metadata: CloMetadata\n): Uint16Array {\n  const { img16, invert } = reconstructImageCore(tiles, width, height, metadata);\n  return to16bit(img16, invert);\n}\n\n// ==================== Public API ====================\n\nfunction parseInputs(\n  pixelInput: string | Buffer,\n  wrapperInput?: string | Buffer,\n): { data: Buffer; width: number; height: number; metadata: CloMetadata; tiles: TileMap } {\n  const data = typeof pixelInput === 'string' ? readFileSync(pixelInput) : pixelInput;\n  const header = parsePixelHeader(data);\n  const { width, height } = header;\n\n  let metadata: CloMetadata = { photometric: \"MONOCHROME1\" };\n  if (wrapperInput) {\n    const hasWrapper = typeof wrapperInput === 'string' ? existsSync(wrapperInput) : true;\n    if (hasWrapper) {\n      try {\n        metadata = parseWrapper(wrapperInput);\n        if (!metadata.photometric) {\n          metadata.photometric = \"MONOCHROME1\";\n        }\n      } catch (err) {\n        logger.warn(`[clo_to_bitmap] Failed to parse wrapper, using defaults:`, (err as Error).message);\n      }\n    }\n  }\n\n  const tiles = extractTiles(data);\n  if (tiles.size === 0) {\n    throw new Error(\"No data blocks found in CLO file\");\n  }\n\n  return { data, width, height, metadata, tiles };\n}\n\nexport function convertCloToBitmap(\n  pixelInput: string | Buffer,\n  wrapperInput?: string | Buffer,\n): Bitmap {\n  const { width, height, metadata, tiles } = parseInputs(pixelInput, wrapperInput);\n  const pixels = reconstructImage(tiles, width, height, metadata);\n  return { pixels, width, height };\n}\n\nexport function convertCloToBitmap16(\n  pixelInput: string | Buffer,\n  wrapperInput?: string | Buffer,\n): Bitmap16 {\n  const { width, height, metadata, tiles } = parseInputs(pixelInput, wrapperInput);\n  const pixels = reconstructImage16(tiles, width, height, metadata);\n  return { pixels, width, height };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Minimal 16-bit grayscale PNG encoder.\n *\n * Sharp's `raw` input option accepts a `depth: 'ushort'` parameter, but\n * with prebuilt binaries it's silently ignored — the buffer is always\n * treated as 8-bit regardless. This means you can't pass a Uint16Array\n * directly to sharp and get correct 16-bit output.\n *\n * However, sharp CAN correctly read 16-bit PNGs (metadata shows\n * depth: 'ushort', bitsPerSample: 16). So we encode a valid 16-bit\n * grayscale PNG manually and feed it to sharp for further conversions\n * (TIFF, AVIF, JPEG, etc.). This is the bridge between our Uint16Array\n * pixel data and sharp's format conversion pipeline.\n */\n\nimport { deflateSync } from \"zlib\";\n\nexport function encode16bitPng(pixels: Uint16Array, width: number, height: number): Buffer {\n  const signature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);\n\n  // IHDR: width(4) + height(4) + bitdepth(1)=16 + colortype(1)=0(grayscale) + rest(3)\n  const ihdr = Buffer.alloc(13);\n  ihdr.writeUInt32BE(width, 0);\n  ihdr.writeUInt32BE(height, 4);\n  ihdr[8] = 16; // bit depth\n  ihdr[9] = 0;  // grayscale\n  ihdr[10] = 0; // compression method (deflate)\n  ihdr[11] = 0; // filter method\n  ihdr[12] = 0; // no interlace\n\n  // Row data: 1 filter byte + width * 2 bytes (big-endian 16-bit) per row\n  const rowSize = 1 + width * 2;\n  const raw = Buffer.alloc(rowSize * height);\n  for (let r = 0; r < height; r++) {\n    raw[r * rowSize] = 0; // filter type: None\n    for (let c = 0; c < width; c++) {\n      // Index accesses are `!`-asserted: bounds are established by the loop structure; noUncheckedIndexedAccess.\n      raw.writeUInt16BE(pixels[r * width + c]!, r * rowSize + 1 + c * 2);\n    }\n  }\n  const compressed = deflateSync(raw);\n\n  return Buffer.concat([\n    signature,\n    makeChunk(\"IHDR\", ihdr),\n    makeChunk(\"IDAT\", compressed),\n    makeChunk(\"IEND\", Buffer.alloc(0)),\n  ]);\n}\n\nfunction makeChunk(type: string, data: Buffer): Buffer {\n  const chunk = Buffer.alloc(4 + 4 + data.length + 4);\n  chunk.writeUInt32BE(data.length, 0);\n  chunk.write(type, 4);\n  data.copy(chunk, 8);\n\n  // CRC32 over type + data\n  const crcData = Buffer.concat([Buffer.from(type), data]);\n  let crc = 0xffffffff;\n  for (let i = 0; i < crcData.length; i++) {\n    crc ^= crcData[i]!; // i bounded by loop; noUncheckedIndexedAccess\n    for (let j = 0; j < 8; j++) {\n      crc = (crc >>> 1) ^ (crc & 1 ? 0xedb88320 : 0);\n    }\n  }\n  chunk.writeInt32BE(~crc, 8 + data.length);\n  return chunk;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Convert 16-bit grayscale bitmaps to JPEG using sharp.\n *\n * JPEG is inherently 8-bit, so 16-bit input is downsampled internally.\n * Uses quality 100 (maximum JPEG quality) by default.\n */\n\nimport sharp from \"sharp\";\nimport { writeFileSync } from \"fs\";\nimport type { Bitmap, Bitmap16 } from \"../clo_to_bitmap\";\nimport { encode16bitPng } from \"./png16\";\n\nexport interface JpgOptions {\n  /** JPEG quality 1-100. Default: 100 */\n  quality?: number;\n}\n\nexport async function convertBitmap16ToJpg(\n  bitmap: Bitmap16,\n  options?: JpgOptions,\n  outputPath?: string | null,\n): Promise<Buffer> {\n  const quality = options?.quality ?? 100;\n\n  const png = encode16bitPng(bitmap.pixels, bitmap.width, bitmap.height);\n  const buffer = await sharp(png).jpeg({ quality }).toBuffer();\n\n  if (outputPath) {\n    writeFileSync(outputPath, buffer);\n  }\n\n  return buffer;\n}\n\n/**\n * Encode an already-8-bit bitmap to JPEG at quality 100.\n *\n * Kept separate from `convertBitmap16ToJpg` rather than folded into it: this\n * path feeds sharp the 8-bit samples directly, where the 16-bit one goes via a\n * 16-bit PNG. Existing consumers depend on these exact bytes, so the two are\n * deliberately not unified.\n */\nexport async function convertBitmapToJpg(\n  bitmap: Bitmap,\n  outputPath?: string | null,\n): Promise<Buffer> {\n  const img = sharp(\n    Buffer.from(bitmap.pixels.buffer, bitmap.pixels.byteOffset, bitmap.pixels.byteLength),\n    { raw: { width: bitmap.width, height: bitmap.height, channels: 1 } },\n  );\n  const buffer = await img.jpeg({ quality: 100 }).toBuffer();\n  if (outputPath) writeFileSync(outputPath, buffer);\n  return buffer;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * `CapabilityContext.readFile` for the Node clients (CLI, Claude Desktop\n * extension): a message attachment is a path on this machine. Node only.\n */\n\nimport { promises as fs } from 'fs';\nimport * as os from 'os';\nimport * as path from 'path';\nimport type { FilePayload } from '../scrapers/myChart/core/filePayload';\nimport { DetailedError } from './detailedError';\n\n// Only the multipart part's Content-Type; MyChart judges a file by its\n// extension against GetComposeSettings, so an unlisted type still goes.\nconst MIME_TYPES: Record<string, string> = {\n  pdf: 'application/pdf',\n  jpg: 'image/jpeg',\n  jpeg: 'image/jpeg',\n  png: 'image/png',\n  gif: 'image/gif',\n  bmp: 'image/bmp',\n  tif: 'image/tiff',\n  tiff: 'image/tiff',\n  heic: 'image/heic',\n  txt: 'text/plain',\n  rtf: 'application/rtf',\n  doc: 'application/msword',\n  docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n  xls: 'application/vnd.ms-excel',\n  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n  mp4: 'video/mp4',\n  mov: 'video/quicktime',\n  m4v: 'video/x-m4v',\n};\n\nexport async function readLocalFile(ref: string): Promise<FilePayload> {\n  const resolved = path.resolve(ref.startsWith('~/') ? path.join(os.homedir(), ref.slice(2)) : ref);\n  const stat = await fs.stat(resolved).catch(() => undefined);\n  if (!stat?.isFile()) throw new DetailedError('No file at the attachment path given.', `Attachment not found: ${resolved}`);\n  const fileName = path.basename(resolved);\n  const ext = path.extname(fileName).slice(1).toLowerCase();\n  return {\n    fileName,\n    mimeType: MIME_TYPES[ext] ?? 'application/octet-stream',\n    bytes: new Uint8Array(await fs.readFile(resolved)),\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * `--action <capability-id>` — the CLI's generic capability dispatch.\n *\n * Lives in its own module so the parity test and the CLI's own unit tests can\n * drive these functions directly, without dragging in `cli.ts`'s login flow\n * and argv parsing.\n *\n * This is the CLI's only dispatch surface: the default no-`--action` run walks\n * {@link FULL_SCRAPE_CAPABILITIES}, and every named action resolves to a\n * registry id (directly, or through {@link CLI_ACTION_ALIASES}). That is what\n * guarantees the CLI can do everything the Claude Desktop extension and the\n * mobile app can — every entry in `shared/capabilities/` is a command here,\n * with no per-flag plumbing to remember — and that every read passes through\n * `executeCapability`'s active-patient guard.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { MyChartRequest } from '../../scrapers/myChart/core/myChartRequest';\nimport type { ImagingResultsStandard } from '../../scrapers/myChart/chart/labs/labResults';\nimport {\n  CAPABILITIES,\n  acceptsPatientParam,\n  capabilitiesByGroup,\n  COMMON_CAPABILITIES,\n  LESS_FREQUENTLY_USED_CAPABILITIES,\n  executeCapability,\n  MODE_PARAM,\n  acceptsModeParam,\n  getCapability,\n  type Capability,\n  type CapabilityContext,\n  type StudyImagePayload,\n  type FilePayload,\n} from '../../shared/capabilities';\nimport { convertCloToBitmap } from '../../scrapers/myChart/clo-image-parser/clo_to_bitmap';\nimport { convertBitmapToJpg } from '../../scrapers/myChart/clo-image-parser/exporters/to_jpg';\nimport { loadTotpSecret, saveTotpSecret } from './totpStore';\nimport { savePasskeyCredential } from './passkeyStore';\nimport { readLocalFile } from '../../shared/readLocalFile';\nimport type { PasskeyCredential } from '../../scrapers/myChart/auth/softwareAuthenticator';\nimport { detailedMessage } from '../../shared/detailedError';\n\n/**\n * Dashed action names the CLI accepted back when each had a hand-written\n * handler. Each now resolves to the registry capability that replaced it —\n * same fetch, same active-patient guard, JSON output. (`get-imaging` is the\n * one dashed action that is not a plain alias; see\n * {@link downloadAllImagingStudies}.)\n */\nexport const CLI_ACTION_ALIASES: Readonly<Record<string, string>> = {\n  'list-proxies': 'list_proxy_targets',\n  'get-thread': 'get_message_thread',\n  'delete-message': 'delete_message',\n  'request-refill': 'request_refill',\n};\n\n/** Resolve an `--action` value to a registry capability, dashed spellings included. */\nexport function resolveCliAction(action: string): Capability | undefined {\n  return getCapability(CLI_ACTION_ALIASES[action] ?? action);\n}\n\n/**\n * What a bare `mychart-cli --host <hostname>` scrapes: every chart-reading\n * capability that can run without arguments. Derived from the registry, never\n * hand-listed — a read capability added there is scraped here the same day.\n * Excluded by the predicate itself: writes and account-security operations,\n * the `public` directory lookups (nothing to do with this chart), reads that\n * require an argument (per-visit notes, single threads), the media capability\n * (bytes belong behind an explicit `--action`), and the `Patients` group\n * (session introspection, not chart data).\n */\nexport const FULL_SCRAPE_CAPABILITIES: readonly Capability[] = CAPABILITIES.filter(\n  (capability) =>\n    capability.kind === 'read' &&\n    !capability.rendersMedia &&\n    !capability.returnsFile &&\n    acceptsPatientParam(capability) &&\n    capability.params.every((param) => !param.required),\n);\n\n/** How much of the registry a listing prints. */\nexport interface CapabilityListOptions {\n  /**\n   * Include the {@link Capability.lessFrequentlyUsed} entries too. Off by\n   * default: a full dump of the registry buries the handful of capabilities\n   * that are the reason to connect an account at all.\n   */\n  showAll?: boolean | undefined;\n}\n\nfunction renderCapabilityGroups(capabilities: readonly Capability[]): string[] {\n  const lines: string[] = [];\n  for (const { group, capabilities: inGroup } of capabilitiesByGroup(capabilities)) {\n    lines.push('', `  -- ${group} --`);\n    for (const capability of inGroup) {\n      // Anything that isn't a plain read gets a marker, so a glance down the\n      // list separates \"shows me something\" from \"changes something\". The\n      // public lookups read too — they just read something other than a chart,\n      // and a capability with no scraper changes nothing whatever its `kind`\n      // says about the write it will be once implemented.\n      const marker =\n        capability.kind === 'read' || capability.kind === 'public' || capability.notImplemented ? ' ' : '!';\n      lines.push(`   ${marker} ${capability.id}`);\n      lines.push(`       ${capability.description}`);\n      for (const param of capability.params) {\n        lines.push(\n          `       --arg ${param.name}=<${param.type}>${param.required ? ' (required)' : ''}  ${param.description}`,\n        );\n      }\n    }\n  }\n  return lines;\n}\n\n/**\n * The capabilities, grouped, with the parameters each takes.\n *\n * By default this is the commonly-used set only, with a pointer to\n * `--show-all` for the rest — the hidden entries stay every bit as runnable,\n * they just don't crowd out labs and medications in a 50-entry wall of text.\n * `--show-all` appends them under their own heading rather than mixing them\n * back in, so the shape of the default listing doesn't change under the reader.\n */\nexport function renderCapabilityList(options: CapabilityListOptions = {}): string {\n  const lines: string[] = [\n    '',\n    '='.repeat(60),\n    '  Capabilities',\n    '='.repeat(60),\n    '',\n    '  Run one with:  mychart-cli --host <hostname> --action <id> [--arg name=value ...]',\n    '  The Providers and Directory lookups are public — no --host and no credentials:',\n    '                 mychart-cli --action lookup_npi --arg npi=1234567893',\n    ...renderCapabilityGroups(COMMON_CAPABILITIES),\n  ];\n\n  if (options.showAll) {\n    lines.push(\n      '',\n      '='.repeat(60),\n      '  Less frequently used',\n      '='.repeat(60),\n      '',\n      '  Supported, and rarely what you want: endpoints most charts leave empty,',\n      \"  and settings for the account's own sign-in. Run them the same way.\",\n      ...renderCapabilityGroups(LESS_FREQUENTLY_USED_CAPABILITIES),\n    );\n  }\n\n  lines.push(\n    '',\n    \"  ! marks a command that changes something — a write to the chart, or the account's own sign-in settings.\",\n    '  Commands that produce images write JPEGs to ./imaging-output (override with --output <dir>).',\n  );\n  if (!options.showAll) {\n    lines.push(\n      `  ${LESS_FREQUENTLY_USED_CAPABILITIES.length} less-frequently-used capabilities are hidden. Show them with:`,\n      '      mychart-cli --list-capabilities --show-all',\n    );\n  }\n  lines.push('');\n  return lines.join('\\n');\n}\n\n/**\n * Per-account context for the capabilities that touch credentials. The\n * password comes from whatever resolved this session; the TOTP secret and the\n * passkey come from the CLI's own on-disk stores.\n */\nexport async function capabilityContext(\n  hostname: string,\n  password: string | undefined,\n): Promise<CapabilityContext> {\n  return {\n    password,\n    totpSecret: (await loadTotpSecret(hostname)) ?? undefined,\n    saveTotpSecret: (secret: string) => saveTotpSecret(hostname, secret),\n    savePasskey: async (serialized: string) => {\n      await savePasskeyCredential(hostname, JSON.parse(serialized) as PasskeyCredential);\n    },\n    readFile: readLocalFile,\n  };\n}\n\n/**\n * `--arg` values arrive as strings; numeric and boolean parameters are coerced\n * so a capability sees the type it declared.\n *\n * An unknown `--arg` is an error rather than a silent no-op — a typo'd\n * parameter name would otherwise look like the capability ignoring the\n * request, which is the worst way to find out you fetched the wrong note.\n */\nexport function coerceCapabilityArgs(\n  capability: Capability,\n  args: Record<string, string>,\n): Record<string, unknown> {\n  const known = new Map(capability.params.map((p) => [p.name, p]));\n  const out: Record<string, unknown> = {};\n\n  for (const [name, raw] of Object.entries(args)) {\n    const param = known.get(name);\n    if (!param) {\n      const accepted = capability.params.map((p) => p.name).join(', ') || '(none)';\n      throw new Error(`${capability.id} has no argument \"${name}\". It accepts: ${accepted}`);\n    }\n    if (param.type === 'number') {\n      const n = Number(raw);\n      if (!Number.isFinite(n)) throw new Error(`--arg ${name} expects a number, got \"${raw}\".`);\n      if (param.min !== undefined && n < param.min) throw new Error(`--arg ${name} must be at least ${param.min}.`);\n      if (param.max !== undefined && n > param.max) throw new Error(`--arg ${name} must be at most ${param.max}.`);\n      out[name] = n;\n    } else if (param.type === 'boolean') {\n      out[name] = raw !== 'false' && raw !== '0';\n    } else if (param.type === 'string[]') {\n      out[name] = raw.split(',').map((item) => item.trim()).filter(Boolean);\n    } else {\n      out[name] = raw;\n    }\n  }\n\n  for (const param of capability.params) {\n    if (param.required && out[param.name] === undefined) {\n      throw new Error(`${capability.id} requires --arg ${param.name}=<${param.type}> (${param.description})`);\n    }\n  }\n  return out;\n}\n\n/**\n * Raw image bytes would swamp a terminal; summarize them instead.\n *\n * JSON.stringify calls `toJSON()` *before* the replacer sees a value, so a\n * Node `Buffer` arrives here as `{type: 'Buffer', data: [...]}`, not as a\n * `Uint8Array` — both shapes must be caught or a single downloaded image\n * prints as tens of thousands of lines of byte values.\n */\nexport function jsonSafeReplacer(_key: string, value: unknown): unknown {\n  if (value instanceof Uint8Array) return `<${value.length} bytes>`;\n  // JSON.stringify invokes Buffer.toJSON() *before* the replacer sees the\n  // value, so a Buffer arrives here already converted to\n  // { type: 'Buffer', data: number[] } — catch that shape too.\n  if (\n    value !== null &&\n    typeof value === 'object' &&\n    (value as { type?: unknown }).type === 'Buffer' &&\n    Array.isArray((value as { data?: unknown }).data)\n  ) {\n    return `<${(value as { data: unknown[] }).data.length} bytes>`;\n  }\n  return value;\n}\n\n/** One JPEG written to disk by {@link writeStudyImages}. */\nexport interface WrittenStudyImage {\n  filePath: string;\n  seriesUID: string;\n  seriesDescription: string;\n  width: number;\n  height: number;\n  jpegBytes: number;\n}\n\n/**\n * The CLI's rendering of a `rendersMedia` capability: decode each raw CLO\n * image in the payload and write it to `outputDir` as a JPEG the user can\n * open in Finder. The registry's contract is that `run` returns raw CLO\n * bytes and each client encodes them its own way — this is the CLI's way,\n * kept separate from `runCapabilityAction` so it can be tested without a\n * MyChart session.\n */\nexport async function writeStudyImages(\n  payload: StudyImagePayload,\n  outputDir: string,\n  options: { saveClo?: boolean | undefined } = {},\n): Promise<WrittenStudyImage[]> {\n  await fs.promises.mkdir(outputDir, { recursive: true });\n  const safeStudy = (payload.studyName || 'study').replace(/[^a-zA-Z0-9_-]/g, '_').substring(0, 80);\n  const written: WrittenStudyImage[] = [];\n\n  for (const image of payload.images) {\n    if (!image.pixelData) continue;\n    const safeSeries = image.seriesDescription.replace(/[^a-zA-Z0-9_-]/g, '_');\n    const baseName = `${safeStudy}_${String(image.index).padStart(3, '0')}_${safeSeries}`;\n    const filePath = path.join(outputDir, `${baseName}.jpg`);\n    if (options.saveClo) {\n      await fs.promises.writeFile(path.join(outputDir, `${baseName}_pixel.clo`), image.pixelData);\n      if (image.wrapperData) {\n        await fs.promises.writeFile(path.join(outputDir, `${baseName}_wrapper.clo`), image.wrapperData);\n      }\n    }\n    const bitmap = convertCloToBitmap(\n      Buffer.from(image.pixelData),\n      image.wrapperData ? Buffer.from(image.wrapperData) : undefined,\n    );\n    const jpeg = await convertBitmapToJpg(bitmap, filePath);\n    written.push({\n      filePath,\n      seriesUID: image.seriesUID,\n      seriesDescription: image.seriesDescription,\n      width: bitmap.width,\n      height: bitmap.height,\n      jpegBytes: jpeg.length,\n    });\n  }\n  return written;\n}\n\n/**\n * The CLI's rendering of a `returnsFile` payload: the bytes written under\n * `outputDir` as `fileName` (the scraper already made it a safe basename), a\n * numeric suffix keeping a re-download from overwriting the first. Returns\n * the path written.\n */\nexport async function writeFilePayload(payload: FilePayload, outputDir: string): Promise<string> {\n  await fs.promises.mkdir(outputDir, { recursive: true });\n  const { name, ext } = path.parse(path.basename(payload.fileName));\n  for (let attempt = 1; attempt <= 100; attempt++) {\n    const filePath = path.join(outputDir, attempt === 1 ? `${name}${ext}` : `${name}-${attempt}${ext}`);\n    try {\n      await fs.promises.writeFile(filePath, payload.bytes, { flag: 'wx' });\n      return filePath;\n    } catch (err) {\n      if ((err as NodeJS.ErrnoException).code !== 'EEXIST') throw err;\n    }\n  }\n  throw new Error(`Could not write ${payload.fileName} under ${outputDir} — 100 copies already exist.`);\n}\n\n/**\n * Run one capability against one session and print its JSON result.\n *\n * Dispatch goes through `executeCapability`, never `capability.run` — that is\n * where the active-patient assertion lives. `patient` is folded in after\n * coercion, since `coerceCapabilityArgs` rejects any name a capability didn't\n * declare and this one is declared by the registry.\n */\nexport async function runCapabilityAction(\n  capability: Capability,\n  session: { hostname: string; request: MyChartRequest },\n  password: string | undefined,\n  args: Record<string, string>,\n  outputDir?: string,\n  patient?: string,\n  mode?: string,\n): Promise<boolean> {\n  console.log(`\\n${'='.repeat(60)}\\n  ${capability.title}: ${session.hostname}\\n${'='.repeat(60)}`);\n  try {\n    const ctx = await capabilityContext(session.hostname, password);\n    // `mode` is declared by the registry, not by each capability, so it is\n    // taken out before coercion (which rejects undeclared names) and folded in\n    // after. `--arg mode=` and `--mode` are the same thing; the former wins.\n    const { [MODE_PARAM.name]: argMode, ...ownArgs } = args;\n    const coerced = coerceCapabilityArgs(capability, ownArgs);\n    const requestedMode = argMode ?? mode;\n    if (requestedMode !== undefined && acceptsModeParam(capability)) coerced[MODE_PARAM.name] = requestedMode;\n    // `patient` is declared by the registry, not by each capability, so it is\n    // folded in AFTER coercion — coerceCapabilityArgs rejects any name the\n    // capability did not declare. An explicit argument wins: on\n    // switch_proxy_target, `patient` is the declared switch target, which the\n    // --patient assertion flag must not clobber.\n    if (patient !== undefined && coerced.patient === undefined) coerced.patient = patient;\n    // executeCapability, never capability.run: the active-patient assertion\n    // lives there, and it has to run for media capabilities too.\n    const result = await executeCapability(session.request, capability.id, coerced, ctx);\n\n    if (capability.returnsFile) {\n      // A file payload becomes exactly that: the file, under --output (default: the current directory).\n      const { bytes, ...rest } = result as FilePayload;\n      const filePath = await writeFilePayload(result as FilePayload, path.resolve(outputDir ?? process.cwd()));\n      console.log(JSON.stringify({ filePath, sizeBytes: bytes.length, ...rest }, jsonSafeReplacer, 2));\n      return true;\n    }\n\n    if (capability.rendersMedia) {\n      // Media payloads become files on disk, never bytes in the terminal.\n      const payload = result as StudyImagePayload;\n      const dir = path.resolve(outputDir ?? path.join(process.cwd(), 'imaging-output'));\n      const files = await writeStudyImages(payload, dir);\n      console.log(JSON.stringify({\n        studyName: payload.studyName,\n        totalImages: payload.totalImages,\n        outputDir: dir,\n        images: files,\n        errors: payload.errors,\n      }, jsonSafeReplacer, 2));\n      // Partial success still wrote files worth exploring; only a run that\n      // produced nothing but errors is a failure.\n      return files.length > 0 || payload.errors.length === 0;\n    }\n\n    // The markdown modes are text already; the data modes are printed as JSON.\n    console.log(typeof result === 'string' ? result : JSON.stringify(result, jsonSafeReplacer, 2));\n    return true;\n  } catch (err) {\n    console.log(`  ${detailedMessage(err)}`);\n    return false;\n  }\n}\n\n/**\n * `--action lookup_npi` and friends — a `public` capability, run once, with no\n * account and no session.\n *\n * Deliberately separate from {@link runCapabilityAction} rather than a branch\n * inside it: that function's whole signature is per-session (a hostname, the\n * password that opened it, the patient to assert), and none of it means\n * anything here. `cli.ts` calls this before it asks for a single credential.\n */\nexport async function runPublicCapabilityAction(\n  capability: Capability,\n  args: Record<string, string>,\n): Promise<boolean> {\n  console.log(`\\n${'='.repeat(60)}\\n  ${capability.title}\\n${'='.repeat(60)}`);\n  try {\n    const coerced = coerceCapabilityArgs(capability, args);\n    // executeCapability with no session: a public capability's `run` cannot\n    // take one, and this keeps \"no client reaches capability.run\" absolute.\n    const result = await executeCapability(null, capability.id, coerced);\n    console.log(typeof result === 'string' ? result : JSON.stringify(result, jsonSafeReplacer, 2));\n    return true;\n  } catch (err) {\n    console.log(`  ${detailedMessage(err)}`);\n    return false;\n  }\n}\n\n/**\n * `--action get-imaging` — every imaging study on the account, downloaded and\n * decoded to JPEGs under `<outputDir>/<hostname>/`, with the full result\n * metadata (reports included) saved as `all-imaging.json`.\n *\n * This is the one dashed action that is a composite rather than an alias: it\n * chains `get_imaging_results` into one `download_imaging_study` per study.\n * Both steps go through `executeCapability`, so the active-patient guard\n * applies to each — this used to be a 220-line hand-written handler that\n * fetched around the guard entirely.\n */\nexport async function downloadAllImagingStudies(\n  session: { hostname: string; request: MyChartRequest },\n  password: string | undefined,\n  // Every field here comes straight off a parsed CLI flag, so an unset flag is an\n  // explicit undefined rather than an absent key.\n  options: { outputDir?: string | undefined; patient?: string | undefined; saveClo?: boolean | undefined } = {},\n): Promise<boolean> {\n  console.log(`\\n${'='.repeat(60)}\\n  Imaging: ${session.hostname}\\n${'='.repeat(60)}`);\n  try {\n    const ctx = await capabilityContext(session.hostname, password);\n    const patientArg = options.patient !== undefined ? { patient: options.patient } : {};\n    // Pinned to `json` because this walks the processor's standard object\n    // (`{ orders }`); the default mode, or a --mode passed through later,\n    // must not hand it markdown or the raw response instead.\n    const { orders } = (await executeCapability(\n      session.request,\n      'get_imaging_results',\n      { ...patientArg, mode: 'json' },\n      ctx,\n    )) as ImagingResultsStandard;\n\n    const hostDir = path.resolve(\n      options.outputDir ?? path.join(process.cwd(), 'imaging-output'),\n      session.hostname,\n    );\n    await fs.promises.mkdir(hostDir, { recursive: true });\n    const metadataPath = path.join(hostDir, 'all-imaging.json');\n    await fs.promises.writeFile(metadataPath, JSON.stringify(orders, jsonSafeReplacer, 2));\n    console.log(`  ${orders.length} imaging result(s); metadata and reports in ${metadataPath}`);\n\n    let ok = true;\n    for (const study of orders) {\n      // No image_id means no viewable pictures — the report text is already\n      // in all-imaging.json, so there is nothing more to download.\n      if (!study.image_id) continue;\n      try {\n        const payload = (await executeCapability(\n          session.request,\n          'download_imaging_study',\n          { ...patientArg, image_id: study.image_id, study_name: study.orderName },\n          ctx,\n        )) as StudyImagePayload;\n        const files = await writeStudyImages(payload, hostDir, { saveClo: options.saveClo });\n        console.log(`  ${payload.studyName}: wrote ${files.length} of ${payload.totalImages} image(s)`);\n        for (const message of payload.errors) console.log(`    warning: ${message}`);\n        if (files.length === 0 && payload.errors.length > 0) ok = false;\n      } catch (err) {\n        console.log(`  ${study.orderName ?? 'study'}: ${detailedMessage(err)}`);\n        ok = false;\n      }\n    }\n    return ok;\n  } catch (err) {\n    console.log(`  ${detailedMessage(err)}`);\n    return false;\n  }\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * `--help` — what the CLI is and every flag it takes, followed by the\n * capability listing.\n *\n * This lives outside `cli.ts` for the same reason `capabilityActions.ts` does:\n * a test asserts that the default listing leads with the useful capabilities\n * and holds the rest back, and rendering the text should cost nothing beyond\n * importing this module.\n */\n\nimport { renderCapabilityList, type CapabilityListOptions } from './capabilityActions';\n\n/**\n * The full help text.\n *\n * The flag sections are always shown in full — there are only a couple of dozen\n * flags and hiding one would just mean a reader failing to find it. What\n * `showAll` gates is the capability listing, which is fifty entries of wildly\n * uneven value; see `Capability.lessFrequentlyUsed`.\n */\nexport function renderCliHelp(options: CapabilityListOptions = {}): string {\n  const lines: string[] = [\n    '',\n    '  mychart-cli — read and act on an Epic MyChart account from the terminal.',\n    '',\n    '  Usage:',\n    '    mychart-cli --host <hostname>                         Scrape every category and print it',\n    '    mychart-cli --host <hostname> --action <capability>   Run one capability, print JSON',\n    '    mychart-cli --help [--show-all]                       This text',\n    '    mychart-cli --list-capabilities [--show-all]          Just the capability listing',\n    '',\n    '  Signing in:',\n    '    --host <hostname>          MyChart hostname, e.g. mychart.example.org',\n    '    --user <u> --pass <p>      Credentials; omit to look them up in the browser password stores',\n    '    --read-login-from-browser  Force a browser password-store lookup (with or without --host)',\n    '    --2fa <code>               Supply the 2FA code instead of being prompted for it',\n    '    --no-cache                 Ignore the cached session cookies and log in fresh',\n    '',\n    \"  Whose chart (accounts with proxy access to a family member's record):\",\n    '    --patient \"<name>\"         Assert the record this command is about; defaults to the account holder',\n    '    --switch \"<name>\"          Change the record MyChart has active. The only command that does',\n    '    --action list-proxies      Every record this account can reach',\n    '',\n    '  Running a capability:',\n    '    --action <id>              Any id from the listing below',\n    '    --arg name=value           A capability argument; repeat for each one',\n    '',\n    '  Public information, no account or credentials needed:',\n    '    --action search_mycharts --arg query=uchealth        Find a health system\\'s MyChart hostname',\n    '    --action lookup_npi --arg npi=1234567893             A provider, by National Provider Identifier',\n    '    --action search_npi_registry --arg last_name=Hibbert --arg state=IL',\n    '    --host <hostname> --action hospital-info',\n    '                               The health system behind a MyChart hostname: support lines, the',\n    '                               bookable provider directory with clinic addresses, billing entities.',\n    '                               --arg specialties=a,b limits the crawl; --arg providers=false skips it',\n    '    --action list-mycharts [--output <file>]',\n    '                               Every MyChart in Epic\\'s directory as JSON, each login URL checked',\n    '                               and corrected where Epic\\'s points elsewhere. Takes a few minutes',\n    '',\n    '  The interactive actions, which prompt for whatever is not given as a flag:',\n    '    --action send-message [--subject <s>] [--message <m>]',\n    '    --action send-reply --conversation-id <id> [--message <m>]',\n    '    --action keep-alive-test   Hold the session open, pinging KeepAlive until Ctrl+C',\n    '',\n    '  Older dashed spellings, still accepted — each is an alias for a registry capability:',\n    '    --action get-imaging       Every imaging study, downloaded and decoded to JPEGs',\n    '    --action get-thread --conversation-id <id>       One conversation\\'s messages',\n    '    --action delete-message --conversation-id <id>   Delete a conversation from the inbox',\n    '    --action request-refill --arg medication_name=…  Refills (declared, not implemented)',\n    '    --action list-proxies                            Patient records this account can reach',\n    '',\n    \"  The account's own sign-in settings:\",\n    '    --set-up-passkey           Register a passkey and save it locally',\n    '    --use-passkey              Log in with the saved passkey instead of a password',\n    '    --list-passkeys            Passkeys registered on the account',\n    '    --delete-passkey           Remove every passkey from the account',\n    '    --set-up-totp              Turn on authenticator-app 2FA and save the secret',\n    '    --use-saved-totp           Generate the 2FA code from the saved secret',\n    '    --disable-totp             Turn authenticator-app 2FA back off',\n    '',\n    '  Other:',\n    '    --output <dir>             Where downloaded images go (default ./imaging-output)',\n    '    --mode <mode>              Output mode for reads: raw | standard | concise | json (default json)',\n    '    --local                    Talk HTTP instead of HTTPS (for a local fake-mychart)',\n    '    --save-clo                 Keep the raw CLO bytes alongside downloaded images',\n    '    --show-all                 Include the less-frequently-used capabilities in the listing',\n    renderCapabilityList(options),\n  ];\n  return lines.join('\\n');\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Plumbing for MyChart's anonymous surface.\n *\n * The pre-login pages behave like the post-login ones in one way that matters:\n * every JSON endpoint behind them is a POST that requires the antiforgery\n * token from the page that hosts it, sent back as a header of the same name,\n * on the session cookie that page set. So \"call an anonymous endpoint\" is\n * always \"open its page first\". This module does that once per page and hands\n * the token around.\n *\n * These are raw `makeRequest` calls on purpose. `makeAuthenticatedRequest`\n * exists to notice an expired login and re-login; there is no login here to\n * expire, and its login-page detector would misread every one of these pages\n * (they *are* the login shell, with a different activity in the middle).\n *\n * ## The two error surfaces\n *\n * A rejected call — wrong payload, missing token, a feature the org switched\n * off — never comes back as a JSON error. The November 2025 release answers\n * 302 → `/Home/FiveHundred` → `/Home/Error?code=14` → a 200 HTML error page;\n * August 2025 answers a bare 500 HTML page. `postForm` refuses to follow the\n * redirect and treats anything that is not a 200 JSON body as the same\n * failure, so a caller sees one `PreloginEndpointError` on either release\n * instead of `SyntaxError: Unexpected token '<'`.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { getRequestVerificationTokenFromBody } from '../core/util';\n\nconst TOKEN_HEADER = '__RequestVerificationToken';\n\nexport class PreloginEndpointError extends Error {\n  constructor(\n    message: string,\n    readonly path: string,\n    readonly status: number,\n  ) {\n    super(message);\n    this.name = 'PreloginEndpointError';\n  }\n}\n\n/** A pre-login page and the antiforgery token it issued. */\nexport type PreloginPage = {\n  html: string;\n  token: string | null;\n  /** Where the request ended up after redirects, relative to the mount. */\n  finalUrl: string;\n};\n\n/**\n * Open a pre-login page under the discovered mount.\n *\n * Redirects are followed: `/GuestEstimates` bounces to its first step, and a\n * feature the org has switched off bounces to the login page — the caller\n * tells those apart by looking at what came back, not by the status.\n */\nexport async function openPreloginPage(request: MyChartRequest, path: string): Promise<PreloginPage> {\n  const response = await request.makeRequest({ path });\n  const html = await response.text();\n  if (response.status >= 400) {\n    throw new PreloginEndpointError(`GET ${path} answered ${response.status}`, path, response.status);\n  }\n  return {\n    html,\n    token: getRequestVerificationTokenFromBody(html) ?? null,\n    finalUrl: response.url || path,\n  };\n}\n\n/**\n * Encode a payload the way MyChart's own page JS does (`$$WPUtil.postify`).\n *\n * Nested objects are `outer.inner=value`; brackets are for array indices only,\n * so a list of objects is `list[0].Field=value`. This is not jQuery's\n * `outer[inner]` convention, and the difference is not cosmetic: the ASP.NET\n * model binder behind the scheduling endpoints rejects the bracket form with a\n * 500 (November 2025 release) or a 302 to the error page (August 2025).\n *\n * Confirmed by replaying one captured `GetSlots` body against a live instance\n * in both encodings — byte-for-byte identical except the separators, 200 for\n * dots and 500 for brackets. Some endpoints bind either form, which is why the\n * bracket version worked on the first instance it was tried against.\n */\nexport function encodeForm(data: Record<string, unknown>): string {\n  const params = new URLSearchParams();\n  const add = (key: string, value: unknown) => {\n    if (value === undefined || value === null) return;\n    if (Array.isArray(value)) {\n      value.forEach((v, i) => add(`${key}[${i}]`, v));\n    } else if (typeof value === 'object') {\n      for (const [k, v] of Object.entries(value as Record<string, unknown>)) add(`${key}.${k}`, v);\n    } else {\n      // Primitives only by now; JSON.stringify renders numbers and booleans\n      // the way jQuery's serializer does (\"1\", \"true\").\n      params.append(key, typeof value === 'string' ? value : JSON.stringify(value));\n    }\n  };\n  for (const [k, v] of Object.entries(data)) add(k, v);\n  return params.toString();\n}\n\n/**\n * POST a form-encoded payload to an anonymous endpoint and parse the JSON it\n * returns. Throws {@link PreloginEndpointError} on either release's error\n * surface rather than handing back an HTML error page as data.\n */\nexport async function postForm<T>(\n  request: MyChartRequest,\n  path: string,\n  token: string | null,\n  data: Record<string, unknown>,\n  referer: string,\n): Promise<T> {\n  if (!token) {\n    throw new PreloginEndpointError(`no antiforgery token to call ${path} with`, path, 0);\n  }\n  const origin = `${request.protocol}://${request.hostname}`;\n  const response = await request.makeRequest({\n    method: 'POST',\n    path,\n    body: encodeForm(data),\n    followRedirects: false,\n    headers: {\n      [TOKEN_HEADER]: token,\n      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n      'X-Requested-With': 'XMLHttpRequest',\n      Origin: origin,\n      Referer: `${origin}${request.firstPathPart ? '/' + request.firstPathPart : ''}${referer}`,\n    },\n  });\n\n  const contentType = response.headers.get('content-type') ?? '';\n  if (response.status !== 200 || !contentType.includes('json')) {\n    throw new PreloginEndpointError(\n      `POST ${path} was refused (${response.status}${contentType ? ', ' + contentType.split(';')[0] : ''}) — ` +\n        'the payload was not what this release expects, or the feature is switched off on this instance',\n      path,\n      response.status,\n    );\n  }\n  return (await response.json()) as T;\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Billing entities and facilities, from the guest price-estimate flow.\n *\n * `/<mount>/GuestEstimates` is the CMS price-transparency tool, open to\n * anyone. Its first two steps are plain pages with their data inlined in a\n * script block, which is all this module reads:\n *\n *   GET GuestEstimates              → 302 → GuestEstimates/SelectServiceArea\n *   GET GuestEstimates/SelectServiceArea\n *       $$WP.Estimates.RecentSAs = [...];  $$WP.Estimates.OtherSAs = [{Id,Title,Phone,PhoneText,LogoURL,SelectLocations,…}]\n *   GET GuestEstimates/SelectLocation?svcArea=<id>&isMultiSA=true      (only when SelectLocations is true)\n *       var model = {\"Locations\":[{Id,Title,…}],\"ServiceArea\":…,\"IsGuest\":true,\"HasCompletedCaptcha\":false,…}\n *\n * A \"service area\" is a billing entity — the hospital system, a physicians'\n * group, an affiliated practice — each with its own customer-service line.\n * `SelectLocation` then lists the hospitals and campuses under it.\n *\n * The flow continues to `AcceptDisclaimer` and, two steps later, the payer\n * picker. That is where accepted insurance lives, and it is not read here:\n * the disclaimer's accept step runs an invisible reCAPTCHA (the location\n * model says so — `HasCompletedCaptcha`), and the scraper does not solve\n * captchas. See `types.ts` `InsuranceAvailability`.\n *\n * Verified on five instances; the inlined field set is identical on all of\n * them. The page keeps `RecentSAs` (areas this visitor used before, always\n * empty for a fresh session) apart from `OtherSAs`; both are read.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { logger } from '../../../shared/logger';\nimport { rec } from '../processors/read';\nimport type { GuestEstimatesLocationModel, GuestEstimatesServiceArea, Location } from './mychart.types';\nimport { openPreloginPage } from './preloginSession';\nimport type { BillingEntity } from './types';\n\nconst GUEST_ESTIMATES_PATH = '/GuestEstimates';\n\nexport type RawServiceArea = GuestEstimatesServiceArea & { Id: string; Title: string };\n\n/**\n * The JSON value that starts at `start`: the shortest prefix `JSON.parse`\n * accepts.\n *\n * A value starting with `[` or `{` has no proper prefix that is itself valid\n * JSON — a prefix only parses once its brackets balance, which is the whole\n * value — so the first prefix that parses is the end of it. Letting the real\n * parser decide is what keeps a `]` inside a title, an escaped quote, or a\n * second statement on the same line from ending the value early.\n */\nfunction valueAt(html: string, start: number): unknown {\n  for (let end = start + 1; end <= html.length; end++) {\n    const ch = html[end - 1];\n    if (ch !== ']' && ch !== '}') continue;\n    try {\n      return JSON.parse(html.slice(start, end));\n    } catch {\n      // Not the end of the value yet.\n    }\n  }\n  return undefined;\n}\n\n/** Read one `$$WP.Estimates.<name> = [...]` assignment out of the page. */\nfunction readAssignment(html: string, name: string): unknown {\n  const m = new RegExp(`\\\\$\\\\$WP\\\\.Estimates\\\\.${name}\\\\s*=\\\\s*`).exec(html);\n  return m ? valueAt(html, m.index + m[0].length) : undefined;\n}\n\n/** The billing entities on the service-area page, or null if it isn't one. */\nexport function parseServiceAreas(html: string): RawServiceArea[] | null {\n  const recent = readAssignment(html, 'RecentSAs');\n  const other = readAssignment(html, 'OtherSAs');\n  if (!Array.isArray(recent) && !Array.isArray(other)) return null;\n  const all = [...(Array.isArray(recent) ? recent : []), ...(Array.isArray(other) ? other : [])];\n  return all\n    .map((a) => rec<GuestEstimatesServiceArea>(a))\n    .filter((a): a is RawServiceArea => typeof a.Id === 'string' && typeof a.Title === 'string');\n}\n\n/** The `var model = {...}` on the location page, or null if it isn't one. */\nexport function parseLocationModel(html: string): GuestEstimatesLocationModel | null {\n  // Not a `$$WP.` assignment: the page wraps it in `$(function () { … })`,\n  // with more statements after it on the same line.\n  const m = /var\\s+model\\s*=\\s*/.exec(html);\n  if (!m) return null;\n  const model = valueAt(html, m.index + m[0].length);\n  return model && typeof model === 'object' ? rec<GuestEstimatesLocationModel>(model) : null;\n}\n\nfunction toBillingEntity(area: RawServiceArea, facilities: { id: string; name: string }[]): BillingEntity {\n  return {\n    id: area.Id,\n    name: area.Title.trim(),\n    phone: area.Phone?.trim() || null,\n    logoUrl: area.LogoURL?.trim() || null,\n    facilities,\n  };\n}\n\n/**\n * Every billing entity the estimate tool offers, with the facilities under\n * each one that groups by location. Returns null when the instance has the\n * tool switched off (the page that comes back is the login shell, or a\n * different activity, with no service areas in it).\n */\nexport async function fetchBillingEntities(request: MyChartRequest): Promise<BillingEntity[] | null> {\n  const page = await openPreloginPage(request, GUEST_ESTIMATES_PATH);\n  const areas = parseServiceAreas(page.html);\n  if (!areas) {\n    logger.debug('guest estimates is not available on', request.hostname);\n    return null;\n  }\n\n  const entities = await Promise.all(\n    areas.map(async (area) => {\n      if (!area.SelectLocations) return toBillingEntity(area, []);\n      const svcArea = encodeURIComponent(area.Id);\n      const location = await openPreloginPage(request, `/GuestEstimates/SelectLocation?svcArea=${svcArea}&isMultiSA=true`);\n      const model = parseLocationModel(location.html);\n      const facilities = (model?.Locations ?? [])\n        .filter((l): l is Location & { Id: string; Title: string } => typeof l?.Id === 'string' && typeof l?.Title === 'string')\n        .map((l) => ({ id: l.Id, name: l.Title.trim() }));\n      return toBillingEntity(area, facilities);\n    }),\n  );\n  return entities;\n}\n\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The organization's contact lines, read off the login shell.\n *\n * Every pre-login page registers a block of string \"mnemonics\" for the page JS\n * to substitute into UI copy:\n *\n *   $$WP.Strings.addMnemonic(\"@MYCHART@HELPDESKPHONE@\",\"<span dir='ltr'><a href='tel:5550100100'>555-010-0100</a></span>\", false, \"Global\", $$WP.Strings.EncodingTypes.None)\n *   $$WP.Strings.addMnemonic(\"@MYCHART@ORGNAME@\",HTMLUnencode(\"Springfield General Hospital\"), false, \"Global\")\n *\n * Verified on five instances spanning both scheduling-bundle generations: the\n * mnemonic names are identical everywhere; only the values differ. Three\n * things about the values bite:\n *\n *  - **Epic ships placeholders.** An org that never set a line leaves\n *    `(555) 555-5555` / `tel:5555555555` in place, and the support email\n *    defaults to `MyChartSupport@DoNotUse.DoNotUse`. Both are reported as\n *    null, never as a number to call.\n *  - **Values are HTML**, usually a `tel:` anchor, sometimes a bare span for a\n *    vanity number (\"800-4Sprng\") that has no `tel:` link at all.\n *  - **`HTMLUnencode(...)` wraps the text ones**, so the JS string literal\n *    still holds entities (`&amp;`, `&#39;`) that have to be decoded.\n *\n * The `addMnemonic` lines are one per mnemonic and machine-generated, so a\n * regex reads them. Their values are HTML, which is cheerio's job: decoding\n * entities by hand is what this module used to do, and it got `&amp;lt;`,\n * every named entity outside the big six, and out-of-range numeric\n * references wrong.\n */\n\nimport * as cheerio from 'cheerio';\n\nimport type { OrgProfile, PhoneNumber } from './types';\n\nconst MNEMONIC_RE =\n  /\\$\\$WP\\.Strings\\.addMnemonic\\(\\s*\"@MYCHART@([A-Z_]+)@\"\\s*,\\s*(HTMLUnencode\\()?\\s*\"((?:[^\"\\\\]|\\\\.)*)\"/g;\n\nconst PLACEHOLDER_DIGITS = '5555555555';\nconst PLACEHOLDER_EMAIL_DOMAIN = 'donotuse.donotuse';\n\n/** Every `@MYCHART@…@` mnemonic on the page, values still raw (HTML/JS-escaped). */\nexport function parseMnemonics(html: string): Record<string, string> {\n  const out: Record<string, string> = {};\n  for (const match of html.matchAll(MNEMONIC_RE)) {\n    const [, name, , literal] = match;\n    if (!name || literal === undefined) continue;\n    out[name] = decodeJsString(literal);\n  }\n  return out;\n}\n\nfunction decodeJsString(literal: string): string {\n  try {\n    return JSON.parse(`\"${literal}\"`) as string;\n  } catch {\n    return literal.replace(/\\\\([\"'\\\\/])/g, '$1');\n  }\n}\n\n/** A parsed fragment's text: tags dropped, entities decoded, spacing collapsed. */\nfunction textOf($: cheerio.CheerioAPI): string {\n  return $.root().text().replace(/\\s+/g, ' ').trim();\n}\n\n/** One mnemonic value's HTML as plain text. */\nfunction toText(html: string): string {\n  return textOf(cheerio.load(html, null, false));\n}\n\n/** Turn one phone mnemonic's HTML into a number, or null for empty/placeholder. */\nexport function parsePhone(raw: string | undefined): PhoneNumber | null {\n  if (!raw) return null;\n  const $ = cheerio.load(raw, null, false);\n  const display = textOf($);\n  if (!display) return null;\n\n  const href = $('a[href]').first().attr('href')?.trim() ?? '';\n  const telDigits = (/^tel:(.+)$/i.exec(href)?.[1] ?? '').replace(/\\D/g, '');\n  const displayDigits = display.replace(/\\D/g, '');\n  // A vanity number only has digits for its prefix; `tel:` is authoritative\n  // when it exists, and a display that is all digits speaks for itself.\n  const digits = telDigits || (/^[\\d\\s().+-]+$/.test(display) ? displayDigits : '');\n\n  if (digits === PLACEHOLDER_DIGITS || /555[-. ]?5555/.test(display)) return null;\n  return { display, digits: digits || null };\n}\n\n/** The support email, or null for empty / Epic's DoNotUse placeholder. */\nexport function parseEmail(raw: string | undefined): string | null {\n  if (!raw) return null;\n  const email = toText(raw);\n  if (!email.includes('@')) return null;\n  if (email.toLowerCase().endsWith('@' + PLACEHOLDER_EMAIL_DOMAIN)) return null;\n  return email;\n}\n\nfunction textOrNull(raw: string | undefined): string | null {\n  if (!raw) return null;\n  return toText(raw) || null;\n}\n\n/** Read the organization's profile out of any pre-login page's HTML. */\nexport function parseOrgProfile(html: string): OrgProfile {\n  const m = parseMnemonics(html);\n  return {\n    organizationName: textOrNull(m.ORGNAME) ?? textOrNull(m.MYORGNAME),\n    portalBrand: textOrNull(m.APPTITLE),\n    mountPath: textOrNull(m.ABSOLUTEURL),\n    phones: {\n      helpDesk: parsePhone(m.HELPDESKPHONE),\n      scheduling: parsePhone(m.SCHEDULINGPHONE),\n      billing: parsePhone(m.BILLINGPHONE),\n    },\n    supportEmail: parseEmail(m.HELPEMAIL),\n  };\n}\n\n/** Does this page carry the mnemonic block at all? False for a non-MyChart page. */\nexport function hasOrgProfile(html: string): boolean {\n  return /addMnemonic\\(\\s*\"@MYCHART@(ORGNAME|APPTITLE)@\"/.test(html);\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The provider and clinic directory behind \"Find a Doctor\".\n *\n * MyChart's open-scheduling workflow runs for anonymous visitors under\n * `/<mount>/OpenScheduling`. Its data comes from two POSTs the page makes\n * itself, both form-encoded (`$$WPUtil.postify`) and both requiring the\n * page's antiforgery token as a header:\n *\n *   POST Scheduling/Anonymous/GetSchedulingWorkflowData\n *        schedulingParameters[workflow]=NewProvider&isFirstLoad=true\n *     → Specialties[], WorkflowSettings{…}, HomeOrganizationName\n *\n *   POST Scheduling/Anonymous/GetSpecialtyData\n *        SpecialtyId=<id>\n *     → Providers[], Departments[], Locations[], ProviderDepartmentPairs[],\n *       ReasonsForVisit[], VisitTypes[]\n *\n * Verified on five instances (root-mounted and prefixed). The URL routes,\n * the parameter names and every key read below are identical on all five.\n * Two keys are additive on the newer scheduling build only —\n * `Providers[].SpecialtySearchTerms` and `WorkflowSettings.UseLegacyQuestionnaires`\n * — and are read as optional; nothing else differs between the builds.\n *\n * What this is and is not: it lists every provider the org has enabled for\n * online scheduling, once per specialty they are bookable under. It is the\n * bookable directory, not the whole medical staff, and it carries no NPI —\n * the only identifier is the instance's opaque WP-encoded provider id, which\n * is stable across specialties (so providers dedupe on it).\n *\n * Size: one specialty is 0.6–2 MB of JSON, and a large org lists twenty-plus\n * specialties. `specialties` narrows the crawl; `maxSpecialties` caps it. The\n * per-host permit in `shared/hostConcurrency.ts` paces whatever is left.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { logger } from '../../../shared/logger';\nimport { rec } from '../processors/read';\nimport type { AnonymousSchedulingWorkflowData, AnonymousSpecialtyData } from './mychart.types';\nimport { openPreloginPage, postForm } from './preloginSession';\nimport type { Clinic, PortalFeatures, Provider, ProviderDirectory, Specialty } from './types';\n\nexport const OPEN_SCHEDULING_PATH = '/OpenScheduling';\nconst WORKFLOW_DATA_PATH = '/Scheduling/Anonymous/GetSchedulingWorkflowData';\nconst SPECIALTY_DATA_PATH = '/Scheduling/Anonymous/GetSpecialtyData';\n\n// ── Raw shapes, as the instance sends them ───────────────────────────────────\n// The two payloads are read as their captured types (`mychart.types.ts`); the\n// provider and department elements are still cast to the keys the crawl reads.\n\ntype RawSpecialty = { Id: string; Name: string };\n\ntype RawSpecialtyRef = { Title?: string | null };\n\ntype RawProvider = {\n  ID: string;\n  Name: string;\n  NameLastFirst?: string | null;\n  Credentials?: string | null;\n  Specialties?: RawSpecialtyRef[] | null;\n  Gender?: string | null;\n  Languages?: string[] | null;\n  PhotoUrl?: string | null;\n  BioSlug?: string | null;\n  /** Newer build only. */\n  SpecialtySearchTerms?: { Title?: string | null }[] | null;\n};\n\ntype RawDepartment = {\n  ID: string;\n  Name: string;\n  Address?: string[] | null;\n  PhoneNumber?: string | null;\n  OverridePhoneNumber?: string | null;\n  IsUsingOverridePhoneNumber?: boolean;\n  Coordinates?: { Latitude: number | null; Longitude: number | null } | null;\n  TimeZone?: { CacheTimeZone?: { Title?: string | null } | null } | null;\n};\n\n/**\n * `DirectProviderDepartmentPairIDs` are `\"<ProviderId>^<DepartmentId>\"`\n * composites — not indices into `ProviderDepartmentPairs`. Some instances\n * refuse a search carrying a pair outside this set.\n */\nexport type RawReason = NonNullable<AnonymousSpecialtyData['ReasonsForVisit']>[number] & { Id: string };\n\nexport type RawVisitType = NonNullable<AnonymousSpecialtyData['VisitTypes']>[number];\n\n// ── Parsing ──────────────────────────────────────────────────────────────────\n\nfunction requireArray<T>(value: unknown, what: string): T[] {\n  if (!Array.isArray(value)) {\n    throw new Error(`${what} is missing from the scheduling response — the endpoint shape changed`);\n  }\n  return value as T[];\n}\n\nexport function parseSpecialties(data: AnonymousSchedulingWorkflowData): Specialty[] {\n  return requireArray<RawSpecialty>(data.Specialties, 'Specialties')\n    .filter((s) => typeof s?.Id === 'string' && typeof s?.Name === 'string')\n    .map((s) => ({ id: s.Id, name: s.Name }));\n}\n\nexport function parseFeatures(data: AnonymousSchedulingWorkflowData): PortalFeatures {\n  const s = data.WorkflowSettings ?? {};\n  return {\n    selfSignup: s.AllowSelfSignup === true,\n    loginEnabled: s.IsLoginEnabled !== false,\n    openScheduling: s.IsWorkflowTurnedOn !== false,\n    scheduleAsGuest: s.DisableScheduleAsGuest !== true,\n    onMyWay: s.AllowOnMyWay === true,\n    onDemandVideoVisits: s.HasOnDemandVideoVisitSecurity === true,\n  };\n}\n\nfunction titles(refs: { Title?: string | null }[] | null | undefined): string[] {\n  return (refs ?? []).map((r) => r?.Title?.trim() ?? '').filter((t) => t.length > 0);\n}\n\n/** A department's phone: the override wins when the org turned it on. */\nfunction departmentPhone(d: RawDepartment): string | null {\n  const phone = d.IsUsingOverridePhoneNumber && d.OverridePhoneNumber ? d.OverridePhoneNumber : d.PhoneNumber;\n  return phone?.trim() || null;\n}\n\nfunction parseClinic(d: RawDepartment): Clinic {\n  const lat = d.Coordinates?.Latitude;\n  const lng = d.Coordinates?.Longitude;\n  return {\n    id: d.ID,\n    name: d.Name,\n    addressLines: (d.Address ?? []).filter((line) => typeof line === 'string' && line.trim().length > 0),\n    phone: departmentPhone(d),\n    coordinates: typeof lat === 'number' && typeof lng === 'number' ? { latitude: lat, longitude: lng } : null,\n    timeZone: d.TimeZone?.CacheTimeZone?.Title?.trim() || null,\n  };\n}\n\n/**\n * Merge one specialty's payload into the running directory.\n *\n * A provider listed under two specialties arrives twice with the same `ID`;\n * the merge keeps one record and unions the clinics and finder specialties.\n */\nexport function mergeSpecialtyData(\n  data: AnonymousSpecialtyData,\n  specialty: Specialty,\n  providers: Map<string, Provider>,\n  clinics: Map<string, Clinic>,\n): void {\n  const rawProviders = requireArray<RawProvider>(data.Providers, 'Providers');\n  const rawDepartments = requireArray<RawDepartment>(data.Departments, 'Departments');\n  const pairs = Array.isArray(data.ProviderDepartmentPairs) ? data.ProviderDepartmentPairs : [];\n\n  for (const d of rawDepartments) {\n    if (typeof d?.ID !== 'string') continue;\n    if (!clinics.has(d.ID)) clinics.set(d.ID, parseClinic(d));\n  }\n\n  const clinicIdsByProvider = new Map<string, Set<string>>();\n  for (const p of pairs) {\n    if (typeof p?.ProviderId !== 'string' || typeof p?.DepartmentId !== 'string') continue;\n    let set = clinicIdsByProvider.get(p.ProviderId);\n    if (!set) clinicIdsByProvider.set(p.ProviderId, (set = new Set()));\n    set.add(p.DepartmentId);\n  }\n\n  for (const raw of rawProviders) {\n    if (typeof raw?.ID !== 'string' || typeof raw?.Name !== 'string') continue;\n    const clinicIds = [...(clinicIdsByProvider.get(raw.ID) ?? [])];\n    const existing = providers.get(raw.ID);\n    if (existing) {\n      existing.clinicIds = [...new Set([...existing.clinicIds, ...clinicIds])];\n      if (!existing.finderSpecialties.includes(specialty.name)) existing.finderSpecialties.push(specialty.name);\n      continue;\n    }\n    const provider: Provider = {\n      id: raw.ID,\n      name: raw.Name,\n      nameLastFirst: raw.NameLastFirst ?? raw.Name,\n      credentials: raw.Credentials ?? '',\n      specialties: titles(raw.Specialties),\n      gender: raw.Gender ?? '',\n      languages: (raw.Languages ?? []).filter((l): l is string => typeof l === 'string' && l.length > 0),\n      photoUrl: raw.PhotoUrl?.trim() || null,\n      bioSlug: raw.BioSlug?.trim() || null,\n      clinicIds,\n      finderSpecialties: [specialty.name],\n    };\n    if (Array.isArray(raw.SpecialtySearchTerms)) provider.searchTerms = titles(raw.SpecialtySearchTerms);\n    providers.set(raw.ID, provider);\n  }\n}\n\n// ── Fetching ─────────────────────────────────────────────────────────────────\n\nexport type ProviderDirectoryOptions = {\n  /**\n   * Only crawl these specialties, matched case-insensitively by name or by id.\n   * Unset means every specialty the instance lists.\n   */\n  specialties?: string[];\n  /** Stop after this many specialties (after `specialties` filtering). */\n  maxSpecialties?: number;\n};\n\n/** Open the workflow page and read the specialty list and feature flags. */\nexport async function fetchSchedulingWorkflow(\n  request: MyChartRequest,\n): Promise<{ token: string | null; data: AnonymousSchedulingWorkflowData }> {\n  const page = await openPreloginPage(request, OPEN_SCHEDULING_PATH);\n  const data = await postForm(\n    request,\n    WORKFLOW_DATA_PATH,\n    page.token,\n    { schedulingParameters: { workflow: 'NewProvider' }, isFirstLoad: true },\n    OPEN_SCHEDULING_PATH,\n  );\n  return { token: page.token, data: rec<AnonymousSchedulingWorkflowData>(data) };\n}\n\n/**\n * One specialty's payload: its providers, departments and the pairs joining\n * them, plus the visit types and reasons for visit the slot search needs.\n *\n * Shared with `openSlots.ts` so the two-POST walk exists in one place.\n */\nexport async function fetchSpecialtyData(\n  request: MyChartRequest,\n  token: string | null,\n  specialtyId: string,\n): Promise<AnonymousSpecialtyData> {\n  return rec<AnonymousSpecialtyData>(\n    await postForm(request, SPECIALTY_DATA_PATH, token, { SpecialtyId: specialtyId }, OPEN_SCHEDULING_PATH),\n  );\n}\n\nexport function selectSpecialties(all: Specialty[], options: ProviderDirectoryOptions): Specialty[] {\n  let chosen = all;\n  if (options.specialties && options.specialties.length > 0) {\n    const wanted = new Set(options.specialties.map((s) => s.trim().toLowerCase()));\n    chosen = all.filter((s) => wanted.has(s.name.toLowerCase()) || wanted.has(s.id.toLowerCase()));\n  }\n  if (options.maxSpecialties !== undefined && options.maxSpecialties >= 0) {\n    chosen = chosen.slice(0, options.maxSpecialties);\n  }\n  return chosen;\n}\n\n/**\n * Crawl the \"Find a Doctor\" workflow into one deduplicated directory.\n *\n * Specialties are fetched concurrently; the per-host permit is the throttle.\n */\nexport async function fetchProviderDirectory(\n  request: MyChartRequest,\n  options: ProviderDirectoryOptions = {},\n): Promise<ProviderDirectory> {\n  const { token, data } = await fetchSchedulingWorkflow(request);\n  const all = parseSpecialties(data);\n  const chosen = selectSpecialties(all, options);\n  logger.debug(`open scheduling lists ${all.length} specialties on ${request.hostname}; crawling ${chosen.length}`);\n\n  const providers = new Map<string, Provider>();\n  const clinics = new Map<string, Clinic>();\n  const payloads = await Promise.all(\n    chosen.map((specialty) => fetchSpecialtyData(request, token, specialty.id)),\n  );\n  chosen.forEach((specialty, i) => mergeSpecialtyData(payloads[i]!, specialty, providers, clinics));\n\n  return {\n    specialties: all,\n    providers: [...providers.values()],\n    clinics: [...clinics.values()],\n    features: parseFeatures(data),\n    organizationName: data.HomeOrganizationName?.trim() || null,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * One hostname in, the health system's public profile out.\n *\n * Runs the three pre-login scrapers under one discovered mount:\n *\n *   1. {@link parseOrgProfile} on the login page — org name, portal brand,\n *      support lines, support email.\n *   2. {@link fetchProviderDirectory} — specialties, bookable providers,\n *      clinics with addresses, and the portal's feature flags.\n *   3. {@link fetchBillingEntities} — billing entities and their facilities.\n *\n * The contact profile is the one part that must work: a host that serves no\n * login page is not a MyChart instance and the call throws. The other two are\n * features an organization can switch off, so each fails on its own into\n * `warnings` and the rest of the profile still comes back.\n *\n * Nothing here sends a credential. Every request is one an anonymous browser\n * makes by opening the portal.\n */\n\nimport { determineFirstPathPart } from '../auth/login';\nimport { MyChartRequest } from '../core/myChartRequest';\nimport { logger } from '../../../shared/logger';\nimport { fetchBillingEntities } from './guestEstimates';\nimport { hasOrgProfile, parseOrgProfile } from './orgProfile';\nimport { openPreloginPage } from './preloginSession';\nimport { fetchProviderDirectory, type ProviderDirectoryOptions } from './providerDirectory';\nimport type { HospitalNetworkProfile } from './types';\n\nconst LOGIN_PAGE_PATH = '/Authentication/Login';\n\nexport const INSURANCE_GATE_REASON =\n  'The accepted-insurance list is the last step of the guest price-estimate flow, behind a ' +\n  'price-transparency disclaimer whose accept step is protected by reCAPTCHA. It is not scraped. ' +\n  \"A signed-in account can read the organization's payer catalogue instead: the get_insurance_payers \" +\n  'capability, which is the same list the Add Coverage form offers and is identical for every ' +\n  'patient on the instance.';\n\nexport type NetworkProfileOptions = ProviderDirectoryOptions & {\n  /** `http` for a local fake-mychart; defaults to https. */\n  protocol?: string;\n  /** Skip the provider/clinic crawl (the largest part by far). Default true. */\n  includeProviders?: boolean;\n  /** Skip the billing entities. Default true. */\n  includeBilling?: boolean;\n};\n\nfunction describe(err: unknown): string {\n  return err instanceof Error ? err.message : String(err);\n}\n\n/**\n * Build the profile for `hostname`. Accepts a bare host, a host with a mount\n * prefix, or a full login URL — whatever a user pasted.\n */\nexport async function fetchHospitalNetworkProfile(\n  hostname: string,\n  options: NetworkProfileOptions = {},\n): Promise<HospitalNetworkProfile> {\n  const request = new MyChartRequest(hostname, options.protocol ? { protocol: options.protocol } : undefined);\n  await determineFirstPathPart(request);\n\n  const login = await openPreloginPage(request, LOGIN_PAGE_PATH);\n  if (!hasOrgProfile(login.html)) {\n    throw new Error(\n      `${request.hostname} did not serve a MyChart login page at ` +\n        `${request.firstPathPart ? '/' + request.firstPathPart : ''}${LOGIN_PAGE_PATH} — is it a MyChart instance?`,\n    );\n  }\n  const profile = parseOrgProfile(login.html);\n  const warnings: string[] = [];\n\n  const [directory, billingEntities] = await Promise.all([\n    options.includeProviders === false\n      ? Promise.resolve(null)\n      : fetchProviderDirectory(request, options).catch((err: unknown) => {\n          logger.debug('provider directory unavailable on', request.hostname, err);\n          warnings.push(`Provider directory unavailable: ${describe(err)}`);\n          return null;\n        }),\n    options.includeBilling === false\n      ? Promise.resolve(null)\n      : fetchBillingEntities(request).catch((err: unknown) => {\n          logger.debug('billing entities unavailable on', request.hostname, err);\n          warnings.push(`Billing entities unavailable: ${describe(err)}`);\n          return null;\n        }),\n  ]);\n\n  return {\n    hostname: request.hostname,\n    mount: request.firstPathPart,\n    profile,\n    directory,\n    billingEntities,\n    insurance: { status: 'gated', reason: INSURANCE_GATE_REASON },\n    warnings,\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Resolving \"what am I searching for\" on an anonymous scheduling instance.\n *\n * Every call in this corner of the API needs the same four things first: the\n * antiforgery token, the specialty, the reason for visit, and the visit type\n * the reason defaults to. The slot search needs them to build a payload; the\n * questionnaire needs them to find the decision tree hanging off the visit\n * type. Resolving it twice, slightly differently, is how the two drift apart.\n *\n * It also carries the org's bookable window. `WorkflowSettings` publishes how\n * far out an instance will look — as day offsets, with a separate pair for the\n * new-provider workflow — which is what a client needs to ask someone \"when\n * would you like to be seen?\" without offering dates the instance will refuse.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport {\n  fetchSchedulingWorkflow,\n  fetchSpecialtyData,\n  parseSpecialties,\n  type RawReason,\n  type RawVisitType,\n} from './providerDirectory';\nimport type { AnonymousSchedulingWorkflowData } from './mychart.types';\nimport type { SchedulingWindow, Specialty } from './types';\n\n/**\n * The instance does not offer what the selector asked for.\n *\n * A distinct type so callers — the probe especially — can tell \"this host has\n * no such specialty\" from a transport failure without matching on the message,\n * which is prose and gets reworded.\n */\nexport class NoSchedulingSelectionError extends Error {\n  constructor(\n    message: string,\n    readonly kind: 'specialty' | 'reasonForVisit',\n  ) {\n    super(message);\n    this.name = 'NoSchedulingSelectionError';\n  }\n}\n\nexport type SchedulingSelector = {\n  /** Specialty name or id. Defaults to the first the instance lists. */\n  specialty?: string;\n  /** Reason-for-visit title or id. Defaults to the first directly schedulable one. */\n  reasonForVisit?: string;\n};\n\ntype RawPair = { ProviderId: string; DepartmentId: string; IsTeamMember?: boolean };\n\nexport type SchedulingContext = {\n  token: string | null;\n  specialty: Specialty;\n  /** Every specialty the instance lists, for a caller offering a choice. */\n  specialties: Specialty[];\n  reason: RawReason | null;\n  reasons: RawReason[];\n  visitTypeId: string | null;\n  visitType: RawVisitType | null;\n  /** The decision tree gating this visit type, when the org attaches one. */\n  treeId: string | null;\n  pairs: RawPair[];\n  window: SchedulingWindow;\n};\n\n/**\n * How far out this instance will look, in whole days from today.\n *\n * The new-provider offsets win when the org sets them — that is the workflow\n * the anonymous \"Find a Doctor\" page runs — and the general pair is the\n * fallback. Both are absent on some instances; 0 and 365 are then the sane\n * reading, and `explicit` says which case a caller is looking at.\n */\nexport function parseSchedulingWindow(settings: AnonymousSchedulingWorkflowData['WorkflowSettings'] | null): SchedulingWindow {\n  const s = settings ?? {};\n  const from = s.NewProvFromDaysOffset ?? s.FromDaysOffset;\n  const to = s.NewProvToDaysOffset ?? s.ToDaysOffset;\n  return {\n    earliestDaysOut: typeof from === 'number' ? from : 0,\n    latestDaysOut: typeof to === 'number' ? to : 365,\n    explicit: typeof from === 'number' && typeof to === 'number',\n  };\n}\n\n/**\n * Turn the window into concrete dates, for a client rendering a date picker.\n *\n * Days are added through the date constructor, not as milliseconds: a day is\n * not always 86,400,000 ms locally. Adding that across a daylight-saving\n * change lands on 23:00 the day before or 01:00 the day after, so the date\n * comes out one off — and any window wider than a few weeks crosses one twice\n * a year.\n */\nexport function windowDates(window: SchedulingWindow, today: Date = new Date()): { earliest: Date; latest: Date } {\n  const shift = (days: number) => new Date(today.getFullYear(), today.getMonth(), today.getDate() + days);\n  return { earliest: shift(window.earliestDaysOut), latest: shift(window.latestDaysOut) };\n}\n\n/**\n * Resolve the workflow and specialty calls into everything downstream needs.\n *\n * An unknown `specialty` or `reasonForVisit` throws with the list the instance\n * publishes, rather than quietly searching something else — a substituted\n * reason means a different visit type and different slots, with nothing in the\n * result saying so.\n */\nexport async function resolveSchedulingContext(\n  request: MyChartRequest,\n  selector: SchedulingSelector = {},\n): Promise<SchedulingContext> {\n  const { token, data: workflowData } = await fetchSchedulingWorkflow(request);\n  const specialties = parseSpecialties(workflowData);\n\n  const wanted = selector.specialty?.trim().toLowerCase();\n  const specialty = wanted\n    ? specialties.find((s) => s.name.toLowerCase() === wanted || s.id.toLowerCase() === wanted)\n    : specialties[0];\n  if (!specialty) {\n    throw new Error(\n      wanted\n        ? `no specialty named ${JSON.stringify(selector.specialty)} on ${request.hostname} — it lists ` +\n          (specialties.map((s) => s.name).join(', ') || 'none')\n        : `${request.hostname} lists no open-scheduling specialties`,\n    );\n  }\n\n  const specialtyData = await fetchSpecialtyData(request, token, specialty.id);\n  const reasons = (specialtyData.ReasonsForVisit ?? []).filter((r): r is RawReason => typeof r?.Id === 'string');\n\n  const wantedRfv = selector.reasonForVisit?.trim().toLowerCase();\n  let reason: RawReason | null;\n  if (wantedRfv) {\n    reason = reasons.find((r) => r.Title?.toLowerCase() === wantedRfv || r.Id.toLowerCase() === wantedRfv) ?? null;\n    if (!reason) {\n      throw new NoSchedulingSelectionError(\n        `no reason for visit named ${JSON.stringify(selector.reasonForVisit)} in ${specialty.name} on ` +\n          `${request.hostname} — it lists ${reasons.map((r) => r.Title).filter(Boolean).join(', ') || 'none'}`,\n        'reasonForVisit',\n      );\n    }\n  } else {\n    // Falling back to a request-only reason is expected to return no slots: it\n    // is the reason the org publishes when nothing is directly bookable.\n    reason = reasons.find((r) => r.CanDirectSchedule) ?? reasons[0] ?? null;\n  }\n\n  const visitTypeId = reason?.DefaultVisitTypeId ?? specialtyData.VisitTypes?.[0]?.ID ?? null;\n  const visitType = specialtyData.VisitTypes?.find((v) => v.ID === visitTypeId) ?? null;\n\n  return {\n    token,\n    specialty,\n    specialties,\n    reason,\n    reasons,\n    visitTypeId,\n    visitType,\n    treeId: visitType?.AnonymousSchedulingDecisionTreeId?.trim() || null,\n    pairs: (specialtyData.ProviderDepartmentPairs ?? []).filter(\n      (p): p is RawPair => typeof p?.ProviderId === 'string' && typeof p?.DepartmentId === 'string',\n    ),\n    window: parseSchedulingWindow(workflowData.WorkflowSettings),\n  };\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The screening questionnaire some orgs put in front of open scheduling.\n *\n * When an org attaches a decision tree to a visit type, `GetSlots` refuses the\n * search with `ErrorCode: \"LqfAnswersRequired\"` until the tree has been walked\n * and its answer id is included. This is the single most common reason a\n * scheduling-enabled instance returns nothing: 221 of the 577 instances that\n * serve the workflow answer that code.\n *\n * The tree lives on a different route family from everything else here —\n * `DecisionTrees/AnonymousDecisionTree/…` rather than `Scheduling/Anonymous/…`\n * — and is walked one question at a time:\n *\n *   POST DecisionTrees/AnonymousDecisionTree/NextStep\n *        traversalInfo{…}          the cursor, echoed from the last response\n *        prevInputNode{…}          the node just answered, with Question nulled\n *        question{…}               that node's question, carrying the answer\n *     → NextInputNode{Question{Prompt, Choices[]}}, TraversalInfo{TreeAnswerID, …}\n *\n * The tree id is not a separate lookup: it is `AnonymousSchedulingDecisionTreeId`\n * on the visit type, already present in `GetSpecialtyData`. When the walk\n * finishes, `TraversalInfo.TreeAnswerID` is the id `GetSlots` wants as\n * `PatientAnswerIds`, alongside the tree id as `LqfIds`.\n *\n * ## Why this does not answer for you\n *\n * These are clinical screening questions — \"Do you think you are having a life\n * threatening emergency?\" is the first one on the instance this was built\n * against. Guessing the answer that keeps the funnel moving would put words in\n * a patient's mouth and could route a real emergency into a routine\n * appointment. So the questions are surfaced and the caller supplies answers;\n * nothing here picks one on its own.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { logger } from '../../../shared/logger';\nimport { openPreloginPage, postForm } from './preloginSession';\nimport { OPEN_SCHEDULING_PATH } from './providerDirectory';\nimport { resolveSchedulingContext, type SchedulingContext, type SchedulingSelector } from './schedulingContext';\nimport type { QuestionAnswer, SchedulingQuestion, SchedulingQuestionnaire } from './types';\n\nconst NEXT_STEP_PATH = '/DecisionTrees/AnonymousDecisionTree/NextStep';\n\n/** `TraversalSourceWorkflow` for open scheduling, as the live page sends it. */\nconst SOURCE_WORKFLOW_OPEN_SCHEDULING = 5;\n\n/** The `NewProvider` workflow, the same `2` the slot search sends as `Type`. */\nconst SCHEDULING_WORKFLOW_TYPE_NEW_PROVIDER = 2;\n\ntype QuestionnaireWalk = {\n  /** The tree id — `LqfIds` for the slot search. */\n  treeId: string;\n  /** `PatientAnswerIds` for the slot search. Null if none was issued. */\n  treeAnswerId: string | null;\n  /** Every question the walk saw, in order. */\n  questions: SchedulingQuestion[];\n  /** The question that stopped the walk because no answer was supplied. */\n  unanswered: SchedulingQuestion | null;\n  /**\n   * The tree reached its end. Not the same as having an answer id: a tree can\n   * finish deliberately without one, which is how an org routes an emergency\n   * out of online scheduling rather than booking it a routine slot.\n   */\n  traversalComplete: boolean;\n};\n\n// ── Raw shapes ───────────────────────────────────────────────────────────────\n\ntype RawChoice = { Index?: string | null; Text?: string | null };\n\ntype RawQuestion = {\n  ID?: string | null;\n  DAT?: string | null;\n  Prompt?: string | null;\n  HelpText?: string | null;\n  Choices?: RawChoice[] | null;\n  QuestionType?: number;\n  ResponseType?: number;\n  IsRequired?: boolean;\n  IsMultiResponse?: boolean;\n  IsTrigger?: boolean;\n  IsEnabled?: boolean;\n  DisplayStyle?: string | null;\n  DisplayStyleVal?: number;\n};\n\ntype RawInputNode = {\n  CSN?: string | null;\n  ID?: string | null;\n  Type?: number;\n  IsFirst?: boolean;\n  DeclutterNavigationButtons?: boolean;\n  Question?: RawQuestion | null;\n};\n\ntype RawTraversalInfo = Record<string, unknown> & {\n  TreeID?: string;\n  TreeAnswerID?: string | null;\n  IsTraversalComplete?: boolean;\n};\n\ntype RawNextStep = { NextInputNode?: RawInputNode | null; TraversalInfo?: RawTraversalInfo | null };\n\n// ── Parsing ──────────────────────────────────────────────────────────────────\n\nexport function parseQuestion(raw: RawQuestion | null | undefined): SchedulingQuestion | null {\n  if (!raw || typeof raw.ID !== 'string') return null;\n  return {\n    id: raw.ID,\n    prompt: raw.Prompt?.trim() ?? '',\n    choices: (raw.Choices ?? [])\n      .filter((c): c is RawChoice => typeof c?.Index === 'string')\n      .map((c) => ({ index: c.Index!, text: c.Text?.trim() ?? '' })),\n    required: raw.IsRequired === true,\n    multiResponse: raw.IsMultiResponse === true,\n    // ResponseType 8 is the choice list every captured scheduling tree used;\n    // a question offering no choices at all is one that wants typing.\n    freeText: (raw.Choices ?? []).length === 0,\n    helpText: raw.HelpText?.trim() || null,\n  };\n}\n\n/** Raised for a question shape this scraper cannot answer yet. */\nclass WorkInProgressError extends Error {\n  constructor(what: string) {\n    super(`${what}: work in progress`);\n    this.name = 'WorkInProgressError';\n  }\n}\n\n/**\n * The `question` field of a `NextStep` post: the question's identity echoed\n * back, with the answer under `Answer`. The prompt and choice list are\n * deliberately not sent back — the live page does not send them either.\n *\n * Single-select is the only shape verified against a live instance. Epic's own\n * serializer says what the others look like — `convertToCoreChoiceArray` pushes\n * every selected choice and `convertToCoreChoiceModel` reduces each to\n * `{ Index }`, so multi-response is more entries, and `FreeTextQuestion` sets\n * `Answer.Text` beside them — but reading the client is not the same as having\n * driven a real tree that asks one. Sampling 198 gated instances turned up 3\n * multi-response and 6 free-text opening questions and none of them has been\n * walked, so both refuse rather than send a payload nobody has watched work.\n */\nexport function answerPayload(raw: RawQuestion, answer: QuestionAnswer): Record<string, unknown> {\n  if (answer.text !== undefined) {\n    throw new WorkInProgressError('answering a free-text scheduling question');\n  }\n  const indexes = answer.choiceIndex === undefined ? [] : [answer.choiceIndex].flat();\n  if (indexes.length > 1) {\n    throw new WorkInProgressError('answering a multi-response scheduling question');\n  }\n  return {\n    ID: raw.ID,\n    DAT: raw.DAT,\n    QuestionType: raw.QuestionType,\n    ResponseType: raw.ResponseType,\n    IsRequired: raw.IsRequired,\n    IsMultiResponse: raw.IsMultiResponse,\n    IsTrigger: raw.IsTrigger,\n    IsEnabled: raw.IsEnabled,\n    DisplayStyle: raw.DisplayStyle ?? '',\n    DisplayStyleVal: raw.DisplayStyleVal ?? 0,\n    Answer: { Choices: indexes.map((Index) => ({ Index })) },\n  };\n}\n\n// ── Walking ──────────────────────────────────────────────────────────────────\n\n/** Guard against a tree that never reports itself complete. */\nconst MAX_STEPS = 25;\n\n/**\n * Walk a scheduling decision tree, answering with `answers` as far as they go.\n *\n * With no answers this is a read: it returns the first question and stops, so\n * a caller can show the questionnaire before deciding anything. With answers\n * it walks until the tree completes or reaches a question nothing answers.\n */\nexport async function walkSchedulingQuestionnaire(\n  request: MyChartRequest,\n  options: { token: string | null; treeId: string; visitTypeId: string | null; answers?: QuestionAnswer[] },\n): Promise<QuestionnaireWalk> {\n  const { token, treeId, visitTypeId, answers = [] } = options;\n  const byQuestion = new Map(answers.map((a) => [a.questionId, a]));\n  const questions: SchedulingQuestion[] = [];\n  /**\n   * Questions already answered in this walk.\n   *\n   * A tree that re-serves an answered question is not advancing, and answering\n   * it again would spin until `MAX_STEPS` — so a repeat fails loudly instead.\n   * The bug this caught was `RestartTree` being echoed back as `true`; the\n   * guard stays because a silent 25-step spin is the worst way to find out.\n   */\n  const answered = new Set<string>();\n\n  let traversalInfo: Record<string, unknown> = {\n    TreeID: treeId,\n    IsTraversalComplete: false,\n    SourceWorkflow: SOURCE_WORKFLOW_OPEN_SCHEDULING,\n    TreeWasDirty: false,\n    TreeWasLocked: false,\n    RestartTree: true,\n    UseInProgress: '',\n    // Not optional: without the whole AdditionalContext block the endpoint\n    // answers the release error surface rather than the first question. The\n    // empty strings are what the live page sends for a fresh anonymous walk.\n    AdditionalContext: {\n      VisitTypeID: visitTypeId ?? '',\n      TicketID: '',\n      OriginalApptDAT: '',\n      FavoriteApptDAT: '',\n      OrdersString: '',\n      IsGuest: false,\n      SchedulingWorkflowType: SCHEDULING_WORKFLOW_TYPE_NEW_PROVIDER,\n      IsAuthenticatedWidget: false,\n    },\n  };\n  let body: Record<string, unknown> = { traversalInfo };\n\n  for (let step = 0; step < MAX_STEPS; step++) {\n    const data = await postForm<RawNextStep>(request, NEXT_STEP_PATH, token, body, OPEN_SCHEDULING_PATH);\n    // The response echoes `RestartTree: true` straight back. Sending that again\n    // restarts the traversal, so the walk re-serves question one forever; the\n    // live client clears the flag after the opening step and so must this.\n    traversalInfo = { ...(data.TraversalInfo ?? {}), RestartTree: false };\n    const node = data.NextInputNode ?? null;\n    const rawQuestion = node?.Question ?? null;\n\n    if (data.TraversalInfo?.IsTraversalComplete === true || !rawQuestion) {\n      const treeAnswerId = (data.TraversalInfo?.TreeAnswerID as string | undefined) ?? null;\n      return { treeId, treeAnswerId, questions, unanswered: null, traversalComplete: true };\n    }\n\n    const question = parseQuestion(rawQuestion);\n    if (!question) {\n      return { treeId, treeAnswerId: null, questions, unanswered: null, traversalComplete: true };\n    }\n    questions.push(question);\n\n    const answer = byQuestion.get(question.id);\n    if (answer === undefined) {\n      logger.debug(`questionnaire on ${request.hostname} needs an answer for ${JSON.stringify(question.prompt)}`);\n      return { treeId, treeAnswerId: null, questions, unanswered: question, traversalComplete: false };\n    }\n    if (answered.has(question.id)) {\n      throw new Error(\n        `scheduling questionnaire on ${request.hostname} re-served an answered question — ` +\n          'the traversal is session state, so walk it on a fresh session rather than reusing one',\n      );\n    }\n    answered.add(question.id);\n\n    body = {\n      traversalInfo,\n      // The node just answered, with its question stripped — the page nulls it.\n      prevInputNode: {\n        CSN: node?.CSN,\n        ID: node?.ID,\n        Type: node?.Type,\n        IsFirst: node?.IsFirst,\n        DeclutterNavigationButtons: node?.DeclutterNavigationButtons ?? false,\n        Question: null,\n      },\n      question: answerPayload(rawQuestion, answer),\n    };\n  }\n\n  throw new Error(`scheduling questionnaire on ${request.hostname} did not finish within ${MAX_STEPS} steps`);\n}\n\n// ── The two calls a client makes ─────────────────────────────────────────────\n\nfunction toQuestionnaire(\n  context: Pick<SchedulingContext, 'specialty' | 'reason' | 'window' | 'treeId' | 'visitTypeId'>,\n  walk: QuestionnaireWalk | null,\n): SchedulingQuestionnaire {\n  const shared = {\n    specialty: context.specialty,\n    reasonForVisit: context.reason?.Title ?? null,\n    window: context.window,\n    treeId: context.treeId,\n    visitTypeId: context.visitTypeId,\n  };\n  if (!walk) {\n    return { ...shared, required: false, nextQuestion: null, questions: [], complete: true, answerToken: null };\n  }\n  return {\n    ...shared,\n    required: true,\n    nextQuestion: walk.unanswered,\n    questions: walk.questions,\n    complete: walk.traversalComplete,\n    answerToken: walk.treeAnswerId ? { lqfIds: [walk.treeId], patientAnswerIds: [walk.treeAnswerId] } : null,\n  };\n}\n\n/**\n * Read the screening questionnaire an org puts in front of its availability.\n *\n * Call this first. It asks nothing of the caller and answers nothing itself —\n * it reports whether a questionnaire is required and, if so, hands back the\n * first question to put to a person, plus the window the org will book in.\n *\n * `required: false` means go straight to `fetchOpenSlots`.\n */\nexport async function fetchSchedulingQuestionnaire(\n  request: MyChartRequest,\n  selector: SchedulingSelector = {},\n): Promise<SchedulingQuestionnaire> {\n  const context = await resolveSchedulingContext(request, selector);\n  if (!context.treeId) return toQuestionnaire(context, null);\n  const walk = await walkSchedulingQuestionnaire(request, { token: context.token, treeId: context.treeId, visitTypeId: context.visitTypeId });\n  return toQuestionnaire(context, walk);\n}\n\n/**\n * Submit the answers a person gave, and get back either the next question or\n * the token that unlocks the search.\n *\n * A tree branches, so one round is often not enough: keep calling with the\n * answers gathered so far until `complete`. Answers are replayed from the top\n * each time, which is what makes this safe to call from a fresh session — the\n * traversal itself is server state, but the answer list is the client's.\n */\nexport async function submitSchedulingAnswers(\n  request: MyChartRequest,\n  answers: QuestionAnswer[],\n  from: SchedulingQuestionnaire | SchedulingSelector = {},\n): Promise<SchedulingQuestionnaire> {\n  // Handed the previous round's questionnaire, this needs nothing from the\n  // specialty payload — it already carries the tree and visit type — so it\n  // opens the page for an antiforgery token and walks. That matters: a\n  // specialty payload is 0.6–2 MB, and a three-question tree would otherwise\n  // download one per answer.\n  if (isQuestionnaire(from)) {\n    if (!from.treeId) return { ...from, nextQuestion: null, complete: true };\n    const page = await openPreloginPage(request, OPEN_SCHEDULING_PATH);\n    const walk = await walkSchedulingQuestionnaire(request, { token: page.token, treeId: from.treeId, visitTypeId: from.visitTypeId, answers });\n    return toQuestionnaire(\n      {\n        specialty: from.specialty,\n        reason: from.reasonForVisit === null ? null : { Id: '', Title: from.reasonForVisit },\n        window: from.window,\n        treeId: from.treeId,\n        visitTypeId: from.visitTypeId,\n      },\n      walk,\n    );\n  }\n\n  const context = await resolveSchedulingContext(request, from);\n  if (!context.treeId) return toQuestionnaire(context, null);\n  const walk = await walkSchedulingQuestionnaire(request, { token: context.token, treeId: context.treeId, visitTypeId: context.visitTypeId, answers });\n  return toQuestionnaire(context, walk);\n}\n\n/** A questionnaire carries `required`; a selector never does. */\nfunction isQuestionnaire(from: SchedulingQuestionnaire | SchedulingSelector): from is SchedulingQuestionnaire {\n  return typeof (from as SchedulingQuestionnaire).required === 'boolean';\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * Open appointment availability, to anyone, with no account.\n *\n * `providerDirectory.ts` reads *who* an org lets you book. This reads *when*.\n * Both live behind the same anonymous `/<mount>/OpenScheduling` workflow and\n * share its session and antiforgery token; this module adds the third POST the\n * page makes once a specialty is chosen:\n *\n *   POST Scheduling/Anonymous/GetSlots\n *        workflow[…] & appointmentBuilder[…] & startDte & continueInfo[…]\n *     → Solutions[{ Slots[], HasPassedFilterCheck }], ContinueInfo, ErrorCode\n *\n * The endpoint name is not special-cased anywhere in Epic's client: its own\n * `$$WPSchedulingUtil.GetEndpointUrl(action, workflow)` prefixes *every*\n * scheduling action with `Scheduling/Anonymous/` whenever the workflow carries\n * `IsAnonymous`. So the anonymous surface mirrors the logged-in scheduling API\n * action for action — `GetSlots`, `ReserveAppointment`, `ReviewAppointment`,\n * `DeleteReservationFromSlot`, `CreateSecureSession`. This module implements\n * the read half only; see \"What this deliberately does not do\" below.\n *\n * ## What comes back\n *\n * A `Solution` is one bookable offer: a provider at a department, with the\n * slots that match. Slots carry both Epic's internal day number and a plain\n * `DisplayDateTimeUtc` ISO string; this module surfaces the ISO string and\n * keeps the raw record so nothing is lost.\n *\n * ## Paging\n *\n * The search is incremental, not offset-based. Each response returns a\n * `ContinueInfo` cursor — a date range plus a `NextProviderIndex` like\n * `\"16^1\"` — that must be echoed back verbatim to get the next tranche. The\n * server decides how far to walk per call, and sets `IsStopSearch` when the\n * walk is finished. `ErrorCode` carries back-pressure: the instance throttles\n * a caller that pages too hard, and says so rather than returning junk.\n *\n * ## What this deliberately does not do\n *\n * It never reserves, reviews, or books. `ReserveAppointment` places a real\n * hold on a real clinic's calendar and `ReviewAppointment`/`ScheduleAppointment`\n * create a real appointment for a real person — side effects on a live health\n * system, not scraping. Those actions also gate on a CAPTCHA and on identity\n * the org is entitled to verify, which this module has no business supplying.\n * Availability is public; booking is not ours to automate unattended.\n *\n * Nor does it expose a provider's *booked* appointments: MyChart never sends\n * those to an anonymous caller, and they would be patient data if it did. What\n * `fetchProviderAvailability` returns is the open half of a calendar only.\n */\n\nimport type { MyChartRequest } from '../core/myChartRequest';\nimport { logger } from '../../../shared/logger';\nimport { toEpicDte, toEpicDteLocal } from '../../../shared/epicDate';\nimport { postForm } from './preloginSession';\nimport { OPEN_SCHEDULING_PATH } from './providerDirectory';\nimport { resolveSchedulingContext, type SchedulingSelector } from './schedulingContext';\nimport { walkSchedulingQuestionnaire } from './schedulingQuestionnaire';\nimport type { QuestionAnswer, QuestionnaireAnswerToken } from './types';\nimport type { OpenSlot, SchedulingQuestionnaire, SlotSearchResult } from './types';\n\nconst SLOTS_PATH = '/Scheduling/Anonymous/GetSlots';\n\n// Every date in the scheduling payloads — `Dte`, `SearchRangeStartDte`,\n// `startDte` — is an Epic day number; `shared/epicDate.ts` converts them.\n\n// ── Raw shapes ───────────────────────────────────────────────────────────────\n\nexport type RawSlot = {\n  ProviderId?: string | null;\n  DepartmentId?: string | null;\n  VisitTypeId?: string | null;\n  DisplayDateTimeUtc?: string | null;\n  DateString?: string | null;\n  TimeString?: string | null;\n  TimeZoneMarker?: string | null;\n  LengthInMinutes?: number | null;\n  TelehealthMode?: number | null;\n  Dte?: number | null;\n};\n\ntype RawSolution = { Slots?: RawSlot[] | null; HasPassedFilterCheck?: boolean };\n\n/** The paging cursor. Echoed back verbatim; its fields are Epic's to define. */\nexport type ContinueInfo = {\n  State?: number;\n  SearchRangeStartDte?: number;\n  SearchRangeEndDte?: number;\n  NextProviderIndex?: string;\n  IsStopSearch?: boolean;\n};\n\nexport type RawSlotsResponse = {\n  Solutions?: RawSolution[] | null;\n  ContinueInfo?: ContinueInfo | null;\n  ErrorCode?: number | string | null;\n};\n\n// ── Parsing ──────────────────────────────────────────────────────────────────\n\nexport function parseSlot(raw: RawSlot): OpenSlot | null {\n  if (typeof raw?.ProviderId !== 'string' || typeof raw?.DepartmentId !== 'string') return null;\n  return {\n    providerId: raw.ProviderId,\n    clinicId: raw.DepartmentId,\n    visitTypeId: raw.VisitTypeId ?? null,\n    startUtc: raw.DisplayDateTimeUtc ?? null,\n    localDate: raw.DateString ?? null,\n    localTime: raw.TimeString ?? null,\n    timeZoneMarker: raw.TimeZoneMarker ?? null,\n    lengthInMinutes: typeof raw.LengthInMinutes === 'number' ? raw.LengthInMinutes : null,\n    /** 1 = in person, 2 = video, on every instance captured so far. */\n    telehealthMode: typeof raw.TelehealthMode === 'number' ? raw.TelehealthMode : null,\n    raw,\n  };\n}\n\nexport function parseSlotsResponse(data: RawSlotsResponse): OpenSlot[] {\n  const out: OpenSlot[] = [];\n  for (const solution of data.Solutions ?? []) {\n    for (const raw of solution?.Slots ?? []) {\n      const slot = parseSlot(raw);\n      if (slot) out.push(slot);\n    }\n  }\n  return out;\n}\n\n/**\n * Whether the walk is finished.\n *\n * Epic stops when it says so (`IsStopSearch`), and also when it stops moving:\n * a cursor identical to the one just sent means the server has no more ground\n * to cover, and echoing it again would loop forever.\n *\n * The comparison is `JSON.stringify` on purpose: the cursor is the server's own\n * object echoed back untouched, so its key order is the server's to keep and a\n * structural compare would only be slower.\n */\nexport function isSearchComplete(previous: ContinueInfo | null, next: ContinueInfo | null | undefined): boolean {\n  if (!next) return true;\n  if (next.IsStopSearch === true) return true;\n  return previous !== null && JSON.stringify(previous) === JSON.stringify(next);\n}\n\n/**\n * The instance's own error code for this search, or null.\n *\n * Deliberately not interpreted. A non-zero code covers both \"you are paging\n * too hard, back off\" and \"this search cannot be run\", and the code table is\n * not published — so the number is passed through and the caller decides,\n * rather than being told `throttled` and retrying a search that will never\n * succeed.\n */\nexport function errorCodeOf(data: RawSlotsResponse): number | string | null {\n  const code = data.ErrorCode;\n  if (code === null || code === undefined || code === 0) return null;\n  return code;\n}\n\n// ── Fetching ─────────────────────────────────────────────────────────────────\n\nexport type OpenSlotsOptions = SchedulingSelector & {\n  /** Only search these provider ids. Unset means every provider in the specialty. */\n  providerIds?: string[];\n  /** First day to search. Defaults to today. */\n  startDate?: Date;\n  /** Stop after this many `GetSlots` round trips. Paging is server-paced. */\n  maxPages?: number;\n  /**\n   * Cap on provider/department pairs sent per search. Epic's own page sends\n   * the full set; a large specialty is ~200 pairs and makes for a slow search.\n   */\n  maxPairs?: number;\n  /**\n   * The `answerToken` from a completed `submitSchedulingAnswers`. Preferred\n   * over `answers`: it skips the tree walk entirely, and it survives the\n   * session it was made in, so a client can carry it across a restart.\n   */\n  answerToken?: QuestionnaireAnswerToken;\n  /**\n   * Raw answers, walked here instead. Convenient for a one-shot script; a\n   * client with a person to ask should use `fetchSchedulingQuestionnaire` /\n   * `submitSchedulingAnswers` and pass the resulting `token`.\n   */\n  answers?: QuestionAnswer[];\n};\n\n/**\n * Search open appointment availability on an instance, anonymously.\n *\n * Walks the same three calls the \"Find a Doctor\" page makes — workflow,\n * specialty, then `GetSlots` until the server says it is done.\n */\nexport async function fetchOpenSlots(\n  request: MyChartRequest,\n  options: OpenSlotsOptions = {},\n): Promise<SlotSearchResult> {\n  const context = await resolveSchedulingContext(request, options);\n  const { token, specialty, reason, visitTypeId, treeId } = context;\n\n  // A gated org needs the questionnaire cleared first. A token from\n  // `submitSchedulingAnswers` is used as-is; raw answers are walked here; with\n  // neither, the search still runs and the result carries the questions so the\n  // caller learns what is being asked rather than just `LqfAnswersRequired`.\n  let lqfIds: string[] = options.answerToken?.lqfIds ?? [];\n  let patientAnswerIds: string[] = options.answerToken?.patientAnswerIds ?? [];\n  let questionnaire: SchedulingQuestionnaire | null = null;\n  if (treeId && lqfIds.length === 0) {\n    const walk = await walkSchedulingQuestionnaire(request, { token, treeId, visitTypeId, answers: options.answers ?? [] });\n    if (walk.treeAnswerId) {\n      lqfIds = [walk.treeId];\n      patientAnswerIds = [walk.treeAnswerId];\n    } else {\n      // The search still runs from here. It will come back\n      // `LqfAnswersRequired`, and that is the point: the instance's own code\n      // is better evidence than an assumption, and it costs one request.\n      questionnaire = {\n        required: true,\n        treeId: walk.treeId,\n        visitTypeId,\n        nextQuestion: walk.unanswered,\n        questions: walk.questions,\n        complete: walk.traversalComplete,\n        answerToken: null,\n        specialty,\n        reasonForVisit: reason?.Title ?? null,\n        window: context.window,\n      };\n    }\n  }\n\n  let pairs = context.pairs\n    // Only the three keys the live page sends per pair.\n    .map((p) => ({ ProviderId: p.ProviderId, DepartmentId: p.DepartmentId, IsTeamMember: p.IsTeamMember === true }));\n\n  // Keep only the pairs actually bookable under the chosen reason.\n  //\n  // `ProviderDepartmentPairs` is the whole specialty; a reason for visit\n  // covers a subset. Sending a pair the reason does not cover is what the\n  // second refusal surface was: the instance answers 302 to the error page\n  // rather than ignoring it. Some instances tolerate the full list, which is\n  // why this only showed up on 59 of 577 hosts.\n  const bookable = new Set(reason?.DirectProviderDepartmentPairIDs ?? []);\n  if (bookable.size > 0) {\n    pairs = pairs.filter((p) => bookable.has(`${p.ProviderId}^${p.DepartmentId}`));\n  }\n  if (options.providerIds?.length) {\n    const keep = new Set(options.providerIds);\n    pairs = pairs.filter((p) => keep.has(p.ProviderId));\n  }\n  if (options.maxPairs !== undefined && options.maxPairs >= 0) pairs = pairs.slice(0, options.maxPairs);\n  if (pairs.length === 0) {\n    return { specialty, slots: [], pages: 0, errorCode: null, complete: true, questionnaire };\n  }\n\n  // Today comes off the wall clock, not UTC: at 9pm Pacific it is already\n  // tomorrow in UTC, and starting the search there silently skips same-day slots.\n  const startDte = options.startDate ? toEpicDte(options.startDate) : toEpicDteLocal(new Date());\n  const maxPages = options.maxPages ?? 10;\n  const slots: OpenSlot[] = [];\n  let cursor: ContinueInfo | null = null;\n  let pages = 0;\n  let errorCode: number | string | null = null;\n  let complete = false;\n\n  while (pages < maxPages) {\n    const body: Record<string, unknown> = {\n      workflow: {\n        Type: 2,\n        IsGuest: false,\n        IsAnonymous: true,\n        IsFromPrelogin: false,\n        SchedulingControllerParams: { isAnonymous: true, workflow: 'NewProvider' },\n        IsAuthenticatedWidget: false,\n      },\n      appointmentBuilder: {\n        Appointments: [\n          {\n            VisitTypeId: visitTypeId,\n            ProviderDepartmentPairs: pairs,\n            Slot: '',\n            SelectedTelehealthMode: 0,\n            CanSkipLicensureCheck: true,\n            ...(lqfIds.length ? { LqfIds: lqfIds, PatientAnswerIds: patientAnswerIds } : {}),\n          },\n        ],\n        ReasonForVisitLine: reason?.Id ?? null,\n        ReasonForVisitValue: reason?.CategoryValue ?? null,\n        SpecialtyId: specialty.id,\n      },\n      startDte,\n      useSchedulingPreferences: false,\n    };\n    if (cursor) body.continueInfo = cursor;\n\n    const data = await postForm<RawSlotsResponse>(request, SLOTS_PATH, token, body, OPEN_SCHEDULING_PATH);\n    pages++;\n    slots.push(...parseSlotsResponse(data));\n\n    errorCode = errorCodeOf(data);\n    if (errorCode !== null) {\n      logger.debug(`GetSlots on ${request.hostname} returned ErrorCode ${String(errorCode)} — stopping`);\n      break;\n    }\n    if (isSearchComplete(cursor, data.ContinueInfo)) {\n      complete = true;\n      break;\n    }\n    cursor = data.ContinueInfo ?? null;\n  }\n\n  return { specialty, slots, pages, errorCode, complete, questionnaire };\n}\n\n/**\n * Every open slot one provider has, across the departments they book at.\n *\n * This is the open half of a doctor's calendar and nothing more — MyChart does\n * not tell an anonymous caller which slots are taken, only which are free.\n */\nexport async function fetchProviderAvailability(\n  request: MyChartRequest,\n  providerId: string,\n  options: Omit<OpenSlotsOptions, 'providerIds'> = {},\n): Promise<SlotSearchResult> {\n  return fetchOpenSlots(request, { ...options, providerIds: [providerId] });\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n/**\n * The pre-login scrapers: what a MyChart instance tells anyone about the\n * health system behind it. See `networkProfile.ts` for the one-call entry.\n */\n\nexport { fetchHospitalNetworkProfile, INSURANCE_GATE_REASON, type NetworkProfileOptions } from './networkProfile';\nexport { parseOrgProfile } from './orgProfile';\nexport { fetchProviderDirectory, type ProviderDirectoryOptions } from './providerDirectory';\nexport { windowDates } from './schedulingContext';\nexport { fetchOpenSlots, fetchProviderAvailability, type OpenSlotsOptions } from './openSlots';\n// `walkSchedulingQuestionnaire` is deliberately not re-exported: the two calls\n// above are the surface, and the raw walk is how they are implemented.\nexport { fetchSchedulingQuestionnaire, submitSchedulingAnswers } from './schedulingQuestionnaire';\nexport { fetchBillingEntities } from './guestEstimates';\nexport { PreloginEndpointError } from './preloginSession';\nexport type * from './types';\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\nimport * as readline from 'readline';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { version as CLI_VERSION } from '../package.json';\nimport { myChartUserPassLogin, myChartPasskeyLogin, complete2faFlow, areCookiesValid, type TwoFaResult } from '../../scrapers/myChart/auth/login';\nimport { MyChartRequest } from '../../scrapers/myChart/core/myChartRequest';\nimport { getMyChartAccounts } from '../../read-local-passwords/index';\nimport type { PasswordStoreEntryWithKey } from '../../read-local-passwords/types';\nimport { sendNewMessage, getMessageTopics, getMessageRecipients, getVerificationToken } from '../../scrapers/myChart/chart/messages/sendMessage';\nimport { sendReply } from '../../scrapers/myChart/chart/messages/sendReply';\nimport { listConversations } from '../../scrapers/myChart/chart/messages/conversations';\nimport { checkProxyContext } from '../../scrapers/myChart/proxy/proxyContext';\nimport { sessionStore } from '../../scrapers/myChart/core/sessionStore';\nimport { generateTotpCode } from '../../scrapers/myChart/auth/totp';\nimport { setupTotp } from '../../scrapers/myChart/auth/setupTotp';\nimport { saveTotpSecret, loadTotpSecret } from './totpStore';\nimport { savePasskeyCredential, loadPasskeyCredential } from './passkeyStore';\nimport { passkeyLoginWithCounterRetry } from '../../scrapers/myChart/auth/passkeyLoginRetry';\nimport { wireSilentReauthentication } from '../../scrapers/myChart/auth/silentLogin';\nimport type { PasskeyCredential } from '../../scrapers/myChart/auth/softwareAuthenticator';\nimport { sendTelemetryEvent } from '../../shared/telemetry';\nimport { checkVersion, formatUpdateNotice } from '../../scrapers/metadata/version';\nimport { isBlockedInstance } from '../../scrapers/myChart/auth/blockedInstances';\nimport {\n  COMMON_CAPABILITIES,\n  LESS_FREQUENTLY_USED_CAPABILITIES,\n  getCapability,\n  isPublicCapability,\n  type Capability,\n} from '../../shared/capabilities';\nimport {\n  FULL_SCRAPE_CAPABILITIES,\n  downloadAllImagingStudies,\n  renderCapabilityList,\n  resolveCliAction,\n  runCapabilityAction,\n  runPublicCapabilityAction,\n} from './capabilityActions';\nimport { renderCliHelp } from './help';\nimport { fetchHospitalNetworkProfile } from '../../scrapers/myChart/prelogin';\nimport { fetchResolvedMyChartDirectory } from '../../scrapers/list-all-mycharts/refreshDirectory';\nimport { detailedMessage } from '../../shared/detailedError';\n\n// Note: We NEVER modify or delete macOS Keychain entries. Read-only via browser password extraction.\n\n// ─── Cookie cache helpers ───\nconst COOKIE_CACHE_DIR = path.join(process.cwd(), '.cookie-cache');\n\nasync function tryLoadCachedSession(hostname: string): Promise<MyChartRequest | null> {\n  const cachePath = path.join(COOKIE_CACHE_DIR, `${hostname}.json`);\n  try {\n    const data = await fs.promises.readFile(cachePath, 'utf-8');\n    const mychartRequest = await MyChartRequest.unserialize(data);\n    if (!mychartRequest) return null;\n    const valid = await areCookiesValid(mychartRequest);\n    if (valid) return mychartRequest;\n    console.log('  Cached cookies expired, will do fresh login.');\n    return null;\n  } catch {\n    return null;\n  }\n}\n\nasync function saveCachedSession(hostname: string, mychartRequest: MyChartRequest): Promise<void> {\n  await fs.promises.mkdir(COOKIE_CACHE_DIR, { recursive: true });\n  const cachePath = path.join(COOKIE_CACHE_DIR, `${hostname}.json`);\n  await fs.promises.writeFile(cachePath, await mychartRequest.serialize());\n}\n\n// ─── Parse CLI args ───\n// Usage:\n//   npx tsx src/cli.ts --host <hostname>                        (finds creds from browser passwords)\n//   npx tsx src/cli.ts --host <hostname> --user <u> --pass <p>  (uses provided creds)\n//   npx tsx src/cli.ts --host <hostname> --2fa <code>           (provides 2FA code)\n//   npx tsx src/cli.ts --host <hostname> --no-cache             (skip cached cookies)\n//   npx tsx src/cli.ts --read-login-from-browser --host <hostname>  (read creds from browser password stores)\n//   npx tsx src/cli.ts --read-login-from-browser               (auto-pick first MyChart account from browsers)\n//   npx tsx src/cli.ts --host <hostname> --action send-message  (send a new message)\n//   npx tsx src/cli.ts --host <hostname> --action send-reply --conversation-id <id> --message <msg>\n//   npx tsx src/cli.ts --host <hostname> --action list-proxies                 (list accessible patient records)\n//   npx tsx src/cli.ts --host <hostname> --patient \"Bart Simpson\"            (read a proxy patient's chart)\n//   npx tsx src/cli.ts --host <hostname> --switch \"Bart Simpson\"             (change MyChart's active patient)\n//   npx tsx src/cli.ts --help                                                (usage + the commonly-used capabilities)\n//   npx tsx src/cli.ts --help --show-all                                     (…including the less-frequently-used ones)\n//   npx tsx src/cli.ts --list-capabilities [--show-all]                      (just the capability listing)\n//   npx tsx src/cli.ts --host <hostname> --action get_visit_notes --arg csn=123\n//   npx tsx src/cli.ts --host <hostname> --action get_medications --mode concise   (raw | standard | concise | json)\n//   npx tsx src/cli.ts --action search_mycharts --arg query=uchealth         (public: no host, no credentials)\n//   npx tsx src/cli.ts --action lookup_npi --arg npi=1234567893              (public: no host, no credentials)\n//\n// `--action` accepts any id from the shared capability registry\n// (`shared/capabilities/`) and prints its result as JSON, with parameters\n// supplied by repeated `--arg name=value`. That is what keeps the CLI from\n// drifting behind the extension and the app: a capability added there is a CLI\n// command the same day, with no flag plumbing to remember.\n\ninterface CliArgs {\n  host?: string; user?: string; pass?: string; twofa?: string;\n  nocache?: boolean; readLoginFromBrowser?: boolean; action?: string;\n  conversationId?: string; message?: string; subject?: string;\n  patient?: string; switchPatient?: string;\n  setupTotp?: boolean; useSavedTotp?: boolean; disableTotp?: boolean;\n  setupPasskey?: boolean; usePasskey?: boolean; listPasskeys?: boolean;\n  deletePasskey?: boolean; local?: boolean; saveClo?: boolean;\n  help?: boolean;\n  listCapabilities?: boolean;\n  /** Include the less-frequently-used capabilities in `--help` / `--list-capabilities`. */\n  showAll?: boolean;\n  /** Repeated `--arg name=value` pairs, passed straight to the capability. */\n  capabilityArgs?: Record<string, string>;\n  /** Where media capabilities write their decoded JPEGs (default ./imaging-output). */\n  output?: string;\n  /** Output mode for read capabilities: raw | standard | concise | json (default json). */\n  mode?: string;\n}\n\nfunction parseArgs(): CliArgs {\n  const args = process.argv.slice(2);\n  const parsed: Record<string, string | boolean | Record<string, string>> = {};\n  const capabilityArgs: Record<string, string> = {};\n  parsed.capabilityArgs = capabilityArgs;\n  for (let i = 0; i < args.length; i++) {\n    if (args[i] === '--help' || args[i] === '-h') parsed.help = true;\n    else if (args[i] === '--show-all') parsed.showAll = true;\n    else if (args[i] === '--list-capabilities') parsed.listCapabilities = true;\n    // `--arg name=value`, repeatable. Whatever the chosen capability declares\n    // in the shared registry is what this accepts — no per-flag plumbing.\n    else if (args[i] === '--arg' && args[i + 1]) {\n      const pair = args[++i]!; // guarded by args[i + 1] above\n      const eq = pair.indexOf('=');\n      if (eq <= 0) {\n        console.error(`  --arg expects name=value, got \"${pair}\".`);\n        process.exit(1);\n      }\n      capabilityArgs[pair.slice(0, eq)] = pair.slice(eq + 1);\n    }\n    else if (args[i] === '--host' && args[i + 1]) parsed.host = args[++i]!;\n    else if (args[i] === '--user' && args[i + 1]) parsed.user = args[++i]!;\n    else if (args[i] === '--pass' && args[i + 1]) parsed.pass = args[++i]!;\n    else if (args[i] === '--2fa' && args[i + 1]) parsed.twofa = args[++i]!;\n    else if (args[i] === '--no-cache') parsed.nocache = true;\n    else if (args[i] === '--read-login-from-browser') parsed.readLoginFromBrowser = true;\n    else if (args[i] === '--action' && args[i + 1]) parsed.action = args[++i]!;\n    else if (args[i] === '--conversation-id' && args[i + 1]) parsed.conversationId = args[++i]!;\n    else if (args[i] === '--message' && args[i + 1]) parsed.message = args[++i]!;\n    else if (args[i] === '--subject' && args[i + 1]) parsed.subject = args[++i]!;\n    // Which patient's chart to read. A name (full or partial), a record id, or\n    // \"me\". Applies to every action; see checkProxyContext().\n    else if (args[i] === '--patient' && args[i + 1]) parsed.patient = args[++i]!;\n    // The one command that changes MyChart's server-side active patient.\n    else if (args[i] === '--switch' && args[i + 1]) parsed.switchPatient = args[++i]!;\n    else if (args[i] === '--set-up-totp') parsed.setupTotp = true;\n    else if (args[i] === '--use-saved-totp') parsed.useSavedTotp = true;\n    else if (args[i] === '--disable-totp') parsed.disableTotp = true;\n    else if (args[i] === '--set-up-passkey') parsed.setupPasskey = true;\n    else if (args[i] === '--use-passkey') parsed.usePasskey = true;\n    else if (args[i] === '--list-passkeys') parsed.listPasskeys = true;\n    else if (args[i] === '--delete-passkey') parsed.deletePasskey = true;\n    else if (args[i] === '--local') parsed.local = true;\n    else if (args[i] === '--save-clo') parsed.saveClo = true;\n    // Output directory for capabilities that produce files: images (rendersMedia) or one downloaded file (returnsFile).\n    else if (args[i] === '--output' && args[i + 1]) parsed.output = args[++i]!; // guarded by args[i + 1] check\n    // How read capabilities render their payload. Validated by the registry.\n    else if (args[i] === '--mode' && args[i + 1]) parsed.mode = args[++i]!;\n  }\n  return parsed;\n}\n\nconst cliArgs = parseArgs();\n\n// If --host provided, try to find creds from browser password stores (read-only)\nasync function resolveCredsFromBrowsers(host: string): Promise<{ user: string; pass: string } | null> {\n  console.log(`  Scanning browser passwords for ${host}...`);\n  try {\n    const accounts = await getMyChartAccounts();\n    const match = accounts.find(a => {\n      try {\n        return new URL(a.url).hostname === host;\n      } catch { return false; }\n    });\n    if (match?.user && match.pass) {\n      console.log(`  Found credentials for ${host} in browser passwords (user: ${match.user})`);\n      return { user: match.user, pass: match.pass };\n    }\n  } catch (err) {\n    console.log(`  Could not scan browser passwords: ${(err as Error).message}`);\n  }\n\n  return null;\n}\n\nlet nonInteractive = false;\n\nlet rl: readline.Interface;\n\nfunction getRL(): readline.Interface {\n  if (!rl) {\n    rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n  }\n  return rl;\n}\n\nfunction closeRL() {\n  if (rl) rl.close();\n}\n\nfunction ask(question: string): Promise<string> {\n  return new Promise((resolve) => {\n    getRL().question(question, (answer) => resolve(answer.trim()));\n  });\n}\n\nfunction header(title: string) {\n  const line = '='.repeat(60);\n  console.log(`\\n${line}`);\n  console.log(`  ${title}`);\n  console.log(line);\n}\n\nfunction subheader(title: string) {\n  console.log(`\\n  -- ${title} --`);\n}\n\n// ─── Step 1: Discover or manually enter credentials ───\n\nasync function discoverAccounts(): Promise<PasswordStoreEntryWithKey[]> {\n  header('Discovering MyChart Accounts');\n  console.log('  Scanning your browsers for saved MyChart passwords...');\n  console.log('  (Chrome, Arc, Firefox)\\n');\n\n  try {\n    const accounts = await getMyChartAccounts();\n    if (accounts.length === 0) {\n      console.log('  No MyChart accounts found in your browsers.');\n    } else {\n      console.log(`  Found ${accounts.length} MyChart account(s):\\n`);\n      for (let i = 0; i < accounts.length; i++) {\n        const a = accounts[i]!; // loop condition guarantees i < accounts.length\n        const hostname = new URL(a.url).hostname;\n        console.log(`    [${i + 1}] ${hostname} - ${a.user || '(no username)'}`);\n      }\n    }\n    return accounts;\n  } catch (err) {\n    console.log('  Could not scan browsers:', (err as Error).message);\n    console.log('  You can still enter credentials manually.\\n');\n    return [];\n  }\n}\n\nasync function getCredentials(): Promise<{ hostname: string; username: string; password: string }[]> {\n  const choice = await ask('\\n  How would you like to proceed?\\n    [1] Scan browsers for saved MyChart passwords (Recommended)\\n    [2] Enter credentials manually\\n  Choice (1 or 2): ');\n\n  if (choice === '1') {\n    const accounts = await discoverAccounts();\n\n    if (accounts.length === 0) {\n      console.log('\\n  No accounts found. Falling back to manual entry.\\n');\n      return [await getManualCredentials()];\n    }\n\n    const selection = await ask(`\\n  Which accounts to scrape?\\n    [a] All of them\\n    [#] Enter number (e.g. \"1\" or \"1,3\")\\n    [m] Enter credentials manually instead\\n  Choice: `);\n\n    if (selection.toLowerCase() === 'm') {\n      return [await getManualCredentials()];\n    }\n\n    let selectedAccounts: PasswordStoreEntryWithKey[];\n\n    if (selection.toLowerCase() === 'a') {\n      selectedAccounts = accounts;\n    } else {\n      const indices = selection.split(',').map(s => parseInt(s.trim(), 10) - 1).filter(i => i >= 0 && i < accounts.length);\n      if (indices.length === 0) {\n        console.log('  Invalid selection. Using all accounts.');\n        selectedAccounts = accounts;\n      } else {\n        selectedAccounts = indices.map(i => accounts[i]!); // indices were filtered to be in range\n      }\n    }\n\n    return selectedAccounts.map(a => {\n      const hostname = new URL(a.url).hostname;\n      return {\n        hostname,\n        username: a.user || '',\n        password: a.pass || '',\n      };\n    });\n  }\n\n  return [await getManualCredentials()];\n}\n\nasync function getManualCredentials(): Promise<{ hostname: string; username: string; password: string }> {\n  console.log('\\n  Example hostnames:');\n  console.log('    - mychart.example.org');\n  console.log('    - mychart.ochsner.org');\n  console.log('    - mychart.geisinger.org\\n');\n\n  const hostname = await ask('  MyChart hostname: ');\n  const username = await ask('  Username: ');\n  const password = await ask('  Password: ');\n\n  if (!hostname || !username || !password) {\n    console.log('\\n  All fields are required. Exiting.');\n    rl.close();\n    process.exit(1);\n  }\n\n  return { hostname, username, password };\n}\n\n// ─── Types ───\n\ntype LoginCredentials =\n  | { hostname: string; passkey: PasskeyCredential }\n  | { hostname: string; username: string; password: string; totp?: string };\n\n// ─── Step 2: Login ───\n\n/**\n * Wire automatic session renewal: when a scrape's session expires mid-run,\n * makeAuthenticatedRequest calls this hook to silently log back in with\n * whatever non-interactive credentials exist (passkey, password, saved TOTP\n * secret) and refresh the cookie cache. Stores are re-read at renewal time so\n * a passkey or TOTP secret saved after login still counts.\n */\nfunction wireCliSessionRenewal(mychartRequest: MyChartRequest, creds: LoginCredentials) {\n  wireSilentReauthentication(mychartRequest, async () => ({\n    hostname: creds.hostname,\n    username: 'username' in creds ? creds.username : undefined,\n    password: 'password' in creds ? creds.password : undefined,\n    totpSecret: ('totp' in creds ? creds.totp : undefined) ?? await loadTotpSecret(creds.hostname),\n    passkey: 'passkey' in creds ? creds.passkey : await loadPasskeyCredential(creds.hostname),\n    protocol: cliArgs.local ? 'http' : undefined,\n    onPasskeyUsed: (credential) => savePasskeyCredential(creds.hostname, credential),\n  }), (renewed) => saveCachedSession(creds.hostname, renewed));\n}\n\nasync function login(creds: LoginCredentials): Promise<MyChartRequest | null> {\n  if (isBlockedInstance(creds.hostname)) {\n    console.log(`\\n  ✗ ${creds.hostname} is not supported. central.mychart.org is a portal aggregator and cannot be scraped directly. Please use the individual hospital MyChart instance instead.`);\n    return null;\n  }\n\n  console.log(`\\n  Connecting to ${creds.hostname}...`);\n\n  // Try cached session first (unless --no-cache)\n  if (!cliArgs.nocache) {\n    const cached = await tryLoadCachedSession(creds.hostname);\n    if (cached) {\n      console.log('  Using cached session (skipping login).');\n      wireCliSessionRenewal(cached, creds);\n      return cached;\n    }\n  }\n\n  try {\n    // Passkey login\n    if ('passkey' in creds) {\n      console.log(`  Attempting passkey login for ${creds.hostname}...`);\n      // MyChart enforces a strictly-increasing WebAuthn signature counter. Our\n      // stored counter can lag the server's, which rejects the first attempt;\n      // passkeyLoginWithCounterRetry bumps and retries to recover.\n      const passkeyResult = await passkeyLoginWithCounterRetry(\n        (credential) => myChartPasskeyLogin({\n          hostname: creds.hostname,\n          credential,\n          protocol: cliArgs.local ? 'http' : undefined,\n        }),\n        creds.passkey,\n      );\n\n      if (passkeyResult.state === 'logged_in') {\n        console.log('  Passkey login successful!');\n        // Persist the accepted (incremented) sign counter so the next login\n        // starts from the right place and doesn't have to retry.\n        await savePasskeyCredential(creds.hostname, creds.passkey);\n        await saveCachedSession(creds.hostname, passkeyResult.mychartRequest);\n        wireCliSessionRenewal(passkeyResult.mychartRequest, creds);\n        return passkeyResult.mychartRequest;\n      }\n\n      console.log(`  Passkey login failed (${passkeyResult.state}).`);\n      return null;\n    }\n\n    // Password login\n    const useTotpSecret = creds.totp ?? (cliArgs.useSavedTotp ? await loadTotpSecret(creds.hostname) : null);\n    if (cliArgs.useSavedTotp && !useTotpSecret) {\n      console.log(`  No saved TOTP secret found for ${creds.hostname}. Run with --set-up-totp first.`);\n      return null;\n    }\n\n    // When using TOTP, skip the SendCode call (no email needed)\n    const loginResult = await myChartUserPassLogin({\n      hostname: creds.hostname,\n      user: creds.username,\n      pass: creds.password,\n      skipSendCode: !!useTotpSecret,\n      protocol: cliArgs.local ? 'http' : undefined,\n    });\n\n    if (loginResult.state === 'invalid_login') {\n      console.log('  Login failed: Invalid username or password.');\n      return null;\n    }\n\n    if (loginResult.state === 'error') {\n      console.log(`  Login error: ${loginResult.error}`);\n      return null;\n    }\n\n    let mychartRequest = loginResult.mychartRequest;\n\n    if (loginResult.state === 'need_2fa') {\n      // Show where the code was sent (helpful for any path).\n      if (loginResult.twoFaDelivery) {\n        const { method, contact } = loginResult.twoFaDelivery;\n        if (method === 'sms') {\n          console.log(`  2FA code sent via text message${contact ? ` to ${contact}` : ''}`);\n        } else {\n          console.log(`  2FA code sent via email${contact ? ` to ${contact}` : ''}`);\n        }\n      }\n\n      // A rejected code re-prompts instead of aborting the run — 3 submissions\n      // max. complete2faFlow re-reads the 2FA page (and a fresh CSRF token) on\n      // every call, and no attempt re-sends a code (that would text or email\n      // the user again).\n      const MAX_2FA_ATTEMPTS = 3;\n      let twoFaResult: TwoFaResult;\n      for (let attempt = 1; ; attempt++) {\n        let code: string;\n        if (useTotpSecret) {\n          // Generate TOTP code locally — no email, no waiting\n          code = await generateTotpCode(useTotpSecret);\n          // The code is submitted programmatically — printing it only puts a\n          // live credential in the terminal scrollback.\n          console.log('  Generated TOTP code locally.');\n        } else if (cliArgs.twofa && attempt === 1) {\n          console.log('  Using 2FA code from --2fa arg');\n          code = cliArgs.twofa;\n        } else {\n          // Default: prompt the user for the code from their phone / email.\n          code = (await ask(attempt === 1\n            ? '  Enter 2FA code: '\n            : `  Invalid 2FA code. Try again (attempt ${attempt} of ${MAX_2FA_ATTEMPTS}): `)).trim();\n          if (!code) {\n            console.log('  No 2FA code entered. Skipping this account.');\n            return null;\n          }\n        }\n\n        twoFaResult = await complete2faFlow({\n          mychartRequest,\n          twofaCodeArray: [{ code, score: 1 }],\n          isTOTP: !!useTotpSecret,\n        });\n\n        if (twoFaResult.state === 'logged_in') break;\n\n        if (twoFaResult.state === 'error') {\n          console.log('  Error completing 2FA.');\n          return null;\n        }\n\n        // A rejected TOTP code means the stored secret is wrong; resubmitting can't help.\n        // Without a TTY nobody can answer a re-prompt — ask() on EOF'd stdin never settles.\n        if (attempt >= MAX_2FA_ATTEMPTS || useTotpSecret || !process.stdin.isTTY) {\n          console.log('  Invalid 2FA code.');\n          return null;\n        }\n      }\n\n      mychartRequest = twoFaResult.mychartRequest;\n\n      // After successful email-based 2FA, offer TOTP auto-setup\n      if (!useTotpSecret && !cliArgs.setupTotp) {\n        const existingSecret = await loadTotpSecret(creds.hostname);\n        if (!existingSecret) {\n          console.log('\\n  To let the CLI sign in automatically in the future, we can set up');\n          console.log('  a TOTP authenticator on your MyChart account (no email codes needed).');\n          const setupChoice = await ask('  Set up automatic sign-in? (y/n): ');\n          if (setupChoice.trim().toLowerCase() === 'y') {\n            console.log('  Setting up TOTP authenticator...');\n            const result = await setupTotp(mychartRequest, creds.password);\n            if (result.secret) {\n              await saveTotpSecret(creds.hostname, result.secret);\n              console.log('  TOTP configured! Future logins will use --use-saved-totp automatically.');\n            } else {\n              console.log(`  TOTP setup failed: ${result.error}`);\n              console.log('  Your session is still active but will expire in a few hours.');\n              console.log('  Without TOTP, you\\'ll need email 2FA again next time.');\n            }\n          } else {\n            console.log('  Skipped TOTP setup. Your session will expire in a few hours.');\n            console.log('  Tip: Use --set-up-totp later to enable automatic sign-in.');\n          }\n        }\n      }\n    }\n\n    console.log('  Logged in successfully!');\n    await saveCachedSession(creds.hostname, mychartRequest);\n    wireCliSessionRenewal(mychartRequest, creds);\n    return mychartRequest;\n  } catch (err) {\n    console.error('  Login failed:', (err as Error).message);\n    return null;\n  }\n}\n\n// ─── Step 3: Scrape everything ───\n//\n// The default no-`--action` run. There is no hand-written per-category\n// fetching or rendering here any more: every category is a registry\n// capability, dispatched through `runCapabilityAction` →\n// `executeCapability` like any other `--action`, so the full scrape gets\n// the same active-patient guard and prints the same JSON. What gets\n// scraped is `FULL_SCRAPE_CAPABILITIES` — derived from the registry, so a\n// read capability added there is scraped here with no CLI change.\n\nasync function scrapeAll(\n  session: { hostname: string; request: MyChartRequest },\n  password: string | undefined,\n): Promise<boolean> {\n  header(`Scraping: ${session.hostname}`);\n  console.log('  This may take a minute...');\n\n  let failures = 0;\n  for (const capability of FULL_SCRAPE_CAPABILITIES) {\n    const ok = await runCapabilityAction(\n      capability,\n      session,\n      password,\n      {},\n      cliArgs.output,\n      cliArgs.patient,\n      cliArgs.mode,\n    );\n    if (!ok) failures++;\n  }\n\n  if (failures > 0) {\n    console.log(`\\n  ${failures} of ${FULL_SCRAPE_CAPABILITIES.length} categories failed on ${session.hostname}; see above.`);\n  }\n  return failures === 0;\n}\n\n// ─── Send Message Handler ───\n\nasync function handleSendMessage(mychartRequest: MyChartRequest) {\n  header('Send New Message');\n\n  const token = await getVerificationToken(mychartRequest);\n  if (!token) {\n    console.log('  Could not get verification token. Session may have expired.');\n    return;\n  }\n\n  // Get available topics\n  const topics = await getMessageTopics(mychartRequest, token);\n  if (topics.length === 0) {\n    console.log('  No message topics available.');\n    return;\n  }\n\n  console.log('\\n  Available topics:');\n  for (let i = 0; i < topics.length; i++) {\n    console.log(`    [${i + 1}] ${topics[i]!.displayName}`); // loop bound guarantees the index\n  }\n\n  const topicChoice = await ask('\\n  Select topic number: ');\n  const topicIdx = parseInt(topicChoice, 10) - 1;\n  if (topicIdx < 0 || topicIdx >= topics.length) {\n    console.log('  Invalid topic selection.');\n    return;\n  }\n  const selectedTopic = topics[topicIdx]!; // range-checked just above\n\n  // Get available recipients\n  const recipients = await getMessageRecipients(mychartRequest, token);\n  if (recipients.length === 0) {\n    console.log('  No recipients available.');\n    return;\n  }\n\n  console.log('\\n  Available recipients:');\n  for (let i = 0; i < recipients.length; i++) {\n    const r = recipients[i]!; // loop bound guarantees the index\n    const specialty = r.specialty ? ` (${r.specialty})` : r.pcpTypeDisplayName ? ` (${r.pcpTypeDisplayName})` : '';\n    console.log(`    [${i + 1}] ${r.displayName}${specialty}`);\n  }\n\n  const recipientChoice = await ask('\\n  Select recipient number: ');\n  const recipientIdx = parseInt(recipientChoice, 10) - 1;\n  if (recipientIdx < 0 || recipientIdx >= recipients.length) {\n    console.log('  Invalid recipient selection.');\n    return;\n  }\n  const selectedRecipient = recipients[recipientIdx]!; // range-checked just above\n\n  const subject = cliArgs.subject || await ask('\\n  Subject: ');\n  const messageBody = cliArgs.message || await ask('  Message: ');\n\n  if (!subject || !messageBody) {\n    console.log('  Subject and message are required.');\n    return;\n  }\n\n  console.log(`\\n  Sending message to ${selectedRecipient.displayName}...`);\n  console.log(`  Topic: ${selectedTopic.displayName}`);\n  console.log(`  Subject: ${subject}`);\n  console.log(`  Message: ${messageBody}\\n`);\n\n  const result = await sendNewMessage(mychartRequest, {\n    recipient: selectedRecipient,\n    topic: selectedTopic,\n    subject,\n    messageBody,\n  });\n\n  if (result.success) {\n    console.log('  Message sent successfully!');\n    console.log(`  Conversation ID: ${result.conversationId}`);\n  } else {\n    console.log(`  Failed to send message: ${result.error}`);\n  }\n}\n\n// ─── Send Reply Handler ───\n\nasync function handleSendReply(mychartRequest: MyChartRequest) {\n  header('Send Reply');\n\n  let conversationId = cliArgs.conversationId;\n  let messageBody = cliArgs.message;\n\n  if (!conversationId) {\n    // List conversations and let user pick\n    subheader('Recent Conversations');\n    const conversations = await listConversations(mychartRequest);\n    const convoList = conversations?.conversations ?? [];\n\n    if (convoList.length === 0) {\n      console.log('  No conversations found.');\n      return;\n    }\n\n    for (let i = 0; i < Math.min(convoList.length, 10); i++) {\n      const c = convoList[i]!; // loop bound guarantees the index\n      const audience = c.audience.map((a) => a.name ?? '').filter(Boolean).join(', ') || 'System';\n      console.log(`    [${i + 1}] \"${c.subject}\" - ${audience}`);\n    }\n\n    const convoChoice = await ask('\\n  Select conversation to reply to: ');\n    const convoIdx = parseInt(convoChoice, 10) - 1;\n    if (convoIdx < 0 || convoIdx >= convoList.length) {\n      console.log('  Invalid selection.');\n      return;\n    }\n    conversationId = convoList[convoIdx]!.hthId ?? undefined; // range-checked just above\n  }\n\n  if (!messageBody) {\n    messageBody = await ask('\\n  Reply message: ');\n  }\n\n  if (!messageBody) {\n    console.log('  Message is required.');\n    return;\n  }\n\n  console.log(`\\n  Sending reply...`);\n  console.log(`  Message: ${messageBody}\\n`);\n\n  const result = await sendReply(mychartRequest, {\n    conversationId: conversationId!,\n    messageBody,\n  });\n\n  if (result.success) {\n    console.log('  Reply sent successfully!');\n    console.log(`  Conversation ID: ${result.conversationId}`);\n  } else {\n    console.log(`  Failed to send reply: ${result.error}`);\n  }\n}\n\n// ─── Main ───\n\nasync function main() {\n  // Fire-and-forget telemetry — never blocks or breaks the CLI\n  sendTelemetryEvent('cli_started', {\n    action: cliArgs.action || 'default',\n    host: cliArgs.host || 'unknown',\n  }, 'cli');\n\n  // Fire-and-forget update check — never blocks or breaks the CLI. Null when\n  // the site is unreachable or the answer is unparseable; silence is the right\n  // output for both.\n  void checkVersion({ currentVersion: CLI_VERSION, target: 'cli' }).then((check) => {\n    if (check?.updateAvailable) console.warn(`\\n  ${formatUpdateNotice(check)}\\n`);\n  });\n\n  // Saying what the CLI can do needs no account and no network. Both listings\n  // lead with the commonly-used capabilities and name `--show-all` for the rest.\n  if (cliArgs.help) {\n    console.log(renderCliHelp({ showAll: cliArgs.showAll }));\n    closeRL();\n    return;\n  }\n  if (cliArgs.listCapabilities) {\n    console.log(renderCapabilityList({ showAll: cliArgs.showAll }));\n    closeRL();\n    return;\n  }\n\n  // ── Actions that need no account ─────────────────────────────────────────\n  //\n  // The NPI Registry and Epic's MyChart directory belong to nobody, so a\n  // lookup against them must not be gated behind a login — and must not run\n  // once per configured account, which is what everything below `main`'s\n  // login block does. Handled here, before a single credential is resolved.\n  if (cliArgs.action) {\n    const publicCapability = resolveCliAction(cliArgs.action);\n    if (publicCapability && isPublicCapability(publicCapability)) {\n      const ok = await runPublicCapabilityAction(publicCapability, cliArgs.capabilityArgs ?? {});\n      closeRL();\n      process.exit(ok ? 0 : 1);\n    }\n  }\n\n  // What the instance tells anyone about the health system behind it. Same\n  // idea, still hand-written: `get_hospital_info` is not a registry entry yet,\n  // so it gets its own branch here rather than the `public` dispatch above.\n  if (cliArgs.action === 'hospital-info' || cliArgs.action === 'get_hospital_info') {\n    if (!cliArgs.host) {\n      console.error('  --action hospital-info needs --host <hostname>.');\n      closeRL();\n      process.exit(1);\n    }\n    const args = cliArgs.capabilityArgs ?? {};\n    const specialties = args.specialties?.split(',').map((s) => s.trim()).filter(Boolean);\n    try {\n      const profile = await fetchHospitalNetworkProfile(cliArgs.host, {\n        ...(cliArgs.local ? { protocol: 'http' } : {}),\n        ...(specialties && specialties.length > 0 ? { specialties } : {}),\n        ...(args.max_specialties ? { maxSpecialties: Number(args.max_specialties) } : {}),\n        includeProviders: args.providers !== 'false',\n        includeBilling: args.billing !== 'false',\n      });\n      console.log(JSON.stringify(profile, null, 2));\n      closeRL();\n      process.exit(0);\n    } catch (err) {\n      console.error(`  ${detailedMessage(err)}`);\n      closeRL();\n      process.exit(1);\n    }\n  }\n\n  // Every MyChart in Epic's directory, with each login URL checked. Not a\n  // registry capability: it is a minutes-long crawl of ~1,400 sites, which no\n  // client should offer as a tool call.\n  if (cliArgs.action === 'list-mycharts') {\n    try {\n      const { instances, corrected, down } = await fetchResolvedMyChartDirectory((done, total) => {\n        if (done % 100 === 0 || done === total) process.stderr.write(`  checked ${done}/${total} login URLs\\n`);\n      });\n      instances.sort((a, b) => a.name.localeCompare(b.name) || a.slgId.localeCompare(b.slgId));\n      const json = JSON.stringify(instances, null, 2);\n      if (cliArgs.output) fs.writeFileSync(cliArgs.output, `${json}\\n`);\n      else console.log(json);\n      console.error(\n        `  ${instances.length} MyCharts: ${corrected} login URLs corrected, ${down.length} down` +\n          (cliArgs.output ? ` — written to ${cliArgs.output}` : ''),\n      );\n      closeRL();\n      process.exit(0);\n    } catch (err) {\n      console.error(`  ${detailedMessage(err)}`);\n      closeRL();\n      process.exit(1);\n    }\n  }\n\n  header('MyChart Scraper - Terminal');\n\n  // ─── Resolve credentials from browser passwords ───\n  // --read-login-from-browser: scan browser password stores for the given --host (or pick from all MyChart accounts)\n  if (cliArgs.readLoginFromBrowser) {\n    console.log('\\n  Scanning browser password stores for saved MyChart credentials...');\n    const accounts = await getMyChartAccounts();\n    if (cliArgs.host) {\n      const match = accounts.find(a => {\n        try { return new URL(a.url).hostname === cliArgs.host; } catch { return false; }\n      });\n      if (match?.user && match.pass) {\n        console.log(`  Found credentials for ${cliArgs.host} (user: ${match.user})`);\n        cliArgs.user = match.user;\n        cliArgs.pass = match.pass;\n      } else {\n        console.log(`  No saved credentials found for ${cliArgs.host}.`);\n        closeRL();\n        process.exit(1);\n      }\n    } else {\n      // No --host: pick the first MyChart account found\n      if (accounts.length === 0) {\n        console.log('  No MyChart credentials found in any browser.');\n        closeRL();\n        process.exit(1);\n      }\n      const first = accounts[0]!; // non-empty checked just above\n      cliArgs.host = new URL(first.url).hostname;\n      cliArgs.user = first.user!;\n      cliArgs.pass = first.pass!;\n      console.log(`  Using ${cliArgs.host} (user: ${cliArgs.user})`);\n    }\n  } else if (cliArgs.host && !cliArgs.user && !cliArgs.pass) {\n    // Check for saved passkey first — no username/password needed\n    const savedPasskey = await loadPasskeyCredential(cliArgs.host);\n    if (savedPasskey) {\n      console.log(`\\n  Found saved passkey for ${cliArgs.host}. Logging in with passkey...`);\n      cliArgs.usePasskey = true;\n    } else {\n      const resolved = await resolveCredsFromBrowsers(cliArgs.host);\n      if (resolved) {\n        cliArgs.user = resolved.user;\n        cliArgs.pass = resolved.pass;\n      } else {\n        console.log(`\\n  Could not find credentials for ${cliArgs.host}.`);\n        console.log(`  Provide them: npx tsx src/cli.ts --host ${cliArgs.host} --user X --pass Y\\n`);\n        closeRL();\n        process.exit(1);\n      }\n    }\n  }\n  nonInteractive = !!(cliArgs.host && (cliArgs.usePasskey || (cliArgs.user && cliArgs.pass)));\n\n  let credentialsList: LoginCredentials[];\n\n  if (nonInteractive) {\n    // Non-interactive mode: credentials from CLI args, Keychain, or passkey\n    console.log(`\\n  Non-interactive mode: --host ${cliArgs.host}`);\n    if (cliArgs.usePasskey) {\n      const passkey = await loadPasskeyCredential(cliArgs.host!);\n      if (!passkey) {\n        console.log(`  No saved passkey found for ${cliArgs.host}. Run with --set-up-passkey first.`);\n        closeRL();\n        process.exit(1);\n      }\n      credentialsList = [{ hostname: cliArgs.host!, passkey }];\n    } else {\n      credentialsList = [{ hostname: cliArgs.host!, username: cliArgs.user!, password: cliArgs.pass! }];\n    }\n  } else {\n    console.log('\\n  This tool logs into your MyChart account(s) and scrapes');\n    console.log('  your medical data (profile, bills, visits, labs, messages).');\n    credentialsList = await getCredentials();\n  }\n\n  if (credentialsList.length === 0) {\n    console.log('\\n  No accounts to scrape. Exiting.');\n    closeRL();\n    process.exit(0);\n  }\n\n  header('Logging In');\n\n  const sessions: { hostname: string; request: MyChartRequest }[] = [];\n\n  for (const creds of credentialsList) {\n    const mychartRequest = await login(creds);\n    if (mychartRequest) {\n      sessions.push({ hostname: creds.hostname, request: mychartRequest });\n    }\n  }\n\n  if (sessions.length === 0) {\n    console.log('\\n  Could not log in to any accounts. Exiting.');\n    closeRL();\n    process.exit(1);\n  }\n\n  console.log(`\\n  Successfully logged in to ${sessions.length} account(s).`);\n\n  // The password that resolved a session, for the account-security\n  // capabilities that need it (TOTP setup wants the account password).\n  const passwordFor = (hostname: string): string | undefined => {\n    const creds = credentialsList.find(c => c.hostname === hostname);\n    return creds && 'password' in creds ? creds.password : undefined;\n  };\n\n  /** Run one registry capability on every session; exits the process. */\n  const runForAllSessions = async (\n    capability: Capability,\n    args: Record<string, string> = {},\n  ): Promise<never> => {\n    let ok = true;\n    for (const session of sessions) {\n      if (!(await runCapabilityAction(capability, session, passwordFor(session.hostname), args, cliArgs.output, cliArgs.patient, cliArgs.mode))) {\n        ok = false;\n      }\n    }\n    closeRL();\n    process.exit(ok ? 0 : 1);\n  };\n\n  // ── Explicit patient switch: the ONLY command that changes MyChart state ──\n  //\n  // MyChart's active patient lives in the server-side session, so changing it\n  // is a real mutation. It gets its own deliberate command rather than\n  // happening as a side effect of a read. The flag is sugar for the\n  // switch_proxy_target capability, which verifies the switch against the\n  // profile page before reporting success.\n  if (cliArgs.switchPatient !== undefined) {\n    await runForAllSessions(getCapability('switch_proxy_target')!, { patient: cliArgs.switchPatient });\n  }\n\n  // ── Every other command asserts which patient it is reading, and refuses ──\n  //\n  // Reads never mutate. If MyChart is pointed at a different patient than this\n  // command is about, stop and say so rather than switching silently — a read\n  // that quietly changes server state is how you end up scraping the wrong\n  // person's chart without noticing.\n  //\n  // No --patient means the account holder, stated explicitly, because the CLI\n  // resumes sessions from cached cookies and would otherwise inherit whichever\n  // patient an earlier invocation left behind.\n  // The patient-record commands are the exception: asserting \"you must already\n  // be on patient X\" before letting someone list the records or switch to one\n  // would make those commands unusable exactly when they are needed.\n  const actionIsAboutPatients =\n    cliArgs.action !== undefined && resolveCliAction(cliArgs.action)?.group === 'Patients';\n\n  if (!actionIsAboutPatients) {\n    for (const session of sessions) {\n      let check;\n      try {\n        check = await checkProxyContext(session.request, cliArgs.patient);\n      } catch (err) {\n        const why = detailedMessage(err);\n        if (cliArgs.patient) {\n          // A specific patient was asked for and we can't confirm we're on\n          // them. Refusing is the whole point.\n          console.log(`\\n  ${why}`);\n          closeRL();\n          process.exit(1);\n        }\n        // Nobody asked for a proxy patient. Most accounts have no proxy access\n        // at all, and two of the three discovery surfaces are inferred rather\n        // than captured from a real instance — so a parsing miss here must not\n        // break an ordinary scrape that has nothing to do with this feature.\n        console.log(`  Note: could not determine the active patient on ${session.hostname} (${why}). Continuing.`);\n        continue;\n      }\n\n      // Single-record account: no proxy surface, nothing to assert.\n      if (!check.wanted) {\n        if (cliArgs.patient) {\n          console.log(`\\n  ${session.hostname} has access to only one patient record, so --patient cannot be used.`);\n          closeRL();\n          process.exit(1);\n        }\n        continue;\n      }\n\n      if (check.active) {\n        console.log(`  Reading ${session.hostname} as: ${check.wanted.displayName}${check.wanted.isSelf ? ' (your own record)' : ''}`);\n        continue;\n      }\n\n      const host = session.hostname;\n      const wantedName = check.wanted.displayName;\n      const currentName = check.current\n        ? check.current.displayName\n        : 'an unknown patient (this MyChart does not report which record is active)';\n\n      console.log(`\\n  Refusing to read: ${host} is currently on ${currentName}, but this command is about ${wantedName}.`);\n      console.log('\\n  The active patient is stored on MyChart\\'s server, so it has to be changed');\n      console.log('  deliberately — reading never changes it. Run:');\n      console.log(`\\n    mychart-cli --host ${host} --action list-proxies     # every patient name on this account`);\n      console.log(`    mychart-cli --host ${host} --switch ${JSON.stringify(wantedName)}`);\n      console.log('\\n  then re-run this command.');\n      closeRL();\n      process.exit(1);\n    }\n  }\n\n  // ── The account-security flags ──\n  //\n  // Each flag is sugar for an `account`-kind registry capability. The\n  // capability reads and writes the CLI's own TOTP and passkey stores through\n  // capabilityContext, exactly as the equivalent `--action setup_totp` would.\n  const accountFlagCapabilityId =\n    (cliArgs.setupTotp && 'setup_totp') ||\n    (cliArgs.disableTotp && 'disable_totp') ||\n    (cliArgs.setupPasskey && 'register_passkey') ||\n    (cliArgs.listPasskeys && 'list_passkeys') ||\n    (cliArgs.deletePasskey && 'delete_passkey') ||\n    undefined;\n  if (accountFlagCapabilityId) {\n    await runForAllSessions(getCapability(accountFlagCapabilityId)!);\n  }\n\n  // Handle send-message action\n  if (cliArgs.action === 'send-message') {\n    for (const session of sessions) {\n      await handleSendMessage(session.request);\n    }\n    closeRL();\n    return;\n  }\n\n  // Handle send-reply action\n  if (cliArgs.action === 'send-reply') {\n    for (const session of sessions) {\n      await handleSendReply(session.request);\n    }\n    closeRL();\n    return;\n  }\n\n  // Handle get-imaging action: every study on the account, downloaded and\n  // decoded. A composite of get_imaging_results + download_imaging_study,\n  // both dispatched through executeCapability.\n  if (cliArgs.action === 'get-imaging') {\n    let ok = true;\n    for (const session of sessions) {\n      const succeeded = await downloadAllImagingStudies(session, passwordFor(session.hostname), {\n        outputDir: cliArgs.output,\n        patient: cliArgs.patient,\n        saveClo: cliArgs.saveClo,\n      });\n      if (!succeeded) ok = false;\n    }\n    closeRL();\n    process.exit(ok ? 0 : 1);\n  }\n\n  // Handle keep-alive-test action — use shared sessionStore keepalive\n  if (cliArgs.action === 'keep-alive-test') {\n    closeRL();\n\n    // Register all sessions in the shared store\n    for (const session of sessions) {\n      sessionStore.set(session.hostname, session.request, { hostname: session.hostname });\n    }\n\n    console.log('\\n  ── Keep-Alive Test Mode ──');\n    console.log(`  Pinging KeepAlive every 30s for ${sessions.length} session(s).`);\n    console.log('  Press Ctrl+C to stop.\\n');\n\n    // Ping immediately, then start the interval\n    await sessionStore.runKeepalive();\n    sessionStore.startKeepalive();\n    return;\n  }\n\n  // Any capability from the shared registry, by id — or one of the dashed\n  // spellings the CLI has always accepted (list-proxies, get-thread,\n  // delete-message, request-refill), which resolve to the same registry\n  // entries. Runs after the bespoke interactive actions above.\n  if (cliArgs.action) {\n    const capability = resolveCliAction(cliArgs.action);\n    if (!capability) {\n      console.log(`\\n  Unknown --action \"${cliArgs.action}\".`);\n      console.log(`  Capabilities: ${COMMON_CAPABILITIES.map(c => c.id).join(', ')}`);\n      console.log(\n        `  …and ${LESS_FREQUENTLY_USED_CAPABILITIES.length} less-frequently-used ones. Run  mychart-cli --list-capabilities [--show-all]  for the full list with arguments.`,\n      );\n      closeRL();\n      process.exit(1);\n    }\n    // `--conversation-id <id>` predates `--arg`; keep honoring it for the\n    // capabilities that take one (get-thread, delete-message, send_reply).\n    const capabilityArgs = { ...(cliArgs.capabilityArgs ?? {}) };\n    if (\n      cliArgs.conversationId !== undefined &&\n      capabilityArgs.conversation_id === undefined &&\n      capability.params.some(p => p.name === 'conversation_id')\n    ) {\n      capabilityArgs.conversation_id = cliArgs.conversationId;\n    }\n    await runForAllSessions(capability, capabilityArgs);\n  }\n\n  // Default: scrape every argument-free read capability in the registry.\n  let allOk = true;\n  for (const session of sessions) {\n    if (!(await scrapeAll(session, passwordFor(session.hostname)))) allOk = false;\n  }\n\n  header('Done!');\n  console.log(`  Scraped ${sessions.length} MyChart account(s).`);\n  console.log('  All available data has been displayed above.\\n');\n  if (!allOk) console.log('  Some categories failed; see the per-category output above.\\n');\n\n  closeRL();\n}\n\n/**\n * main() plus the fatal-error handler. Called by `entry.ts` (which is also\n * what the published binary is built from), or directly below when this file\n * itself is the entry module — importing this module no longer runs the CLI,\n * so tests can reach its internals.\n */\nexport async function runCli(): Promise<void> {\n  try {\n    await main();\n    // Exit rather than return. The update check is fire-and-forget, and an\n    // in-flight fetch keeps the event loop alive on its own — so a hung request\n    // to the manifest would hold the CLI open for the full two-minute scraper\n    // deadline after it had finished printing. Every other terminal path here\n    // already exits; this one just returned.\n    process.exit(process.exitCode ?? 0);\n  } catch (err) {\n    console.error('Fatal error:', err);\n    closeRL();\n    process.exit(1);\n  }\n}\n\nif (import.meta.main) {\n  void runCli();\n}\n","// Copyright (c) Fan Pier Labs. Use of this software is governed by the LICENSE file in the project root.\n\n// CLI entry point with subcommand dispatch. This is what the published binary\n// is built from (see tsup.config.ts).\n// Usage:\n//   bun run cli mychart [flags]   — MyChart scraper (default if no subcommand)\n\nconst subcommand = process.argv[2];\n\n// Default: run the MyChart CLI (pass all args through)\n// If the user typed \"bun run cli mychart ...\", strip \"mychart\" from argv\nif (subcommand === 'mychart') {\n  process.argv.splice(2, 1);\n}\n// eslint-disable-next-line no-restricted-syntax -- must stay dynamic: cli.ts parses argv at import time, and the argv splice above has to happen first (a static import would hoist past it)\nvoid import('./cli').then(({ runCli }) => runCli());\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAEE;AAFF;AAAA;AAEE,cAAW;AAAA;AAAA;;;ACFb,IA4BM,aAOF,YAES;AArCb;AAAA;AA4BA,IAAM,cAAuB,CAAC,OAAO,SAAS;AAE5C,UAAI,UAAU,OAAQ,SAAQ,KAAK,GAAG,IAAI;AAAA,eACjC,UAAU,QAAS,SAAQ,MAAM,GAAG,IAAI;AAAA,UAC5C,SAAQ,IAAI,GAAG,IAAI;AAAA,IAC1B;AAEA,IAAI,aAAsB;AAEnB,IAAM,SAAS;AAAA,MACpB,SAAS,MAAuB;AAAE,mBAAW,SAAS,IAAI;AAAA,MAAG;AAAA,MAC7D,QAAQ,MAAwB;AAAE,mBAAW,QAAQ,IAAI;AAAA,MAAI;AAAA,MAC7D,QAAQ,MAAwB;AAAE,mBAAW,QAAQ,IAAI;AAAA,MAAI;AAAA,MAC7D,SAAS,MAAuB;AAAE,mBAAW,SAAS,IAAI;AAAA,MAAG;AAAA,IAC/D;AAAA;AAAA;;;ACrBA,eAAsB,gBAAgB,KAAgB,KAAqC;AACzF,QAAM,eAAe,MAAM,IAAI,gBAAgB,GAAG;AAClD,SAAO,gBAAgB;AACzB;AAgBA,eAAsB,gBAAgB,KAAgB,KAAa,UAAmC;AACpG,QAAM,UAAU,SAAS;AAEzB,MAAI;AACJ,MAAI,OAAO,QAAQ,iBAAiB,YAAY;AAC9C,iBAAa,QAAQ,aAAa;AAAA,EACpC,OAAO;AACL,UAAM,MAAM,SAAS,QAAQ,IAAI,YAAY;AAC7C,iBAAa,MAAM,IAAI,MAAM,yBAAyB,IAAI,CAAC;AAAA,EAC7D;AAEA,aAAW,aAAa,YAAY;AAClC,QAAI;AACF,YAAM,IAAI,UAAU,UAAU,KAAK,GAAG,GAAG;AAAA,IAC3C,QAA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A,QACR,OAAS;AAAA,QACT,KAAO;AAAA,MACT;AAAA,MACA;AAAA,QACE,SAAW;AAAA,UACT;AAAA,QACF;AAAA,QACA,SAAW;AAAA,QACX,MAAQ;AAAA,QACR,OAAS;AAAA,QACT,KAAO;AAAA,MACT;AAAA,MACA;AAAA,QACE,SAAW;AAAA,UACT;AAAA,QACF;AAAA,QACA,MAAQ;AAAA,QACR,SAAW;AAAA,QACX,MAAQ;AAAA,QACR,OAAS;AAAA,QACT,KAAO;AAAA,MACT;AAAA,MACA;AAAA,QACE,SAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;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C9D,MAAI,CAAC,MAAO,SAAQ,IAAI,gEAAgE;AAExF,UAAQ;AACV;AAQA,eAAsB,SAAwB;AAC5C,MAAI;AACF,UAAM,KAAK;AAMX,YAAQ,KAAK,QAAQ,YAAY,CAAC;AAAA,EACpC,SAAS,KAAK;AACZ,YAAQ,MAAM,gBAAgB,GAAG;AACjC,YAAQ;AACR,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAvmCA,IAEA,UACAC,KACAC,QAJA,aAgDM,kBA0HA,SAuBF,gBAEA;AAnMJ;AAAA;AAEA,eAA0B;AAC1B,IAAAD,MAAoB;AACpB,IAAAC,SAAsB;AACtB;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAOA;AAQA;AACA;AACA;AACA;AA3CA;AAgDA,IAAM,mBAAwB,YAAK,QAAQ,IAAI,GAAG,eAAe;AA0HjE,IAAM,UAAU,UAAU;AAuB1B,IAAI,iBAAiB;AAw6BrB,QAAI,YAAY,MAAM;AACpB,WAAK,OAAO;AAAA,IACd;AAAA;AAAA;;;ACpmCA,IAAM,aAAa,QAAQ,KAAK,CAAC;AAIjC,IAAI,eAAe,WAAW;AAC5B,UAAQ,KAAK,OAAO,GAAG,CAAC;AAC1B;AAEA,KAAK,wDAAgB,KAAK,CAAC,EAAE,QAAAC,QAAO,MAAMA,QAAO,CAAC;","names":["limit","resolve","mountPath","text","text","cheerio","b","str","header","crypto","import_crypto","path","text","str","cheerio","exports","module","str","result","tempPtr","err","row","path","crypto","fs","preRun","postRun","resolve","num","ret","wasmExports","toBuffer","path","account","decipher","row","toBuffer","text","import_crypto","import_fs","import_os","path","import_util","decipher","toBuffer","row","directory","login","import_crypto","import_fs","import_os","path","MAX_REDIRECTS","import_crypto","globalKey","REDIRECT_STATUSES","text","list","text","path","text","result","list","makeApiRequest","path","text","result","getViewerWprId","getComposeId","removeComposeId","text","path","result","directory","cheerio","header","body","result","targets","result","describe","refreshed","cheerio","fs","path","fs","path","result","result","text","row","child","result","num","header","fs","fs","MAX_PAGES","path","path","init_profile","provider","result","path","visit","bucket","row","VISITS_PAGE","result","path","init_visits","cheerio","result","visit","str","text","study","match","result","CLOCLHAAR_MAGIC","fs","path","import_js_base64","num","result","directory","PAGE_SIZE","MAX_PAGES","header","fail","named","rest","text","normalize","text","nameTokens","result","path","amount","cheerio","scalarOrNull","row","path","account","row","provider","path","statement","bucket","account","detailsPagePath","account","provider","load","load","list","provider","PAGE_SIZE","MAX_PAGES","named","named","text","init_emergencyContacts","logUnexpectedResponse","result","result","address","provider","limit","text","num","resolve","directory","answered","resolve","probe","hostnameOf","limit","text","init_directory","limit","num","bucket","result","init_profile","init_visits","init_emergencyContacts","init_directory","CLOHEADERZ01_MAGIC","result","text","zstdDecompress","header","import_fs","import_zlib","sharp","import_fs","fs","import_fs","os","path","result","fs","path","path","toText","textOrNull","cheerio","provider","login","directory","resolve","result","fs","path","runCli"]}