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 FhirResource

Generic 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.

ParameterTypeKindDefault
_httpHttpClientpositional

Methods

FhirResource.read

Future<Map<String, dynamic>> read(String type, String id)

Reads one resource. Calls GET {fhirPath}/{type}/{id}.

ParameterTypeKindDefault
typeStringpositional
idStringpositional

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.

ParameterTypeKindDefault
typeStringpositional
paramsQueryParamsoptional positionalconst {}

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.

ParameterTypeKindDefault
typeStringpositional
paramsQueryParamsoptional positionalconst {}

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.

ParameterTypeKindDefault
resourceMap<String, dynamic>positional
ifNoneExistString?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.

ParameterTypeKindDefault
resourceMap<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}.

ParameterTypeKindDefault
typeStringpositional
idStringpositional
operationsList<PatchOperation>positional

Returns Future<Map<String, dynamic>>.

FhirResource.delete

Future<void> delete(String type, String id)

Deletes one resource. Calls DELETE {fhirPath}/{type}/{id}.

ParameterTypeKindDefault
typeStringpositional
idStringpositional

Returns Future<void>.

FhirResource.batch

Future<Map<String, dynamic>> batch(Map<String, dynamic> bundle)

Posts a batch or transaction bundle. Calls POST {fhirPath}.

ParameterTypeKindDefault
bundleMap<String, dynamic>positional

Returns Future<Map<String, dynamic>>.

Last updated on

On this page