ITB - Online appointment booking service
1.0.0 - Initial Release

ITB - Online appointment booking service, published by Service Well AB. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/servicewell/servicewell.fhir.wof-portal/ and changes regularly. See the Directory of published versions

OperationDefinition: $getOffersContext — Booking Content Context

Official URL: https://canonical.fhir.link/servicewell/wof-portal/OperationDefinition/get-offers-context Version: 1.0.0
Active as of 2026-04-20 Computable Name: GetOffersContext

$get-offers-context is a read-oriented FHIR operation designed to let a frontend quickly populate booking content so a patient can choose what to book and with whom/where — without needing multiple round-trips.
It may include ActivityDefinitionPortal, HealthcareServicePortal, PractitionerRolePortal and OfferPortal.
It MUST NOT include Schedule, Slot, or bookable time slots.

This operation returns a profiled Bundle that may include:

  • ActivityDefinitionPortal (what is being offered)
  • HealthcareServicePortal (where / which clinic service offers it)
  • PractitionerRolePortal (who can perform it)
  • Offer resources (a lightweight “relation + settings” object)

The response is intentionally shaped for fast content rendering, not for scheduling.

NOTE

  • Operation name: getOffersContext
  • Operation usage: $get-offers-context

What this operation is NOT

$getOffersContext does not answer:

  • Whether a practitioner is working right now
  • Schedule availability
  • Which time slots are bookable

In other words:

  • No Schedule
  • No Slot
  • No bookable times

Those concerns belong to downstream availability/slot endpoints.

Non-goals / exclusions

  • No scheduling, working hours, or shift logic
  • No real-time availability
  • No Slot calculation
  • No guarantee that all returned practitioners are currently working

Endpoints

The operation can be exposed at (at least) the following levels:

  • System:
    GET /fhir/$get-offers-context

  • ActivityDefinition scope:
    GET /fhir/ActivityDefinition/{id}/$get-offers-context

  • HealthcareService scope:
    GET /fhir/HealthcareService/{id}/$get-offers-context

  • PractitionerRole scope:
    GET /fhir/PractitionerRole/{id}/$get-offers-context

The server may return different subsets depending on the endpoint and/or query parameters, but the response is always a Bundle.

Response

Resource type

  • Bundle (profiled)

resources (depending on inputs) The response Bundle MAY include any combination of:

  • ActivityDefinitionPortal
  • HealthcareServicePortal
  • PractitionerRolePortal
  • OfferPortal (custom resource/profile)

The OfferPortal resource (custom, profiled)

OfferPortal is the compact “join object” used by clients to connect:

  • what (ActivityDefinitionPortal)
  • where (HealthcareServicePortal)
  • who (PractitionerRolePortal)

An Offer contains:

  • healthcareServiceReference(HealthcareServicePortal) (with display populated when possible)
  • practitionerRoleReference(PractitionerRolePortal) (with display populated when possible)
  • activityDefinitionReference(ActivityDefinitionPortal) (with display populated when possible)

Offer may also include presentation-focused settings needed for booking content, e.g.:

  • duration (free-text)
  • price (free-text)
  • booking URL / deeplink

Note: duration and price are intended for booking/marketing presentation. They are not required to be machine-parseable.

Why Bundle (instead of Parameters)

We use a profiled Bundle so that:

  • Clients can reuse standard FHIR parsing patterns
  • Resources can be included once and referenced from multiple offers
  • The payload remains efficient for “chatty” consumers

Typical client usage

  1. Call $get-offers-context for a scope (e.g. an ActivityDefinition).
  2. Parse the Bundle and build in-memory maps:
    • ActivityDefinition by id
    • HealthcareService by id
    • PractitionerRole by id
    • Offer list
  3. Render booking options:
    • group by clinic (HealthcareService)
    • show practitioners (PractitionerRole)
    • show the selected activity (ActivityDefinition)
    • show offer-specific settings (duration/price/deeplink)

Glossary

  • ActivityDefinition: what can be booked (e.g., “Examination”)
  • HealthcareService: a clinic/service unit offering the activity
  • PractitionerRole: a practitioner in a role relevant for booking
  • Offer: the relationship + settings that ties the above together

URL: [base]/$get-offers-context

URL: [base]/ActivityDefinition/[id]/$get-offers-context

URL: [base]/HealthcareService/[id]/$get-offers-context

URL: [base]/PractitionerRole/[id]/$get-offers-context

Parameters

UseNameScopeCardinalityTypeBindingDocumentation
INincludeActivityDefinitionPortal0..1boolean

If true, the response Bundle SHALL include ActivityDefinitionPortal resources. If omitted or false, ActivityDefinitionPortal resources are not included.

INincludeHealthcareServicePortal0..1boolean

If true, the response Bundle SHALL include HealthcareServicePortal resources. If omitted or false, HealthcareServicePortal resources are not included.

INincludePractitionerRolePortal0..1boolean

If true, the response Bundle SHALL include PractitionerRolePortal resources. If omitted or false, PractitionerRolePortal resources are not included.

OUTreturn1..1Bundle (Bundle (Offers Context) — WOF Portal)

A profiled Bundle containing offers context resources.