feat(drill): ProviderDrawer with Overview tab + DrillDrawerHeader shell
This commit is contained in:
+31
-1
@@ -16,7 +16,8 @@
|
||||
* - `parse835(...)` mirrors the 837 shape for `/api/parse-835`.
|
||||
* - `health()` GETs `/api/health` and returns `{ status, version }`.
|
||||
* - `listBatches / getBatch / listClaims / listRemittances / listProviders
|
||||
* / listActivity` are plain JSON GETs against the persistence surface.
|
||||
* / getProvider / listActivity` are plain JSON GETs against the
|
||||
* persistence surface.
|
||||
* - `listUnmatched / matchRemit / unmatchClaim` hit the reconciliation
|
||||
* surface. POSTs throw `ApiError` so callers can branch on `.status`.
|
||||
*/
|
||||
@@ -36,6 +37,7 @@ import type {
|
||||
Payer,
|
||||
Payer835,
|
||||
Payee835,
|
||||
Provider,
|
||||
ReassociationTrace,
|
||||
UnmatchedClaim,
|
||||
UnmatchedResponse,
|
||||
@@ -586,6 +588,33 @@ async function listProviders<T = unknown>(
|
||||
return (await res.json()) as PaginatedResponse<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch one configured provider by NPI, used by the provider drill-down
|
||||
* drawer (SP21 Task 2.2 / 1.6).
|
||||
*
|
||||
* Drives ``GET /api/config/providers/{npi}``. Note the ``/api/config/``
|
||||
* prefix — this is the config-side route namespace, distinct from the
|
||||
* persistence-side ``/api/providers`` used by ``listProviders``. The
|
||||
* response is the full ``Provider`` shape (including the optional
|
||||
* ``recent_claims`` and ``recent_activity`` arrays populated by Task
|
||||
* 1.6 when the backend can serve them).
|
||||
*
|
||||
* Throws ``ApiError`` on non-2xx — including 404, which the drawer may
|
||||
* want to branch on for a "provider no longer configured" state.
|
||||
*/
|
||||
async function getProvider(npi: string): Promise<Provider> {
|
||||
if (!isConfigured) throw notConfiguredError();
|
||||
const res = await fetch(
|
||||
joinUrl(`/api/config/providers/${encodeURIComponent(npi)}`),
|
||||
{ headers: { Accept: "application/json" } }
|
||||
);
|
||||
if (!res.ok) {
|
||||
const detail = await readErrorBody(res);
|
||||
throw new ApiError(res.status, detail || res.statusText);
|
||||
}
|
||||
return (await res.json()) as Provider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggregate stats for one payer, used by the peek modal on Dashboard /
|
||||
* Claims tables (SP21 universal drill-down). Drives
|
||||
@@ -773,6 +802,7 @@ export const api = {
|
||||
listRemittances,
|
||||
getRemittance,
|
||||
listProviders,
|
||||
getProvider,
|
||||
getPayerSummary,
|
||||
listActivity,
|
||||
listUnmatched,
|
||||
|
||||
Reference in New Issue
Block a user