Project Settings

In MyDataHelps, a project represents the whole set of participants and all of the points of interaction with those participants. All MyDataHelps interfaces are project-specific, and SDK operations use the project associated with the participant’s access token.

See the data overview for more information about projects.

Get Project Info

Use PartcipantSession.getProjectInfo to retrieve general project information.

SDK Reference

Examples

Retrieving Project Info
let projectInfo = try await session.getProjectInfo()
print("You're enrolled in \(projectInfo.name).")
let projectInfo = try await session.getProjectInfo() print("You're enrolled in \(projectInfo.name).")

In the MyDataHelpsKit example app, see:


Get Data Collection Settings

Use PartcipantSession.getDataCollectionSettings to retrieve settings related to data collection for the participant and their project.

This allows dynamically controlling available features in your app based on project configuration, such as Electronic Health Record data collection.

SDK Reference

Examples

Retrieving Data Collection Settings
let settings = try await session.getDataCollectionSettings()
if settings.ehrEnabled {
    print("EHR data collection is enabled for this project.")
}
let settings = try await session.getDataCollectionSettings() if settings.ehrEnabled { print("EHR data collection is enabled for this project.") }

During app development, the queryableDeviceDataTypes property is useful for determining the exact namespace and type values to use for constructing device data queries; see Device Data for more info. You can use the following code listing in a debugger or playground to produce a list of all queryable data types for constructing DeviceDataQueries.

Exploring Device Data Types
for dataType in settings.queryableDeviceDataTypes {
    print("namespace: \(dataType.namespace), type: \(dataType.type)")
    // Example query for this data type:
    // let criteria = DeviceDataQuery(namespace: dataType.namespace, types: Set([dataType.type]))
}
for dataType in settings.queryableDeviceDataTypes { print("namespace: \(dataType.namespace), type: \(dataType.type)") // Example query for this data type: // let criteria = DeviceDataQuery(namespace: dataType.namespace, types: Set([dataType.type])) }

In the MyDataHelpsKit example app, see:

  • Account/AccountView.swift: EHR feature demos are controlled by the project's configuration.
  • Data/DataView.swift: SensorDataSectionView on the Data tab lists all available device data types with drilldown views to query for data of each type.