Introduction
The API sandbox (in the menu bar at the top of this page) allows you to test the raw HTTP REST API against a live server to see how to work with the low-level API itself. If you're interested in working in R, Python, or JS, we recommend you try out our programming libraries instead.
LAMP Protocol
The LAMP Protocol
, or Application Programming Interface (API), is the formalized inter-component language used by any app or tool connecting to the LAMP Platform
. It consists of major "surfaces" that describe types of data, actions that may be performed on these types of data, and access and manipulation control of these data. These "surfaces" are designed to be compatible with the Health Level 7 (HL7) organization's Fast Healthcare Interoperability Resources (FHIR) standard resources as well as compliant with the Health Insurance Portability and Accountability Act (HIPAA).
A schema (data blueprint) presented below for each type of data in relation to other types, along with a description of the properties and actions available. The use of JSON Schema
at build-time codifies these schema using sets of validation rules and declared links between types and properties. Furthermore, the Spec data types use JSON Schema
at run-time to constrain data from different device sensors or activity interfaces dynamically.
Object Model
ActivitySpec
: (global) a representation of an interactive user interface that can be presented toParticipant
s.SensorSpec
: (global) a representation of a physical hardware sensor that can be used to passively collect data on a device owned by aParticipant
.Researcher
: encapsulates access and control of multipleStudies
.Study
: encapsulates the assignment ofActivities
andSensors
toParticipants
.Activity
: activates, configures, and optionally schedules, an interactive activity for theParticipant
to use, and optionally, receive notifications for.Sensor
: activates and configures a hardware sensor on theParticipant
's physical device for sensor data collection.Participant
: encapsulates the storage and retrieval ofActivityEvent
andSensorEvent
data streams.ActivityEvent
: a chronologically ordered timestamp-indexed packet of data synthesized from theParticipant
's interaction session with anActivity
, containing temporal slices representative of each tap or action within the session.Note:
this object is owned both by theParticipant
AND theActivity
, and so it is possible to query the data either cross-Activity
for a specificParticipant
OR
cross-Participant
for a specificActivity
.
SensorEvent
: a chronologically ordered timestamp-indexed packet of data synthesized by hardware sensors on a physical device being used byParticipant
.Note:
this object is owned both by theParticipant
AND theSensor
, and so it is possible to query the data either cross-Sensor
for a specificParticipant
OR
cross-Participant
for a specificSensor
.
Each of the above data types also support the below associated data types:
Type
: (any of the data types above)Credential
: a security credential granting authorization to read and write to this specific object and any of its children, with which all data read/write operations are appended to a global audit log.Device
: a specifically identified physical hardware device, console, or browser that represents the origin of a read/write operation in the global audit log.
Tag
: any arbitrary key-value indexed data, either represented as a JSON object (with or without an associatedJSON Schema
), or as a data-url encoded string.
Though the above hierarchy is described in terms of object composition, that is, in a manner similar to files recursively nested within several folders, it is important to distinguish and describe a form of object inheritance used by Spec/*/Event
data types.
ActivitySpec
/SensorSpec
: similar to apps on an App Store, the Spec object describes the schema for input (configuration) and output (data) for an interactive activity or a hardware sensor.Activity
/Sensor
: this object can be thought of as an 'instance' of a Spec object assigned within aStudy
, with a specific name, icon, schedule, customized parameters, and more.ActivityEvent
/SensorEvent
: represents an 'event' as part of a time series event stream recorded by theActivity
orSensor
.
Using the SDK
To follow along with the sample code provided in this document, install the appropriate SDK. Currently, we officially support the following:
JavaScript
npm i lamp-core
Python
pip install LAMP-core
R
R -e 'install.packages("devtools"); devtools::install_github("BIDMCDigitalPsychiatry/LAMP-r")'