FHIR resource
Generated reference for ovok_sdk: fhir resource.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.23+d339d81
FhirResource
class FhirResourceGeneric FHIR R4 on {baseUrl}/{fhirPath}; resources are decoded JSON.
Reached through ovok.fhir. Every request throws an OvokException
subclass when it fails.
Constructors
FhirResource.new
FhirResource(HttpClient _http)Built by Ovok; use ovok.fhir instead.
| Parameter | Type | Kind | Default |
|---|---|---|---|
_http | HttpClient | positional |
Methods
FhirResource.read
Future<Map<String, dynamic>> read(String type, String id)Reads one resource. Calls GET {fhirPath}/{type}/{id}.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | String | positional | |
id | String | positional |
Returns Future<Map<String, dynamic>>.
FhirResource.search
Future<Page<Map<String, dynamic>>> search(String type, [QueryParams params = const {}])Searches type and returns the first page of matches.
Calls GET {fhirPath}/{type}?{params}.
A list value repeats its parameter, which FHIR reads as AND; write 'a,b' for OR.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | String | positional | |
params | QueryParams | optional positional | const {} |
Returns Future<Page<Map<String, dynamic>>>.
FhirResource.searchOne
Future<Map<String, dynamic>?> searchOne(String type, [QueryParams params = const {}])Returns the first match of a search with _count=1, or null when none matches.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | String | positional | |
params | QueryParams | optional positional | const {} |
Returns Future<Map<String, dynamic>?>.
FhirResource.create
Future<Map<String, dynamic>> create(Map<String, dynamic> resource, {String? ifNoneExist})Creates resource. Calls POST {fhirPath}/{resourceType}.
ifNoneExist is sent as the If-None-Exist header.
With ifNoneExist, a retry cannot create a duplicate, so the request is safe to repeat.
| Parameter | Type | Kind | Default |
|---|---|---|---|
resource | Map<String, dynamic> | positional | |
ifNoneExist | String? | named |
Returns Future<Map<String, dynamic>>.
FhirResource.update
Future<Map<String, dynamic>> update(Map<String, dynamic> resource)Replaces resource. Calls PUT {fhirPath}/{resourceType}/{id}.
Throws OvokValidationException when resource has no id.
| Parameter | Type | Kind | Default |
|---|---|---|---|
resource | Map<String, dynamic> | positional |
Returns Future<Map<String, dynamic>>.
FhirResource.patch
Future<Map<String, dynamic>> patch(
String type,
String id,
List<PatchOperation> operations,
)Applies JSON Patch operations to one resource.
Calls PATCH {fhirPath}/{type}/{id}.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | String | positional | |
id | String | positional | |
operations | List<PatchOperation> | positional |
Returns Future<Map<String, dynamic>>.
FhirResource.delete
Future<void> delete(String type, String id)Deletes one resource. Calls DELETE {fhirPath}/{type}/{id}.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | String | positional | |
id | String | positional |
Returns Future<void>.
FhirResource.batch
Future<Map<String, dynamic>> batch(Map<String, dynamic> bundle)Posts a batch or transaction bundle. Calls POST {fhirPath}.
| Parameter | Type | Kind | Default |
|---|---|---|---|
bundle | Map<String, dynamic> | positional |
Returns Future<Map<String, dynamic>>.
Last updated on