Skip to content
Pascal Pfiffner edited this page Apr 2, 2015 · 6 revisions

The embedded Swift-FHIR library contains classes for all base FHIR profiles. All classes are documented in the technical documentation, their inheritance graph usually is:

Usage

The FHIR REST API defines a set of logical interactions. These are all (to be) implemented as a class extension on Resource, at instance- or class-level, or are handled by the Server instance the client is hanging on to.

Currently, all server interactions use the JSON format. These interactions will all use the Server's JSON methods:

  • getJSON(path:callback:)
  • putJSON(path:body:callback:)
  • postJSON(path:body:callback:)

Instance Level

read

Patient.read({patient-id}, server: smart.server) { resource, error in
    // check error
    // `resource` is a "Patient" instance on success
}

vread

TBD

update

let encounter = Encounter(...)
encounter.create(server: smart.server) { error in
    // check error
}

delete

TBD

history

TBD

Type Level

create

let prescription = MedicationPrescription(...)
prescription.create(server: smart.server) { error in
    // check error
}

search

See the search page for detailed instructions. A basic example:

MedicationPrescription.search(["patient": id])
.perform(smart.server) { bundle, error in
    // check error
    // `bundle` is a Bundle instance
}

history

TBD

System Level

conformance

The Server instance handles working with the conformance statement. You don't usually need to work with conformance yourself, but you still can if you desire to do so. Take a look at the Server and Conformance class documentation for details.

transaction

TBD

history

TBD

search

See the search page.

Clone this wiki locally