# Hjemmelegene Video integration
### Flow overview (Customer perspective)
look at Figma designs of the flow: https://www.figma.com/file/V5xseOa3UL8j9xwQKoK5oO/Digital-consultations-(HL-internal)?node-id=0%3A1&t=TnelhNkQUjq7WrMj-0
- Customer logs in
- gets through the IF coverage verification
- gets to some sort of next step of the wizard in which he likely fills up the nature of his desired consultation in a text field
- backend creates Consultation and redirects his ass in a URL (same url he'd get via SMS if he was in the referral flow)
- he gets there and is being show a spinner or sth that basically tells them to wait
- doctor starts a consultation, video and chat widgets begin to work
- they're done talking
- doctor finishes a consultation, video and chat switch off
- customer is redirected to review page
```plantuml
@startuml
actor Patient as pat
actor Doctor as doc
entity Backend as back
boundary VideoProvider as vid
== patient creates \na consultation ==
pat -> back : `GQL: createCustomerConsultation(...)`
back -> vid : Call to Daily API and create a videoroom (UUID) tokens for doctor(owner) and patient
note over pat, vid: backend configures video? (generation of keys, identifiers and what-not?)
back -> pat : returns data on Consultation, Doctor and Patient
note over pat, vid: frontend injects those data to the Video React component?
note over pat, vid: Patient starts video-consultation
== patient enters consultation view ==
note over pat, vid: Patient starts video-consultation
@enduml
```
- name of the patient
- name of the doctor
- tokens (doctor and patient)
- UUID (or identifier) of the room
- identifiers "uid://Doctor/5" or "uid://Patient/4567"
```jsx
<MultiChannelConsultationDashboard>
/* tabs */
<VideoConsultationComponent props={
} />
</MultiChannelConsultationDashboard>
```
#### Closing the VideoRoom
5 min after closing Consultation, async job to close the room (Daily API call)
### API call to Daily to create VideoRoom