FHIROpenServer
open class FHIROpenServer: FHIRMinimalServer
A very basic FHIRServer implementation that deals with Open FHIR servers in JSON.
It knows its base URL, can fetch and hold on to the cabability statement and perform requests and operations.
These methods are of interest to you when you create a subclass:
handlerForRequest(withMethod:resource:)
: what kind of handler your server wants to use. ReturnsFHIRJSONRequestHandler
.configurableRequest(for:)
: the SMART framework returns a request that already has an Authorization headers set, if needed.
-
The server’s cabability statement. Must be implicitly fetched using
getCapabilityStatement()
Declaration
Swift
public final internal(set) var cabability: CapabilityStatement?
-
Undocumented
Declaration
Swift
open class FHIROpenServer: FHIRMinimalServer
-
Undocumented
Declaration
Swift
open class FHIROpenServer: FHIRMinimalServer
-
Retrieve the operation definition with the given name, either from cache or load the OperationDefinition resource.
Once an OperationDefinition has been retrieved, it is cached into the instance’s
operations
dictionary. Must be used after the cabability statement has been fetched, i.e. after usingready
orgetCapabilityStatement
.Declaration
Swift
open func operation(_ name: String, callback: @escaping ((OperationDefinition?) -> Void))
-
Performs the given Operation.
The server first validates the operation and only proceeds with execution if validation succeeds.
Resource
has extensions to facilitate working with operations, be sure to take a look.Declaration
Swift
open func perform(_ operation: FHIROperation, callback: @escaping ((FHIRServerResponse) -> Void))
Parameters
operation
The operation instance to perform
callback
The callback to call when the request ends (success or failure)