Start a consultation with an existing patient and user
sequenceDiagram
actor Vendor External System
participant Empego API
participant Empego APP (Employee view)
actor Patient
participant Empego APP (Patient view)
participant Event delivery service
Vendor External System->>Empego API: 1. POST /embeddable/consultation/create (with API key header)
note left of Empego API: -create/update patient,<br/>-create/update user,<br/>-request preauthorized consultation start iframe URL
alt Valid Request
Empego API-->>Vendor External System: 2. Return { patientId, userId, iframeUrl } <br/>iframeUrl example: app.empego.ca/fr/embed/franchise/test/consultation/start?sessionId=124334832&patient=345
else
Empego API-->>Vendor External System: 2. Return error code
end
Vendor External System->>Empego APP (Employee view): 3. Open preauthorized, user-scoped iframeUrl to create a consultation
Empego APP (Employee view)-)Empego API: 4. Complete the consultation creation steps
par
Empego APP (Employee view)-)Empego APP (Employee view): Emit Consultation create browser event
Event delivery service-)Event delivery service: Emit Consultation create event
end
Empego API -) Patient: 5. Send consultation to the patient
Patient->>Empego APP (Patient view): 6. Patient completes consultation
par
Empego APP (Patient view)-)Empego APP (Patient view): Emit Consultation update browser event
Event delivery service-)Event delivery service: Emit Consultation update event
end
Vendor External System->>Empego API: 7. POST /embeddable/consultation/view (with API key header)
note left of Empego API: --create/update user,<br/>-request preauthorized consultation view iframe URL
Empego API-->>Vendor External System: 8. Return { userId, iframeUrl }
Vendor External System->>Empego APP (Employee view): 9. Open preauthorized, user-scoped iframeUrl to view consultation details
Process Steps
- Create/Update Patient, Create/Update User, and Start Consultation ([POST]) The Employee’s system sends a single POST request to the Empego API to:
- Create or update a patient (if needed)
- Create or update a user (if needed)
- Request a preauthorized, user-scoped iframe URL for starting a consultation The request must include an API key for M2M authentication.
- API Response
- Success: The Empego API returns a response containing:
patientId
(if a patient was created or updated)userId
(if a user was created or updated)- A preauthorized, user-scoped
iframeUrl
for the consultation
- Failure: An error code and message are returned.
- Success: The Empego API returns a response containing:
-
Open Consultation Creation Interface The Employee opens the provided, preauthorized iframe URL in the Employee View application to create a consultation (logged in as the user).
- Complete Consultation Creation The Employee completes the consultation creation steps in the Empego APP. Upon completion:
- A browser event is emitted for Consultation creation
- The Event delivery service emits a Consultation create event
-
Send Consultation to Patient The Empego API sends the consultation to the patient.
- Patient Completes Consultation The Patient interacts with the Empego APP (Patient view) to complete the consultation. Upon completion:
- A browser event is emitted for Consultation update
- The Event delivery service emits a Consultation update event
- Request Consultation View ([POST]) When the Employee needs to view consultation details, the system sends another POST request to the Empego API to:
- Create or update the user (no patient data is sent, since the consultation/patient already exist)
- Request a preauthorized, user-scoped iframe URL for viewing consultation details Again, an API key must be included for M2M authentication.
- API Response (Consultation Details) The Empego API returns a response with:
userId
- The preauthorized, user-scoped
iframeUrl
for viewing consultation details
- View Consultation Details The Employee opens the provided iframe URL in the Employee View application to access the consultation details.