Foundation

Undocumented

  • Attempt to read a JSON file with the given name (.json) from the bundle, parse the JSON and instantiate a FHIR resource corresponding to the resourceType in the file.

    Declaration

    Swift

    public func fhir_bundledResource<T: Resource>(_ name: String, type: T.Type) throws -> T

    Parameters

    name

    The filename, without “.json” extension, to read the resource from

    type

    The type the resource is expected to be; must be a subclass of Resource

    Return Value

    A Resource subclass corresponding to the “resourceType” entry, as specified under type

  • Attempts to read a JSON file with the given name (without .json) from the given directory. Parses the JSON and instantiates a FHIR resource corresponding to resourceType.

    Declaration

    Swift

    public func fhir_bundledResource<T: Resource>(_ name: String, subdirectory: String?, type: T.Type) throws -> T

    Parameters

    name

    The filename, without “.json” extension, to read the resource from

    subdirectory

    The directory name to search for the resource; nil for top level

    type

    The type the resource is expected to be; must be a subclass of Resource

    Return Value

    A Resource subclass corresponding to the “resourceType” entry, as specified under type

  • Attempts to read a JSON file with the given name (without .json) from the given directory. Parses the JSON and instantiates a FHIR resource corresponding to resourceType.

    Declaration

    Swift

    public func fhir_json(from name: String, subdirectory: String?) throws -> FHIRJSON

    Parameters

    name

    The filename, without “.json” extension, to read the resource from

    subdirectory

    The directory name to search for the resource; nil for top level

    type

    The type the resource is expected to be; must be a subclass of Resource

    Return Value

    A Resource subclass corresponding to the “resourceType” entry, as specified under type