import type { components, paths } from '../generated/api.js';
import { WorkspaceScopedResource } from './base.js';
type Q<P extends keyof paths> = NonNullable<paths[P] extends {
    get: {
        parameters: {
            query?: infer Query;
        };
    };
} ? Query : never>;
export type PatientSearchParams = Q<'/v1/{workspace_id}/fhir/patients'>;
/** Spec-defined query params for `/fhir/resources/{resource_type}` (FHIR-style search). */
export type FhirSearchParams = Q<'/v1/{workspace_id}/fhir/resources/{resource_type}'>;
export type FhirPatientsViewParams = Q<'/v1/{workspace_id}/fhir/views/patients'>;
export type FhirAppointmentsViewParams = Q<'/v1/{workspace_id}/fhir/views/appointments'>;
export type FhirPractitionersViewParams = Q<'/v1/{workspace_id}/fhir/views/practitioners'>;
export type FhirOrganizationsViewParams = Q<'/v1/{workspace_id}/fhir/views/organizations'>;
export type FhirLocationsViewParams = Q<'/v1/{workspace_id}/fhir/views/locations'>;
export type FhirSlotsViewParams = Q<'/v1/{workspace_id}/fhir/views/slots'>;
/**
 * FHIR — healthcare data interop surface for connected EHR integrations.
 *
 * @beta New in this release; surface may evolve as the EHR adapters stabilize.
 *
 * Provides:
 *   - Sync status (`status`)
 *   - Bulk imports (`import`)
 *   - FHIR-shaped CRUD on resources (`resources.*`)
 *   - Patient-centric views (`patients`, `patientSummary`, `patientTimeline`)
 *   - Pre-aggregated typed views per resource type (`views.*`)
 *
 * All operations are workspace-scoped; the FHIR server identity is determined
 * by the workspace's connected EHR integration.
 */
export declare class FhirResource extends WorkspaceScopedResource {
    /** Get current FHIR sync status (server identity, last sync, counts) */
    getStatus(): Promise<{
        configured: boolean;
        connector_type?: string | null | undefined;
        entity_count: number;
        entity_type_counts?: {
            [x: string]: number;
        } | undefined;
        event_count: number;
        last_change_at?: string | null | undefined;
        last_poll_at?: string | null | undefined;
        resource_type_counts?: {
            [x: string]: number;
        } | undefined;
        sync_healthy?: boolean | null | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Trigger a FHIR import (full or partial, depending on request) */
    import(body: components['schemas']['FhirImportRequest']): Promise<{
        absence_semantics?: "absent_resources_persist" | undefined;
        entities_created: number;
        entities_updated: number;
        error_count?: number | undefined;
        errors?: string[] | undefined;
        errors_truncated?: boolean | undefined;
        events_created: number;
        events_skipped?: number | undefined;
        events_updated?: number | undefined;
        unsupported_resource_count?: number | undefined;
        unsupported_resources?: {
            location: string;
            reason: string;
            resource_id?: string | null | undefined;
            resource_type?: string | null | undefined;
        }[] | undefined;
        unsupported_resources_truncated?: boolean | undefined;
        upsert_semantics?: "same_resource_id_upsert" | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Search patients by demographics or identifiers */
    searchPatients(params?: PatientSearchParams): Promise<{
        has_more?: boolean | undefined;
        next_offset?: number | null | undefined;
        patients: {
            birth_date?: string | null | undefined;
            email?: string | null | undefined;
            entity_id: string;
            event_count?: number | undefined;
            gender?: string | null | undefined;
            last_event_at?: string | null | undefined;
            mrn?: string | null | undefined;
            name?: string | null | undefined;
            phone?: string | null | undefined;
        }[];
        total: number;
    } & import("../index.js").ResponseMetadata>;
    /** Get a patient summary (canonical demographics + active conditions/meds) */
    getPatientSummary(patientId: string): Promise<{
        birth_date?: string | null | undefined;
        display_name: string | null;
        email?: string | null | undefined;
        entity_id: string;
        entity_type: string;
        event_count: number;
        gender?: string | null | undefined;
        last_event_at: string | null;
        mrn?: string | null | undefined;
        name?: string | null | undefined;
        phone?: string | null | undefined;
        state?: {
            [x: string]: unknown;
        } | undefined;
    } & import("../index.js").ResponseMetadata>;
    /** Get a patient's longitudinal clinical timeline */
    getPatientTimeline(patientId: string): Promise<{
        entity_id: string;
        events: {
            [x: string]: unknown;
        }[];
        total: number;
    } & import("../index.js").ResponseMetadata>;
    readonly resources: {
        /** Search FHIR resources of a given type (passes search params through to FHIR) */
        search: (resourceType: string, params?: FhirSearchParams) => Promise<{
            entries: {
                [x: string]: unknown;
            }[];
            next_url?: string | null | undefined;
            resource_type: string;
            total: number | null;
        } & import("../index.js").ResponseMetadata>;
        /** Create a FHIR resource of the given type */
        create: (resourceType: string, body: components["schemas"]["FhirWriteRequest"]) => Promise<{
            data: {
                [x: string]: unknown;
            };
            entity_id?: string | null | undefined;
            resource_id: string;
            resource_type: string;
        } & import("../index.js").ResponseMetadata>;
        /** Get a single FHIR resource by type + id */
        get: (resourceType: string, resourceId: string) => Promise<{
            data: {
                [x: string]: unknown;
            };
            entity_id?: string | null | undefined;
            resource_id: string;
            resource_type: string;
        } & import("../index.js").ResponseMetadata>;
        /** Update a FHIR resource by type + id */
        update: (resourceType: string, resourceId: string, body: components["schemas"]["FhirWriteRequest"]) => Promise<{
            data: {
                [x: string]: unknown;
            };
            entity_id?: string | null | undefined;
            resource_id: string;
            resource_type: string;
        } & import("../index.js").ResponseMetadata>;
        /** Get the version history for a FHIR resource */
        getHistory: (resourceType: string, resourceId: string) => Promise<{
            entries: {
                confidence?: number | null | undefined;
                created_at?: string | null | undefined;
                data?: {
                    [x: string]: unknown;
                } | undefined;
                data_source_id?: string | null | undefined;
                effective_at?: string | null | undefined;
                entity_id?: string | null | undefined;
                event_id: string;
                event_type: string;
                fields_affected?: string[] | undefined;
                is_current: boolean;
                source?: string | null | undefined;
                source_system?: string | null | undefined;
            }[];
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            resource_id: string;
            resource_type: string;
            total: number;
        } & import("../index.js").ResponseMetadata>;
    };
    readonly views: {
        /** List patients (typed view with computed display fields) */
        patients: (params?: FhirPatientsViewParams) => Promise<{
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            patients: {
                active_conditions?: string[] | undefined;
                active_medications?: string[] | undefined;
                address?: {
                    [x: string]: unknown;
                } | null | undefined;
                address_city?: string | null | undefined;
                address_postal_code?: string | null | undefined;
                address_state?: string | null | undefined;
                allergies?: string[] | undefined;
                birth_date?: string | null | undefined;
                canonical_id?: string | null | undefined;
                confidence?: number | undefined;
                created_at?: string | null | undefined;
                email?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                first_name?: string | null | undefined;
                gender?: string | null | undefined;
                insurance?: {
                    [x: string]: unknown;
                }[] | undefined;
                last_event_at?: string | null | undefined;
                last_name?: string | null | undefined;
                member_id?: string | null | undefined;
                mrn?: string | null | undefined;
                name?: string | null | undefined;
                phone?: string | null | undefined;
                policyholder_dob?: string | null | undefined;
                policyholder_name?: string | null | undefined;
                policyholder_relationship?: string | null | undefined;
                practice_payer_id?: string | null | undefined;
                primary_payer_name?: string | null | undefined;
                source_system?: string | null | undefined;
            }[];
            total: number;
        } & import("../index.js").ResponseMetadata>;
        /** List appointments */
        appointments: (params?: FhirAppointmentsViewParams) => Promise<{
            appointments: {
                appointment_type?: string | null | undefined;
                cancel_reason?: string | null | undefined;
                canonical_id?: string | null | undefined;
                duration_minutes?: number | null | undefined;
                end?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                last_event_at?: string | null | undefined;
                location_name?: string | null | undefined;
                modality?: string | null | undefined;
                patient_name?: string | null | undefined;
                practitioner_name?: string | null | undefined;
                reason?: string | null | undefined;
                source_system?: string | null | undefined;
                start?: string | null | undefined;
                status?: string | null | undefined;
            }[];
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            total: number;
        } & import("../index.js").ResponseMetadata>;
        /** List practitioners */
        practitioners: (params?: FhirPractitionersViewParams) => Promise<{
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            practitioners: {
                canonical_id?: string | null | undefined;
                email?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                last_event_at?: string | null | undefined;
                member_id?: string | null | undefined;
                name?: string | null | undefined;
                npi?: string | null | undefined;
                phone?: string | null | undefined;
                scheduling_eligible?: boolean | null | undefined;
                source_system?: string | null | undefined;
                specialty?: string | null | undefined;
            }[];
            total: number;
        } & import("../index.js").ResponseMetadata>;
        /** List organizations */
        organizations: (params?: FhirOrganizationsViewParams) => Promise<{
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            organizations: {
                address?: {
                    [x: string]: unknown;
                } | null | undefined;
                canonical_id?: string | null | undefined;
                domain?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                industry?: string | null | undefined;
                last_event_at?: string | null | undefined;
                name?: string | null | undefined;
                phone?: string | null | undefined;
                source_system?: string | null | undefined;
            }[];
            total: number;
        } & import("../index.js").ResponseMetadata>;
        /** List locations */
        locations: (params?: FhirLocationsViewParams) => Promise<{
            has_more?: boolean | undefined;
            locations: {
                address?: {
                    [x: string]: unknown;
                } | null | undefined;
                address_line?: string | null | undefined;
                canonical_id?: string | null | undefined;
                city?: string | null | undefined;
                country?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                facility_id?: string | null | undefined;
                hours?: {
                    [x: string]: unknown;
                } | null | undefined;
                last_event_at?: string | null | undefined;
                latitude?: number | null | undefined;
                longitude?: number | null | undefined;
                name?: string | null | undefined;
                phone?: string | null | undefined;
                postal_code?: string | null | undefined;
                source_system?: string | null | undefined;
                state?: string | null | undefined;
                timezone?: string | null | undefined;
            }[];
            next_offset?: number | null | undefined;
            total: number;
        } & import("../index.js").ResponseMetadata>;
        /**
         * List schedule slots — supports richer filtering than the other views
         * (status, date window, provider, specialty, service_type, facility_id).
         */
        slots: (params?: FhirSlotsViewParams) => Promise<{
            has_more?: boolean | undefined;
            next_offset?: number | null | undefined;
            slots: {
                canonical_id?: string | null | undefined;
                end?: string | null | undefined;
                entity_id: string;
                event_count?: number | undefined;
                facility_id?: string | null | undefined;
                last_event_at?: string | null | undefined;
                provider_id?: string | null | undefined;
                provider_name?: string | null | undefined;
                schedule_ref?: string | null | undefined;
                source_system?: string | null | undefined;
                specialty?: string | null | undefined;
                start?: string | null | undefined;
                status?: string | null | undefined;
                visit_type_ids?: string | null | undefined;
                visit_type_names?: string | null | undefined;
            }[];
            total: number;
        } & import("../index.js").ResponseMetadata>;
    };
}
export {};
//# sourceMappingURL=fhir.d.ts.map