Skip to main content
Version: 14.x

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.

tip

You can create the CRUD by importing this JSON schema. Remember to set the CRUD_DEVICES_ENDPOINT environment variable with the CRUD internal endpoint.

NameTypeRequiredEncryptionDescription
deviceIdstringtruefalseUnique device identifier
deviceProviderstringtruefalseDevice prodiver (e.g. Medisanté)
deviceTypestringtruefalseDevice type (medical, wearable, etc.)
featuresArray of stringsfalsefalseFeatures supported by the device
statusstringfalsefalseDevice status (accepted values: Active, Not Active)
namestringfalsefalseHuman-friendly device name
assignedPatientIdstringfalsefalseID of the patient the device is assigned to. If the field is missing, the device can be assigned to a patient.
serialNumberstringfalsefalseDevice 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.

tip

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.

NameTypeRequiredEncryptionDescription
deviceIdstringtruefalseThe ID of the device being the source of the health data
patientIdstringfalsefalseThe ID of the patient the health data refers to
providerIdstringtruefalseThe ID of the provider of the device (e.g. Medisanté)
rawDataObjecttruetrueThe original data received from the device in JSON format
rawDataTypestringfalsefalseThe type of the health data received from the device (e.g. blood pressure)
rawDataFormatstringfalsefalseThe format of the health data received from the device (e.g. Medisanté JSON or FHIR)
normalizedDataObjectfalsetrueNormalized health data
normalizedDataTypestringfalsefalseThe type of the health data after normalization (e.g. systolic blood pressure)
receivedAtDatetruefalseWhen the health data was received by the provider or, if not specified, by the DM itself
recordedAtDatefalsefalseWhen 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).

tip

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.

NameTypeRequiredEncryptionDescription
identifierstringtruefalseUnique identifier of the data type
codestringfalsefalseMachine-friendly code for the data type (like LOINC or SNOMED CT)
namestringfalsefalseHuman-friendly name of the data type
versionstringfalsefalseData type version
providerIdstringfalsefalseID of the device provider
dataTypestringfalsefalseThe type of the health data (e.g. blood pressure)
formatstringfalsefalseThe format of the health data (e.g. Medisanté JSON or FHIR)
schemaObjectfalsefalseThe JSON schema of the health data
metricsArray of stringsfalsefalseList of metrics collected included in a sample of the health data
normalizedDataTypestringfalsefalseID of the normalized data type
normalizedDataSchemaObjectfalsefalseThe JSON schema of the normalized data
normalizationRulesObjectfalsefalseNormalization rules
danger

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

NameRequiredDefaultDescription
LOG_LEVELNoinfoLogging level.
HTTP_PORTNo3000The port on which the HTTP server will listen.
USERID_HEADER_KEYNomiauseridHTTP header key used to identify the user ID.
GROUPS_HEADER_KEYNomiausergroupsHTTP header key for user groups.
CLIENTTYPE_HEADER_KEYNoclienttypeHTTP header key for client type.
BACKOFFICE_HEADER_KEYNoisbackofficeHTTP header key to indicate if the request is from backoffice.
MICROSERVICE_GATEWAY_SERVICE_NAMENomicroservicegatewayName of the microservice gateway service.
USER_PROPERTIES_HEADER_KEYNomiauserpropertiesHTTP header key for additional user properties.
CRUD_SERVICE_URLYeshttp//crud-serviceThe HTTP(S) URL of the CRUD service.
CRUD_DEVICES_ENDPOINTYes/tdm-dm-devicesInternal endpoint of the devices CRUD
CRUD_HEALTH_DATA_ENDPOINTYes/tdm-dm-health-dataInternal endpoint of the health data CRUD
CRUD_HEALTH_DATA_TYPE_ENDPOINTYes/tdm-dm-health-data-typeInternal endpoint of the health data types CRUD
TMM_SERVICE_URLYeshttp//therapy-monitoring-managerURL of the Therapy Monitoring Manager (TMM)service.
TMM_MONITORINGS_ENDPOINTNo/monitoringsInternal endpoint of the TMM monitorings service.
TMM_DETECTIONS_ENDPOINTNo/detectionsInternal endpoint of the TMM detections.
TMM_PROTOTYPES_ENDPOINTNo/prototypesInternal endpoint of the TMM prototypes.
MEDISANTE_PROVIDERNomedisanteIdentifier for the Medisante data provider.
HEALTHKIT_PROVIDERNohealthkitIdentifier for the HealthKit data provider.
STANDARD_JSON_MEDISANTENomedisantestandard-jsonIdentifier for the standard JSON format from Medisante.
STANDARD_JSON_HEALTHKITNohealthkitstandard-jsonIdentifier for the standard JSON format from HealthKit.
MONGODB_URLYes-The string to connect to MongoDB database storing information about data acquisition jobs.
DATA_ACQUISITION_JOB_COLLECTIONYesdataAcquisitionJobsThe name of the MongoDB collection for data acquisition jobs.