FHIR and paging
ovok.fhir reads and writes FHIR R4 resources as decoded JSON (JsonMap).
- Stable unknown
- Release candidate since 0.1.0-rc.3
- Development since 0.1.0-dev.17+c121e27
ovok.fhir reads and writes FHIR R4 resources as decoded JSON (JsonMap).
final patient = await ovok.fhir.read('Patient', id);
final page = await ovok.fhir.search('Observation', {
'patient': 'Patient/$id',
'_count': 50,
});
await ovok.fhir.create(observation, ifNoneExist: 'identifier=urn:device|42');
await ovok.fhir.update(patient);
await ovok.fhir.patch('Patient', id, [PatchOperation.replace('/active', false)]);
await ovok.fhir.delete('Patient', id);
final first = await ovok.fhir.searchOne('Patient', {'identifier': 'urn:mrn|123'});- AND and OR: a list value repeats its parameter, which FHIR reads as AND, as in
'date': ['ge2026-01-01', 'le2026-02-01']. For OR, pass one comma-separated string. - Conditional create: with
ifNoneExist, a retry cannot create a duplicate, so the request is retried like a GET. - Batches:
batch(bundle)sends a FHIR batch or transaction Bundle.
Paging
Every list returns Future<Page<T>> with data, hasMore and total (null when the
server does not count). autoPaging() streams every item from that page on, fetching
the next page only when it is needed:
await for (final observation in page.autoPaging()) {
// every page, fetched as you go
}The same Page works for every list in the SDK, whichever pagination the server uses.
Questionnaire responses
ovok.questionnaires.populate requests a prefilled FHIR Questionnaire. Submit the
completed resource with ovok.questionnaireResponses.submit; the SDK sends it through
the existing FHIR transaction endpoint. Flutter apps can render the same resource with
QuestionnaireForm.
Last updated on