@cliwant/mcp-sam-gov 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.ja.md +22 -9
  2. package/README.ko.md +22 -9
  3. package/README.md +70 -12
  4. package/dist/bea.d.ts +105 -0
  5. package/dist/bea.d.ts.map +1 -0
  6. package/dist/bea.js +303 -0
  7. package/dist/bea.js.map +1 -0
  8. package/dist/census-economic.d.ts +1 -1
  9. package/dist/census-economic.d.ts.map +1 -1
  10. package/dist/census-economic.js +12 -6
  11. package/dist/census-economic.js.map +1 -1
  12. package/dist/cms-facility.d.ts +112 -0
  13. package/dist/cms-facility.d.ts.map +1 -0
  14. package/dist/cms-facility.js +311 -0
  15. package/dist/cms-facility.js.map +1 -0
  16. package/dist/cms-hospital.d.ts +105 -0
  17. package/dist/cms-hospital.d.ts.map +1 -0
  18. package/dist/cms-hospital.js +290 -0
  19. package/dist/cms-hospital.js.map +1 -0
  20. package/dist/cms-supplier.d.ts +133 -0
  21. package/dist/cms-supplier.d.ts.map +1 -0
  22. package/dist/cms-supplier.js +414 -0
  23. package/dist/cms-supplier.js.map +1 -0
  24. package/dist/cms-utilization.d.ts +113 -0
  25. package/dist/cms-utilization.d.ts.map +1 -0
  26. package/dist/cms-utilization.js +328 -0
  27. package/dist/cms-utilization.js.map +1 -0
  28. package/dist/courtlistener.d.ts +115 -0
  29. package/dist/courtlistener.d.ts.map +1 -0
  30. package/dist/courtlistener.js +398 -0
  31. package/dist/courtlistener.js.map +1 -0
  32. package/dist/cpsc.d.ts +81 -0
  33. package/dist/cpsc.d.ts.map +1 -0
  34. package/dist/cpsc.js +283 -0
  35. package/dist/cpsc.js.map +1 -0
  36. package/dist/dol.d.ts +118 -0
  37. package/dist/dol.d.ts.map +1 -0
  38. package/dist/dol.js +421 -0
  39. package/dist/dol.js.map +1 -0
  40. package/dist/epa-envirofacts.d.ts +97 -0
  41. package/dist/epa-envirofacts.d.ts.map +1 -0
  42. package/dist/epa-envirofacts.js +292 -0
  43. package/dist/epa-envirofacts.js.map +1 -0
  44. package/dist/fred.d.ts +1 -1
  45. package/dist/fred.js +1 -1
  46. package/dist/keys.d.ts +11 -8
  47. package/dist/keys.d.ts.map +1 -1
  48. package/dist/keys.js +55 -8
  49. package/dist/keys.js.map +1 -1
  50. package/dist/lda.d.ts +105 -0
  51. package/dist/lda.d.ts.map +1 -0
  52. package/dist/lda.js +317 -0
  53. package/dist/lda.js.map +1 -0
  54. package/dist/nhtsa.d.ts +91 -0
  55. package/dist/nhtsa.d.ts.map +1 -0
  56. package/dist/nhtsa.js +263 -0
  57. package/dist/nhtsa.js.map +1 -0
  58. package/dist/nonprofit.d.ts +116 -0
  59. package/dist/nonprofit.d.ts.map +1 -0
  60. package/dist/nonprofit.js +342 -0
  61. package/dist/nonprofit.js.map +1 -0
  62. package/dist/openfda-device.d.ts +85 -0
  63. package/dist/openfda-device.d.ts.map +1 -0
  64. package/dist/openfda-device.js +277 -0
  65. package/dist/openfda-device.js.map +1 -0
  66. package/dist/openfda.d.ts +133 -0
  67. package/dist/openfda.d.ts.map +1 -0
  68. package/dist/openfda.js +402 -0
  69. package/dist/openfda.js.map +1 -0
  70. package/dist/server.d.ts.map +1 -1
  71. package/dist/server.js +872 -6
  72. package/dist/server.js.map +1 -1
  73. package/package.json +2 -1
  74. package/src/bea.ts +372 -0
  75. package/src/census-economic.ts +12 -6
  76. package/src/cms-facility.ts +379 -0
  77. package/src/cms-hospital.ts +344 -0
  78. package/src/cms-supplier.ts +527 -0
  79. package/src/cms-utilization.ts +389 -0
  80. package/src/courtlistener.ts +465 -0
  81. package/src/cpsc.ts +333 -0
  82. package/src/dol.ts +515 -0
  83. package/src/epa-envirofacts.ts +342 -0
  84. package/src/fred.ts +1 -1
  85. package/src/keys.ts +60 -8
  86. package/src/lda.ts +385 -0
  87. package/src/nhtsa.ts +352 -0
  88. package/src/nonprofit.ts +460 -0
  89. package/src/openfda-device.ts +356 -0
  90. package/src/openfda.ts +495 -0
  91. package/src/server.ts +995 -6
@@ -0,0 +1,311 @@
1
+ /**
2
+ * cms-facility.ts — CMS "facility directory" across FOUR provider-data datasets
3
+ * (`data.cms.gov`, the provider-data DKAN datastore-query API; ADR-0063). KEYLESS.
4
+ *
5
+ * WHAT IT ADDS: `cms_facility_directory` — a healthcare-facility directory / market
6
+ * lane that generalizes cms_hospital_compare (ADR-0062) BEYOND hospitals: a caller
7
+ * picks a `facilityType` (nursing_home | home_health | hospice | dialysis) and the
8
+ * tool routes to the RIGHT CMS provider-data dataset, returning each facility's
9
+ * name / address / city / state / zip / ownership. The facility-level complement to
10
+ * the utilization and hospital lanes — WHERE these Medicare-certified facilities are.
11
+ *
12
+ * ★THE facilityType → DATASET-ID CONSTANT MAP (the load-bearing SSRF guard): the
13
+ * USER value never enters the URL path. `facilityType` is a Zod ENUM; it indexes a
14
+ * MODULE-CONSTANT map to a VETTED dataset id (e.g. nursing_home → "4pq5-n9py") that
15
+ * is spliced into the path. An unknown facilityType is blocked by the enum
16
+ * (invalid_input) BEFORE any fetch — only one of four compile-time ids can ever
17
+ * reach the path.
18
+ *
19
+ * ★THE ONE-REQUEST COUNT PATTERN (P1 honesty, inherited from cms-hospital): the DKAN
20
+ * datastore-query response is `{ count, results, schema, query }` — `count` is the
21
+ * EXACT per-filter total in the SAME body as the rows. So totalAvailable = the
22
+ * response's top-level `count` (nursing_home ⇒ 14695), NEVER `results.length`.
23
+ *
24
+ * ★FIELD-NAME VARIANCE ACROSS DATASETS (the one genuinely-new complexity vs.
25
+ * cms-hospital) — live-verified 2026-07-15. The facility NAME, ADDRESS, and
26
+ * OWNERSHIP columns are NAMED DIFFERENTLY per dataset, so each is COALESCED over a
27
+ * fixed candidate order (null if none present — NEVER an empty string, NEVER
28
+ * fabricated):
29
+ * name : provider_name → facility_name → legal_business_name
30
+ * address : address → provider_address → address_line_1
31
+ * ownership : ownership_type → type_of_ownership → profit_or_nonprofit
32
+ * (city = citytown, state = state, zip = zip_code are uniform across all four.)
33
+ * Per-dataset verified columns:
34
+ * nursing_home 4pq5-n9py: provider_name / provider_address / ownership_type
35
+ * home_health 6jpm-sxkc: provider_name / address / type_of_ownership
36
+ * hospice yc9t-dgbk: facility_name / address_line_1 / ownership_type
37
+ * dialysis 23ew-n7w9: facility_name / address_line_1 / profit_or_nonprofit
38
+ * ★ADR-0063 said nursing_home's address is `address`; it is actually
39
+ * `provider_address` (probed live) — the coalescing candidate list covers it.
40
+ *
41
+ * ★THE facilityName FILTER COLUMN also varies: the `contains` filter targets the
42
+ * dataset's OWN primary-name column (provider_name for nursing_home/home_health,
43
+ * facility_name for hospice/dialysis) — stored per-type in the constant map.
44
+ *
45
+ * The module writes ZERO fetch/coercion/error/meta code — it REUSES `getJson`
46
+ * (redirect:"error") / `driftError` (datasource.ts), `str` (coerce.ts,
47
+ * null-never-empty-string), and `withMeta`·`buildMeta` (meta.ts, offset pagination
48
+ * + totalAvailable). It MIRRORS cms-hospital.ts's fixed-host SSRF idiom (a single
49
+ * host const + a post-construction hostname/protocol assertion + redirect:"error" +
50
+ * `conditions[i][…]` bracket keys and values carried via URLSearchParams) and its
51
+ * schema_drift catch-ladder (ToolErrorCarrier rethrow FIRST → SyntaxError→driftError
52
+ * → bare rethrow).
53
+ *
54
+ * GET https://data.cms.gov/provider-data/api/1/datastore/query/{datasetId}/0
55
+ * ?limit=&offset=&conditions[0][property]=state&conditions[0][value]=VA&conditions[0][operator]==
56
+ * → { count: 383, results: [ { provider_name, provider_address, … }, … ], schema, query }
57
+ *
58
+ * ★ SSRF: the host is a compile-time literal (`CMS_HOST`); the dataset id is chosen
59
+ * by a Zod-enum key from a MODULE-CONSTANT map (never the user string). Every USER
60
+ * filter VALUE rides as a URLSearchParams VALUE (`conditions[i][value]=…`) — the
61
+ * bracket key AND the value are encoded, so a value can never break out of the
62
+ * path or inject a parameter. state is `^[A-Za-z]{2}$`; facilityName is a bounded
63
+ * free-text charclass; size/offset are coerced to integers. A post-construction
64
+ * hostname/protocol assertion + `redirect:"error"` fail closed on any off-host 3xx.
65
+ *
66
+ * ★ HONESTY (ADR-0063 P1–P5, live-verified 2026-07-15 on data.cms.gov):
67
+ * [P1] totalAvailable = the response's top-level `count` (EXACT per-filter total),
68
+ * NOT the slice length. hasMore = offset+returned < count.
69
+ * [P2] results:[] ⇒ honest empty (returned:0). An invalid facilityType is blocked
70
+ * by the Zod enum (invalid_input). getJson maps a 4xx/5xx via
71
+ * errorFromResponse and THROWS (503 ⇒ upstream_unavailable, 400 ⇒
72
+ * invalid_input, 404 ⇒ not_found); a 200 non-JSON body OR a body missing
73
+ * `count`/`results` ⇒ schema_drift (NEVER a fabricated empty).
74
+ * [P3] name/address/ownership are COALESCED over the candidate order — null if none
75
+ * (NEVER an empty string, NEVER fabricated). String fields via str().
76
+ * [P4] results non-array OR count non-number ⇒ driftError.
77
+ */
78
+ import { ToolErrorCarrier } from "./errors.js";
79
+ import { getJson, driftError } from "./datasource.js";
80
+ import { str } from "./coerce.js";
81
+ import { withMeta } from "./meta.js";
82
+ // Re-export the shared honesty coercion (single audited copy in ./coerce.js) so a
83
+ // regression fails together across sources. NO local str.
84
+ export { str };
85
+ // ─── SSRF core: the single fixed host + module-literal endpoint prefix ──
86
+ const CMS_HOST = "data.cms.gov";
87
+ // HOST-only label — surfaces in ToolError.upstreamEndpoint; keyless, so no token
88
+ // can ever appear here.
89
+ const CMS_LABEL = "cms-facility:data.cms.gov";
90
+ const CMS_PATH_PREFIX = "/provider-data/api/1/datastore/query";
91
+ const CMS_PATH_SUFFIX = "/0";
92
+ const FACILITY_DATASETS = {
93
+ nursing_home: {
94
+ id: "4pq5-n9py",
95
+ nameColumn: "provider_name",
96
+ label: 'CMS "Provider Information" (Nursing Home / Long-Term Care; ~14,695 Medicare/Medicaid-certified nursing homes)',
97
+ },
98
+ home_health: {
99
+ id: "6jpm-sxkc",
100
+ nameColumn: "provider_name",
101
+ label: 'CMS "Home Health Care Agencies" (~12,460 Medicare-certified home health agencies)',
102
+ },
103
+ hospice: {
104
+ id: "yc9t-dgbk",
105
+ nameColumn: "facility_name",
106
+ label: 'CMS "Hospice Provider Information" (~6,852 Medicare-certified hospices)',
107
+ },
108
+ dialysis: {
109
+ id: "23ew-n7w9",
110
+ nameColumn: "facility_name",
111
+ label: 'CMS "Dialysis Facility" (~7,490 Medicare-certified dialysis facilities)',
112
+ },
113
+ };
114
+ // The valid enum keys — a belt-and-suspenders re-guard behind the server Zod (a
115
+ // DIRECT handler call bypasses Zod). An unknown key ⇒ invalid_input, 0 fetch.
116
+ const FACILITY_TYPES = Object.keys(FACILITY_DATASETS);
117
+ // ─── Coalescing candidate orders (the field-name variance across datasets) ──
118
+ // Each output field probes these source columns IN ORDER; the first non-null (via
119
+ // str(), which nulls ""/whitespace/"null") wins; null if NONE present. NEVER an
120
+ // empty string, NEVER a fabricated value.
121
+ const NAME_FIELDS = ["provider_name", "facility_name", "legal_business_name"];
122
+ const ADDRESS_FIELDS = ["address", "provider_address", "address_line_1"];
123
+ const OWNERSHIP_FIELDS = ["ownership_type", "type_of_ownership", "profit_or_nonprofit"];
124
+ // ─── Validation charclasses (SSRF + "verify the input" honesty) ───
125
+ const STATE_RE = /^[A-Za-z]{2}$/; // 2-letter state/territory abbreviation
126
+ // facilityName rides as a URLSearchParams VALUE (encoded), so this bound is a sanity
127
+ // guard, not an SSRF necessity: letters/digits/space and common punctuation only
128
+ // (facility names carry apostrophes, &, /, -, .).
129
+ const FACILITY_NAME_RE = /^[A-Za-z0-9 &.,()/'-]{1,100}$/;
130
+ const SIZE_MIN = 1;
131
+ const SIZE_MAX = 100;
132
+ const SIZE_DEFAULT = 25;
133
+ // DKAN condition operators (live-verified). state = exact; name = substring.
134
+ const OP_EQUALS = "=";
135
+ const OP_CONTAINS = "contains";
136
+ // ─── Honesty notes (ADR-0063 required set) ────────────────────────
137
+ const COALESCE_NOTE = "Field names vary across the four CMS provider-data datasets — `name`, `address`, and `ownership` are COALESCED over per-dataset candidate columns (name: provider_name/facility_name/legal_business_name; address: address/provider_address/address_line_1; ownership: ownership_type/type_of_ownership/profit_or_nonprofit). A field absent in the chosen dataset is null (unknown), NEVER an empty string and NEVER fabricated.";
138
+ const FILTER_NOTE = "Filters are applied SERVER-SIDE via DKAN conditions (AND-combined): `state` is an EXACT match; `facilityName` is a case-insensitive SUBSTRING (contains) match against the dataset's primary-name column — so a facilityName fragment may match several facilities. totalAvailable is the upstream's EXACT count for this filter set, not the returned-row count.";
139
+ /**
140
+ * Coalesce a row's value over a candidate column order → string | null.
141
+ * Returns the FIRST column whose str() is non-null (str nulls ""/whitespace/"null");
142
+ * null if NONE — NEVER an empty string, NEVER a fabricated value (P3).
143
+ */
144
+ export function coalesceField(row, fields) {
145
+ for (const f of fields) {
146
+ const v = str(row[f]);
147
+ if (v !== null)
148
+ return v;
149
+ }
150
+ return null;
151
+ }
152
+ /** Map ONE datastore-query row → the curated facility shape for `facilityType`. */
153
+ function mapFacility(row, facilityType) {
154
+ const r = (row ?? {});
155
+ return {
156
+ // [P3] name/address/ownership coalesced over candidate columns; null-never-empty.
157
+ name: coalesceField(r, NAME_FIELDS),
158
+ address: coalesceField(r, ADDRESS_FIELDS),
159
+ city: str(r.citytown),
160
+ state: str(r.state),
161
+ zip: str(r.zip_code),
162
+ // Echo the input facilityType (the caller's chosen lane).
163
+ facilityType,
164
+ ownership: coalesceField(r, OWNERSHIP_FIELDS),
165
+ };
166
+ }
167
+ // ─── SSRF-guarded fetch (fixed host + hostname assertion + redirect:"error") ──
168
+ /**
169
+ * GET one data.cms.gov provider-data JSON resource at a MODULE-BUILT URL. The dataset
170
+ * id is a VETTED value from FACILITY_DATASETS (never the user string); the endpoint
171
+ * path is built from module literals; all user filter VALUES are already carried in
172
+ * the URLSearchParams `query`. Asserts the CONSTRUCTED URL's hostname === the fixed
173
+ * host over https, and sets `redirect:"error"` (an off-host 3xx must NOT be
174
+ * followed). Keyless — no headers.
175
+ */
176
+ async function getCms(datasetId, query) {
177
+ const path = `${CMS_PATH_PREFIX}/${datasetId}${CMS_PATH_SUFFIX}`;
178
+ const url = `https://${CMS_HOST}${path}?${query.toString()}`;
179
+ const built = new URL(url);
180
+ if (built.hostname !== CMS_HOST || built.protocol !== "https:") {
181
+ throw new ToolErrorCarrier({
182
+ kind: "invalid_input",
183
+ message: `Constructed CMS provider-data URL host ${JSON.stringify(built.hostname)} (${built.protocol}) does not match the fixed host ${JSON.stringify(CMS_HOST)} over https — refusing to fetch (SSRF safety).`,
184
+ retryable: false,
185
+ upstreamEndpoint: CMS_LABEL,
186
+ });
187
+ }
188
+ return getJson(built.toString(), { label: CMS_LABEL, redirect: "error" });
189
+ }
190
+ /**
191
+ * Fetch CMS provider-data facility rows for a `facilityType` (+ optional state /
192
+ * facility-name fragment) → normalized facility rows + honest `_meta`. The
193
+ * facilityType (a Zod enum) indexes the FACILITY_DATASETS constant map to a vetted
194
+ * dataset id — the user value never enters the path. A SINGLE request: the response's
195
+ * top-level `count` is the EXACT per-filter total (P1 — never the slice length).
196
+ */
197
+ export async function facilityDirectory(args) {
198
+ // ── [SSRF/input] resolve facilityType → the vetted dataset (belt-and-suspenders
199
+ // behind the server Zod enum; a DIRECT handler call bypasses Zod). An unknown/
200
+ // absent facilityType ⇒ invalid_input, 0 fetch. ──
201
+ const ft = args.facilityType;
202
+ if (ft === undefined || !Object.prototype.hasOwnProperty.call(FACILITY_DATASETS, ft)) {
203
+ throw new ToolErrorCarrier({
204
+ kind: "invalid_input",
205
+ retryable: false,
206
+ message: `Invalid or missing facilityType ${JSON.stringify(ft)} — expected one of: ${FACILITY_TYPES.join(", ")}.`,
207
+ upstreamEndpoint: CMS_LABEL,
208
+ });
209
+ }
210
+ const facilityType = ft;
211
+ const dataset = FACILITY_DATASETS[facilityType];
212
+ // ── Validate + build the DKAN conditions (SSRF: charclass + URLSearchParams
213
+ // value). URLSearchParams encodes both the bracket key and the value. Each
214
+ // condition is an (property, value, operator) triple indexed by position. ──
215
+ const query = new URLSearchParams();
216
+ const filtersApplied = [`facilityType:${facilityType}`];
217
+ let ci = 0;
218
+ const pushCondition = (property, value, operator) => {
219
+ query.set(`conditions[${ci}][property]`, property);
220
+ query.set(`conditions[${ci}][value]`, value);
221
+ query.set(`conditions[${ci}][operator]`, operator);
222
+ ci += 1;
223
+ };
224
+ if (args.state !== undefined && args.state !== "") {
225
+ const state = args.state;
226
+ if (!STATE_RE.test(state)) {
227
+ throw new ToolErrorCarrier({
228
+ kind: "invalid_input",
229
+ retryable: false,
230
+ message: `Invalid state ${JSON.stringify(state)} — expected a 2-letter state/territory code (^[A-Za-z]{2}$), e.g. "VA".`,
231
+ upstreamEndpoint: CMS_LABEL,
232
+ });
233
+ }
234
+ pushCondition("state", state.toUpperCase(), OP_EQUALS);
235
+ filtersApplied.push(`state:${state.toUpperCase()}`);
236
+ }
237
+ if (args.facilityName !== undefined && args.facilityName !== "") {
238
+ const name = args.facilityName;
239
+ if (!FACILITY_NAME_RE.test(name)) {
240
+ throw new ToolErrorCarrier({
241
+ kind: "invalid_input",
242
+ retryable: false,
243
+ message: `Invalid facilityName ${JSON.stringify(name)} — allowed: letters, digits, space, & . , ( ) / ' - (≤100 chars). It is a case-insensitive substring match.`,
244
+ upstreamEndpoint: CMS_LABEL,
245
+ });
246
+ }
247
+ // The name column varies per dataset (provider_name vs facility_name).
248
+ pushCondition(dataset.nameColumn, name, OP_CONTAINS);
249
+ filtersApplied.push(`facilityName~${name}`);
250
+ }
251
+ // ── Coerce size / offset to bounded integers (belt-and-suspenders behind the
252
+ // server Zod; a DIRECT handler call bypasses Zod). ──
253
+ let size = SIZE_DEFAULT;
254
+ if (typeof args.size === "number" && Number.isFinite(args.size)) {
255
+ size = Math.trunc(args.size);
256
+ if (size < SIZE_MIN)
257
+ size = SIZE_MIN;
258
+ if (size > SIZE_MAX)
259
+ size = SIZE_MAX;
260
+ }
261
+ let offset = 0;
262
+ if (typeof args.offset === "number" &&
263
+ Number.isFinite(args.offset) &&
264
+ args.offset > 0) {
265
+ offset = Math.trunc(args.offset);
266
+ }
267
+ query.set("limit", String(size));
268
+ query.set("offset", String(offset));
269
+ // ── The single request. Catch-ladder (cms-hospital shape): preserve the
270
+ // 4xx/5xx/timeout ToolErrorCarrier taxonomy FIRST; reclassify a 200 non-JSON
271
+ // SyntaxError to schema_drift SECOND; bare-rethrow LAST. ──
272
+ let body;
273
+ try {
274
+ body = await getCms(dataset.id, query);
275
+ }
276
+ catch (e) {
277
+ if (e instanceof ToolErrorCarrier)
278
+ throw e;
279
+ if (e instanceof SyntaxError)
280
+ throw driftError(CMS_LABEL, "CMS provider-data API returned a non-JSON body at HTTP 200 — schema drift (never read as an empty result).");
281
+ throw e;
282
+ }
283
+ // [P4] the body MUST be an object with a numeric `count` and an array `results`
284
+ // (a non-array results OR a non-number count is drift, never a fabricated empty).
285
+ const b = (body ?? {});
286
+ if (typeof b.count !== "number" ||
287
+ !Number.isFinite(b.count) ||
288
+ !Array.isArray(b.results)) {
289
+ throw driftError(CMS_LABEL, "CMS provider-data shape drift — the response must carry a numeric `count` and an array `results` of facility rows.");
290
+ }
291
+ const totalAvailable = b.count;
292
+ const facilities = b.results.map((row) => mapFacility(row, facilityType));
293
+ const returned = facilities.length;
294
+ // ── [P1] pagination. hasMore = offset+returned < total (the EXACT count). ──
295
+ const hasMore = offset + returned < totalAvailable;
296
+ const nextOffset = hasMore ? offset + returned : null;
297
+ const DATASET_NOTE = `Source dataset: ${dataset.label} — data.cms.gov provider-data datastore "${dataset.id}". A CMS-published snapshot, not a live/real-time feed. Update the dataset id if CMS re-publishes it.`;
298
+ const meta = {
299
+ source: `${CMS_HOST} CMS provider-data facility directory — ${facilityType} (keyless)`,
300
+ keylessMode: true,
301
+ returned,
302
+ totalAvailable,
303
+ filtersApplied,
304
+ filtersDropped: [],
305
+ fieldsUnavailable: [],
306
+ pagination: { offset, limit: size, hasMore, nextOffset },
307
+ notes: [DATASET_NOTE, COALESCE_NOTE, FILTER_NOTE],
308
+ };
309
+ return withMeta({ facilities }, meta);
310
+ }
311
+ //# sourceMappingURL=cms-facility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cms-facility.js","sourceRoot":"","sources":["../src/cms-facility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAsC,MAAM,WAAW,CAAC;AAEzE,kFAAkF;AAClF,0DAA0D;AAC1D,OAAO,EAAE,GAAG,EAAE,CAAC;AAEf,2EAA2E;AAC3E,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,iFAAiF;AACjF,wBAAwB;AACxB,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAC9C,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,eAAe,GAAG,IAAI,CAAC;AAY7B,MAAM,iBAAiB,GAAqC;IAC1D,YAAY,EAAE;QACZ,EAAE,EAAE,WAAW;QACf,UAAU,EAAE,eAAe;QAC3B,KAAK,EACH,+GAA+G;KAClH;IACD,WAAW,EAAE;QACX,EAAE,EAAE,WAAW;QACf,UAAU,EAAE,eAAe;QAC3B,KAAK,EACH,mFAAmF;KACtF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,WAAW;QACf,UAAU,EAAE,eAAe;QAC3B,KAAK,EAAE,yEAAyE;KACjF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,WAAW;QACf,UAAU,EAAE,eAAe;QAC3B,KAAK,EACH,yEAAyE;KAC5E;CACF,CAAC;AAEF,gFAAgF;AAChF,8EAA8E;AAC9E,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAmB,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O,CAAC,CAAC,CAAC,OAAO,CAAC,EACzB,CAAC;QACD,MAAM,UAAU,CACd,SAAS,EACT,oHAAoH,CACrH,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/B,MAAM,UAAU,GAAI,CAAC,CAAC,OAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC;IAEnC,8EAA8E;IAC9E,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IACnD,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAEtD,MAAM,YAAY,GAAG,mBAAmB,OAAO,CAAC,KAAK,4CAA4C,OAAO,CAAC,EAAE,uGAAuG,CAAC;IAEnN,MAAM,IAAI,GAA0B;QAClC,MAAM,EAAE,GAAG,QAAQ,2CAA2C,YAAY,YAAY;QACtF,WAAW,EAAE,IAAI;QACjB,QAAQ;QACR,cAAc;QACd,cAAc;QACd,cAAc,EAAE,EAAE;QAClB,iBAAiB,EAAE,EAAE;QACrB,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;QACxD,KAAK,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC;KAClD,CAAC;IAEF,OAAO,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * cms-hospital.ts — CMS Hospital Compare "Hospital General Information"
3
+ * (`data.cms.gov`, the provider-data DKAN datastore-query API; ADR-0062). KEYLESS.
4
+ *
5
+ * WHAT IT ADDS: `cms_hospital_compare` — a healthcare-facility directory / market
6
+ * lane: for a US state (and/or a facility-name fragment) list Medicare-certified
7
+ * hospitals with their location, type, ownership, emergency-services flag, and CMS
8
+ * star rating. The facility-level complement to the utilization lane
9
+ * (cms_medicare_provider_services, who BILLS) — this is WHERE the hospitals ARE and
10
+ * HOW CMS rates them.
11
+ *
12
+ * ★THE ONE-REQUEST COUNT PATTERN (the load-bearing P1 honesty — SIMPLER than
13
+ * cms-utilization's two-request stats-count): the DKAN datastore-query response
14
+ * is `{ count, results, schema, query }` — `count` is the EXACT per-filter total
15
+ * in the SAME body as the rows. So totalAvailable = the response's top-level
16
+ * `count` (VA ⇒ 96), NEVER `results.length`. A single request; no separate count
17
+ * sub-query is needed (or possible — the endpoint reports the total inline).
18
+ *
19
+ * ★THE FILTER-REQUIRED INPUT GUARD: the dataset is 5432 hospitals. An all-empty
20
+ * query (no state, no facilityName) is REFUSED with invalid_input (0 fetch) —
21
+ * hospitalType alone is NOT enough to scope; a caller MUST pin state OR
22
+ * facilityName.
23
+ *
24
+ * ★THE DKAN CONDITIONS FILTER (live-verified 2026-07-15): filters ride as
25
+ * `conditions[i][property]` / `conditions[i][value]` / `conditions[i][operator]`
26
+ * query triples, AND-combined server-side. `state` uses the exact operator `=`
27
+ * (VA ⇒ 96); `facilityName` + `hospitalType` use the `contains` operator (a
28
+ * case-insensitive substring match, live-verified — "CHILDREN" ⇒ 95). ALL
29
+ * filtering is server-side; NOTHING is silently dropped or client-faked.
30
+ *
31
+ * The module writes ZERO fetch/coercion/error/meta code — it REUSES `getJson`
32
+ * (redirect:"error") / `driftError` (datasource.ts), `str`/`num` (coerce.ts,
33
+ * null-never-empty-string / null-never-0), and `withMeta`·`buildMeta` (meta.ts,
34
+ * offset pagination + totalAvailable). It MIRRORS cms-utilization.ts's fixed-host
35
+ * SSRF idiom (a single host const + a post-construction hostname/protocol assertion
36
+ * + redirect:"error" + `conditions[i][…]` bracket keys and values carried via
37
+ * URLSearchParams) and its schema_drift catch-ladder (ToolErrorCarrier rethrow
38
+ * FIRST so a 5xx keeps its taxonomy → SyntaxError→driftError → bare rethrow).
39
+ *
40
+ * GET https://data.cms.gov/provider-data/api/1/datastore/query/{datasetId}/0
41
+ * ?limit=&offset=&conditions[0][property]=state&conditions[0][value]=VA&conditions[0][operator]==
42
+ * → { count: 96, results: [ { facility_id, facility_name, … }, … ], schema, query }
43
+ *
44
+ * ★ SSRF: the host is a compile-time literal (`CMS_HOST`); the dataset id + the
45
+ * endpoint path are MODULE literals. Every USER filter VALUE rides as a
46
+ * URLSearchParams VALUE (`conditions[i][value]=…`) — URLSearchParams encodes the
47
+ * bracket key AND the value, so a value can never break out into the path or
48
+ * inject a parameter. state is `^[A-Za-z]{2}$`; facilityName/hospitalType are a
49
+ * bounded free-text charclass; size/offset are coerced to integers. A
50
+ * post-construction hostname/protocol assertion + `redirect:"error"` fail closed
51
+ * on any off-host 3xx.
52
+ *
53
+ * ★ HONESTY (ADR-0062 P1–P5, live-verified 2026-07-15 on data.cms.gov):
54
+ * [input] require state OR facilityName — an all-empty query is REFUSED (0 fetch).
55
+ * [P1] totalAvailable = the response's top-level `count` (EXACT — VA = 96), NOT
56
+ * the slice length. hasMore = offset+returned < count.
57
+ * [P2] results:[] ⇒ honest empty (returned:0). getJson maps a 4xx/5xx via
58
+ * errorFromResponse and THROWS (503 ⇒ upstream_unavailable, 400 ⇒
59
+ * invalid_input, 404 ⇒ not_found); a 200 non-JSON/non-array body OR a body
60
+ * missing `count`/`results` ⇒ schema_drift (NEVER a fabricated empty).
61
+ * [P3] hospital_overall_rating "1"–"5" via num(); "Not Available"/""/non-numeric
62
+ * ⇒ null (NEVER 0 — a data-absence-as-zero masquerade is the forbidden
63
+ * class). emergency_services "Yes"⇒true / "No"⇒false / else null. String
64
+ * fields via str() (null-never-empty-string).
65
+ * [P4] results non-array OR count non-number ⇒ driftError.
66
+ */
67
+ import { str, num } from "./coerce.js";
68
+ import { type MetaBundle } from "./meta.js";
69
+ export { num, str };
70
+ export type Hospital = {
71
+ facilityId: string | null;
72
+ facilityName: string | null;
73
+ address: string | null;
74
+ city: string | null;
75
+ state: string | null;
76
+ zip: string | null;
77
+ county: string | null;
78
+ phone: string | null;
79
+ hospitalType: string | null;
80
+ ownership: string | null;
81
+ emergencyServices: boolean | null;
82
+ overallRating: number | null;
83
+ };
84
+ /**
85
+ * Normalize the CMS `emergency_services` "Yes"/"No" flag → boolean | null.
86
+ * "Yes"⇒true, "No"⇒false (case-insensitive); anything else (absent/""/unrecognized)
87
+ * ⇒ null — NEVER a fabricated false (a data-absence-as-false masquerade).
88
+ */
89
+ export declare function emergencyBool(x: unknown): boolean | null;
90
+ export type CmsHospitalCompareArgs = {
91
+ state?: string;
92
+ facilityName?: string;
93
+ hospitalType?: string;
94
+ size?: number;
95
+ offset?: number;
96
+ };
97
+ /**
98
+ * Fetch CMS Hospital Compare "Hospital General Information" rows for a state and/or
99
+ * facility-name fragment (+ optional hospitalType) → normalized hospital rows +
100
+ * honest `_meta`. REQUIRES state OR facilityName (an all-empty query is refused). A
101
+ * SINGLE request: the response's top-level `count` is the EXACT per-filter total
102
+ * (P1 — never the slice length).
103
+ */
104
+ export declare function hospitalCompare(args: CmsHospitalCompareArgs): Promise<MetaBundle>;
105
+ //# sourceMappingURL=cms-hospital.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cms-hospital.d.ts","sourceRoot":"","sources":["../src/cms-hospital.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAIH,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAY,KAAK,UAAU,EAAqB,MAAM,WAAW,CAAC;AAIzE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AA0CpB,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,C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