Configuration
The Device Manager needs some configuration in order to be used effectively.
CRUD collections
To use the Device Manager you need to create the following CRUD collections:
devices
: a CRUD collection containing all past and present enrolled devices;health data type
: a CRUD containing the health data type and their schema;health data
: a CRUD containing the health records;
Devices
This CRUD collection stores all the past and currently enrolled devices, including basic product details, and tracks the patient assigned to each device.
You can create the CRUD by importing this JSON schema.
Remember to set the CRUD_DEVICES_ENDPOINT
environment variable with the CRUD internal endpoint.
Name | Type | Required | Encryption | Description |
---|---|---|---|---|
deviceId | string | true | false | Unique device identifier |
deviceProvider | string | true | false | Device prodiver (e.g. Medisanté) |
deviceType | string | true | false | Device type (medical, wearable, etc.) |
features | Array of strings | false | false | Features supported by the device |
status | string | false | false | Device status (accepted values: Active , Not Active ) |
name | string | false | false | Human-friendly device name |
assignedPatientId | string | false | false | ID of the patient the device is assigned to. If the field is missing, the device can be assigned to a patient. |
serialNumber | string | false | false | Device serial number assigned by the manufacturer |
Health Data
This CRUD collection, for each health data received from a device, the raw content and metadata (type, format, etc.) and the normalized version.
You can create the CRUD by importing this JSON schema.
Remember to set the CRUD_HEALTH_DATA_ENDPOINT
environment variable with the CRUD internal endpoint.
Name | Type | Required | Encryption | Description |
---|---|---|---|---|
deviceId | string | true | false | The ID of the device being the source of the health data |
patientId | string | false | false | The ID of the patient the health data refers to |
providerId | string | true | false | The ID of the provider of the device (e.g. Medisanté) |
rawData | Object | true | true | The original data received from the device in JSON format |
rawDataType | string | false | false | The type of the health data received from the device (e.g. blood pressure) |
rawDataFormat | string | false | false | The format of the health data received from the device (e.g. Medisanté JSON or FHIR) |
normalizedData | Object | false | true | Normalized health data |
normalizedDataType | string | false | false | The type of the health data after normalization (e.g. systolic blood pressure) |
receivedAt | Date | true | false | When the health data was received by the provider or, if not specified, by the DM itself |
recordedAt | Date | false | false | When the health data was recorded by the device |
Health Data Types
This CRUD collection contains all the health data type specifications, including the supported data types (both raw and normalized) and normalization rules (for raw only).
You can create the CRUD by importing this JSON schema.
Remember to set the CRUD_HEALTH_DATA_TYPE_ENDPOINT
environment variable with the CRUD internal endpoint.
Name | Type | Required | Encryption | Description |
---|---|---|---|---|
identifier | string | true | false | Unique identifier of the data type |
name | string | false | false | Human-friendly name of the data type |
version | string | false | false | Data type version |
providerId | string | false | false | ID of the device provider |
dataType | string | false | false | The type of the health data (e.g. blood pressure) |
format | string | false | false | The format of the health data (e.g. Medisanté JSON or FHIR) |
schema | Object | false | false | The JSON schema of the health data |
metrics | Array of strings | false | false | List of metrics collected included in a sample of the health data |
normalizedDataType | string | false | false | ID of the normalized data type |
normalizedDataSchema | Object | false | false | The JSON schema of the normalized data |
normalizationRules | Object | false | false | Normalization rules |
The service currently expects the normalizedDataSchema
to be as follows, otherwise some features like chart visualization may not work as expected:
{
"type": "object",
"properties": {
"period": {
"type": "object"
},
"observations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
},
"unit": {
"type": "string"
},
"value": {
"type": "number"
}
}
}
}
},
"required": [
"observations",
"period"
]
}
If you use a different schema the following endpoints may not work as intended:
Environment variables
Name | Required | Default | Description |
---|---|---|---|
LOG_LEVEL | No | info | |
CRUD_SERVICE_URL | Yes | http://crud-service | The HTTP(S) URL of the CRUD service |
CRUD_DEVICES_ENDPOINT | Yes | /tdm-dm-devices | Internal endpoint of the devices CRUD |
CRUD_HEALTH_DATA_ENDPOINT | Yes | /tdm-dm-health-data | Internal endpoint of the health data CRUD |
CRUD_HEALTH_DATA_TYPE_ENDPOINT | No | /tdm-dm-health-data-type | Internal endpoint of the health data types CRUD |
MONGODB_URL | Yes | - | The string to connect to MongoDB database storing information about data acquisition jobs. |
DATA_ACQUISITION_JOB_COLLECTION | Yes | dataAcquisitionJobs | The name of the MongoDB collection for data acquisition jobs. |
TMM_SERVICE_URL | Yes | http://therapy-monitoring-manager | The HTTP(S) URL of the Therapy and Monitoring Manager (TMM) service. |