import { environment } from '../environments/environment'; /** * The gateway every `Provenance` read must go to. * * - TWO CALLERS PICKED A DIFFERENT ONE AND BOTH FAILED SILENTLY. `GET /R4/Provenance` is * declared in exactly one place, `templates/fhir/01-fhir-foundation.yaml`, and therefore exists on the * FOUNDATION gateway alone. Read against the live account on 2026-08-16: `/R4/Provenance`, * `/R4/Provenance/{id}` and `/R4/Provenance/{id}/_history` are present on * `FhirFoundationApiStack` and on NO other REST API in the deployment. * * THE FAILURE HAS NO STATUS CODE, which is why nobody saw it. Asking a gateway for a path it does * not declare means the CORS preflight gets no `Access-Control-Allow-Origin`, so the browser reports * `net::ERR_FAILED` before any handler is reached. Both callers catch and degrade - deliberately and * correctly, because a failed provenance read must never be rendered as *"this record has no * provenance"* - so a dead route and a genuinely empty record are indistinguishable, forever. * * DO NOT route Provenance through the gateway that serves the resource being asked about. That is * the rule the field-history fetch used, and it is why "who changed this" has only ever resolved for * `DocumentReference`: every other resource type sent the query to base or clinical, where the route * does not exist. Provenance's home does not follow its target's. * * The route is `allowedRoles: [ADMINS]` in the api's `routes.ts`, so a non-admin still gets a 403 * and still degrades to nothing. That is a separate question about who may ask, not about where. */ export function provenanceApiBase(): string { return environment.fhirFoundationApi; }