Skip to content

Care

Care management service — coordinates care episodes, provider appointments, prescriptions, and diagnostic referrals.

Overview

The Care service models the post-triage care delivery journey. Once a member completes a triage session (or presents directly), a care episode is opened to track the full course of treatment. Within an episode, the care team can book appointments with providers, issue prescriptions, and create referrals to diagnostic facilities or specialists.

Episodes are the root aggregate. They carry a care type (GP, specialist, urgent care, etc.) and optionally reference the triage session that originated them. All appointments, prescriptions, and referrals are scoped to an episode, providing a cohesive view of a member's care journey.

The service integrates with Provider to look up available appointment slots and validate provider participation before booking. A Kafka producer publishes care events for downstream notification and analytics.

Responsibilities

  • Open and manage care episodes linked to triage sessions or direct member requests
  • Book and manage provider appointments within episodes
  • Manage provider availability slots for appointment scheduling
  • Issue and track prescription records
  • Create and track diagnostic referrals (lab, imaging, specialist)
  • Publish care events for Notifications and analytics consumers
  • Expose internal endpoints for member portal to list a member's active episodes

Database

Schema: care

TablePurpose
episodesCare episode root with member, care type, status, and optional triage session reference
appointmentsProvider appointments within an episode (PENDING → CONFIRMED → ATTENDED/CANCELLED/NO_SHOW)
provider_slotsProvider availability slots (AVAILABLE → BOOKED/BLOCKED)
prescriptionsPrescription records linked to an episode (ISSUED → FILLED/VOID)
diagnostics_referralsReferrals to labs or specialists (REFERRED → BOOKED → COMPLETED/CANCELLED)

API Routes

MethodPathAuthDescription
POST/episodesJWTOpen a new care episode
GET/episodesJWTList episodes (filterable by party, status, care type)
GET/episodes/{locator}JWTGet episode by locator
PATCH/episodes/{locator}/closeJWTClose an episode with a summary
PATCH/episodes/{locator}/cancelJWTCancel an episode
POST/episodes/{locator}/appointmentsJWTBook an appointment within an episode
GET/episodes/{locator}/appointmentsJWTList appointments for an episode
PATCH/appointments/{locator}/confirmJWTConfirm an appointment
PATCH/appointments/{locator}/attendJWTMark appointment as attended
PATCH/appointments/{locator}/cancelJWTCancel an appointment
PATCH/appointments/{locator}/no-showJWTMark appointment as no-show
POST/providers/{providerLocator}/slotsJWTAdd a provider availability slot
GET/providers/{providerLocator}/slotsJWTList slots for a provider
PATCH/slots/{locator}/blockJWTBlock a provider slot
POST/episodes/{locator}/prescriptionsJWTIssue a prescription
GET/episodes/{locator}/prescriptionsJWTList prescriptions for an episode
PATCH/prescriptions/{locator}/fillJWTMark a prescription as filled
PATCH/prescriptions/{locator}/voidJWTVoid a prescription
POST/episodes/{locator}/referralsJWTCreate a diagnostic referral
GET/episodes/{locator}/referralsJWTList referrals for an episode
PATCH/referrals/{locator}/bookJWTBook a referral appointment
PATCH/referrals/{locator}/completeJWTMark referral as completed
PATCH/referrals/{locator}/cancelJWTCancel a referral
GET/internal/episodes/{locator}InternalFetch episode for member portal (no JWT)
GET/internal/members/{partyLocator}/episodesInternalList all episodes for a member

Events

Publishes

TopicWhen
care.episode.openedA new care episode is created
care.episode.closedAn episode is closed with a care summary
care.appointment.bookedAn appointment is booked
care.appointment.attendedAn appointment is marked as attended

Consumes

The Care service does not consume Kafka events.

Dependencies

ServiceHow used
ProviderFetches provider details and validates slot availability before booking appointments

Key Design Decisions

Episode as the coordination unit: All care activities (appointments, prescriptions, referrals) are scoped to an episode rather than directly to a member. This allows a single member to have multiple concurrent care pathways (e.g., one for a respiratory issue, one for a follow-up from a prior condition) without data mixing.

Triage session linkage is optional: Episodes can be opened without a triage session locator, supporting cases where a member books directly (annual check-up, specialist referral from GP, etc.) or where care is initiated by an admin.

Olly Health Insurance Platform