Televisit

Televisits enable providers to initiate video calls with patients. They can be created using a script. For a more detailed explanation, please see Object Room.

Overview

Create televisit

return org.objects.objects
  .insertOne({
    name: 'room',
    label: 'My Televisit Room',

    // apply access control lists (optional)
    acl: [
      'account.public.read',
      'account.anonymous.read',
      'role.developer.read',
      'account.[ACL ID].read'
    ],

    // apply custom properties (optional)
    properties: [{
      name: 'c_number',
      label: 'Room Number',
      type: 'Number',
      indexed: true
    }]
  })
  .execute()

Use the following to update the televisit ACL.

const _id = '[Room ID]'
const _acl_id = '[ACL ID]'
return org.objects.rooms
  .updateOne({ _id }, {

    // Adds an additional account to the ACL
    $push: {
      acl: [
        `account.${ _acl_id }.read`
      ]
    }
  })
  .execute()

The potential televisit states are new, open, or closed. Immediately following the command to create a televisit, its state is new. Once the televisit has completed setup, it's state is set to open. A televisit is considered concluded when its state is set to closed. Once closed, a televisit cannot be reopend. If no one joins the televisit for 5 minutes after being open, its state is automatically set to closed.

To view the state of a televisit, please run the following.

const _id = '[Room ID]'
return org.objects.room.find({ _id }).next().state

To end a televisit, set its state to closed.

const _id = '[Room ID]'
return org.objects.room
  .updateOne({ _id }, {
    $set: {
      state: 'closed'
    }
  })
  .execute()

Last updated