@startuml skinparam NoteTextAlignment left skinparam Padding 2 skinparam ParticipantPadding 50 skinparam LifelineStrategy solid autonumber participant "FHIR Server\nREST API" as S participant "Client" as C participant "Client Endpoint\n(HTTP/S)" as E group Subscription Negotiation C->>S: Create Subscription\n""channel.type: rest-hook"" return Success\n""Subscription.status: requested"" S->>E: HTTP POST - Handshake\n""Bundle:""\n"" Bundle.type: history""\n""SubscriptionStatus.type: handshake"" return HTTP Success, e.g.:\n""200: OK"" note right of S Server updates Subscription: ""Subscription.status: active"" end note end group REST Subscription Processing else Server sends heartbeat S->>E: HTTP POST - Heartbeat\n""Bundle:""\n"" Bundle.type: history""\n""SubscriptionStatus.type: heartbeat"" return HTTP Success, e.g.:\n""200: OK"" ... else Server sends event-notification S->>E: HTTP POST - Notification\n""Bundle:""\n"" Bundle.type: history""\n""SubscriptionStatus.type: event-notification"" return HTTP Success, e.g.:\n""200: OK"" ... end @enduml