From e63bbbb7694d567925fc95f32b78486b2b2eec58 Mon Sep 17 00:00:00 2001 From: Bot-targa Date: Tue, 17 Sep 2024 11:46:05 +0200 Subject: [PATCH] chore(docs): update Teleconsultation Service Backend documentation (#1619) * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation * chore(docs): update Teleconsultation Service Backend documentation --- .../20_configuration.md | 127 +++++++++++------- .../30_usage.md | 69 ++++++---- .../changelog.md | 8 ++ .../img/image.svg | 2 +- 4 files changed, 129 insertions(+), 77 deletions(-) diff --git a/docs/runtime_suite/teleconsultation-service-backend/20_configuration.md b/docs/runtime_suite/teleconsultation-service-backend/20_configuration.md index 33edec78b6..b725dd3b38 100644 --- a/docs/runtime_suite/teleconsultation-service-backend/20_configuration.md +++ b/docs/runtime_suite/teleconsultation-service-backend/20_configuration.md @@ -41,77 +41,104 @@ The microservice requires the `ADDITIONAL_HEADERS_TO_PROXY` environment variable The microservice requires the `TELECONSULTATION_SERVICE_CONFIG_PATH` environment variable to specify the path where the `JSON` config file is stored. If no path is defined a default configuration will be used. The default configuration is the following: -``` + +```json { - privileges: { - basic: { - groups: [ - 'customer', + "privileges": { + "basic": { + "groups": [ + "patient", ], - tools: { - chat: true, - screen_sharing: true, - file_upload: true, - whiteboard: true, - snapshot: true, - live_edit: true, - live_pointer: true, - present_to_everyone: true, + "tools": { + "chat": true, + "screen_sharing": true, + "file_upload": true, + "whiteboard": true, + "snapshot": true, + "live_edit": true, + "live_pointer": true, + "present_to_everyone": true, }, }, - plus: { - groups: [ - 'doctor', + "plus": { + "groups": [ + "doctor", ], - tools: { - chat: true, - screen_sharing: true, - file_upload: true, - whiteboard: true, - snapshot: true, - live_edit: true, - live_pointer: true, - present_to_everyone: true, + "tools": { + "chat": true, + "screen_sharing": true, + "file_upload": true, + "whiteboard": true, + "snapshot": true, + "live_edit": true, + "live_pointer": true, + "present_to_everyone": true, }, }, }, - theme: { - light: { - primaryColor: '#fff', - accentColor: '#480ca8', + "theme": { + "light": { + "primaryColor": "#fff", + "accentColor": "#480ca8", }, - dark: { - primaryColor: '#003049', - accentColor: '#d62828', + "dark": { + "primaryColor": "#003049", + "accentColor": "#d62828", }, }, - environment: 'sandbox', - mode: 'window', - companyLogo: { - url: 'https://www.insert.url.it', + "environment": "sandbox", + "mode": "window", + "companyLogo": { + "url": "https://www.insert.url.it", }, + "customUserId": { + "source": "_id", + "target": "authUserId" +} } ``` Update the `JSON` configuration file in the ConfigMaps section according to your needs. +#### Custom user id + +:::info + +**v1.8.0** The custom user id feature is available from v1.8.0 onwards. + +::: + +When the `CUSTOM_ID_USERS_API_ENDPOINT` environment variable is specified it is possible, for each participant, to resolve a custom user id (`customUserId.source`) received from a client, like a MongoDB `_id` or an email address, into the corresponding Auth0 id (`customUserId.target`), required by the service to perform authentication and authorization. +The Teleconsultation Service then looks for the user with the given MongoDb `_id` or email address and returns the corresponding identity provider id (Auth0 is the only IDP currently supported). +These two fields can be customized specifying different values for the `source` and `target` fields under the `customUserId` configuration option: + +```json +"customUserId": { + "source": "The name of the field containing the user ID received from a client, like a MongoDB `_id` or email address", + "target": "The name of the field containing the user ID of the identity provider, like Auth0 `sub`" +} +``` + + + ### Environment Variables The Teleconsultation Service Backend accepts the environment variables described in the following table. -| Name | Required | Default | Minimum version | Description | -|------------------------------------------|----------|---------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **BANDYER_API_SECRET_KEY** | Yes | - | 1.0.0 | API Secret Key to use in order to communicate with Kaleyra's APIs. | -| **BANDYER_BASE_URL** | Yes | - | 1.0.0 | Name of the Kaleyra API endpoint. | -| **TELECONSULTATION_SERVICE_CONFIG_PATH** | No | - | 1.0.0 | Full path of the updated file defined in the [previous section][environment-variables]. | -| **TELECONSULTATIONS_CRUD_NAME** | No | - | 1.0.0 | Name of the endpoint of the CRUD with all the teleconsultations. | -| **USER_ID_MAP_CRUD_NAME** | No | - | 1.0.0 | Name of the endpoint of the CRUD with all the user_ids (e.g. receivedUserId, bandyerId), for each user. | -| **AUTH_SERVICE** | No | - | 1.0.0 | Name of the authentication service; if not provided, the operating mode without auth0 dependency is used (see [Teleconsultation Service Backend Configuration][configuration]). | -| **DEFAULT_CLIENT_TYPE** | No | - | 1.0.0 | Name of the application that auth0-client uses to retrieve data of the users involved in the teleconsultation. | -| **UNLIMITED_TELECONSULTATION** | No | `true` | 1.1.2 | If the teleconsultation duration is infinite. | -| **LIVE_TELECONSULTATION** | No | `true` | 1.3.0 | If the teleconsultation ends when a participant leaves the call and the number of the remaining participants are less than two. | -| **IMMUTABLE_PERIOD_MS** | No | 0 | 1.2.1 | How much time (in milliseconds) before the scheduled start date you can join the teleconsultation room and you can no longer update the teleconsultation. | -| **TELECONSULTATION_DELETE_UPLOADS** | No | `false` | 1.5.0 | If set to `true`, the files uploaded during a teleconsultation are deleted when the call ends. | +| Name | Required | Default | Minimum version | Description | +|------------------------------------------|----------|---------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **BANDYER_API_SECRET_KEY** | Yes | - | 1.0.0 | API Secret Key to use in order to communicate with Kaleyra's APIs. | +| **BANDYER_BASE_URL** | Yes | - | 1.0.0 | Name of the Kaleyra API endpoint. | +| **TELECONSULTATION_SERVICE_CONFIG_PATH** | No | - | 1.0.0 | Full path of the updated file defined in the [previous section][environment-variables]. | +| **TELECONSULTATIONS_CRUD_NAME** | No | - | 1.0.0 | Name of the endpoint of the CRUD with all the teleconsultations. | +| **USER_ID_MAP_CRUD_NAME** | No | - | 1.0.0 | Name of the endpoint of the CRUD with all the user_ids (e.g. receivedUserId, bandyerId), for each user. | +| **AUTH_SERVICE** | No | - | 1.0.0 | Name of the authentication service; if not provided, the operating mode without auth0 dependency is used (see [Teleconsultation Service Backend Configuration][configuration]). | +| **CUSTOM_ID_USERS_API_ENDPOINT** | No | - | 1.8.0 | The url of the API used to retrieve the Auth0 users id from the given custom user id (e.g. http://user-manager-service/users/ or http://crud-service/users/). It works only with **AUTH_SERVICE** defined. | +| **DEFAULT_CLIENT_TYPE** | No | - | 1.0.0 | Name of the application that auth0-client uses to retrieve data of the users involved in the teleconsultation. | +| **UNLIMITED_TELECONSULTATION** | No | `true` | 1.1.2 | If the teleconsultation duration is infinite. | +| **LIVE_TELECONSULTATION** | No | `true` | 1.3.0 | If the teleconsultation ends when a participant leaves the call and the number of the remaining participants are less than two. | +| **IMMUTABLE_PERIOD_MS** | No | 0 | 1.2.1 | How much time (in milliseconds) before the scheduled start date you can join the teleconsultation room and you can no longer update the teleconsultation. | +| **TELECONSULTATION_DELETE_UPLOADS** | No | `false` | 1.5.0 | If set to `true`, the files uploaded during a teleconsultation are deleted when the call ends. | :::caution diff --git a/docs/runtime_suite/teleconsultation-service-backend/30_usage.md b/docs/runtime_suite/teleconsultation-service-backend/30_usage.md index 518ed91bcf..1dd625a44f 100644 --- a/docs/runtime_suite/teleconsultation-service-backend/30_usage.md +++ b/docs/runtime_suite/teleconsultation-service-backend/30_usage.md @@ -14,7 +14,7 @@ Instead, modify the source file and run the aggregator to regenerate this file. The following sections explain the details about the endpoints exposed from the **Teleconsultation Service Backend**. -This service has been develop based on the assumption that the user authentication method uses **auth0** as auth provider and the platform service [*auth0 Client*][auth0-client]. +This service has been developed based on the assumption that the user authentication method uses **auth0** as auth provider and the platform service [*auth0 Client*][auth0-client]. In Kaleyra there's the concept of _duration_ for a Room. If a Room has a duration, then after the duration expires, the Room is unavailable. @@ -47,12 +47,19 @@ The service will create a kaleyra room only if all participants' data is specifi #### Body parameters -##### participants (required) -**Type**: `array of string` (only accepted if the service is configured to interact with auth0) or `object`
-**Description**: The list of participants to the call. If a list of string is provided, each element of the array needs to be an auth0's user id of the participant. If an object is provided, you must specify: +##### participants (required) + +**Type**: `array of string` (accepted if the service is configured to interact with auth0 or another service to fetch users info) or `object` + +**Description**: The list of participants to the call. + +If a list of string is provided, each element of the array needs to be an Auth0 user id of the participant (if `AUTH_SERVICE` is defined) or a custom id that identifies the users (if also `CUSTOM_ID_USERS_API_ENDPOINT` is defined). + +If an object is provided, you must specify: + - the expected `number` of participants; - an array of participants' `data`, containing, for each participant: - - a `userExternalId` to be used in GET requests to retrieve the correct link for a given user, if interaction with auth0 is enabled, it must be the auth0 id of the participant, + - a `userId` to be used in GET requests to retrieve the correct link for a given user, if interaction with auth0 is enabled, it must be the auth0 id of the participant, - the `groups` (required if auth0 dependency is enabled, not supported otherwise) to be assigned to the user (one of those listed in any of the `privileges.$.groups` array of the service configuration file), - the `fullName` (required if auth0 dependency is enabled, not supported otherwise) to be show by the frontend, - the `language` to be used by the frontend. @@ -113,15 +120,15 @@ curl -X POST "https://my_project_url/teleconsultation" \ "number": 3, "data": [ { - "userExternalId": "user1_auth0_id", + "userId": "user1_auth0_id", "language": "it" }, { - "userExternalId": "user2_auth0_id", + "userId": "user2_auth0_id", "language": "it" }, { - "userExternalId": "user3_auth0_id", + "userId": "user3_auth0_id", "language": "it" } ] @@ -139,11 +146,11 @@ curl -X POST "https://my_project_url/teleconsultation" \ "number": 3, "data": [ { - "userExternalId": "user1_auth0_id", + "userId": "user1_auth0_id", "language": "it" }, { - "userExternalId": "user2_auth0_id", + "userId": "user2_auth0_id", "language": "it" } ] @@ -162,13 +169,13 @@ curl -X POST "https://my_project_url/teleconsultation" \ "number": 3, "data": [ { - "userExternalId": "user1_external_id", + "userId": "user1_external_id", "groups": ["doctor"], "fullName": "Joe Smith", "language": "it" } { - "userExternalId": "user3_external_id", + "userId": "user3_external_id", "groups": ["patient"], "fullName": "Jane Doe, "language": "it" @@ -215,7 +222,7 @@ Updates a teleconsultation whose id is equal to roomId. **roomId** is the **_id** field returned by the CRUD of a specific teleconsultation. :::note -Kaleyra does not support the possibility to make changes existing rooms. +Kaleyra does not support the possibility to make changes in existing rooms. For this reason, the Kaleyra room is created only if all participants data is provided. If the Kaleyra room has already been created and a change having effects on its features is requested, the existing Kaleyra room is deleted and a new one is created. If all participants' data has been provided, starting from [`IMMUTABLE_PERIOD_MS`][environment-variables] milliseconds before the starting time of the call, the service will refuse all the change requests to the teleconsultation instance. See [`GET /teleconsultation/:roomId`][get-teleconsultation-room-id] documentation to understand how the service grants that participants cannot access a Kaleyra room as long as it could be replaced by a new one. ::: @@ -224,6 +231,12 @@ For this reason, the Kaleyra room is created only if all participants data is pr Same body parameters of the POST request are allowed, but only the ones to be modified are required to be provided. +:::info + +**v1.8.0** The participants can use a custom id different from the auth0 id if `CUSTOM_ID_USERS_API_ENDPOINT` is defined. + +::: + **PATCH Request Examples** With auth0 dependency and all a priori known participants: @@ -244,15 +257,15 @@ curl -X PATCH "https://my_project_url/teleconsultation/room_xyz" \ "number": 3, "data": [ { - "userExternalId": "user1_auth0_id", + "userId": "user1_auth0_id", "language": "it" }, { - "userExternalId": "user2_auth0_id", + "userId": "user2_auth0_id", "language": "it" }, { - "userExternalId": "user3_auth0_id", + "userId": "user3_auth0_id", "language": "it" } ] @@ -270,11 +283,11 @@ curl -X PATCH "https://my_project_url/teleconsultation/room_xyz" \ "number": 3, "data": [ { - "userExternalId": "user1_auth0_id", + "userId": "user1_auth0_id", "language": "it" }, { - "userExternalId": "user2_auth0_id", + "userId": "user2_auth0_id", "language": "it" } ] @@ -293,13 +306,13 @@ curl -X PATCH "https://my_project_url/teleconsultation/room_xyz" \ "number": 3, "data": [ { - "userExternalId": "user1_external_id", + "userId": "user1_external_id", "groups": ["doctor"], "fullName": "Joe Smith", "language": "it" } { - "userExternalId": "user3_external_id", + "userId": "user3_external_id", "groups": ["patient"], "fullName": "Jane Doe, "language": "it" @@ -332,10 +345,14 @@ Kaleyra does not support the possibility to make changes existing rooms. For thi #### Body parameters -The data of the participant to be added, that is: - - a `userExternalId` to be used in GET requests to retrieve the correct link for a given user, if interaction with auth0 is enabled, it must be the auth0 id of the participant, - - the `group` (required if auth0 dependency is enabled, not supported otherwise) to be assigned to the user (one of those listed in any of the `privileges.$.groups` array of the service configuration file), - - the `fullName` (required if auth0 dependency is enabled, not supported otherwise) to be show by the frontend, +The data of the participant to be added. + +When the interaction with Auth0 is enabled is sufficient to specify the `userId`. It must be the auth0 id of the participant, or a custom id that identifies the user if `CUSTOM_ID_USERS_API_ENDPOINT` is defined; + +When there is no interaction with auth0 enabled: + + - the `group` (required if auth0 dependency is enabled, not supported otherwise) to be assigned to the user (one of those listed in any of the `privileges.$.groups` array of the service configuration file); + - the `fullName` (required if auth0 dependency is enabled, not supported otherwise) to be show by the frontend; - the `language` to be used by the frontend. @@ -345,7 +362,7 @@ With auth0 dependency and all a priori known participants: ``` curl -X POST "https://my_project_url/teleconsultation/room_xyz/participants/data" \ -d '{ - "userExternalId": "user3_auth0_id", + "userId": "user3_auth0_id", "language": "it" }' ``` @@ -355,7 +372,7 @@ Without auth0 dependency: ``` curl -X POST "https://my_project_url/teleconsultation/room_xyz/participants/data" \ -d '{ - "userExternalId": "user1_external_id", + "userId": "user1_external_id", "groups": ["doctor"], "fullName": "Joe Smith", "language": "it" diff --git a/docs/runtime_suite/teleconsultation-service-backend/changelog.md b/docs/runtime_suite/teleconsultation-service-backend/changelog.md index 310cf56e1b..75d8c1e71b 100644 --- a/docs/runtime_suite/teleconsultation-service-backend/changelog.md +++ b/docs/runtime_suite/teleconsultation-service-backend/changelog.md @@ -15,6 +15,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.8.0] 2024-08-29 + +- Update Node.js to v20 (LTS) + +### Added + +- Add optional environment variable `CUSTOM_ID_USERS_API_ENDPOINT` to allow custom user ids for teleconsultation participants + ## [1.7.0] 2024-02-13 - Added possibility to set virtual background for user group from configMap diff --git a/docs/runtime_suite/teleconsultation-service-backend/img/image.svg b/docs/runtime_suite/teleconsultation-service-backend/img/image.svg index 6aefcb2670..249871ded1 100644 --- a/docs/runtime_suite/teleconsultation-service-backend/img/image.svg +++ b/docs/runtime_suite/teleconsultation-service-backend/img/image.svg @@ -1 +1 @@ -%23%20edit%20in%20https%3A%2F%2Fsequencediagram.org%2F%0A%0Aentryspacing%201.2%0Atitle%20Teleconsulto%202.0%0A%0Aautonumber%20on%0A%0Aactor%20Utente%0Aparticipant%20%22teleconsultation-service-fe%5Cn(FE)%22%20as%20teleconsultation-service-fe%0Aparticipant%20%22teleconsultation-adapter%5Cn(user%20defined)%22%20as%20teleconsultation%20adapter%0Aparticipant%20Servizio%20chiamante%0Aparticipant%20%22teleconsultation-service-be%5Cn(BE)%22%20as%20teleconsultation-service-be%0A%0Adatabase%20%22teleconsultation-user-base%5Cn(CRUD)%22%20as%20teleconsultation-user-base%0Adatabase%20%22teleconsultation-room-base%5Cn(CRUD)%22%20as%20%22teleconsultation-room-base%22%0Aparticipant%20Bandyer%0A%0Anote%20right%20of%20teleconsultation-service-be%3AService%20config%3A%5Cnprivileges%3A%20%7B%5Cn%20%20basic%3A%20%7B%5Cn%20%20%20%20groups%3A%20%5B%5Cn%20%20%20%20%20%20'patient'%2C%5Cn%20%20%20%20%5D%2C%5Cn%20%20%20%20tools%3A%20%7B%5Cn%20%20%20%20%20%20chat%3A%20true%2C%5Cn%20%20%20%20%20%20screen_sharing%3A%20true%2C%5Cn%20%20%20%20%20%20file_upload%3A%20true%2C%5Cn%20%20%20%20%20%20whiteboard%3A%20true%2C%5Cn%20%20%20%20%20%20snapshot%3A%20true%2C%5Cn%20%20%20%20%20%20live_edit%3A%20true%2C%5Cn%20%20%20%20%20%20live_pointer%3A%20true%2C%5Cn%20%20%20%20%20%20present_to_everyone%3A%20true%2C%5Cn%20%20%20%20%7D%2C%5Cn%20%20%7D%2C%5Cn%20%20plus%3A%20%7B%5Cn%20%20%20%20groups%3A%20%5B%5Cn%20%20%20%20%20%20'doctor'%2C%5Cn%20%20%20%20%5D%2C%5Cn%20%20%20%20tools%3A%20%7B%5Cn%20%20%20%20%20%20chat%3A%20true%2C%5Cn%20%20%20%20%20%20screen_sharing%3A%20true%2C%5Cn%20%20%20%20%20%20file_upload%3A%20true%2C%5Cn%20%20%20%20%20%20whiteboard%3A%20true%2C%5Cn%20%20%20%20%20%20snapshot%3A%20true%2C%5Cn%20%20%20%20%20%20live_edit%3A%20true%2C%5Cn%20%20%20%20%20%20live_pointer%3A%20true%2C%5Cn%20%20%20%20%20%20present_to_everyone%3A%20true%2C%5Cn%20%20%20%20%7D%2C%5Cn%7D%2C%5CnuserIdPathInRequest%3A%20%5B%5Cn%20%20%7B%20from%3A%20'object'%2C%20extract%3A%20'headers'%20%7D%2C%5Cn%20%20%7B%20from%3A%20'object'%2C%20extract%3A%20'miauserproperties'%20%7D%2C%5Cn%20%20%7B%20from%3A%20'json'%2C%20extract%3A%20'customUserId'%20%7D%5Cn%5D%0A%0A%3D%3DServizio%20crea%20room%20teleconsulto%3D%3D%0AServizio%20chiamante-%3Eteleconsultation-service-be%3APOST%20%2Fteleconsultation%5Cn%7B%20%5Cn%20%20%22start_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22end_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22participants%22%3A%20%7B%5Cn%20%20%20%20%22number%22%3A%202%2C%5Cn%20%20%20%20%22data%22%3A%20%5B%5Cn%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%22userId%22%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20%20%20%20%20%20%20%20%22fullName%22%3A%20%22Francesco%20Rossi%22%5Cn%20%20%20%20%20%20%20%20%22group%22%3A%20%22patient%22%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%5D%5Cn%20%20%7D%5Cn%7D%0Aspace%0A%0A%0Aloop%20Per%20ogni%20participant%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ARecupero%20utente%5Cncon%20receivedUserId%3D%3D**participant.userId**%0Aalt%20Utente%20esistente%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A%7B%5Cn%20bandyerId%3A%20user1-bandyer-id%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aelse%20Utente%20non%20esistente%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ADefinizione%20del%20ruolo%20Bandyer%20(basic%2C%20pluss)%20partendo%20da%5Cn**participant.group**%2C%20consultando%20la%20configurazione%5Cndei%20gruppi%20del%20servizio%0Ateleconsultation-service-be-%3EBandyer%3APOST%20%2Fuser%2Fcreate%5Cn%7B%20%5Cn%20%20role%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20user%3A%20%7B%5Cn%20%20%20id%3A%20user2-bandyer-id%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ASalvataggio%20utente%20teleconsulto%20in%5Cnuser%20base%5Cn%7B%5Cn%20receivedUserId%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20**bandyerId**%3A%20%22user1-bandyer-id%22%2C%5Cn%20fullName%3A%20%22Francesco%20Rossi%22%5Cn%20groups%3A%20%5B%22patient%22%5D%5Cn%7D%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3AOk%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aend%0Aend%0Aopt%20if%20participants.data.length%20%3D%3D%20participants.number%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20tra%20i%20partecipanti%20ci%20sia%5Cnalmeno%20un%20utente%20plus%0Aalt%20Non%20c'%C3%A8%20almeno%20un%20utente%20plus%0AServizio%20chiamante%3C%23red--teleconsultation-service-be%3AKO%5CnDeve%20esserci%20almeno%20un%20partecipante%5Cndi%20tipo%20plus%0Aend%0Ateleconsultation-service-be-%3EBandyer%3ACreazione%20room%5Cn%7B%5Cn%20%20participants%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20user_id%3A%20%22user1-bandyer-id%22%2C%5Cn%20%20%20%20%20%20tools%3A%20%7B...tootls%20utente%20in%20base%20al%20gruppo...%7D%5Cn%20%20%20%20%20%20is_admin%3A%20**dipende%20dal%20gruppo%20utente**%5Cn%20%20%20%20%7D%5Cn%20%20%5D%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20%20room_id%3A%20%22room1-id%22%5Cn%20%20...%5Cn%7D%0A%0A%0A%0A%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3ACrea%20istanza%20di%20teleconsulto%5Cn%7B%20%5Cn%20%20%22start_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22end_date%22%3A%20%22...%22%2C%5Cn%20%20%22room_id%22%3A%20%22room-id%22%20%5C%2F%5C%2Fsolo%20se%20creata%5Cn%20%20%22participants%22%3A%20%7B%5Cn%20%20%20%20%22number%22%3A%202%2C%5Cn%20%20%20%20%22data%22%3A%20%5B%5Cn%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20%20%20%20%20%20%20%20%22groups%22%3A%20%5B%22patient%22%5D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%5D%5Cn%20%20%7D%5Cn%7D%0A%0A%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3AOk%5Cn%7B%5Cn%20%20_id%3A%20**teleconsultation1-id**%5Cn%7D%0AServizio%20chiamante%3C%23green--teleconsultation-service-be%3AOk%0A%0A%3D%3DServizio%20aggiorna%20partecipanti%20room%20teleconsulto%3D%3D%0AServizio%20chiamante-%3Eteleconsultation-service-be%3APOST%20%2Fteleconsultation%2F%3Ateleconsultation-id%2Fparticipants%2Fdata%5Cn%7B%5Cn%20%20%22userId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%7D%0Aspace%0A%0A%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ARecupero%20utente%5Cncon%20receivedUserId%3D%3D**participant.userId**%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A200%0Aalt%20Utente%20esistente%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A%7B%5Cn%20bandyerId%3A%20user2-bandyer-id%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aelse%20Utente%20non%20esistente%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ADefinizione%20del%20ruolo%20Bandyer%20(basic%2C%20pluss)%20partendo%20da%5Cn**participant.groups**%2C%20consultando%20la%20configurazione%5Cndei%20gruppi%20del%20servizio%0Ateleconsultation-service-be-%3EBandyer%3APOST%20%2Fuser%2Fcreate%5Cn%7B%20%5Cn%20%20role%2C%20%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20user%3A%20%7B%5Cn%20%20%20id%3A%20user2-bandyer-id%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ASalvataggio%20utente%20teleconsulto%20in%5Cnuser%20base%5Cn%7B%5Cn%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%20%22**bandyerId**%22%3A%20%22user2-bandyer-id%22%2C%5Cn%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%7D%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3AOk%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3AGET%20%2Fteleconsultation%2F%3Ateleconsultation-id%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3A200%0Aopt%20if%20request.participants.data.length%20%3D%3D%20crudDoc.participants.number%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20tra%20i%20partecipanti%20ci%20sia%5Cnalmeno%20un%20utente%20plus%0Aalt%20Non%20c'%C3%A8%20almeno%20un%20utente%20plus%0AServizio%20chiamante%3C%23red--teleconsultation-service-be%3AKO%5CnDeve%20esserci%20almeno%20un%20partecipante%5Cndi%20tipo%20plus%0Aend%0Ateleconsultation-service-be-%3EBandyer%3ACreazione%20room%5Cn%7B%5Cn%20%20participants%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20user_id%3A%20%22user2-bandyer-id%22%2C%5Cn%20%20%20%20%20%20tools%3A%20%7B...tootls%20utente%20in%20base%20al%20gruppo...%7D%5Cn%20%20%20%20%20%20is_admin%3A%20**dipende%20dal%20gruppo%20utente**%5Cn%20%20%20%20%7D%5Cn%20%20%5D%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20%20room_id%3A%20%22room1-id%22%5Cn%20%20...%5Cn%7D%0A%0A%0A%0A%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3AUpdate%20room%20di%20teleconsulto%5Cn%7B%20%5Cn%20%20%22participants.data%22%3A%5Cn%20%20%20%20%22%24push%22%3A%20%7B%5Cn%20%20%20%20%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%20%20%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%20%20%20%20%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%20%20%7D%5Cn%20%20%7D%2C%5Cn%20%20%22room_id%22%3A%20%22room-id%22%20%5C%2F%5C%2Fsolo%20se%20creata%5Cn%7D%0A%0A%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3AOk%5Cn%7B%5Cn%20%20_id%3A%20**teleconsultation1-id**%5Cn%7D%0AServizio%20chiamante%3C%23green--teleconsultation-service-be%3AOk%0A%0A%0A%0A%0A%0A%0A%3D%3DUtente%20accede%20a%20FE%20di%20teleconsulto%3D%3D%0AUtente-%3Eteleconsultation-service-fe%3AGET%20http%3A%2F%2Fwebsite.com%2Ftelecons-fe%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%0Ateleconsultation%20adapter%3C-teleconsultation-service-fe%3ARecupera%20teleconsulto%20con%20**teleconsultation1-id**%5CnGET%20http%3A%2F%2Fwebsite.com%2Fapi%2Fv1%2Ftelecons-be%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%5Cn%5CnHeaders%3D%7B%5Cn%20miauserproperties%3A%20%7B%5Cn%20%20%20customUserId%3A%20'...'%5Cn%20%7D%5Cn%7D%0Ateleconsultation%20adapter-%3Eteleconsultation-service-be%3ARecupera%20teleconsulto%20con%20**teleconsultation1-id**%5CnGET%20%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%5Cn%5CnHeaders%3D%7B%5Cn%20miauserproperties%3A%20%7B%5Cn%20%20%20customUserId%3A%20'...'%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3ARecupero%20informazioni%20teleconsulto%20per%5Cn**teleconsultation1-id**%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3A%7B%5Cn%20%20...%2C%5Cn%20%20participants%3A%20%5B...%5D%2C%5Cn%20%20...%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20**user1-external-id**%20sia%20tra%20i%20partecipant%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ACostruisce%20il%20link%20di%20teleconsulto%20personalizzato%5Cnper%20l'utente%0Aalt%20%0Ateleconsultation-service-be--%3Eteleconsultation%20adapter%3A%7B%5Cn%20accessLinkURL%3A%20undefined%5Cn%7D%0Ateleconsultation%20adapter--%3Eteleconsultation-service-fe%3A%7B%5Cn%20accessLinkURL%3Aundefined%5Cn%7D%0Ateleconsultation-service-fe-%3Eteleconsultation-service-fe%3ACarica%20pagina%20%22sala%20d'attesa%22%0AUtente%3C-teleconsultation-service-fe%3AMostra%20pagina%20%22In%20attesa%20altri%20partecipanti%22%0Aelse%0Ateleconsultation-service-be--%3Eteleconsultation%20adapter%3A%7B%5Cn%20accessLinkURL%3A%20https%3A%2F%2Fbandyer.com%2Ftelecons%2F...%5Cn%7D%0Ateleconsultation%20adapter--%3Eteleconsultation-service-fe%3A%7B%5Cn%20accessLinkURL%3A%20https%3A%2F%2Fbandyer.com%2Ftelecons%2F...%5Cn%7D%0Ateleconsultation-service-fe-%3Eteleconsultation-service-fe%3ACarica%20iframe%0AUtente%3C-teleconsultation-service-fe%3AMostra%20iframe%20con%20teleconsulto%5Cnbandyer%0Aend%20Teleconsulto 2.0Utenteteleconsultation-service-fe(FE)teleconsultation-adapter(user defined)Servizio chiamanteteleconsultation-service-be(BE)teleconsultation-user-base(CRUD)teleconsultation-room-base(CRUD)KaleyraService config:privileges: {  basic: {    groups: [      'patient',    ],    tools: {      chat: true,      screen_sharing: true,      file_upload: true,      whiteboard: true,      snapshot: true,      live_edit: true,      live_pointer: true,      present_to_everyone: true,    },  },  plus: {    groups: [      'doctor',    ],    tools: {      chat: true,      screen_sharing: true,      file_upload: true,      whiteboard: true,      snapshot: true,      live_edit: true,      live_pointer: true,      present_to_everyone: true,    },},userIdPathInRequest: [  { from: 'object', extract: 'headers' },  { from: 'object', extract: 'miauserproperties' },  { from: 'json', extract: 'customUserId' }]Servizio crea room teleconsultoPOST /teleconsultation  "start_date": "...",   "end_date": "...",   "participants": {    "number": 2,    "data": [      {        "userId": "${FHIR_id_patient}",        "fullName": "Francesco Rossi"        "group": "patient"      }    ]  }}Recupero utentecon receivedUserId==participant.userId{ bandyerId: user1-bandyer-id}Recupero dei tools per l'utentesulla base del gruppoDefinizione del ruolo Bandyer (basic, pluss) partendo daparticipant.group, consultando la configurazionedei gruppi del servizioPOST /user/create  role}{ user: {   id: user2-bandyer-id }}Salvataggio utente teleconsulto inuser base{ receivedUserId: "${FHIR_id_patient}", bandyerId: "user1-bandyer-id", fullName: "Francesco Rossi" groups: ["patient"]}OkRecupero dei tools per l'utente10 sulla base del gruppoVerifica che tra i partecipanti ci sia11 almeno un utente plusKO12 Deve esserci almeno un partecipantedi tipo plusCreazione room13 {  participants: [    {      user_id: "user1-bandyer-id",      tools: {...tootls utente in base al gruppo...}      is_admin: dipende dal gruppo utente    }  ]}{14   room_id: "room1-id"  ...}Crea istanza di teleconsulto15   "start_date": "...",   "end_date": "...",  "room_id": "room-id" //solo se creata  "participants": {    "number": 2,    "data": [      {        "userExternalId": "${FHIR_id_patient}",        "groups": ["patient"]      }    ]  }}Ok16 {  _id: teleconsultation1-id}Ok17 Servizio aggiorna partecipanti room teleconsultoPOST /teleconsultation/:teleconsultation-id/participants/data18 {  "userId": "${FHIR_id_doctor}",  "group": "doctor",  "fullName": "Jane Doe"}Recupero utente19 con receivedUserId==participant.userId20020 {21  bandyerId: user2-bandyer-id}Recupero dei tools per l'utente22 sulla base del gruppoDefinizione del ruolo Bandyer (basic, pluss) partendo da23 participant.groups, consultando la configurazionedei gruppi del servizioPOST /user/create24   role, }{25  user: {   id: user2-bandyer-id }}Salvataggio utente teleconsulto in26 user base{  "userExternalId": "${FHIR_id_doctor}",   "bandyerId": "user2-bandyer-id",  "group": "doctor",  "fullName": "Jane Doe"}Ok27 Recupero dei tools per l'utente28 sulla base del gruppoGET /teleconsultation/:teleconsultation-id29 20030 Verifica che tra i partecipanti ci sia31 almeno un utente plusKO32 Deve esserci almeno un partecipantedi tipo plusCreazione room33 {  participants: [    {      user_id: "user2-bandyer-id",      tools: {...tootls utente in base al gruppo...}      is_admin: dipende dal gruppo utente    }  ]}{34   room_id: "room1-id"  ...}Update room di teleconsulto35   "participants.data":    "$push": {      "userExternalId": "${FHIR_id_doctor}",      "fullName": "Jane Doe"      "group": "doctor",    }  },  "room_id": "room-id" //solo se creata}Ok36 {  _id: teleconsultation1-id}Ok37 Utente accede a FE di teleconsultoGET http://website.com/telecons-fe/teleconsultation/{teleconsultation1-id}38 Recupera teleconsulto con teleconsultation1-id39 GET http://website.com/api/v1/telecons-be/teleconsultation/{teleconsultation1-id}Headers={ miauserproperties: {   customUserId: '...' }}Recupera teleconsulto con teleconsultation1-id40 GET /teleconsultation/{teleconsultation1-id}Headers={ miauserproperties: {   customUserId: '...' }}Recupero informazioni teleconsulto per41 teleconsultation1-id{42   ...,  participants: [...],  ...}Verifica che user1-external-id sia tra i partecipant43 Costruisce il link di teleconsulto personalizzato44 per l'utente{45  accessLinkURL: undefined}{46  accessLinkURL:undefined}Carica pagina "sala d'attesa"47 Mostra pagina "In attesa altri partecipanti"48 {49  accessLinkURL: https://bandyer.com/telecons/...}{50  accessLinkURL: https://bandyer.com/telecons/...}Carica iframe51 Mostra iframe con teleconsulto52 bandyerloop[Per ogni participant]alt[Utente esistente][Utente non esistente]opt[if participants.data.length == participants.number]alt[Non c'è almeno un utente plus]alt[Utente esistente][Utente non esistente]opt[if request.participants.data.length == crudDoc.participants.number]alt[Non c'è almeno un utente plus]alt \ No newline at end of file +%23%20edit%20in%20https%3A%2F%2Fsequencediagram.org%2F%0A%0Aentryspacing%201.2%0Atitle%20Teleconsulto%202.0%0A%0Aautonumber%20on%0A%0Aactor%20Utente%0Aparticipant%20%22teleconsultation-service-fe%5Cn(FE)%22%20as%20teleconsultation-service-fe%0Aparticipant%20%22teleconsultation-adapter%5Cn(user%20defined)%22%20as%20teleconsultation%20adapter%0Aparticipant%20Servizio%20chiamante%0Aparticipant%20%22teleconsultation-service-be%5Cn(BE)%22%20as%20teleconsultation-service-be%0A%0Adatabase%20%22teleconsultation-user-base%5Cn(CRUD)%22%20as%20teleconsultation-user-base%0Adatabase%20%22teleconsultation-room-base%5Cn(CRUD)%22%20as%20%22teleconsultation-room-base%22%0Aparticipant%20Bandyer%0A%0Anote%20right%20of%20teleconsultation-service-be%3AService%20config%3A%5Cnprivileges%3A%20%7B%5Cn%20%20basic%3A%20%7B%5Cn%20%20%20%20groups%3A%20%5B%5Cn%20%20%20%20%20%20'patient'%2C%5Cn%20%20%20%20%5D%2C%5Cn%20%20%20%20tools%3A%20%7B%5Cn%20%20%20%20%20%20chat%3A%20true%2C%5Cn%20%20%20%20%20%20screen_sharing%3A%20true%2C%5Cn%20%20%20%20%20%20file_upload%3A%20true%2C%5Cn%20%20%20%20%20%20whiteboard%3A%20true%2C%5Cn%20%20%20%20%20%20snapshot%3A%20true%2C%5Cn%20%20%20%20%20%20live_edit%3A%20true%2C%5Cn%20%20%20%20%20%20live_pointer%3A%20true%2C%5Cn%20%20%20%20%20%20present_to_everyone%3A%20true%2C%5Cn%20%20%20%20%7D%2C%5Cn%20%20%7D%2C%5Cn%20%20plus%3A%20%7B%5Cn%20%20%20%20groups%3A%20%5B%5Cn%20%20%20%20%20%20'doctor'%2C%5Cn%20%20%20%20%5D%2C%5Cn%20%20%20%20tools%3A%20%7B%5Cn%20%20%20%20%20%20chat%3A%20true%2C%5Cn%20%20%20%20%20%20screen_sharing%3A%20true%2C%5Cn%20%20%20%20%20%20file_upload%3A%20true%2C%5Cn%20%20%20%20%20%20whiteboard%3A%20true%2C%5Cn%20%20%20%20%20%20snapshot%3A%20true%2C%5Cn%20%20%20%20%20%20live_edit%3A%20true%2C%5Cn%20%20%20%20%20%20live_pointer%3A%20true%2C%5Cn%20%20%20%20%20%20present_to_everyone%3A%20true%2C%5Cn%20%20%20%20%7D%2C%5Cn%7D%2C%5CnuserIdPathInRequest%3A%20%5B%5Cn%20%20%7B%20from%3A%20'object'%2C%20extract%3A%20'headers'%20%7D%2C%5Cn%20%20%7B%20from%3A%20'object'%2C%20extract%3A%20'miauserproperties'%20%7D%2C%5Cn%20%20%7B%20from%3A%20'json'%2C%20extract%3A%20'customUserId'%20%7D%5Cn%5D%0A%0A%3D%3DServizio%20crea%20room%20teleconsulto%3D%3D%0AServizio%20chiamante-%3Eteleconsultation-service-be%3APOST%20%2Fteleconsultation%5Cn%7B%20%5Cn%20%20%22start_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22end_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22participants%22%3A%20%7B%5Cn%20%20%20%20%22number%22%3A%202%2C%5Cn%20%20%20%20%22data%22%3A%20%5B%5Cn%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%22userId%22%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20%20%20%20%20%20%20%20%22fullName%22%3A%20%22Francesco%20Rossi%22%5Cn%20%20%20%20%20%20%20%20%22group%22%3A%20%22patient%22%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%5D%5Cn%20%20%7D%5Cn%7D%0Aspace%0A%0A%0Aloop%20Per%20ogni%20participant%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ARecupero%20utente%5Cncon%20receivedUserId%3D%3D**participant.userId**%0Aalt%20Utente%20esistente%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A%7B%5Cn%20bandyerId%3A%20user1-bandyer-id%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aelse%20Utente%20non%20esistente%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ADefinizione%20del%20ruolo%20Bandyer%20(basic%2C%20pluss)%20partendo%20da%5Cn**participant.group**%2C%20consultando%20la%20configurazione%5Cndei%20gruppi%20del%20servizio%0Ateleconsultation-service-be-%3EBandyer%3APOST%20%2Fuser%2Fcreate%5Cn%7B%20%5Cn%20%20role%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20user%3A%20%7B%5Cn%20%20%20id%3A%20user2-bandyer-id%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ASalvataggio%20utente%20teleconsulto%20in%5Cnuser%20base%5Cn%7B%5Cn%20receivedUserId%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20**bandyerId**%3A%20%22user1-bandyer-id%22%2C%5Cn%20fullName%3A%20%22Francesco%20Rossi%22%5Cn%20groups%3A%20%5B%22patient%22%5D%5Cn%7D%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3AOk%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aend%0Aend%0Aopt%20if%20participants.data.length%20%3D%3D%20participants.number%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20tra%20i%20partecipanti%20ci%20sia%5Cnalmeno%20un%20utente%20plus%0Aalt%20Non%20c'%C3%A8%20almeno%20un%20utente%20plus%0AServizio%20chiamante%3C%23red--teleconsultation-service-be%3AKO%5CnDeve%20esserci%20almeno%20un%20partecipante%5Cndi%20tipo%20plus%0Aend%0Ateleconsultation-service-be-%3EBandyer%3ACreazione%20room%5Cn%7B%5Cn%20%20participants%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20user_id%3A%20%22user1-bandyer-id%22%2C%5Cn%20%20%20%20%20%20tools%3A%20%7B...tootls%20utente%20in%20base%20al%20gruppo...%7D%5Cn%20%20%20%20%20%20is_admin%3A%20**dipende%20dal%20gruppo%20utente**%5Cn%20%20%20%20%7D%5Cn%20%20%5D%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20%20room_id%3A%20%22room1-id%22%5Cn%20%20...%5Cn%7D%0A%0A%0A%0A%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3ACrea%20istanza%20di%20teleconsulto%5Cn%7B%20%5Cn%20%20%22start_date%22%3A%20%22...%22%2C%20%5Cn%20%20%22end_date%22%3A%20%22...%22%2C%5Cn%20%20%22room_id%22%3A%20%22room-id%22%20%5C%2F%5C%2Fsolo%20se%20creata%5Cn%20%20%22participants%22%3A%20%7B%5Cn%20%20%20%20%22number%22%3A%202%2C%5Cn%20%20%20%20%22data%22%3A%20%5B%5Cn%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_patient%7D%22%2C%5Cn%20%20%20%20%20%20%20%20%22groups%22%3A%20%5B%22patient%22%5D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%5D%5Cn%20%20%7D%5Cn%7D%0A%0A%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3AOk%5Cn%7B%5Cn%20%20_id%3A%20**teleconsultation1-id**%5Cn%7D%0AServizio%20chiamante%3C%23green--teleconsultation-service-be%3AOk%0A%0A%3D%3DServizio%20aggiorna%20partecipanti%20room%20teleconsulto%3D%3D%0AServizio%20chiamante-%3Eteleconsultation-service-be%3APOST%20%2Fteleconsultation%2F%3Ateleconsultation-id%2Fparticipants%2Fdata%5Cn%7B%5Cn%20%20%22userId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%7D%0Aspace%0A%0A%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ARecupero%20utente%5Cncon%20receivedUserId%3D%3D**participant.userId**%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A200%0Aalt%20Utente%20esistente%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3A%7B%5Cn%20bandyerId%3A%20user2-bandyer-id%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aelse%20Utente%20non%20esistente%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ADefinizione%20del%20ruolo%20Bandyer%20(basic%2C%20pluss)%20partendo%20da%5Cn**participant.groups**%2C%20consultando%20la%20configurazione%5Cndei%20gruppi%20del%20servizio%0Ateleconsultation-service-be-%3EBandyer%3APOST%20%2Fuser%2Fcreate%5Cn%7B%20%5Cn%20%20role%2C%20%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20user%3A%20%7B%5Cn%20%20%20id%3A%20user2-bandyer-id%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-user-base%3ASalvataggio%20utente%20teleconsulto%20in%5Cnuser%20base%5Cn%7B%5Cn%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%20%22**bandyerId**%22%3A%20%22user2-bandyer-id%22%2C%5Cn%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%7D%0Ateleconsultation-service-be%3C--teleconsultation-user-base%3AOk%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ARecupero%20dei%20tools%20per%20l'utente%5Cnsulla%20base%20del%20gruppo%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3AGET%20%2Fteleconsultation%2F%3Ateleconsultation-id%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3A200%0Aopt%20if%20request.participants.data.length%20%3D%3D%20crudDoc.participants.number%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20tra%20i%20partecipanti%20ci%20sia%5Cnalmeno%20un%20utente%20plus%0Aalt%20Non%20c'%C3%A8%20almeno%20un%20utente%20plus%0AServizio%20chiamante%3C%23red--teleconsultation-service-be%3AKO%5CnDeve%20esserci%20almeno%20un%20partecipante%5Cndi%20tipo%20plus%0Aend%0Ateleconsultation-service-be-%3EBandyer%3ACreazione%20room%5Cn%7B%5Cn%20%20participants%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20user_id%3A%20%22user2-bandyer-id%22%2C%5Cn%20%20%20%20%20%20tools%3A%20%7B...tootls%20utente%20in%20base%20al%20gruppo...%7D%5Cn%20%20%20%20%20%20is_admin%3A%20**dipende%20dal%20gruppo%20utente**%5Cn%20%20%20%20%7D%5Cn%20%20%5D%5Cn%7D%0Ateleconsultation-service-be%3C--Kaleyra%3A%7B%5Cn%20%20room_id%3A%20%22room1-id%22%5Cn%20%20...%5Cn%7D%0A%0A%0A%0A%0Aend%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3AUpdate%20room%20di%20teleconsulto%5Cn%7B%20%5Cn%20%20%22participants.data%22%3A%5Cn%20%20%20%20%22%24push%22%3A%20%7B%5Cn%20%20%20%20%20%20%22userExternalId%22%3A%20%22%24%7BFHIR_id_doctor%7D%22%2C%5Cn%20%20%20%20%20%20%22fullName%22%3A%20%22Jane%20Doe%22%5Cn%20%20%20%20%20%20%22group%22%3A%20%22doctor%22%2C%5Cn%20%20%20%20%7D%5Cn%20%20%7D%2C%5Cn%20%20%22room_id%22%3A%20%22room-id%22%20%5C%2F%5C%2Fsolo%20se%20creata%5Cn%7D%0A%0A%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3AOk%5Cn%7B%5Cn%20%20_id%3A%20**teleconsultation1-id**%5Cn%7D%0AServizio%20chiamante%3C%23green--teleconsultation-service-be%3AOk%0A%0A%0A%0A%0A%0A%0A%3D%3DUtente%20accede%20a%20FE%20di%20teleconsulto%3D%3D%0AUtente-%3Eteleconsultation-service-fe%3AGET%20http%3A%2F%2Fwebsite.com%2Ftelecons-fe%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%0Ateleconsultation%20adapter%3C-teleconsultation-service-fe%3ARecupera%20teleconsulto%20con%20**teleconsultation1-id**%5CnGET%20http%3A%2F%2Fwebsite.com%2Fapi%2Fv1%2Ftelecons-be%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%5Cn%5CnHeaders%3D%7B%5Cn%20miauserproperties%3A%20%7B%5Cn%20%20%20customUserId%3A%20'...'%5Cn%20%7D%5Cn%7D%0Ateleconsultation%20adapter-%3Eteleconsultation-service-be%3ARecupera%20teleconsulto%20con%20**teleconsultation1-id**%5CnGET%20%2Fteleconsultation%2F%7B**teleconsultation1-id**%7D%5Cn%5CnHeaders%3D%7B%5Cn%20miauserproperties%3A%20%7B%5Cn%20%20%20customUserId%3A%20'...'%5Cn%20%7D%5Cn%7D%0Ateleconsultation-service-be-%3E%22teleconsultation-room-base%22%3ARecupero%20informazioni%20teleconsulto%20per%5Cn**teleconsultation1-id**%0Ateleconsultation-service-be%3C--%22teleconsultation-room-base%22%3A%7B%5Cn%20%20...%2C%5Cn%20%20participants%3A%20%5B...%5D%2C%5Cn%20%20...%5Cn%7D%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3AVerifica%20che%20**user1-external-id**%20sia%20tra%20i%20partecipant%0Ateleconsultation-service-be-%3Eteleconsultation-service-be%3ACostruisce%20il%20link%20di%20teleconsulto%20personalizzato%5Cnper%20l'utente%0Aalt%20%0Ateleconsultation-service-be--%3Eteleconsultation%20adapter%3A%7B%5Cn%20accessLinkURL%3A%20undefined%5Cn%7D%0Ateleconsultation%20adapter--%3Eteleconsultation-service-fe%3A%7B%5Cn%20accessLinkURL%3Aundefined%5Cn%7D%0Ateleconsultation-service-fe-%3Eteleconsultation-service-fe%3ACarica%20pagina%20%22sala%20d'attesa%22%0AUtente%3C-teleconsultation-service-fe%3AMostra%20pagina%20%22In%20attesa%20altri%20partecipanti%22%0Aelse%0Ateleconsultation-service-be--%3Eteleconsultation%20adapter%3A%7B%5Cn%20accessLinkURL%3A%20https%3A%2F%2Fbandyer.com%2Ftelecons%2F...%5Cn%7D%0Ateleconsultation%20adapter--%3Eteleconsultation-service-fe%3A%7B%5Cn%20accessLinkURL%3A%20https%3A%2F%2Fbandyer.com%2Ftelecons%2F...%5Cn%7D%0Ateleconsultation-service-fe-%3Eteleconsultation-service-fe%3ACarica%20iframe%0AUtente%3C-teleconsultation-service-fe%3AMostra%20iframe%20con%20teleconsulto%5Cnbandyer%0Aend%20Teleconsulto 2.0Utenteteleconsultation-service-fe(FE)teleconsultation-adapter(user defined)Servizio chiamanteteleconsultation-service-be(BE)teleconsultation-user-base(CRUD)teleconsultation-room-base(CRUD)KaleyraService config:privileges: {  basic: {    groups: [      'patient',    ],    tools: {      chat: true,      screen_sharing: true,      file_upload: true,      whiteboard: true,      snapshot: true,      live_edit: true,      live_pointer: true,      present_to_everyone: true,    },  },  plus: {    groups: [      'doctor',    ],    tools: {      chat: true,      screen_sharing: true,      file_upload: true,      whiteboard: true,      snapshot: true,      live_edit: true,      live_pointer: true,      present_to_everyone: true,    },},userIdPathInRequest: [  { from: 'object', extract: 'headers' },  { from: 'object', extract: 'miauserproperties' },  { from: 'json', extract: 'customUserId' }]Servizio crea room teleconsultoPOST /teleconsultation  "start_date": "...",   "end_date": "...",   "participants": {    "number": 2,    "data": [      {        "userId": "${FHIR_id_patient}",        "fullName": "Francesco Rossi"        "group": "patient"      }    ]  }}Recupero utentecon receivedUserId==participant.userId{ bandyerId: user1-bandyer-id}Recupero dei tools per l'utentesulla base del gruppoDefinizione del ruolo Bandyer (basic, pluss) partendo daparticipant.group, consultando la configurazionedei gruppi del servizioPOST /user/create  role}{ user: {   id: user2-bandyer-id }}Salvataggio utente teleconsulto inuser base{ receivedUserId: "${FHIR_id_patient}", bandyerId: "user1-bandyer-id", fullName: "Francesco Rossi" groups: ["patient"]}OkRecupero dei tools per l'utente10 sulla base del gruppoVerifica che tra i partecipanti ci sia11 almeno un utente plusKO12 Deve esserci almeno un partecipantedi tipo plusCreazione room13 {  participants: [    {      user_id: "user1-bandyer-id",      tools: {...tootls utente in base al gruppo...}      is_admin: dipende dal gruppo utente    }  ]}{14   room_id: "room1-id"  ...}Crea istanza di teleconsulto15   "start_date": "...",   "end_date": "...",  "room_id": "room-id" //solo se creata  "participants": {    "number": 2,    "data": [      {        "userId": "${FHIR_id_patient}",        "groups": ["patient"]      }    ]  }}Ok16 {  _id: teleconsultation1-id}Ok17 Servizio aggiorna partecipanti room teleconsultoPOST /teleconsultation/:teleconsultation-id/participants/data18 {  "userId": "${FHIR_id_doctor}",  "group": "doctor",  "fullName": "Jane Doe"}Recupero utente19 con receivedUserId==participant.userId20020 {21  bandyerId: user2-bandyer-id}Recupero dei tools per l'utente22 sulla base del gruppoDefinizione del ruolo Bandyer (basic, pluss) partendo da23 participant.groups, consultando la configurazionedei gruppi del servizioPOST /user/create24   role, }{25  user: {   id: user2-bandyer-id }}Salvataggio utente teleconsulto in26 user base{  "userId": "${FHIR_id_doctor}",   "bandyerId": "user2-bandyer-id",  "group": "doctor",  "fullName": "Jane Doe"}Ok27 Recupero dei tools per l'utente28 sulla base del gruppoGET /teleconsultation/:teleconsultation-id29 20030 Verifica che tra i partecipanti ci sia31 almeno un utente plusKO32 Deve esserci almeno un partecipantedi tipo plusCreazione room33 {  participants: [    {      user_id: "user2-bandyer-id",      tools: {...tootls utente in base al gruppo...}      is_admin: dipende dal gruppo utente    }  ]}{34   room_id: "room1-id"  ...}Update room di teleconsulto35   "participants.data":    "$push": {      "userId": "${FHIR_id_doctor}",      "fullName": "Jane Doe"      "group": "doctor",    }  },  "room_id": "room-id" //solo se creata}Ok36 {  _id: teleconsultation1-id}Ok37 Utente accede a FE di teleconsultoGET http://website.com/telecons-fe/teleconsultation/{teleconsultation1-id}38 Recupera teleconsulto con teleconsultation1-id39 GET http://website.com/api/v1/telecons-be/teleconsultation/{teleconsultation1-id}Headers={ miauserproperties: {   customUserId: '...' }}Recupera teleconsulto con teleconsultation1-id40 GET /teleconsultation/{teleconsultation1-id}Headers={ miauserproperties: {   customUserId: '...' }}Recupero informazioni teleconsulto per41 teleconsultation1-id{42   ...,  participants: [...],  ...}Verifica che user1-external-id sia tra i partecipant43 Costruisce il link di teleconsulto personalizzato44 per l'utente{45  accessLinkURL: undefined}{46  accessLinkURL:undefined}Carica pagina "sala d'attesa"47 Mostra pagina "In attesa altri partecipanti"48 {49  accessLinkURL: https://bandyer.com/telecons/...}{50  accessLinkURL: https://bandyer.com/telecons/...}Carica iframe51 Mostra iframe con teleconsulto52 bandyerloop[Per ogni participant]alt[Utente esistente][Utente non esistente]opt[if participants.data.length == participants.number]alt[Non c'è almeno un utente plus]alt[Utente esistente][Utente non esistente]opt[if request.participants.data.length == crudDoc.participants.number]alt[Non c'è almeno un utente plus]alt \ No newline at end of file