The “Sampling Package” and “Data Transformer” Software Patterns in CAMS

In a recent paper [1], we have documented the “Sampling Package” and “Data Transformer” software patterns used in CAMS. The patterns are core to CAMS and are the enablers of the high extensibility of the framework and its support for multiple data formats, including the new Open mHealth format.

The paper argues that most existing mobile sensing platforms only support a fixed set of mobile phone and wearable sensors which are ‘built into’ the platform’s generic ‘study app’ and this creates some fundamental challenges for the creation and approval of application-specific mobile sensing studies, since there is little support for adapting the sensing capabilities to what is needed for a specific study. Moreover, most existing platforms use their own proprietary data formats and there is no standardization in how data are collected and in what formats. This poses some fundamental challenges to realizing the vision of using mobile sensing in health applications, since mobile sensing data collected across different phones and studies cannot be compared, thus hampering generalizability and reproducibility across studies.

The paper presents two software architecture patterns enabling (i) dynamic extension of mobile sensing to incorporate new sensing capabilities, such as collecting data from a wearable sensor, and (ii) handling real-time transformation of data into standardized data formats. These software patterns are part of CAMS.

This paper shows how the framework uses the two software architecture patterns to add sampling support for an electrocardiography (ECG) device and support data transformation into the new Open mHealth (OMH) data format.

For example, Figure 1 in the paper illustrates the “Sampling Package” pattern and shows how classes are implemented (specialized) as part of the MovisensSamplingPackage, which collects data from the Movisens EcgMove4 wearable movement and ECG monitor.

The paper also presents data from a small study, demonstrating the robustness and feasibility of using CAMS for data collection and transformation in mobile sensing. Figure 8 shows the number of collected data types on an hourly basis over a 50 hour period. Looking at the distribution of the total number of collected data, we can observe that 11 different types of data were collected with a wide variety over the 50 hour period, reflecting differences in activity level and circadian rhythms. Of these 11 types of data, OMH only supports location (named geoposition) and activity (named psychical-activity), but we see that the collected data were correctly transformed into these two types. Of all data, 42% are of type geoposition and 6% are of type psychical-activity. The rest of the data are kept in the default dk.cachet.carp name space.


  1. Bardram, J. E. (2022). Software Architecture Patterns for Extending Sensing Capabilities and Data Formatting in Mobile Sensing. Sensors22(7), 2813.