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.
Contents
Use PartcipantSession.getProjectInfo
to retrieve general project information.
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:
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.
ParticipantSession.getDataCollectionSettings()
ProjectDataCollectionSettings
QueryableDeviceDataType
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.
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: