-
Notifications
You must be signed in to change notification settings - Fork 47
Resources
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:
-
FHIRElement
-
FHIRResource
-
Resource, generated from the base resource profile
- DomainResource, generated from the domain resource profile
-
Resource, generated from the base resource profile
-
FHIRResource
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:)
Patient.read({patient-id}, server: smart.server) { resource, error in
// check error
// `resource` is a "Patient" instance on success
}
TBD
let encounter = Encounter(...)
encounter.create(server: smart.server) { error in
// check error
}
TBD
TBD
let prescription = MedicationPrescription(...)
prescription.create(server: smart.server) { error in
// check error
}
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
}
TBD
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.
TBD
TBD
See the search page.