FHIRKit Client - v2.0.0
    Preparing search index...

    Class CapabilityTool

    Inspect a FHIR CapabilityStatement for server and resource capabilities.

    const capabilities = new CapabilityTool(capabilityStatement);

    // Check resource-level interaction
    capabilities.resourceCan('Patient', 'read'); // true | false

    // General capability check
    capabilities.supportFor({ resourceType: 'Patient', capabilityType: 'interaction', where: { code: 'read' } });
    Index

    Constructors

    Methods

    • Return the raw value of a specific capability category for a resource type.

      Parameters

      • Optionalparams: { capabilityType: string; resourceType: string }

        { resourceType, capabilityType }.

      Returns unknown

      The raw capability value (e.g. an array of interaction objects), or undefined.

    • List interaction codes supported by a resource type.

      Parameters

      • Optionalparams: { resourceType: string }

        { resourceType } — the resource type to inspect.

      Returns string[]

      Array of interaction code strings (e.g. ['read', 'search-type']).

    • Check whether a resource-level interaction is supported.

      Parameters

      • resource: string

        FHIR resource type (e.g. 'Patient').

      • interaction: string

        Interaction code (e.g. 'read', 'search-type').

      Returns boolean

      true if the resource advertises the interaction.

    • Return the full capability entry for a given resource type.

      Parameters

      • Optionalparams: { resourceType: string }

        { resourceType } — the resource type to look up.

      Returns ResourceCapability | undefined

      The raw capability object, or undefined if not found.

    • Check whether a resource-level search parameter is supported.

      Parameters

      • resource: string

        FHIR resource type.

      • searchParam: string

        Search parameter name.

      Returns boolean

      true if the resource advertises the search parameter.

    • List search parameter names supported by a resource type.

      Parameters

      • Optionalparams: { resourceType: string }

        { resourceType } — the resource type to inspect.

      Returns string[]

      Array of search parameter name strings.

    • Check whether a server-level interaction is supported.

      Parameters

      • interaction: string

        Interaction code (e.g. 'transaction', 'batch').

      Returns boolean

      true if the server advertises the interaction.

    • Return the server-mode REST capability block from the CapabilityStatement.

      Returns ServerCapability | undefined

      The server REST capability, or undefined if not present.

    • Check whether a server-level search parameter is supported.

      Parameters

      • searchParam: string

        Search parameter name.

      Returns boolean

      true if the server advertises the search parameter.

    • General capability check. Returns true if the specified capability exists (optionally filtered by a where clause).

      Parameters

      Returns boolean

      true if the capability is found.