Building a RPM devices bot

In this guide you will see how you can build your own bot to provide organizations the ability to order your devices directly from within DocsInk.

Configuring your bot

To be able to write vitals and other readings into a patient's profile, the following scope must be selected for your client application:

  • clinical-write`

When a device order is created, DocsInk will POST an order event notification to the registered webhook url set in the app settings. In addition, your application bot must be activated and subscribed to the following events:

  • device_order_created
  • device_order_updated
  • device_order_deleted

Import device catalog

Next is to add your catalog of devices into the DocsInk organization. Added devices are visible throughout the DocsInk application and are linked to one or more metric types indicating to users which types of information can be collected.

Devices are managed using the /rpm/devices endpoint of the DocsInk Client API. See Bot Tokens for more information about obtaining a bot access token.

Linking devices to a RPM program

Typically this step is performed by a user within the DocsInk organization installing the bot.

Now that the devices have been imported, they can be associated with the RPM programs in the organization. To do this, we'll navigate to the RPM Builder.

Create new or edit an existing RPM program. Users are able to associate devices to the program in two different ways.

First method is at the bottom of the page under the "Devices" section. The list of devices shown in this section are all available options created in the organization. Users select their desired devices for the program.

The second method is inline with the assigned tracked items. Tracked items are the different metric reading types that the program is monitoring. These include blood pressure, oxygen saturation, and many more.

Adding devices inline with a metric type will filter the list of devices in the organization to those that support the selected metric type. This allows organizations to specifically assign devices based on metric types. All devices added inline are also displayed at the bottom for easy review.

Device ordering

When a patient is assigned to a RPM program, DocsInk will lookup the devices associated with the program and create orders for the devices automatically.

Users can view the device orders that have been placed directly within DocsInk.

All device status changes trigger notifications to be sent to subscribed bots. The notification payload will include the ordering information such as order number, device details, patient information, etc. Extra API calls may be necessary to retrieve additional information regarding the order.

// Example device order created notification
{
    "app_uuid": 314180500,
    "org_uuid": 568691045,
    "event_name": "device_order_created",
    "event_time": "2021-02-12T21:46:22+00:00",
    "payload": {
        "updated_at": "2021-02-12T21:46:16+00:00",
        "created_at": "2021-02-12T21:46:16+00:00",
        "uuid": 1693145160,
        "patient_uuid": 325278339,
        "user_uuid": 324904135,
        "bot_uuid": null,
        "device_uuid": 309440735,
        "patient_rpm_program_uuid": 676991425
    }
}

Writing readings to a patients chart

Metric readings can be added to a patients chart using the /rpm/metrics endpoint of the DocsInk Client API. See Bot Tokens for more information about obtaining a bot access token.