Skip to content

Integrations and Events

Integration style

Use API boundaries for commands and event boundaries for status changes.

Commands

Examples:

  • channel submits treatment request to Phensys
  • Phensys routes fulfilment request to provider
  • Phensys requests stock estimate from a provider adapter

Events

Examples:

  • consultation.completed
  • prescription.approved
  • prescription.rejected
  • fulfilment.requested
  • fulfilment.delayed
  • dispensing.completed
  • shipment.dispatched
  • shipment.delivered
LoveMyLife → create request in Phensys
Phensys → route to provider adapter
Provider → emit operational updates to Phensys
Phensys → expose authoritative status to LoveMyLife
LoveMyLife → notify patient

Why Phensys should sit in the middle

This keeps:

  • channel logic separate from provider logic
  • tenant routing rules in one place
  • multiple provider support possible without changing the storefront
  • audit narratives simpler for certification

Provider abstraction

Suggested interfaces:

  • PrescriptionFulfilmentProvider
  • StockAvailabilityProvider
  • ShipmentStatusProvider

Possible implementations:

  • PharmetraProvider
  • ExternalPharmacyProvider
  • ManualQueueProvider
  • SupplierDirectProvider