@startuml skin rose autonumber "[#]" hide footbox skinparam responseMessageBelowArrow true skinparam sequenceMessageAlign direction skinparam sequenceGroupBorderThickness 1 title 1. Refer Patient actor Clinician participant "WebPas\nPatient Admin" as WebPAS participant "HL7 v2\nHub & Spoke" as HL7 participant "FHIR API\nIntegration Hub" as HUB participant "API Client\n(ConnectedCare, Scope, etc)" as CLIENT note right of CLIENT **Preconditions:** 1. Have OAuth AccessToken 2. ServiceRequest Subscription **Payload Options** - PUT - callback/ServiceRequest - single resource payload - POST - callback - multi-resource bundle including end note group #azure Patient Referral Clinician -> WebPAS: Create Patient Referral to Medical Speciality WebPAS -> HL7: HL7 REF I12 HL7 -> HUB: HL7 REF I12 activate HUB #lavender HUB -> HUB: mapToServiceRequest() HUB -> HUB: saveResource(ServiceRequest) return ack/nak deactivate HUB ... milliseconds later ... HUB -> CLIENT: PUT or POST /fhir/callback return ack/nak end ... ... note right of CLIENT for PUT ServiceRequest payload end note group #azure Retrieve Patient Details CLIENT -> HUB: GET /fhir/Patient/{id} activate HUB #lavender HUB -> HUB: retrieveResource({patientId}) return Patient({id}) deactivate HUB end ... ... note right of CLIENT **Callback Payload Options** 1. PUT - callback/Patient/{id} - single resource payload 2. POST - callback - multi-resource bundle end note group #azure Subscribe Patient Updates CLIENT -> HUB: POST /fhir/Subscription activate HUB #lavender HUB -> HUB: validateSubscription HUB -> HUB: saveResource() return ack/nak deactivate HUB end Clinician --> CLIENT: Acts on Referral @enduml